diff --git a/MAINTAINERS b/MAINTAINERS index 4bab36bfdf9..59873f6804c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -223,6 +223,7 @@ F: dlls/winegstreamer/mfplat.c F: dlls/winegstreamer/resampler.c F: dlls/winegstreamer/video_decoder.c F: dlls/winegstreamer/video_processor.c +F: dlls/winegstreamer/wg_source.c F: dlls/winegstreamer/wg_sample.c F: dlls/winegstreamer/wg_transform.c F: dlls/winegstreamer/wma_decoder.c diff --git a/README.esync b/README.esync new file mode 100644 index 00000000000..6520f2da564 --- /dev/null +++ b/README.esync @@ -0,0 +1,196 @@ +This is eventfd-based synchronization, or 'esync' for short. Turn it on with +WINEESYNC=1; debug it with +esync. + +== BUGS AND LIMITATIONS == + +Please let me know if you find any bugs. If you can, also attach a log with ++seh,+pid,+esync,+server,+timestamp. + +If you get something like "eventfd: Too many open files" and then things start +crashing, you've probably run out of file descriptors. esync creates one +eventfd descriptor for each synchronization object, and some games may use a +large number of these. Linux by default limits a process to 4096 file +descriptors, which probably was reasonable back in the nineties but isn't +really anymore. (Fortunately Debian and derivatives [Ubuntu, Mint] already +have a reasonable limit.) To raise the limit you'll want to edit +/etc/security/limits.conf and add a line like + +* hard nofile 1048576 + +then restart your session. + +On distributions using systemd, the settings in `/etc/security/limits.conf` +will be overridden by systemd's own settings. If you run `ulimit -Hn` and it +returns a lower number than the one you've previously set, then you can set + +DefaultLimitNOFILE=1024:1048576 + +in both `/etc/systemd/system.conf` and `/etc/systemd/user.conf`. You can then +execute `sudo systemctl daemon-reexec` and restart your session. Check again +with `ulimit -Hn` that the limit is correct. + +Also note that if the wineserver has esync active, all clients also must, and +vice versa. Otherwise things will probably crash quite badly. + +== EXPLANATION == + +The aim is to execute all synchronization operations in "user-space", that is, +without going through wineserver. We do this using Linux's eventfd +facility. The main impetus to using eventfd is so that we can poll multiple +objects at once; in particular we can't do this with futexes, or pthread +semaphores, or the like. The only way I know of to wait on any of multiple +objects is to use select/poll/epoll to wait on multiple fds, and eventfd gives +us those fds in a quite usable way. + +Whenever a semaphore, event, or mutex is created, we have the server, instead +of creating a traditional server-side event/semaphore/mutex, instead create an +'esync' primitive. These live in esync.c and are very slim objects; in fact, +they don't even know what type of primitive they are. The server is involved +at all because we still need a way of creating named objects, passing handles +to another process, etc. + +The server creates an eventfd file descriptor with the requested parameters +and passes it back to ntdll. ntdll creates an object of the appropriate type, +then caches it in a table. This table is copied almost wholesale from the fd +cache code in server.c. + +Specific operations follow quite straightforwardly from eventfd: + +* To release an object, or set an event, we simply write() to it. +* An object is signalled if read() succeeds on it. Notably, we create all + eventfd descriptors with O_NONBLOCK, so that we can atomically check if an + object is signalled and grab it if it is. This also lets us reset events. +* For objects whose state should not be reset upon waiting—e.g. manual-reset + events—we simply check for the POLLIN flag instead of reading. +* Semaphores are handled by the EFD_SEMAPHORE flag. This matches up quite well + (although with some difficulties; see below). +* Mutexes store their owner thread locally. This isn't reliable information if + a different process's thread owns the mutex, but this doesn't matter—a + thread should only care whether it owns the mutex, so it knows whether to + try waiting on it or simply to increase the recursion count. + +The interesting part about esync is that (almost) all waits happen in ntdll, +including those on server-bound objects. The idea here is that on the server +side, for any waitable object, we create an eventfd file descriptor (not an +esync primitive), and then pass it to ntdll if the program tries to wait on +it. These are cached too, so only the first wait will require a round trip to +the server. Then the server signals the file descriptor as appropriate, and +thereby wakes up the client. So far this is implemented for processes, +threads, message queues (difficult; see below), and device managers (necessary +for drivers to work). All of these are necessarily server-bound, so we +wouldn't really gain anything by signalling on the client side instead. Of +course, except possibly for message queues, it's not likely that any program +(cutting-edge D3D game or not) is going to be causing a great wineserver load +by waiting on any of these objects; the motivation was rather to provide a way +to wait on ntdll-bound and server-bound objects at the same time. + +Some cases are still passed to the server, and there's probably no reason not +to keep them that way. Those that I noticed while testing include: async +objects, which are internal to the file APIs and never exposed to userspace, +startup_info objects, which are internal to the loader and signalled when a +process starts, and keyed events, which are exposed through an ntdll API +(although not through kernel32) but can't be mixed with other objects (you +have to use NtWaitForKeyedEvent()). Other cases include: named pipes, debug +events, sockets, and timers. It's unlikely we'll want to optimize debug events +or sockets (or any of the other, rather rare, objects), but it is possible +we'll want to optimize named pipes or timers. + +There were two sort of complications when working out the above. The first one +was events. The trouble is that (1) the server actually creates some events by +itself and (2) the server sometimes manipulates events passed by the +client. Resolving the first case was easy enough, and merely entailed creating +eventfd descriptors for the events the same way as for processes and threads +(note that we don't really lose anything this way; the events include +"LowMemoryCondition" and the event that signals system processes to shut +down). For the second case I basically had to hook the server-side event +functions to redirect to esync versions if the event was actually an esync +primitive. + +The second complication was message queues. The difficulty here is that X11 +signals events by writing into a pipe (at least I think it's a pipe?), and so +as a result wineserver has to poll on that descriptor. In theory we could just +let wineserver do so and then signal us as appropriate, except that wineserver +only polls on the pipe when the thread is waiting for events (otherwise we'd +get e.g. keyboard input while the thread is doing something else, and spin +forever trying to wake up a thread that doesn't care). The obvious solution is +just to poll on that fd ourselves, and that's what I did—it's just that +getting the fd from wineserver was kind of ugly, and the code for waiting was +also kind of ugly basically because we have to wait on both X11's fd and the +"normal" process/thread-style wineserver fd that we use to signal sent +messages. The upshot about the whole thing was that races are basically +impossible, since a thread can only wait on its own queue. + +System APCs already work, since the server will forcibly suspend a thread if +it's not already waiting, and so we just need to check for EINTR from +poll(). User APCs and alertable waits are implemented in a similar style to +message queues (well, sort of): whenever someone executes an alertable wait, +we add an additional eventfd to the list, which the server signals when an APC +arrives. If that eventfd gets signaled, we hand it off to the server to take +care of, and return STATUS_USER_APC. + +Originally I kept the volatile state of semaphores and mutexes inside a +variable local to the handle, with the knowledge that this would break if +someone tried to open the handle elsewhere or duplicate it. It did, and so now +this state is stored inside shared memory. This is of the POSIX variety, is +allocated by the server (but never mapped there) and lives under the path +"/wine-esync". + +There are a couple things that this infrastructure can't handle, although +surprisingly there aren't that many. In particular: +* Implementing wait-all, i.e. WaitForMultipleObjects(..., TRUE, ...), is not + exactly possible the way we'd like it to be possible. In theory that + function should wait until it knows all objects are available, then grab + them all at once atomically. The server (like the kernel) can do this + because the server is single-threaded and can't race with itself. We can't + do this in ntdll, though. The approach I've taken I've laid out in great + detail in the relevant patch, but for a quick summary we poll on each object + until it's signaled (but don't grab it), check them all again, and if + they're all signaled we try to grab them all at once in a tight loop, and if + we fail on any of them we reset the count on whatever we shouldn't have + consumed. Such a blip would necessarily be very quick. +* The whole patchset only works on Linux, where eventfd is available. However, + it should be possible to make it work on a Mac, since eventfd is just a + quicker, easier way to use pipes (i.e. instead of writing 1 to the fd you'd + write 1 byte; instead of reading a 64-bit value from the fd you'd read as + many bytes as you can carry, which is admittedly less than 2**64 but + can probably be something reasonable.) It's also possible, although I + haven't yet looked, to use some different kind of synchronization + primitives, but pipes would be easiest to tack onto this framework. +* PulseEvent() can't work the way it's supposed to work. Fortunately it's rare + and deprecated. It's also explicitly mentioned on MSDN that a thread can + miss the notification for a kernel APC, so in a sense we're not necessarily + doing anything wrong. + +There are some things that are perfectly implementable but that I just haven't +done yet: +* Other synchronizable server primitives. It's unlikely we'll need any of + these, except perhaps named pipes (which would honestly be rather difficult) + and (maybe) timers. +* Access masks. We'd need to store these inside ntdll, and validate them when + someone tries to execute esync operations. + +This patchset was inspired by Daniel Santos' "hybrid synchronization" +patchset. My idea was to create a framework whereby even contended waits could +be executed in userspace, eliminating a lot of the complexity that his +synchronization primitives used. I do however owe some significant gratitude +toward him for setting me on the right path. + +I've tried to maximize code separation, both to make any potential rebases +easier and to ensure that esync is only active when configured. All code in +existing source files is guarded with "if (do_esync())", and generally that +condition is followed by "return esync_version_of_this_method(...);", where +the latter lives in esync.c and is declared in esync.h. I've also tried to +make the patchset very clear and readable—to write it as if I were going to +submit it upstream. (Some intermediate patches do break things, which Wine is +generally against, but I think it's for the better in this case.) I have cut +some corners, though; there is some error checking missing, or implicit +assumptions that the program is behaving correctly. + +I've tried to be careful about races. There are a lot of comments whose +purpose are basically to assure me that races are impossible. In most cases we +don't have to worry about races since all of the low-level synchronization is +done by the kernel. + +Anyway, yeah, this is esync. Use it if you like. + +--Zebediah Figura diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000000..afd4a144aad --- /dev/null +++ b/autogen.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +tools/make_requests +dlls/winevulkan/make_vulkan -x vk.xml +autoreconf -ifv +rm -rf autom4te.cache + +echo "Now run ./configure" diff --git a/configure b/configure deleted file mode 100755 index e30aed5f408..00000000000 --- a/configure +++ /dev/null @@ -1,24267 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for Wine 9.0. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, -# Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : - -else \$as_nop - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : - as_have_required=yes -else $as_nop - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : - -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : - break 2 -fi -fi - done;; - esac - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi - - - if test "x$CONFIG_SHELL" != x -then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." - else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and -$0: wine-devel@winehq.org about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='Wine' -PACKAGE_TARNAME='wine' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='Wine 9.0' -PACKAGE_BUGREPORT='wine-devel@winehq.org' -PACKAGE_URL='https://www.winehq.org' - -ac_unique_file="server/atom.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_c_list= -ac_subst_vars='LTLIBOBJS -LIBOBJS -TAGSFLAGS -RT_LIBS -WINELOADER_PROGRAMS -DELAYLOADFLAG -MSVCRTFLAGS -NETAPI_LIBS -NETAPI_CFLAGS -PROCSTAT_LIBS -GSSAPI_LIBS -GSSAPI_CFLAGS -KRB5_LIBS -KRB5_CFLAGS -FONTCONFIG_LIBS -FONTCONFIG_CFLAGS -CUPS_LIBS -CUPS_CFLAGS -CAPI20_LIBS -CAPI20_CFLAGS -SDL2_LIBS -SDL2_CFLAGS -UNWIND_LIBS -UNWIND_CFLAGS -UDEV_LIBS -UDEV_CFLAGS -OSS4_LIBS -OSS4_CFLAGS -ALSA_LIBS -GSTREAMER_LIBS -GSTREAMER_CFLAGS -PULSE_LIBS -PULSE_CFLAGS -GETTEXTPO_LIBS -FREETYPE_LIBS -FREETYPE_CFLAGS -RESOLV_LIBS -GPHOTO2_PORT_LIBS -GPHOTO2_PORT_CFLAGS -GPHOTO2_LIBS -GPHOTO2_CFLAGS -USB_LIBS -USB_CFLAGS -SANE_LIBS -SANE_CFLAGS -GNUTLS_LIBS -GNUTLS_CFLAGS -DBUS_LIBS -DBUS_CFLAGS -INOTIFY_LIBS -INOTIFY_CFLAGS -PCSCLITE_LIBS -PCAP_LIBS -XKBREGISTRY_LIBS -XKBREGISTRY_CFLAGS -XKBCOMMON_LIBS -XKBCOMMON_CFLAGS -WAYLAND_SCANNER -WAYLAND_CLIENT_LIBS -WAYLAND_CLIENT_CFLAGS -X_EXTRA_LIBS -X_LIBS -X_PRE_LIBS -X_CFLAGS -CPP -XMKMF -PTHREAD_LIBS -ZYDIS_PE_LIBS -ZYDIS_PE_CFLAGS -ZLIB_PE_LIBS -ZLIB_PE_CFLAGS -XSLT_PE_LIBS -XSLT_PE_CFLAGS -XML2_PE_LIBS -XML2_PE_CFLAGS -VKD3D_PE_LIBS -VKD3D_PE_CFLAGS -TIFF_PE_LIBS -TIFF_PE_CFLAGS -PNG_PE_LIBS -PNG_PE_CFLAGS -MUSL_PE_LIBS -MUSL_PE_CFLAGS -MPG123_PE_LIBS -MPG123_PE_CFLAGS -LDAP_PE_LIBS -LDAP_PE_CFLAGS -LCMS2_PE_LIBS -LCMS2_PE_CFLAGS -JXR_PE_LIBS -JXR_PE_CFLAGS -JPEG_PE_LIBS -JPEG_PE_CFLAGS -GSM_PE_LIBS -GSM_PE_CFLAGS -FLUIDSYNTH_PE_LIBS -FLUIDSYNTH_PE_CFLAGS -FAUDIO_PE_LIBS -FAUDIO_PE_CFLAGS -MINGW_PKG_CONFIG -PE_ARCHS -WINELOADER_DEPENDS -ac_ct_OBJC -OBJCFLAGS -OBJC -OPENCL_LIBS -COREAUDIO_LIBS -SYSTEMCONFIGURATION_LIBS -SECURITY_LIBS -APPKIT_LIBS -CORESERVICES_LIBS -APPLICATIONSERVICES_LIBS -METAL_LIBS -IOKIT_LIBS -DISKARBITRATION_LIBS -COREFOUNDATION_LIBS -CARBON_LIBS -CONFIGURE_TARGETS -DISABLED_SUBDIRS -SUBDIRS -READELF -OTOOL -LDD -DLLEXT -WINEPRELOADER_LDFLAGS -WINELOADER_LDFLAGS -TOP_INSTALL_DEV -TOP_INSTALL_LIB -UNIXLDFLAGS -UNIXDLLFLAGS -EXTRACFLAGS -LDEXECFLAGS -LDDLLFLAGS -DLLFLAGS -OPENGL_LIBS -I386_LIBS -ICOTOOL -CONVERT -RSVG -FONTFORGE -PKG_CONFIG -MSGFMT -LDCONFIG -EGREP -GREP -LN_S -RANLIB -STRIP -ac_ct_AR -AR -BISON -FLEX -SED_CMD -RUNTESTFLAGS -MAKEDEP -toolsdir -x86_64_DISABLED_SUBDIRS -x86_64_DELAYLOADFLAG -x86_64_TARGET -x86_64_DEBUG -x86_64_LDFLAGS -x86_64_EXTRACFLAGS -x86_64_CFLAGS -x86_64_CC -i386_DISABLED_SUBDIRS -i386_DELAYLOADFLAG -i386_TARGET -i386_DEBUG -i386_LDFLAGS -i386_EXTRACFLAGS -i386_CFLAGS -i386_CC -arm64ec_DISABLED_SUBDIRS -arm64ec_DELAYLOADFLAG -arm64ec_TARGET -arm64ec_DEBUG -arm64ec_LDFLAGS -arm64ec_EXTRACFLAGS -arm64ec_CFLAGS -arm64ec_CC -arm_DISABLED_SUBDIRS -arm_DELAYLOADFLAG -arm_TARGET -arm_DEBUG -arm_LDFLAGS -arm_EXTRACFLAGS -arm_CFLAGS -arm_CC -aarch64_DISABLED_SUBDIRS -aarch64_DELAYLOADFLAG -aarch64_TARGET -aarch64_DEBUG -aarch64_LDFLAGS -aarch64_EXTRACFLAGS -aarch64_CFLAGS -aarch64_CC -HOST_ARCH -toolsext -TARGETFLAGS -LD -CPPBIN -ac_ct_CXX -CXXFLAGS -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -SET_MAKE -srcdir -nlsdir -fontdir -dlldir -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -system_dllpath -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_archs -enable_win16 -enable_win64 -enable_tests -enable_build_id -enable_maintainer_mode -enable_silent_rules -enable_werror -with_alsa -with_capi -with_coreaudio -with_cups -with_dbus -with_float_abi -with_fontconfig -with_freetype -with_gettext -with_gettextpo -with_gphoto -with_gnutls -with_gssapi -with_gstreamer -with_inotify -with_krb5 -with_mingw -with_netapi -with_opencl -with_opengl -with_osmesa -with_oss -with_pcap -with_pcsclite -with_pthread -with_pulse -with_sane -with_sdl -with_udev -with_unwind -with_usb -with_v4l2 -with_vulkan -with_wayland -with_xcomposite -with_xcursor -with_xfixes -with_xinerama -with_xinput -with_xinput2 -with_xrandr -with_xrender -with_xshape -with_xshm -with_xxf86vm -with_system_dllpath -with_wine_tools -with_wine64 -enable_largefile -with_x -enable_acledit -enable_aclui -enable_activeds_tlb -enable_activeds -enable_actxprxy -enable_adsldp -enable_adsldpc -enable_advapi32 -enable_advpack -enable_amsi -enable_amstream -enable_apisetschema -enable_apphelp -enable_appwiz_cpl -enable_appxdeploymentclient -enable_atl -enable_atl100 -enable_atl110 -enable_atl80 -enable_atl90 -enable_atlthunk -enable_atmlib -enable_authz -enable_avicap32 -enable_avifil32 -enable_avrt -enable_bcrypt -enable_bcryptprimitives -enable_bluetoothapis -enable_browseui -enable_bthprops_cpl -enable_cabinet -enable_capi2032 -enable_cards -enable_cdosys -enable_cfgmgr32 -enable_clusapi -enable_cng_sys -enable_combase -enable_comcat -enable_comctl32 -enable_comdlg32 -enable_coml2 -enable_compstui -enable_comsvcs -enable_concrt140 -enable_connect -enable_credui -enable_crtdll -enable_crypt32 -enable_cryptdlg -enable_cryptdll -enable_cryptext -enable_cryptnet -enable_cryptowinrt -enable_cryptsp -enable_cryptui -enable_ctapi32 -enable_ctl3d32 -enable_d2d1 -enable_d3d10 -enable_d3d10_1 -enable_d3d10core -enable_d3d11 -enable_d3d12 -enable_d3d12core -enable_d3d8 -enable_d3d8thk -enable_d3d9 -enable_d3dcompiler_33 -enable_d3dcompiler_34 -enable_d3dcompiler_35 -enable_d3dcompiler_36 -enable_d3dcompiler_37 -enable_d3dcompiler_38 -enable_d3dcompiler_39 -enable_d3dcompiler_40 -enable_d3dcompiler_41 -enable_d3dcompiler_42 -enable_d3dcompiler_43 -enable_d3dcompiler_46 -enable_d3dcompiler_47 -enable_d3dim -enable_d3dim700 -enable_d3drm -enable_d3dx10_33 -enable_d3dx10_34 -enable_d3dx10_35 -enable_d3dx10_36 -enable_d3dx10_37 -enable_d3dx10_38 -enable_d3dx10_39 -enable_d3dx10_40 -enable_d3dx10_41 -enable_d3dx10_42 -enable_d3dx10_43 -enable_d3dx11_42 -enable_d3dx11_43 -enable_d3dx9_24 -enable_d3dx9_25 -enable_d3dx9_26 -enable_d3dx9_27 -enable_d3dx9_28 -enable_d3dx9_29 -enable_d3dx9_30 -enable_d3dx9_31 -enable_d3dx9_32 -enable_d3dx9_33 -enable_d3dx9_34 -enable_d3dx9_35 -enable_d3dx9_36 -enable_d3dx9_37 -enable_d3dx9_38 -enable_d3dx9_39 -enable_d3dx9_40 -enable_d3dx9_41 -enable_d3dx9_42 -enable_d3dx9_43 -enable_d3dxof -enable_davclnt -enable_dbgeng -enable_dbghelp -enable_dciman32 -enable_dcomp -enable_ddraw -enable_ddrawex -enable_devenum -enable_dhcpcsvc -enable_dhcpcsvc6 -enable_dhtmled_ocx -enable_diasymreader -enable_difxapi -enable_dinput -enable_dinput8 -enable_directmanipulation -enable_dispex -enable_dmband -enable_dmcompos -enable_dmime -enable_dmloader -enable_dmscript -enable_dmstyle -enable_dmsynth -enable_dmusic -enable_dmusic32 -enable_dnsapi -enable_dplay -enable_dplayx -enable_dpnaddr -enable_dpnet -enable_dpnhpast -enable_dpnhupnp -enable_dpnlobby -enable_dpvoice -enable_dpwsockx -enable_drmclien -enable_dsdmo -enable_dsound -enable_dsquery -enable_dssenh -enable_dsuiext -enable_dswave -enable_dwmapi -enable_dwrite -enable_dx8vb -enable_dxcore -enable_dxdiagn -enable_dxgi -enable_dxtrans -enable_dxva2 -enable_esent -enable_evr -enable_explorerframe -enable_faultrep -enable_feclient -enable_fltlib -enable_fltmgr_sys -enable_fntcache -enable_fontsub -enable_fusion -enable_fwpuclnt -enable_gameux -enable_gamingtcui -enable_gdi32 -enable_gdiplus -enable_geolocation -enable_glu32 -enable_gphoto2_ds -enable_gpkcsp -enable_graphicscapture -enable_hal -enable_hhctrl_ocx -enable_hid -enable_hidclass_sys -enable_hidparse_sys -enable_hlink -enable_hnetcfg -enable_hrtfapo -enable_http_sys -enable_httpapi -enable_hvsimanagementapi -enable_ia2comproxy -enable_iccvid -enable_icmp -enable_ieframe -enable_ieproxy -enable_imaadp32_acm -enable_imagehlp -enable_imm32 -enable_inetcomm -enable_inetcpl_cpl -enable_inetmib1 -enable_infosoft -enable_initpki -enable_inkobj -enable_inseng -enable_iphlpapi -enable_iprop -enable_ir50_32 -enable_irprops_cpl -enable_itircl -enable_itss -enable_joy_cpl -enable_jscript -enable_jsproxy -enable_kerberos -enable_kernel32 -enable_kernelbase -enable_ksecdd_sys -enable_ksproxy_ax -enable_ksuser -enable_ktmw32 -enable_l3codeca_acm -enable_light_msstyles -enable_loadperf -enable_localspl -enable_localui -enable_lz32 -enable_magnification -enable_mapi32 -enable_mapistub -enable_mciavi32 -enable_mcicda -enable_mciqtz32 -enable_mciseq -enable_mciwave -enable_mf -enable_mf3216 -enable_mferror -enable_mfmediaengine -enable_mfplat -enable_mfplay -enable_mfreadwrite -enable_mfsrcsnk -enable_mgmtapi -enable_midimap -enable_mlang -enable_mmcndmgr -enable_mmdevapi -enable_mountmgr_sys -enable_mp3dmod -enable_mpr -enable_mprapi -enable_msacm32_drv -enable_msacm32 -enable_msado15 -enable_msadp32_acm -enable_msasn1 -enable_msauddecmft -enable_mscat32 -enable_mscms -enable_mscoree -enable_mscorwks -enable_msctf -enable_msctfmonitor -enable_msctfp -enable_msdaps -enable_msdasql -enable_msdelta -enable_msdmo -enable_msdrm -enable_msftedit -enable_msg711_acm -enable_msgsm32_acm -enable_mshtml_tlb -enable_mshtml -enable_msi -enable_msident -enable_msimg32 -enable_msimsg -enable_msimtf -enable_msisip -enable_msisys_ocx -enable_msls31 -enable_msmpeg2vdec -enable_msnet32 -enable_mspatcha -enable_msports -enable_msrle32 -enable_msscript_ocx -enable_mssign32 -enable_mssip32 -enable_mstask -enable_msttsengine -enable_msv1_0 -enable_msvcirt -enable_msvcm80 -enable_msvcm90 -enable_msvcp100 -enable_msvcp110 -enable_msvcp120 -enable_msvcp120_app -enable_msvcp140 -enable_msvcp140_1 -enable_msvcp140_2 -enable_msvcp140_atomic_wait -enable_msvcp140_codecvt_ids -enable_msvcp60 -enable_msvcp70 -enable_msvcp71 -enable_msvcp80 -enable_msvcp90 -enable_msvcp_win -enable_msvcr100 -enable_msvcr110 -enable_msvcr120 -enable_msvcr120_app -enable_msvcr70 -enable_msvcr71 -enable_msvcr80 -enable_msvcr90 -enable_msvcrt -enable_msvcrt20 -enable_msvcrt40 -enable_msvcrtd -enable_msvfw32 -enable_msvidc32 -enable_mswsock -enable_msxml -enable_msxml2 -enable_msxml3 -enable_msxml4 -enable_msxml6 -enable_mtxdm -enable_ncrypt -enable_nddeapi -enable_ndis_sys -enable_netapi32 -enable_netcfgx -enable_netio_sys -enable_netprofm -enable_netutils -enable_newdev -enable_ninput -enable_normaliz -enable_npmshtml -enable_npptools -enable_nsi -enable_nsiproxy_sys -enable_ntdll -enable_ntdsapi -enable_ntoskrnl_exe -enable_ntprint -enable_objsel -enable_odbc32 -enable_odbcbcp -enable_odbccp32 -enable_odbccu32 -enable_ole32 -enable_oleacc -enable_oleaut32 -enable_olecli32 -enable_oledb32 -enable_oledlg -enable_olepro32 -enable_olesvr32 -enable_olethk32 -enable_opcservices -enable_opencl -enable_opengl32 -enable_packager -enable_pdh -enable_photometadatahandler -enable_pidgen -enable_powrprof -enable_printui -enable_prntvpt -enable_propsys -enable_psapi -enable_pstorec -enable_pwrshplugin -enable_qasf -enable_qcap -enable_qdvd -enable_qedit -enable_qmgr -enable_qmgrprxy -enable_quartz -enable_query -enable_qwave -enable_rasapi32 -enable_rasdlg -enable_regapi -enable_resutils -enable_riched20 -enable_riched32 -enable_rpcrt4 -enable_rsabase -enable_rsaenh -enable_rstrtmgr -enable_rtutils -enable_rtworkq -enable_samlib -enable_sane_ds -enable_sapi -enable_sas -enable_scarddlg -enable_scardsvr -enable_sccbase -enable_schannel -enable_schedsvc -enable_scrobj -enable_scrrun -enable_scsiport_sys -enable_sechost -enable_secur32 -enable_security -enable_sensapi -enable_serialui -enable_setupapi -enable_sfc -enable_sfc_os -enable_shcore -enable_shdoclc -enable_shdocvw -enable_shell32 -enable_shfolder -enable_shlwapi -enable_slbcsp -enable_slc -enable_snmpapi -enable_softpub -enable_spoolss -enable_sppc -enable_srclient -enable_srvcli -enable_srvsvc -enable_sspicli -enable_stdole2_tlb -enable_stdole32_tlb -enable_sti -enable_strmdll -enable_svrapi -enable_sxs -enable_t2embed -enable_tapi32 -enable_taskschd -enable_tbs -enable_tdh -enable_tdi_sys -enable_threadpoolwinrt -enable_traffic -enable_twain_32 -enable_twinapi_appcore -enable_tzres -enable_ucrtbase -enable_uianimation -enable_uiautomationcore -enable_uiribbon -enable_unicows -enable_updspapi -enable_url -enable_urlmon -enable_usbd_sys -enable_user32 -enable_userenv -enable_usp10 -enable_utildll -enable_uxtheme -enable_vbscript -enable_vcomp -enable_vcomp100 -enable_vcomp110 -enable_vcomp120 -enable_vcomp140 -enable_vcomp90 -enable_vcruntime140 -enable_vcruntime140_1 -enable_vdmdbg -enable_version -enable_vga -enable_virtdisk -enable_vssapi -enable_vulkan_1 -enable_wbemdisp -enable_wbemprox -enable_wdscore -enable_webservices -enable_websocket -enable_wer -enable_wevtapi -enable_wevtsvc -enable_wiaservc -enable_wimgapi -enable_win32u -enable_windows_applicationmodel -enable_windows_devices_bluetooth -enable_windows_devices_enumeration -enable_windows_devices_usb -enable_windows_gaming_input -enable_windows_gaming_ui_gamebar -enable_windows_globalization -enable_windows_media_devices -enable_windows_media_mediacontrol -enable_windows_media_speech -enable_windows_media -enable_windows_networking_hostname -enable_windows_networking -enable_windows_perception_stub -enable_windows_security_credentials_ui_userconsentverifier -enable_windows_storage_applicationdata -enable_windows_system_profile_systemmanufacturers -enable_windows_ui -enable_windowscodecs -enable_windowscodecsext -enable_winealsa_drv -enable_wineandroid_drv -enable_winebus_sys -enable_winecoreaudio_drv -enable_winecrt0 -enable_wined3d -enable_winegstreamer -enable_winehid_sys -enable_winemac_drv -enable_winemapi -enable_wineoss_drv -enable_wineps_drv -enable_winepulse_drv -enable_wineusb_sys -enable_winevulkan -enable_winewayland_drv -enable_winex11_drv -enable_winexinput_sys -enable_wing32 -enable_winhttp -enable_wininet -enable_winmm -enable_winnls32 -enable_winprint -enable_winscard -enable_winspool_drv -enable_winsta -enable_wintab32 -enable_wintrust -enable_wintypes -enable_winusb -enable_wlanapi -enable_wlanui -enable_wldap32 -enable_wldp -enable_wmasf -enable_wmi -enable_wmiutils -enable_wmp -enable_wmphoto -enable_wmvcore -enable_wnaspi32 -enable_wofutil -enable_wow64 -enable_wow64cpu -enable_wow64win -enable_wpc -enable_wpcap -enable_ws2_32 -enable_wsdapi -enable_wshom_ocx -enable_wsnmp32 -enable_wsock32 -enable_wtsapi32 -enable_wuapi -enable_wuaueng -enable_x3daudio1_0 -enable_x3daudio1_1 -enable_x3daudio1_2 -enable_x3daudio1_3 -enable_x3daudio1_4 -enable_x3daudio1_5 -enable_x3daudio1_6 -enable_x3daudio1_7 -enable_xactengine2_0 -enable_xactengine2_4 -enable_xactengine2_7 -enable_xactengine2_9 -enable_xactengine3_0 -enable_xactengine3_1 -enable_xactengine3_2 -enable_xactengine3_3 -enable_xactengine3_4 -enable_xactengine3_5 -enable_xactengine3_6 -enable_xactengine3_7 -enable_xapofx1_1 -enable_xapofx1_2 -enable_xapofx1_3 -enable_xapofx1_4 -enable_xapofx1_5 -enable_xaudio2_0 -enable_xaudio2_1 -enable_xaudio2_2 -enable_xaudio2_3 -enable_xaudio2_4 -enable_xaudio2_5 -enable_xaudio2_6 -enable_xaudio2_7 -enable_xaudio2_8 -enable_xaudio2_9 -enable_xinput1_1 -enable_xinput1_2 -enable_xinput1_3 -enable_xinput1_4 -enable_xinput9_1_0 -enable_xinputuap -enable_xmllite -enable_xolehlp -enable_xpsprint -enable_xpssvcs -enable_fonts -enable_include -enable_adsiid -enable_dmoguids -enable_dxerr8 -enable_dxerr9 -enable_dxguid -enable_faudio -enable_fluidsynth -enable_gsm -enable_jpeg -enable_jxr -enable_lcms2 -enable_ldap -enable_mfuuid -enable_mpg123 -enable_musl -enable_png -enable_strmbase -enable_strmiids -enable_tiff -enable_uuid -enable_vkd3d -enable_wbemuuid -enable_wmcodecdspuuid -enable_xml2 -enable_xslt -enable_zlib -enable_zydis -enable_loader -enable_nls -enable_po -enable_arp -enable_aspnet_regiis -enable_attrib -enable_cabarc -enable_cacls -enable_certutil -enable_chcp_com -enable_clock -enable_cmd -enable_conhost -enable_control -enable_cscript -enable_dism -enable_dllhost -enable_dplaysvr -enable_dpnsvr -enable_dpvsetup -enable_dxdiag -enable_eject -enable_expand -enable_explorer -enable_extrac32 -enable_fc -enable_find -enable_findstr -enable_fsutil -enable_hh -enable_hostname -enable_icacls -enable_icinfo -enable_iexplore -enable_ipconfig -enable_klist -enable_lodctr -enable_mofcomp -enable_mshta -enable_msidb -enable_msiexec -enable_msinfo32 -enable_net -enable_netsh -enable_netstat -enable_ngen -enable_notepad -enable_oleview -enable_ping -enable_plugplay -enable_pnputil -enable_powershell -enable_presentationfontcache -enable_progman -enable_reg -enable_regasm -enable_regedit -enable_regini -enable_regsvcs -enable_regsvr32 -enable_robocopy -enable_rpcss -enable_rundll32 -enable_sc -enable_schtasks -enable_sdbinst -enable_secedit -enable_servicemodelreg -enable_services -enable_setx -enable_shutdown -enable_spoolsv -enable_start -enable_subst -enable_svchost -enable_systeminfo -enable_taskkill -enable_tasklist -enable_taskmgr -enable_termsv -enable_uninstaller -enable_unlodctr -enable_view -enable_wevtutil -enable_where -enable_whoami -enable_wineboot -enable_winebrowser -enable_winecfg -enable_wineconsole -enable_winedbg -enable_winedevice -enable_winefile -enable_winemenubuilder -enable_winemine -enable_winemsibuilder -enable_winepath -enable_winetest -enable_winhlp32 -enable_winmgmt -enable_winver -enable_wmic -enable_wmplayer -enable_wordpad -enable_write -enable_wscript -enable_wuauserv -enable_wusa -enable_xcopy -enable_server -enable_tools -enable_sfnt2fon -enable_widl -enable_winebuild -enable_winedump -enable_winegcc -enable_winemaker -enable_wmc -enable_wrc -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -OBJC -OBJCFLAGS -FAUDIO_PE_CFLAGS -FAUDIO_PE_LIBS -FLUIDSYNTH_PE_CFLAGS -FLUIDSYNTH_PE_LIBS -GSM_PE_CFLAGS -GSM_PE_LIBS -JPEG_PE_CFLAGS -JPEG_PE_LIBS -JXR_PE_CFLAGS -JXR_PE_LIBS -LCMS2_PE_CFLAGS -LCMS2_PE_LIBS -LDAP_PE_CFLAGS -LDAP_PE_LIBS -MPG123_PE_CFLAGS -MPG123_PE_LIBS -MUSL_PE_CFLAGS -MUSL_PE_LIBS -PNG_PE_CFLAGS -PNG_PE_LIBS -TIFF_PE_CFLAGS -TIFF_PE_LIBS -VKD3D_PE_CFLAGS -VKD3D_PE_LIBS -XML2_PE_CFLAGS -XML2_PE_LIBS -XSLT_PE_CFLAGS -XSLT_PE_LIBS -ZLIB_PE_CFLAGS -ZLIB_PE_LIBS -ZYDIS_PE_CFLAGS -ZYDIS_PE_LIBS -XMKMF -CPP -WAYLAND_CLIENT_CFLAGS -WAYLAND_CLIENT_LIBS -XKBCOMMON_CFLAGS -XKBCOMMON_LIBS -XKBREGISTRY_CFLAGS -XKBREGISTRY_LIBS -INOTIFY_CFLAGS -INOTIFY_LIBS -DBUS_CFLAGS -DBUS_LIBS -GNUTLS_CFLAGS -GNUTLS_LIBS -SANE_CFLAGS -SANE_LIBS -USB_CFLAGS -USB_LIBS -GPHOTO2_CFLAGS -GPHOTO2_LIBS -GPHOTO2_PORT_CFLAGS -GPHOTO2_PORT_LIBS -FREETYPE_CFLAGS -FREETYPE_LIBS -PULSE_CFLAGS -PULSE_LIBS -GSTREAMER_CFLAGS -GSTREAMER_LIBS -UDEV_CFLAGS -UDEV_LIBS -UNWIND_CFLAGS -UNWIND_LIBS -SDL2_CFLAGS -SDL2_LIBS -CAPI20_CFLAGS -CAPI20_LIBS -CUPS_CFLAGS -CUPS_LIBS -FONTCONFIG_CFLAGS -FONTCONFIG_LIBS -KRB5_CFLAGS -KRB5_LIBS -GSSAPI_CFLAGS -GSSAPI_LIBS -NETAPI_CFLAGS -NETAPI_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures Wine 9.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/wine] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of Wine 9.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-archs={i386,x86_64,arm,aarch64} - enable multiple architectures for PE compilation - --disable-win16 do not include Win16 support - --enable-win64 build a Win64 emulator on AMD64 (won't run Win32 - binaries) - --disable-tests do not build the regression tests - --enable-build-id include .buildid section in output objects - --enable-maintainer-mode - enable maintainer-specific build rules - --enable-silent-rules use silent build rules (override: "make V=1") - --enable-werror treat compilation warnings as errors - --disable-largefile omit support for large files - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-alsa do not use the Alsa sound support - --without-capi do not use CAPI (ISDN support) - --without-coreaudio do not use the CoreAudio sound support - --without-cups do not use CUPS - --without-dbus do not use DBus (dynamic device support) - --with-float-abi=abi specify the ABI (soft|softfp|hard) for ARM platforms - --without-fontconfig do not use fontconfig - --without-freetype do not use the FreeType library - --without-gettext do not use gettext - --with-gettextpo use the GetTextPO library to rebuild po files - --without-gphoto do not use gphoto (Digital Camera support) - --without-gnutls do not use GnuTLS (schannel support) - --without-gssapi do not use GSSAPI (Kerberos SSP support) - --without-gstreamer do not use GStreamer (codecs support) - --without-inotify do not use inotify (filesystem change notifications) - --without-krb5 do not use krb5 (Kerberos) - --without-mingw do not use the MinGW cross-compiler - --without-netapi do not use the Samba NetAPI library - --without-opencl do not use OpenCL - --without-opengl do not use OpenGL - --without-osmesa do not use the OSMesa library - --without-oss do not use the OSS sound support - --without-pcap do not use the Packet Capture library - --without-pcsclite do not use PCSC lite - --without-pthread do not use the pthread library - --without-pulse do not use PulseAudio sound support - --without-sane do not use SANE (scanner support) - --without-sdl do not use SDL - --without-udev do not use udev (plug and play support) - --without-unwind do not use the libunwind library (exception - handling) - --without-usb do not use the libusb library - --without-v4l2 do not use v4l2 (video capture) - --without-vulkan do not use Vulkan - --without-wayland do not build the Wayland driver - --without-xcomposite do not use the Xcomposite extension - --without-xcursor do not use the Xcursor extension - --without-xfixes do not use Xfixes for clipboard change notifications - --without-xinerama do not use Xinerama (legacy multi-monitor support) - --without-xinput do not use the Xinput extension - --without-xinput2 do not use the Xinput 2 extension - --without-xrandr do not use Xrandr (multi-monitor support) - --without-xrender do not use the Xrender extension - --without-xshape do not use the Xshape extension - --without-xshm do not use XShm (shared memory extension) - --without-xxf86vm do not use XFree video mode extension - --with-system-dllpath=PATH - load external PE dependencies from colon-separated - path PATH - --with-wine-tools=DIR use Wine tools from directory DIR - --with-wine64=DIR use the 64-bit Wine in DIR for a Wow64 build - --with-x use the X Window System - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - OBJC Objective C compiler command - OBJCFLAGS Objective C compiler flags - FAUDIO_PE_CFLAGS - C compiler flags for the PE faudio, overriding the bundled - version - FAUDIO_PE_LIBS - Linker flags for the PE faudio, overriding the bundled version - FLUIDSYNTH_PE_CFLAGS - C compiler flags for the PE fluidsynth, overriding the bundled - version - FLUIDSYNTH_PE_LIBS - Linker flags for the PE fluidsynth, overriding the bundled - version - GSM_PE_CFLAGS - C compiler flags for the PE gsm, overriding the bundled version - GSM_PE_LIBS Linker flags for the PE gsm, overriding the bundled version - JPEG_PE_CFLAGS - C compiler flags for the PE jpeg, overriding the bundled version - JPEG_PE_LIBS - Linker flags for the PE jpeg, overriding the bundled version - JXR_PE_CFLAGS - C compiler flags for the PE jxr, overriding the bundled version - JXR_PE_LIBS Linker flags for the PE jxr, overriding the bundled version - LCMS2_PE_CFLAGS - C compiler flags for the PE lcms2, overriding the bundled - version - LCMS2_PE_LIBS - Linker flags for the PE lcms2, overriding the bundled version - LDAP_PE_CFLAGS - C compiler flags for the PE ldap, overriding the bundled version - LDAP_PE_LIBS - Linker flags for the PE ldap, overriding the bundled version - MPG123_PE_CFLAGS - C compiler flags for the PE mpg123, overriding the bundled - version - MPG123_PE_LIBS - Linker flags for the PE mpg123, overriding the bundled version - MUSL_PE_CFLAGS - C compiler flags for the PE musl, overriding the bundled version - MUSL_PE_LIBS - Linker flags for the PE musl, overriding the bundled version - PNG_PE_CFLAGS - C compiler flags for the PE png, overriding the bundled version - PNG_PE_LIBS Linker flags for the PE png, overriding the bundled version - TIFF_PE_CFLAGS - C compiler flags for the PE tiff, overriding the bundled version - TIFF_PE_LIBS - Linker flags for the PE tiff, overriding the bundled version - VKD3D_PE_CFLAGS - C compiler flags for the PE vkd3d, overriding the bundled - version - VKD3D_PE_LIBS - Linker flags for the PE vkd3d, overriding the bundled version - XML2_PE_CFLAGS - C compiler flags for the PE xml2, overriding the bundled version - XML2_PE_LIBS - Linker flags for the PE xml2, overriding the bundled version - XSLT_PE_CFLAGS - C compiler flags for the PE xslt, overriding the bundled version - XSLT_PE_LIBS - Linker flags for the PE xslt, overriding the bundled version - ZLIB_PE_CFLAGS - C compiler flags for the PE zlib, overriding the bundled version - ZLIB_PE_LIBS - Linker flags for the PE zlib, overriding the bundled version - ZYDIS_PE_CFLAGS - C compiler flags for the PE zydis, overriding the bundled - version - ZYDIS_PE_LIBS - Linker flags for the PE zydis, overriding the bundled version - XMKMF Path to xmkmf, Makefile generator for X Window System - CPP C preprocessor - WAYLAND_CLIENT_CFLAGS - C compiler flags for wayland-client, overriding pkg-config - WAYLAND_CLIENT_LIBS - Linker flags for wayland-client, overriding pkg-config - XKBCOMMON_CFLAGS - C compiler flags for xkbcommon, overriding pkg-config - XKBCOMMON_LIBS - Linker flags for xkbcommon, overriding pkg-config - XKBREGISTRY_CFLAGS - C compiler flags for xkbregistry, overriding pkg-config - XKBREGISTRY_LIBS - Linker flags for xkbregistry, overriding pkg-config - INOTIFY_CFLAGS - C compiler flags for libinotify, overriding pkg-config - INOTIFY_LIBS - Linker flags for libinotify, overriding pkg-config - DBUS_CFLAGS C compiler flags for dbus-1, overriding pkg-config - DBUS_LIBS Linker flags for dbus-1, overriding pkg-config - GNUTLS_CFLAGS - C compiler flags for gnutls, overriding pkg-config - GNUTLS_LIBS Linker flags for gnutls, overriding pkg-config - SANE_CFLAGS C compiler flags for sane-backends, overriding pkg-config - SANE_LIBS Linker flags for sane-backends, overriding pkg-config - USB_CFLAGS C compiler flags for libusb-1.0, overriding pkg-config - USB_LIBS Linker flags for libusb-1.0, overriding pkg-config - GPHOTO2_CFLAGS - C compiler flags for libgphoto2, overriding pkg-config - GPHOTO2_LIBS - Linker flags for libgphoto2, overriding pkg-config - GPHOTO2_PORT_CFLAGS - C compiler flags for libgphoto2_port, overriding pkg-config - GPHOTO2_PORT_LIBS - Linker flags for libgphoto2_port, overriding pkg-config - FREETYPE_CFLAGS - C compiler flags for freetype2, overriding pkg-config - FREETYPE_LIBS - Linker flags for freetype2, overriding pkg-config - PULSE_CFLAGS - C compiler flags for libpulse, overriding pkg-config - PULSE_LIBS Linker flags for libpulse, overriding pkg-config - GSTREAMER_CFLAGS - C compiler flags for gstreamer-1.0 gstreamer-video-1.0 - gstreamer-audio-1.0 gstreamer-tag-1.0, overriding pkg-config - GSTREAMER_LIBS - Linker flags for gstreamer-1.0 gstreamer-video-1.0 - gstreamer-audio-1.0 gstreamer-tag-1.0, overriding pkg-config - UDEV_CFLAGS C compiler flags for libudev, overriding pkg-config - UDEV_LIBS Linker flags for libudev, overriding pkg-config - UNWIND_CFLAGS - C compiler flags for libunwind, overriding pkg-config - UNWIND_LIBS Linker flags for libunwind, overriding pkg-config - SDL2_CFLAGS C compiler flags for sdl2, overriding pkg-config - SDL2_LIBS Linker flags for sdl2, overriding pkg-config - CAPI20_CFLAGS - C compiler flags for capi20, overriding pkg-config - CAPI20_LIBS Linker flags for capi20, overriding pkg-config - CUPS_CFLAGS C compiler flags for cups, overriding pkg-config - CUPS_LIBS Linker flags for cups, overriding pkg-config - FONTCONFIG_CFLAGS - C compiler flags for fontconfig, overriding pkg-config - FONTCONFIG_LIBS - Linker flags for fontconfig, overriding pkg-config - KRB5_CFLAGS C compiler flags for krb5, overriding pkg-config - KRB5_LIBS Linker flags for krb5, overriding pkg-config - GSSAPI_CFLAGS - C compiler flags for krb5-gssapi, overriding pkg-config - GSSAPI_LIBS Linker flags for krb5-gssapi, overriding pkg-config - NETAPI_CFLAGS - C compiler flags for netapi, overriding pkg-config - NETAPI_LIBS Linker flags for netapi, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -Wine home page: . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -Wine configure 9.0 -generated by GNU Autoconf 2.71 - -Copyright (C) 2021 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_objc_try_compile LINENO -# ----------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_objc_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_objc_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_objc_try_compile - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ - -#include -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main (void) -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -printf %s "checking for $2.$3... " >&6; } -if eval test \${$4+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main (void) -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$4=yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main (void) -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$4=yes" -else $as_nop - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$4 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by Wine $as_me 9.0, which was -generated by GNU Autoconf 2.71. Invocation command line was - - $ $0$ac_configure_args_raw - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - printf "%s\n" "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -printf "%s\n" "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" -else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -fi - -for ac_site_file in $ac_site_files -do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" - -# Auxiliary files required by this configure script. -ac_aux_files="config.guess config.sub" - -# Locations in which to look for auxiliary files. -ac_aux_dir_candidates="${srcdir}/tools" - -# Search for a directory containing all of the required auxiliary files, -# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. -# If we don't find one directory that contains all the files we need, -# we report the set of missing files from the *first* directory in -# $ac_aux_dir_candidates and give up. -ac_missing_aux_files="" -ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in $ac_aux_dir_candidates -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 - ac_aux_dir_found=yes - ac_install_sh= - for ac_aux in $ac_aux_files - do - # As a special case, if "install-sh" is required, that requirement - # can be satisfied by any of "install-sh", "install.sh", or "shtool", - # and $ac_install_sh is set appropriately for whichever one is found. - if test x"$ac_aux" = x"install-sh" - then - if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 - ac_install_sh="${as_dir}install-sh -c" - elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 - ac_install_sh="${as_dir}install.sh -c" - elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 - ac_install_sh="${as_dir}shtool install -c" - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} install-sh" - else - break - fi - fi - else - if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" - else - break - fi - fi - fi - done - if test "$ac_aux_dir_found" = yes; then - ac_aux_dir="$as_dir" - break - fi - ac_first_candidate=false - - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 -fi - - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -if test -f "${ac_aux_dir}config.guess"; then - ac_config_guess="$SHELL ${ac_aux_dir}config.guess" -fi -if test -f "${ac_aux_dir}config.sub"; then - ac_config_sub="$SHELL ${ac_aux_dir}config.sub" -fi -if test -f "$ac_aux_dir/configure"; then - ac_configure="$SHELL ${ac_aux_dir}configure" -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' - and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers include/config.h" - - - -libwine_version="1.0" - - -# Check whether --enable-archs was given. -if test ${enable_archs+y} -then : - enableval=$enable_archs; -fi - -# Check whether --enable-win16 was given. -if test ${enable_win16+y} -then : - enableval=$enable_win16; -fi - -# Check whether --enable-win64 was given. -if test ${enable_win64+y} -then : - enableval=$enable_win64; -fi - -# Check whether --enable-tests was given. -if test ${enable_tests+y} -then : - enableval=$enable_tests; -fi - -# Check whether --enable-build-id was given. -if test ${enable_build_id+y} -then : - enableval=$enable_build_id; -fi - -# Check whether --enable-maintainer-mode was given. -if test ${enable_maintainer_mode+y} -then : - enableval=$enable_maintainer_mode; -fi - -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -# Check whether --enable-werror was given. -if test ${enable_werror+y} -then : - enableval=$enable_werror; -fi - - - -# Check whether --with-alsa was given. -if test ${with_alsa+y} -then : - withval=$with_alsa; -fi - - -# Check whether --with-capi was given. -if test ${with_capi+y} -then : - withval=$with_capi; -fi - - -# Check whether --with-coreaudio was given. -if test ${with_coreaudio+y} -then : - withval=$with_coreaudio; -fi - - -# Check whether --with-cups was given. -if test ${with_cups+y} -then : - withval=$with_cups; -fi - - -# Check whether --with-dbus was given. -if test ${with_dbus+y} -then : - withval=$with_dbus; -fi - - -# Check whether --with-float-abi was given. -if test ${with_float_abi+y} -then : - withval=$with_float_abi; -fi - - -# Check whether --with-fontconfig was given. -if test ${with_fontconfig+y} -then : - withval=$with_fontconfig; -fi - - -# Check whether --with-freetype was given. -if test ${with_freetype+y} -then : - withval=$with_freetype; -fi - - -# Check whether --with-gettext was given. -if test ${with_gettext+y} -then : - withval=$with_gettext; -fi - - -# Check whether --with-gettextpo was given. -if test ${with_gettextpo+y} -then : - withval=$with_gettextpo; if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi -fi - - -# Check whether --with-gphoto was given. -if test ${with_gphoto+y} -then : - withval=$with_gphoto; -fi - - -# Check whether --with-gnutls was given. -if test ${with_gnutls+y} -then : - withval=$with_gnutls; -fi - - -# Check whether --with-gssapi was given. -if test ${with_gssapi+y} -then : - withval=$with_gssapi; -fi - - -# Check whether --with-gstreamer was given. -if test ${with_gstreamer+y} -then : - withval=$with_gstreamer; -fi - - -# Check whether --with-inotify was given. -if test ${with_inotify+y} -then : - withval=$with_inotify; -fi - - -# Check whether --with-krb5 was given. -if test ${with_krb5+y} -then : - withval=$with_krb5; -fi - - -# Check whether --with-mingw was given. -if test ${with_mingw+y} -then : - withval=$with_mingw; -fi - - -# Check whether --with-netapi was given. -if test ${with_netapi+y} -then : - withval=$with_netapi; -fi - - -# Check whether --with-opencl was given. -if test ${with_opencl+y} -then : - withval=$with_opencl; if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi -fi - - -# Check whether --with-opengl was given. -if test ${with_opengl+y} -then : - withval=$with_opengl; -fi - - -# Check whether --with-osmesa was given. -if test ${with_osmesa+y} -then : - withval=$with_osmesa; -fi - - -# Check whether --with-oss was given. -if test ${with_oss+y} -then : - withval=$with_oss; -fi - - -# Check whether --with-pcap was given. -if test ${with_pcap+y} -then : - withval=$with_pcap; if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi -fi - - -# Check whether --with-pcsclite was given. -if test ${with_pcsclite+y} -then : - withval=$with_pcsclite; -fi - - -# Check whether --with-pthread was given. -if test ${with_pthread+y} -then : - withval=$with_pthread; -fi - - -# Check whether --with-pulse was given. -if test ${with_pulse+y} -then : - withval=$with_pulse; -fi - - -# Check whether --with-sane was given. -if test ${with_sane+y} -then : - withval=$with_sane; -fi - - -# Check whether --with-sdl was given. -if test ${with_sdl+y} -then : - withval=$with_sdl; -fi - - -# Check whether --with-udev was given. -if test ${with_udev+y} -then : - withval=$with_udev; -fi - - -# Check whether --with-unwind was given. -if test ${with_unwind+y} -then : - withval=$with_unwind; -fi - - -# Check whether --with-usb was given. -if test ${with_usb+y} -then : - withval=$with_usb; -fi - - -# Check whether --with-v4l2 was given. -if test ${with_v4l2+y} -then : - withval=$with_v4l2; -fi - - -# Check whether --with-vulkan was given. -if test ${with_vulkan+y} -then : - withval=$with_vulkan; -fi - - -# Check whether --with-wayland was given. -if test ${with_wayland+y} -then : - withval=$with_wayland; -fi - - -# Check whether --with-xcomposite was given. -if test ${with_xcomposite+y} -then : - withval=$with_xcomposite; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi -fi - - -# Check whether --with-xcursor was given. -if test ${with_xcursor+y} -then : - withval=$with_xcursor; if test "x$withval" = "xno"; then ac_cv_header_X11_Xcursor_Xcursor_h=no; fi -fi - - -# Check whether --with-xfixes was given. -if test ${with_xfixes+y} -then : - withval=$with_xfixes; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xfixes_h=no; fi -fi - - -# Check whether --with-xinerama was given. -if test ${with_xinerama+y} -then : - withval=$with_xinerama; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xinerama_h=no; fi -fi - - -# Check whether --with-xinput was given. -if test ${with_xinput+y} -then : - withval=$with_xinput; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XInput_h=no; fi -fi - - -# Check whether --with-xinput2 was given. -if test ${with_xinput2+y} -then : - withval=$with_xinput2; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XInput2_h=no; fi -fi - - -# Check whether --with-xrandr was given. -if test ${with_xrandr+y} -then : - withval=$with_xrandr; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xrandr_h=no; fi -fi - - -# Check whether --with-xrender was given. -if test ${with_xrender+y} -then : - withval=$with_xrender; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xrender_h=no; fi -fi - - -# Check whether --with-xshape was given. -if test ${with_xshape+y} -then : - withval=$with_xshape; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_shape_h=no; fi -fi - - -# Check whether --with-xshm was given. -if test ${with_xshm+y} -then : - withval=$with_xshm; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XShm_h=no; fi -fi - - -# Check whether --with-xxf86vm was given. -if test ${with_xxf86vm+y} -then : - withval=$with_xxf86vm; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_xf86vmode_h=no; ac_cv_header_X11_extensions_xf86vmproto_h=no; fi -fi - - - -# Check whether --with-system-dllpath was given. -if test ${with_system_dllpath+y} -then : - withval=$with_system_dllpath; system_dllpath=$withval - -fi - - -# Check whether --with-wine-tools was given. -if test ${with_wine_tools+y} -then : - withval=$with_wine_tools; -fi - - -# Check whether --with-wine64 was given. -if test ${with_wine64+y} -then : - withval=$with_wine64; -fi - - - - - - # Make sure we can run config.sub. -$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -printf %s "checking build system type... " >&6; } -if test ${ac_cv_build+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -printf %s "checking host system type... " >&6; } -if test ${ac_cv_host+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -dlldir=\${libdir}/wine - -fontdir=\${datadir}/wine/fonts - -nlsdir=\${datadir}/wine/nls - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval test \${ac_cv_prog_make_${ac_make}_set+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - SET_MAKE= -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else $as_nop - ac_file='' -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cpp", so it can be a program name with args. -set dummy ${ac_tool_prefix}cpp; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CPPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CPPBIN"; then - ac_cv_prog_CPPBIN="$CPPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CPPBIN="${ac_tool_prefix}cpp" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CPPBIN=$ac_cv_prog_CPPBIN -if test -n "$CPPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPPBIN" >&5 -printf "%s\n" "$CPPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CPPBIN"; then - ac_ct_CPPBIN=$CPPBIN - # Extract the first word of "cpp", so it can be a program name with args. -set dummy cpp; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CPPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CPPBIN"; then - ac_cv_prog_ac_ct_CPPBIN="$ac_ct_CPPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CPPBIN="cpp" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CPPBIN=$ac_cv_prog_ac_ct_CPPBIN -if test -n "$ac_ct_CPPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CPPBIN" >&5 -printf "%s\n" "$ac_ct_CPPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CPPBIN" = x; then - CPPBIN="cpp" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CPPBIN=$ac_ct_CPPBIN - fi -else - CPPBIN="$ac_cv_prog_CPPBIN" -fi - - -printf "%s\n" "#define EXEEXT \"$ac_exeext\"" >>confdefs.h - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. -set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LD="${ac_tool_prefix}ld" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LD"; then - ac_ct_LD=$LD - # Extract the first word of "ld", so it can be a program name with args. -set dummy ld; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LD"; then - ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LD="ld" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LD=$ac_cv_prog_ac_ct_LD -if test -n "$ac_ct_LD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 -printf "%s\n" "$ac_ct_LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_LD" = x; then - LD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LD=$ac_ct_LD - fi -else - LD="$ac_cv_prog_LD" -fi - - -case $host in - *-darwin*) - with_fontconfig=${with_fontconfig:-no} - ;; - *-mingw32*|*-cygwin*) - enable_win16=${enable_win16:-no} - with_mingw=${with_mingw:-no} - ;; -esac - - -case $host in - x86_64*|amd64*) - if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes" -a x"$enable_archs" = x - then - CC="$CC -m32" - CXX="$CXX -m32" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 -printf %s "checking whether $CC works... " >&6; } -if test ${wine_cv_cc_m32+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_cc_m32=yes -else $as_nop - wine_cv_cc_m32=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_cc_m32" >&5 -printf "%s\n" "$wine_cv_cc_m32" >&6; } - test $wine_cv_cc_m32 != no || as_fn_error $? "Cannot build a 32-bit program, you need to install 32-bit development libraries." "$LINENO" 5 - host_cpu="i386" - notice_platform="32-bit " - TARGETFLAGS="$TARGETFLAGS -m32" - PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig} - export PKG_CONFIG_LIBDIR - with_unwind=${with_unwind:-no} - else - CC="$CC -m64" - CXX="$CXX -m64" - host_cpu="x86_64" - notice_platform="64-bit " - TARGETFLAGS="$TARGETFLAGS -m64" - fi - ;; - arm*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb-2" >&5 -printf %s "checking whether $CC supports Thumb-2... " >&6; } -if test ${wine_cv_thumb2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -asm(".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_thumb2=yes -else $as_nop - wine_cv_thumb2=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb2" >&5 -printf "%s\n" "$wine_cv_thumb2" >&6; } - if test x"$wine_cv_thumb2" = xyes - then - CFLAGS="$CFLAGS -mthumb" - TARGETFLAGS="$TARGETFLAGS -mthumb" - else - CFLAGS="$CFLAGS -marm" - TARGETFLAGS="$TARGETFLAGS -marm" - fi - case $with_float_abi in - soft|softfp|hard) - float_abi=$with_float_abi ;; - *) - case $host_os in - *eabihf) - float_abi=hard ;; - *) - float_abi=softfp - saved_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -mfloat-abi=$float_abi" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5 -printf %s "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; } -if test ${wine_cv_float_abi+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -asm("vmrs r2,fpscr"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_float_abi=yes -else $as_nop - wine_cv_float_abi=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_float_abi" >&5 -printf "%s\n" "$wine_cv_float_abi" >&6; } - if test $wine_cv_float_abi = no - then - float_abi=soft - as_fn_append wine_warnings "|Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries." - fi - CFLAGS=$saved_CFLAGS - esac - ;; - esac - CFLAGS="$CFLAGS -mfloat-abi=$float_abi" - TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi" - ;; - i[3456789]86*) - with_unwind=${with_unwind:-no} - ;; -esac - -enable_win16=${enable_win16:-i386} -enable_win64=${enable_win64:-no} -enable_wow64=${enable_wow64:-aarch64,x86_64} -enable_wow64win=${enable_wow64win:-aarch64,x86_64} -enable_wow64cpu=${enable_wow64cpu:-x86_64} -enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec} - -enable_cmd=${enable_cmd:-yes} -enable_dllhost=${enable_dllhost:-yes} -enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec} -enable_dxdiag=${enable_dxdiag:-yes} -enable_msiexec=${enable_msiexec:-yes} -enable_netsh=${enable_netsh:-yes} -enable_regsvr32=${enable_regsvr32:-yes} -enable_rundll32=${enable_rundll32:-yes} - -enable_winetest=${enable_winetest:-$enable_tests} - -if test "x$enable_win64" = "xyes" -then - test -z "$with_wine64" || as_fn_error $? "--enable-win64 and --with-wine64 are mutually exclusive. ---enable-win64 should be used in the 64-bit build tree, --with-wine64 in the 32-bit Wow64 build tree." "$LINENO" 5 -fi - -case $build_os in - cygwin*|mingw32*) toolsext=".exe" - ;; - *) toolsext="" - ;; -esac - -HOST_ARCH=unknown -case "$host_cpu" in - aarch64*) HOST_ARCH=aarch64 ;; - arm*) HOST_ARCH=arm ;; - i[3456789]86*) HOST_ARCH=i386 ;; - x86_64) HOST_ARCH=x86_64 ;; -esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the directory containing the Wine tools" >&5 -printf %s "checking for the directory containing the Wine tools... " >&6; } -if test ${wine_cv_toolsdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - wine_cv_toolsdir="$with_wine_tools" - if test -z "$with_wine_tools"; then - if test "$cross_compiling" = "yes"; then - as_fn_error $? "you must use the --with-wine-tools option when cross-compiling." "$LINENO" 5 - elif test -n "$with_wine64"; then - wine_cv_toolsdir="$with_wine64" - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_toolsdir" >&5 -printf "%s\n" "$wine_cv_toolsdir" >&6; } -if test -z "$wine_cv_toolsdir"; then - wine_makedep=tools/makedep$toolsext -elif test -d "$wine_cv_toolsdir/tools/winebuild"; then - wine_makedep=$wine_cv_toolsdir/tools/makedep$toolsext - enable_tools=${enable_tools:-no} - test -f "$wine_makedep" || as_fn_error $? "the Wine tools have not yet been built in $wine_cv_toolsdir" "$LINENO" 5 -else - as_fn_error $? "could not find Wine tools in $wine_cv_toolsdir" "$LINENO" 5 -fi -toolsdir=$wine_cv_toolsdir - -MAKEDEP=$wine_makedep - -RUNTESTFLAGS="-q -P wine" - -SED_CMD="LC_ALL=C sed -e 's,@bindir@,\${bindir},g' -e 's,@dlldir@,\${dlldir},g' -e 's,@PACKAGE_STRING@,$PACKAGE_STRING,g' -e 's,@PACKAGE_VERSION@,$PACKAGE_VERSION,g'" - - -if test -n "$host_alias" -a "$host_alias" != "$build_alias" -then - TARGETFLAGS="-b $host_alias $TARGETFLAGS" -fi - -for ac_prog in flex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_FLEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$FLEX"; then - ac_cv_prog_FLEX="$FLEX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FLEX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -FLEX=$ac_cv_prog_FLEX -if test -n "$FLEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 -printf "%s\n" "$FLEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$FLEX" && break -done -test -n "$FLEX" || FLEX="none" - -if test "$FLEX" = "none" -then - as_fn_error $? "no suitable flex found. Please install the 'flex' package." "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether flex is recent enough" >&5 -printf %s "checking whether flex is recent enough... " >&6; } -if test ${wine_cv_recent_flex+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat >conftest.l </dev/null 2>&5 - then - wine_cv_recent_flex=yes - else - wine_cv_recent_flex=no - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_recent_flex" >&5 -printf "%s\n" "$wine_cv_recent_flex" >&6; } -test $wine_cv_recent_flex != no || as_fn_error $? "Your flex version is too old. Please install flex version 2.5.33 or newer." "$LINENO" 5 - -for ac_prog in bison -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_BISON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$BISON"; then - ac_cv_prog_BISON="$BISON" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_BISON="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -BISON=$ac_cv_prog_BISON -if test -n "$BISON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 -printf "%s\n" "$BISON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$BISON" && break -done -test -n "$BISON" || BISON="none" - -if test "$BISON" = "none" -then - as_fn_error $? "no suitable bison found. Please install the 'bison' package." "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether bison is recent enough" >&5 -printf %s "checking whether bison is recent enough... " >&6; } -if test ${wine_cv_recent_bison+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat >conftest.y </dev/null 2>&5 - then - wine_cv_recent_bison=yes - else - wine_cv_recent_bison=no - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_recent_bison" >&5 -printf "%s\n" "$wine_cv_recent_bison" >&6; } -test $wine_cv_recent_bison != no || as_fn_error $? "Your bison version is too old. Please install bison version 3.0 or newer." "$LINENO" 5 - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar gar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar gar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="ar" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP="strip" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -printf %s "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -printf "%s\n" "no, using $LN_S" >&6; } -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -# Extract the first word of "ldconfig", so it can be a program name with args. -set dummy ldconfig; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_LDCONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $LDCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /sbin /usr/sbin $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_LDCONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_LDCONFIG" && ac_cv_path_LDCONFIG="true" - ;; -esac -fi -LDCONFIG=$ac_cv_path_LDCONFIG -if test -n "$LDCONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 -printf "%s\n" "$LDCONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -for ac_prog in msgfmt -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MSGFMT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$MSGFMT"; then - ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MSGFMT="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MSGFMT=$ac_cv_prog_MSGFMT -if test -n "$MSGFMT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -printf "%s\n" "$MSGFMT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$MSGFMT" && break -done -test -n "$MSGFMT" || MSGFMT="false" - -if test ${ac_tool_prefix+y} -then : - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$PKG_CONFIG"; then - ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PKG_CONFIG=$ac_cv_prog_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if ${ac_cv_prog_PKG_CONFIG:+false} : -then : - if test "x$cross_compiling" = xyes -then : - -else $as_nop - { ac_cv_prog_PKG_CONFIG=; unset ac_cv_prog_PKG_CONFIG;} - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$PKG_CONFIG"; then - ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PKG_CONFIG="pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PKG_CONFIG=$ac_cv_prog_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -else $as_nop - PKG_CONFIG=$ac_cv_prog_PKG_CONFIG -fi - -if test "x$enable_maintainer_mode" != "xyes" -then - FONTFORGE="" - RSVG="" - CONVERT="" - ICOTOOL="" -else - test "$srcdir" = . || as_fn_error $? "Maintainer mode cannot work out of tree." "$LINENO" 5 - for ac_prog in fontforge -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_FONTFORGE+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$FONTFORGE"; then - ac_cv_prog_FONTFORGE="$FONTFORGE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FONTFORGE="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -FONTFORGE=$ac_cv_prog_FONTFORGE -if test -n "$FONTFORGE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FONTFORGE" >&5 -printf "%s\n" "$FONTFORGE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$FONTFORGE" && break -done -test -n "$FONTFORGE" || FONTFORGE="false" - - for ac_prog in rsvg-convert rsvg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RSVG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$RSVG"; then - ac_cv_prog_RSVG="$RSVG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RSVG="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RSVG=$ac_cv_prog_RSVG -if test -n "$RSVG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RSVG" >&5 -printf "%s\n" "$RSVG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$RSVG" && break -done -test -n "$RSVG" || RSVG="false" - - for ac_prog in convert -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CONVERT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CONVERT"; then - ac_cv_prog_CONVERT="$CONVERT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CONVERT="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CONVERT=$ac_cv_prog_CONVERT -if test -n "$CONVERT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONVERT" >&5 -printf "%s\n" "$CONVERT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CONVERT" && break -done -test -n "$CONVERT" || CONVERT="false" - - for ac_prog in icotool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ICOTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ICOTOOL"; then - ac_cv_prog_ICOTOOL="$ICOTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ICOTOOL="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ICOTOOL=$ac_cv_prog_ICOTOOL -if test -n "$ICOTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ICOTOOL" >&5 -printf "%s\n" "$ICOTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ICOTOOL" && break -done -test -n "$ICOTOOL" || ICOTOOL="false" - - test "$FONTFORGE" != "false" || as_fn_error $? "You need fontforge to rebuild fonts in maintainer mode." "$LINENO" 5 - test "$RSVG" != "false" || as_fn_error $? "You need rsvg to rebuild icons in maintainer mode." "$LINENO" 5 - - if test "$CONVERT" = false - then - as_fn_error $? "You need imagemagick to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recent enough imagemagick" >&5 -printf %s "checking for recent enough imagemagick... " >&6; } - convert_version=`convert --version | head -n1` - if test "x$convert_version" != "x" - then - convert_version_major=`expr "$convert_version" : '.* \([0-9]*\)\.[0-9]*'` - convert_version_minor=`expr "$convert_version" : '.* [0-9]*\.\([0-9]*\)'` - if test "$convert_version_major" -eq 6 -a "$convert_version_minor" -lt 6 - then - CONVERT=false - fi - fi - if test "$CONVERT" = false - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($convert_version_major.$convert_version_minor)" >&5 -printf "%s\n" "no ($convert_version_major.$convert_version_minor)" >&6; } - as_fn_error $? "You need imagemagick version 6.6 or newer to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($convert_version_major.$convert_version_minor)" >&5 -printf "%s\n" "yes ($convert_version_major.$convert_version_minor)" >&6; } - fi - fi - - if test "$ICOTOOL" = false - then - as_fn_error $? "You need icotool to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recent enough icotool" >&5 -printf %s "checking for recent enough icotool... " >&6; } - icotool_version=`icotool --version | head -n1` - if test "x$icotool_version" != "x" - then - icotool_version_major=`expr "$icotool_version" : '.* \([0-9]*\)\.[0-9]*'` - icotool_version_minor=`expr "$icotool_version" : '.* [0-9]*\.\([0-9]*\)'` - if test "$icotool_version_major" -eq 0 -a "$icotool_version_minor" -lt 29 - then - ICOTOOL=false - as_fn_append wine_warnings "|icotool version 0.29.0 or newer is needed to rebuild icons." - fi - fi - if test "$ICOTOOL" = false - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($icotool_version_major.$icotool_version_minor)" >&5 -printf "%s\n" "no ($icotool_version_major.$icotool_version_minor)" >&6; } - as_fn_error $? "You need icotool version 0.29.0 or newer to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($icotool_version_major.$icotool_version_minor)" >&5 -printf "%s\n" "yes ($icotool_version_major.$icotool_version_minor)" >&6; } - fi - fi - - with_gettext=yes - with_gettextpo=yes - - enable_werror=yes -fi - -test "x$with_gettext" != xno || MSGFMT=false -if test "$MSGFMT" != "false" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether msgfmt supports contexts" >&5 -printf %s "checking whether msgfmt supports contexts... " >&6; } -if test ${wine_cv_msgfmt_contexts+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat >conftest.po <&5 - then - wine_cv_msgfmt_contexts=yes - else - wine_cv_msgfmt_contexts=no - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_msgfmt_contexts" >&5 -printf "%s\n" "$wine_cv_msgfmt_contexts" >&6; } - test $wine_cv_msgfmt_contexts != no || MSGFMT=false -fi -if test "$MSGFMT" = false -then : - case "x$with_gettext" in - x) as_fn_append wine_warnings "|gettext tools not found (or too old), translations won't be built." ;; - xno) ;; - *) as_fn_error $? "gettext tools not found (or too old), translations won't be built. -This is an error since --with-gettext was requested." "$LINENO" 5 ;; -esac -enable_po=${enable_po:-no} -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_set_ldt in -li386" >&5 -printf %s "checking for i386_set_ldt in -li386... " >&6; } -if test ${ac_cv_lib_i386_i386_set_ldt+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-li386 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char i386_set_ldt (); -int -main (void) -{ -return i386_set_ldt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_i386_i386_set_ldt=yes -else $as_nop - ac_cv_lib_i386_i386_set_ldt=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_i386_i386_set_ldt" >&5 -printf "%s\n" "$ac_cv_lib_i386_i386_set_ldt" >&6; } -if test "x$ac_cv_lib_i386_i386_set_ldt" = xyes -then : - I386_LIBS="-li386" - -fi - - -OPENGL_LIBS="" - - - -# Check whether --enable-largefile was given. -if test ${enable_largefile+y} -then : - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -printf %s "checking for special C compiler options needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF - if ac_fn_c_try_compile "$LINENO" -then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test ${ac_cv_sys_file_offset_bits+y} -then : - printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } -if test ${ac_cv_sys_large_files+y} -then : - printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -printf "%s\n" "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h -;; -esac -rm -rf conftest* - fi -fi - - -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" -if test "x$ac_cv_header_CL_cl_h" = xyes -then : - printf "%s\n" "#define HAVE_CL_CL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "EGL/egl.h" "ac_cv_header_EGL_egl_h" "$ac_includes_default" -if test "x$ac_cv_header_EGL_egl_h" = xyes -then : - printf "%s\n" "#define HAVE_EGL_EGL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "OpenCL/opencl.h" "ac_cv_header_OpenCL_opencl_h" "$ac_includes_default" -if test "x$ac_cv_header_OpenCL_opencl_h" = xyes -then : - printf "%s\n" "#define HAVE_OPENCL_OPENCL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_nameser_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_types_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "asm/user.h" "ac_cv_header_asm_user_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_user_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "elf.h" "ac_cv_header_elf_h" "$ac_includes_default" -if test "x$ac_cv_header_elf_h" = xyes -then : - printf "%s\n" "#define HAVE_ELF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" -if test "x$ac_cv_header_float_h" = xyes -then : - printf "%s\n" "#define HAVE_FLOAT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "gettext-po.h" "ac_cv_header_gettext_po_h" "$ac_includes_default" -if test "x$ac_cv_header_gettext_po_h" = xyes -then : - printf "%s\n" "#define HAVE_GETTEXT_PO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "libproc.h" "ac_cv_header_libproc_h" "$ac_includes_default" -if test "x$ac_cv_header_libproc_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBPROC_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "link.h" "ac_cv_header_link_h" "$ac_includes_default" -if test "x$ac_cv_header_link_h" = xyes -then : - printf "%s\n" "#define HAVE_LINK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/cdrom.h" "ac_cv_header_linux_cdrom_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_cdrom_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CDROM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/filter.h" "ac_cv_header_linux_filter_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_filter_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_FILTER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/hdreg.h" "ac_cv_header_linux_hdreg_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_hdreg_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_HDREG_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/hidraw.h" "ac_cv_header_linux_hidraw_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_hidraw_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_HIDRAW_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_input_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/ioctl.h" "ac_cv_header_linux_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IOCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/major.h" "ac_cv_header_linux_major_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_major_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_MAJOR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/param.h" "ac_cv_header_linux_param_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_param_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_PARAM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_serial_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_SERIAL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/types.h" "ac_cv_header_linux_types_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_types_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/ucdrom.h" "ac_cv_header_linux_ucdrom_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_ucdrom_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_UCDROM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/wireless.h" "ac_cv_header_linux_wireless_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_wireless_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_WIRELESS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "lwp.h" "ac_cv_header_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_h" = xyes -then : - printf "%s\n" "#define HAVE_LWP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mach-o/loader.h" "ac_cv_header_mach_o_loader_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_o_loader_h" = xyes -then : - printf "%s\n" "#define HAVE_MACH_O_LOADER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_mach_h" = xyes -then : - printf "%s\n" "#define HAVE_MACH_MACH_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "machine/cpu.h" "ac_cv_header_machine_cpu_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_cpu_h" = xyes -then : - printf "%s\n" "#define HAVE_MACHINE_CPU_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "machine/sysarch.h" "ac_cv_header_machine_sysarch_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_sysarch_h" = xyes -then : - printf "%s\n" "#define HAVE_MACHINE_SYSARCH_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_mntent_h" = xyes -then : - printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_systm_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_SYSTM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_tcp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_fsm.h" "ac_cv_header_netinet_tcp_fsm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_tcp_fsm_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_FSM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "pcap/pcap.h" "ac_cv_header_pcap_pcap_h" "$ac_includes_default" -if test "x$ac_cv_header_pcap_pcap_h" = xyes -then : - printf "%s\n" "#define HAVE_PCAP_PCAP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default" -if test "x$ac_cv_header_port_h" = xyes -then : - printf "%s\n" "#define HAVE_PORT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" -if test "x$ac_cv_header_pwd_h" = xyes -then : - printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/scsi.h" "ac_cv_header_scsi_scsi_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_scsi_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SCSI_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/scsi_ioctl.h" "ac_cv_header_scsi_scsi_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_scsi_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SCSI_IOCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/sg.h" "ac_cv_header_scsi_sg_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_sg_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SG_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = xyes -then : - printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/attr.h" "ac_cv_header_sys_attr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_attr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_ATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/auxv.h" "ac_cv_header_sys_auxv_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_auxv_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_AUXV_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/cdio.h" "ac_cv_header_sys_cdio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_cdio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_CDIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_epoll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_event_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/extattr.h" "ac_cv_header_sys_extattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_extattr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EXTATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_filio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ipc_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IPC_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/link.h" "ac_cv_header_sys_link_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_link_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_LINK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_modem_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mtio.h" "ac_cv_header_sys_mtio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mtio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MTIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_prctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/ptrace.h" "ac_cv_header_sys_ptrace_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ptrace_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PTRACE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/queue.h" "ac_cv_header_sys_queue_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_queue_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_QUEUE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_random_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_resource_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/scsiio.h" "ac_cv_header_sys_scsiio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_scsiio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SCSIIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_shm_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SHM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/signal.h" "ac_cv_header_sys_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_signal_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SIGNAL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/socketvar.h" "ac_cv_header_sys_socketvar_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socketvar_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKETVAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sockio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statvfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/strtio.h" "ac_cv_header_sys_strtio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_strtio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STRTIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_syscall_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sysinfo.h" "ac_cv_header_sys_sysinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysinfo_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSINFO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_times_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_uio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_user_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_utsname_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/vnode.h" "ac_cv_header_sys_vnode_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_vnode_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_VNODE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_xattr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_XATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "syscall.h" "ac_cv_header_syscall_h" "$ac_includes_default" -if test "x$ac_cv_header_syscall_h" = xyes -then : - printf "%s\n" "#define HAVE_SYSCALL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" -if test "x$ac_cv_header_utime_h" = xyes -then : - printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "valgrind/memcheck.h" "ac_cv_header_valgrind_memcheck_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_memcheck_h" = xyes -then : - printf "%s\n" "#define HAVE_VALGRIND_MEMCHECK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_valgrind_h" = xyes -then : - printf "%s\n" "#define HAVE_VALGRIND_VALGRIND_H 1" >>confdefs.h - -fi - -ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes -then : - -printf "%s\n" "#define MAJOR_IN_MKDEV 1" >>confdefs.h - -fi - -if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes -then : - -printf "%s\n" "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 -printf %s "checking whether stat file-mode macros are broken... " >&6; } -if test ${ac_cv_header_stat_broken+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -#if defined S_ISBLK && defined S_IFDIR -extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; -#endif - -#if defined S_ISBLK && defined S_IFCHR -extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; -#endif - -#if defined S_ISLNK && defined S_IFREG -extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; -#endif - -#if defined S_ISSOCK && defined S_IFREG -extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_header_stat_broken=no -else $as_nop - ac_cv_header_stat_broken=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 -printf "%s\n" "$ac_cv_header_stat_broken" >&6; } -if test $ac_cv_header_stat_broken = yes; then - -printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h - -fi - - - -ac_fn_c_check_header_compile "$LINENO" "sys/conf.h" "ac_cv_header_sys_conf_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_conf_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_CONF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_mount_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MOUNT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/statfs.h" "ac_cv_header_sys_statfs_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_statfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STATFS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_user_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_vfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_VFS_H 1" >>confdefs.h - -fi - - -saved_sysctl_h_CFLAGS=$CFLAGS -test "x${GCC}" != xyes || CFLAGS="$CFLAGS -Werror" -ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_sysctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSCTL_H 1" >>confdefs.h - -fi - -CFLAGS=$saved_sysctl_h_CFLAGS - -ac_fn_c_check_header_compile "$LINENO" "netinet/ip.h" "ac_cv_header_netinet_ip_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_arp.h" "ac_cv_header_net_if_arp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_arp_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_ARP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_dl_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_DL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_types_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_route_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_ROUTE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_if_ether_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IF_ETHER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in_pcb.h" "ac_cv_header_netinet_in_pcb_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_in_pcb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_PCB_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/ip_icmp.h" "ac_cv_header_netinet_ip_icmp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_icmp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_ICMP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/ip_var.h" "ac_cv_header_netinet_ip_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/udp.h" "ac_cv_header_netinet_udp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_udp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_UDP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet6/ip6_var.h" "ac_cv_header_netinet6_ip6_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet6_ip6_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET6_IP6_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netipx/ipx.h" "ac_cv_header_netipx_ipx_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netipx_ipx_h" = xyes -then : - printf "%s\n" "#define HAVE_NETIPX_IPX_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_sys_un_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "netinet/udp_var.h" "ac_cv_header_netinet_udp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_udp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_UDP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/icmp_var.h" "ac_cv_header_netinet_icmp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_icmp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_ICMP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/icmp6.h" "ac_cv_header_netinet_icmp6_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_icmp6_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_ICMP6_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_tcp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_VAR_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "linux/ipx.h" "ac_cv_header_linux_ipx_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_ipx_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IPX_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/irda.h" "ac_cv_header_linux_irda_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_irda_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IRDA_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/rtnetlink.h" "ac_cv_header_linux_rtnetlink_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_rtnetlink_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_RTNETLINK_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#include - #include - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_ARPA_NAMESER_H - # include - #endif -" -if test "x$ac_cv_header_resolv_h" = xyes -then : - printf "%s\n" "#define HAVE_RESOLV_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "#include -" -if test "x$ac_cv_header_ifaddrs_h" = xyes -then : - printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/ucontext.h" "ac_cv_header_sys_ucontext_h" "#include -" -if test "x$ac_cv_header_sys_ucontext_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UCONTEXT_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include -#ifdef HAVE_SYS_UCONTEXT_H -#include -#endif -" -if test "x$ac_cv_header_sys_thr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_THR_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "#include -" -if test "x$ac_cv_header_pthread_np_h" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "#include -#include -#ifdef HAVE_ASM_TYPES_H -#include -#endif -" -if test "x$ac_cv_header_linux_videodev2_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_VIDEODEV2_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "libprocstat.h" "ac_cv_header_libprocstat_h" "#ifdef HAVE_SYS_PARAM_H -#include -#endif -#include -#ifdef HAVE_SYS_QUEUE_H -#include -#endif -" -if test "x$ac_cv_header_libprocstat_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBPROCSTAT_H 1" >>confdefs.h - -fi - - -if test "x$ac_cv_header_sys_xattr_h" = xyes -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getxattr takes additional arguments" >&5 -printf %s "checking whether getxattr takes additional arguments... " >&6; } -if test ${wine_cv_xattr_extra_args+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -getxattr("", "", "", 0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - wine_cv_xattr_extra_args=yes -else $as_nop - wine_cv_xattr_extra_args=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_xattr_extra_args" >&5 -printf "%s\n" "$wine_cv_xattr_extra_args" >&6; } - test $wine_cv_xattr_extra_args != yes || -printf "%s\n" "#define XATTR_ADDITIONAL_OPTIONS 1" >>confdefs.h - -fi - - -DLLFLAGS="" - -LDDLLFLAGS="" - -LDEXECFLAGS="" - -EXTRACFLAGS="" - -UNIXDLLFLAGS="-fPIC" - -UNIXLDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname,\$(UNIXLIB)" - -TOP_INSTALL_LIB="" - -TOP_INSTALL_DEV="" - -WINELOADER_LDFLAGS="" - -WINEPRELOADER_LDFLAGS="" - -DLLEXT=".so" - -LIBEXT="so" -# Extract the first word of "ldd", so it can be a program name with args. -set dummy ldd; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_LDD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/sbin:/usr/sbin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_LDD="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_LDD" && ac_cv_path_LDD="true" - ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -printf "%s\n" "$LDD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -printf "%s\n" "$OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -printf "%s\n" "$ac_ct_OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL="otool" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. -set dummy ${ac_tool_prefix}readelf; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_READELF+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$READELF"; then - ac_cv_prog_READELF="$READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_READELF="${ac_tool_prefix}readelf" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -READELF=$ac_cv_prog_READELF -if test -n "$READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -printf "%s\n" "$READELF" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_READELF"; then - ac_ct_READELF=$READELF - # Extract the first word of "readelf", so it can be a program name with args. -set dummy readelf; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_READELF+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_READELF"; then - ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_READELF="readelf" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_READELF=$ac_cv_prog_ac_ct_READELF -if test -n "$ac_ct_READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -printf "%s\n" "$ac_ct_READELF" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_READELF" = x; then - READELF="true" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - READELF=$ac_ct_READELF - fi -else - READELF="$ac_cv_prog_READELF" -fi - -wine_rules="all:" -SUBDIRS="" - -DISABLED_SUBDIRS="" - -CONFIGURE_TARGETS="" - - -wine_fn_config_makefile () -{ - as_fn_append SUBDIRS " \\$as_nl $1" - eval enable=\$$2 - case "$enable" in - no) as_fn_append DISABLED_SUBDIRS " $1" ;; - yes) ;; - *aarch64*|*arm*|*i386*|*x86_64*) - if test -n "$PE_ARCHS" - then - for i in $PE_ARCHS - do - test $(expr ",$enable," : ".*,$i,") -gt 0 || as_fn_append ${i}_DISABLED_SUBDIRS " $1" - done - else - test $(expr ",$enable," : ".*,$HOST_ARCH,") -gt 0 || as_fn_append DISABLED_SUBDIRS " $1" - fi ;; - "") - case "$1, $PE_ARCHS " in - programs/*,*\ arm64ec\ *) as_fn_append arm64ec_DISABLED_SUBDIRS " $1" ;; - esac ;; - esac -} - -wine_fn_config_symlink () -{ - ac_links=$@ - as_fn_append wine_rules " -$ac_links: - @./config.status \$@" - for f in $ac_links; do as_fn_append CONFIGURE_TARGETS " $f"; done -} - -case $host_os in - cygwin*|mingw32*) - LIBEXT="dll" - DLLEXT="" - EXTRACFLAGS="-D__WINE_PE_BUILD" - if test "x$HOST_ARCH" = xi386 -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--disable-stdcall-fixup" >&5 -printf %s "checking whether the compiler supports -Wl,--disable-stdcall-fixup... " >&6; } -if test ${ac_cv_cflags__Wl___disable_stdcall_fixup+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--disable-stdcall-fixup" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___disable_stdcall_fixup=yes -else $as_nop - ac_cv_cflags__Wl___disable_stdcall_fixup=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___disable_stdcall_fixup" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___disable_stdcall_fixup" >&6; } -if test "x$ac_cv_cflags__Wl___disable_stdcall_fixup" = xyes -then : - LDDLLFLAGS="-Wl,--disable-stdcall-fixup" -fi -fi - enable_loader=${enable_loader:-no} - enable_server=${enable_server:-no} - with_x=${with_x:-no} - with_pthread=${with_pthread:-no} - ;; - - darwin*|macosx*) - LIBEXT="dylib" - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - enable_winemac_drv=${enable_winemac_drv:-yes} - CARBON_LIBS="-framework Carbon" - - COREFOUNDATION_LIBS="-framework CoreFoundation" - - DISKARBITRATION_LIBS="-framework DiskArbitration -framework CoreFoundation" - - IOKIT_LIBS="-framework IOKit -framework CoreFoundation" - - METAL_LIBS="-framework Metal" - - APPLICATIONSERVICES_LIBS="-framework ApplicationServices" - - CORESERVICES_LIBS="-framework CoreServices" - - APPKIT_LIBS="-framework AppKit" - - SECURITY_LIBS="-framework Security -framework CoreFoundation" - - SYSTEMCONFIGURATION_LIBS="-framework SystemConfiguration" - - - WINELOADER_LDFLAGS="-Wl,-pie,-segalign,0x1000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,loader/wine_info.plist" - - case $HOST_ARCH in - i386|x86_64) wine_can_build_preloader=yes ;; - *) wine_can_build_preloader=no ;; - esac - - if test "$wine_can_build_preloader" = "yes" - then - WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs -e _start -ldylib1.o -mmacosx-version-min=10.7 -Wl,-no_new_main,-segalign,0x1000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,loader/wine_info.plist" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_pie" >&5 -printf %s "checking whether the compiler supports -Wl,-no_pie... " >&6; } -if test ${ac_cv_cflags__Wl__no_pie+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-no_pie" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__no_pie=yes -else $as_nop - ac_cv_cflags__Wl__no_pie=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__no_pie" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__no_pie" >&6; } -if test "x$ac_cv_cflags__Wl__no_pie" = xyes -then : - WINEPRELOADER_LDFLAGS="-Wl,-no_pie $WINEPRELOADER_LDFLAGS" -fi - case $HOST_ARCH in - i386) - WINEPRELOADER_LDFLAGS="-Wl,-image_base,0x7d400000 $WINEPRELOADER_LDFLAGS" - ;; - x86_64) - WINEPRELOADER_LDFLAGS="-Wl,-image_base,0x200000000,-segalign,0x1000,-segaddr,WINE_RESERVE,0x1000 $WINEPRELOADER_LDFLAGS" - ;; - esac - WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -mmacosx-version-min=10.7" - else - as_fn_append wine_warnings "|can't build Wine preloader; many programs won't work" - fi - - if test "x$with_coreaudio" != "xno"; - then - COREAUDIO_LIBS="-framework CoreFoundation -framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreMIDI" - - enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-yes} - fi - if test "$ac_cv_header_OpenCL_opencl_h" = "yes" - then - OPENCL_LIBS="-framework OpenCL" - - ac_cv_lib_OpenCL_clGetPlatformInfo=yes - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether MTLDevice protocol supports registryID property" >&5 -printf %s "checking whether MTLDevice protocol supports registryID property... " >&6; } - ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - - ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc objcc objc cc CC clang - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OBJC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJC"; then - ac_cv_prog_OBJC="$OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJC=$ac_cv_prog_OBJC -if test -n "$OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJC" >&5 -printf "%s\n" "$OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$OBJC" && break - done -fi -if test -z "$OBJC"; then - ac_ct_OBJC=$OBJC - for ac_prog in gcc objcc objc cc CC clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OBJC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJC"; then - ac_cv_prog_ac_ct_OBJC="$ac_ct_OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC -if test -n "$ac_ct_OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJC" >&5 -printf "%s\n" "$ac_ct_OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_OBJC" && break -done - - if test "x$ac_ct_OBJC" = x; then - OBJC="gcc" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJC=$ac_ct_OBJC - fi -fi - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Objective C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Objective C" >&5 -printf %s "checking whether the compiler supports GNU Objective C... " >&6; } -if test ${ac_cv_objc_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_objc_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objc_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_objc_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GOBJC=yes -else - GOBJC= -fi -ac_test_OBJCFLAGS=${OBJCFLAGS+y} -ac_save_OBJCFLAGS=$OBJCFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5 -printf %s "checking whether $OBJC accepts -g... " >&6; } -if test ${ac_cv_prog_objc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_objc_werror_flag=$ac_objc_werror_flag - ac_objc_werror_flag=yes - ac_cv_prog_objc_g=no - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -else $as_nop - OBJCFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - -else $as_nop - ac_objc_werror_flag=$ac_save_objc_werror_flag - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_objc_werror_flag=$ac_save_objc_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_objc_g" >&5 -printf "%s\n" "$ac_cv_prog_objc_g" >&6; } -if test $ac_test_OBJCFLAGS; then - OBJCFLAGS=$ac_save_OBJCFLAGS -elif test $ac_cv_prog_objc_g = yes; then - if test "$GOBJC" = yes; then - OBJCFLAGS="-g -O2" - else - OBJCFLAGS="-g" - fi -else - if test "$GOBJC" = yes; then - OBJCFLAGS="-O2" - else - OBJCFLAGS= - fi -fi -ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -id device; device.registryID; - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_MTLDEVICE_REGISTRYID 1" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - UNIXLDFLAGS="-dynamiclib -install_name @rpath/\$(UNIXLIB) -Wl,-rpath,@loader_path\/" - WINELOADER_DEPENDS="wine_info.plist" - - ;; - - linux-android*) - -printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h - - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - LDEXECFLAGS="-Wl,-pie" - enable_wineandroid_drv=${enable_wineandroid_drv:-yes} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-z,defs" >&5 -printf %s "checking whether the compiler supports -Wl,-z,defs... " >&6; } -if test ${ac_cv_cflags__Wl__z_defs+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-z,defs" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__z_defs=yes -else $as_nop - ac_cv_cflags__Wl__z_defs=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__z_defs" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__z_defs" >&6; } -if test "x$ac_cv_cflags__Wl__z_defs" = xyes -then : - UNIXLDFLAGS="$UNIXLDFLAGS -Wl,-z,defs" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5 -printf %s "checking whether the compiler supports -fPIC -Wl,--export-dynamic... " >&6; } -if test ${ac_cv_cflags__fPIC__Wl___export_dynamic+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fPIC -Wl,--export-dynamic" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fPIC__Wl___export_dynamic=yes -else $as_nop - ac_cv_cflags__fPIC__Wl___export_dynamic=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5 -printf "%s\n" "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; } -if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes -then : - WINELOADER_LDFLAGS="-Wl,--export-dynamic" -fi - WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lEGL" >&5 -printf %s "checking for -lEGL... " >&6; } -if test ${ac_cv_lib_soname_EGL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lEGL $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char eglGetProcAddress (); -int -main (void) -{ -return eglGetProcAddress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_EGL=`$ac_cv_path_LDD conftest.exe | grep "EGL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_EGL=`$OTOOL -L conftest$ac_exeext | grep "libEGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libEGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_EGL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libEGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libEGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_EGL:+false} : -then : - ac_cv_lib_soname_EGL=`$LDD conftest$ac_exeext | grep "libEGL\\.$LIBEXT" | sed -e "s/^.*\(libEGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_EGL= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_EGL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_EGL" >&5 -printf "%s\n" "$ac_cv_lib_soname_EGL" >&6; } - -printf "%s\n" "#define SONAME_LIBEGL \"$ac_cv_lib_soname_EGL\"" >>confdefs.h - - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGLESv2" >&5 -printf %s "checking for -lGLESv2... " >&6; } -if test ${ac_cv_lib_soname_GLESv2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lGLESv2 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char glFlush (); -int -main (void) -{ -return glFlush (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GLESv2=`$ac_cv_path_LDD conftest.exe | grep "GLESv2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GLESv2=`$OTOOL -L conftest$ac_exeext | grep "libGLESv2\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGLESv2\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GLESv2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGLESv2\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGLESv2\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GLESv2:+false} : -then : - ac_cv_lib_soname_GLESv2=`$LDD conftest$ac_exeext | grep "libGLESv2\\.$LIBEXT" | sed -e "s/^.*\(libGLESv2\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_GLESv2= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_GLESv2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GLESv2" >&5 -printf "%s\n" "$ac_cv_lib_soname_GLESv2" >&6; } - -printf "%s\n" "#define SONAME_LIBGLESV2 \"$ac_cv_lib_soname_GLESv2\"" >>confdefs.h - - -fi - - if test "x$exec_prefix" = xNONE - then - case $HOST_ARCH in - i386) exec_prefix='${prefix}/x86' ;; - x86_64) exec_prefix='${prefix}/x86_64' ;; - arm) exec_prefix='${prefix}/armeabi-v7a' ;; - aarch64) exec_prefix='${prefix}/arm64-v8a' ;; - esac - fi - ;; - - *) - -printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h - - test "$ac_cv_sys_file_offset_bits" = 64 && -printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h - - if test $HOST_ARCH = i386 - then - DLLFLAGS="$DLLFLAGS -fno-PIC" - LDDLLFLAGS="-fno-PIC" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-PIC -Wl,-z,notext" >&5 -printf %s "checking whether the compiler supports -fno-PIC -Wl,-z,notext... " >&6; } -if test ${ac_cv_cflags__fno_PIC__Wl__z_notext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-PIC -Wl,-z,notext" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_PIC__Wl__z_notext=yes -else $as_nop - ac_cv_cflags__fno_PIC__Wl__z_notext=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_PIC__Wl__z_notext" >&5 -printf "%s\n" "$ac_cv_cflags__fno_PIC__Wl__z_notext" >&6; } -if test "x$ac_cv_cflags__fno_PIC__Wl__z_notext" = xyes -then : - LDDLLFLAGS="$LDDLLFLAGS -Wl,-z,notext" -fi - else - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wl,-z,defs works correctly" >&5 -printf %s "checking whether -Wl,-z,defs works correctly... " >&6; } -if test ${ac_cv_wl_z_defs+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $UNIXDLLFLAGS $UNIXLDFLAGS -Wl,-z,defs" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -extern char **environ; char **envp; void myfunc(void) { envp = environ; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_wl_z_defs=yes -else $as_nop - ac_cv_wl_z_defs=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ac_save_CFLAGS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wl_z_defs" >&5 -printf "%s\n" "$ac_cv_wl_z_defs" >&6; } - test $ac_cv_wl_z_defs != yes || as_fn_append UNIXLDFLAGS " -Wl,-z,defs" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--export-dynamic" >&5 -printf %s "checking whether the compiler supports -Wl,--export-dynamic... " >&6; } -if test ${ac_cv_cflags__Wl___export_dynamic+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--export-dynamic" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___export_dynamic=yes -else $as_nop - ac_cv_cflags__Wl___export_dynamic=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___export_dynamic" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___export_dynamic" >&6; } -if test "x$ac_cv_cflags__Wl___export_dynamic" = xyes -then : - WINELOADER_LDFLAGS="-Wl,--export-dynamic" -fi - WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs" - - case $host_os in - linux*) - as_fn_append WINELOADER_LDFLAGS " -pie" - case $HOST_ARCH in - i386|arm) - as_fn_append WINEPRELOADER_LDFLAGS " -static -Wl,-Ttext=0x7d400000" ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -static-pie" >&5 -printf %s "checking whether the compiler supports -static-pie... " >&6; } -if test ${ac_cv_cflags__static_pie+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -static-pie" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__static_pie=yes -else $as_nop - ac_cv_cflags__static_pie=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__static_pie" >&5 -printf "%s\n" "$ac_cv_cflags__static_pie" >&6; } -if test "x$ac_cv_cflags__static_pie" = xyes -then : - as_fn_append WINEPRELOADER_LDFLAGS " -static-pie" -else $as_nop - as_fn_append WINEPRELOADER_LDFLAGS " -static -Wl,-Ttext=0x7d7d00000000" -fi - ;; - esac - ;; - *) - case $HOST_ARCH in - i386|arm) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x60000000" >&5 -printf %s "checking whether the compiler supports -Wl,-Ttext-segment=0x60000000... " >&6; } -if test ${ac_cv_cflags__Wl__Ttext_segment_0x60000000+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x60000000" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__Ttext_segment_0x60000000=yes -else $as_nop - ac_cv_cflags__Wl__Ttext_segment_0x60000000=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x60000000" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__Ttext_segment_0x60000000" >&6; } -if test "x$ac_cv_cflags__Wl__Ttext_segment_0x60000000" = xyes -then : - as_fn_append WINELOADER_LDFLAGS " -Wl,-Ttext-segment=0x60000000" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x60000400" >&5 -printf %s "checking whether the compiler supports -Wl,--section-start,.interp=0x60000400... " >&6; } -if test ${ac_cv_cflags__Wl___section_start__interp_0x60000400+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x60000400" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___section_start__interp_0x60000400=yes -else $as_nop - ac_cv_cflags__Wl___section_start__interp_0x60000400=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x60000400" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___section_start__interp_0x60000400" >&6; } -if test "x$ac_cv_cflags__Wl___section_start__interp_0x60000400" = xyes -then : - as_fn_append WINELOADER_LDFLAGS " -Wl,--section-start,.interp=0x60000400" -fi -fi - ;; - *) - as_fn_append WINELOADER_LDFLAGS " -pie" - ;; - esac - ;; - esac - ;; -esac - -enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} -enable_wineandroid_drv=${enable_wineandroid_drv:-no} -enable_winemac_drv=${enable_winemac_drv:-no} - -PE_ARCHS="" - -cross_archs= -if test ${enable_archs+y} -then : - test "x$with_system_dllpath" = "x" || as_fn_error $? "\"The --with-system-dllpath option is not compatible with --enable-archs\"" "$LINENO" 5 - ac_save_IFS=$IFS - IFS=' ,' - set x $enable_archs - IFS=$ac_save_IFS - shift - for arch - do - case $arch in - i386|x86_64|arm|aarch64|arm64ec) cross_archs="$cross_archs $arch" ;; - *) as_fn_error $? "Unknown cross-compilation architecture '$arch'" "$LINENO" 5 ;; - esac - done -else $as_nop - if test "x$with_mingw" != xno - then - test $HOST_ARCH = unknown || cross_archs=$HOST_ARCH - fi -fi - -for wine_arch in $cross_archs -do - case "x$with_mingw" in - xclang|x*/clang) eval "${wine_arch}_CC=\$with_mingw" ;; - esac - if eval \${${wine_arch}_CC:+false} : -then : - case $wine_arch in - aarch64) - for ac_prog in aarch64-w64-mingw32-clang aarch64-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_aarch64_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$aarch64_CC"; then - ac_cv_prog_aarch64_CC="$aarch64_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_aarch64_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -aarch64_CC=$ac_cv_prog_aarch64_CC -if test -n "$aarch64_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $aarch64_CC" >&5 -printf "%s\n" "$aarch64_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$aarch64_CC" && break -done -test -n "$aarch64_CC" || aarch64_CC="false" - - ;; - arm64ec) - for ac_prog in arm64ec-w64-mingw32-clang arm64ec-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_arm64ec_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$arm64ec_CC"; then - ac_cv_prog_arm64ec_CC="$arm64ec_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_arm64ec_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -arm64ec_CC=$ac_cv_prog_arm64ec_CC -if test -n "$arm64ec_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $arm64ec_CC" >&5 -printf "%s\n" "$arm64ec_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$arm64ec_CC" && break -done -test -n "$arm64ec_CC" || arm64ec_CC="false" - - ;; - arm) - for ac_prog in armv7-w64-mingw32-clang armv7-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_arm_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$arm_CC"; then - ac_cv_prog_arm_CC="$arm_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_arm_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -arm_CC=$ac_cv_prog_arm_CC -if test -n "$arm_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $arm_CC" >&5 -printf "%s\n" "$arm_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$arm_CC" && break -done -test -n "$arm_CC" || arm_CC="false" - - ;; - i386) - ac_prefix_list="i686-w64-mingw32-gcc i586-w64-mingw32-gcc i486-w64-mingw32-gcc i386-w64-mingw32-gcc i686-w64-mingw32-clang i586-w64-mingw32-clang i486-w64-mingw32-clang i386-w64-mingw32-clang " - for ac_prog in $ac_prefix_list clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_i386_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$i386_CC"; then - ac_cv_prog_i386_CC="$i386_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_i386_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -i386_CC=$ac_cv_prog_i386_CC -if test -n "$i386_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $i386_CC" >&5 -printf "%s\n" "$i386_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$i386_CC" && break -done -test -n "$i386_CC" || i386_CC="false" - - ;; - x86_64) - ac_prefix_list="x86_64-w64-mingw32-gcc amd64-w64-mingw32-gcc x86_64-w64-mingw32-clang amd64-w64-mingw32-clang " - for ac_prog in $ac_prefix_list clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_x86_64_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$x86_64_CC"; then - ac_cv_prog_x86_64_CC="$x86_64_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_x86_64_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -x86_64_CC=$ac_cv_prog_x86_64_CC -if test -n "$x86_64_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $x86_64_CC" >&5 -printf "%s\n" "$x86_64_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$x86_64_CC" && break -done -test -n "$x86_64_CC" || x86_64_CC="false" - - ;; - esac -fi - - saved_CC=$CC - saved_CFLAGS=$CFLAGS - saved_LDFLAGS=$LDFLAGS - - CFLAGS=${CROSSCFLAGS:-"-g -O2"} - LDFLAGS=$CROSSLDFLAGS - eval CC=\$${wine_arch}_CC - eval ${wine_arch}_CFLAGS=\$CFLAGS - eval ${wine_arch}_LDFLAGS=\$LDFLAGS - eval "${wine_arch}_EXTRACFLAGS=\"-D__WINE_PE_BUILD -Wall\"" - - target="" - as_wine_cv_crosscc=`printf "%s\n" "ac_cv_${wine_arch}_crosscc" | $as_tr_sh` - - if eval test \"x\$"${wine_arch}_CC"\" = x"false" -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 -printf %s "checking whether $CC works... " >&6; } -if eval test \${$as_wine_cv_crosscc+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_crosscc=yes" -else $as_nop - eval "$as_wine_cv_crosscc=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$as_wine_cv_crosscc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -fi - if eval test \"x\$"$as_wine_cv_crosscc"\" = x"yes" -then : - set x $CC - shift - while test $# -ge 1 - do - case "$1" in - *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;; - *-clang) target=`expr "$1" : '\(.*\)-clang'` ;; - esac - shift - done - - llvm_target=$target - if test -z "$llvm_target" - then - case $wine_arch in - i386) llvm_target=i686-windows ;; - arm) llvm_target=armv7-windows ;; - *) llvm_target=$wine_arch-windows ;; - esac - fi - llvm_extra_cflags="-target $llvm_target -fuse-ld=lld" - llvm_extra_ldflags="" - case $llvm_target in - *windows) llvm_cflags="-Wl,-subsystem:console -Wl,-WX" ;; - esac - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_$llvm_extra_cflags $llvm_cflags --no-default-config" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $llvm_extra_cflags $llvm_cflags --no-default-config" >&5 -printf %s "checking whether $CC supports $llvm_extra_cflags $llvm_cflags --no-default-config... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $llvm_extra_cflags $llvm_cflags --no-default-config" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - llvm_extra_cflags="$llvm_extra_cflags --no-default-config" - llvm_extra_ldflags="--no-default-config" -else $as_nop - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_$llvm_extra_cflags $llvm_cflags" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $llvm_extra_cflags $llvm_cflags" >&5 -printf %s "checking whether $CC supports $llvm_extra_cflags $llvm_cflags... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $llvm_extra_cflags $llvm_cflags" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - : -else $as_nop - llvm_extra_cflags="" -fi } -fi } - if test -n "$llvm_extra_cflags" - then - target=$llvm_target - eval "${wine_arch}_DELAYLOADFLAG=\"-Wl,-delayload,\"" - as_fn_append ${wine_arch}_EXTRACFLAGS " $llvm_extra_cflags" - as_fn_append ${wine_arch}_LDFLAGS " $llvm_extra_ldflags" - CFLAGS="$llvm_extra_cflags $llvm_cflags" - fi - eval "${wine_arch}_TARGET=\$target" -fi - - - if test -z "$target" - then - if test ${enable_archs+y} -then : - as_fn_error $? "MinGW $wine_arch compiler not found. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - CC=$saved_CC - CFLAGS=$saved_CFLAGS - LDFLAGS=$saved_LDFLAGS - continue - fi - - as_wine_cv_crosscc_c99=`printf "%s\n" "ac_cv_${wine_arch}_crosscc_c99" | $as_tr_sh` - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } - if eval test \${$as_wine_cv_crosscc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "$as_wine_cv_crosscc_c99=no" - for arg in '' '-std=gnu99' '-D__STDC__' - do - test -z "$arg" || CC="$CC $arg" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_crosscc_c99=\$arg" -else $as_nop - eval "$as_wine_cv_crosscc_c99=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval CC=\$${wine_arch}_CC - if eval test \"x\$"$as_wine_cv_crosscc_c99"\" = x"no" -then : - -else $as_nop - break -fi - done -fi - - eval res=\$$as_wine_cv_crosscc_c99 - - case "x$res" in - x) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } ;; - xno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } - CC=$saved_CC - CFLAGS=$saved_CFLAGS - LDFLAGS=$saved_LDFLAGS - if test ${enable_archs+y} -then : - as_fn_error $? "MinGW $wine_arch compiler supporting C99 not found. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - continue - ;; - x*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $res" >&5 -printf "%s\n" "$res" >&6; } - as_fn_append ${wine_arch}_CC " $res" ;; - esac - - if test "x$wine_arch" = xi386 -then : - -else $as_nop - as_wine_cv_seh_support=`printf "%s\n" "ac_cv_${wine_arch}_seh_support" | $as_tr_sh` - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports SEH directives" >&5 -printf %s "checking whether $CC supports SEH directives... " >&6; } -if eval test \${$as_wine_cv_seh_support+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -asm(".text\nac_test:\t.seh_proc ac_test\n\tnop\n\t.seh_stackalloc 16\n\t.seh_endprologue\n\t.seh_endproc"); -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_seh_support=yes" -else $as_nop - eval "$as_wine_cv_seh_support=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$as_wine_cv_seh_support - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval res=\$$as_wine_cv_seh_support - - if test "x$res" = xyes -then : - -else $as_nop - if test ${enable_archs+y} -then : - as_fn_error $? "The $wine_arch cross-compiler doesn't support SEH directives. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - continue -fi -fi - - as_fn_append PE_ARCHS " $wine_arch" - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fno-strict-aliasing" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5 -printf %s "checking whether $CC supports -fno-strict-aliasing... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fno-strict-aliasing" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fno-strict-aliasing" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror=unknown-warning-option" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror=unknown-warning-option" >&5 -printf %s "checking whether $CC supports -Werror=unknown-warning-option... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror=unknown-warning-option" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - CFLAGS="$CFLAGS -Werror=unknown-warning-option" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror=ignored-optimization-argument" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror=ignored-optimization-argument" >&5 -printf %s "checking whether $CC supports -Werror=ignored-optimization-argument... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror=ignored-optimization-argument" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wdeclaration-after-statement" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5 -printf %s "checking whether $CC supports -Wdeclaration-after-statement... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wdeclaration-after-statement" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wdeclaration-after-statement" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wempty-body" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 -printf %s "checking whether $CC supports -Wempty-body... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wempty-body" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wempty-body" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wignored-qualifiers" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wignored-qualifiers" >&5 -printf %s "checking whether $CC supports -Wignored-qualifiers... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wignored-qualifiers" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wignored-qualifiers" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Winit-self" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Winit-self" >&5 -printf %s "checking whether $CC supports -Winit-self... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Winit-self" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Winit-self" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpacked-not-aligned" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpacked-not-aligned" >&5 -printf %s "checking whether $CC supports -Wpacked-not-aligned... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpacked-not-aligned" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-packed-not-aligned" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpragma-pack" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpragma-pack" >&5 -printf %s "checking whether $CC supports -Wpragma-pack... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpragma-pack" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-pragma-pack" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wmicrosoft-enum-forward-reference" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmicrosoft-enum-forward-reference" >&5 -printf %s "checking whether $CC supports -Wmicrosoft-enum-forward-reference... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wmicrosoft-enum-forward-reference" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-microsoft-enum-forward-reference" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wshift-overflow=2" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshift-overflow=2" >&5 -printf %s "checking whether $CC supports -Wshift-overflow=2... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wshift-overflow=2" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wshift-overflow=2" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wstrict-prototypes" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstrict-prototypes" >&5 -printf %s "checking whether $CC supports -Wstrict-prototypes... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wstrict-prototypes" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wstrict-prototypes" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wtype-limits" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wtype-limits" >&5 -printf %s "checking whether $CC supports -Wtype-limits... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wtype-limits" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wtype-limits" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wunused-but-set-parameter" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-but-set-parameter" >&5 -printf %s "checking whether $CC supports -Wunused-but-set-parameter... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wunused-but-set-parameter" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wunused-but-set-parameter" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wvla" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wvla" >&5 -printf %s "checking whether $CC supports -Wvla... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wvla" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wvla" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wwrite-strings" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wwrite-strings" >&5 -printf %s "checking whether $CC supports -Wwrite-strings... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wwrite-strings" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wwrite-strings" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpointer-arith" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpointer-arith" >&5 -printf %s "checking whether $CC supports -Wpointer-arith... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpointer-arith" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wpointer-arith" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wlogical-op" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wlogical-op" >&5 -printf %s "checking whether $CC supports -Wlogical-op... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wlogical-op" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wlogical-op" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wabsolute-value" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wabsolute-value" >&5 -printf %s "checking whether $CC supports -Wabsolute-value... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wabsolute-value" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wabsolute-value" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-conversion" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5 -printf %s "checking whether $CC supports -Wenum-conversion... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wenum-conversion" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wenum-conversion" -fi } - - case $wine_arch in - i386) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fno-omit-frame-pointer" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5 -printf %s "checking whether $CC supports -fno-omit-frame-pointer... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fno-omit-frame-pointer" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fno-omit-frame-pointer" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mpreferred-stack-boundary=2" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mpreferred-stack-boundary=2" >&5 -printf %s "checking whether $CC supports -mpreferred-stack-boundary=2... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mpreferred-stack-boundary=2" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mpreferred-stack-boundary=2" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wl,--disable-stdcall-fixup" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--disable-stdcall-fixup" >&5 -printf %s "checking whether $CC supports -Wl,--disable-stdcall-fixup... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wl,--disable-stdcall-fixup" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_LDFLAGS " -Wl,--disable-stdcall-fixup" -fi } ;; - x86_64) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wformat-overflow" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-overflow" >&5 -printf %s "checking whether $CC supports -Wformat-overflow... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wformat-overflow" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wformat-overflow" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wnonnull" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnonnull" >&5 -printf %s "checking whether $CC supports -Wnonnull... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wnonnull" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wnonnull" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mcx16" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mcx16" >&5 -printf %s "checking whether $CC supports -mcx16... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mcx16" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mcx16" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mcmodel=small" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mcmodel=small" >&5 -printf %s "checking whether $CC supports -mcmodel=small... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mcmodel=small" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mcmodel=small" -fi } ;; - esac - - wine_crossdebug=$CROSSDEBUG - if test -z "$wine_crossdebug" - then - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*) wine_crossdebug=dwarf ;; - -gcodeview) wine_crossdebug=pdb ;; - -g) wine_crossdebug=${wine_crossdebug:-dwarf} ;; - esac - done - fi - - ac_debug_format_seen="" - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*|-gcodeview) ac_debug_format_seen=$ac_flag ;; - esac - done - if test "x$ac_debug_format_seen" = x - then - case $wine_crossdebug in - *dwarf) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-gdwarf-4" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -gdwarf-4" >&5 -printf %s "checking whether $CC supports -gdwarf-4... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -gdwarf-4" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -gdwarf-4" -fi } ;; - pdb) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-gcodeview" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -gcodeview" >&5 -printf %s "checking whether $CC supports -gcodeview... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -gcodeview" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -gcodeview" -fi } ;; - esac - fi - eval "${wine_arch}_DEBUG=\$wine_crossdebug" - - test "x$enable_werror" != xyes || { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror" >&5 -printf %s "checking whether $CC supports -Werror... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Werror" -fi } - test "x$enable_build_id" != xyes || { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wl,--build-id" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--build-id" >&5 -printf %s "checking whether $CC supports -Wl,--build-id... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wl,--build-id" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else $as_nop - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_CFLAGS " -Wl,--build-id" - as_fn_append ${wine_arch}_LDFLAGS " -Wl,--build-id" -fi } - - CC=$saved_CC - CFLAGS=$saved_CFLAGS - LDFLAGS=$saved_LDFLAGS -done - -if test $HOST_ARCH = aarch64 -then - test "x$PE_ARCHS" != x || as_fn_error $? "PE cross-compilation is required for ARM64, please install clang/llvm-dlltool/lld, or llvm-mingw." "$LINENO" 5 - DLLEXT="" -fi - - -if test "x$with_system_dllpath" != "x" -a -n "$PE_ARCHS" -then - if test "x$HOST_ARCH" = xi386 -then : - ac_prefix_list="i686-w64-mingw32-pkg-config i586-w64-mingw32-pkg-config i486-w64-mingw32-pkg-config i386-w64-mingw32-pkg-config " -else $as_nop - ac_prefix_list="$host_cpu-w64-mingw32-pkg-config" -fi -for ac_prog in $ac_prefix_list -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MINGW_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$MINGW_PKG_CONFIG"; then - ac_cv_prog_MINGW_PKG_CONFIG="$MINGW_PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MINGW_PKG_CONFIG="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MINGW_PKG_CONFIG=$ac_cv_prog_MINGW_PKG_CONFIG -if test -n "$MINGW_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MINGW_PKG_CONFIG" >&5 -printf "%s\n" "$MINGW_PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$MINGW_PKG_CONFIG" && break -done -test -n "$MINGW_PKG_CONFIG" || MINGW_PKG_CONFIG="false" - -if ${FAUDIO_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FAUDIO_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags FAudio 2>/dev/null` -fi -fi -if ${FAUDIO_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FAUDIO_PE_LIBS=`$MINGW_PKG_CONFIG --libs FAudio 2>/dev/null` -fi -fi -FAUDIO_PE_LIBS=${FAUDIO_PE_LIBS:-"-lFAudio"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FAUDIO_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW FAudio.h" >&5 -printf %s "checking for MinGW FAudio.h... " >&6; } -if test ${ac_cv_mingw_header_FAudio_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_FAudio_h=yes -else $as_nop - ac_cv_mingw_header_FAudio_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_FAudio_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_FAudio_h" >&6; } -if test "x$ac_cv_mingw_header_FAudio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FAudio_CommitOperationSet in MinGW -lFAudio" >&5 -printf %s "checking for FAudio_CommitOperationSet in MinGW -lFAudio... " >&6; } -if test ${ac_cv_mingw_lib_FAudio+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lFAudio $FAUDIO_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char FAudio_CommitOperationSet (); -int -main (void) -{ -return FAudio_CommitOperationSet (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_FAudio=yes -else $as_nop - ac_cv_mingw_lib_FAudio=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_FAudio" >&5 -printf "%s\n" "$ac_cv_mingw_lib_FAudio" >&6; } -if test "x$ac_cv_mingw_lib_FAudio" = xyes -then : - : -else $as_nop - FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS="" -fi -else $as_nop - FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$FAUDIO_PE_LIBS" = "x" - then - as_fn_append wine_notices "|FAudio ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${FLUIDSYNTH_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FLUIDSYNTH_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags fluidsynth 2>/dev/null` -fi -fi -if ${FLUIDSYNTH_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FLUIDSYNTH_PE_LIBS=`$MINGW_PKG_CONFIG --libs fluidsynth 2>/dev/null` -fi -fi -FLUIDSYNTH_PE_LIBS=${FLUIDSYNTH_PE_LIBS:-"-lfluidsynth"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FLUIDSYNTH_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW fluidsynth.h" >&5 -printf %s "checking for MinGW fluidsynth.h... " >&6; } -if test ${ac_cv_mingw_header_fluidsynth_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_fluidsynth_h=yes -else $as_nop - ac_cv_mingw_header_fluidsynth_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_fluidsynth_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_fluidsynth_h" >&6; } -if test "x$ac_cv_mingw_header_fluidsynth_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for new_fluid_synth in MinGW -lfluidsynth" >&5 -printf %s "checking for new_fluid_synth in MinGW -lfluidsynth... " >&6; } -if test ${ac_cv_mingw_lib_fluidsynth+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lfluidsynth $FLUIDSYNTH_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char new_fluid_synth (); -int -main (void) -{ -return new_fluid_synth (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_fluidsynth=yes -else $as_nop - ac_cv_mingw_lib_fluidsynth=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_fluidsynth" >&5 -printf "%s\n" "$ac_cv_mingw_lib_fluidsynth" >&6; } -if test "x$ac_cv_mingw_lib_fluidsynth" = xyes -then : - : -else $as_nop - FLUIDSYNTH_PE_CFLAGS=""; FLUIDSYNTH_PE_LIBS="" -fi -else $as_nop - FLUIDSYNTH_PE_CFLAGS=""; FLUIDSYNTH_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$FLUIDSYNTH_PE_LIBS" = "x" - then - as_fn_append wine_notices "|Fluidsynth ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${JPEG_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - JPEG_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libjpeg 2>/dev/null` -fi -fi -if ${JPEG_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - JPEG_PE_LIBS=`$MINGW_PKG_CONFIG --libs libjpeg 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $JPEG_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW jpeglib.h" >&5 -printf %s "checking for MinGW jpeglib.h... " >&6; } -if test ${ac_cv_mingw_header_jpeglib_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_jpeglib_h=yes -else $as_nop - ac_cv_mingw_header_jpeglib_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_jpeglib_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_jpeglib_h" >&6; } -if test "x$ac_cv_mingw_header_jpeglib_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_decompress in MinGW -ljpeg" >&5 -printf %s "checking for jpeg_start_decompress in MinGW -ljpeg... " >&6; } -if test ${ac_cv_mingw_lib_jpeg+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-ljpeg $JPEG_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char jpeg_start_decompress (); -int -main (void) -{ -return jpeg_start_decompress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_jpeg=yes -else $as_nop - ac_cv_mingw_lib_jpeg=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_jpeg" >&5 -printf "%s\n" "$ac_cv_mingw_lib_jpeg" >&6; } -if test "x$ac_cv_mingw_lib_jpeg" = xyes -then : - : -else $as_nop - JPEG_PE_CFLAGS=""; JPEG_PE_LIBS="" -fi -else $as_nop - JPEG_PE_CFLAGS=""; JPEG_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$JPEG_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libjpeg ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${LCMS2_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - LCMS2_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags lcms2 2>/dev/null` -fi -fi -if ${LCMS2_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - LCMS2_PE_LIBS=`$MINGW_PKG_CONFIG --libs lcms2 2>/dev/null` -fi -fi -LCMS2_PE_LIBS=${LCMS2_PE_LIBS:-"-llcms2"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $LCMS2_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW lcms2.h" >&5 -printf %s "checking for MinGW lcms2.h... " >&6; } -if test ${ac_cv_mingw_header_lcms2_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_lcms2_h=yes -else $as_nop - ac_cv_mingw_header_lcms2_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_lcms2_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_lcms2_h" >&6; } -if test "x$ac_cv_mingw_header_lcms2_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cmsOpenProfileFromFile in MinGW -llcms2" >&5 -printf %s "checking for cmsOpenProfileFromFile in MinGW -llcms2... " >&6; } -if test ${ac_cv_mingw_lib_lcms2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-llcms2 $LCMS2_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char cmsOpenProfileFromFile (); -int -main (void) -{ -return cmsOpenProfileFromFile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_lcms2=yes -else $as_nop - ac_cv_mingw_lib_lcms2=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_lcms2" >&5 -printf "%s\n" "$ac_cv_mingw_lib_lcms2" >&6; } -if test "x$ac_cv_mingw_lib_lcms2" = xyes -then : - : -else $as_nop - LCMS2_PE_CFLAGS=""; LCMS2_PE_LIBS="" -fi -else $as_nop - LCMS2_PE_CFLAGS=""; LCMS2_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$LCMS2_PE_LIBS" = "x" - then - as_fn_append wine_notices "|liblcms2 ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${MPG123_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - MPG123_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libmpg123 2>/dev/null` -fi -fi -if ${MPG123_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - MPG123_PE_LIBS=`$MINGW_PKG_CONFIG --libs libmpg123 2>/dev/null` -fi -fi -MPG123_PE_LIBS=${MPG123_PE_LIBS:-"-lmpg123"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $MPG123_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW mpg123.h" >&5 -printf %s "checking for MinGW mpg123.h... " >&6; } -if test ${ac_cv_mingw_header_mpg123_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_mpg123_h=yes -else $as_nop - ac_cv_mingw_header_mpg123_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_mpg123_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_mpg123_h" >&6; } -if test "x$ac_cv_mingw_header_mpg123_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mpg123_feed in MinGW -lmpg123" >&5 -printf %s "checking for mpg123_feed in MinGW -lmpg123... " >&6; } -if test ${ac_cv_mingw_lib_mpg123+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lmpg123 $MPG123_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char mpg123_feed (); -int -main (void) -{ -return mpg123_feed (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_mpg123=yes -else $as_nop - ac_cv_mingw_lib_mpg123=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_mpg123" >&5 -printf "%s\n" "$ac_cv_mingw_lib_mpg123" >&6; } -if test "x$ac_cv_mingw_lib_mpg123" = xyes -then : - : -else $as_nop - MPG123_PE_CFLAGS=""; MPG123_PE_LIBS="" -fi -else $as_nop - MPG123_PE_CFLAGS=""; MPG123_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$MPG123_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libmpg123 ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${PNG_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - PNG_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libpng 2>/dev/null` -fi -fi -if ${PNG_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - PNG_PE_LIBS=`$MINGW_PKG_CONFIG --libs libpng 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $PNG_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW png.h" >&5 -printf %s "checking for MinGW png.h... " >&6; } -if test ${ac_cv_mingw_header_png_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_png_h=yes -else $as_nop - ac_cv_mingw_header_png_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_png_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_png_h" >&6; } -if test "x$ac_cv_mingw_header_png_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in MinGW -lpng" >&5 -printf %s "checking for png_create_read_struct in MinGW -lpng... " >&6; } -if test ${ac_cv_mingw_lib_png+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lpng $PNG_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char png_create_read_struct (); -int -main (void) -{ -return png_create_read_struct (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_png=yes -else $as_nop - ac_cv_mingw_lib_png=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_png" >&5 -printf "%s\n" "$ac_cv_mingw_lib_png" >&6; } -if test "x$ac_cv_mingw_lib_png" = xyes -then : - : -else $as_nop - PNG_PE_CFLAGS=""; PNG_PE_LIBS="" -fi -else $as_nop - PNG_PE_CFLAGS=""; PNG_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$PNG_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libpng ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${TIFF_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - TIFF_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libtiff-4 2>/dev/null` -fi -fi -if ${TIFF_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - TIFF_PE_LIBS=`$MINGW_PKG_CONFIG --libs libtiff-4 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $TIFF_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW tiffio.h" >&5 -printf %s "checking for MinGW tiffio.h... " >&6; } -if test ${ac_cv_mingw_header_tiffio_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_tiffio_h=yes -else $as_nop - ac_cv_mingw_header_tiffio_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_tiffio_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_tiffio_h" >&6; } -if test "x$ac_cv_mingw_header_tiffio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in MinGW -ltiff" >&5 -printf %s "checking for TIFFClientOpen in MinGW -ltiff... " >&6; } -if test ${ac_cv_mingw_lib_tiff+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-ltiff $TIFF_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFClientOpen (); -int -main (void) -{ -return TIFFClientOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_tiff=yes -else $as_nop - ac_cv_mingw_lib_tiff=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_tiff" >&5 -printf "%s\n" "$ac_cv_mingw_lib_tiff" >&6; } -if test "x$ac_cv_mingw_lib_tiff" = xyes -then : - : -else $as_nop - TIFF_PE_CFLAGS=""; TIFF_PE_LIBS="" -fi -else $as_nop - TIFF_PE_CFLAGS=""; TIFF_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$TIFF_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libtiff ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${XML2_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XML2_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libxml-2.0 2>/dev/null` -fi -fi -if ${XML2_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XML2_PE_LIBS=`$MINGW_PKG_CONFIG --libs libxml-2.0 2>/dev/null` -fi -fi -XML2_PE_LIBS=${XML2_PE_LIBS:-"-lxml2"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XML2_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/parser.h" >&5 -printf %s "checking for MinGW libxml/parser.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_parser_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_parser_h=yes -else $as_nop - ac_cv_mingw_header_libxml_parser_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_parser_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_parser_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_parser_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/xmlsave.h" >&5 -printf %s "checking for MinGW libxml/xmlsave.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_xmlsave_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_xmlsave_h=yes -else $as_nop - ac_cv_mingw_header_libxml_xmlsave_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_xmlsave_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_xmlsave_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_xmlsave_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/SAX2.h" >&5 -printf %s "checking for MinGW libxml/SAX2.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_SAX2_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_SAX2_h=yes -else $as_nop - ac_cv_mingw_header_libxml_SAX2_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_SAX2_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_SAX2_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_SAX2_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_libxml_parser_h" = "yes" -a "$ac_cv_mingw_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_mingw_header_libxml_SAX2_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in MinGW -lxml2" >&5 -printf %s "checking for xmlFirstElementChild in MinGW -lxml2... " >&6; } -if test ${ac_cv_mingw_lib_xml2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lxml2 $XML2_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char xmlFirstElementChild (); -int -main (void) -{ -return xmlFirstElementChild (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_xml2=yes -else $as_nop - ac_cv_mingw_lib_xml2=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_xml2" >&5 -printf "%s\n" "$ac_cv_mingw_lib_xml2" >&6; } -if test "x$ac_cv_mingw_lib_xml2" = xyes -then : - : -else $as_nop - XML2_PE_CFLAGS=""; XML2_PE_LIBS="" -fi - else - XML2_PE_CFLAGS="" - XML2_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$XML2_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libxml2 ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${XSLT_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XSLT_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libxslt 2>/dev/null` -fi -fi -if ${XSLT_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XSLT_PE_LIBS=`$MINGW_PKG_CONFIG --libs libxslt 2>/dev/null` -fi -fi -XSLT_PE_LIBS=${XSLT_PE_LIBS:-"-lxslt"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XSLT_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxslt/pattern.h" >&5 -printf %s "checking for MinGW libxslt/pattern.h... " >&6; } -if test ${ac_cv_mingw_header_libxslt_pattern_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxslt_pattern_h=yes -else $as_nop - ac_cv_mingw_header_libxslt_pattern_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxslt_pattern_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxslt_pattern_h" >&6; } -if test "x$ac_cv_mingw_header_libxslt_pattern_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxslt/transform.h" >&5 -printf %s "checking for MinGW libxslt/transform.h... " >&6; } -if test ${ac_cv_mingw_header_libxslt_transform_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxslt_transform_h=yes -else $as_nop - ac_cv_mingw_header_libxslt_transform_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxslt_transform_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxslt_transform_h" >&6; } -if test "x$ac_cv_mingw_header_libxslt_transform_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_libxslt_pattern_h" = "yes" -a "$ac_cv_mingw_header_libxslt_transform_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xsltCompilePattern in MinGW -lxslt" >&5 -printf %s "checking for xsltCompilePattern in MinGW -lxslt... " >&6; } -if test ${ac_cv_mingw_lib_xslt+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lxslt $XSLT_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char xsltCompilePattern (); -int -main (void) -{ -return xsltCompilePattern (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_xslt=yes -else $as_nop - ac_cv_mingw_lib_xslt=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_xslt" >&5 -printf "%s\n" "$ac_cv_mingw_lib_xslt" >&6; } -if test "x$ac_cv_mingw_lib_xslt" = xyes -then : - : -else $as_nop - XSLT_PE_CFLAGS=""; XSLT_PE_LIBS="" -fi - else - XSLT_PE_CFLAGS="" - XSLT_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$XSLT_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libxslt ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${VKD3D_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - VKD3D_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libvkd3d libvkd3d-shader 2>/dev/null` -fi -fi -if ${VKD3D_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - VKD3D_PE_LIBS=`$MINGW_PKG_CONFIG --libs libvkd3d libvkd3d-shader 2>/dev/null` -fi -fi -VKD3D_PE_LIBS=${VKD3D_PE_LIBS:-"-lvkd3d -lvkd3d-shader"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $VKD3D_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW vkd3d.h" >&5 -printf %s "checking for MinGW vkd3d.h... " >&6; } -if test ${ac_cv_mingw_header_vkd3d_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_vkd3d_h=yes -else $as_nop - ac_cv_mingw_header_vkd3d_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_vkd3d_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_vkd3d_h" >&6; } -if test "x$ac_cv_mingw_header_vkd3d_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW vkd3d_shader.h" >&5 -printf %s "checking for MinGW vkd3d_shader.h... " >&6; } -if test ${ac_cv_mingw_header_vkd3d_shader_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_vkd3d_shader_h=yes -else $as_nop - ac_cv_mingw_header_vkd3d_shader_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_vkd3d_shader_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_vkd3d_shader_h" >&6; } -if test "x$ac_cv_mingw_header_vkd3d_shader_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_vkd3d_h" = "yes" -a "$ac_cv_mingw_header_vkd3d_shader_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vkd3d_set_log_callback in MinGW -lvkd3d" >&5 -printf %s "checking for vkd3d_set_log_callback in MinGW -lvkd3d... " >&6; } -if test ${ac_cv_mingw_lib_vkd3d+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lvkd3d $VKD3D_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char vkd3d_set_log_callback (); -int -main (void) -{ -return vkd3d_set_log_callback (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_vkd3d=yes -else $as_nop - ac_cv_mingw_lib_vkd3d=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_vkd3d" >&5 -printf "%s\n" "$ac_cv_mingw_lib_vkd3d" >&6; } -if test "x$ac_cv_mingw_lib_vkd3d" = xyes -then : - : -else $as_nop - : -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vkd3d_shader_serialize_dxbc in MinGW -lvkd3d-shader" >&5 -printf %s "checking for vkd3d_shader_serialize_dxbc in MinGW -lvkd3d-shader... " >&6; } -if test ${ac_cv_mingw_lib_vkd3d_shader+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lvkd3d-shader $VKD3D_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char vkd3d_shader_serialize_dxbc (); -int -main (void) -{ -return vkd3d_shader_serialize_dxbc (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_vkd3d_shader=yes -else $as_nop - ac_cv_mingw_lib_vkd3d_shader=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_vkd3d_shader" >&5 -printf "%s\n" "$ac_cv_mingw_lib_vkd3d_shader" >&6; } -if test "x$ac_cv_mingw_lib_vkd3d_shader" = xyes -then : - : -else $as_nop - : -fi - if test "$ac_cv_mingw_lib_vkd3d" = "no" -o "$ac_cv_mingw_lib_vkd3d_shader" = "no" - then - VKD3D_PE_CFLAGS="" - VKD3D_PE_LIBS="" - fi - else - VKD3D_PE_CFLAGS="" - VKD3D_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$VKD3D_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libvkd3d ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${ZLIB_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - ZLIB_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags zlib 2>/dev/null` -fi -fi -if ${ZLIB_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - ZLIB_PE_LIBS=`$MINGW_PKG_CONFIG --libs zlib 2>/dev/null` -fi -fi -ZLIB_PE_LIBS=${ZLIB_PE_LIBS:-"-lz"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $ZLIB_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW zlib.h" >&5 -printf %s "checking for MinGW zlib.h... " >&6; } -if test ${ac_cv_mingw_header_zlib_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_zlib_h=yes -else $as_nop - ac_cv_mingw_header_zlib_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_zlib_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_zlib_h" >&6; } -if test "x$ac_cv_mingw_header_zlib_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflate in MinGW -lz" >&5 -printf %s "checking for inflate in MinGW -lz... " >&6; } -if test ${ac_cv_mingw_lib_z+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lz $ZLIB_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char inflate (); -int -main (void) -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_z=yes -else $as_nop - ac_cv_mingw_lib_z=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_z" >&5 -printf "%s\n" "$ac_cv_mingw_lib_z" >&6; } -if test "x$ac_cv_mingw_lib_z" = xyes -then : - : -else $as_nop - ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS="" -fi -else $as_nop - ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS="" -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$ZLIB_PE_LIBS" = "x" - then - as_fn_append wine_notices "|zlib ${notice_platform}MinGW development files not found; using bundled version." - fi -fi - -if ${FAUDIO_PE_LIBS:+false} : -then : - FAUDIO_PE_LIBS="faudio mfplat mfreadwrite mfuuid propsys" - if ${FAUDIO_PE_CFLAGS:+false} : -then : - FAUDIO_PE_CFLAGS="-I\$(top_srcdir)/libs/faudio/include" -else $as_nop - enable_faudio=no -fi -else $as_nop - enable_faudio=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: faudio cflags: $FAUDIO_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: faudio libs: $FAUDIO_PE_LIBS" >&5 - -if ${FLUIDSYNTH_PE_LIBS:+false} : -then : - FLUIDSYNTH_PE_LIBS="fluidsynth" - if ${FLUIDSYNTH_PE_CFLAGS:+false} : -then : - FLUIDSYNTH_PE_CFLAGS="-I\$(top_srcdir)/libs/fluidsynth/include" -else $as_nop - enable_fluidsynth=no -fi -else $as_nop - enable_fluidsynth=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fluidsynth cflags: $FLUIDSYNTH_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fluidsynth libs: $FLUIDSYNTH_PE_LIBS" >&5 - -if ${GSM_PE_LIBS:+false} : -then : - GSM_PE_LIBS=gsm - if ${GSM_PE_CFLAGS:+false} : -then : - GSM_PE_CFLAGS="-I\$(top_srcdir)/libs/gsm/inc" -else $as_nop - enable_gsm=no -fi -else $as_nop - enable_gsm=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gsm cflags: $GSM_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gsm libs: $GSM_PE_LIBS" >&5 - -if ${JPEG_PE_LIBS:+false} : -then : - JPEG_PE_LIBS=jpeg - if ${JPEG_PE_CFLAGS:+false} : -then : - JPEG_PE_CFLAGS="-I\$(top_srcdir)/libs/jpeg" -else $as_nop - enable_jpeg=no -fi -else $as_nop - enable_jpeg=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jpeg cflags: $JPEG_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jpeg libs: $JPEG_PE_LIBS" >&5 - -if ${JXR_PE_LIBS:+false} : -then : - JXR_PE_LIBS=jxr - if ${JXR_PE_CFLAGS:+false} : -then : - JXR_PE_CFLAGS="-I\$(top_srcdir)/libs/jxr/jxrgluelib -I\$(top_srcdir)/libs/jxr/image/sys" -else $as_nop - enable_jxr=no -fi -else $as_nop - enable_jxr=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jxr cflags: $JXR_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jxr libs: $JXR_PE_LIBS" >&5 - -if ${LCMS2_PE_LIBS:+false} : -then : - LCMS2_PE_LIBS=lcms2 - if ${LCMS2_PE_CFLAGS:+false} : -then : - LCMS2_PE_CFLAGS="-I\$(top_srcdir)/libs/lcms2/include" -else $as_nop - enable_lcms2=no -fi -else $as_nop - enable_lcms2=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 cflags: $LCMS2_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 libs: $LCMS2_PE_LIBS" >&5 - -if ${LDAP_PE_LIBS:+false} : -then : - LDAP_PE_LIBS=ldap - if ${LDAP_PE_CFLAGS:+false} : -then : - LDAP_PE_CFLAGS="-I\$(top_srcdir)/libs/ldap/include" -else $as_nop - enable_ldap=no -fi -else $as_nop - enable_ldap=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap cflags: $LDAP_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap libs: $LDAP_PE_LIBS" >&5 - -if ${MPG123_PE_LIBS:+false} : -then : - MPG123_PE_LIBS=mpg123 - if ${MPG123_PE_CFLAGS:+false} : -then : - MPG123_PE_CFLAGS="-I\$(top_srcdir)/libs/mpg123/src/libmpg123" -else $as_nop - enable_mpg123=no -fi -else $as_nop - enable_mpg123=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: mpg123 cflags: $MPG123_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: mpg123 libs: $MPG123_PE_LIBS" >&5 - -if ${MUSL_PE_LIBS:+false} : -then : - MUSL_PE_LIBS=musl - if ${MUSL_PE_CFLAGS:+false} : -then : - MUSL_PE_CFLAGS= -else $as_nop - enable_musl=no -fi -else $as_nop - enable_musl=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: musl cflags: $MUSL_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: musl libs: $MUSL_PE_LIBS" >&5 - -if ${PNG_PE_LIBS:+false} : -then : - PNG_PE_LIBS="png \$(ZLIB_PE_LIBS)" - if ${PNG_PE_CFLAGS:+false} : -then : - PNG_PE_CFLAGS="-I\$(top_srcdir)/libs/png" -else $as_nop - enable_png=no -fi -else $as_nop - enable_png=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: png cflags: $PNG_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: png libs: $PNG_PE_LIBS" >&5 - -if ${TIFF_PE_LIBS:+false} : -then : - TIFF_PE_LIBS="tiff \$(ZLIB_PE_LIBS)" - if ${TIFF_PE_CFLAGS:+false} : -then : - TIFF_PE_CFLAGS="-I\$(top_srcdir)/libs/tiff/libtiff" -else $as_nop - enable_tiff=no -fi -else $as_nop - enable_tiff=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: tiff cflags: $TIFF_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: tiff libs: $TIFF_PE_LIBS" >&5 - -if ${VKD3D_PE_LIBS:+false} : -then : - VKD3D_PE_LIBS=vkd3d - if ${VKD3D_PE_CFLAGS:+false} : -then : - VKD3D_PE_CFLAGS="-I\$(top_srcdir)/libs/vkd3d/include" -else $as_nop - enable_vkd3d=no -fi -else $as_nop - enable_vkd3d=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: vkd3d cflags: $VKD3D_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: vkd3d libs: $VKD3D_PE_LIBS" >&5 - -if ${XML2_PE_LIBS:+false} : -then : - XML2_PE_LIBS=xml2 - if ${XML2_PE_CFLAGS:+false} : -then : - XML2_PE_CFLAGS="-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC" -else $as_nop - enable_xml2=no -fi -else $as_nop - enable_xml2=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xml2 cflags: $XML2_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xml2 libs: $XML2_PE_LIBS" >&5 - -if ${XSLT_PE_LIBS:+false} : -then : - XSLT_PE_LIBS=xslt - if ${XSLT_PE_CFLAGS:+false} : -then : - XSLT_PE_CFLAGS="-I\$(top_srcdir)/libs/xslt/libxslt -I\$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC" -else $as_nop - enable_xslt=no -fi -else $as_nop - enable_xslt=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xslt cflags: $XSLT_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xslt libs: $XSLT_PE_LIBS" >&5 - -if ${ZLIB_PE_LIBS:+false} : -then : - ZLIB_PE_LIBS=z - if ${ZLIB_PE_CFLAGS:+false} : -then : - ZLIB_PE_CFLAGS="-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO" -else $as_nop - enable_zlib=no -fi -else $as_nop - enable_zlib=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zlib cflags: $ZLIB_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zlib libs: $ZLIB_PE_LIBS" >&5 - -if ${ZYDIS_PE_LIBS:+false} : -then : - ZYDIS_PE_LIBS=zydis - if ${ZYDIS_PE_CFLAGS:+false} : -then : - ZYDIS_PE_CFLAGS="-I\$(top_srcdir)/libs/zydis/include" -else $as_nop - enable_zydis=no -fi -else $as_nop - enable_zydis=no -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zydis cflags: $ZYDIS_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zydis libs: $ZYDIS_PE_LIBS" >&5 - - - -if test "x$with_pthread" = xno -then : - -else $as_nop - ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" -if test "x$ac_cv_func_pthread_create" = xyes -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -printf %s "checking for pthread_create in -lpthread... " >&6; } -if test ${ac_cv_lib_pthread_pthread_create+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_create (); -int -main (void) -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pthread_pthread_create=yes -else $as_nop - ac_cv_lib_pthread_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes -then : - PTHREAD_LIBS="-lpthread" - -fi - -fi - -fi -if test "x$ac_cv_func_pthread_create" != xyes -a "x$PTHREAD_LIBS" = x -then : - case "x$with_pthread" in - xno) ;; - *) as_fn_error $? "pthread ${notice_platform}development files not found. -Wine cannot support threads without libpthread. -Use the --without-pthread option if you really want this." "$LINENO" 5 ;; -esac - -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -printf %s "checking for X... " >&6; } - - -# Check whether --with-x was given. -if test ${with_x+y} -then : - withval=$with_x; -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if test ${ac_cv_have_x+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no -ac_x_libraries=no -# Do we need to do anything special at all? -ac_save_LIBS=$LIBS -LIBS="-lX11 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - # We can compile and link X programs with no special options. - ac_x_includes= - ac_x_libraries= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS="$ac_save_LIBS" -# If that didn't work, only try xmkmf and file system searches -# for native compilation. -if test x"$ac_x_includes" = xno && test "$cross_compiling" = no -then : - rm -f -r conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir -fi - - # Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R7/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R7 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R7/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R7 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/opt/X11/include - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # We can compile using X headers with no special include directory. -ac_x_includes= -else $as_nop - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi -done -fi -rm -f conftest.err conftest.i conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else $as_nop - LIBS=$ac_save_LIBS -for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -fi -# Record the results. -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) : - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no" ;; #( - *) : - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" ;; -esac -fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -printf "%s\n" "$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - -printf "%s\n" "#define X_DISPLAY_MISSING 1" >>confdefs.h - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 -printf %s "checking whether -R must be followed by a space... " >&6; } - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - ac_xsave_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - X_LIBS="$X_LIBS -R$x_libraries" -else $as_nop - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - X_LIBS="$X_LIBS -R $x_libraries" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -printf "%s\n" "neither works" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ac_c_werror_flag=$ac_xsave_c_werror_flag - LIBS=$ac_xsave_LIBS - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XOpenDisplay (); -int -main (void) -{ -return XOpenDisplay (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 -printf %s "checking for dnet_ntoa in -ldnet... " >&6; } -if test ${ac_cv_lib_dnet_dnet_ntoa+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); -int -main (void) -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dnet_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_dnet_ntoa=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 -printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); -int -main (void) -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dnet_stub_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_stub_dnet_ntoa=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -fi - - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to T.E. Dickey. - # The functions gethostbyname, getservbyname, and inet_addr are - # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes -then : - -fi - - if test $ac_cv_func_gethostbyname = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -printf %s "checking for gethostbyname in -lnsl... " >&6; } -if test ${ac_cv_lib_nsl_gethostbyname+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_nsl_gethostbyname=yes -else $as_nop - ac_cv_lib_nsl_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -fi - - if test $ac_cv_lib_nsl_gethostbyname = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 -printf %s "checking for gethostbyname in -lbsd... " >&6; } -if test ${ac_cv_lib_bsd_gethostbyname+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_bsd_gethostbyname=yes -else $as_nop - ac_cv_lib_bsd_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 -printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" -fi - - fi - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # variants that don't use the name server (or something). -lsocket - # must be given before -lnsl if both are needed. We assume that - # if connect needs -lnsl, so does gethostbyname. - ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = xyes -then : - -fi - - if test $ac_cv_func_connect = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 -printf %s "checking for connect in -lsocket... " >&6; } -if test ${ac_cv_lib_socket_connect+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char connect (); -int -main (void) -{ -return connect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_socket_connect=yes -else $as_nop - ac_cv_lib_socket_connect=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 -printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = xyes -then : - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -fi - - fi - - # Guillermo Gomez says -lposix is necessary on A/UX. - ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = xyes -then : - -fi - - if test $ac_cv_func_remove = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 -printf %s "checking for remove in -lposix... " >&6; } -if test ${ac_cv_lib_posix_remove+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char remove (); -int -main (void) -{ -return remove (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_posix_remove=yes -else $as_nop - ac_cv_lib_posix_remove=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 -printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = xyes -then : - -fi - - if test $ac_cv_func_shmat = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 -printf %s "checking for shmat in -lipc... " >&6; } -if test ${ac_cv_lib_ipc_shmat+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shmat (); -int -main (void) -{ -return shmat (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_ipc_shmat=yes -else $as_nop - ac_cv_lib_ipc_shmat=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 -printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = xyes -then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # John Interrante, Karl Berry - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 -printf %s "checking for IceConnectionNumber in -lICE... " >&6; } -if test ${ac_cv_lib_ICE_IceConnectionNumber+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char IceConnectionNumber (); -int -main (void) -{ -return IceConnectionNumber (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_ICE_IceConnectionNumber=yes -else $as_nop - ac_cv_lib_ICE_IceConnectionNumber=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes -then : - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -fi - - LDFLAGS=$ac_save_LDFLAGS - -fi - - -if test "$have_x" = "yes" -then - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lX11" >&5 -printf %s "checking for -lX11... " >&6; } -if test ${ac_cv_lib_soname_X11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XCreateWindow (); -int -main (void) -{ -return XCreateWindow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest.exe | grep "X11" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_X11=`$OTOOL -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_X11=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libX11\\.$LIBEXT" | sed -e "s/^.*\\[\\(libX11\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_X11:+false} : -then : - ac_cv_lib_soname_X11=`$LDD conftest$ac_exeext | grep "libX11\\.$LIBEXT" | sed -e "s/^.*\(libX11\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_X11= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_X11:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_X11" >&5 -printf "%s\n" "$ac_cv_lib_soname_X11" >&6; } - -printf "%s\n" "#define SONAME_LIBX11 \"$ac_cv_lib_soname_X11\"" >>confdefs.h - - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXext" >&5 -printf %s "checking for -lXext... " >&6; } -if test ${ac_cv_lib_soname_Xext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XextCreateExtension (); -int -main (void) -{ -return XextCreateExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest.exe | grep "Xext" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xext=`$OTOOL -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xext=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXext\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXext\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xext:+false} : -then : - ac_cv_lib_soname_Xext=`$LDD conftest$ac_exeext | grep "libXext\\.$LIBEXT" | sed -e "s/^.*\(libXext\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xext= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xext:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xext" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xext" >&6; } - -printf "%s\n" "#define SONAME_LIBXEXT \"$ac_cv_lib_soname_Xext\"" >>confdefs.h - - X_LIBS="$X_LIBS -lXext" -fi - X_LIBS="$X_LIBS -lX11" - - xlib_includes="#include -#include " - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/shape.h" "ac_cv_header_X11_extensions_shape_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_shape_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_SHAPE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput2.h" "ac_cv_header_X11_extensions_XInput2_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XInput2_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XINPUT2_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XSHM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xfixes.h" "ac_cv_header_X11_extensions_Xfixes_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xfixes_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XFIXES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XINERAMA_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XRANDR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xrender_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XRENDER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XF86VMODE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmproto.h" "ac_cv_header_X11_extensions_xf86vmproto_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_xf86vmproto_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XF86VMPROTO_H 1" >>confdefs.h - -fi - - - ac_fn_c_check_header_compile "$LINENO" "X11/Xcursor/Xcursor.h" "ac_cv_header_X11_Xcursor_Xcursor_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_Xcursor_Xcursor_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXcursor" >&5 -printf %s "checking for -lXcursor... " >&6; } -if test ${ac_cv_lib_soname_Xcursor+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXcursor $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XcursorImageLoadCursor (); -int -main (void) -{ -return XcursorImageLoadCursor (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xcursor=`$ac_cv_path_LDD conftest.exe | grep "Xcursor" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcursor=`$OTOOL -L conftest$ac_exeext | grep "libXcursor\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcursor\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xcursor=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcursor\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcursor\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xcursor:+false} : -then : - ac_cv_lib_soname_Xcursor=`$LDD conftest$ac_exeext | grep "libXcursor\\.$LIBEXT" | sed -e "s/^.*\(libXcursor\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xcursor= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xcursor:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xcursor" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xcursor" >&6; } - -printf "%s\n" "#define SONAME_LIBXCURSOR \"$ac_cv_lib_soname_Xcursor\"" >>confdefs.h - - -fi -fi - - if test "x$ac_cv_lib_soname_Xcursor" = "x" -then : - case "x$with_xcursor" in - x) as_fn_append wine_notices "|libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported. -This is an error since --with-xcursor was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput.h" "ac_cv_header_X11_extensions_XInput_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XInput_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXi" >&5 -printf %s "checking for -lXi... " >&6; } -if test ${ac_cv_lib_soname_Xi+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXi $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XOpenDevice (); -int -main (void) -{ -return XOpenDevice (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xi=`$ac_cv_path_LDD conftest.exe | grep "Xi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xi=`$OTOOL -L conftest$ac_exeext | grep "libXi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xi:+false} : -then : - ac_cv_lib_soname_Xi=`$LDD conftest$ac_exeext | grep "libXi\\.$LIBEXT" | sed -e "s/^.*\(libXi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xi:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xi" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xi" >&6; } - -printf "%s\n" "#define SONAME_LIBXI \"$ac_cv_lib_soname_Xi\"" >>confdefs.h - - -fi -fi - - if test "x$ac_cv_lib_soname_Xi" = "x" -then : - case "x$with_xinput" in - x) as_fn_append wine_notices "|libxi ${notice_platform}development files not found, the Xinput extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxi ${notice_platform}development files not found, the Xinput extension won't be supported. -This is an error since --with-xinput was requested." "$LINENO" 5 ;; -esac - -fi - - if test "x$ac_cv_lib_soname_Xi" != x - then - if test "$ac_cv_header_X11_extensions_XInput2_h" != "yes" -then : - case "x$with_xinput2" in - x) as_fn_append wine_notices "|XInput2 headers not found, the XInput 2 extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "XInput2 headers not found, the XInput 2 extension won't be supported. -This is an error since --with-xinput2 was requested." "$LINENO" 5 ;; -esac - -fi - fi - - if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXext" >&5 -printf %s "checking for XShmQueryExtension in -lXext... " >&6; } -if test ${ac_cv_lib_Xext_XShmQueryExtension+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XShmQueryExtension (); -int -main (void) -{ -return XShmQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xext_XShmQueryExtension=yes -else $as_nop - ac_cv_lib_Xext_XShmQueryExtension=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShmQueryExtension" >&5 -printf "%s\n" "$ac_cv_lib_Xext_XShmQueryExtension" >&6; } -if test "x$ac_cv_lib_Xext_XShmQueryExtension" = xyes -then : - -printf "%s\n" "#define HAVE_LIBXXSHM 1" >>confdefs.h - -fi - - fi - if test "$ac_cv_lib_Xext_XShmQueryExtension" != "yes" -then : - case "x$with_xshm" in - x) as_fn_append wine_notices "|XShm ${notice_platform}development files not found, X Shared Memory won't be supported." ;; - xno) ;; - *) as_fn_error $? "XShm ${notice_platform}development files not found, X Shared Memory won't be supported. -This is an error since --with-xshm was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_shape_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 -printf %s "checking for XShapeQueryExtension in -lXext... " >&6; } -if test ${ac_cv_lib_Xext_XShapeQueryExtension+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XShapeQueryExtension (); -int -main (void) -{ -return XShapeQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xext_XShapeQueryExtension=yes -else $as_nop - ac_cv_lib_Xext_XShapeQueryExtension=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 -printf "%s\n" "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } -if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = xyes -then : - -printf "%s\n" "#define HAVE_LIBXSHAPE 1" >>confdefs.h - -fi - - fi - if test "$ac_cv_lib_Xext_XShapeQueryExtension" != "yes" -then : - case "x$with_xshape" in - x) as_fn_append wine_notices "|XShape ${notice_platform}development files not found, XShape won't be supported." ;; - xno) ;; - *) as_fn_error $? "XShape ${notice_platform}development files not found, XShape won't be supported. -This is an error since --with-xshape was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes" -o "$ac_cv_header_X11_extensions_xf86vmproto_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXxf86vm" >&5 -printf %s "checking for -lXxf86vm... " >&6; } -if test ${ac_cv_lib_soname_Xxf86vm+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXxf86vm $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XF86VidModeQueryExtension (); -int -main (void) -{ -return XF86VidModeQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xxf86vm=`$ac_cv_path_LDD conftest.exe | grep "Xxf86vm" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xxf86vm=`$OTOOL -L conftest$ac_exeext | grep "libXxf86vm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXxf86vm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xxf86vm=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXxf86vm\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xxf86vm:+false} : -then : - ac_cv_lib_soname_Xxf86vm=`$LDD conftest$ac_exeext | grep "libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\(libXxf86vm\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xxf86vm= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xxf86vm:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xxf86vm" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xxf86vm" >&6; } - -printf "%s\n" "#define SONAME_LIBXXF86VM \"$ac_cv_lib_soname_Xxf86vm\"" >>confdefs.h - - -fi - fi - if test "x$ac_cv_lib_soname_Xxf86vm" = "x" -then : - case "x$with_xxf86vm" in - x) as_fn_append wine_notices "|libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported." ;; - xno) ;; - *) as_fn_error $? "libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported. -This is an error since --with-xxf86vm was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" -a "x$ac_cv_lib_soname_X11" != "x" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXrender" >&5 -printf %s "checking for -lXrender... " >&6; } -if test ${ac_cv_lib_soname_Xrender+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XRenderQueryExtension (); -int -main (void) -{ -return XRenderQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest.exe | grep "Xrender" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrender=`$OTOOL -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xrender=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrender\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrender\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xrender:+false} : -then : - ac_cv_lib_soname_Xrender=`$LDD conftest$ac_exeext | grep "libXrender\\.$LIBEXT" | sed -e "s/^.*\(libXrender\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xrender= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xrender:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xrender" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xrender" >&6; } - -printf "%s\n" "#define SONAME_LIBXRENDER \"$ac_cv_lib_soname_Xrender\"" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XRenderSetPictureTransform in -lXrender" >&5 -printf %s "checking for XRenderSetPictureTransform in -lXrender... " >&6; } -if test ${ac_cv_lib_Xrender_XRenderSetPictureTransform+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XRenderSetPictureTransform (); -int -main (void) -{ -return XRenderSetPictureTransform (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xrender_XRenderSetPictureTransform=yes -else $as_nop - ac_cv_lib_Xrender_XRenderSetPictureTransform=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderSetPictureTransform" >&5 -printf "%s\n" "$ac_cv_lib_Xrender_XRenderSetPictureTransform" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderSetPictureTransform" = xyes -then : - -printf "%s\n" "#define HAVE_XRENDERSETPICTURETRANSFORM 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XRenderCreateLinearGradient in -lXrender" >&5 -printf %s "checking for XRenderCreateLinearGradient in -lXrender... " >&6; } -if test ${ac_cv_lib_Xrender_XRenderCreateLinearGradient+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XRenderCreateLinearGradient (); -int -main (void) -{ -return XRenderCreateLinearGradient (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xrender_XRenderCreateLinearGradient=yes -else $as_nop - ac_cv_lib_Xrender_XRenderCreateLinearGradient=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderCreateLinearGradient" >&5 -printf "%s\n" "$ac_cv_lib_Xrender_XRenderCreateLinearGradient" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderCreateLinearGradient" = xyes -then : - -printf "%s\n" "#define HAVE_XRENDERCREATELINEARGRADIENT 1" >>confdefs.h - -fi - -fi - - fi - if test "x$ac_cv_lib_soname_Xrender" = "x" -then : - case "x$with_xrender" in - x) as_fn_append wine_warnings "|libxrender ${notice_platform}development files not found, XRender won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxrender ${notice_platform}development files not found, XRender won't be supported. -This is an error since --with-xrender was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXrandr" >&5 -printf %s "checking for -lXrandr... " >&6; } -if test ${ac_cv_lib_soname_Xrandr+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXrandr $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XRRQueryExtension (); -int -main (void) -{ -return XRRQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xrandr=`$ac_cv_path_LDD conftest.exe | grep "Xrandr" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrandr=`$OTOOL -L conftest$ac_exeext | grep "libXrandr\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xrandr=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrandr\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrandr\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xrandr:+false} : -then : - ac_cv_lib_soname_Xrandr=`$LDD conftest$ac_exeext | grep "libXrandr\\.$LIBEXT" | sed -e "s/^.*\(libXrandr\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xrandr= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xrandr:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xrandr" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xrandr" >&6; } - -printf "%s\n" "#define SONAME_LIBXRANDR \"$ac_cv_lib_soname_Xrandr\"" >>confdefs.h - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XRRGetProviderResources) *f; if (f) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_XRRGETPROVIDERRESOURCES 1" >>confdefs.h - -else $as_nop - as_fn_append wine_notices "|libxrandr ${notice_platform}development files too old, XRandR display device handler won't be supported." -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xrandr" = "x" -then : - case "x$with_xrandr" in - x) as_fn_append wine_notices "|libxrandr ${notice_platform}development files not found, XRandr won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxrandr ${notice_platform}development files not found, XRandr won't be supported. -This is an error since --with-xrandr was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xfixes_h" = "yes" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XFixesQueryVersion) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXfixes" >&5 -printf %s "checking for -lXfixes... " >&6; } -if test ${ac_cv_lib_soname_Xfixes+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXfixes $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XFixesQueryVersion (); -int -main (void) -{ -return XFixesQueryVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xfixes=`$ac_cv_path_LDD conftest.exe | grep "Xfixes" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xfixes=`$OTOOL -L conftest$ac_exeext | grep "libXfixes\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXfixes\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xfixes=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXfixes\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXfixes\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xfixes:+false} : -then : - ac_cv_lib_soname_Xfixes=`$LDD conftest$ac_exeext | grep "libXfixes\\.$LIBEXT" | sed -e "s/^.*\(libXfixes\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xfixes= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xfixes:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xfixes" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xfixes" >&6; } - -printf "%s\n" "#define SONAME_LIBXFIXES \"$ac_cv_lib_soname_Xfixes\"" >>confdefs.h - - -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xfixes" = "x" -then : - case "x$with_xfixes" in - x) as_fn_append wine_notices "|libxfixes ${notice_platform}development files not found, Xfixes won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxfixes ${notice_platform}development files not found, Xfixes won't be supported. -This is an error since --with-xfixes was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XineramaQueryScreens) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXinerama" >&5 -printf %s "checking for -lXinerama... " >&6; } -if test ${ac_cv_lib_soname_Xinerama+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXinerama $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XineramaQueryScreens (); -int -main (void) -{ -return XineramaQueryScreens (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xinerama=`$ac_cv_path_LDD conftest.exe | grep "Xinerama" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xinerama=`$OTOOL -L conftest$ac_exeext | grep "libXinerama\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXinerama\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xinerama=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXinerama\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXinerama\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xinerama:+false} : -then : - ac_cv_lib_soname_Xinerama=`$LDD conftest$ac_exeext | grep "libXinerama\\.$LIBEXT" | sed -e "s/^.*\(libXinerama\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xinerama= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xinerama:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xinerama" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xinerama" >&6; } - -printf "%s\n" "#define SONAME_LIBXINERAMA \"$ac_cv_lib_soname_Xinerama\"" >>confdefs.h - - -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xinerama" = "x" -then : - case "x$with_xinerama" in - x) as_fn_append wine_notices "|libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported. -This is an error since --with-xinerama was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xcomposite.h" "ac_cv_header_X11_extensions_Xcomposite_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xcomposite_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXcomposite" >&5 -printf %s "checking for -lXcomposite... " >&6; } -if test ${ac_cv_lib_soname_Xcomposite+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXcomposite $X_LIBS $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XCompositeRedirectWindow (); -int -main (void) -{ -return XCompositeRedirectWindow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xcomposite=`$ac_cv_path_LDD conftest.exe | grep "Xcomposite" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcomposite=`$OTOOL -L conftest$ac_exeext | grep "libXcomposite\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcomposite\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xcomposite=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcomposite\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcomposite\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xcomposite:+false} : -then : - ac_cv_lib_soname_Xcomposite=`$LDD conftest$ac_exeext | grep "libXcomposite\\.$LIBEXT" | sed -e "s/^.*\(libXcomposite\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_Xcomposite= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_Xcomposite:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xcomposite" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xcomposite" >&6; } - -printf "%s\n" "#define SONAME_LIBXCOMPOSITE \"$ac_cv_lib_soname_Xcomposite\"" >>confdefs.h - - -fi -fi - - if test "x$ac_cv_lib_soname_Xcomposite" = "x" -then : - case "x$with_xcomposite" in - x) as_fn_append wine_notices "|libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported. -This is an error since --with-xcomposite was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_member "$LINENO" "XICCallback" "callback" "ac_cv_member_XICCallback_callback" "$xlib_includes -" -if test "x$ac_cv_member_XICCallback_callback" = xyes -then : - -printf "%s\n" "#define HAVE_XICCALLBACK_CALLBACK 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "XEvent" "xcookie" "ac_cv_member_XEvent_xcookie" "$xlib_includes -" -if test "x$ac_cv_member_XEvent_xcookie" = xyes -then : - -printf "%s\n" "#define HAVE_XEVENT_XCOOKIE 1" >>confdefs.h - - -fi - - - - opengl_msg="" - if test "x$with_opengl" != "xno" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGL" >&5 -printf %s "checking for -lGL... " >&6; } -if test ${ac_cv_lib_soname_GL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lGL $X_LIBS -lm $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char glXCreateContext (); -int -main (void) -{ -return glXCreateContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GL:+false} : -then : - ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_GL= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_GL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGL" >&5 -printf %s "checking for -lGL... " >&6; } -if test ${ac_cv_lib_soname_GL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lGL $X_LIBS -lm $X_EXTRA_LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char glXCreateContext (); -int -main (void) -{ -return glXCreateContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GL:+false} : -then : - ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_GL= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_GL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - if test -f /usr/X11R6/lib/libGL.a - then - opengl_msg="/usr/X11R6/lib/libGL.a is present on your system. -This probably prevents linking to OpenGL. Try deleting the file and restarting configure." - else - opengl_msg="No OpenGL library found on this system." - fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GL" >&5 -printf "%s\n" "$ac_cv_lib_soname_GL" >&6; } - -printf "%s\n" "#define SONAME_LIBGL \"$ac_cv_lib_soname_GL\"" >>confdefs.h - - OPENGL_LIBS="-Xlinker -dylib_file -Xlinker /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -lGL" -fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GL" >&5 -printf "%s\n" "$ac_cv_lib_soname_GL" >&6; } - -printf "%s\n" "#define SONAME_LIBGL \"$ac_cv_lib_soname_GL\"" >>confdefs.h - - OPENGL_LIBS="-lGL" -fi - if test "x$with_osmesa" != "xno" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lOSMesa" >&5 -printf %s "checking for -lOSMesa... " >&6; } -if test ${ac_cv_lib_soname_OSMesa+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lOSMesa $X_LIBS -lm $X_EXTRA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char OSMesaGetProcAddress (); -int -main (void) -{ -return OSMesaGetProcAddress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_OSMesa=`$ac_cv_path_LDD conftest.exe | grep "OSMesa" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_OSMesa=`$OTOOL -L conftest$ac_exeext | grep "libOSMesa\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOSMesa\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_OSMesa=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libOSMesa\\.$LIBEXT" | sed -e "s/^.*\\[\\(libOSMesa\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_OSMesa:+false} : -then : - ac_cv_lib_soname_OSMesa=`$LDD conftest$ac_exeext | grep "libOSMesa\\.$LIBEXT" | sed -e "s/^.*\(libOSMesa\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_OSMesa= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_OSMesa:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_OSMesa" >&5 -printf "%s\n" "$ac_cv_lib_soname_OSMesa" >&6; } - -printf "%s\n" "#define SONAME_LIBOSMESA \"$ac_cv_lib_soname_OSMesa\"" >>confdefs.h - - -fi - if test "x$ac_cv_lib_soname_OSMesa" = "x" -then : - case "x$with_osmesa" in - x) as_fn_append wine_notices "|libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported." ;; - xno) ;; - *) as_fn_error $? "libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported. -This is an error since --with-osmesa was requested." "$LINENO" 5 ;; -esac - -fi - fi - fi - if test -n "$opengl_msg" -then : - case "x$with_opengl" in - x) as_fn_append wine_warnings "|$opengl_msg -OpenGL and Direct3D won't be supported." ;; - xno) ;; - *) as_fn_error $? "$opengl_msg -OpenGL and Direct3D won't be supported. -This is an error since --with-opengl was requested." "$LINENO" 5 ;; -esac - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" -else - X_CFLAGS="" - X_LIBS="" -fi - -if test "$enable_wineandroid_drv$enable_winemac_drv" = "nono" -then - if test "x$X_LIBS" = "x" -then : - case "x$with_x" in - xno) ;; - *) as_fn_error $? "X ${notice_platform}development files not found. Wine will be built -without X support, which probably isn't what you want. You will need -to install ${notice_platform}development packages of Xlib at the very least. -Use the --without-x option if you really want this." "$LINENO" 5 ;; -esac -enable_winex11_drv=${enable_winex11_drv:-no} -fi -else - if test "x$X_LIBS" = "x" -then : - case "x$with_x" in - x) as_fn_append wine_notices "|X ${notice_platform}development files not found, the X11 driver won't be supported." ;; - xno) ;; - *) as_fn_error $? "X ${notice_platform}development files not found, the X11 driver won't be supported. -This is an error since --with-x was requested." "$LINENO" 5 ;; -esac -enable_winex11_drv=${enable_winex11_drv:-no} -fi -fi - -if test "x$with_wayland" != "xno" -then - rm -f conftest.err -if ${WAYLAND_CLIENT_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_CLIENT_CFLAGS=`$PKG_CONFIG --cflags wayland-client 2>conftest.err` -fi -fi - -if ${WAYLAND_CLIENT_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_CLIENT_LIBS=`$PKG_CONFIG --libs wayland-client 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-client cflags: $WAYLAND_CLIENT_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-client libs: $WAYLAND_CLIENT_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: wayland-client errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $WAYLAND_CLIENT_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "wayland-client.h" "ac_cv_header_wayland_client_h" "$ac_includes_default" -if test "x$ac_cv_header_wayland_client_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wl_display_connect in -lwayland-client" >&5 -printf %s "checking for wl_display_connect in -lwayland-client... " >&6; } -if test ${ac_cv_lib_wayland_client_wl_display_connect+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lwayland-client $WAYLAND_CLIENT_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char wl_display_connect (); -int -main (void) -{ -return wl_display_connect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_wayland_client_wl_display_connect=yes -else $as_nop - ac_cv_lib_wayland_client_wl_display_connect=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wayland_client_wl_display_connect" >&5 -printf "%s\n" "$ac_cv_lib_wayland_client_wl_display_connect" >&6; } -if test "x$ac_cv_lib_wayland_client_wl_display_connect" = xyes -then : - # Extract the first word of "wayland-scanner", so it can be a program name with args. -set dummy wayland-scanner; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_WAYLAND_SCANNER+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $WAYLAND_SCANNER in - [\\/]* | ?:[\\/]*) - ac_cv_path_WAYLAND_SCANNER="$WAYLAND_SCANNER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_WAYLAND_SCANNER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_WAYLAND_SCANNER" && ac_cv_path_WAYLAND_SCANNER="`test -n "$PKG_CONFIG" && $PKG_CONFIG --variable=wayland_scanner wayland-scanner 2>/dev/null`" - ;; -esac -fi -WAYLAND_SCANNER=$ac_cv_path_WAYLAND_SCANNER -if test -n "$WAYLAND_SCANNER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WAYLAND_SCANNER" >&5 -printf "%s\n" "$WAYLAND_SCANNER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -else $as_nop - WAYLAND_CLIENT_LIBS="" -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${XKBCOMMON_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBCOMMON_CFLAGS=`$PKG_CONFIG --cflags xkbcommon 2>conftest.err` -fi -fi - -if ${XKBCOMMON_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBCOMMON_LIBS=`$PKG_CONFIG --libs xkbcommon 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbcommon cflags: $XKBCOMMON_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbcommon libs: $XKBCOMMON_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: xkbcommon errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XKBCOMMON_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "xkbcommon/xkbcommon.h" "ac_cv_header_xkbcommon_xkbcommon_h" "$ac_includes_default" -if test "x$ac_cv_header_xkbcommon_xkbcommon_h" = xyes -then : - printf "%s\n" "#define HAVE_XKBCOMMON_XKBCOMMON_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xkb_context_new in -lxkbcommon" >&5 -printf %s "checking for xkb_context_new in -lxkbcommon... " >&6; } -if test ${ac_cv_lib_xkbcommon_xkb_context_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxkbcommon $XKBCOMMON_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char xkb_context_new (); -int -main (void) -{ -return xkb_context_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_xkbcommon_xkb_context_new=yes -else $as_nop - ac_cv_lib_xkbcommon_xkb_context_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xkbcommon_xkb_context_new" >&5 -printf "%s\n" "$ac_cv_lib_xkbcommon_xkb_context_new" >&6; } -if test "x$ac_cv_lib_xkbcommon_xkb_context_new" = xyes -then : - : -else $as_nop - XKBCOMMON_LIBS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${XKBREGISTRY_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBREGISTRY_CFLAGS=`$PKG_CONFIG --cflags xkbregistry 2>conftest.err` -fi -fi - -if ${XKBREGISTRY_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBREGISTRY_LIBS=`$PKG_CONFIG --libs xkbregistry 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbregistry cflags: $XKBREGISTRY_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbregistry libs: $XKBREGISTRY_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: xkbregistry errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XKBREGISTRY_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "xkbcommon/xkbregistry.h" "ac_cv_header_xkbcommon_xkbregistry_h" "$ac_includes_default" -if test "x$ac_cv_header_xkbcommon_xkbregistry_h" = xyes -then : - printf "%s\n" "#define HAVE_XKBCOMMON_XKBREGISTRY_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rxkb_context_new in -lxkbregistry" >&5 -printf %s "checking for rxkb_context_new in -lxkbregistry... " >&6; } -if test ${ac_cv_lib_xkbregistry_rxkb_context_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxkbregistry $XKBREGISTRY_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char rxkb_context_new (); -int -main (void) -{ -return rxkb_context_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_xkbregistry_rxkb_context_new=yes -else $as_nop - ac_cv_lib_xkbregistry_rxkb_context_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xkbregistry_rxkb_context_new" >&5 -printf "%s\n" "$ac_cv_lib_xkbregistry_rxkb_context_new" >&6; } -if test "x$ac_cv_lib_xkbregistry_rxkb_context_new" = xyes -then : - : -else $as_nop - XKBREGISTRY_LIBS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test -z "$WAYLAND_CLIENT_LIBS" -o -z "$WAYLAND_SCANNER" -o -z "$XKBCOMMON_LIBS" -o -z "$XKBREGISTRY_LIBS" -o "$ac_cv_header_linux_input_h" = "no" -then : - case "x$with_wayland" in - x) as_fn_append wine_notices "|Wayland ${notice_platform}development files not found, the Wayland driver won't be supported." ;; - xno) ;; - *) as_fn_error $? "Wayland ${notice_platform}development files not found, the Wayland driver won't be supported. -This is an error since --with-wayland was requested." "$LINENO" 5 ;; -esac -enable_winewayland_drv=${enable_winewayland_drv:-no} -fi - -if test "$ac_cv_header_CL_cl_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clGetPlatformInfo in -lOpenCL" >&5 -printf %s "checking for clGetPlatformInfo in -lOpenCL... " >&6; } -if test ${ac_cv_lib_OpenCL_clGetPlatformInfo+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lOpenCL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char clGetPlatformInfo (); -int -main (void) -{ -return clGetPlatformInfo (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_OpenCL_clGetPlatformInfo=yes -else $as_nop - ac_cv_lib_OpenCL_clGetPlatformInfo=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenCL_clGetPlatformInfo" >&5 -printf "%s\n" "$ac_cv_lib_OpenCL_clGetPlatformInfo" >&6; } -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes -then : - OPENCL_LIBS="-lOpenCL" - -fi - -fi -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes -then : - case "x$with_opencl" in - x) as_fn_append wine_notices "|OpenCL ${notice_platform}development files not found, OpenCL won't be supported." ;; - xno) ;; - *) as_fn_error $? "OpenCL ${notice_platform}development files not found, OpenCL won't be supported. -This is an error since --with-opencl was requested." "$LINENO" 5 ;; -esac -enable_opencl=${enable_opencl:-no} -fi - -if test "$ac_cv_header_pcap_pcap_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_init in -lpcap" >&5 -printf %s "checking for pcap_init in -lpcap... " >&6; } -if test ${ac_cv_lib_pcap_pcap_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pcap_init (); -int -main (void) -{ -return pcap_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pcap_pcap_init=yes -else $as_nop - ac_cv_lib_pcap_pcap_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_init" >&5 -printf "%s\n" "$ac_cv_lib_pcap_pcap_init" >&6; } -if test "x$ac_cv_lib_pcap_pcap_init" = xyes -then : - PCAP_LIBS="-lpcap" - -fi - -fi -if test "x$ac_cv_lib_pcap_pcap_init" != xyes -then : - case "x$with_pcap" in - x) as_fn_append wine_notices "|pcap ${notice_platform}development files not found, wpcap won't be supported." ;; - xno) ;; - *) as_fn_error $? "pcap ${notice_platform}development files not found, wpcap won't be supported. -This is an error since --with-pcap was requested." "$LINENO" 5 ;; -esac -enable_wpcap=${enable_wpcap:-no} -fi - -if test "x$with_pcsclite" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SCardEstablishContext in -lpcsclite" >&5 -printf %s "checking for SCardEstablishContext in -lpcsclite... " >&6; } -if test ${ac_cv_lib_pcsclite_SCardEstablishContext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcsclite $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char SCardEstablishContext (); -int -main (void) -{ -return SCardEstablishContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pcsclite_SCardEstablishContext=yes -else $as_nop - ac_cv_lib_pcsclite_SCardEstablishContext=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcsclite_SCardEstablishContext" >&5 -printf "%s\n" "$ac_cv_lib_pcsclite_SCardEstablishContext" >&6; } -if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = xyes -then : - PCSCLITE_LIBS="-lpcsclite" - -else $as_nop - case $host_os in - darwin*|macosx*) PCSCLITE_LIBS="-framework PCSC" - ;; - esac -fi - -fi -if test "x$PCSCLITE_LIBS" = x -then : - case "x$with_pcsclite" in - x) as_fn_append wine_notices "|libpcsclite not found, smart cards won't be supported." ;; - xno) ;; - *) as_fn_error $? "libpcsclite not found, smart cards won't be supported. -This is an error since --with-pcsclite was requested." "$LINENO" 5 ;; -esac -enable_winscard=${enable_winscard:-no} -fi - -if test "x$with_inotify" != "xno" -then - rm -f conftest.err -if ${INOTIFY_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - INOTIFY_CFLAGS=`$PKG_CONFIG --cflags libinotify 2>conftest.err` -fi -fi - -if ${INOTIFY_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - INOTIFY_LIBS=`$PKG_CONFIG --libs libinotify 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libinotify cflags: $INOTIFY_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libinotify libs: $INOTIFY_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libinotify errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $INOTIFY_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_inotify_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_INOTIFY_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inotify_add_watch in -linotify" >&5 -printf %s "checking for inotify_add_watch in -linotify... " >&6; } -if test ${ac_cv_lib_inotify_inotify_add_watch+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-linotify $INOTIFY_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char inotify_add_watch (); -int -main (void) -{ -return inotify_add_watch (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_inotify_inotify_add_watch=yes -else $as_nop - ac_cv_lib_inotify_inotify_add_watch=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inotify_inotify_add_watch" >&5 -printf "%s\n" "$ac_cv_lib_inotify_inotify_add_watch" >&6; } -if test "x$ac_cv_lib_inotify_inotify_add_watch" = xyes -then : - : -else $as_nop - INOTIFY_LIBS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_header_sys_inotify_h" != "yes" -then : - case "x$with_inotify" in - x) as_fn_append wine_notices "|libinotify ${notice_platform}development files not found (or too old), filesystem change notifications won't be supported." ;; - xno) ;; - *) as_fn_error $? "libinotify ${notice_platform}development files not found (or too old), filesystem change notifications won't be supported. -This is an error since --with-inotify was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_dbus" != "xno" -then - rm -f conftest.err -if ${DBUS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1 2>conftest.err` -fi -fi - -if ${DBUS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - DBUS_LIBS=`$PKG_CONFIG --libs dbus-1 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: dbus-1 cflags: $DBUS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: dbus-1 libs: $DBUS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: dbus-1 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default" -if test "x$ac_cv_header_dbus_dbus_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -ldbus-1" >&5 -printf %s "checking for -ldbus-1... " >&6; } -if test ${ac_cv_lib_soname_dbus_1+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-ldbus-1 $DBUS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dbus_connection_close (); -int -main (void) -{ -return dbus_connection_close (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest.exe | grep "dbus-1" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_dbus_1=`$OTOOL -L conftest$ac_exeext | grep "libdbus-1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_dbus_1=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libdbus-1\\.$LIBEXT" | sed -e "s/^.*\\[\\(libdbus-1\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_dbus_1:+false} : -then : - ac_cv_lib_soname_dbus_1=`$LDD conftest$ac_exeext | grep "libdbus-1\\.$LIBEXT" | sed -e "s/^.*\(libdbus-1\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_dbus_1= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_dbus_1:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - DBUS_CFLAGS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_dbus_1" >&5 -printf "%s\n" "$ac_cv_lib_soname_dbus_1" >&6; } - -printf "%s\n" "#define SONAME_LIBDBUS_1 \"$ac_cv_lib_soname_dbus_1\"" >>confdefs.h - - -fi -else $as_nop - DBUS_CFLAGS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -case $host_os in - darwin*|macosx*) ;; - *) if test "x$ac_cv_lib_soname_dbus_1" = "x" -then : - case "x$with_dbus" in - x) as_fn_append wine_notices "|libdbus ${notice_platform}development files not found, no dynamic device support." ;; - xno) ;; - *) as_fn_error $? "libdbus ${notice_platform}development files not found, no dynamic device support. -This is an error since --with-dbus was requested." "$LINENO" 5 ;; -esac - -fi ;; -esac - -if test "x$with_gnutls" != "xno" -then - rm -f conftest.err -if ${GNUTLS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GNUTLS_CFLAGS=`$PKG_CONFIG --cflags gnutls 2>conftest.err` -fi -fi - -if ${GNUTLS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GNUTLS_LIBS=`$PKG_CONFIG --libs gnutls 2>/dev/null` -fi -fi - -GNUTLS_LIBS=${GNUTLS_LIBS:-"-lgnutls"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gnutls cflags: $GNUTLS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gnutls libs: $GNUTLS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: gnutls errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" -if test "x$ac_cv_header_gnutls_gnutls_h" = xyes -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(gnutls_mac_get_key_size) *func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lgnutls" >&5 -printf %s "checking for -lgnutls... " >&6; } -if test ${ac_cv_lib_soname_gnutls+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lgnutls $GNUTLS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gnutls_global_init (); -int -main (void) -{ -return gnutls_global_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_gnutls=`$ac_cv_path_LDD conftest.exe | grep "gnutls" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gnutls=`$OTOOL -L conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgnutls\\(-deb0\\)\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_gnutls=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_gnutls:+false} : -then : - ac_cv_lib_soname_gnutls=`$LDD conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\(libgnutls\\(-deb0\\)\\{0,1\\}\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_gnutls= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_gnutls:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - GNUTLS_CFLAGS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_gnutls" >&5 -printf "%s\n" "$ac_cv_lib_soname_gnutls" >&6; } - -printf "%s\n" "#define SONAME_LIBGNUTLS \"$ac_cv_lib_soname_gnutls\"" >>confdefs.h - - -fi - ac_wine_check_funcs_save_LIBS="$LIBS" -LIBS="$LIBS $GNUTLS_LIBS" - - for ac_func in gnutls_cipher_init -do : - ac_fn_c_check_func "$LINENO" "gnutls_cipher_init" "ac_cv_func_gnutls_cipher_init" -if test "x$ac_cv_func_gnutls_cipher_init" = xyes -then : - printf "%s\n" "#define HAVE_GNUTLS_CIPHER_INIT 1" >>confdefs.h - -else $as_nop - as_fn_append wine_notices "|libgnutls ${notice_platform}development files too old, bcrypt encryption won't be supported." -fi - -done -LIBS="$ac_wine_check_funcs_save_LIBS" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - GNUTLS_CFLAGS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_gnutls" = "x" -then : - case "x$with_gnutls" in - x) as_fn_append wine_warnings "|libgnutls ${notice_platform}development files not found, no schannel support." ;; - xno) ;; - *) as_fn_error $? "libgnutls ${notice_platform}development files not found, no schannel support. -This is an error since --with-gnutls was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_sane" != "xno" -then - rm -f conftest.err -if ${SANE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SANE_CFLAGS=`$PKG_CONFIG --cflags sane-backends 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || SANE_CFLAGS=${SANE_CFLAGS:-`${SANE_CONFIG:-sane-config} --cflags 2>/dev/null`} -if ${SANE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SANE_LIBS=`$PKG_CONFIG --libs sane-backends 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || SANE_LIBS=${SANE_LIBS:-`${SANE_CONFIG:-sane-config} --ldflags 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sane-backends cflags: $SANE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sane-backends libs: $SANE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: sane-backends errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SANE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "sane/sane.h" "ac_cv_header_sane_sane_h" "$ac_includes_default" -if test "x$ac_cv_header_sane_sane_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sane_init in -lsane" >&5 -printf %s "checking for sane_init in -lsane... " >&6; } -if test ${ac_cv_lib_sane_sane_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsane $SANE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char sane_init (); -int -main (void) -{ -return sane_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_sane_sane_init=yes -else $as_nop - ac_cv_lib_sane_sane_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sane_sane_init" >&5 -printf "%s\n" "$ac_cv_lib_sane_sane_init" >&6; } -if test "x$ac_cv_lib_sane_sane_init" = xyes -then : - : -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_sane_sane_init" != "yes" -then : - case "x$with_sane" in - x) as_fn_append wine_notices "|libsane ${notice_platform}development files not found, scanners won't be supported." ;; - xno) ;; - *) as_fn_error $? "libsane ${notice_platform}development files not found, scanners won't be supported. -This is an error since --with-sane was requested." "$LINENO" 5 ;; -esac -enable_sane_ds=${enable_sane_ds:-no} -fi - -if test "x$with_usb" != "xno" -then - rm -f conftest.err -if ${USB_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - USB_CFLAGS=`$PKG_CONFIG --cflags libusb-1.0 2>conftest.err` -fi -fi - -if ${USB_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - USB_LIBS=`$PKG_CONFIG --libs libusb-1.0 2>/dev/null` -fi -fi - -USB_LIBS=${USB_LIBS:-"-lusb-1.0"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libusb-1.0 cflags: $USB_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libusb-1.0 libs: $USB_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libusb-1.0 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $USB_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default" -if test "x$ac_cv_header_libusb_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libusb_interrupt_event_handler in -lusb-1.0" >&5 -printf %s "checking for libusb_interrupt_event_handler in -lusb-1.0... " >&6; } -if test ${ac_cv_lib_usb_1_0_libusb_interrupt_event_handler+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lusb-1.0 $USB_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char libusb_interrupt_event_handler (); -int -main (void) -{ -return libusb_interrupt_event_handler (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_usb_1_0_libusb_interrupt_event_handler=yes -else $as_nop - ac_cv_lib_usb_1_0_libusb_interrupt_event_handler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" >&5 -printf "%s\n" "$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" >&6; } -if test "x$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" = xyes -then : - : -else $as_nop - USB_LIBS="" -fi - -else $as_nop - USB_LIBS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" != "yes" -then : - case "x$with_usb" in - x) as_fn_append wine_notices "|libusb-1.0 ${notice_platform}development files not found (or too old), USB devices won't be supported." ;; - xno) ;; - *) as_fn_error $? "libusb-1.0 ${notice_platform}development files not found (or too old), USB devices won't be supported. -This is an error since --with-usb was requested." "$LINENO" 5 ;; -esac -enable_wineusb_sys=${enable_wineusb_sys:-no} -fi - -if test "x$with_v4l2" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lv4l2" >&5 -printf %s "checking for -lv4l2... " >&6; } -if test ${ac_cv_lib_soname_v4l2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lv4l2 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char v4l2_open (); -int -main (void) -{ -return v4l2_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_v4l2=`$ac_cv_path_LDD conftest.exe | grep "v4l2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_v4l2=`$OTOOL -L conftest$ac_exeext | grep "libv4l2\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libv4l2\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_v4l2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libv4l2\\.$LIBEXT" | sed -e "s/^.*\\[\\(libv4l2\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_v4l2:+false} : -then : - ac_cv_lib_soname_v4l2=`$LDD conftest$ac_exeext | grep "libv4l2\\.$LIBEXT" | sed -e "s/^.*\(libv4l2\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_v4l2= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_v4l2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_v4l2" >&5 -printf "%s\n" "$ac_cv_lib_soname_v4l2" >&6; } - -printf "%s\n" "#define SONAME_LIBV4L2 \"$ac_cv_lib_soname_v4l2\"" >>confdefs.h - - -fi -fi -if test "x$ac_cv_lib_soname_v4l2" = "x" -then : - case "x$with_v4l2" in - x) as_fn_append wine_notices "|libv4l2 ${notice_platform}development files not found." ;; - xno) ;; - *) as_fn_error $? "libv4l2 ${notice_platform}development files not found. -This is an error since --with-v4l2 was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_gphoto" != "xno" -then - rm -f conftest.err -if ${GPHOTO2_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_CFLAGS=`$PKG_CONFIG --cflags libgphoto2 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_CFLAGS=${GPHOTO2_CFLAGS:-`${GPHOTO2_CONFIG:-gphoto2-config} --cflags 2>/dev/null`} -if ${GPHOTO2_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_LIBS=`$PKG_CONFIG --libs libgphoto2 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_LIBS=${GPHOTO2_LIBS:-`${GPHOTO2_CONFIG:-gphoto2-config} --libs 2>/dev/null`} -GPHOTO2_LIBS=${GPHOTO2_LIBS:-"-lgphoto2"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2 cflags: $GPHOTO2_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2 libs: $GPHOTO2_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libgphoto2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GPHOTO2_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gphoto2-camera.h" "ac_cv_header_gphoto2_camera_h" "$ac_includes_default" -if test "x$ac_cv_header_gphoto2_camera_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_camera_new in -lgphoto2" >&5 -printf %s "checking for gp_camera_new in -lgphoto2... " >&6; } -if test ${ac_cv_lib_gphoto2_gp_camera_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgphoto2 $GPHOTO2_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gp_camera_new (); -int -main (void) -{ -return gp_camera_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gphoto2_gp_camera_new=yes -else $as_nop - ac_cv_lib_gphoto2_gp_camera_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gphoto2_gp_camera_new" >&5 -printf "%s\n" "$ac_cv_lib_gphoto2_gp_camera_new" >&6; } -if test "x$ac_cv_lib_gphoto2_gp_camera_new" = xyes -then : - : -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${GPHOTO2_PORT_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_PORT_CFLAGS=`$PKG_CONFIG --cflags libgphoto2_port 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_PORT_CFLAGS=${GPHOTO2_PORT_CFLAGS:-`${GPHOTO2_PORT_CONFIG:-gphoto2-port-config} --cflags 2>/dev/null`} -if ${GPHOTO2_PORT_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_PORT_LIBS=`$PKG_CONFIG --libs libgphoto2_port 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_PORT_LIBS=${GPHOTO2_PORT_LIBS:-`${GPHOTO2_PORT_CONFIG:-gphoto2-port-config} --libs 2>/dev/null`} -GPHOTO2_PORT_LIBS=${GPHOTO2_PORT_LIBS:-"-lgphoto2_port"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2_port cflags: $GPHOTO2_PORT_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2_port libs: $GPHOTO2_PORT_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libgphoto2_port errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GPHOTO2_PORT_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gphoto2-port.h" "ac_cv_header_gphoto2_port_h" "$ac_includes_default" -if test "x$ac_cv_header_gphoto2_port_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_port_info_list_new in -lgphoto2_port" >&5 -printf %s "checking for gp_port_info_list_new in -lgphoto2_port... " >&6; } -if test ${ac_cv_lib_gphoto2_port_gp_port_info_list_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgphoto2_port $GPHOTO2_PORT_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gp_port_info_list_new (); -int -main (void) -{ -return gp_port_info_list_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gphoto2_port_gp_port_info_list_new=yes -else $as_nop - ac_cv_lib_gphoto2_port_gp_port_info_list_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gphoto2_port_gp_port_info_list_new" >&5 -printf "%s\n" "$ac_cv_lib_gphoto2_port_gp_port_info_list_new" >&6; } -if test "x$ac_cv_lib_gphoto2_port_gp_port_info_list_new" = xyes -then : - -printf "%s\n" "#define HAVE_GPHOTO2_PORT 1" >>confdefs.h - -else $as_nop - GPHOTO2_PORT_LIBS=""; GPHOTO2_PORT_CFLAGS="" -fi - -else $as_nop - GPHOTO2_PORT_LIBS=""; GPHOTO2_PORT_CFLAGS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes" -then : - case "x$with_gphoto" in - x) as_fn_append wine_notices "|libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported." ;; - xno) ;; - *) as_fn_error $? "libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported. -This is an error since --with-gphoto was requested." "$LINENO" 5 ;; -esac -enable_gphoto2_ds=${enable_gphoto2_ds:-no} -fi -if test "$ac_cv_lib_gphoto2_port_gp_port_info_list_new" != "yes" -then : - case "x$with_gphoto" in - x) as_fn_append wine_notices "|libgphoto2_port ${notice_platform}development files not found, digital cameras won't be auto-detected." ;; - xno) ;; - *) as_fn_error $? "libgphoto2_port ${notice_platform}development files not found, digital cameras won't be auto-detected. -This is an error since --with-gphoto was requested." "$LINENO" 5 ;; -esac - -fi - - -if test "$ac_cv_header_resolv_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resolver library" >&5 -printf %s "checking for resolver library... " >&6; } -if test ${ac_cv_have_resolv+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_LIBS="$LIBS" - for lib in '' -lresolv - do - LIBS="$lib $ac_save_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef HAVE_NETINET_IN_H -#include -#endif -#include -int -main (void) -{ -if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0); ns_initparse(0,0,0) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have_resolv=${lib:-"none required"} -else $as_nop - ac_cv_have_resolv="not found" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - test "x$ac_cv_have_resolv" = "xnot found" || break - done - LIBS="$ac_save_LIBS" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_resolv" >&5 -printf "%s\n" "$ac_cv_have_resolv" >&6; } - - case "$ac_cv_have_resolv" in - "not found") ;; - "none required") - -printf "%s\n" "#define HAVE_RESOLV 1" >>confdefs.h - ;; - *) - printf "%s\n" "#define HAVE_RESOLV 1" >>confdefs.h - - RESOLV_LIBS=$ac_cv_have_resolv - ;; - esac - - if test "x$ac_cv_have_resolv" != "xnot found" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for res_getservers" >&5 -printf %s "checking for res_getservers... " >&6; } -if test ${ac_cv_have_res_getservers+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_LIBS="$LIBS" - LIBS="$RESOLV_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -res_getservers(NULL, NULL, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have_res_getservers=yes -else $as_nop - ac_cv_have_res_getservers=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_save_LIBS" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_res_getservers" >&5 -printf "%s\n" "$ac_cv_have_res_getservers" >&6; } - if test "$ac_cv_have_res_getservers" = "yes" - then - -printf "%s\n" "#define HAVE_RES_GETSERVERS 1" >>confdefs.h - - fi - fi -fi - -if test "x$with_freetype" != "xno" -then - rm -f conftest.err -if ${FREETYPE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FREETYPE_CFLAGS=`$PKG_CONFIG --cflags freetype2 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || FREETYPE_CFLAGS=${FREETYPE_CFLAGS:-`(${FREETYPE_CONFIG:-freetype-config} --cflags || ${FREETYPE2_CONFIG:-freetype2-config} --cflags) 2>/dev/null`} -if ${FREETYPE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FREETYPE_LIBS=`$PKG_CONFIG --libs freetype2 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || FREETYPE_LIBS=${FREETYPE_LIBS:-`(${FREETYPE_CONFIG:-freetype-config} --libs || ${FREETYPE2_CONFIG:-freetype2-config} --libs) 2>/dev/null`} -FREETYPE_LIBS=${FREETYPE_LIBS:-"-lfreetype"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: freetype2 cflags: $FREETYPE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: freetype2 libs: $FREETYPE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: freetype2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" -if test "x$ac_cv_header_ft2build_h" = xyes -then : - printf "%s\n" "#define HAVE_FT2BUILD_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_ft2build_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5 -printf %s "checking for -lfreetype... " >&6; } -if test ${ac_cv_lib_soname_freetype+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lfreetype $FREETYPE_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char FT_Init_FreeType (); -int -main (void) -{ -return FT_Init_FreeType (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest.exe | grep "freetype" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_freetype=`$OTOOL -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_freetype=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfreetype\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfreetype\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_freetype:+false} : -then : - ac_cv_lib_soname_freetype=`$LDD conftest$ac_exeext | grep "libfreetype\\.$LIBEXT" | sed -e "s/^.*\(libfreetype\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_freetype= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_freetype:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - FREETYPE_LIBS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_freetype" >&5 -printf "%s\n" "$ac_cv_lib_soname_freetype" >&6; } - -printf "%s\n" "#define SONAME_LIBFREETYPE \"$ac_cv_lib_soname_freetype\"" >>confdefs.h - - -printf "%s\n" "#define HAVE_FREETYPE 1" >>confdefs.h - - ac_fn_c_check_type "$LINENO" "FT_TrueTypeEngineType" "ac_cv_type_FT_TrueTypeEngineType" "#include -#include FT_MODULE_H -" -if test "x$ac_cv_type_FT_TrueTypeEngineType" = xyes -then : - -printf "%s\n" "#define HAVE_FT_TRUETYPEENGINETYPE 1" >>confdefs.h - - -fi - -fi - else - FREETYPE_CFLAGS="" - FREETYPE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_freetype" = x -then : - case "x$with_freetype" in - xno) ;; - *) as_fn_error $? "FreeType ${notice_platform}development files not found. Fonts will not be built. -Use the --without-freetype option if you really want this." "$LINENO" 5 ;; -esac -enable_fonts=${enable_fonts:-no} -fi - -ac_wine_check_funcs_save_LIBS="$LIBS" -LIBS="$LIBS $PTHREAD_LIBS" -ac_fn_c_check_func "$LINENO" "pthread_getthreadid_np" "ac_cv_func_pthread_getthreadid_np" -if test "x$ac_cv_func_pthread_getthreadid_np" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_GETTHREADID_NP 1" >>confdefs.h - -fi - -LIBS="$ac_wine_check_funcs_save_LIBS" - -if test "x$enable_tools" != xno -a "x$with_gettextpo" = xyes -then - if test "$ac_cv_header_gettext_po_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for po_message_msgctxt in -lgettextpo" >&5 -printf %s "checking for po_message_msgctxt in -lgettextpo... " >&6; } -if test ${ac_cv_lib_gettextpo_po_message_msgctxt+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgettextpo $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char po_message_msgctxt (); -int -main (void) -{ -return po_message_msgctxt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gettextpo_po_message_msgctxt=yes -else $as_nop - ac_cv_lib_gettextpo_po_message_msgctxt=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gettextpo_po_message_msgctxt" >&5 -printf "%s\n" "$ac_cv_lib_gettextpo_po_message_msgctxt" >&6; } -if test "x$ac_cv_lib_gettextpo_po_message_msgctxt" = xyes -then : - -printf "%s\n" "#define HAVE_LIBGETTEXTPO 1" >>confdefs.h - - GETTEXTPO_LIBS="-lgettextpo" - -fi - - fi - if test "x$GETTEXTPO_LIBS" = "x" -then : - case "x$with_gettextpo" in - x) as_fn_append wine_notices "|GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt." ;; - xno) ;; - *) as_fn_error $? "GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt. -This is an error since --with-gettextpo was requested." "$LINENO" 5 ;; -esac - -fi - if test "$srcdir" != . -then : - case "x$with_gettextpo" in - x) as_fn_append wine_notices "|Rebuilding po files is not supported for out of tree builds." ;; - xno) ;; - *) as_fn_error $? "Rebuilding po files is not supported for out of tree builds. -This is an error since --with-gettextpo was requested." "$LINENO" 5 ;; -esac - -fi -fi - -if test "x$with_pulse" != "xno"; -then - rm -f conftest.err -if ${PULSE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse 2>conftest.err` -fi -fi - -if ${PULSE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - PULSE_LIBS=`$PKG_CONFIG --libs libpulse 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libpulse cflags: $PULSE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libpulse libs: $PULSE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libpulse errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $PULSE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "pulse/pulseaudio.h" "ac_cv_header_pulse_pulseaudio_h" "$ac_includes_default" -if test "x$ac_cv_header_pulse_pulseaudio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pa_stream_is_corked in -lpulse" >&5 -printf %s "checking for pa_stream_is_corked in -lpulse... " >&6; } -if test ${ac_cv_lib_pulse_pa_stream_is_corked+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpulse $PULSE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pa_stream_is_corked (); -int -main (void) -{ -return pa_stream_is_corked (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pulse_pa_stream_is_corked=yes -else $as_nop - ac_cv_lib_pulse_pa_stream_is_corked=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pulse_pa_stream_is_corked" >&5 -printf "%s\n" "$ac_cv_lib_pulse_pa_stream_is_corked" >&6; } -if test "x$ac_cv_lib_pulse_pa_stream_is_corked" = xyes -then : - : -else $as_nop - PULSE_LIBS="" -fi - -else $as_nop - PULSE_LIBS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test -z "$PULSE_LIBS" -then : - case "x$with_pulse" in - x) as_fn_append wine_notices "|libpulse ${notice_platform}development files not found or too old, Pulse won't be supported." ;; - xno) ;; - *) as_fn_error $? "libpulse ${notice_platform}development files not found or too old, Pulse won't be supported. -This is an error since --with-pulse was requested." "$LINENO" 5 ;; -esac -enable_winepulse_drv=${enable_winepulse_drv:-no} -fi - -if test "x$with_gstreamer" != "xno" -then - rm -f conftest.err -if ${GSTREAMER_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSTREAMER_CFLAGS=`$PKG_CONFIG --cflags gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 2>conftest.err` -fi -fi - -if ${GSTREAMER_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSTREAMER_LIBS=`$PKG_CONFIG --libs gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 cflags: $GSTREAMER_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 libs: $GSTREAMER_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GSTREAMER_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gst/gst.h" "ac_cv_header_gst_gst_h" "$ac_includes_default" -if test "x$ac_cv_header_gst_gst_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gint64 defined by gst/gst.h is indeed 64-bit" >&5 -printf %s "checking whether gint64 defined by gst/gst.h is indeed 64-bit... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -static int a[sizeof(gint64) > 4 ? 1 : -1]; if (a[0]) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gst_pad_new in -lgstreamer-1.0" >&5 -printf %s "checking for gst_pad_new in -lgstreamer-1.0... " >&6; } -if test ${ac_cv_lib_gstreamer_1_0_gst_pad_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgstreamer-1.0 $GSTREAMER_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gst_pad_new (); -int -main (void) -{ -return gst_pad_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gstreamer_1_0_gst_pad_new=yes -else $as_nop - ac_cv_lib_gstreamer_1_0_gst_pad_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gstreamer_1_0_gst_pad_new" >&5 -printf "%s\n" "$ac_cv_lib_gstreamer_1_0_gst_pad_new" >&6; } -if test "x$ac_cv_lib_gstreamer_1_0_gst_pad_new" = xyes -then : - : -fi - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ac_glib2_broken=yes - enable_winegstreamer=${enable_winegstreamer:-no} - as_fn_append wine_notices "|glib-2.0 pkgconfig configuration is for the wrong architecture, winegstreamer won't be built." -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_glib2_broken" != xyes -a "x$ac_cv_lib_gstreamer_1_0_gst_pad_new" != xyes -then : - case "x$with_gstreamer" in - x) as_fn_append wine_notices "|gstreamer-1.0 base plugins ${notice_platform}development files not found, GStreamer won't be supported." ;; - xno) ;; - *) as_fn_error $? "gstreamer-1.0 base plugins ${notice_platform}development files not found, GStreamer won't be supported. -This is an error since --with-gstreamer was requested." "$LINENO" 5 ;; -esac -enable_winegstreamer=${enable_winegstreamer:-no} -fi - -ALSA_LIBS="" - -if test "x$with_alsa" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_hw_params_get_access_mask in -lasound" >&5 -printf %s "checking for snd_pcm_hw_params_get_access_mask in -lasound... " >&6; } -if test ${ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lasound $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char snd_pcm_hw_params_get_access_mask (); -int -main (void) -{ -return snd_pcm_hw_params_get_access_mask (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask=yes -else $as_nop - ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" >&5 -printf "%s\n" "$ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" >&6; } -if test "x$ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" = xyes -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -snd_pcm_hw_params_get_access_mask(NULL, NULL) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ALSA_LIBS="-lasound" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} - -if test "x$with_oss" != xno -then - ac_save_CPPFLAGS="$CPPFLAGS" - if test -f /etc/oss.conf - then - . /etc/oss.conf - fi - ac_oss_incl="-I${OSSLIBDIR:-/usr/lib/oss}/include" - CPPFLAGS="$CPPFLAGS $ac_oss_incl" - ac_fn_c_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = xyes -then : - ac_fn_c_check_member "$LINENO" "oss_sysinfo" "numaudioengines" "ac_cv_member_oss_sysinfo_numaudioengines" "#include -" -if test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes -then : - -printf "%s\n" "#define HAVE_OSS_SYSINFO_NUMAUDIOENGINES 1" >>confdefs.h - -OSS4_CFLAGS="$ac_oss_incl" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5 -printf %s "checking for _oss_ioctl in -lossaudio... " >&6; } -if test ${ac_cv_lib_ossaudio__oss_ioctl+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lossaudio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _oss_ioctl (); -int -main (void) -{ -return _oss_ioctl (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_ossaudio__oss_ioctl=yes -else $as_nop - ac_cv_lib_ossaudio__oss_ioctl=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5 -printf "%s\n" "$ac_cv_lib_ossaudio__oss_ioctl" >&6; } -if test "x$ac_cv_lib_ossaudio__oss_ioctl" = xyes -then : - OSS4_LIBS="-lossaudio" - -fi - -fi - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" -fi -if test "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -then : - case "x$with_oss" in - x) as_fn_append wine_notices "|OSS sound system found but too old (OSSv4 needed), OSS won't be supported." ;; - xno) ;; - *) as_fn_error $? "OSS sound system found but too old (OSSv4 needed), OSS won't be supported. -This is an error since --with-oss was requested." "$LINENO" 5 ;; -esac -enable_wineoss_drv=${enable_wineoss_drv:-no} -fi - -if test "x$with_udev" != "xno" -then - rm -f conftest.err -if ${UDEV_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UDEV_CFLAGS=`$PKG_CONFIG --cflags libudev 2>conftest.err` -fi -fi - -if ${UDEV_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UDEV_LIBS=`$PKG_CONFIG --libs libudev 2>/dev/null` -fi -fi - -UDEV_LIBS=${UDEV_LIBS:-"-ludev"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libudev cflags: $UDEV_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libudev libs: $UDEV_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libudev errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $UDEV_CFLAGS" - for ac_header in libudev.h -do : - ac_fn_c_check_header_compile "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default" -if test "x$ac_cv_header_libudev_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBUDEV_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for udev_new in -ludev" >&5 -printf %s "checking for udev_new in -ludev... " >&6; } -if test ${ac_cv_lib_udev_udev_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ludev $UDEV_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char udev_new (); -int -main (void) -{ -return udev_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_udev_udev_new=yes -else $as_nop - ac_cv_lib_udev_udev_new=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_new" >&5 -printf "%s\n" "$ac_cv_lib_udev_udev_new" >&6; } -if test "x$ac_cv_lib_udev_udev_new" = xyes -then : - -printf "%s\n" "#define HAVE_UDEV 1" >>confdefs.h - -else $as_nop - UDEV_LIBS="" -fi - -else $as_nop - UDEV_LIBS="" -fi - -done -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$UDEV_LIBS" = "x" -then : - case "x$with_udev" in - x) as_fn_append wine_notices "|libudev ${notice_platform}development files not found, plug and play won't be supported." ;; - xno) ;; - *) as_fn_error $? "libudev ${notice_platform}development files not found, plug and play won't be supported. -This is an error since --with-udev was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_unwind" != xno -then - rm -f conftest.err -if ${UNWIND_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UNWIND_CFLAGS=`$PKG_CONFIG --cflags libunwind 2>conftest.err` -fi -fi - -if ${UNWIND_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UNWIND_LIBS=`$PKG_CONFIG --libs libunwind 2>/dev/null` -fi -fi - -UNWIND_LIBS=${UNWIND_LIBS:-"-lunwind"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libunwind cflags: $UNWIND_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libunwind libs: $UNWIND_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libunwind errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $UNWIND_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unw_step" >&5 -printf %s "checking for unw_step... " >&6; } -if test ${wine_cv_have_unw_step+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define UNW_LOCAL_ONLY -#include -int -main (void) -{ -unw_cursor_t cursor; unw_step( &cursor ); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_unw_step="yes" -else $as_nop - wine_cv_have_unw_step="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_unw_step" >&5 -printf "%s\n" "$wine_cv_have_unw_step" >&6; } - if test "$wine_cv_have_unw_step" = no -a -n "$UNWIND_LIBS" - then - save_libs=$LIBS - UNWIND_LIBS="-static-libgcc $UNWIND_LIBS" - LIBS="$UNWIND_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unw_step in libunwind" >&5 -printf %s "checking for unw_step in libunwind... " >&6; } -if test ${wine_cv_have_libunwind_unw_step+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define UNW_LOCAL_ONLY -#include -int -main (void) -{ -unw_cursor_t cursor; unw_step( &cursor ); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_libunwind_unw_step="yes" -else $as_nop - wine_cv_have_libunwind_unw_step="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_libunwind_unw_step" >&5 -printf "%s\n" "$wine_cv_have_libunwind_unw_step" >&6; } - LIBS=$save_libs - fi - test "$wine_cv_have_libunwind_unw_step" = yes || UNWIND_LIBS="" - if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono - then - -printf "%s\n" "#define HAVE_LIBUNWIND 1" >>confdefs.h - - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -case $host in - aarch64*|*-darwin*) - if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" = xnono -then : - case "x$with_unwind" in - x) as_fn_append wine_notices "|libunwind ${notice_platform}development files not found, stack unwinding won't work." ;; - xno) ;; - *) as_fn_error $? "libunwind ${notice_platform}development files not found, stack unwinding won't work. -This is an error since --with-unwind was requested." "$LINENO" 5 ;; -esac - -fi ;; -esac - -if test "x$with_sdl" != "xno" -then - rm -f conftest.err -if ${SDL2_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SDL2_CFLAGS=`$PKG_CONFIG --cflags sdl2 2>conftest.err` -fi -fi - -if ${SDL2_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SDL2_LIBS=`$PKG_CONFIG --libs sdl2 2>/dev/null` -fi -fi - -SDL2_LIBS=${SDL2_LIBS:-"-lSDL2"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sdl2 cflags: $SDL2_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sdl2 libs: $SDL2_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: sdl2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SDL2_CFLAGS" - for ac_header in SDL.h -do : - ac_fn_c_check_header_compile "$LINENO" "SDL.h" "ac_cv_header_SDL_h" "$ac_includes_default" -if test "x$ac_cv_header_SDL_h" = xyes -then : - printf "%s\n" "#define HAVE_SDL_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lSDL2" >&5 -printf %s "checking for -lSDL2... " >&6; } -if test ${ac_cv_lib_soname_SDL2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lSDL2 $SDL2_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char SDL_Init (); -int -main (void) -{ -return SDL_Init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_SDL2=`$ac_cv_path_LDD conftest.exe | grep "SDL2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_SDL2=`$OTOOL -L conftest$ac_exeext | grep "libSDL2-2.0*\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libSDL2-2.0*\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_SDL2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libSDL2-2.0*\\.$LIBEXT" | sed -e "s/^.*\\[\\(libSDL2-2.0*\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_SDL2:+false} : -then : - ac_cv_lib_soname_SDL2=`$LDD conftest$ac_exeext | grep "libSDL2-2.0*\\.$LIBEXT" | sed -e "s/^.*\(libSDL2-2.0*\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_SDL2= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_SDL2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_SDL2" >&5 -printf "%s\n" "$ac_cv_lib_soname_SDL2" >&6; } - -printf "%s\n" "#define SONAME_LIBSDL2 \"$ac_cv_lib_soname_SDL2\"" >>confdefs.h - - -fi -fi - -done -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_SDL2" = "x" -then : - case "x$with_sdl" in - x) as_fn_append wine_notices "|libSDL2 ${notice_platform}development files not found, SDL2 won't be supported." ;; - xno) ;; - *) as_fn_error $? "libSDL2 ${notice_platform}development files not found, SDL2 won't be supported. -This is an error since --with-sdl was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_capi" != "xno" -then - rm -f conftest.err -if ${CAPI20_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CAPI20_CFLAGS=`$PKG_CONFIG --cflags capi20 2>conftest.err` -fi -fi - -if ${CAPI20_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CAPI20_LIBS=`$PKG_CONFIG --libs capi20 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capi20 cflags: $CAPI20_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capi20 libs: $CAPI20_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: capi20 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $CAPI20_CFLAGS" - ac_fn_c_check_header_compile "$LINENO" "capi20.h" "ac_cv_header_capi20_h" "#define __user -" -if test "x$ac_cv_header_capi20_h" = xyes -then : - printf "%s\n" "#define HAVE_CAPI20_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/capi.h" "ac_cv_header_linux_capi_h" "#define __user -" -if test "x$ac_cv_header_linux_capi_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAPI_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for capi20_register in -lcapi20" >&5 -printf %s "checking for capi20_register in -lcapi20... " >&6; } -if test ${ac_cv_lib_capi20_capi20_register+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcapi20 $CAPI20_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char capi20_register (); -int -main (void) -{ -return capi20_register (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_capi20_capi20_register=yes -else $as_nop - ac_cv_lib_capi20_capi20_register=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_capi20_capi20_register" >&5 -printf "%s\n" "$ac_cv_lib_capi20_capi20_register" >&6; } -if test "x$ac_cv_lib_capi20_capi20_register" = xyes -then : - : -else $as_nop - CAPI20_LIBS="" -fi - - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_capi20_capi20_register" != xyes -then : - case "x$with_capi" in - x) as_fn_append wine_notices "|libcapi20 ${notice_platform}development files not found, ISDN won't be supported." ;; - xno) ;; - *) as_fn_error $? "libcapi20 ${notice_platform}development files not found, ISDN won't be supported. -This is an error since --with-capi was requested." "$LINENO" 5 ;; -esac -enable_capi2032=${enable_capi2032:-no} -fi - -if test "x$with_cups" != "xno" -then - rm -f conftest.err -if ${CUPS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CUPS_CFLAGS=`$PKG_CONFIG --cflags cups 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || CUPS_CFLAGS=${CUPS_CFLAGS:-`${CUPS_CONFIG:-cups-config} --cflags 2>/dev/null`} -if ${CUPS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CUPS_LIBS=`$PKG_CONFIG --libs cups 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || CUPS_LIBS=${CUPS_LIBS:-`${CUPS_CONFIG:-cups-config} --libs 2>/dev/null`} -CUPS_LIBS=${CUPS_LIBS:-"-lcups"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: cups cflags: $CUPS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: cups libs: $CUPS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: cups errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $CUPS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_cups_h" = xyes -then : - printf "%s\n" "#define HAVE_CUPS_CUPS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "cups/ppd.h" "ac_cv_header_cups_ppd_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_ppd_h" = xyes -then : - printf "%s\n" "#define HAVE_CUPS_PPD_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_cups_cups_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lcups" >&5 -printf %s "checking for -lcups... " >&6; } -if test ${ac_cv_lib_soname_cups+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lcups $CUPS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char cupsGetDefault (); -int -main (void) -{ -return cupsGetDefault (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest.exe | grep "cups" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_cups=`$OTOOL -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_cups=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libcups\\.$LIBEXT" | sed -e "s/^.*\\[\\(libcups\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_cups:+false} : -then : - ac_cv_lib_soname_cups=`$LDD conftest$ac_exeext | grep "libcups\\.$LIBEXT" | sed -e "s/^.*\(libcups\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_cups= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_cups:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - CUPS_LIBS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_cups" >&5 -printf "%s\n" "$ac_cv_lib_soname_cups" >&6; } - -printf "%s\n" "#define SONAME_LIBCUPS \"$ac_cv_lib_soname_cups\"" >>confdefs.h - - -fi - else - CUPS_CFLAGS="" - CUPS_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_cups" = "x" -then : - case "x$with_cups" in - x) as_fn_append wine_notices "|libcups ${notice_platform}development files not found, CUPS won't be supported." ;; - xno) ;; - *) as_fn_error $? "libcups ${notice_platform}development files not found, CUPS won't be supported. -This is an error since --with-cups was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_fontconfig" != "xno" -then - rm -f conftest.err -if ${FONTCONFIG_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags fontconfig 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || FONTCONFIG_CFLAGS=${FONTCONFIG_CFLAGS:-$X_CFLAGS} -if ${FONTCONFIG_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FONTCONFIG_LIBS=`$PKG_CONFIG --libs fontconfig 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || FONTCONFIG_LIBS=${FONTCONFIG_LIBS:-$X_LIBS} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fontconfig cflags: $FONTCONFIG_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fontconfig libs: $FONTCONFIG_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: fontconfig errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" -if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lfontconfig" >&5 -printf %s "checking for -lfontconfig... " >&6; } -if test ${ac_cv_lib_soname_fontconfig+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lfontconfig $FONTCONFIG_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char FcInit (); -int -main (void) -{ -return FcInit (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest.exe | grep "fontconfig" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_fontconfig=`$OTOOL -L conftest$ac_exeext | grep "libfontconfig\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_fontconfig=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfontconfig\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfontconfig\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_fontconfig:+false} : -then : - ac_cv_lib_soname_fontconfig=`$LDD conftest$ac_exeext | grep "libfontconfig\\.$LIBEXT" | sed -e "s/^.*\(libfontconfig\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_fontconfig= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_fontconfig:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - FONTCONFIG_CFLAGS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_fontconfig" >&5 -printf "%s\n" "$ac_cv_lib_soname_fontconfig" >&6; } - -printf "%s\n" "#define SONAME_LIBFONTCONFIG \"$ac_cv_lib_soname_fontconfig\"" >>confdefs.h - - -fi -else $as_nop - FONTCONFIG_CFLAGS="" -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_fontconfig" = "x" -then : - case "x$with_fontconfig" in - x) as_fn_append wine_notices "|fontconfig ${notice_platform}development files not found, fontconfig won't be supported." ;; - xno) ;; - *) as_fn_error $? "fontconfig ${notice_platform}development files not found, fontconfig won't be supported. -This is an error since --with-fontconfig was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_krb5" != "xno" -then - rm -f conftest.err -if ${KRB5_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - KRB5_CFLAGS=`$PKG_CONFIG --cflags krb5 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || KRB5_CFLAGS=${KRB5_CFLAGS:-`${KRB5_CONFIG:-krb5-config} --cflags 2>/dev/null`} -if ${KRB5_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - KRB5_LIBS=`$PKG_CONFIG --libs krb5 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || KRB5_LIBS=${KRB5_LIBS:-`${KRB5_CONFIG:-krb5-config} --libs 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5 cflags: $KRB5_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5 libs: $KRB5_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: krb5 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "krb5/krb5.h" "ac_cv_header_krb5_krb5_h" "$ac_includes_default" -if test "x$ac_cv_header_krb5_krb5_h" = xyes -then : - printf "%s\n" "#define HAVE_KRB5_KRB5_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_krb5_krb5_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lkrb5" >&5 -printf %s "checking for -lkrb5... " >&6; } -if test ${ac_cv_lib_soname_krb5+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lkrb5 $KRB5_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char krb5_is_config_principal (); -int -main (void) -{ -return krb5_is_config_principal (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_krb5=`$ac_cv_path_LDD conftest.exe | grep "krb5" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_krb5=`$OTOOL -L conftest$ac_exeext | grep "libkrb5\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libkrb5\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_krb5=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libkrb5\\.$LIBEXT" | sed -e "s/^.*\\[\\(libkrb5\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_krb5:+false} : -then : - ac_cv_lib_soname_krb5=`$LDD conftest$ac_exeext | grep "libkrb5\\.$LIBEXT" | sed -e "s/^.*\(libkrb5\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_krb5= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_krb5:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - KRB5_CFLAGS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_krb5" >&5 -printf "%s\n" "$ac_cv_lib_soname_krb5" >&6; } - -printf "%s\n" "#define SONAME_LIBKRB5 \"$ac_cv_lib_soname_krb5\"" >>confdefs.h - - -fi - else - KRB5_CFLAGS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_krb5" = "x" -then : - case "x$with_krb5" in - x) as_fn_append wine_notices "|libkrb5 ${notice_platform}development files not found (or too old), Kerberos won't be supported." ;; - xno) ;; - *) as_fn_error $? "libkrb5 ${notice_platform}development files not found (or too old), Kerberos won't be supported. -This is an error since --with-krb5 was requested." "$LINENO" 5 ;; -esac - -fi -test "x$ac_cv_lib_soname_krb5" != "x" || with_gssapi=${with_gssapi:-no} - -if test "x$with_gssapi" != "xno" -then - rm -f conftest.err -if ${GSSAPI_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSSAPI_CFLAGS=`$PKG_CONFIG --cflags krb5-gssapi 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GSSAPI_CFLAGS=${GSSAPI_CFLAGS:-`${KRB5_CONFIG:-krb5-config} --cflags gssapi 2>/dev/null`} -if ${GSSAPI_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSSAPI_LIBS=`$PKG_CONFIG --libs krb5-gssapi 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GSSAPI_LIBS=${GSSAPI_LIBS:-`${KRB5_CONFIG:-krb5-config} --libs gssapi 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5-gssapi cflags: $GSSAPI_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5-gssapi libs: $GSSAPI_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: krb5-gssapi errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_h" = xyes -then : - printf "%s\n" "#define HAVE_GSSAPI_GSSAPI_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi_ext.h" "ac_cv_header_gssapi_gssapi_ext_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_ext_h" = xyes -then : - printf "%s\n" "#define HAVE_GSSAPI_GSSAPI_EXT_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_gssapi_gssapi_h" = "yes" -a "$ac_cv_header_gssapi_gssapi_ext_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lgssapi_krb5" >&5 -printf %s "checking for -lgssapi_krb5... " >&6; } -if test ${ac_cv_lib_soname_gssapi_krb5+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lgssapi_krb5 $GSSAPI_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gss_init_sec_context (); -int -main (void) -{ -return gss_init_sec_context (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_gssapi_krb5=`$ac_cv_path_LDD conftest.exe | grep "gssapi_krb5" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gssapi_krb5=`$OTOOL -L conftest$ac_exeext | grep "libgssapi_krb5\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgssapi_krb5\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_gssapi_krb5=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgssapi_krb5\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgssapi_krb5\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_gssapi_krb5:+false} : -then : - ac_cv_lib_soname_gssapi_krb5=`$LDD conftest$ac_exeext | grep "libgssapi_krb5\\.$LIBEXT" | sed -e "s/^.*\(libgssapi_krb5\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_gssapi_krb5= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_gssapi_krb5:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - GSSAPI_CFLAGS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_gssapi_krb5" >&5 -printf "%s\n" "$ac_cv_lib_soname_gssapi_krb5" >&6; } - -printf "%s\n" "#define SONAME_LIBGSSAPI_KRB5 \"$ac_cv_lib_soname_gssapi_krb5\"" >>confdefs.h - - -fi - else - GSSAPI_CFLAGS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_gssapi_krb5" = "x" -then : - case "x$with_gssapi" in - x) as_fn_append wine_notices "|libgssapi_krb5 ${notice_platform}development files not found (or too old), no Kerberos SSP support." ;; - xno) ;; - *) as_fn_error $? "libgssapi_krb5 ${notice_platform}development files not found (or too old), no Kerberos SSP support. -This is an error since --with-gssapi was requested." "$LINENO" 5 ;; -esac - -fi - -if test "$ac_cv_header_libprocstat_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for procstat_open_sysctl in -lprocstat" >&5 -printf %s "checking for procstat_open_sysctl in -lprocstat... " >&6; } -if test ${ac_cv_lib_procstat_procstat_open_sysctl+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lprocstat $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char procstat_open_sysctl (); -int -main (void) -{ -return procstat_open_sysctl (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_procstat_procstat_open_sysctl=yes -else $as_nop - ac_cv_lib_procstat_procstat_open_sysctl=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_procstat_procstat_open_sysctl" >&5 -printf "%s\n" "$ac_cv_lib_procstat_procstat_open_sysctl" >&6; } -if test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes -then : - -printf "%s\n" "#define HAVE_LIBPROCSTAT 1" >>confdefs.h - - PROCSTAT_LIBS="-lprocstat" - -fi - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lodbc" >&5 -printf %s "checking for -lodbc... " >&6; } -if test ${ac_cv_lib_soname_odbc+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lodbc $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char SQLConnect (); -int -main (void) -{ -return SQLConnect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_odbc=`$ac_cv_path_LDD conftest.exe | grep "odbc" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_odbc=`$OTOOL -L conftest$ac_exeext | grep "libodbc\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libodbc\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_odbc=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libodbc\\.$LIBEXT" | sed -e "s/^.*\\[\\(libodbc\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_odbc:+false} : -then : - ac_cv_lib_soname_odbc=`$LDD conftest$ac_exeext | grep "libodbc\\.$LIBEXT" | sed -e "s/^.*\(libodbc\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_odbc= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_odbc:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - printf "%s\n" "#define SONAME_LIBODBC \"libodbc.$LIBEXT\"" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_odbc" >&5 -printf "%s\n" "$ac_cv_lib_soname_odbc" >&6; } - -printf "%s\n" "#define SONAME_LIBODBC \"$ac_cv_lib_soname_odbc\"" >>confdefs.h - - -fi - -if test "x$with_netapi" != "xno" -then - rm -f conftest.err -if ${NETAPI_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - NETAPI_CFLAGS=`$PKG_CONFIG --cflags netapi 2>conftest.err` -fi -fi - -if ${NETAPI_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - NETAPI_LIBS=`$PKG_CONFIG --libs netapi 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: netapi cflags: $NETAPI_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: netapi libs: $NETAPI_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: netapi errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $NETAPI_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lnetapi" >&5 -printf %s "checking for -lnetapi... " >&6; } -if test ${ac_cv_lib_soname_netapi+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lnetapi $NETAPI_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char libnetapi_init (); -int -main (void) -{ -return libnetapi_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_netapi=`$ac_cv_path_LDD conftest.exe | grep "netapi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_netapi=`$OTOOL -L conftest$ac_exeext | grep "libnetapi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libnetapi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_netapi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libnetapi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libnetapi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_netapi:+false} : -then : - ac_cv_lib_soname_netapi=`$LDD conftest$ac_exeext | grep "libnetapi\\.$LIBEXT" | sed -e "s/^.*\(libnetapi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_netapi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_netapi:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - printf "%s\n" "#define SONAME_LIBNETAPI \"libnetapi.$LIBEXT\"" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_netapi" >&5 -printf "%s\n" "$ac_cv_lib_soname_netapi" >&6; } - -printf "%s\n" "#define SONAME_LIBNETAPI \"$ac_cv_lib_soname_netapi\"" >>confdefs.h - - -fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_netapi" = "x" -then : - case "x$with_netapi" in - x) as_fn_append wine_notices "|libnetapi not found, Samba NetAPI won't be supported." ;; - xno) ;; - *) as_fn_error $? "libnetapi not found, Samba NetAPI won't be supported. -This is an error since --with-netapi was requested." "$LINENO" 5 ;; -esac -enable_netapi=${enable_netapi:-no} -fi - - -if test "x$enable_winealsa_drv$enable_winecoreaudio_drv$enable_winepulse_drv$enable_wineoss_drv$enable_wineandroid_drv" = xnonononono -a \ - "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono -then - as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." -fi - -if test "x$with_vulkan" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lvulkan" >&5 -printf %s "checking for -lvulkan... " >&6; } -if test ${ac_cv_lib_soname_vulkan+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lvulkan $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char vkGetInstanceProcAddr (); -int -main (void) -{ -return vkGetInstanceProcAddr (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_vulkan=`$ac_cv_path_LDD conftest.exe | grep "vulkan" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_vulkan=`$OTOOL -L conftest$ac_exeext | grep "libvulkan\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libvulkan\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_vulkan=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libvulkan\\.$LIBEXT" | sed -e "s/^.*\\[\\(libvulkan\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_vulkan:+false} : -then : - ac_cv_lib_soname_vulkan=`$LDD conftest$ac_exeext | grep "libvulkan\\.$LIBEXT" | sed -e "s/^.*\(libvulkan\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_vulkan= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_vulkan:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_vulkan" >&5 -printf "%s\n" "$ac_cv_lib_soname_vulkan" >&6; } - -printf "%s\n" "#define SONAME_LIBVULKAN \"$ac_cv_lib_soname_vulkan\"" >>confdefs.h - - -fi - if test "x$ac_cv_lib_soname_vulkan" = "x" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lMoltenVK" >&5 -printf %s "checking for -lMoltenVK... " >&6; } -if test ${ac_cv_lib_soname_MoltenVK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_soname_save_LIBS=$LIBS -LIBS="-lMoltenVK $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char vkGetInstanceProcAddr (); -int -main (void) -{ -return vkGetInstanceProcAddr (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_MoltenVK=`$ac_cv_path_LDD conftest.exe | grep "MoltenVK" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_MoltenVK=`$OTOOL -L conftest$ac_exeext | grep "libMoltenVK\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libMoltenVK\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_MoltenVK=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libMoltenVK\\.$LIBEXT" | sed -e "s/^.*\\[\\(libMoltenVK\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_MoltenVK:+false} : -then : - ac_cv_lib_soname_MoltenVK=`$LDD conftest$ac_exeext | grep "libMoltenVK\\.$LIBEXT" | sed -e "s/^.*\(libMoltenVK\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else $as_nop - ac_cv_lib_soname_MoltenVK= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if ${ac_cv_lib_soname_MoltenVK:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_MoltenVK" >&5 -printf "%s\n" "$ac_cv_lib_soname_MoltenVK" >&6; } - -printf "%s\n" "#define SONAME_LIBMOLTENVK \"$ac_cv_lib_soname_MoltenVK\"" >>confdefs.h - - -fi - fi -fi -if test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x" -then : - case "x$with_vulkan" in - x) as_fn_append wine_notices "|libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported." ;; - xno) ;; - *) as_fn_error $? "libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported. -This is an error since --with-vulkan was requested." "$LINENO" 5 ;; -esac - -fi - - -if test "x${GCC}" = "xyes" -then - EXTRACFLAGS="$EXTRACFLAGS -Wall -pipe" - - saved_CFLAGS=$CFLAGS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5 -printf %s "checking whether the compiler supports -Werror=unknown-warning-option... " >&6; } -if test ${ac_cv_cflags__Werror_unknown_warning_option+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=unknown-warning-option" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_unknown_warning_option=yes -else $as_nop - ac_cv_cflags__Werror_unknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unknown_warning_option" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_unknown_warning_option" >&6; } -if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes -then : - CFLAGS="$CFLAGS -Werror=unknown-warning-option" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unused-command-line-argument" >&5 -printf %s "checking whether the compiler supports -Werror=unused-command-line-argument... " >&6; } -if test ${ac_cv_cflags__Werror_unused_command_line_argument+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=unused-command-line-argument" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_unused_command_line_argument=yes -else $as_nop - ac_cv_cflags__Werror_unused_command_line_argument=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unused_command_line_argument" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_unused_command_line_argument" >&6; } -if test "x$ac_cv_cflags__Werror_unused_command_line_argument" = xyes -then : - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=ignored-optimization-argument" >&5 -printf %s "checking whether the compiler supports -Werror=ignored-optimization-argument... " >&6; } -if test ${ac_cv_cflags__Werror_ignored_optimization_argument+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_ignored_optimization_argument=yes -else $as_nop - ac_cv_cflags__Werror_ignored_optimization_argument=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_ignored_optimization_argument" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_ignored_optimization_argument" >&6; } -if test "x$ac_cv_cflags__Werror_ignored_optimization_argument" = xyes -then : - CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fcf-protection=none" >&5 -printf %s "checking whether the compiler supports -fcf-protection=none... " >&6; } -if test ${ac_cv_cflags__fcf_protection_none+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fcf-protection=none" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fcf_protection_none=yes -else $as_nop - ac_cv_cflags__fcf_protection_none=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fcf_protection_none" >&5 -printf "%s\n" "$ac_cv_cflags__fcf_protection_none" >&6; } -if test "x$ac_cv_cflags__fcf_protection_none" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fcf-protection=none" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fvisibility=hidden" >&5 -printf %s "checking whether the compiler supports -fvisibility=hidden... " >&6; } -if test ${ac_cv_cflags__fvisibility_hidden+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fvisibility=hidden" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fvisibility_hidden=yes -else $as_nop - ac_cv_cflags__fvisibility_hidden=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fvisibility_hidden" >&5 -printf "%s\n" "$ac_cv_cflags__fvisibility_hidden" >&6; } -if test "x$ac_cv_cflags__fvisibility_hidden" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fvisibility=hidden" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-stack-protector" >&5 -printf %s "checking whether the compiler supports -fno-stack-protector... " >&6; } -if test ${ac_cv_cflags__fno_stack_protector+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-stack-protector" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_stack_protector=yes -else $as_nop - ac_cv_cflags__fno_stack_protector=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_stack_protector" >&5 -printf "%s\n" "$ac_cv_cflags__fno_stack_protector" >&6; } -if test "x$ac_cv_cflags__fno_stack_protector" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fno-stack-protector" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-strict-aliasing" >&5 -printf %s "checking whether the compiler supports -fno-strict-aliasing... " >&6; } -if test ${ac_cv_cflags__fno_strict_aliasing+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-strict-aliasing" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_strict_aliasing=yes -else $as_nop - ac_cv_cflags__fno_strict_aliasing=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_strict_aliasing" >&5 -printf "%s\n" "$ac_cv_cflags__fno_strict_aliasing" >&6; } -if test "x$ac_cv_cflags__fno_strict_aliasing" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 -printf %s "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } -if test ${ac_cv_cflags__Wdeclaration_after_statement+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wdeclaration-after-statement" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wdeclaration_after_statement=yes -else $as_nop - ac_cv_cflags__Wdeclaration_after_statement=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wdeclaration_after_statement" >&5 -printf "%s\n" "$ac_cv_cflags__Wdeclaration_after_statement" >&6; } -if test "x$ac_cv_cflags__Wdeclaration_after_statement" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wempty-body" >&5 -printf %s "checking whether the compiler supports -Wempty-body... " >&6; } -if test ${ac_cv_cflags__Wempty_body+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wempty-body" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wempty_body=yes -else $as_nop - ac_cv_cflags__Wempty_body=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wempty_body" >&5 -printf "%s\n" "$ac_cv_cflags__Wempty_body" >&6; } -if test "x$ac_cv_cflags__Wempty_body" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wempty-body" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wignored-qualifiers" >&5 -printf %s "checking whether the compiler supports -Wignored-qualifiers... " >&6; } -if test ${ac_cv_cflags__Wignored_qualifiers+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wignored-qualifiers" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wignored_qualifiers=yes -else $as_nop - ac_cv_cflags__Wignored_qualifiers=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wignored_qualifiers" >&5 -printf "%s\n" "$ac_cv_cflags__Wignored_qualifiers" >&6; } -if test "x$ac_cv_cflags__Wignored_qualifiers" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wignored-qualifiers" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Winit-self" >&5 -printf %s "checking whether the compiler supports -Winit-self... " >&6; } -if test ${ac_cv_cflags__Winit_self+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Winit-self" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Winit_self=yes -else $as_nop - ac_cv_cflags__Winit_self=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Winit_self" >&5 -printf "%s\n" "$ac_cv_cflags__Winit_self" >&6; } -if test "x$ac_cv_cflags__Winit_self" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Winit-self" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpacked-not-aligned" >&5 -printf %s "checking whether the compiler supports -Wpacked-not-aligned... " >&6; } -if test ${ac_cv_cflags__Wpacked_not_aligned+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpacked-not-aligned" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpacked_not_aligned=yes -else $as_nop - ac_cv_cflags__Wpacked_not_aligned=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpacked_not_aligned" >&5 -printf "%s\n" "$ac_cv_cflags__Wpacked_not_aligned" >&6; } -if test "x$ac_cv_cflags__Wpacked_not_aligned" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-packed-not-aligned" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpragma-pack" >&5 -printf %s "checking whether the compiler supports -Wpragma-pack... " >&6; } -if test ${ac_cv_cflags__Wpragma_pack+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpragma-pack" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpragma_pack=yes -else $as_nop - ac_cv_cflags__Wpragma_pack=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpragma_pack" >&5 -printf "%s\n" "$ac_cv_cflags__Wpragma_pack" >&6; } -if test "x$ac_cv_cflags__Wpragma_pack" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-pragma-pack" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wshift-overflow=2" >&5 -printf %s "checking whether the compiler supports -Wshift-overflow=2... " >&6; } -if test ${ac_cv_cflags__Wshift_overflow_2+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wshift-overflow=2" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wshift_overflow_2=yes -else $as_nop - ac_cv_cflags__Wshift_overflow_2=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wshift_overflow_2" >&5 -printf "%s\n" "$ac_cv_cflags__Wshift_overflow_2" >&6; } -if test "x$ac_cv_cflags__Wshift_overflow_2" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wshift-overflow=2" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wstrict-prototypes" >&5 -printf %s "checking whether the compiler supports -Wstrict-prototypes... " >&6; } -if test ${ac_cv_cflags__Wstrict_prototypes+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wstrict-prototypes" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wstrict_prototypes=yes -else $as_nop - ac_cv_cflags__Wstrict_prototypes=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wstrict_prototypes" >&5 -printf "%s\n" "$ac_cv_cflags__Wstrict_prototypes" >&6; } -if test "x$ac_cv_cflags__Wstrict_prototypes" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wstrict-prototypes" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wtype-limits" >&5 -printf %s "checking whether the compiler supports -Wtype-limits... " >&6; } -if test ${ac_cv_cflags__Wtype_limits+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wtype-limits" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wtype_limits=yes -else $as_nop - ac_cv_cflags__Wtype_limits=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wtype_limits" >&5 -printf "%s\n" "$ac_cv_cflags__Wtype_limits" >&6; } -if test "x$ac_cv_cflags__Wtype_limits" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wtype-limits" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wunused-but-set-parameter" >&5 -printf %s "checking whether the compiler supports -Wunused-but-set-parameter... " >&6; } -if test ${ac_cv_cflags__Wunused_but_set_parameter+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wunused-but-set-parameter" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wunused_but_set_parameter=yes -else $as_nop - ac_cv_cflags__Wunused_but_set_parameter=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wunused_but_set_parameter" >&5 -printf "%s\n" "$ac_cv_cflags__Wunused_but_set_parameter" >&6; } -if test "x$ac_cv_cflags__Wunused_but_set_parameter" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wunused-but-set-parameter" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wvla" >&5 -printf %s "checking whether the compiler supports -Wvla... " >&6; } -if test ${ac_cv_cflags__Wvla+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wvla" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wvla=yes -else $as_nop - ac_cv_cflags__Wvla=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wvla" >&5 -printf "%s\n" "$ac_cv_cflags__Wvla" >&6; } -if test "x$ac_cv_cflags__Wvla" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wvla" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wwrite-strings" >&5 -printf %s "checking whether the compiler supports -Wwrite-strings... " >&6; } -if test ${ac_cv_cflags__Wwrite_strings+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wwrite-strings" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wwrite_strings=yes -else $as_nop - ac_cv_cflags__Wwrite_strings=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wwrite_strings" >&5 -printf "%s\n" "$ac_cv_cflags__Wwrite_strings" >&6; } -if test "x$ac_cv_cflags__Wwrite_strings" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings" -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpointer-arith" >&5 -printf %s "checking whether the compiler supports -Wpointer-arith... " >&6; } -if test ${ac_cv_cflags__Wpointer_arith+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpointer-arith" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpointer_arith=yes -else $as_nop - ac_cv_cflags__Wpointer_arith=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpointer_arith" >&5 -printf "%s\n" "$ac_cv_cflags__Wpointer_arith" >&6; } -if test "x$ac_cv_cflags__Wpointer_arith" = xyes -then : - saved_string_h_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Wpointer-arith -Werror" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken string.h that generates warnings with -Wpointer-arith" >&5 -printf %s "checking for broken string.h that generates warnings with -Wpointer-arith... " >&6; } -if test ${ac_cv_c_string_h_warnings+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_string_h_warnings=no -else $as_nop - ac_cv_c_string_h_warnings=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_string_h_warnings" >&5 -printf "%s\n" "$ac_cv_c_string_h_warnings" >&6; } - test "$ac_cv_c_string_h_warnings" = yes || EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith" - CFLAGS=$saved_string_h_CFLAGS -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wlogical-op" >&5 -printf %s "checking whether the compiler supports -Wlogical-op... " >&6; } -if test ${ac_cv_cflags__Wlogical_op+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wlogical-op" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wlogical_op=yes -else $as_nop - ac_cv_cflags__Wlogical_op=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wlogical_op" >&5 -printf "%s\n" "$ac_cv_cflags__Wlogical_op" >&6; } -if test "x$ac_cv_cflags__Wlogical_op" = xyes -then : - saved_string_h_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Wlogical-op -Werror" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken string.h that generates warnings with -Wlogical-op" >&5 -printf %s "checking for broken string.h that generates warnings with -Wlogical-op... " >&6; } -if test ${ac_cv_c_logicalop_noisy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -char*f(const char *h,char n) {return strchr(h,n);} -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_logicalop_noisy=no -else $as_nop - ac_cv_c_logicalop_noisy=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_logicalop_noisy" >&5 -printf "%s\n" "$ac_cv_c_logicalop_noisy" >&6; } - CFLAGS=$saved_string_h_CFLAGS - test "$ac_cv_c_logicalop_noisy" = yes || EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op" -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flags needed for 64-bit compare-and-swap support" >&5 -printf %s "checking for flags needed for 64-bit compare-and-swap support... " >&6; } -if test ${wine_cv_64bit_compare_swap+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - wine_cv_64bit_compare_swap="none needed" -else $as_nop - case $HOST_ARCH in - i386) wine_cv_64bit_compare_swap="-march=i586" ;; - arm) wine_cv_64bit_compare_swap="-march=armv7-a" ;; - *) wine_cv_64bit_compare_swap="unknown" ;; - esac - if test "x$wine_cv_64bit_compare_swap" != xunknown - then - CFLAGS="$CFLAGS $wine_cv_64bit_compare_swap" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - wine_cv_64bit_compare_swap="unknown" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$saved_CFLAGS - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_64bit_compare_swap" >&5 -printf "%s\n" "$wine_cv_64bit_compare_swap" >&6; } - case "$wine_cv_64bit_compare_swap" in - unknown) as_fn_error $? "gcc doesn't support 64-bit compare-and-swap on this platform" "$LINENO" 5 ;; - "none needed") ;; - *) EXTRACFLAGS="$EXTRACFLAGS $wine_cv_64bit_compare_swap" ;; - esac - - ac_debug_format_seen="" - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*) ac_debug_format_seen=yes ;; - -g) ac_debug_format_seen=${ac_debug_format_seen:-default} ;; - esac - done - if test "x$ac_debug_format_seen" = xdefault - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -gdwarf-4" >&5 -printf %s "checking whether the compiler supports -gdwarf-4... " >&6; } -if test ${ac_cv_cflags__gdwarf_4+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -gdwarf-4" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__gdwarf_4=yes -else $as_nop - ac_cv_cflags__gdwarf_4=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__gdwarf_4" >&5 -printf "%s\n" "$ac_cv_cflags__gdwarf_4" >&6; } -if test "x$ac_cv_cflags__gdwarf_4" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -gdwarf-4" -fi - fi - - MSVCRTFLAGS="" - - case $host_os in - mingw32*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-delayload,autoconftest.dll" >&5 -printf %s "checking whether the compiler supports -Wl,-delayload,autoconftest.dll... " >&6; } -if test ${ac_cv_cflags__Wl__delayload_autoconftest_dll+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-delayload,autoconftest.dll" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__delayload_autoconftest_dll=yes -else $as_nop - ac_cv_cflags__Wl__delayload_autoconftest_dll=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__delayload_autoconftest_dll" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__delayload_autoconftest_dll" >&6; } -if test "x$ac_cv_cflags__Wl__delayload_autoconftest_dll" = xyes -then : - DELAYLOADFLAG="-Wl,-delayload," - -fi ;; - *) MSVCRTFLAGS="-D_WIN32" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5 -printf %s "checking whether the compiler supports -fno-builtin... " >&6; } -if test ${ac_cv_cflags__fno_builtin+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-builtin" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_builtin=yes -else $as_nop - ac_cv_cflags__fno_builtin=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_builtin" >&5 -printf "%s\n" "$ac_cv_cflags__fno_builtin" >&6; } -if test "x$ac_cv_cflags__fno_builtin" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fno-builtin" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fshort-wchar" >&5 -printf %s "checking whether the compiler supports -fshort-wchar... " >&6; } -if test ${ac_cv_cflags__fshort_wchar+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fshort-wchar" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fshort_wchar=yes -else $as_nop - ac_cv_cflags__fshort_wchar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fshort_wchar" >&5 -printf "%s\n" "$ac_cv_cflags__fshort_wchar" >&6; } -if test "x$ac_cv_cflags__fshort_wchar" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 -printf %s "checking whether the compiler supports -Wno-format... " >&6; } -if test ${ac_cv_cflags__Wno_format+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wno-format" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wno_format=yes -else $as_nop - ac_cv_cflags__Wno_format=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wno_format" >&5 -printf "%s\n" "$ac_cv_cflags__Wno_format" >&6; } -if test "x$ac_cv_cflags__Wno_format" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -Wno-format" -fi ;; - esac - - case $HOST_ARCH in - i386) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-omit-frame-pointer" >&5 -printf %s "checking whether the compiler supports -fno-omit-frame-pointer... " >&6; } -if test ${ac_cv_cflags__fno_omit_frame_pointer+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-omit-frame-pointer" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_omit_frame_pointer=yes -else $as_nop - ac_cv_cflags__fno_omit_frame_pointer=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_omit_frame_pointer" >&5 -printf "%s\n" "$ac_cv_cflags__fno_omit_frame_pointer" >&6; } -if test "x$ac_cv_cflags__fno_omit_frame_pointer" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fno-omit-frame-pointer" -fi ;; - x86_64) - case $host_os in - cygwin*|mingw32*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 -printf %s "checking whether the compiler supports -Wno-format... " >&6; } -if test ${ac_cv_cflags__Wno_format+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wno-format" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wno_format=yes -else $as_nop - ac_cv_cflags__Wno_format=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wno_format" >&5 -printf "%s\n" "$ac_cv_cflags__Wno_format" >&6; } -if test "x$ac_cv_cflags__Wno_format" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-format" -fi ;; - *) if test -z "$PE_ARCHS" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -mabi=ms" >&5 -printf %s "checking for working -mabi=ms... " >&6; } -if test ${ac_cv_mabi_ms+y} -then : - printf %s "(cached) " >&6 -else $as_nop - CFLAGS="$CFLAGS -mabi=ms" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); } -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mabi_ms=yes -else $as_nop - ac_cv_mabi_ms=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$saved_CFLAGS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mabi_ms" >&5 -printf "%s\n" "$ac_cv_mabi_ms" >&6; } - test $ac_cv_mabi_ms = yes || as_fn_error $? "The compiler doesn't support -mabi=ms. Use gcc instead of clang, or install mingw-w64." "$LINENO" 5 - fi - MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;; - esac ;; - arm) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wincompatible-function-pointer-types" >&5 -printf %s "checking whether the compiler supports -Wincompatible-function-pointer-types... " >&6; } -if test ${ac_cv_cflags__Wincompatible_function_pointer_types+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wincompatible-function-pointer-types" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wincompatible_function_pointer_types=yes -else $as_nop - ac_cv_cflags__Wincompatible_function_pointer_types=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wincompatible_function_pointer_types" >&5 -printf "%s\n" "$ac_cv_cflags__Wincompatible_function_pointer_types" >&6; } -if test "x$ac_cv_cflags__Wincompatible_function_pointer_types" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-error=incompatible-function-pointer-types" -fi ;; - esac - - CFLAGS=$saved_CFLAGS - - if test "x$enable_werror" = "xyes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror" >&5 -printf %s "checking whether the compiler supports -Werror... " >&6; } -if test ${ac_cv_cflags__Werror+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror=yes -else $as_nop - ac_cv_cflags__Werror=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror" >&5 -printf "%s\n" "$ac_cv_cflags__Werror" >&6; } -if test "x$ac_cv_cflags__Werror" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Werror" -fi - fi - if test "x$enable_build_id" = "xyes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--build-id" >&5 -printf %s "checking whether the compiler supports -Wl,--build-id... " >&6; } -if test ${ac_cv_cflags__Wl___build_id+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--build-id" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___build_id=yes -else $as_nop - ac_cv_cflags__Wl___build_id=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___build_id" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___build_id" >&6; } -if test "x$ac_cv_cflags__Wl___build_id" = xyes -then : - CFLAGS="$CFLAGS -Wl,--build-id" - LDFLAGS="$LDFLAGS -Wl,--build-id" -fi - fi -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the need to disable Fortify" >&5 -printf %s "checking for the need to disable Fortify... " >&6; } -if test ${ac_cv_c_fortify_enabled+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -#if (defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0) || (defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0) -#error Fortify enabled -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_fortify_enabled=no -else $as_nop - ac_cv_c_fortify_enabled=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fortify_enabled" >&5 -printf "%s\n" "$ac_cv_c_fortify_enabled" >&6; } -if test "$ac_cv_c_fortify_enabled" = yes -then - CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether CFI directives are supported in assembly code" >&5 -printf %s "checking whether CFI directives are supported in assembly code... " >&6; } -if test ${ac_cv_c_cfi_support+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc"); -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_cfi_support="yes" -else $as_nop - ac_cv_c_cfi_support="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cfi_support" >&5 -printf "%s\n" "$ac_cv_c_cfi_support" >&6; } -if test "$ac_cv_c_cfi_support" = "yes" -then - DLLFLAGS="$DLLFLAGS -fasynchronous-unwind-tables" - LDDLLFLAGS="$LDDLLFLAGS -fasynchronous-unwind-tables" - UNIXDLLFLAGS="$UNIXDLLFLAGS -fasynchronous-unwind-tables" -elif test $HOST_ARCH = x86_64 -then - as_fn_append wine_warnings "|building 64-bit Wine without support for CFI directives; exception handling will not work properly." -fi - - -case "$HOST_ARCH,$PE_ARCHS" in - x86_64,*i386*) wine_binary="wine" ;; - x86_64,*) wine_binary="wine64" ;; - *) wine_binary="wine" ;; -esac -WINELOADER_PROGRAMS="$wine_binary" - - -case $host_os in - linux*) - if test $HOST_ARCH != unknown - then - test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine-preloader" - WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" - fi - ;; - darwin*|macosx*) - if test "$wine_can_build_preloader" = "yes" - then - test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine-preloader" - WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" - fi - ;; -esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -printf %s "checking for library containing dlopen... " >&6; } -if test ${ac_cv_search_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_dlopen+y} -then : - break -fi -done -if test ${ac_cv_search_dlopen+y} -then : - -else $as_nop - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -printf "%s\n" "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 -printf %s "checking for library containing gethostbyname... " >&6; } -if test ${ac_cv_search_gethostbyname+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_gethostbyname=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_gethostbyname+y} -then : - break -fi -done -if test ${ac_cv_search_gethostbyname+y} -then : - -else $as_nop - ac_cv_search_gethostbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 -printf "%s\n" "$ac_cv_search_gethostbyname" >&6; } -ac_res=$ac_cv_search_gethostbyname -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5 -printf %s "checking for library containing connect... " >&6; } -if test ${ac_cv_search_connect+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char connect (); -int -main (void) -{ -return connect (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_connect=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_connect+y} -then : - break -fi -done -if test ${ac_cv_search_connect+y} -then : - -else $as_nop - ac_cv_search_connect=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5 -printf "%s\n" "$ac_cv_search_connect" >&6; } -ac_res=$ac_cv_search_connect -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5 -printf %s "checking for library containing inet_aton... " >&6; } -if test ${ac_cv_search_inet_aton+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char inet_aton (); -int -main (void) -{ -return inet_aton (); - ; - return 0; -} -_ACEOF -for ac_lib in '' resolv -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_inet_aton=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_inet_aton+y} -then : - break -fi -done -if test ${ac_cv_search_inet_aton+y} -then : - -else $as_nop - ac_cv_search_inet_aton=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5 -printf "%s\n" "$ac_cv_search_inet_aton" >&6; } -ac_res=$ac_cv_search_inet_aton -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -ac_save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $BUILTINFLAG" -ac_fn_c_check_func "$LINENO" "dladdr1" "ac_cv_func_dladdr1" -if test "x$ac_cv_func_dladdr1" = xyes -then : - printf "%s\n" "#define HAVE_DLADDR1 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "dlinfo" "ac_cv_func_dlinfo" -if test "x$ac_cv_func_dlinfo" = xyes -then : - printf "%s\n" "#define HAVE_DLINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "epoll_create" "ac_cv_func_epoll_create" -if test "x$ac_cv_func_epoll_create" = xyes -then : - printf "%s\n" "#define HAVE_EPOLL_CREATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs" -if test "x$ac_cv_func_fstatfs" = xyes -then : - printf "%s\n" "#define HAVE_FSTATFS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" -if test "x$ac_cv_func_futimens" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimes" "ac_cv_func_futimes" -if test "x$ac_cv_func_futimes" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimesat" "ac_cv_func_futimesat" -if test "x$ac_cv_func_futimesat" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMESAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes -then : - printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" -if test "x$ac_cv_func_getattrlist" = xyes -then : - printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" -if test "x$ac_cv_func_getauxval" = xyes -then : - printf "%s\n" "#define HAVE_GETAUXVAL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes -then : - printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" -if test "x$ac_cv_func_getrandom" = xyes -then : - printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" -if test "x$ac_cv_func_kqueue" = xyes -then : - printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mach_continuous_time" "ac_cv_func_mach_continuous_time" -if test "x$ac_cv_func_mach_continuous_time" = xyes -then : - printf "%s\n" "#define HAVE_MACH_CONTINUOUS_TIME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" -if test "x$ac_cv_func_pipe2" = xyes -then : - printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create" -if test "x$ac_cv_func_port_create" = xyes -then : - printf "%s\n" "#define HAVE_PORT_CREATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" -if test "x$ac_cv_func_posix_fadvise" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" -if test "x$ac_cv_func_posix_fallocate" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "prctl" "ac_cv_func_prctl" -if test "x$ac_cv_func_prctl" = xyes -then : - printf "%s\n" "#define HAVE_PRCTL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "proc_pidinfo" "ac_cv_func_proc_pidinfo" -if test "x$ac_cv_func_proc_pidinfo" = xyes -then : - printf "%s\n" "#define HAVE_PROC_PIDINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" -if test "x$ac_cv_func_sched_yield" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" -if test "x$ac_cv_func_setproctitle" = xyes -then : - printf "%s\n" "#define HAVE_SETPROCTITLE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setprogname" "ac_cv_func_setprogname" -if test "x$ac_cv_func_setprogname" = xyes -then : - printf "%s\n" "#define HAVE_SETPROGNAME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" -if test "x$ac_cv_func_sigprocmask" = xyes -then : - printf "%s\n" "#define HAVE_SIGPROCMASK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sysinfo" "ac_cv_func_sysinfo" -if test "x$ac_cv_func_sysinfo" = xyes -then : - printf "%s\n" "#define HAVE_SYSINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain" -if test "x$ac_cv_func_tcdrain" = xyes -then : - printf "%s\n" "#define HAVE_TCDRAIN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "thr_kill2" "ac_cv_func_thr_kill2" -if test "x$ac_cv_func_thr_kill2" = xyes -then : - printf "%s\n" "#define HAVE_THR_KILL2 1" >>confdefs.h - -fi - -CFLAGS="$ac_save_CFLAGS" - -case $host_os in - darwin*|macosx*) ;; - *) ac_save_LIBS=$LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -printf %s "checking for library containing clock_gettime... " >&6; } -if test ${ac_cv_search_clock_gettime+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char clock_gettime (); -int -main (void) -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_clock_gettime+y} -then : - break -fi -done -if test ${ac_cv_search_clock_gettime+y} -then : - -else $as_nop - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - - test "$ac_res" = "none required" || RT_LIBS="$ac_res" - -fi - - LIBS=$ac_save_LIBS - ;; -esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5 -printf %s "checking for sched_setaffinity... " >&6; } -if test ${wine_cv_have_sched_setaffinity+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -sched_setaffinity(0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_sched_setaffinity=yes -else $as_nop - wine_cv_have_sched_setaffinity=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_sched_setaffinity" >&5 -printf "%s\n" "$wine_cv_have_sched_setaffinity" >&6; } -if test "$wine_cv_have_sched_setaffinity" = "yes" -then - -printf "%s\n" "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -printf %s "checking for inline... " >&6; } -if test ${ac_cv_c_inline+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo (void) {return 0; } -$ac_kw foo_t foo (void) {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -printf "%s\n" "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_check_type "$LINENO" "request_sense" "ac_cv_type_request_sense" "#include -" -if test "x$ac_cv_type_request_sense" = xyes -then : - -printf "%s\n" "#define HAVE_REQUEST_SENSE 1" >>confdefs.h - - -fi - - -ac_fn_c_check_type "$LINENO" "struct xinpgen" "ac_cv_type_struct_xinpgen" "#include -#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NET_ROUTE_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_IN_PCB_H -#include -#endif -" -if test "x$ac_cv_type_struct_xinpgen" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_XINPGEN 1" >>confdefs.h - - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use re-entrant gethostbyname_r Linux style" >&5 -printf %s "checking whether we can use re-entrant gethostbyname_r Linux style... " >&6; } -if test ${wine_cv_linux_gethostbyname_r_6+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - char *name=0; - struct hostent he; - struct hostent *result; - char *buf=0; - int bufsize=0; - int errnr; - char *addr=0; - int addrlen=0; - int addrtype=0; - gethostbyname_r(name,&he,buf,bufsize,&result,&errnr); - gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_linux_gethostbyname_r_6=yes -else $as_nop - wine_cv_linux_gethostbyname_r_6=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_linux_gethostbyname_r_6" >&5 -printf "%s\n" "$wine_cv_linux_gethostbyname_r_6" >&6; } - if test "$wine_cv_linux_gethostbyname_r_6" = "yes" - then - -printf "%s\n" "#define HAVE_LINUX_GETHOSTBYNAME_R_6 1" >>confdefs.h - - fi - -ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_accrights" "ac_cv_member_struct_msghdr_msg_accrights" "#include -#include -#ifdef HAVE_SYS_UN_H -# include -#endif -" -if test "x$ac_cv_member_struct_msghdr_msg_accrights" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" "#include -#include -#ifdef HAVE_SYS_UN_H -# include -#endif -" -if test "x$ac_cv_member_struct_sockaddr_un_sun_len" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "scsireq_t" "cmd" "ac_cv_member_scsireq_t_cmd" "#include -#ifdef HAVE_SCSI_SG_H -#include -#endif -" -if test "x$ac_cv_member_scsireq_t_cmd" = xyes -then : - -printf "%s\n" "#define HAVE_SCSIREQ_T_CMD 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "sg_io_hdr_t" "interface_id" "ac_cv_member_sg_io_hdr_t_interface_id" "#include -#ifdef HAVE_SCSI_SG_H -#include -#endif -" -if test "x$ac_cv_member_sg_io_hdr_t_interface_id" = xyes -then : - -printf "%s\n" "#define HAVE_SG_IO_HDR_T_INTERFACE_ID 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_fd" "ac_cv_member_siginfo_t_si_fd" "#include -" -if test "x$ac_cv_member_siginfo_t_si_fd" = xyes -then : - -printf "%s\n" "#define HAVE_SIGINFO_T_SI_FD 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_blksiz" "ac_cv_member_struct_mtget_mt_blksiz" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_blksiz" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_BLKSIZ 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_gstat" "ac_cv_member_struct_mtget_mt_gstat" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_gstat" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_GSTAT 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_blkno" "ac_cv_member_struct_mtget_mt_blkno" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_blkno" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_BLKNO 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim" "ac_cv_member_struct_stat_st_ctim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_CTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimespec" "ac_cv_member_struct_stat_st_ctimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec" "ac_cv_member_struct_stat_st_atimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim" "ac_cv_member_struct_stat_st_birthtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec" "ac_cv_member_struct_stat_st_birthtimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "__st_birthtime" "ac_cv_member_struct_stat___st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat___st_birthtime" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT___ST_BIRTHTIME 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "__st_birthtim" "ac_cv_member_struct_stat___st_birthtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat___st_birthtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT___ST_BIRTHTIM 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "#include -#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct __res_state" "_u._ext.nscount6" "ac_cv_member_struct___res_state__u__ext_nscount6" "#ifdef HAVE_RESOLV_H -#include -#endif -" -if test "x$ac_cv_member_struct___res_state__u__ext_nscount6" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT___RES_STATE__U__EXT_NSCOUNT6 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct in6_pktinfo" "ipi6_addr" "ac_cv_member_struct_in6_pktinfo_ipi6_addr" "#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_member_struct_in6_pktinfo_ipi6_addr" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_total" "ac_cv_member_struct_ipstat_ips_total" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ipstat_ips_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IPSTAT_IPS_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ip_stats" "ips_total" "ac_cv_member_struct_ip_stats_ips_total" "#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ip_stats_ips_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IP_STATS_IPS_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ip6stat" "ip6s_total" "ac_cv_member_struct_ip6stat_ip6s_total" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET6_IP6_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ip6stat_ip6s_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IP6STAT_IP6S_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_error" "ac_cv_member_struct_icmpstat_icps_error" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_IP_ICMP_H -#include -#endif -#ifdef HAVE_NETINET_ICMP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_icmpstat_icps_error" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_ICMPSTAT_ICPS_ERROR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct icmp6stat" "icp6s_error" "ac_cv_member_struct_icmp6stat_icp6s_error" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_ICMP6_H -#include -#endif -" -if test "x$ac_cv_member_struct_icmp6stat_icp6s_error" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcps_connattempt" "ac_cv_member_struct_tcpstat_tcps_connattempt" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_tcpstat_tcps_connattempt" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct tcp_stats" "tcps_connattempt" "ac_cv_member_struct_tcp_stats_tcps_connattempt" "#ifdef HAVE_NETINET_TCP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_tcp_stats_tcps_connattempt" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_TCP_STATS_TCPS_CONNATTEMPT 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_ipackets" "ac_cv_member_struct_udpstat_udps_ipackets" "#include -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -#ifdef HAVE_NETINET_UDP_H -#include -#endif -#ifdef HAVE_NETINET_UDP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_udpstat_udps_ipackets" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_hwaddr" "ac_cv_member_struct_ifreq_ifr_hwaddr" "#include -#ifdef HAVE_NET_IF_H -# include -#endif -" -if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IFREQ_IFR_HWADDR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct sysinfo" "totalram" "ac_cv_member_struct_sysinfo_totalram" "#ifdef HAVE_SYS_SYSINFO_H -# include -#endif -" -if test "x$ac_cv_member_struct_sysinfo_totalram" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SYSINFO_TOTALRAM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct sysinfo" "mem_unit" "ac_cv_member_struct_sysinfo_mem_unit" "#ifdef HAVE_SYS_SYSINFO_H -# include -#endif -" -if test "x$ac_cv_member_struct_sysinfo_mem_unit" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SYSINFO_MEM_UNIT 1" >>confdefs.h - - -fi - - -LIBS="$ac_save_LIBS" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 -printf %s "checking for __builtin_popcount... " >&6; } -if test ${ac_cv_have___builtin_popcount+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -return __builtin_popcount(1) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have___builtin_popcount="yes" -else $as_nop - ac_cv_have___builtin_popcount="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___builtin_popcount" >&5 -printf "%s\n" "$ac_cv_have___builtin_popcount" >&6; } -if test "$ac_cv_have___builtin_popcount" = "yes" -then - -printf "%s\n" "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __clear_cache" >&5 -printf %s "checking for __clear_cache... " >&6; } -if test ${ac_cv_have___clear_cache+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -__clear_cache((void*)0, (void*)0); return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have___clear_cache="yes" -else $as_nop - ac_cv_have___clear_cache="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___clear_cache" >&5 -printf "%s\n" "$ac_cv_have___clear_cache" >&6; } -if test "$ac_cv_have___clear_cache" = "yes" -then - -printf "%s\n" "#define HAVE___CLEAR_CACHE 1" >>confdefs.h - -fi - - -case $host_cpu in - *i[3456789]86*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __i386__" >&5 -printf %s "checking whether we need to define __i386__... " >&6; } -if test ${ac_cv_cpp_def___i386__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __i386__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___i386__=yes -else $as_nop - ac_cv_cpp_def___i386__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___i386__" >&5 -printf "%s\n" "$ac_cv_cpp_def___i386__" >&6; } -if test "x$ac_cv_cpp_def___i386__" = xyes -then : - CFLAGS="$CFLAGS -D__i386__" - LINTFLAGS="$LINTFLAGS -D__i386__" -fi ;; - *x86_64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __x86_64__" >&5 -printf %s "checking whether we need to define __x86_64__... " >&6; } -if test ${ac_cv_cpp_def___x86_64__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __x86_64__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___x86_64__=yes -else $as_nop - ac_cv_cpp_def___x86_64__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___x86_64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___x86_64__" >&6; } -if test "x$ac_cv_cpp_def___x86_64__" = xyes -then : - CFLAGS="$CFLAGS -D__x86_64__" - LINTFLAGS="$LINTFLAGS -D__x86_64__" -fi ;; - *sparc64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __sparc64__" >&5 -printf %s "checking whether we need to define __sparc64__... " >&6; } -if test ${ac_cv_cpp_def___sparc64__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __sparc64__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___sparc64__=yes -else $as_nop - ac_cv_cpp_def___sparc64__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___sparc64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___sparc64__" >&6; } -if test "x$ac_cv_cpp_def___sparc64__" = xyes -then : - CFLAGS="$CFLAGS -D__sparc64__" - LINTFLAGS="$LINTFLAGS -D__sparc64__" -fi ;; - *sparc*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __sparc__" >&5 -printf %s "checking whether we need to define __sparc__... " >&6; } -if test ${ac_cv_cpp_def___sparc__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __sparc__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___sparc__=yes -else $as_nop - ac_cv_cpp_def___sparc__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___sparc__" >&5 -printf "%s\n" "$ac_cv_cpp_def___sparc__" >&6; } -if test "x$ac_cv_cpp_def___sparc__" = xyes -then : - CFLAGS="$CFLAGS -D__sparc__" - LINTFLAGS="$LINTFLAGS -D__sparc__" -fi ;; - *powerpc64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __powerpc64__" >&5 -printf %s "checking whether we need to define __powerpc64__... " >&6; } -if test ${ac_cv_cpp_def___powerpc64__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __powerpc64__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___powerpc64__=yes -else $as_nop - ac_cv_cpp_def___powerpc64__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___powerpc64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___powerpc64__" >&6; } -if test "x$ac_cv_cpp_def___powerpc64__" = xyes -then : - CFLAGS="$CFLAGS -D__powerpc64__" - LINTFLAGS="$LINTFLAGS -D__powerpc64__" -fi ;; - *powerpc*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __powerpc__" >&5 -printf %s "checking whether we need to define __powerpc__... " >&6; } -if test ${ac_cv_cpp_def___powerpc__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __powerpc__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___powerpc__=yes -else $as_nop - ac_cv_cpp_def___powerpc__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___powerpc__" >&5 -printf "%s\n" "$ac_cv_cpp_def___powerpc__" >&6; } -if test "x$ac_cv_cpp_def___powerpc__" = xyes -then : - CFLAGS="$CFLAGS -D__powerpc__" - LINTFLAGS="$LINTFLAGS -D__powerpc__" -fi ;; - *aarch64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __aarch64__" >&5 -printf %s "checking whether we need to define __aarch64__... " >&6; } -if test ${ac_cv_cpp_def___aarch64__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __aarch64__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___aarch64__=yes -else $as_nop - ac_cv_cpp_def___aarch64__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___aarch64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___aarch64__" >&6; } -if test "x$ac_cv_cpp_def___aarch64__" = xyes -then : - CFLAGS="$CFLAGS -D__aarch64__" - LINTFLAGS="$LINTFLAGS -D__aarch64__" -fi ;; - *arm*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __arm__" >&5 -printf %s "checking whether we need to define __arm__... " >&6; } -if test ${ac_cv_cpp_def___arm__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __arm__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___arm__=yes -else $as_nop - ac_cv_cpp_def___arm__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___arm__" >&5 -printf "%s\n" "$ac_cv_cpp_def___arm__" >&6; } -if test "x$ac_cv_cpp_def___arm__" = xyes -then : - CFLAGS="$CFLAGS -D__arm__" - LINTFLAGS="$LINTFLAGS -D__arm__" -fi ;; -esac - -case $host_vendor in - *sun*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __sun__" >&5 -printf %s "checking whether we need to define __sun__... " >&6; } -if test ${ac_cv_cpp_def___sun__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __sun__ -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : - ac_cv_cpp_def___sun__=yes -else $as_nop - ac_cv_cpp_def___sun__=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___sun__" >&5 -printf "%s\n" "$ac_cv_cpp_def___sun__" >&6; } -if test "x$ac_cv_cpp_def___sun__" = xyes -then : - CFLAGS="$CFLAGS -D__sun__" - LINTFLAGS="$LINTFLAGS -D__sun__" -fi ;; -esac - - - - - -ac_config_commands="$ac_config_commands include/stamp-h" - -printf %s "creating Makefile rules..." >&6 - -makedep_flags="" -test "x$enable_silent_rules" = xyes && makedep_flags="$makedep_flags -S" - -wine_srcdir= -test "$srcdir" = . || wine_srcdir="$srcdir/" - -ac_config_links="$ac_config_links wine:tools/winewrapper" -wine_fn_config_symlink wine -if test "$wine_binary" = wine64 -o -n "$with_wine64"; then -ac_config_links="$ac_config_links wine64:tools/winewrapper" -wine_fn_config_symlink wine64 -fi - -wine_fn_config_makefile dlls/acledit enable_acledit -wine_fn_config_makefile dlls/aclui enable_aclui -wine_fn_config_makefile dlls/activeds.tlb enable_activeds_tlb -wine_fn_config_makefile dlls/activeds enable_activeds -wine_fn_config_makefile dlls/activeds/tests enable_tests -wine_fn_config_makefile dlls/actxprxy enable_actxprxy -wine_fn_config_makefile dlls/adsldp enable_adsldp -wine_fn_config_makefile dlls/adsldp/tests enable_tests -wine_fn_config_makefile dlls/adsldpc enable_adsldpc -wine_fn_config_makefile dlls/advapi32 enable_advapi32 -wine_fn_config_makefile dlls/advapi32/tests enable_tests -wine_fn_config_makefile dlls/advpack enable_advpack -wine_fn_config_makefile dlls/advpack/tests enable_tests -wine_fn_config_makefile dlls/amsi enable_amsi -wine_fn_config_makefile dlls/amstream enable_amstream -wine_fn_config_makefile dlls/amstream/tests enable_tests -wine_fn_config_makefile dlls/apisetschema enable_apisetschema -wine_fn_config_makefile dlls/apphelp enable_apphelp -wine_fn_config_makefile dlls/apphelp/tests enable_tests -wine_fn_config_makefile dlls/appwiz.cpl enable_appwiz_cpl -wine_fn_config_makefile dlls/appxdeploymentclient enable_appxdeploymentclient -wine_fn_config_makefile dlls/atl enable_atl -wine_fn_config_makefile dlls/atl/tests enable_tests -wine_fn_config_makefile dlls/atl100 enable_atl100 -wine_fn_config_makefile dlls/atl100/tests enable_tests -wine_fn_config_makefile dlls/atl110 enable_atl110 -wine_fn_config_makefile dlls/atl110/tests enable_tests -wine_fn_config_makefile dlls/atl80 enable_atl80 -wine_fn_config_makefile dlls/atl80/tests enable_tests -wine_fn_config_makefile dlls/atl90 enable_atl90 -wine_fn_config_makefile dlls/atlthunk enable_atlthunk -wine_fn_config_makefile dlls/atlthunk/tests enable_tests -wine_fn_config_makefile dlls/atmlib enable_atmlib -wine_fn_config_makefile dlls/authz enable_authz -wine_fn_config_makefile dlls/avicap32 enable_avicap32 -wine_fn_config_makefile dlls/avifil32 enable_avifil32 -wine_fn_config_makefile dlls/avifil32/tests enable_tests -wine_fn_config_makefile dlls/avifile.dll16 enable_win16 -wine_fn_config_makefile dlls/avrt enable_avrt -wine_fn_config_makefile dlls/bcrypt enable_bcrypt -wine_fn_config_makefile dlls/bcrypt/tests enable_tests -wine_fn_config_makefile dlls/bcryptprimitives enable_bcryptprimitives -wine_fn_config_makefile dlls/bluetoothapis enable_bluetoothapis -wine_fn_config_makefile dlls/browseui enable_browseui -wine_fn_config_makefile dlls/browseui/tests enable_tests -wine_fn_config_makefile dlls/bthprops.cpl enable_bthprops_cpl -wine_fn_config_makefile dlls/cabinet enable_cabinet -wine_fn_config_makefile dlls/cabinet/tests enable_tests -wine_fn_config_makefile dlls/capi2032 enable_capi2032 -wine_fn_config_makefile dlls/cards enable_cards -wine_fn_config_makefile dlls/cdosys enable_cdosys -wine_fn_config_makefile dlls/cfgmgr32 enable_cfgmgr32 -wine_fn_config_makefile dlls/cfgmgr32/tests enable_tests -wine_fn_config_makefile dlls/clusapi enable_clusapi -wine_fn_config_makefile dlls/cng.sys enable_cng_sys -wine_fn_config_makefile dlls/combase enable_combase -wine_fn_config_makefile dlls/combase/tests enable_tests -wine_fn_config_makefile dlls/comcat enable_comcat -wine_fn_config_makefile dlls/comcat/tests enable_tests -wine_fn_config_makefile dlls/comctl32 enable_comctl32 -wine_fn_config_makefile dlls/comctl32/tests enable_tests -wine_fn_config_makefile dlls/comdlg32 enable_comdlg32 -wine_fn_config_makefile dlls/comdlg32/tests enable_tests -wine_fn_config_makefile dlls/coml2 enable_coml2 -wine_fn_config_makefile dlls/comm.drv16 enable_win16 -wine_fn_config_makefile dlls/commdlg.dll16 enable_win16 -wine_fn_config_makefile dlls/compobj.dll16 enable_win16 -wine_fn_config_makefile dlls/compstui enable_compstui -wine_fn_config_makefile dlls/compstui/tests enable_tests -wine_fn_config_makefile dlls/comsvcs enable_comsvcs -wine_fn_config_makefile dlls/comsvcs/tests enable_tests -wine_fn_config_makefile dlls/concrt140 enable_concrt140 -wine_fn_config_makefile dlls/concrt140/tests enable_tests -wine_fn_config_makefile dlls/connect enable_connect -wine_fn_config_makefile dlls/credui enable_credui -wine_fn_config_makefile dlls/credui/tests enable_tests -wine_fn_config_makefile dlls/crtdll enable_crtdll -wine_fn_config_makefile dlls/crypt32 enable_crypt32 -wine_fn_config_makefile dlls/crypt32/tests enable_tests -wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg -wine_fn_config_makefile dlls/cryptdll enable_cryptdll -wine_fn_config_makefile dlls/cryptext enable_cryptext -wine_fn_config_makefile dlls/cryptnet enable_cryptnet -wine_fn_config_makefile dlls/cryptnet/tests enable_tests -wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt -wine_fn_config_makefile dlls/cryptowinrt/tests enable_tests -wine_fn_config_makefile dlls/cryptsp enable_cryptsp -wine_fn_config_makefile dlls/cryptui enable_cryptui -wine_fn_config_makefile dlls/cryptui/tests enable_tests -wine_fn_config_makefile dlls/ctapi32 enable_ctapi32 -wine_fn_config_makefile dlls/ctl3d.dll16 enable_win16 -wine_fn_config_makefile dlls/ctl3d32 enable_ctl3d32 -wine_fn_config_makefile dlls/ctl3dv2.dll16 enable_win16 -wine_fn_config_makefile dlls/d2d1 enable_d2d1 -wine_fn_config_makefile dlls/d2d1/tests enable_tests -wine_fn_config_makefile dlls/d3d10 enable_d3d10 -wine_fn_config_makefile dlls/d3d10/tests enable_tests -wine_fn_config_makefile dlls/d3d10_1 enable_d3d10_1 -wine_fn_config_makefile dlls/d3d10_1/tests enable_tests -wine_fn_config_makefile dlls/d3d10core enable_d3d10core -wine_fn_config_makefile dlls/d3d10core/tests enable_tests -wine_fn_config_makefile dlls/d3d11 enable_d3d11 -wine_fn_config_makefile dlls/d3d11/tests enable_tests -wine_fn_config_makefile dlls/d3d12 enable_d3d12 -wine_fn_config_makefile dlls/d3d12/tests enable_tests -wine_fn_config_makefile dlls/d3d12core enable_d3d12core -wine_fn_config_makefile dlls/d3d8 enable_d3d8 -wine_fn_config_makefile dlls/d3d8/tests enable_tests -wine_fn_config_makefile dlls/d3d8thk enable_d3d8thk -wine_fn_config_makefile dlls/d3d9 enable_d3d9 -wine_fn_config_makefile dlls/d3d9/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_33 enable_d3dcompiler_33 -wine_fn_config_makefile dlls/d3dcompiler_34 enable_d3dcompiler_34 -wine_fn_config_makefile dlls/d3dcompiler_35 enable_d3dcompiler_35 -wine_fn_config_makefile dlls/d3dcompiler_36 enable_d3dcompiler_36 -wine_fn_config_makefile dlls/d3dcompiler_37 enable_d3dcompiler_37 -wine_fn_config_makefile dlls/d3dcompiler_38 enable_d3dcompiler_38 -wine_fn_config_makefile dlls/d3dcompiler_39 enable_d3dcompiler_39 -wine_fn_config_makefile dlls/d3dcompiler_40 enable_d3dcompiler_40 -wine_fn_config_makefile dlls/d3dcompiler_41 enable_d3dcompiler_41 -wine_fn_config_makefile dlls/d3dcompiler_42 enable_d3dcompiler_42 -wine_fn_config_makefile dlls/d3dcompiler_43 enable_d3dcompiler_43 -wine_fn_config_makefile dlls/d3dcompiler_43/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_46 enable_d3dcompiler_46 -wine_fn_config_makefile dlls/d3dcompiler_46/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_47 enable_d3dcompiler_47 -wine_fn_config_makefile dlls/d3dcompiler_47/tests enable_tests -wine_fn_config_makefile dlls/d3dim enable_d3dim -wine_fn_config_makefile dlls/d3dim700 enable_d3dim700 -wine_fn_config_makefile dlls/d3drm enable_d3drm -wine_fn_config_makefile dlls/d3drm/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_33 enable_d3dx10_33 -wine_fn_config_makefile dlls/d3dx10_34 enable_d3dx10_34 -wine_fn_config_makefile dlls/d3dx10_34/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_35 enable_d3dx10_35 -wine_fn_config_makefile dlls/d3dx10_35/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_36 enable_d3dx10_36 -wine_fn_config_makefile dlls/d3dx10_36/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_37 enable_d3dx10_37 -wine_fn_config_makefile dlls/d3dx10_37/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_38 enable_d3dx10_38 -wine_fn_config_makefile dlls/d3dx10_38/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_39 enable_d3dx10_39 -wine_fn_config_makefile dlls/d3dx10_39/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_40 enable_d3dx10_40 -wine_fn_config_makefile dlls/d3dx10_40/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_41 enable_d3dx10_41 -wine_fn_config_makefile dlls/d3dx10_41/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_42 enable_d3dx10_42 -wine_fn_config_makefile dlls/d3dx10_42/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_43 enable_d3dx10_43 -wine_fn_config_makefile dlls/d3dx10_43/tests enable_tests -wine_fn_config_makefile dlls/d3dx11_42 enable_d3dx11_42 -wine_fn_config_makefile dlls/d3dx11_42/tests enable_tests -wine_fn_config_makefile dlls/d3dx11_43 enable_d3dx11_43 -wine_fn_config_makefile dlls/d3dx11_43/tests enable_tests -wine_fn_config_makefile dlls/d3dx9_24 enable_d3dx9_24 -wine_fn_config_makefile dlls/d3dx9_25 enable_d3dx9_25 -wine_fn_config_makefile dlls/d3dx9_26 enable_d3dx9_26 -wine_fn_config_makefile dlls/d3dx9_27 enable_d3dx9_27 -wine_fn_config_makefile dlls/d3dx9_28 enable_d3dx9_28 -wine_fn_config_makefile dlls/d3dx9_29 enable_d3dx9_29 -wine_fn_config_makefile dlls/d3dx9_30 enable_d3dx9_30 -wine_fn_config_makefile dlls/d3dx9_31 enable_d3dx9_31 -wine_fn_config_makefile dlls/d3dx9_32 enable_d3dx9_32 -wine_fn_config_makefile dlls/d3dx9_33 enable_d3dx9_33 -wine_fn_config_makefile dlls/d3dx9_34 enable_d3dx9_34 -wine_fn_config_makefile dlls/d3dx9_35 enable_d3dx9_35 -wine_fn_config_makefile dlls/d3dx9_36 enable_d3dx9_36 -wine_fn_config_makefile dlls/d3dx9_36/tests enable_tests -wine_fn_config_makefile dlls/d3dx9_37 enable_d3dx9_37 -wine_fn_config_makefile dlls/d3dx9_38 enable_d3dx9_38 -wine_fn_config_makefile dlls/d3dx9_39 enable_d3dx9_39 -wine_fn_config_makefile dlls/d3dx9_40 enable_d3dx9_40 -wine_fn_config_makefile dlls/d3dx9_41 enable_d3dx9_41 -wine_fn_config_makefile dlls/d3dx9_42 enable_d3dx9_42 -wine_fn_config_makefile dlls/d3dx9_43 enable_d3dx9_43 -wine_fn_config_makefile dlls/d3dxof enable_d3dxof -wine_fn_config_makefile dlls/d3dxof/tests enable_tests -wine_fn_config_makefile dlls/davclnt enable_davclnt -wine_fn_config_makefile dlls/dbgeng enable_dbgeng -wine_fn_config_makefile dlls/dbgeng/tests enable_tests -wine_fn_config_makefile dlls/dbghelp enable_dbghelp -wine_fn_config_makefile dlls/dbghelp/tests enable_tests -wine_fn_config_makefile dlls/dciman32 enable_dciman32 -wine_fn_config_makefile dlls/dcomp enable_dcomp -wine_fn_config_makefile dlls/ddeml.dll16 enable_win16 -wine_fn_config_makefile dlls/ddraw enable_ddraw -wine_fn_config_makefile dlls/ddraw/tests enable_tests -wine_fn_config_makefile dlls/ddrawex enable_ddrawex -wine_fn_config_makefile dlls/ddrawex/tests enable_tests -wine_fn_config_makefile dlls/devenum enable_devenum -wine_fn_config_makefile dlls/devenum/tests enable_tests -wine_fn_config_makefile dlls/dhcpcsvc enable_dhcpcsvc -wine_fn_config_makefile dlls/dhcpcsvc/tests enable_tests -wine_fn_config_makefile dlls/dhcpcsvc6 enable_dhcpcsvc6 -wine_fn_config_makefile dlls/dhtmled.ocx enable_dhtmled_ocx -wine_fn_config_makefile dlls/diasymreader enable_diasymreader -wine_fn_config_makefile dlls/difxapi enable_difxapi -wine_fn_config_makefile dlls/dinput enable_dinput -wine_fn_config_makefile dlls/dinput/tests enable_tests -wine_fn_config_makefile dlls/dinput8 enable_dinput8 -wine_fn_config_makefile dlls/directmanipulation enable_directmanipulation -wine_fn_config_makefile dlls/directmanipulation/tests enable_tests -wine_fn_config_makefile dlls/dispdib.dll16 enable_win16 -wine_fn_config_makefile dlls/dispex enable_dispex -wine_fn_config_makefile dlls/dispex/tests enable_tests -wine_fn_config_makefile dlls/display.drv16 enable_win16 -wine_fn_config_makefile dlls/dmband enable_dmband -wine_fn_config_makefile dlls/dmband/tests enable_tests -wine_fn_config_makefile dlls/dmcompos enable_dmcompos -wine_fn_config_makefile dlls/dmcompos/tests enable_tests -wine_fn_config_makefile dlls/dmime enable_dmime -wine_fn_config_makefile dlls/dmime/tests enable_tests -wine_fn_config_makefile dlls/dmloader enable_dmloader -wine_fn_config_makefile dlls/dmloader/tests enable_tests -wine_fn_config_makefile dlls/dmscript enable_dmscript -wine_fn_config_makefile dlls/dmscript/tests enable_tests -wine_fn_config_makefile dlls/dmstyle enable_dmstyle -wine_fn_config_makefile dlls/dmstyle/tests enable_tests -wine_fn_config_makefile dlls/dmsynth enable_dmsynth -wine_fn_config_makefile dlls/dmsynth/tests enable_tests -wine_fn_config_makefile dlls/dmusic enable_dmusic -wine_fn_config_makefile dlls/dmusic/tests enable_tests -wine_fn_config_makefile dlls/dmusic32 enable_dmusic32 -wine_fn_config_makefile dlls/dnsapi enable_dnsapi -wine_fn_config_makefile dlls/dnsapi/tests enable_tests -wine_fn_config_makefile dlls/dplay enable_dplay -wine_fn_config_makefile dlls/dplayx enable_dplayx -wine_fn_config_makefile dlls/dplayx/tests enable_tests -wine_fn_config_makefile dlls/dpnaddr enable_dpnaddr -wine_fn_config_makefile dlls/dpnet enable_dpnet -wine_fn_config_makefile dlls/dpnet/tests enable_tests -wine_fn_config_makefile dlls/dpnhpast enable_dpnhpast -wine_fn_config_makefile dlls/dpnhupnp enable_dpnhupnp -wine_fn_config_makefile dlls/dpnlobby enable_dpnlobby -wine_fn_config_makefile dlls/dpvoice enable_dpvoice -wine_fn_config_makefile dlls/dpvoice/tests enable_tests -wine_fn_config_makefile dlls/dpwsockx enable_dpwsockx -wine_fn_config_makefile dlls/drmclien enable_drmclien -wine_fn_config_makefile dlls/dsdmo enable_dsdmo -wine_fn_config_makefile dlls/dsdmo/tests enable_tests -wine_fn_config_makefile dlls/dsound enable_dsound -wine_fn_config_makefile dlls/dsound/tests enable_tests -wine_fn_config_makefile dlls/dsquery enable_dsquery -wine_fn_config_makefile dlls/dssenh enable_dssenh -wine_fn_config_makefile dlls/dssenh/tests enable_tests -wine_fn_config_makefile dlls/dsuiext enable_dsuiext -wine_fn_config_makefile dlls/dswave enable_dswave -wine_fn_config_makefile dlls/dswave/tests enable_tests -wine_fn_config_makefile dlls/dwmapi enable_dwmapi -wine_fn_config_makefile dlls/dwmapi/tests enable_tests -wine_fn_config_makefile dlls/dwrite enable_dwrite -wine_fn_config_makefile dlls/dwrite/tests enable_tests -wine_fn_config_makefile dlls/dx8vb enable_dx8vb -wine_fn_config_makefile dlls/dxcore enable_dxcore -wine_fn_config_makefile dlls/dxdiagn enable_dxdiagn -wine_fn_config_makefile dlls/dxdiagn/tests enable_tests -wine_fn_config_makefile dlls/dxgi enable_dxgi -wine_fn_config_makefile dlls/dxgi/tests enable_tests -wine_fn_config_makefile dlls/dxtrans enable_dxtrans -wine_fn_config_makefile dlls/dxva2 enable_dxva2 -wine_fn_config_makefile dlls/dxva2/tests enable_tests -wine_fn_config_makefile dlls/esent enable_esent -wine_fn_config_makefile dlls/evr enable_evr -wine_fn_config_makefile dlls/evr/tests enable_tests -wine_fn_config_makefile dlls/explorerframe enable_explorerframe -wine_fn_config_makefile dlls/explorerframe/tests enable_tests -wine_fn_config_makefile dlls/faultrep enable_faultrep -wine_fn_config_makefile dlls/faultrep/tests enable_tests -wine_fn_config_makefile dlls/feclient enable_feclient -wine_fn_config_makefile dlls/fltlib enable_fltlib -wine_fn_config_makefile dlls/fltmgr.sys enable_fltmgr_sys -wine_fn_config_makefile dlls/fntcache enable_fntcache -wine_fn_config_makefile dlls/fontsub enable_fontsub -wine_fn_config_makefile dlls/fusion enable_fusion -wine_fn_config_makefile dlls/fusion/tests enable_tests -wine_fn_config_makefile dlls/fwpuclnt enable_fwpuclnt -wine_fn_config_makefile dlls/gameux enable_gameux -wine_fn_config_makefile dlls/gameux/tests enable_tests -wine_fn_config_makefile dlls/gamingtcui enable_gamingtcui -wine_fn_config_makefile dlls/gdi.exe16 enable_win16 -wine_fn_config_makefile dlls/gdi32 enable_gdi32 -wine_fn_config_makefile dlls/gdi32/tests enable_tests -wine_fn_config_makefile dlls/gdiplus enable_gdiplus -wine_fn_config_makefile dlls/gdiplus/tests enable_tests -wine_fn_config_makefile dlls/geolocation enable_geolocation -wine_fn_config_makefile dlls/geolocation/tests enable_tests -wine_fn_config_makefile dlls/glu32 enable_glu32 -wine_fn_config_makefile dlls/gphoto2.ds enable_gphoto2_ds -wine_fn_config_makefile dlls/gpkcsp enable_gpkcsp -wine_fn_config_makefile dlls/graphicscapture enable_graphicscapture -wine_fn_config_makefile dlls/graphicscapture/tests enable_tests -wine_fn_config_makefile dlls/hal enable_hal -wine_fn_config_makefile dlls/hhctrl.ocx enable_hhctrl_ocx -wine_fn_config_makefile dlls/hid enable_hid -wine_fn_config_makefile dlls/hid/tests enable_tests -wine_fn_config_makefile dlls/hidclass.sys enable_hidclass_sys -wine_fn_config_makefile dlls/hidparse.sys enable_hidparse_sys -wine_fn_config_makefile dlls/hlink enable_hlink -wine_fn_config_makefile dlls/hlink/tests enable_tests -wine_fn_config_makefile dlls/hnetcfg enable_hnetcfg -wine_fn_config_makefile dlls/hnetcfg/tests enable_tests -wine_fn_config_makefile dlls/hrtfapo enable_hrtfapo -wine_fn_config_makefile dlls/http.sys enable_http_sys -wine_fn_config_makefile dlls/httpapi enable_httpapi -wine_fn_config_makefile dlls/httpapi/tests enable_tests -wine_fn_config_makefile dlls/hvsimanagementapi enable_hvsimanagementapi -wine_fn_config_makefile dlls/hvsimanagementapi/tests enable_tests -wine_fn_config_makefile dlls/ia2comproxy enable_ia2comproxy -wine_fn_config_makefile dlls/iccvid enable_iccvid -wine_fn_config_makefile dlls/icmp enable_icmp -wine_fn_config_makefile dlls/ieframe enable_ieframe -wine_fn_config_makefile dlls/ieframe/tests enable_tests -wine_fn_config_makefile dlls/ieproxy enable_ieproxy -wine_fn_config_makefile dlls/ifsmgr.vxd enable_win16 -wine_fn_config_makefile dlls/imaadp32.acm enable_imaadp32_acm -wine_fn_config_makefile dlls/imagehlp enable_imagehlp -wine_fn_config_makefile dlls/imagehlp/tests enable_tests -wine_fn_config_makefile dlls/imm.dll16 enable_win16 -wine_fn_config_makefile dlls/imm32 enable_imm32 -wine_fn_config_makefile dlls/imm32/tests enable_tests -wine_fn_config_makefile dlls/inetcomm enable_inetcomm -wine_fn_config_makefile dlls/inetcomm/tests enable_tests -wine_fn_config_makefile dlls/inetcpl.cpl enable_inetcpl_cpl -wine_fn_config_makefile dlls/inetmib1 enable_inetmib1 -wine_fn_config_makefile dlls/inetmib1/tests enable_tests -wine_fn_config_makefile dlls/infosoft enable_infosoft -wine_fn_config_makefile dlls/infosoft/tests enable_tests -wine_fn_config_makefile dlls/initpki enable_initpki -wine_fn_config_makefile dlls/inkobj enable_inkobj -wine_fn_config_makefile dlls/inseng enable_inseng -wine_fn_config_makefile dlls/iphlpapi enable_iphlpapi -wine_fn_config_makefile dlls/iphlpapi/tests enable_tests -wine_fn_config_makefile dlls/iprop enable_iprop -wine_fn_config_makefile dlls/ir50_32 enable_ir50_32 -wine_fn_config_makefile dlls/irprops.cpl enable_irprops_cpl -wine_fn_config_makefile dlls/itircl enable_itircl -wine_fn_config_makefile dlls/itss enable_itss -wine_fn_config_makefile dlls/itss/tests enable_tests -wine_fn_config_makefile dlls/joy.cpl enable_joy_cpl -wine_fn_config_makefile dlls/jscript enable_jscript -wine_fn_config_makefile dlls/jscript/tests enable_tests -wine_fn_config_makefile dlls/jsproxy enable_jsproxy -wine_fn_config_makefile dlls/jsproxy/tests enable_tests -wine_fn_config_makefile dlls/kerberos enable_kerberos -wine_fn_config_makefile dlls/kernel32 enable_kernel32 -wine_fn_config_makefile dlls/kernel32/tests enable_tests -wine_fn_config_makefile dlls/kernelbase enable_kernelbase -wine_fn_config_makefile dlls/kernelbase/tests enable_tests -wine_fn_config_makefile dlls/keyboard.drv16 enable_win16 -wine_fn_config_makefile dlls/krnl386.exe16 enable_win16 -wine_fn_config_makefile dlls/ksecdd.sys enable_ksecdd_sys -wine_fn_config_makefile dlls/ksproxy.ax enable_ksproxy_ax -wine_fn_config_makefile dlls/ksuser enable_ksuser -wine_fn_config_makefile dlls/ktmw32 enable_ktmw32 -wine_fn_config_makefile dlls/l3codeca.acm enable_l3codeca_acm -wine_fn_config_makefile dlls/light.msstyles enable_light_msstyles -wine_fn_config_makefile dlls/loadperf enable_loadperf -wine_fn_config_makefile dlls/localspl enable_localspl -wine_fn_config_makefile dlls/localspl/tests enable_tests -wine_fn_config_makefile dlls/localui enable_localui -wine_fn_config_makefile dlls/localui/tests enable_tests -wine_fn_config_makefile dlls/lz32 enable_lz32 -wine_fn_config_makefile dlls/lz32/tests enable_tests -wine_fn_config_makefile dlls/lzexpand.dll16 enable_win16 -wine_fn_config_makefile dlls/magnification enable_magnification -wine_fn_config_makefile dlls/mapi32 enable_mapi32 -wine_fn_config_makefile dlls/mapi32/tests enable_tests -wine_fn_config_makefile dlls/mapistub enable_mapistub -wine_fn_config_makefile dlls/mciavi32 enable_mciavi32 -wine_fn_config_makefile dlls/mcicda enable_mcicda -wine_fn_config_makefile dlls/mciqtz32 enable_mciqtz32 -wine_fn_config_makefile dlls/mciseq enable_mciseq -wine_fn_config_makefile dlls/mciwave enable_mciwave -wine_fn_config_makefile dlls/mf enable_mf -wine_fn_config_makefile dlls/mf/tests enable_tests -wine_fn_config_makefile dlls/mf3216 enable_mf3216 -wine_fn_config_makefile dlls/mferror enable_mferror -wine_fn_config_makefile dlls/mfmediaengine enable_mfmediaengine -wine_fn_config_makefile dlls/mfmediaengine/tests enable_tests -wine_fn_config_makefile dlls/mfplat enable_mfplat -wine_fn_config_makefile dlls/mfplat/tests enable_tests -wine_fn_config_makefile dlls/mfplay enable_mfplay -wine_fn_config_makefile dlls/mfplay/tests enable_tests -wine_fn_config_makefile dlls/mfreadwrite enable_mfreadwrite -wine_fn_config_makefile dlls/mfreadwrite/tests enable_tests -wine_fn_config_makefile dlls/mfsrcsnk enable_mfsrcsnk -wine_fn_config_makefile dlls/mfsrcsnk/tests enable_tests -wine_fn_config_makefile dlls/mgmtapi enable_mgmtapi -wine_fn_config_makefile dlls/midimap enable_midimap -wine_fn_config_makefile dlls/mlang enable_mlang -wine_fn_config_makefile dlls/mlang/tests enable_tests -wine_fn_config_makefile dlls/mmcndmgr enable_mmcndmgr -wine_fn_config_makefile dlls/mmcndmgr/tests enable_tests -wine_fn_config_makefile dlls/mmdevapi enable_mmdevapi -wine_fn_config_makefile dlls/mmdevapi/tests enable_tests -wine_fn_config_makefile dlls/mmdevldr.vxd enable_win16 -wine_fn_config_makefile dlls/mmsystem.dll16 enable_win16 -wine_fn_config_makefile dlls/monodebg.vxd enable_win16 -wine_fn_config_makefile dlls/mountmgr.sys enable_mountmgr_sys -wine_fn_config_makefile dlls/mouse.drv16 enable_win16 -wine_fn_config_makefile dlls/mp3dmod enable_mp3dmod -wine_fn_config_makefile dlls/mp3dmod/tests enable_tests -wine_fn_config_makefile dlls/mpr enable_mpr -wine_fn_config_makefile dlls/mpr/tests enable_tests -wine_fn_config_makefile dlls/mprapi enable_mprapi -wine_fn_config_makefile dlls/msacm.dll16 enable_win16 -wine_fn_config_makefile dlls/msacm32.drv enable_msacm32_drv -wine_fn_config_makefile dlls/msacm32 enable_msacm32 -wine_fn_config_makefile dlls/msacm32/tests enable_tests -wine_fn_config_makefile dlls/msado15 enable_msado15 -wine_fn_config_makefile dlls/msado15/tests enable_tests -wine_fn_config_makefile dlls/msadp32.acm enable_msadp32_acm -wine_fn_config_makefile dlls/msasn1 enable_msasn1 -wine_fn_config_makefile dlls/msasn1/tests enable_tests -wine_fn_config_makefile dlls/msauddecmft enable_msauddecmft -wine_fn_config_makefile dlls/mscat32 enable_mscat32 -wine_fn_config_makefile dlls/mscms enable_mscms -wine_fn_config_makefile dlls/mscms/tests enable_tests -wine_fn_config_makefile dlls/mscoree enable_mscoree -wine_fn_config_makefile dlls/mscoree/tests enable_tests -wine_fn_config_makefile dlls/mscorwks enable_mscorwks -wine_fn_config_makefile dlls/msctf enable_msctf -wine_fn_config_makefile dlls/msctf/tests enable_tests -wine_fn_config_makefile dlls/msctfmonitor enable_msctfmonitor -wine_fn_config_makefile dlls/msctfp enable_msctfp -wine_fn_config_makefile dlls/msdaps enable_msdaps -wine_fn_config_makefile dlls/msdasql enable_msdasql -wine_fn_config_makefile dlls/msdasql/tests enable_tests -wine_fn_config_makefile dlls/msdelta enable_msdelta -wine_fn_config_makefile dlls/msdmo enable_msdmo -wine_fn_config_makefile dlls/msdmo/tests enable_tests -wine_fn_config_makefile dlls/msdrm enable_msdrm -wine_fn_config_makefile dlls/msftedit enable_msftedit -wine_fn_config_makefile dlls/msftedit/tests enable_tests -wine_fn_config_makefile dlls/msg711.acm enable_msg711_acm -wine_fn_config_makefile dlls/msgsm32.acm enable_msgsm32_acm -wine_fn_config_makefile dlls/mshtml.tlb enable_mshtml_tlb -wine_fn_config_makefile dlls/mshtml enable_mshtml -wine_fn_config_makefile dlls/mshtml/tests enable_tests -wine_fn_config_makefile dlls/msi enable_msi -wine_fn_config_makefile dlls/msi/tests enable_tests -wine_fn_config_makefile dlls/msident enable_msident -wine_fn_config_makefile dlls/msimg32 enable_msimg32 -wine_fn_config_makefile dlls/msimsg enable_msimsg -wine_fn_config_makefile dlls/msimtf enable_msimtf -wine_fn_config_makefile dlls/msisip enable_msisip -wine_fn_config_makefile dlls/msisys.ocx enable_msisys_ocx -wine_fn_config_makefile dlls/msls31 enable_msls31 -wine_fn_config_makefile dlls/msmpeg2vdec enable_msmpeg2vdec -wine_fn_config_makefile dlls/msnet32 enable_msnet32 -wine_fn_config_makefile dlls/mspatcha enable_mspatcha -wine_fn_config_makefile dlls/mspatcha/tests enable_tests -wine_fn_config_makefile dlls/msports enable_msports -wine_fn_config_makefile dlls/msrle32 enable_msrle32 -wine_fn_config_makefile dlls/msrle32/tests enable_tests -wine_fn_config_makefile dlls/msscript.ocx enable_msscript_ocx -wine_fn_config_makefile dlls/msscript.ocx/tests enable_tests -wine_fn_config_makefile dlls/mssign32 enable_mssign32 -wine_fn_config_makefile dlls/mssip32 enable_mssip32 -wine_fn_config_makefile dlls/mstask enable_mstask -wine_fn_config_makefile dlls/mstask/tests enable_tests -wine_fn_config_makefile dlls/msttsengine enable_msttsengine -wine_fn_config_makefile dlls/msv1_0 enable_msv1_0 -wine_fn_config_makefile dlls/msvcirt enable_msvcirt -wine_fn_config_makefile dlls/msvcirt/tests enable_tests -wine_fn_config_makefile dlls/msvcm80 enable_msvcm80 -wine_fn_config_makefile dlls/msvcm90 enable_msvcm90 -wine_fn_config_makefile dlls/msvcp100 enable_msvcp100 -wine_fn_config_makefile dlls/msvcp100/tests enable_tests -wine_fn_config_makefile dlls/msvcp110 enable_msvcp110 -wine_fn_config_makefile dlls/msvcp110/tests enable_tests -wine_fn_config_makefile dlls/msvcp120 enable_msvcp120 -wine_fn_config_makefile dlls/msvcp120/tests enable_tests -wine_fn_config_makefile dlls/msvcp120_app enable_msvcp120_app -wine_fn_config_makefile dlls/msvcp140 enable_msvcp140 -wine_fn_config_makefile dlls/msvcp140/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_1 enable_msvcp140_1 -wine_fn_config_makefile dlls/msvcp140_1/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_2 enable_msvcp140_2 -wine_fn_config_makefile dlls/msvcp140_atomic_wait enable_msvcp140_atomic_wait -wine_fn_config_makefile dlls/msvcp140_atomic_wait/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_codecvt_ids enable_msvcp140_codecvt_ids -wine_fn_config_makefile dlls/msvcp60 enable_msvcp60 -wine_fn_config_makefile dlls/msvcp60/tests enable_tests -wine_fn_config_makefile dlls/msvcp70 enable_msvcp70 -wine_fn_config_makefile dlls/msvcp71 enable_msvcp71 -wine_fn_config_makefile dlls/msvcp80 enable_msvcp80 -wine_fn_config_makefile dlls/msvcp90 enable_msvcp90 -wine_fn_config_makefile dlls/msvcp90/tests enable_tests -wine_fn_config_makefile dlls/msvcp_win enable_msvcp_win -wine_fn_config_makefile dlls/msvcr100 enable_msvcr100 -wine_fn_config_makefile dlls/msvcr100/tests enable_tests -wine_fn_config_makefile dlls/msvcr110 enable_msvcr110 -wine_fn_config_makefile dlls/msvcr110/tests enable_tests -wine_fn_config_makefile dlls/msvcr120 enable_msvcr120 -wine_fn_config_makefile dlls/msvcr120/tests enable_tests -wine_fn_config_makefile dlls/msvcr120_app enable_msvcr120_app -wine_fn_config_makefile dlls/msvcr70 enable_msvcr70 -wine_fn_config_makefile dlls/msvcr70/tests enable_tests -wine_fn_config_makefile dlls/msvcr71 enable_msvcr71 -wine_fn_config_makefile dlls/msvcr71/tests enable_tests -wine_fn_config_makefile dlls/msvcr80 enable_msvcr80 -wine_fn_config_makefile dlls/msvcr80/tests enable_tests -wine_fn_config_makefile dlls/msvcr90 enable_msvcr90 -wine_fn_config_makefile dlls/msvcr90/tests enable_tests -wine_fn_config_makefile dlls/msvcrt enable_msvcrt -wine_fn_config_makefile dlls/msvcrt/tests enable_tests -wine_fn_config_makefile dlls/msvcrt20 enable_msvcrt20 -wine_fn_config_makefile dlls/msvcrt40 enable_msvcrt40 -wine_fn_config_makefile dlls/msvcrtd enable_msvcrtd -wine_fn_config_makefile dlls/msvcrtd/tests enable_tests -wine_fn_config_makefile dlls/msvfw32 enable_msvfw32 -wine_fn_config_makefile dlls/msvfw32/tests enable_tests -wine_fn_config_makefile dlls/msvidc32 enable_msvidc32 -wine_fn_config_makefile dlls/msvideo.dll16 enable_win16 -wine_fn_config_makefile dlls/mswsock enable_mswsock -wine_fn_config_makefile dlls/msxml enable_msxml -wine_fn_config_makefile dlls/msxml2 enable_msxml2 -wine_fn_config_makefile dlls/msxml3 enable_msxml3 -wine_fn_config_makefile dlls/msxml3/tests enable_tests -wine_fn_config_makefile dlls/msxml4 enable_msxml4 -wine_fn_config_makefile dlls/msxml4/tests enable_tests -wine_fn_config_makefile dlls/msxml6 enable_msxml6 -wine_fn_config_makefile dlls/msxml6/tests enable_tests -wine_fn_config_makefile dlls/mtxdm enable_mtxdm -wine_fn_config_makefile dlls/ncrypt enable_ncrypt -wine_fn_config_makefile dlls/ncrypt/tests enable_tests -wine_fn_config_makefile dlls/nddeapi enable_nddeapi -wine_fn_config_makefile dlls/ndis.sys enable_ndis_sys -wine_fn_config_makefile dlls/ndis.sys/tests enable_tests -wine_fn_config_makefile dlls/netapi32 enable_netapi32 -wine_fn_config_makefile dlls/netapi32/tests enable_tests -wine_fn_config_makefile dlls/netcfgx enable_netcfgx -wine_fn_config_makefile dlls/netcfgx/tests enable_tests -wine_fn_config_makefile dlls/netio.sys enable_netio_sys -wine_fn_config_makefile dlls/netprofm enable_netprofm -wine_fn_config_makefile dlls/netprofm/tests enable_tests -wine_fn_config_makefile dlls/netutils enable_netutils -wine_fn_config_makefile dlls/newdev enable_newdev -wine_fn_config_makefile dlls/ninput enable_ninput -wine_fn_config_makefile dlls/ninput/tests enable_tests -wine_fn_config_makefile dlls/normaliz enable_normaliz -wine_fn_config_makefile dlls/npmshtml enable_npmshtml -wine_fn_config_makefile dlls/npptools enable_npptools -wine_fn_config_makefile dlls/nsi enable_nsi -wine_fn_config_makefile dlls/nsi/tests enable_tests -wine_fn_config_makefile dlls/nsiproxy.sys enable_nsiproxy_sys -wine_fn_config_makefile dlls/ntdll enable_ntdll -wine_fn_config_makefile dlls/ntdll/tests enable_tests -wine_fn_config_makefile dlls/ntdsapi enable_ntdsapi -wine_fn_config_makefile dlls/ntdsapi/tests enable_tests -wine_fn_config_makefile dlls/ntoskrnl.exe enable_ntoskrnl_exe -wine_fn_config_makefile dlls/ntoskrnl.exe/tests enable_tests -wine_fn_config_makefile dlls/ntprint enable_ntprint -wine_fn_config_makefile dlls/ntprint/tests enable_tests -wine_fn_config_makefile dlls/objsel enable_objsel -wine_fn_config_makefile dlls/odbc32 enable_odbc32 -wine_fn_config_makefile dlls/odbcbcp enable_odbcbcp -wine_fn_config_makefile dlls/odbccp32 enable_odbccp32 -wine_fn_config_makefile dlls/odbccp32/tests enable_tests -wine_fn_config_makefile dlls/odbccu32 enable_odbccu32 -wine_fn_config_makefile dlls/ole2.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2conv.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2disp.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2nls.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2prox.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2thk.dll16 enable_win16 -wine_fn_config_makefile dlls/ole32 enable_ole32 -wine_fn_config_makefile dlls/ole32/tests enable_tests -wine_fn_config_makefile dlls/oleacc enable_oleacc -wine_fn_config_makefile dlls/oleacc/tests enable_tests -wine_fn_config_makefile dlls/oleaut32 enable_oleaut32 -wine_fn_config_makefile dlls/oleaut32/tests enable_tests -wine_fn_config_makefile dlls/olecli.dll16 enable_win16 -wine_fn_config_makefile dlls/olecli32 enable_olecli32 -wine_fn_config_makefile dlls/oledb32 enable_oledb32 -wine_fn_config_makefile dlls/oledb32/tests enable_tests -wine_fn_config_makefile dlls/oledlg enable_oledlg -wine_fn_config_makefile dlls/oledlg/tests enable_tests -wine_fn_config_makefile dlls/olepro32 enable_olepro32 -wine_fn_config_makefile dlls/olesvr.dll16 enable_win16 -wine_fn_config_makefile dlls/olesvr32 enable_olesvr32 -wine_fn_config_makefile dlls/olethk32 enable_olethk32 -wine_fn_config_makefile dlls/opcservices enable_opcservices -wine_fn_config_makefile dlls/opcservices/tests enable_tests -wine_fn_config_makefile dlls/opencl enable_opencl -wine_fn_config_makefile dlls/opengl32 enable_opengl32 -wine_fn_config_makefile dlls/opengl32/tests enable_tests -wine_fn_config_makefile dlls/packager enable_packager -wine_fn_config_makefile dlls/packager/tests enable_tests -wine_fn_config_makefile dlls/pdh enable_pdh -wine_fn_config_makefile dlls/pdh/tests enable_tests -wine_fn_config_makefile dlls/photometadatahandler enable_photometadatahandler -wine_fn_config_makefile dlls/pidgen enable_pidgen -wine_fn_config_makefile dlls/powrprof enable_powrprof -wine_fn_config_makefile dlls/printui enable_printui -wine_fn_config_makefile dlls/prntvpt enable_prntvpt -wine_fn_config_makefile dlls/prntvpt/tests enable_tests -wine_fn_config_makefile dlls/propsys enable_propsys -wine_fn_config_makefile dlls/propsys/tests enable_tests -wine_fn_config_makefile dlls/psapi enable_psapi -wine_fn_config_makefile dlls/psapi/tests enable_tests -wine_fn_config_makefile dlls/pstorec enable_pstorec -wine_fn_config_makefile dlls/pstorec/tests enable_tests -wine_fn_config_makefile dlls/pwrshplugin enable_pwrshplugin -wine_fn_config_makefile dlls/qasf enable_qasf -wine_fn_config_makefile dlls/qasf/tests enable_tests -wine_fn_config_makefile dlls/qcap enable_qcap -wine_fn_config_makefile dlls/qcap/tests enable_tests -wine_fn_config_makefile dlls/qdvd enable_qdvd -wine_fn_config_makefile dlls/qdvd/tests enable_tests -wine_fn_config_makefile dlls/qedit enable_qedit -wine_fn_config_makefile dlls/qedit/tests enable_tests -wine_fn_config_makefile dlls/qmgr enable_qmgr -wine_fn_config_makefile dlls/qmgr/tests enable_tests -wine_fn_config_makefile dlls/qmgrprxy enable_qmgrprxy -wine_fn_config_makefile dlls/quartz enable_quartz -wine_fn_config_makefile dlls/quartz/tests enable_tests -wine_fn_config_makefile dlls/query enable_query -wine_fn_config_makefile dlls/qwave enable_qwave -wine_fn_config_makefile dlls/qwave/tests enable_tests -wine_fn_config_makefile dlls/rasapi16.dll16 enable_win16 -wine_fn_config_makefile dlls/rasapi32 enable_rasapi32 -wine_fn_config_makefile dlls/rasapi32/tests enable_tests -wine_fn_config_makefile dlls/rasdlg enable_rasdlg -wine_fn_config_makefile dlls/regapi enable_regapi -wine_fn_config_makefile dlls/resutils enable_resutils -wine_fn_config_makefile dlls/riched20 enable_riched20 -wine_fn_config_makefile dlls/riched20/tests enable_tests -wine_fn_config_makefile dlls/riched32 enable_riched32 -wine_fn_config_makefile dlls/riched32/tests enable_tests -wine_fn_config_makefile dlls/rpcrt4 enable_rpcrt4 -wine_fn_config_makefile dlls/rpcrt4/tests enable_tests -wine_fn_config_makefile dlls/rsabase enable_rsabase -wine_fn_config_makefile dlls/rsaenh enable_rsaenh -wine_fn_config_makefile dlls/rsaenh/tests enable_tests -wine_fn_config_makefile dlls/rstrtmgr enable_rstrtmgr -wine_fn_config_makefile dlls/rtutils enable_rtutils -wine_fn_config_makefile dlls/rtworkq enable_rtworkq -wine_fn_config_makefile dlls/rtworkq/tests enable_tests -wine_fn_config_makefile dlls/samlib enable_samlib -wine_fn_config_makefile dlls/sane.ds enable_sane_ds -wine_fn_config_makefile dlls/sapi enable_sapi -wine_fn_config_makefile dlls/sapi/tests enable_tests -wine_fn_config_makefile dlls/sas enable_sas -wine_fn_config_makefile dlls/scarddlg enable_scarddlg -wine_fn_config_makefile dlls/scardsvr enable_scardsvr -wine_fn_config_makefile dlls/sccbase enable_sccbase -wine_fn_config_makefile dlls/schannel enable_schannel -wine_fn_config_makefile dlls/schannel/tests enable_tests -wine_fn_config_makefile dlls/schedsvc enable_schedsvc -wine_fn_config_makefile dlls/schedsvc/tests enable_tests -wine_fn_config_makefile dlls/scrobj enable_scrobj -wine_fn_config_makefile dlls/scrobj/tests enable_tests -wine_fn_config_makefile dlls/scrrun enable_scrrun -wine_fn_config_makefile dlls/scrrun/tests enable_tests -wine_fn_config_makefile dlls/scsiport.sys enable_scsiport_sys -wine_fn_config_makefile dlls/sechost enable_sechost -wine_fn_config_makefile dlls/secur32 enable_secur32 -wine_fn_config_makefile dlls/secur32/tests enable_tests -wine_fn_config_makefile dlls/security enable_security -wine_fn_config_makefile dlls/sensapi enable_sensapi -wine_fn_config_makefile dlls/serialui enable_serialui -wine_fn_config_makefile dlls/serialui/tests enable_tests -wine_fn_config_makefile dlls/setupapi enable_setupapi -wine_fn_config_makefile dlls/setupapi/tests enable_tests -wine_fn_config_makefile dlls/setupx.dll16 enable_win16 -wine_fn_config_makefile dlls/sfc enable_sfc -wine_fn_config_makefile dlls/sfc_os enable_sfc_os -wine_fn_config_makefile dlls/shcore enable_shcore -wine_fn_config_makefile dlls/shcore/tests enable_tests -wine_fn_config_makefile dlls/shdoclc enable_shdoclc -wine_fn_config_makefile dlls/shdocvw enable_shdocvw -wine_fn_config_makefile dlls/shdocvw/tests enable_tests -wine_fn_config_makefile dlls/shell.dll16 enable_win16 -wine_fn_config_makefile dlls/shell32 enable_shell32 -wine_fn_config_makefile dlls/shell32/tests enable_tests -wine_fn_config_makefile dlls/shfolder enable_shfolder -wine_fn_config_makefile dlls/shlwapi enable_shlwapi -wine_fn_config_makefile dlls/shlwapi/tests enable_tests -wine_fn_config_makefile dlls/slbcsp enable_slbcsp -wine_fn_config_makefile dlls/slc enable_slc -wine_fn_config_makefile dlls/slc/tests enable_tests -wine_fn_config_makefile dlls/snmpapi enable_snmpapi -wine_fn_config_makefile dlls/snmpapi/tests enable_tests -wine_fn_config_makefile dlls/softpub enable_softpub -wine_fn_config_makefile dlls/sound.drv16 enable_win16 -wine_fn_config_makefile dlls/spoolss enable_spoolss -wine_fn_config_makefile dlls/spoolss/tests enable_tests -wine_fn_config_makefile dlls/sppc enable_sppc -wine_fn_config_makefile dlls/srclient enable_srclient -wine_fn_config_makefile dlls/srvcli enable_srvcli -wine_fn_config_makefile dlls/srvsvc enable_srvsvc -wine_fn_config_makefile dlls/sspicli enable_sspicli -wine_fn_config_makefile dlls/stdole2.tlb enable_stdole2_tlb -wine_fn_config_makefile dlls/stdole32.tlb enable_stdole32_tlb -wine_fn_config_makefile dlls/sti enable_sti -wine_fn_config_makefile dlls/sti/tests enable_tests -wine_fn_config_makefile dlls/storage.dll16 enable_win16 -wine_fn_config_makefile dlls/stress.dll16 enable_win16 -wine_fn_config_makefile dlls/strmdll enable_strmdll -wine_fn_config_makefile dlls/svrapi enable_svrapi -wine_fn_config_makefile dlls/sxs enable_sxs -wine_fn_config_makefile dlls/sxs/tests enable_tests -wine_fn_config_makefile dlls/system.drv16 enable_win16 -wine_fn_config_makefile dlls/t2embed enable_t2embed -wine_fn_config_makefile dlls/t2embed/tests enable_tests -wine_fn_config_makefile dlls/tapi32 enable_tapi32 -wine_fn_config_makefile dlls/tapi32/tests enable_tests -wine_fn_config_makefile dlls/taskschd enable_taskschd -wine_fn_config_makefile dlls/taskschd/tests enable_tests -wine_fn_config_makefile dlls/tbs enable_tbs -wine_fn_config_makefile dlls/tdh enable_tdh -wine_fn_config_makefile dlls/tdi.sys enable_tdi_sys -wine_fn_config_makefile dlls/threadpoolwinrt enable_threadpoolwinrt -wine_fn_config_makefile dlls/threadpoolwinrt/tests enable_tests -wine_fn_config_makefile dlls/toolhelp.dll16 enable_win16 -wine_fn_config_makefile dlls/traffic enable_traffic -wine_fn_config_makefile dlls/twain.dll16 enable_win16 -wine_fn_config_makefile dlls/twain_32 enable_twain_32 -wine_fn_config_makefile dlls/twain_32/tests enable_tests -wine_fn_config_makefile dlls/twinapi.appcore enable_twinapi_appcore -wine_fn_config_makefile dlls/twinapi.appcore/tests enable_tests -wine_fn_config_makefile dlls/typelib.dll16 enable_win16 -wine_fn_config_makefile dlls/tzres enable_tzres -wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase -wine_fn_config_makefile dlls/ucrtbase/tests enable_tests -wine_fn_config_makefile dlls/uianimation enable_uianimation -wine_fn_config_makefile dlls/uianimation/tests enable_tests -wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore -wine_fn_config_makefile dlls/uiautomationcore/tests enable_tests -wine_fn_config_makefile dlls/uiribbon enable_uiribbon -wine_fn_config_makefile dlls/unicows enable_unicows -wine_fn_config_makefile dlls/updspapi enable_updspapi -wine_fn_config_makefile dlls/url enable_url -wine_fn_config_makefile dlls/urlmon enable_urlmon -wine_fn_config_makefile dlls/urlmon/tests enable_tests -wine_fn_config_makefile dlls/usbd.sys enable_usbd_sys -wine_fn_config_makefile dlls/user.exe16 enable_win16 -wine_fn_config_makefile dlls/user32 enable_user32 -wine_fn_config_makefile dlls/user32/tests enable_tests -wine_fn_config_makefile dlls/userenv enable_userenv -wine_fn_config_makefile dlls/userenv/tests enable_tests -wine_fn_config_makefile dlls/usp10 enable_usp10 -wine_fn_config_makefile dlls/usp10/tests enable_tests -wine_fn_config_makefile dlls/utildll enable_utildll -wine_fn_config_makefile dlls/uxtheme enable_uxtheme -wine_fn_config_makefile dlls/uxtheme/tests enable_tests -wine_fn_config_makefile dlls/vbscript enable_vbscript -wine_fn_config_makefile dlls/vbscript/tests enable_tests -wine_fn_config_makefile dlls/vcomp enable_vcomp -wine_fn_config_makefile dlls/vcomp/tests enable_tests -wine_fn_config_makefile dlls/vcomp100 enable_vcomp100 -wine_fn_config_makefile dlls/vcomp110 enable_vcomp110 -wine_fn_config_makefile dlls/vcomp110/tests enable_tests -wine_fn_config_makefile dlls/vcomp120 enable_vcomp120 -wine_fn_config_makefile dlls/vcomp140 enable_vcomp140 -wine_fn_config_makefile dlls/vcomp90 enable_vcomp90 -wine_fn_config_makefile dlls/vcruntime140 enable_vcruntime140 -wine_fn_config_makefile dlls/vcruntime140_1 enable_vcruntime140_1 -wine_fn_config_makefile dlls/vdhcp.vxd enable_win16 -wine_fn_config_makefile dlls/vdmdbg enable_vdmdbg -wine_fn_config_makefile dlls/ver.dll16 enable_win16 -wine_fn_config_makefile dlls/version enable_version -wine_fn_config_makefile dlls/version/tests enable_tests -wine_fn_config_makefile dlls/vga enable_vga -wine_fn_config_makefile dlls/virtdisk enable_virtdisk -wine_fn_config_makefile dlls/virtdisk/tests enable_tests -wine_fn_config_makefile dlls/vmm.vxd enable_win16 -wine_fn_config_makefile dlls/vnbt.vxd enable_win16 -wine_fn_config_makefile dlls/vnetbios.vxd enable_win16 -wine_fn_config_makefile dlls/vssapi enable_vssapi -wine_fn_config_makefile dlls/vtdapi.vxd enable_win16 -wine_fn_config_makefile dlls/vulkan-1 enable_vulkan_1 -wine_fn_config_makefile dlls/vulkan-1/tests enable_tests -wine_fn_config_makefile dlls/vwin32.vxd enable_win16 -wine_fn_config_makefile dlls/w32skrnl enable_win16 -wine_fn_config_makefile dlls/w32sys.dll16 enable_win16 -wine_fn_config_makefile dlls/wbemdisp enable_wbemdisp -wine_fn_config_makefile dlls/wbemdisp/tests enable_tests -wine_fn_config_makefile dlls/wbemprox enable_wbemprox -wine_fn_config_makefile dlls/wbemprox/tests enable_tests -wine_fn_config_makefile dlls/wdscore enable_wdscore -wine_fn_config_makefile dlls/webservices enable_webservices -wine_fn_config_makefile dlls/webservices/tests enable_tests -wine_fn_config_makefile dlls/websocket enable_websocket -wine_fn_config_makefile dlls/wer enable_wer -wine_fn_config_makefile dlls/wer/tests enable_tests -wine_fn_config_makefile dlls/wevtapi enable_wevtapi -wine_fn_config_makefile dlls/wevtapi/tests enable_tests -wine_fn_config_makefile dlls/wevtsvc enable_wevtsvc -wine_fn_config_makefile dlls/wiaservc enable_wiaservc -wine_fn_config_makefile dlls/wiaservc/tests enable_tests -wine_fn_config_makefile dlls/wimgapi enable_wimgapi -wine_fn_config_makefile dlls/win32s16.dll16 enable_win16 -wine_fn_config_makefile dlls/win32u enable_win32u -wine_fn_config_makefile dlls/win32u/tests enable_tests -wine_fn_config_makefile dlls/win87em.dll16 enable_win16 -wine_fn_config_makefile dlls/winaspi.dll16 enable_win16 -wine_fn_config_makefile dlls/windebug.dll16 enable_win16 -wine_fn_config_makefile dlls/windows.applicationmodel enable_windows_applicationmodel -wine_fn_config_makefile dlls/windows.applicationmodel/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.bluetooth enable_windows_devices_bluetooth -wine_fn_config_makefile dlls/windows.devices.bluetooth/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.enumeration enable_windows_devices_enumeration -wine_fn_config_makefile dlls/windows.devices.enumeration/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.usb enable_windows_devices_usb -wine_fn_config_makefile dlls/windows.devices.usb/tests enable_tests -wine_fn_config_makefile dlls/windows.gaming.input enable_windows_gaming_input -wine_fn_config_makefile dlls/windows.gaming.input/tests enable_tests -wine_fn_config_makefile dlls/windows.gaming.ui.gamebar enable_windows_gaming_ui_gamebar -wine_fn_config_makefile dlls/windows.gaming.ui.gamebar/tests enable_tests -wine_fn_config_makefile dlls/windows.globalization enable_windows_globalization -wine_fn_config_makefile dlls/windows.globalization/tests enable_tests -wine_fn_config_makefile dlls/windows.media.devices enable_windows_media_devices -wine_fn_config_makefile dlls/windows.media.devices/tests enable_tests -wine_fn_config_makefile dlls/windows.media.mediacontrol enable_windows_media_mediacontrol -wine_fn_config_makefile dlls/windows.media.mediacontrol/tests enable_tests -wine_fn_config_makefile dlls/windows.media.speech enable_windows_media_speech -wine_fn_config_makefile dlls/windows.media.speech/tests enable_tests -wine_fn_config_makefile dlls/windows.media enable_windows_media -wine_fn_config_makefile dlls/windows.media/tests enable_tests -wine_fn_config_makefile dlls/windows.networking.hostname enable_windows_networking_hostname -wine_fn_config_makefile dlls/windows.networking.hostname/tests enable_tests -wine_fn_config_makefile dlls/windows.networking enable_windows_networking -wine_fn_config_makefile dlls/windows.perception.stub enable_windows_perception_stub -wine_fn_config_makefile dlls/windows.perception.stub/tests enable_tests -wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier enable_windows_security_credentials_ui_userconsentverifier -wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier/tests enable_tests -wine_fn_config_makefile dlls/windows.storage.applicationdata enable_windows_storage_applicationdata -wine_fn_config_makefile dlls/windows.storage.applicationdata/tests enable_tests -wine_fn_config_makefile dlls/windows.system.profile.systemmanufacturers enable_windows_system_profile_systemmanufacturers -wine_fn_config_makefile dlls/windows.system.profile.systemmanufacturers/tests enable_tests -wine_fn_config_makefile dlls/windows.ui enable_windows_ui -wine_fn_config_makefile dlls/windows.ui/tests enable_tests -wine_fn_config_makefile dlls/windowscodecs enable_windowscodecs -wine_fn_config_makefile dlls/windowscodecs/tests enable_tests -wine_fn_config_makefile dlls/windowscodecsext enable_windowscodecsext -wine_fn_config_makefile dlls/windowscodecsext/tests enable_tests -wine_fn_config_makefile dlls/winealsa.drv enable_winealsa_drv -wine_fn_config_makefile dlls/wineandroid.drv enable_wineandroid_drv -wine_fn_config_makefile dlls/winebus.sys enable_winebus_sys -wine_fn_config_makefile dlls/winecoreaudio.drv enable_winecoreaudio_drv -wine_fn_config_makefile dlls/winecrt0 enable_winecrt0 -wine_fn_config_makefile dlls/wined3d enable_wined3d -wine_fn_config_makefile dlls/winegstreamer enable_winegstreamer -wine_fn_config_makefile dlls/winehid.sys enable_winehid_sys -wine_fn_config_makefile dlls/winemac.drv enable_winemac_drv -wine_fn_config_makefile dlls/winemapi enable_winemapi -wine_fn_config_makefile dlls/wineoss.drv enable_wineoss_drv -wine_fn_config_makefile dlls/wineps.drv enable_wineps_drv -wine_fn_config_makefile dlls/wineps16.drv16 enable_win16 -wine_fn_config_makefile dlls/winepulse.drv enable_winepulse_drv -wine_fn_config_makefile dlls/wineusb.sys enable_wineusb_sys -wine_fn_config_makefile dlls/winevulkan enable_winevulkan -wine_fn_config_makefile dlls/winewayland.drv enable_winewayland_drv -wine_fn_config_makefile dlls/winex11.drv enable_winex11_drv -wine_fn_config_makefile dlls/winexinput.sys enable_winexinput_sys -wine_fn_config_makefile dlls/wing.dll16 enable_win16 -wine_fn_config_makefile dlls/wing32 enable_wing32 -wine_fn_config_makefile dlls/winhttp enable_winhttp -wine_fn_config_makefile dlls/winhttp/tests enable_tests -wine_fn_config_makefile dlls/wininet enable_wininet -wine_fn_config_makefile dlls/wininet/tests enable_tests -wine_fn_config_makefile dlls/winmm enable_winmm -wine_fn_config_makefile dlls/winmm/tests enable_tests -wine_fn_config_makefile dlls/winnls.dll16 enable_win16 -wine_fn_config_makefile dlls/winnls32 enable_winnls32 -wine_fn_config_makefile dlls/winprint enable_winprint -wine_fn_config_makefile dlls/winscard enable_winscard -wine_fn_config_makefile dlls/winscard/tests enable_tests -wine_fn_config_makefile dlls/winsock.dll16 enable_win16 -wine_fn_config_makefile dlls/winspool.drv enable_winspool_drv -wine_fn_config_makefile dlls/winspool.drv/tests enable_tests -wine_fn_config_makefile dlls/winsta enable_winsta -wine_fn_config_makefile dlls/wintab.dll16 enable_win16 -wine_fn_config_makefile dlls/wintab32 enable_wintab32 -wine_fn_config_makefile dlls/wintab32/tests enable_tests -wine_fn_config_makefile dlls/wintrust enable_wintrust -wine_fn_config_makefile dlls/wintrust/tests enable_tests -wine_fn_config_makefile dlls/wintypes enable_wintypes -wine_fn_config_makefile dlls/wintypes/tests enable_tests -wine_fn_config_makefile dlls/winusb enable_winusb -wine_fn_config_makefile dlls/wlanapi enable_wlanapi -wine_fn_config_makefile dlls/wlanapi/tests enable_tests -wine_fn_config_makefile dlls/wlanui enable_wlanui -wine_fn_config_makefile dlls/wldap32 enable_wldap32 -wine_fn_config_makefile dlls/wldap32/tests enable_tests -wine_fn_config_makefile dlls/wldp enable_wldp -wine_fn_config_makefile dlls/wldp/tests enable_tests -wine_fn_config_makefile dlls/wmasf enable_wmasf -wine_fn_config_makefile dlls/wmi enable_wmi -wine_fn_config_makefile dlls/wmiutils enable_wmiutils -wine_fn_config_makefile dlls/wmiutils/tests enable_tests -wine_fn_config_makefile dlls/wmp enable_wmp -wine_fn_config_makefile dlls/wmp/tests enable_tests -wine_fn_config_makefile dlls/wmphoto enable_wmphoto -wine_fn_config_makefile dlls/wmvcore enable_wmvcore -wine_fn_config_makefile dlls/wmvcore/tests enable_tests -wine_fn_config_makefile dlls/wnaspi32 enable_wnaspi32 -wine_fn_config_makefile dlls/wofutil enable_wofutil -wine_fn_config_makefile dlls/wow32 enable_win16 -wine_fn_config_makefile dlls/wow64 enable_wow64 -wine_fn_config_makefile dlls/wow64cpu enable_wow64cpu -wine_fn_config_makefile dlls/wow64win enable_wow64win -wine_fn_config_makefile dlls/wpc enable_wpc -wine_fn_config_makefile dlls/wpc/tests enable_tests -wine_fn_config_makefile dlls/wpcap enable_wpcap -wine_fn_config_makefile dlls/wpcap/tests enable_tests -wine_fn_config_makefile dlls/ws2_32 enable_ws2_32 -wine_fn_config_makefile dlls/ws2_32/tests enable_tests -wine_fn_config_makefile dlls/wsdapi enable_wsdapi -wine_fn_config_makefile dlls/wsdapi/tests enable_tests -wine_fn_config_makefile dlls/wshom.ocx enable_wshom_ocx -wine_fn_config_makefile dlls/wshom.ocx/tests enable_tests -wine_fn_config_makefile dlls/wsnmp32 enable_wsnmp32 -wine_fn_config_makefile dlls/wsnmp32/tests enable_tests -wine_fn_config_makefile dlls/wsock32 enable_wsock32 -wine_fn_config_makefile dlls/wtsapi32 enable_wtsapi32 -wine_fn_config_makefile dlls/wtsapi32/tests enable_tests -wine_fn_config_makefile dlls/wuapi enable_wuapi -wine_fn_config_makefile dlls/wuaueng enable_wuaueng -wine_fn_config_makefile dlls/x3daudio1_0 enable_x3daudio1_0 -wine_fn_config_makefile dlls/x3daudio1_1 enable_x3daudio1_1 -wine_fn_config_makefile dlls/x3daudio1_2 enable_x3daudio1_2 -wine_fn_config_makefile dlls/x3daudio1_3 enable_x3daudio1_3 -wine_fn_config_makefile dlls/x3daudio1_4 enable_x3daudio1_4 -wine_fn_config_makefile dlls/x3daudio1_5 enable_x3daudio1_5 -wine_fn_config_makefile dlls/x3daudio1_6 enable_x3daudio1_6 -wine_fn_config_makefile dlls/x3daudio1_7 enable_x3daudio1_7 -wine_fn_config_makefile dlls/xactengine2_0 enable_xactengine2_0 -wine_fn_config_makefile dlls/xactengine2_4 enable_xactengine2_4 -wine_fn_config_makefile dlls/xactengine2_7 enable_xactengine2_7 -wine_fn_config_makefile dlls/xactengine2_9 enable_xactengine2_9 -wine_fn_config_makefile dlls/xactengine3_0 enable_xactengine3_0 -wine_fn_config_makefile dlls/xactengine3_1 enable_xactengine3_1 -wine_fn_config_makefile dlls/xactengine3_2 enable_xactengine3_2 -wine_fn_config_makefile dlls/xactengine3_3 enable_xactengine3_3 -wine_fn_config_makefile dlls/xactengine3_4 enable_xactengine3_4 -wine_fn_config_makefile dlls/xactengine3_5 enable_xactengine3_5 -wine_fn_config_makefile dlls/xactengine3_6 enable_xactengine3_6 -wine_fn_config_makefile dlls/xactengine3_7 enable_xactengine3_7 -wine_fn_config_makefile dlls/xactengine3_7/tests enable_tests -wine_fn_config_makefile dlls/xapofx1_1 enable_xapofx1_1 -wine_fn_config_makefile dlls/xapofx1_2 enable_xapofx1_2 -wine_fn_config_makefile dlls/xapofx1_3 enable_xapofx1_3 -wine_fn_config_makefile dlls/xapofx1_4 enable_xapofx1_4 -wine_fn_config_makefile dlls/xapofx1_5 enable_xapofx1_5 -wine_fn_config_makefile dlls/xaudio2_0 enable_xaudio2_0 -wine_fn_config_makefile dlls/xaudio2_1 enable_xaudio2_1 -wine_fn_config_makefile dlls/xaudio2_2 enable_xaudio2_2 -wine_fn_config_makefile dlls/xaudio2_3 enable_xaudio2_3 -wine_fn_config_makefile dlls/xaudio2_4 enable_xaudio2_4 -wine_fn_config_makefile dlls/xaudio2_5 enable_xaudio2_5 -wine_fn_config_makefile dlls/xaudio2_6 enable_xaudio2_6 -wine_fn_config_makefile dlls/xaudio2_7 enable_xaudio2_7 -wine_fn_config_makefile dlls/xaudio2_7/tests enable_tests -wine_fn_config_makefile dlls/xaudio2_8 enable_xaudio2_8 -wine_fn_config_makefile dlls/xaudio2_8/tests enable_tests -wine_fn_config_makefile dlls/xaudio2_9 enable_xaudio2_9 -wine_fn_config_makefile dlls/xinput1_1 enable_xinput1_1 -wine_fn_config_makefile dlls/xinput1_2 enable_xinput1_2 -wine_fn_config_makefile dlls/xinput1_3 enable_xinput1_3 -wine_fn_config_makefile dlls/xinput1_3/tests enable_tests -wine_fn_config_makefile dlls/xinput1_4 enable_xinput1_4 -wine_fn_config_makefile dlls/xinput9_1_0 enable_xinput9_1_0 -wine_fn_config_makefile dlls/xinputuap enable_xinputuap -wine_fn_config_makefile dlls/xmllite enable_xmllite -wine_fn_config_makefile dlls/xmllite/tests enable_tests -wine_fn_config_makefile dlls/xolehlp enable_xolehlp -wine_fn_config_makefile dlls/xpsprint enable_xpsprint -wine_fn_config_makefile dlls/xpssvcs enable_xpssvcs -wine_fn_config_makefile fonts enable_fonts -wine_fn_config_makefile include enable_include -wine_fn_config_makefile libs/adsiid enable_adsiid -wine_fn_config_makefile libs/dmoguids enable_dmoguids -wine_fn_config_makefile libs/dxerr8 enable_dxerr8 -wine_fn_config_makefile libs/dxerr9 enable_dxerr9 -wine_fn_config_makefile libs/dxguid enable_dxguid -wine_fn_config_makefile libs/faudio enable_faudio -wine_fn_config_makefile libs/fluidsynth enable_fluidsynth -wine_fn_config_makefile libs/gsm enable_gsm -wine_fn_config_makefile libs/jpeg enable_jpeg -wine_fn_config_makefile libs/jxr enable_jxr -wine_fn_config_makefile libs/lcms2 enable_lcms2 -wine_fn_config_makefile libs/ldap enable_ldap -wine_fn_config_makefile libs/mfuuid enable_mfuuid -wine_fn_config_makefile libs/mpg123 enable_mpg123 -wine_fn_config_makefile libs/musl enable_musl -wine_fn_config_makefile libs/png enable_png -wine_fn_config_makefile libs/strmbase enable_strmbase -wine_fn_config_makefile libs/strmiids enable_strmiids -wine_fn_config_makefile libs/tiff enable_tiff -wine_fn_config_makefile libs/uuid enable_uuid -wine_fn_config_makefile libs/vkd3d enable_vkd3d -wine_fn_config_makefile libs/wbemuuid enable_wbemuuid -wine_fn_config_makefile libs/wmcodecdspuuid enable_wmcodecdspuuid -wine_fn_config_makefile libs/xml2 enable_xml2 -wine_fn_config_makefile libs/xslt enable_xslt -wine_fn_config_makefile libs/zlib enable_zlib -wine_fn_config_makefile libs/zydis enable_zydis -wine_fn_config_makefile loader enable_loader -wine_fn_config_makefile nls enable_nls -wine_fn_config_makefile po enable_po -wine_fn_config_makefile programs/arp enable_arp -wine_fn_config_makefile programs/aspnet_regiis enable_aspnet_regiis -wine_fn_config_makefile programs/attrib enable_attrib -wine_fn_config_makefile programs/cabarc enable_cabarc -wine_fn_config_makefile programs/cacls enable_cacls -wine_fn_config_makefile programs/certutil enable_certutil -wine_fn_config_makefile programs/chcp.com enable_chcp_com -wine_fn_config_makefile programs/clock enable_clock -wine_fn_config_makefile programs/cmd enable_cmd -wine_fn_config_makefile programs/cmd/tests enable_tests -wine_fn_config_makefile programs/conhost enable_conhost -wine_fn_config_makefile programs/conhost/tests enable_tests -wine_fn_config_makefile programs/control enable_control -wine_fn_config_makefile programs/cscript enable_cscript -wine_fn_config_makefile programs/dism enable_dism -wine_fn_config_makefile programs/dllhost enable_dllhost -wine_fn_config_makefile programs/dplaysvr enable_dplaysvr -wine_fn_config_makefile programs/dpnsvr enable_dpnsvr -wine_fn_config_makefile programs/dpvsetup enable_dpvsetup -wine_fn_config_makefile programs/dxdiag enable_dxdiag -wine_fn_config_makefile programs/eject enable_eject -wine_fn_config_makefile programs/expand enable_expand -wine_fn_config_makefile programs/explorer enable_explorer -wine_fn_config_makefile programs/explorer/tests enable_tests -wine_fn_config_makefile programs/extrac32 enable_extrac32 -wine_fn_config_makefile programs/fc enable_fc -wine_fn_config_makefile programs/find enable_find -wine_fn_config_makefile programs/find/tests enable_tests -wine_fn_config_makefile programs/findstr enable_findstr -wine_fn_config_makefile programs/findstr/tests enable_tests -wine_fn_config_makefile programs/fsutil enable_fsutil -wine_fn_config_makefile programs/fsutil/tests enable_tests -wine_fn_config_makefile programs/hh enable_hh -wine_fn_config_makefile programs/hostname enable_hostname -wine_fn_config_makefile programs/icacls enable_icacls -wine_fn_config_makefile programs/icinfo enable_icinfo -wine_fn_config_makefile programs/iexplore enable_iexplore -wine_fn_config_makefile programs/ipconfig enable_ipconfig -wine_fn_config_makefile programs/klist enable_klist -wine_fn_config_makefile programs/lodctr enable_lodctr -wine_fn_config_makefile programs/mofcomp enable_mofcomp -wine_fn_config_makefile programs/mshta enable_mshta -wine_fn_config_makefile programs/msidb enable_msidb -wine_fn_config_makefile programs/msiexec enable_msiexec -wine_fn_config_makefile programs/msinfo32 enable_msinfo32 -wine_fn_config_makefile programs/net enable_net -wine_fn_config_makefile programs/netsh enable_netsh -wine_fn_config_makefile programs/netstat enable_netstat -wine_fn_config_makefile programs/ngen enable_ngen -wine_fn_config_makefile programs/notepad enable_notepad -wine_fn_config_makefile programs/oleview enable_oleview -wine_fn_config_makefile programs/ping enable_ping -wine_fn_config_makefile programs/plugplay enable_plugplay -wine_fn_config_makefile programs/pnputil enable_pnputil -wine_fn_config_makefile programs/powershell enable_powershell -wine_fn_config_makefile programs/presentationfontcache enable_presentationfontcache -wine_fn_config_makefile programs/progman enable_progman -wine_fn_config_makefile programs/reg enable_reg -wine_fn_config_makefile programs/reg/tests enable_tests -wine_fn_config_makefile programs/regasm enable_regasm -wine_fn_config_makefile programs/regedit enable_regedit -wine_fn_config_makefile programs/regedit/tests enable_tests -wine_fn_config_makefile programs/regini enable_regini -wine_fn_config_makefile programs/regsvcs enable_regsvcs -wine_fn_config_makefile programs/regsvr32 enable_regsvr32 -wine_fn_config_makefile programs/robocopy enable_robocopy -wine_fn_config_makefile programs/rpcss enable_rpcss -wine_fn_config_makefile programs/rundll.exe16 enable_win16 -wine_fn_config_makefile programs/rundll32 enable_rundll32 -wine_fn_config_makefile programs/sc enable_sc -wine_fn_config_makefile programs/sc/tests enable_tests -wine_fn_config_makefile programs/schtasks enable_schtasks -wine_fn_config_makefile programs/schtasks/tests enable_tests -wine_fn_config_makefile programs/sdbinst enable_sdbinst -wine_fn_config_makefile programs/secedit enable_secedit -wine_fn_config_makefile programs/servicemodelreg enable_servicemodelreg -wine_fn_config_makefile programs/services enable_services -wine_fn_config_makefile programs/services/tests enable_tests -wine_fn_config_makefile programs/setx enable_setx -wine_fn_config_makefile programs/shutdown enable_shutdown -wine_fn_config_makefile programs/spoolsv enable_spoolsv -wine_fn_config_makefile programs/start enable_start -wine_fn_config_makefile programs/subst enable_subst -wine_fn_config_makefile programs/svchost enable_svchost -wine_fn_config_makefile programs/systeminfo enable_systeminfo -wine_fn_config_makefile programs/taskkill enable_taskkill -wine_fn_config_makefile programs/tasklist enable_tasklist -wine_fn_config_makefile programs/tasklist/tests enable_tests -wine_fn_config_makefile programs/taskmgr enable_taskmgr -wine_fn_config_makefile programs/termsv enable_termsv -wine_fn_config_makefile programs/uninstaller enable_uninstaller -wine_fn_config_makefile programs/unlodctr enable_unlodctr -wine_fn_config_makefile programs/view enable_view -wine_fn_config_makefile programs/wevtutil enable_wevtutil -wine_fn_config_makefile programs/where enable_where -wine_fn_config_makefile programs/whoami enable_whoami -wine_fn_config_makefile programs/wineboot enable_wineboot -wine_fn_config_makefile programs/winebrowser enable_winebrowser -wine_fn_config_makefile programs/winecfg enable_winecfg -wine_fn_config_makefile programs/wineconsole enable_wineconsole -wine_fn_config_makefile programs/winedbg enable_winedbg -wine_fn_config_makefile programs/winedevice enable_winedevice -wine_fn_config_makefile programs/winefile enable_winefile -wine_fn_config_makefile programs/winemenubuilder enable_winemenubuilder -wine_fn_config_makefile programs/winemine enable_winemine -wine_fn_config_makefile programs/winemsibuilder enable_winemsibuilder -wine_fn_config_makefile programs/winepath enable_winepath -wine_fn_config_makefile programs/winetest enable_winetest -wine_fn_config_makefile programs/winevdm enable_win16 -wine_fn_config_makefile programs/winhelp.exe16 enable_win16 -wine_fn_config_makefile programs/winhlp32 enable_winhlp32 -wine_fn_config_makefile programs/winmgmt enable_winmgmt -wine_fn_config_makefile programs/winoldap.mod16 enable_win16 -wine_fn_config_makefile programs/winver enable_winver -wine_fn_config_makefile programs/wmic enable_wmic -wine_fn_config_makefile programs/wmplayer enable_wmplayer -wine_fn_config_makefile programs/wordpad enable_wordpad -wine_fn_config_makefile programs/write enable_write -wine_fn_config_makefile programs/wscript enable_wscript -wine_fn_config_makefile programs/wscript/tests enable_tests -wine_fn_config_makefile programs/wuauserv enable_wuauserv -wine_fn_config_makefile programs/wusa enable_wusa -wine_fn_config_makefile programs/xcopy enable_xcopy -wine_fn_config_makefile programs/xcopy/tests enable_tests -wine_fn_config_makefile server enable_server -test "x$enable_tools" = xno || wine_fn_config_makefile tools enable_tools -test "x$enable_tools" = xno || wine_fn_config_makefile tools/sfnt2fon enable_sfnt2fon -test "x$enable_tools" = xno || wine_fn_config_makefile tools/widl enable_widl -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winebuild enable_winebuild -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winedump enable_winedump -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winegcc enable_winegcc -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winemaker enable_winemaker -test "x$enable_tools" = xno || wine_fn_config_makefile tools/wmc enable_wmc -test "x$enable_tools" = xno || wine_fn_config_makefile tools/wrc enable_wrc - - -as_fn_append CONFIGURE_TARGETS " TAGS" -as_fn_append CONFIGURE_TARGETS " tags" -as_fn_append CONFIGURE_TARGETS " autom4te.cache" -as_fn_append CONFIGURE_TARGETS " config.log" -as_fn_append CONFIGURE_TARGETS " config.status" -as_fn_append CONFIGURE_TARGETS " include/config.h" -as_fn_append CONFIGURE_TARGETS " include/stamp-h" -test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine" - -if test "x$enable_tools" != xno -then - as_fn_append CONFIGURE_TARGETS " tools/makedep$ac_exeext" - ac_config_commands="$ac_config_commands tools/makedep" - -fi - -ac_config_commands="$ac_config_commands Makefile" - - - -SHELL=/bin/sh - - -as_fn_append wine_rules " -all: wine - @echo \"Wine build complete.\" -.INIT: Makefile -.MAKEFILEDEPS: -all: Makefile -Makefile: config.status \$(MAKEDEP) - @./config.status Makefile -depend: \$(MAKEDEP) - \$(MAKEDEP)$makedep_flags" - - -as_fn_append wine_rules " -config.status: ${wine_srcdir}configure - @./config.status --recheck -include/config.h: include/stamp-h -include/stamp-h: ${wine_srcdir}include/config.h.in config.status - @./config.status include/config.h include/stamp-h" - -if test "x$enable_maintainer_mode" = xyes -then - as_fn_append wine_rules " -configure: configure.ac aclocal.m4 - autoconf --warnings=all -include/config.h.in: include/stamp-h.in -include/stamp-h.in: configure.ac aclocal.m4 - autoheader --warnings=all - @echo timestamp > \$@" -fi - -if test "x$enable_tools" != xno -then - as_fn_append wine_rules " -tools/makedep$ac_exeext: ${wine_srcdir}tools/makedep.c include/config.h config.status - @./config.status tools/makedep -Makefile: tools/makedep$ac_exeext" -else - as_fn_append wine_rules " -\$(MAKEDEP): - @echo \"You need to run make in $toolsdir first\" && false" -fi - - -if test -n "$with_wine64" -then - case "$with_wine64" in - /*) reldir="" ;; - *) reldir="../" ;; - esac - rm -f fonts server 2>/dev/null - as_fn_append wine_rules " -all: loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader -loader/wine64 loader/wine64-preloader: - rm -f \$@ && \$(LN_S) $reldir$with_wine64/\$@ \$@ -$with_wine64/loader/wine: - rm -f \$@ && \$(LN_S) $ac_pwd/loader/wine \$@ -$with_wine64/loader/wine-preloader: - rm -f \$@ && \$(LN_S) $ac_pwd/loader/wine-preloader \$@ -clean:: - rm -f loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader" -else - TOP_INSTALL_DEV="$TOP_INSTALL_DEV include" - TOP_INSTALL_LIB="$TOP_INSTALL_LIB \ -fonts \ -loader/wine.inf \ -nls \ -programs/msidb/msidb \ -programs/msiexec/msiexec \ -programs/notepad/notepad \ -programs/regedit/regedit \ -programs/regsvr32/regsvr32 \ -programs/wineboot/wineboot \ -programs/winecfg/winecfg \ -programs/wineconsole/wineconsole \ -programs/winedbg/winedbg \ -programs/winefile/winefile \ -programs/winemine/winemine \ -programs/winepath/winepath \ -server/wineserver" - - case $host_os in - cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;; - *) TOP_INSTALL_LIB="$TOP_INSTALL_LIB loader/wine.desktop" ;; - esac -fi - - -as_fn_append wine_rules " -distclean:: clean - rm -rf autom4te.cache -maintainer-clean:: - rm -f configure include/config.h.in" - - -as_fn_append wine_rules " -dlls/ntdll/unix/version.c: dummy - @version=\`(GIT_DIR=${wine_srcdir}.git git describe HEAD 2>/dev/null || echo \"wine-\$(PACKAGE_VERSION)\") | sed -n -e '\$\$s/\(.*\)/const char wine_build[] = \"\\1\";/p'\` && (echo \$\$version | cmp -s - \$@) || echo \$\$version >\$@ || (rm -f \$@ && exit 1) -programs/winetest/build.rc: dummy - @build=\"STRINGTABLE { 1 \\\"\`GIT_DIR=${wine_srcdir}.git git rev-parse HEAD 2>/dev/null\`\\\" }\" && (echo \$\$build | cmp -s - \$@) || echo \$\$build >\$@ || (rm -f \$@ && exit 1) -programs/winetest/build.nfo: - @-\$(CC) -v 2>\$@ -dlls/wineandroid.drv/wine-debug.apk: dlls/wineandroid.drv/build.gradle ${wine_srcdir}dlls/wineandroid.drv/AndroidManifest.xml ${wine_srcdir}dlls/wineandroid.drv/WineActivity.java ${wine_srcdir}dlls/wineandroid.drv/wine.svg - cd dlls/wineandroid.drv && gradle -q -Psrcdir=$srcdir assembleDebug - mv dlls/wineandroid.drv/build/outputs/apk/wine-debug.apk \$@" - - -TAGSFLAGS="--langmap='c:+.idl.l.rh,make:(Make*.in)'" - -as_fn_append wine_rules " -TAGS etags: - rm -f TAGS - (test -d .git && git ls-files || find -L $srcdir -name '*.[ch]' -print) | xargs etags -a \$(TAGSFLAGS) -tags ctags: - rm -f tags - (test -d .git && git ls-files || find -L $srcdir -name '*.[ch]' -print) | xargs ctags -a \$(TAGSFLAGS) -dummy: -.PHONY: depend dummy install-manpages" - -printf "%s\n" " done" >&6 -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by Wine $as_me 9.0, which was -generated by GNU Autoconf 2.71. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_headers="$ac_config_headers" -config_links="$ac_config_links" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration headers: -$config_headers - -Configuration links: -$config_links - -Configuration commands: -$config_commands - -Report bugs to . -Wine home page: ." - -_ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' -ac_cs_version="\\ -Wine config.status 9.0 -configured by $0, generated by GNU Autoconf 2.71, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2021 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - printf "%s\n" "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -wine_fn_output_makedep () -{ - as_dir=tools; as_fn_mkdir_p - $CC -I${wine_srcdir}tools -Iinclude -I${wine_srcdir}include -D__WINESRC__ -DWINE_UNIX_LIB $EXTRACFLAGS $CPPFLAGS $CFLAGS -o tools/makedep$ac_exeext ${wine_srcdir}tools/makedep.c $LDFLAGS -} -wine_fn_output_makefile () -{ - cat <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$1 && "$wine_makedep"$makedep_flags && return -# This Makefile understands the following targets: -# -# all (default): build wine -# clean: remove all intermediate files -# distclean: also remove all files created by configure -# test: run tests -# testclean: clean test results to force running all tests again -# install-lib: install libraries needed to run applications -# install-dev: install development environment -# install: install everything -# uninstall: uninstall everything -# ctags: create a tags file for vim and others. -# etags: create a TAGS file for Emacs. - -SHELL = $SHELL -PATH_SEPARATOR = $PATH_SEPARATOR -PACKAGE_NAME = $PACKAGE_NAME -PACKAGE_TARNAME = $PACKAGE_TARNAME -PACKAGE_VERSION = $PACKAGE_VERSION -PACKAGE_STRING = $PACKAGE_STRING -PACKAGE_BUGREPORT = $PACKAGE_BUGREPORT -PACKAGE_URL = $PACKAGE_URL -exec_prefix = $exec_prefix -prefix = $prefix -program_transform_name = $program_transform_name -bindir = $bindir -sbindir = $sbindir -libexecdir = $libexecdir -datarootdir = $datarootdir -datadir = $datadir -sysconfdir = $sysconfdir -sharedstatedir = $sharedstatedir -localstatedir = $localstatedir -runstatedir = $runstatedir -includedir = $includedir -oldincludedir = $oldincludedir -docdir = $docdir -infodir = $infodir -htmldir = $htmldir -dvidir = $dvidir -pdfdir = $pdfdir -psdir = $psdir -libdir = $libdir -localedir = $localedir -mandir = $mandir -DEFS = $DEFS -ECHO_C = $ECHO_C -ECHO_N = $ECHO_N -ECHO_T = $ECHO_T -LIBS = $LIBS -build_alias = $build_alias -host_alias = $host_alias -target_alias = $target_alias -system_dllpath = $system_dllpath -build = $build -build_cpu = $build_cpu -build_vendor = $build_vendor -build_os = $build_os -host = $host -host_cpu = $host_cpu -host_vendor = $host_vendor -host_os = $host_os -dlldir = $dlldir -fontdir = $fontdir -nlsdir = $nlsdir -srcdir = $srcdir -SET_MAKE = $SET_MAKE -CC = $CC -CFLAGS = $CFLAGS -LDFLAGS = $LDFLAGS -CPPFLAGS = $CPPFLAGS -ac_ct_CC = $ac_ct_CC -EXEEXT = $EXEEXT -OBJEXT = $OBJEXT -CXX = $CXX -CXXFLAGS = $CXXFLAGS -ac_ct_CXX = $ac_ct_CXX -CPPBIN = $CPPBIN -LD = $LD -TARGETFLAGS = $TARGETFLAGS -toolsext = $toolsext -HOST_ARCH = $HOST_ARCH -aarch64_CC = $aarch64_CC -aarch64_CFLAGS = $aarch64_CFLAGS -aarch64_EXTRACFLAGS = $aarch64_EXTRACFLAGS -aarch64_LDFLAGS = $aarch64_LDFLAGS -aarch64_DEBUG = $aarch64_DEBUG -aarch64_TARGET = $aarch64_TARGET -aarch64_DELAYLOADFLAG = $aarch64_DELAYLOADFLAG -aarch64_DISABLED_SUBDIRS = $aarch64_DISABLED_SUBDIRS -arm_CC = $arm_CC -arm_CFLAGS = $arm_CFLAGS -arm_EXTRACFLAGS = $arm_EXTRACFLAGS -arm_LDFLAGS = $arm_LDFLAGS -arm_DEBUG = $arm_DEBUG -arm_TARGET = $arm_TARGET -arm_DELAYLOADFLAG = $arm_DELAYLOADFLAG -arm_DISABLED_SUBDIRS = $arm_DISABLED_SUBDIRS -arm64ec_CC = $arm64ec_CC -arm64ec_CFLAGS = $arm64ec_CFLAGS -arm64ec_EXTRACFLAGS = $arm64ec_EXTRACFLAGS -arm64ec_LDFLAGS = $arm64ec_LDFLAGS -arm64ec_DEBUG = $arm64ec_DEBUG -arm64ec_TARGET = $arm64ec_TARGET -arm64ec_DELAYLOADFLAG = $arm64ec_DELAYLOADFLAG -arm64ec_DISABLED_SUBDIRS = $arm64ec_DISABLED_SUBDIRS -i386_CC = $i386_CC -i386_CFLAGS = $i386_CFLAGS -i386_EXTRACFLAGS = $i386_EXTRACFLAGS -i386_LDFLAGS = $i386_LDFLAGS -i386_DEBUG = $i386_DEBUG -i386_TARGET = $i386_TARGET -i386_DELAYLOADFLAG = $i386_DELAYLOADFLAG -i386_DISABLED_SUBDIRS = $i386_DISABLED_SUBDIRS -x86_64_CC = $x86_64_CC -x86_64_CFLAGS = $x86_64_CFLAGS -x86_64_EXTRACFLAGS = $x86_64_EXTRACFLAGS -x86_64_LDFLAGS = $x86_64_LDFLAGS -x86_64_DEBUG = $x86_64_DEBUG -x86_64_TARGET = $x86_64_TARGET -x86_64_DELAYLOADFLAG = $x86_64_DELAYLOADFLAG -x86_64_DISABLED_SUBDIRS = $x86_64_DISABLED_SUBDIRS -toolsdir = $toolsdir -MAKEDEP = $MAKEDEP -RUNTESTFLAGS = $RUNTESTFLAGS -SED_CMD = $SED_CMD -FLEX = $FLEX -BISON = $BISON -AR = $AR -ac_ct_AR = $ac_ct_AR -STRIP = $STRIP -RANLIB = $RANLIB -LN_S = $LN_S -GREP = $GREP -EGREP = $EGREP -LDCONFIG = $LDCONFIG -MSGFMT = $MSGFMT -PKG_CONFIG = $PKG_CONFIG -FONTFORGE = $FONTFORGE -RSVG = $RSVG -CONVERT = $CONVERT -ICOTOOL = $ICOTOOL -I386_LIBS = $I386_LIBS -OPENGL_LIBS = $OPENGL_LIBS -DLLFLAGS = $DLLFLAGS -LDDLLFLAGS = $LDDLLFLAGS -LDEXECFLAGS = $LDEXECFLAGS -EXTRACFLAGS = $EXTRACFLAGS -UNIXDLLFLAGS = $UNIXDLLFLAGS -UNIXLDFLAGS = $UNIXLDFLAGS -TOP_INSTALL_LIB = $TOP_INSTALL_LIB -TOP_INSTALL_DEV = $TOP_INSTALL_DEV -WINELOADER_LDFLAGS = $WINELOADER_LDFLAGS -WINEPRELOADER_LDFLAGS = $WINEPRELOADER_LDFLAGS -DLLEXT = $DLLEXT -LDD = $LDD -OTOOL = $OTOOL -READELF = $READELF -SUBDIRS = $SUBDIRS -DISABLED_SUBDIRS = $DISABLED_SUBDIRS -CONFIGURE_TARGETS = $CONFIGURE_TARGETS -CARBON_LIBS = $CARBON_LIBS -COREFOUNDATION_LIBS = $COREFOUNDATION_LIBS -DISKARBITRATION_LIBS = $DISKARBITRATION_LIBS -IOKIT_LIBS = $IOKIT_LIBS -METAL_LIBS = $METAL_LIBS -APPLICATIONSERVICES_LIBS = $APPLICATIONSERVICES_LIBS -CORESERVICES_LIBS = $CORESERVICES_LIBS -APPKIT_LIBS = $APPKIT_LIBS -SECURITY_LIBS = $SECURITY_LIBS -SYSTEMCONFIGURATION_LIBS = $SYSTEMCONFIGURATION_LIBS -COREAUDIO_LIBS = $COREAUDIO_LIBS -OPENCL_LIBS = $OPENCL_LIBS -OBJC = $OBJC -OBJCFLAGS = $OBJCFLAGS -ac_ct_OBJC = $ac_ct_OBJC -WINELOADER_DEPENDS = $WINELOADER_DEPENDS -PE_ARCHS = $PE_ARCHS -MINGW_PKG_CONFIG = $MINGW_PKG_CONFIG -FAUDIO_PE_CFLAGS = $FAUDIO_PE_CFLAGS -FAUDIO_PE_LIBS = $FAUDIO_PE_LIBS -FLUIDSYNTH_PE_CFLAGS = $FLUIDSYNTH_PE_CFLAGS -FLUIDSYNTH_PE_LIBS = $FLUIDSYNTH_PE_LIBS -GSM_PE_CFLAGS = $GSM_PE_CFLAGS -GSM_PE_LIBS = $GSM_PE_LIBS -JPEG_PE_CFLAGS = $JPEG_PE_CFLAGS -JPEG_PE_LIBS = $JPEG_PE_LIBS -JXR_PE_CFLAGS = $JXR_PE_CFLAGS -JXR_PE_LIBS = $JXR_PE_LIBS -LCMS2_PE_CFLAGS = $LCMS2_PE_CFLAGS -LCMS2_PE_LIBS = $LCMS2_PE_LIBS -LDAP_PE_CFLAGS = $LDAP_PE_CFLAGS -LDAP_PE_LIBS = $LDAP_PE_LIBS -MPG123_PE_CFLAGS = $MPG123_PE_CFLAGS -MPG123_PE_LIBS = $MPG123_PE_LIBS -MUSL_PE_CFLAGS = $MUSL_PE_CFLAGS -MUSL_PE_LIBS = $MUSL_PE_LIBS -PNG_PE_CFLAGS = $PNG_PE_CFLAGS -PNG_PE_LIBS = $PNG_PE_LIBS -TIFF_PE_CFLAGS = $TIFF_PE_CFLAGS -TIFF_PE_LIBS = $TIFF_PE_LIBS -VKD3D_PE_CFLAGS = $VKD3D_PE_CFLAGS -VKD3D_PE_LIBS = $VKD3D_PE_LIBS -XML2_PE_CFLAGS = $XML2_PE_CFLAGS -XML2_PE_LIBS = $XML2_PE_LIBS -XSLT_PE_CFLAGS = $XSLT_PE_CFLAGS -XSLT_PE_LIBS = $XSLT_PE_LIBS -ZLIB_PE_CFLAGS = $ZLIB_PE_CFLAGS -ZLIB_PE_LIBS = $ZLIB_PE_LIBS -ZYDIS_PE_CFLAGS = $ZYDIS_PE_CFLAGS -ZYDIS_PE_LIBS = $ZYDIS_PE_LIBS -PTHREAD_LIBS = $PTHREAD_LIBS -XMKMF = $XMKMF -CPP = $CPP -X_CFLAGS = $X_CFLAGS -X_PRE_LIBS = $X_PRE_LIBS -X_LIBS = $X_LIBS -X_EXTRA_LIBS = $X_EXTRA_LIBS -WAYLAND_CLIENT_CFLAGS = $WAYLAND_CLIENT_CFLAGS -WAYLAND_CLIENT_LIBS = $WAYLAND_CLIENT_LIBS -WAYLAND_SCANNER = $WAYLAND_SCANNER -XKBCOMMON_CFLAGS = $XKBCOMMON_CFLAGS -XKBCOMMON_LIBS = $XKBCOMMON_LIBS -XKBREGISTRY_CFLAGS = $XKBREGISTRY_CFLAGS -XKBREGISTRY_LIBS = $XKBREGISTRY_LIBS -PCAP_LIBS = $PCAP_LIBS -PCSCLITE_LIBS = $PCSCLITE_LIBS -INOTIFY_CFLAGS = $INOTIFY_CFLAGS -INOTIFY_LIBS = $INOTIFY_LIBS -DBUS_CFLAGS = $DBUS_CFLAGS -DBUS_LIBS = $DBUS_LIBS -GNUTLS_CFLAGS = $GNUTLS_CFLAGS -GNUTLS_LIBS = $GNUTLS_LIBS -SANE_CFLAGS = $SANE_CFLAGS -SANE_LIBS = $SANE_LIBS -USB_CFLAGS = $USB_CFLAGS -USB_LIBS = $USB_LIBS -GPHOTO2_CFLAGS = $GPHOTO2_CFLAGS -GPHOTO2_LIBS = $GPHOTO2_LIBS -GPHOTO2_PORT_CFLAGS = $GPHOTO2_PORT_CFLAGS -GPHOTO2_PORT_LIBS = $GPHOTO2_PORT_LIBS -RESOLV_LIBS = $RESOLV_LIBS -FREETYPE_CFLAGS = $FREETYPE_CFLAGS -FREETYPE_LIBS = $FREETYPE_LIBS -GETTEXTPO_LIBS = $GETTEXTPO_LIBS -PULSE_CFLAGS = $PULSE_CFLAGS -PULSE_LIBS = $PULSE_LIBS -GSTREAMER_CFLAGS = $GSTREAMER_CFLAGS -GSTREAMER_LIBS = $GSTREAMER_LIBS -ALSA_LIBS = $ALSA_LIBS -OSS4_CFLAGS = $OSS4_CFLAGS -OSS4_LIBS = $OSS4_LIBS -UDEV_CFLAGS = $UDEV_CFLAGS -UDEV_LIBS = $UDEV_LIBS -UNWIND_CFLAGS = $UNWIND_CFLAGS -UNWIND_LIBS = $UNWIND_LIBS -SDL2_CFLAGS = $SDL2_CFLAGS -SDL2_LIBS = $SDL2_LIBS -CAPI20_CFLAGS = $CAPI20_CFLAGS -CAPI20_LIBS = $CAPI20_LIBS -CUPS_CFLAGS = $CUPS_CFLAGS -CUPS_LIBS = $CUPS_LIBS -FONTCONFIG_CFLAGS = $FONTCONFIG_CFLAGS -FONTCONFIG_LIBS = $FONTCONFIG_LIBS -KRB5_CFLAGS = $KRB5_CFLAGS -KRB5_LIBS = $KRB5_LIBS -GSSAPI_CFLAGS = $GSSAPI_CFLAGS -GSSAPI_LIBS = $GSSAPI_LIBS -PROCSTAT_LIBS = $PROCSTAT_LIBS -NETAPI_CFLAGS = $NETAPI_CFLAGS -NETAPI_LIBS = $NETAPI_LIBS -MSVCRTFLAGS = $MSVCRTFLAGS -DELAYLOADFLAG = $DELAYLOADFLAG -WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS -RT_LIBS = $RT_LIBS -TAGSFLAGS = $TAGSFLAGS -LIBOBJS = $LIBOBJS -LTLIBOBJS = $LTLIBOBJS -$SET_MAKE -$wine_rules -_WINE_EOF - as_fn_error $? "could not create Makefile" "$LINENO" 5 -} - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; - "include/stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/stamp-h" ;; - "wine") CONFIG_LINKS="$CONFIG_LINKS wine:tools/winewrapper" ;; - "wine64") CONFIG_LINKS="$CONFIG_LINKS wine64:tools/winewrapper" ;; - "tools/makedep") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/makedep" ;; - "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - :L) - # - # CONFIG_LINK - # - - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 -printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - as_fn_error $? "$ac_source: file not found" "$LINENO" 5 - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $ac_source in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 - fi - ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "include/stamp-h":C) echo timestamp > include/stamp-h ;; - "tools/makedep":C) wine_fn_output_makedep || as_fn_exit $? ;; - "Makefile":C) wine_fn_output_makefile Makefile ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -if test "$no_create" = "yes" -then - exit 0 -fi - -ac_save_IFS="$IFS" -if test "x$wine_notices" != x; then - echo >&6 - IFS="|" - for msg in $wine_notices; do - IFS="$ac_save_IFS" - if ${msg:+false} : -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $msg" >&5 -printf "%s\n" "$as_me: $msg" >&6;} -fi - done -fi -IFS="|" -for msg in $wine_warnings; do - IFS="$ac_save_IFS" - if ${msg:+false} : -then : - -else $as_nop - echo >&2 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $msg" >&5 -printf "%s\n" "$as_me: WARNING: $msg" >&2;} -fi -done -IFS="$ac_save_IFS" - -printf "%s\n" " -$as_me: Finished. Do '${ac_make}' to compile Wine. -" >&6 - - diff --git a/configure.ac b/configure.ac index cba55126869..708c8269fc2 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms])) AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig])) AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library])) +AC_ARG_WITH(gcrypt, AS_HELP_STRING([--without-gcrypt],[do not use libgcrypt])) AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext])) AC_ARG_WITH(gettextpo, AS_HELP_STRING([--with-gettextpo],[use the GetTextPO library to rebuild po files]), [if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi]) @@ -59,6 +60,7 @@ AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug an AC_ARG_WITH(unwind, AS_HELP_STRING([--without-unwind],[do not use the libunwind library (exception handling)])) AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb library])) AC_ARG_WITH(v4l2, AS_HELP_STRING([--without-v4l2],[do not use v4l2 (video capture)])) +AC_ARG_WITH(vosk, AS_HELP_STRING([--without-vosk],[do not use Vosk])) AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan])) AC_ARG_WITH(wayland, AS_HELP_STRING([--without-wayland],[do not build the Wayland driver])) AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), @@ -424,12 +426,14 @@ AC_CHECK_HEADERS(\ link.h \ linux/cdrom.h \ linux/filter.h \ + linux/futex.h \ linux/hdreg.h \ linux/hidraw.h \ linux/input.h \ linux/ioctl.h \ linux/major.h \ linux/param.h \ + linux/seccomp.h \ linux/serial.h \ linux/types.h \ linux/ucdrom.h \ @@ -458,6 +462,7 @@ AC_CHECK_HEADERS(\ sys/cdio.h \ sys/epoll.h \ sys/event.h \ + sys/eventfd.h \ sys/extattr.h \ sys/filio.h \ sys/ipc.h \ @@ -488,7 +493,8 @@ AC_CHECK_HEADERS(\ syscall.h \ utime.h \ valgrind/memcheck.h \ - valgrind/valgrind.h + valgrind/valgrind.h \ + vosk_api.h ) WINE_HEADER_MAJOR() AC_HEADER_STAT() @@ -817,6 +823,7 @@ enable_winemac_drv=${enable_winemac_drv:-no} dnl Check for cross compiler(s) AC_SUBST(PE_ARCHS,"") +AC_SUBST(MSHTML_CFLAGS,"") cross_archs= AS_VAR_SET_IF([enable_archs], [test "x$with_system_dllpath" = "x" || AC_MSG_ERROR("The --with-system-dllpath option is not compatible with --enable-archs") @@ -999,6 +1006,8 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-Wlogical-op]) WINE_TRY_PE_CFLAGS([-Wabsolute-value]) WINE_TRY_PE_CFLAGS([-Wenum-conversion]) + WINE_TRY_PE_CFLAGS([-Wno-misleading-indentation], + [AS_VAR_APPEND([MSHTML_CFLAGS],[" -Wno-misleading-indentation"])]) case $wine_arch in i386) WINE_TRY_PE_CFLAGS([-fno-omit-frame-pointer]) @@ -1229,6 +1238,7 @@ then dnl *** All of the following tests require X11/Xlib.h AC_CHECK_HEADERS([X11/extensions/shape.h \ + X11/extensions/XInput.h \ X11/extensions/XInput2.h \ X11/extensions/XShm.h \ X11/extensions/Xfixes.h \ @@ -1482,6 +1492,23 @@ fi WINE_WARNING_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"], [libgnutls ${notice_platform}development files not found, no schannel support.]) +dnl **** Check for libdrm **** +WINE_PACKAGE_FLAGS(DRM,[libdrm],,,, + [AC_CHECK_HEADERS([xf86drm.h], + [WINE_CHECK_SONAME(drm,drmOpen,,,[$DRM_LIBS])])]) + +WINE_PACKAGE_FLAGS(DRMAMDGPU,[libdrm_amdgpu],,,, + [AC_CHECK_HEADERS([amdgpu_drm.h], + [WINE_CHECK_SONAME(drm_amdgpu,amdgpu_query_info,,,[$DRMAMDGPU_LIBS])])]) + +dnl **** Check for libgmp **** +if test "x$with_gnutls" != "xno" +then + WINE_PACKAGE_FLAGS(GMP,[gmp],[-lgmp],,, + [AC_CHECK_HEADERS([gmp.h], + [WINE_CHECK_SONAME(gmp,__gmpz_init,,[GMP_CFLAGS=""],[$GMP_LIBS],[[libgmp-*]])])]) +fi + dnl **** Check for SANE **** if test "x$with_sane" != "xno" then @@ -1636,7 +1663,7 @@ WINE_NOTICE_WITH(pulse, [test -z "$PULSE_LIBS"], dnl **** Check for gstreamer **** if test "x$with_gstreamer" != "xno" then - WINE_PACKAGE_FLAGS(GSTREAMER,[gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0],,,, + WINE_PACKAGE_FLAGS(GSTREAMER,[gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 gstreamer-gl-1.0],,,, [AC_CHECK_HEADER([gst/gst.h], [AC_MSG_CHECKING([whether gint64 defined by gst/gst.h is indeed 64-bit]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], @@ -1850,6 +1877,14 @@ then WINE_WARNING([No sound system was found. Windows applications will be silent.]) fi +dnl **** Check for Vosk **** +if test x$with_vosk != xno +then + WINE_CHECK_SONAME(vosk,vosk_recognizer_new) +fi +WINE_NOTICE_WITH(vosk,[test x$ac_cv_lib_soname_vosk = x], + [libvosk ${notice_platform}development files not found, speech recognition won't be supported.]) + dnl *** Check for Vulkan *** if test "x$with_vulkan" != "xno" then @@ -1862,6 +1897,19 @@ fi WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x"], [libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported.]) +dnl **** Check for gcrypt **** +if test "x$with_gcrypt" != "xno" +then + WINE_PACKAGE_FLAGS(GCRYPT,[libgcrypt],,,, + [AC_CHECK_HEADERS([gcrypt.h]) + if test "$ac_cv_header_gcrypt_h" = "yes" + then + WINE_CHECK_SONAME(gcrypt,gcry_sexp_build,,,[$GCRYPT_LIBS]) + fi]) +fi +WINE_NOTICE_WITH(gcrypt,[test "x$ac_cv_lib_soname_gcrypt" = "x"], + [libgcrypt ${notice_platform}development files not found, GCRYPT won't be supported.]) + dnl **** Check for gcc specific options **** if test "x${GCC}" = "xyes" @@ -2083,10 +2131,12 @@ AC_CHECK_FUNCS(\ getrandom \ kqueue \ mach_continuous_time \ + memfd_create \ pipe2 \ port_create \ posix_fadvise \ posix_fallocate \ + ppoll \ prctl \ proc_pidinfo \ sched_yield \ @@ -2110,6 +2160,12 @@ case $host_os in ;; esac +ac_save_LIBS=$LIBS +AC_SEARCH_LIBS(shm_open, rt, + [AC_DEFINE(HAVE_SHM_OPEN, 1, [Define to 1 if you have the `shm_open' function.]) + test "$ac_res" = "none required" || AC_SUBST(RT_LIBS,"$ac_res")]) +LIBS=$ac_save_LIBS + AC_CACHE_CHECK([for sched_setaffinity],wine_cv_have_sched_setaffinity, AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[sched_setaffinity(0, 0, 0);]])],[wine_cv_have_sched_setaffinity=yes],[wine_cv_have_sched_setaffinity=no])) @@ -2118,6 +2174,16 @@ then AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [Define to 1 if you have the `sched_setaffinity' function.]) fi +AC_CACHE_CHECK([for setpriority],wine_cv_have_setpriority, + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[#define _GNU_SOURCE +#include +#include ]], [[setpriority(0, 0, 0);]])],[wine_cv_have_setpriority=yes],[wine_cv_have_setpriority=no])) +if test "$wine_cv_have_setpriority" = "yes" +then + AC_DEFINE(HAVE_SETPRIORITY, 1, [Define to 1 if you have the `setpriority' function.]) +fi + dnl **** Check for types **** AC_C_INLINE @@ -2409,6 +2475,7 @@ WINE_CONFIG_MAKEFILE(dlls/advapi32/tests) WINE_CONFIG_MAKEFILE(dlls/advpack) WINE_CONFIG_MAKEFILE(dlls/advpack/tests) WINE_CONFIG_MAKEFILE(dlls/amsi) +WINE_CONFIG_MAKEFILE(dlls/amd_ags_x64) WINE_CONFIG_MAKEFILE(dlls/amstream) WINE_CONFIG_MAKEFILE(dlls/amstream/tests) WINE_CONFIG_MAKEFILE(dlls/apisetschema) @@ -2416,6 +2483,7 @@ WINE_CONFIG_MAKEFILE(dlls/apphelp) WINE_CONFIG_MAKEFILE(dlls/apphelp/tests) WINE_CONFIG_MAKEFILE(dlls/appwiz.cpl) WINE_CONFIG_MAKEFILE(dlls/appxdeploymentclient) +WINE_CONFIG_MAKEFILE(dlls/atiadlxx) WINE_CONFIG_MAKEFILE(dlls/atl) WINE_CONFIG_MAKEFILE(dlls/atl/tests) WINE_CONFIG_MAKEFILE(dlls/atl100) @@ -2428,6 +2496,7 @@ WINE_CONFIG_MAKEFILE(dlls/atl90) WINE_CONFIG_MAKEFILE(dlls/atlthunk) WINE_CONFIG_MAKEFILE(dlls/atlthunk/tests) WINE_CONFIG_MAKEFILE(dlls/atmlib) +WINE_CONFIG_MAKEFILE(dlls/audioses) WINE_CONFIG_MAKEFILE(dlls/authz) WINE_CONFIG_MAKEFILE(dlls/avicap32) WINE_CONFIG_MAKEFILE(dlls/avifil32) @@ -2730,7 +2799,6 @@ WINE_CONFIG_MAKEFILE(dlls/inseng) WINE_CONFIG_MAKEFILE(dlls/iphlpapi) WINE_CONFIG_MAKEFILE(dlls/iphlpapi/tests) WINE_CONFIG_MAKEFILE(dlls/iprop) -WINE_CONFIG_MAKEFILE(dlls/ir50_32) WINE_CONFIG_MAKEFILE(dlls/irprops.cpl) WINE_CONFIG_MAKEFILE(dlls/itircl) WINE_CONFIG_MAKEFILE(dlls/itss) @@ -2952,6 +3020,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe) WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe/tests) WINE_CONFIG_MAKEFILE(dlls/ntprint) WINE_CONFIG_MAKEFILE(dlls/ntprint/tests) +WINE_CONFIG_MAKEFILE(dlls/nvcuda) WINE_CONFIG_MAKEFILE(dlls/objsel) WINE_CONFIG_MAKEFILE(dlls/odbc32) WINE_CONFIG_MAKEFILE(dlls/odbcbcp) @@ -3066,6 +3135,7 @@ WINE_CONFIG_MAKEFILE(dlls/setupapi/tests) WINE_CONFIG_MAKEFILE(dlls/setupx.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/sfc) WINE_CONFIG_MAKEFILE(dlls/sfc_os) +WINE_CONFIG_MAKEFILE(dlls/sharedgpures.sys) WINE_CONFIG_MAKEFILE(dlls/shcore) WINE_CONFIG_MAKEFILE(dlls/shcore/tests) WINE_CONFIG_MAKEFILE(dlls/shdoclc) @@ -3404,6 +3474,7 @@ WINE_CONFIG_MAKEFILE(po) WINE_CONFIG_MAKEFILE(programs/arp) WINE_CONFIG_MAKEFILE(programs/aspnet_regiis) WINE_CONFIG_MAKEFILE(programs/attrib) +WINE_CONFIG_MAKEFILE(programs/belauncher) WINE_CONFIG_MAKEFILE(programs/cabarc) WINE_CONFIG_MAKEFILE(programs/cacls) WINE_CONFIG_MAKEFILE(programs/certutil) @@ -3418,6 +3489,7 @@ WINE_CONFIG_MAKEFILE(programs/cscript) WINE_CONFIG_MAKEFILE(programs/dism) WINE_CONFIG_MAKEFILE(programs/dllhost) WINE_CONFIG_MAKEFILE(programs/dplaysvr) +WINE_CONFIG_MAKEFILE(programs/dotnetfx35) WINE_CONFIG_MAKEFILE(programs/dpnsvr) WINE_CONFIG_MAKEFILE(programs/dpvsetup) WINE_CONFIG_MAKEFILE(programs/dxdiag) @@ -3433,6 +3505,7 @@ WINE_CONFIG_MAKEFILE(programs/findstr) WINE_CONFIG_MAKEFILE(programs/findstr/tests) WINE_CONFIG_MAKEFILE(programs/fsutil) WINE_CONFIG_MAKEFILE(programs/fsutil/tests) +WINE_CONFIG_MAKEFILE(programs/getminidump) WINE_CONFIG_MAKEFILE(programs/hh) WINE_CONFIG_MAKEFILE(programs/hostname) WINE_CONFIG_MAKEFILE(programs/icacls) @@ -3486,6 +3559,7 @@ WINE_CONFIG_MAKEFILE(programs/start) WINE_CONFIG_MAKEFILE(programs/subst) WINE_CONFIG_MAKEFILE(programs/svchost) WINE_CONFIG_MAKEFILE(programs/systeminfo) +WINE_CONFIG_MAKEFILE(programs/tabtip) WINE_CONFIG_MAKEFILE(programs/taskkill) WINE_CONFIG_MAKEFILE(programs/tasklist) WINE_CONFIG_MAKEFILE(programs/tasklist/tests) diff --git a/dlls/actxprxy/Makefile.in b/dlls/actxprxy/Makefile.in index 0397f7c3a93..36aa17b61ef 100644 --- a/dlls/actxprxy/Makefile.in +++ b/dlls/actxprxy/Makefile.in @@ -8,6 +8,7 @@ SOURCES = \ actxprxy_hlink.idl \ actxprxy_htiface.idl \ actxprxy_htiframe.idl \ + actxprxy_mshtml.idl \ actxprxy_objsafe.idl \ actxprxy_ocmm.idl \ actxprxy_servprov.idl \ diff --git a/dlls/actxprxy/actxprxy_mshtml.idl b/dlls/actxprxy/actxprxy_mshtml.idl new file mode 100644 index 00000000000..6f4a7ca9fd0 --- /dev/null +++ b/dlls/actxprxy/actxprxy_mshtml.idl @@ -0,0 +1,35 @@ +/* + * Copyright 2009 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* just a wrapper for mshtmhst.idl */ + +#pragma makedep proxy +#pragma makedep register + +#define NO_MSHTML_IMPORT + +#include "mshtml.idl" +#include "mshtmhst.idl" +#include "shdeprecated.idl" +#include "docobjectservice.idl" + +[ + threading(both), + uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */ +] +coclass PSFactoryBuffer { interface IFactoryBuffer; } diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c index 2284e92b263..127cec57252 100644 --- a/dlls/advapi32/advapi.c +++ b/dlls/advapi32/advapi.c @@ -44,14 +44,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi); */ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size ) { - DWORD len = GetEnvironmentVariableA( "WINEUSERNAME", name, *size ); - BOOL ret; - - if (!len) return FALSE; - if ((ret = (len < *size))) len++; - else SetLastError( ERROR_INSUFFICIENT_BUFFER ); - *size = len; - return ret; + static const char steamuserA[] = {'s','t','e','a','m','u','s','e','r',0}; + if(*size < ARRAY_SIZE(steamuserA)){ + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + *size = ARRAY_SIZE(steamuserA); + return FALSE; + } + memcpy(name, steamuserA, sizeof(steamuserA)); + *size = ARRAY_SIZE(steamuserA); + return TRUE; } /****************************************************************************** @@ -59,14 +60,15 @@ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size ) */ BOOL WINAPI GetUserNameW( LPWSTR name, LPDWORD size ) { - DWORD len = GetEnvironmentVariableW( L"WINEUSERNAME", name, *size ); - BOOL ret; - - if (!len) return FALSE; - if ((ret = (len < *size))) len++; - else SetLastError( ERROR_INSUFFICIENT_BUFFER ); - *size = len; - return ret; + static const WCHAR steamuserW[] = {'s','t','e','a','m','u','s','e','r',0}; + if(*size < ARRAY_SIZE(steamuserW)){ + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + *size = ARRAY_SIZE(steamuserW); + return FALSE; + } + memcpy(name, steamuserW, sizeof(steamuserW)); + *size = ARRAY_SIZE(steamuserW); + return TRUE; } /****************************************************************************** diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 73c9b1d219d..c3f927cfb60 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -645,9 +645,19 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags) if (InterlockedDecrement(&pProv->refcount) == 0) { + static unsigned int once; + char sgi[64]; + ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags); pProv->dwMagic = 0; - FreeLibrary(pProv->hModule); + if(GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "1252330")) + { + if (!once++) FIXME("HACK: not freeing provider library.\n"); + } + else + { + FreeLibrary(pProv->hModule); + } #if 0 CRYPT_Free(pProv->pVTable->pContextInfo); #endif diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 85e883bdcc9..e3226c38d0a 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -70,6 +70,9 @@ LSTATUS WINAPI RegOverridePredefKey( HKEY hkey, HKEY override ) */ LSTATUS WINAPI RegCreateKeyW( HKEY hkey, LPCWSTR lpSubKey, PHKEY phkResult ) { + if (!phkResult) + return ERROR_INVALID_PARAMETER; + return RegCreateKeyExW( hkey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, MAXIMUM_ALLOWED, NULL, phkResult, NULL ); } @@ -82,6 +85,9 @@ LSTATUS WINAPI RegCreateKeyW( HKEY hkey, LPCWSTR lpSubKey, PHKEY phkResult ) */ LSTATUS WINAPI RegCreateKeyA( HKEY hkey, LPCSTR lpSubKey, PHKEY phkResult ) { + if (!phkResult) + return ERROR_INVALID_PARAMETER; + return RegCreateKeyExA( hkey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, MAXIMUM_ALLOWED, NULL, phkResult, NULL ); } diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 8d0c6977d72..43c35b14eca 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -244,12 +244,42 @@ BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName) return Result; } +static BOOL WINAPI init_computer_sid( INIT_ONCE *init_once, void *parameter, void **context ) +{ + DWORD *sub_authority = parameter; + unsigned int i, count; + DWORD len, index; + BOOL found = FALSE; + DWORD values[3]; + char buffer[64]; + LSTATUS status; + + len = ARRAY_SIZE(buffer); + index = 0; + while (!(status = RegEnumKeyExA( HKEY_USERS, index, buffer, &len, NULL, NULL, NULL, NULL ))) + { + count = sscanf(buffer, "S-1-5-21-%lu-%lu-%lu", &values[0], &values[1], &values[2]); + if (count == 3) + { + if (found) + ERR( "Multiple users are not supported.\n" ); + for (i = 0; i < 3; ++i) + sub_authority[i] = values[i]; + found = TRUE; + } + ++index; + len = ARRAY_SIZE(buffer); + } + return found; +} + /************************************************************ * ADVAPI_GetComputerSid */ BOOL ADVAPI_GetComputerSid(PSID sid) { - static const struct /* same fields as struct SID */ + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + static struct /* same fields as struct SID */ { BYTE Revision; BYTE SubAuthorityCount; @@ -258,6 +288,9 @@ BOOL ADVAPI_GetComputerSid(PSID sid) } computer_sid = { SID_REVISION, 4, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0 } }; + if (!InitOnceExecuteOnce( &init_once, init_computer_sid, computer_sid.SubAuthority + 1, NULL )) + ERR( "Could not initialize computer sid.\n" ); + memcpy( sid, &computer_sid, sizeof(computer_sid) ); return TRUE; } diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 30a79368c94..ecfdbbe547e 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -1268,6 +1268,19 @@ static void test_reg_create_key(void) PACL key_acl; SECURITY_DESCRIPTOR *sd; + /* NULL return key check */ + ret = RegCreateKeyA(hkey_main, "Subkey1", NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret); + + ret = RegCreateKeyW(hkey_main, L"Subkey1", NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret); + + ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL); + ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret); + + ret = RegCreateKeyExW(hkey_main, L"Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL); + ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret); + ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL); ok(!ret, "RegCreateKeyExA failed with error %ld\n", ret); /* should succeed: all versions of Windows ignore the access rights @@ -2763,6 +2776,28 @@ static void test_redirection(void) RegCloseKey( root32 ); RegCloseKey( root64 ); + err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\WOW6432Node\\test1\\test2", 0, NULL, 0, + KEY_WRITE | KEY_WOW64_32KEY, NULL, &key, NULL ); + ok(!err, "got %#lx.\n", err); + RegCloseKey(key); + + err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, NULL, 0, KEY_WRITE | KEY_WOW64_32KEY, + NULL, &key, NULL ); + ok(!err, "got %#lx.\n", err); + RegCloseKey(key); + + err = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, KEY_WRITE | KEY_WOW64_32KEY, &key ); + ok(!err, "got %#lx.\n", err); + RegCloseKey(key); + + if (pRegDeleteTreeA) + { + err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\test1"); + ok(!err, "got %#lx.\n", err); + err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\test1"); + ok(err == ERROR_FILE_NOT_FOUND, "got %#lx.\n", err); + } + /* Software\Classes is shared/reflected so behavior is different */ err = RegCreateKeyExA( HKEY_LOCAL_MACHINE, "Software\\Classes\\Wine", diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 2840f6bd75a..318eb2ba18b 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -786,6 +786,9 @@ static void test_lookupPrivilegeValue(void) } } +static TOKEN_OWNER *get_alloc_token_owner( HANDLE token ); +static TOKEN_PRIMARY_GROUP *get_alloc_token_primary_group( HANDLE token ); + static void test_FileSecurity(void) { char wintmpdir [MAX_PATH]; @@ -800,6 +803,16 @@ static void test_FileSecurity(void) const SECURITY_INFORMATION request = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; + TOKEN_OWNER *owner; + PSID owner_sid; + BOOL defaulted, present; + TOKEN_PRIMARY_GROUP *group; + SECURITY_ATTRIBUTES sa; + PACL dacl; + ACL_SIZE_INFORMATION acl_size; + ACCESS_ALLOWED_ACE *ace; + static SID owner_rights_sid = { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_OWNER_RIGHTS_RID } }; + const WCHAR sd_onwer_rights_str[] = L"D:(A;;FA;;;S-1-3-4)"; if (!pSetFileSecurityA) { win_skip ("SetFileSecurity is not available\n"); @@ -902,6 +915,58 @@ static void test_FileSecurity(void) ok (GetLastError() == ERROR_FILE_NOT_FOUND, "last error ERROR_FILE_NOT_FOUND expected, got %ld\n", GetLastError()); + sa.nLength = sizeof(sa); + sa.bInheritHandle = FALSE; + rc = ConvertStringSecurityDescriptorToSecurityDescriptorW(sd_onwer_rights_str, SDDL_REVISION_1, &sa.lpSecurityDescriptor, NULL); + ok(rc, "got error %lu.\n", GetLastError()); + + DeleteFileA(file); + fh = CreateFileA(file, GENERIC_READ, 0, &sa, CREATE_ALWAYS, 0, NULL); + ok (fh != INVALID_HANDLE_VALUE, "error %lu\n", GetLastError()); + LocalFree(sa.lpSecurityDescriptor); + + rc = GetFileSecurityA (file, OWNER_SECURITY_INFORMATION, NULL, 0, &retSize); + ok (!rc && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld, error %lu.\n", rc, GetLastError()); + sd = HeapAlloc (GetProcessHeap (), 0, sdSize); + rc = GetFileSecurityA (file, OWNER_SECURITY_INFORMATION, sd, retSize, &retSize); + ok(rc, "got error %lu.\n", GetLastError()); + rc = GetSecurityDescriptorOwner(sd, &owner_sid, &defaulted); + ok(rc, "got error %lu.\n", GetLastError()); + ok(!defaulted, "got %d.\n", defaulted); + owner = get_alloc_token_owner(GetCurrentProcessToken()); + todo_wine ok(EqualSid(owner_sid, owner->Owner), "Owner SIDs are not equal %s != %s\n", debugstr_sid(owner_sid), debugstr_sid(owner->Owner)); + HeapFree (GetProcessHeap (), 0, owner); + HeapFree (GetProcessHeap (), 0, sd); + + group = get_alloc_token_primary_group(GetCurrentProcessToken()); + test_group_equal(fh, group->PrimaryGroup, __LINE__); + HeapFree (GetProcessHeap (), 0, group); + + CloseHandle(fh); + + fh = CreateFileA(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + ok (fh != INVALID_HANDLE_VALUE, "error %lu\n", GetLastError()); + if (fh != INVALID_HANDLE_VALUE) + { + rc = GetFileSecurityA (file, DACL_SECURITY_INFORMATION, NULL, 0, &retSize); + ok (!rc && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld, error %lu.\n", rc, GetLastError()); + sd = HeapAlloc (GetProcessHeap (), 0, sdSize); + rc = GetFileSecurityA (file, DACL_SECURITY_INFORMATION, sd, retSize, &retSize); + ok(rc, "got error %lu.\n", GetLastError()); + rc = GetSecurityDescriptorDacl(sd, &present, &dacl, &defaulted); + ok(rc, "got error %lu.\n", GetLastError()); + ok(present, "got %d.\n", present); + ok(!defaulted, "got %d.\n", defaulted); + rc = GetAclInformation(dacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(rc, "got error %lu.\n", GetLastError()); + ok(acl_size.AceCount == 1, "got %lu.\n", acl_size.AceCount); + rc = GetAce(dacl, 0, (VOID **)&ace); + ok(rc, "got error %lu.\n", GetLastError()); + ok(EqualSid(&ace->SidStart, &owner_rights_sid), "Owner SIDs are not equal %s != %s\n", debugstr_sid(&ace->SidStart), debugstr_sid(&owner_rights_sid)); + CloseHandle(fh); + HeapFree (GetProcessHeap (), 0, sd); + } + cleanup: /* Remove temporary file and directory */ DeleteFileA(file); @@ -3728,7 +3793,7 @@ static void test_CreateDirectoryA(void) } ok(!error, "GetNamedSecurityInfo failed with error %ld\n", error); test_inherited_dacl(pDacl, admin_sid, user_sid, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, - 0x1f01ff, FALSE, TRUE, FALSE, __LINE__); + 0x1f01ff, FALSE, FALSE, FALSE, __LINE__); LocalFree(pSD); /* Test inheritance of ACLs in CreateFile without security descriptor */ @@ -3774,7 +3839,6 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); ok(bret, "GetAclInformation failed\n"); - todo_wine ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", acl_size.AceCount); LocalFree(pSD); @@ -3782,17 +3846,12 @@ static void test_CreateDirectoryA(void) error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, (PSID *)&owner, NULL, &pDacl, NULL, &pSD); - todo_wine ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); - if (error == ERROR_SUCCESS) - { - bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); - ok(bret, "GetAclInformation failed\n"); - todo_wine - ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", - acl_size.AceCount); - LocalFree(pSD); - } + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); CloseHandle(hTemp); /* Test inheritance of ACLs in NtCreateFile without security descriptor */ @@ -3861,17 +3920,158 @@ static void test_CreateDirectoryA(void) error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, (PSID *)&owner, NULL, &pDacl, NULL, &pSD); - todo_wine ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); - if (error == ERROR_SUCCESS) - { - bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); - ok(bret, "GetAclInformation failed\n"); - todo_wine - ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", - acl_size.AceCount); - LocalFree(pSD); - } + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + CloseHandle(hTemp); + + /* Test inheritance of ACLs in CreateDirectory without security descriptor */ + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir"); + bret = CreateDirectoryA(tmpfile, NULL); + ok(bret == TRUE, "CreateDirectoryA failed with error %u\n", GetLastError()); + + error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); + test_inherited_dacl(pDacl, admin_sid, user_sid, + OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, + 0x1f01ff, TRUE, TRUE, TRUE, __LINE__); + LocalFree(pSD); + bret = RemoveDirectoryA(tmpfile); + ok(bret == TRUE, "RemoveDirectoryA failed with error %u\n", GetLastError()); + + /* Test inheritance of ACLs in CreateDirectory with security descriptor */ + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, sizeof(ACL)); + bret = InitializeAcl(pDacl, sizeof(ACL), ACL_REVISION); + ok(bret, "Failed to initialize ACL\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor\n"); + + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir1"); + + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = pSD; + sa.bInheritHandle = TRUE; + bret = CreateDirectoryA(tmpfile, &sa); + ok(bret == TRUE, "CreateDirectoryA failed with error %u\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, pDacl); + + error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + + SetLastError(0xdeadbeef); + bret = RemoveDirectoryA(tmpfile); + error = GetLastError(); + ok(bret == FALSE, "RemoveDirectoryA unexpected succeeded\n"); + ok(error == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %u\n", error); + + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, 100); + bret = InitializeAcl(pDacl, 100, ACL_REVISION); + ok(bret, "Failed to initialize ACL.\n"); + bret = pAddAccessAllowedAceEx(pDacl, ACL_REVISION, 0, GENERIC_ALL, user_sid); + ok(bret, "Failed to add Current User to ACL.\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor.\n"); + error = pSetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, + NULL, pDacl, NULL); + ok(error == ERROR_SUCCESS, "SetNamedSecurityInfoA failed with error %u\n", error); + HeapFree(GetProcessHeap(), 0, pDacl); + + bret = RemoveDirectoryA(tmpfile); + ok(bret == TRUE, "RemoveDirectoryA failed with error %u\n", GetLastError()); + + /* Test inheritance of ACLs in NtCreateFile(..., FILE_DIRECTORY_FILE, ...) without security descriptor */ + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir"); + get_nt_pathW(tmpfile, &tmpfileW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &tmpfileW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = pNtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08x\n", status); + RtlFreeUnicodeString(&tmpfileW); + + error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); + test_inherited_dacl(pDacl, admin_sid, user_sid, + OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, + 0x1f01ff, TRUE, TRUE, TRUE, __LINE__); + LocalFree(pSD); + CloseHandle(hTemp); + + /* Test inheritance of ACLs in NtCreateFile(..., FILE_DIRECTORY_FILE, ...) with security descriptor */ + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, sizeof(ACL)); + bret = InitializeAcl(pDacl, sizeof(ACL), ACL_REVISION); + ok(bret, "Failed to initialize ACL\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor\n"); + + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir2"); + get_nt_pathW(tmpfile, &tmpfileW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &tmpfileW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = pSD; + attr.SecurityQualityOfService = NULL; + + status = pNtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08x\n", status); + RtlFreeUnicodeString(&tmpfileW); + HeapFree(GetProcessHeap(), 0, pDacl); + + error = GetSecurityInfo(hTemp, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + + error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%d != 0).\n", + acl_size.AceCount); + LocalFree(pSD); CloseHandle(hTemp); done: @@ -4047,21 +4247,20 @@ static void test_GetNamedSecurityInfoA(void) bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); + ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + ok(ace->Mask == 0x1f01ff, + "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } if (acl_size.AceCount > 1) { bret = GetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret || broken(!bret) /* win2k */, - "Administators Group ACE (%s) != Administators Group SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); + ok(bret || broken(!bret) /* win2k */, "Administators Group ACE (%s) != Administators Group SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff || broken(ace->Mask == GENERIC_ALL) /* win2k */, @@ -4088,8 +4287,8 @@ static void test_GetNamedSecurityInfoA(void) { bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get ACE.\n"); - todo_wine ok(((ACE_HEADER *)ace)->AceFlags & INHERITED_ACE, - "ACE has unexpected flags: 0x%x\n", ((ACE_HEADER *)ace)->AceFlags); + ok(((ACE_HEADER *)ace)->AceFlags & INHERITED_ACE, + "ACE has unexpected flags: 0x%x\n", ((ACE_HEADER *)ace)->AceFlags); } LocalFree(pSD); @@ -4905,23 +5104,22 @@ static void test_GetSecurityInfo(void) bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); + ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + ace->Mask); } if (acl_size.AceCount > 1) { bret = GetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); + ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + ok(ace->Mask == 0x1f01ff, + "Administators Group ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } LocalFree(pSD); CloseHandle(obj); diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in new file mode 100644 index 00000000000..03441315802 --- /dev/null +++ b/dlls/amd_ags_x64/Makefile.in @@ -0,0 +1,14 @@ +EXTRADEFS = -DWINE_NO_LONG_TYPES +MODULE = amd_ags_x64.dll +UNIXLIB = amd_ags_x64.so +UNIX_CFLAGS = $(DRM_CFLAGS) +UNIX_LIBS = $(DRM_LIBS) $(DRMAMDGPU_LIBS) +IMPORTS = version vulkan-1 user32 +IMPORTLIB = amd_ags_x64 + +EXTRADLLFLAGS = -mno-cygwin + +SOURCES = \ + amd_ags_x64_main.c \ + unixlib.c \ + dxvk_interfaces.idl diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h new file mode 100644 index 00000000000..f6e50cad8f3 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags.h @@ -0,0 +1,2066 @@ +// +// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +/// \file +/// \mainpage +/// AGS Library Overview +/// -------------------- +/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query +/// AMD GPU software and hardware state information that is not normally available through standard operating systems or graphic APIs. +/// +/// The latest version of the API is publicly hosted here: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/. +/// It is also worth checking http://gpuopen.com/gaming-product/amd-gpu-services-ags-library/ for any updates and articles on AGS. +/// \internal +/// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ +/// \endinternal +/// +/// --------------------------------------- +/// What's new in AGS 6.0 since version 5.4.2 +/// --------------------------------------- +/// AGS 6.0 includes the following updates: +/// * DX12 ray tracing hit token for RDNA2 hardware. +/// * Shader intrinsic that exposes ReadLaneAt in DX12. +/// * Shader intrinsics that expose explicit float conversions in DX12. +/// * Refactored and revised API to minimize user error. +/// * Added agsGetVersionNumber. +/// * Detection for external GPUs. +/// * Detection of RDNA2 architecture. +/// * Grouped the more established intrinsics together into per year support. +/// * Function pointer typedefs for the API +/// +/// --------------------------------------- +/// What's new in AGS 5.4.2 since version 5.4.1 +/// --------------------------------------- +/// AGS 5.4.2 includes the following updates: +/// * sharedMemoryInBytes has been reinstated. +/// * Clock speed returned for APUs. +/// +/// --------------------------------------- +/// What's new in AGS 5.4.1 since version 5.4.0 +/// --------------------------------------- +/// AGS 5.4.1 includes the following updates: +/// * AsicFamily_Count to help with code maintenance. +/// * Visual Studio 2019 support. +/// * x86 support +/// * BaseInstance and BaseVertex intrinsics along with corresponding caps bits. +/// * GetWaveSize intrinsic along with corresponding caps bits. +/// +/// --------------------------------------- +/// What's new in AGS 5.4 since version 5.3 +/// --------------------------------------- +/// AGS 5.4 includes the following updates: +/// * A more detailed description of the GPU architecture, now including RDNA GPUs. +/// * Radeon 7 core and memory speeds returned. +/// * Draw index and Atomic U64 intrinsics for both DX11 and DX12. +/// +/// --------------------------------------- +/// What's new in AGS 5.3 since version 5.2 +/// --------------------------------------- +/// AGS 5.3 includes the following updates: +/// * DX11 deferred context support for Multi Draw Indirect and UAV Overlap extensions. +/// * A Radeon Software Version helper to determine whether the installed driver meets your game's minimum driver version requirements. +/// * Freesync HDR Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync HDR scRGB. +/// +/// What's new in AGS 5.2.1 since version 5.2.0 +/// --------------------------------------- +/// * Fix for crash when using Eyefinity +/// * Fix for DX12 app registration in the UWP version +/// +/// +/// What's new in AGS 5.2.0 since version 5.1 +/// --------------------------------------- +/// AGS 5.2 includes the following updates: +/// * DX12 app registration API +/// * DX11 breadcrumb marker API for tracking down GPU hangs:\ref agsDriverExtensionsDX11_WriteBreadcrumb +/// * DX12 extensions now require the creation of the device via \ref agsDriverExtensionsDX12_CreateDevice +/// * agsGetCrossfireGPUCount has been removed in favor of retrieving the value from \ref agsDriverExtensionsDX11_CreateDevice +/// * API change that fixes a reference leak in \ref agsDriverExtensionsDX11_DestroyDevice +/// +/// What's new in AGS 5.1.1 since version 5.0.6 +/// --------------------------------------- +/// AGS 5.1.1 includes the following updates: +/// * An API change for DX11 extensions +/// - It is now mandatory to call agsDriverExtensionsDX11_CreateDevice() when creating a device if the user wants to access any DX11 AMD extensions. +/// - The corresponding agsDriverExtensionsDX11_DestroyDevice() call must be called to release the device and free up the internal resources allocated by the create call. +/// * App registration extension for DX11. +/// * Freesync 2 HDR support. +/// * Wave reduce and wave scan shader extensions. +/// * AMD user markers for DX12. +/// * Eyefinity bug fixes. +/// * MultiDrawIndexedInstancedIndirectCountIndirect parameter bug fix. +/// * Static lib versions of the binary. +/// * VS2017 support for the samples. +/// +/// What's new in AGS 5.x since version 4.x +/// --------------------------------------- +/// Version 5.x is a major overhaul of the library designed to provide a much clearer view of the GPUs in the system and the displays attached to them. +/// It also exposes the ability to query each display for HDR capabilities and put those HDR capable displays into various HDR modes. +/// Some functions such as agsGetGPUMemorySize and agsGetEyefinityConfigInfo have been removed in favor of including this information in the device & display enumeration. +/// Features include: +/// * Full GPU enumeration with adapter string, device id, revision id and vendor id. +/// * Per GPU display enumeration including information on display name, resolution and HDR capabilities. +/// * Optional user supplied memory allocator. +/// * Function to set displays into HDR mode. +/// * A Microsoft WACK compliant version of the library. +/// * DirectX11 shader compiler controls. +/// * DirectX11 multiview extension enabling MultiView and MultiRes rendering. +/// * DirectX11 Crossfire API now supports using the API without needing a driver profile. Can also specify the transfer engine. +/// +/// Using the AGS library +/// --------------------- +/// It is recommended to take a look at the source code for the samples that come with the AGS SDK: +/// * AGSSample +/// * CrossfireSample +/// * EyefinitySample +/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state. +/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more +/// extensive example of Eyefinity setup than the basic example provided in AGSSample. +/// There are other samples on Github that demonstrate the DirectX shader extensions, such as the Barycentrics11 and Barycentrics12 samples. +/// +/// To add AGS support to an existing project, follow these steps: +/// * Link your project against the correct import library. Choose from either the 32 bit or 64 bit version. +/// * Copy the AGS dll into the same directory as your game executable. +/// * Include the amd_ags.h header file from your source code. +/// * Include the AGS hlsl files if you are using the shader intrinsics. +/// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS. +/// * On game initialization, call \ref agsInitialize passing in the address of the context. On success, this function will return a valid context pointer. +/// +/// Don't forget to cleanup AGS by calling \ref agsDeInitialize when the app exits, after the device has been destroyed. + +#ifndef AMD_AGS_H +#define AMD_AGS_H + +#define AMD_AGS_VERSION_MAJOR 6 ///< AGS major version +#define AMD_AGS_VERSION_MINOR 0 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version + +#ifdef __cplusplus +extern "C" { +#endif + +/// \defgroup Defines AGS defines +/// @{ +#define AMD_AGS_API WINAPI + +#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams and the Radeon Software Version +#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version +/// @} + +// Forward declaration of D3D and DXGI types +struct IDXGIAdapter; +struct IDXGISwapChain; +struct DXGI_SWAP_CHAIN_DESC; +enum D3D_DRIVER_TYPE; +enum D3D_FEATURE_LEVEL; + enum D3D_PRIMITIVE_TOPOLOGY; + +// Forward declaration of D3D11 types +struct ID3D11Device; +struct ID3D11DeviceContext; +struct ID3D11Resource; +struct ID3D11Buffer; +struct ID3D11Texture1D; +struct ID3D11Texture2D; +struct ID3D11Texture3D; +struct D3D11_BUFFER_DESC; +struct D3D11_TEXTURE1D_DESC; +struct D3D11_TEXTURE2D_DESC; +struct D3D11_TEXTURE3D_DESC; +struct D3D11_SUBRESOURCE_DATA; + +// Forward declaration of D3D12 types +struct ID3D12Device; +struct ID3D12GraphicsCommandList; + +/// \defgroup enums General enumerations +/// @{ + +/// The return codes +typedef enum AGSReturnCode +{ + AGS_SUCCESS, ///< Successful function call + AGS_FAILURE, ///< Failed to complete call for some unspecified reason + AGS_INVALID_ARGS, ///< Invalid arguments into the function + AGS_OUT_OF_MEMORY, ///< Out of memory when allocating space internally + AGS_MISSING_D3D_DLL, ///< Returned when a D3D dll fails to load + AGS_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver + // AGS_NO_AMD_DRIVER_INSTALLED ADDED IN 5.4.1 + AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed + AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension + AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) + AGS_DX_FAILURE, ///< Failure from DirectX runtime + AGS_D3DDEVICE_NOT_CREATED, ///< Failure due to not creating the D3D device successfully via AGS. +} AGSReturnCode; + +/// The DirectX11 extension support bits +typedef enum AGSDriverExtensionDX11 +{ + AGS_DX11_EXTENSION_QUADLIST = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT_COUNTINDIRECT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_CROSSFIRE_API = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READLANE = 1 << 8, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_LANEID = 1 << 9, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_SWIZZLE = 1 << 10, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BALLOT = 1 << 11, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MBCOUNT = 1 << 12, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MED3 = 1 << 13, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 14, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 15, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 16, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, ///< Supported in Radeon Software Version 16.12.1 onwards. + AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_BREADCRUMB_MARKERS = 1 << 20, ///< Supported in Radeon Software Version 17.11.1 onwards. + AGS_DX11_EXTENSION_MDI_DEFERRED_CONTEXTS = 1 << 21, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 24, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 25, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 26, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 27, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 28 ///< Supported in Radeon Software Version 20.2.1 onwards. +} AGSDriverExtensionDX11; + +/// The DirectX12 extension support bits +typedef enum AGSDriverExtensionDX12 +{ + AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_LANEID = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_SWIZZLE = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BALLOT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MBCOUNT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MED3 = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT = 1 << 12, ///< Supported in Radeon Software Version 19.5.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 13, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 14, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 15, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 16, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 17 ///< Supported in Radeon Software Version 20.5.1 onwards. +} AGSDriverExtensionDX12; + +/// The space id for DirectX12 intrinsic support +const unsigned int AGS_DX12_SHADER_INTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 + +/// The display flags describing various properties of the display. +typedef enum AGSDisplayFlags +{ + AGS_DISPLAYFLAG_PRIMARY_DISPLAY = 1 << 0, ///< Whether this display is marked as the primary display. Not set on the WACK version. + AGS_DISPLAYFLAG_HDR10 = 1 << 1, ///< HDR10 is supported on this display + AGS_DISPLAYFLAG_DOLBYVISION = 1 << 2, ///< Dolby Vision is supported on this display + AGS_DISPLAYFLAG_FREESYNC = 1 << 3, ///< Freesync is supported on this display + AGS_DISPLAYFLAG_FREESYNC_HDR = 1 << 4, ///< Freesync HDR is supported on this display + AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP = 1 << 5, ///< The display is part of the Eyefinity group + AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY = 1 << 6, ///< The display is the preferred display in the Eyefinity group for displaying the UI + AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7, ///< The display is in the Eyefinity group but in portrait mode +} AGSDisplayFlags; + +/// The display settings flags. +typedef enum AGSDisplaySettingsFlags +{ + AGS_DISPLAYSETTINGSFLAG_DISABLE_LOCAL_DIMMING = 1 << 0, ///< Disables local dimming if possible +} AGSDisplaySettingsFlags; + +/// @} + +typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInitialize + +/// The rectangle struct used by AGS. +typedef struct AGSRect +{ + int offsetX; ///< Offset on X axis + int offsetY; ///< Offset on Y axis + int width; ///< Width of rectangle + int height; ///< Height of rectangle +} AGSRect; + +typedef struct AGSEyefinityInfo +{ + int iSLSActive; // Indicates if Eyefinity is active for the operating system display + // index passed into atiEyefinityGetConfigInfo(). 1 if enabled and 0 if disabled. + + int iSLSGridWidth; // Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + // For example, a 3 display wide by 2 high Eyefinity setup will return 3 for this entry. + int iSLSGridHeight; // Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + // For example, a 3 display wide by 2 high Eyefinity setup will return 2 for this entry. + + int iSLSWidth; // Contains width in pixels of the multi-monitor Single Large Surface. The value returned is + // a function of the width of the SLS grid, of the horizontal resolution of each display, and + // of whether or not bezel compensation is enabled. + int iSLSHeight; // Contains height in pixels of the multi-monitor Single Large Surface. The value returned is + // a function of the height of the SLS grid, of the vertical resolution of each display, and + // of whether or not bezel compensation is enabled. + + int iBezelCompensatedDisplay; // Indicates if bezel compensation is used for the current SLS display area. + // 1 if enabled, and 0 if disabled. +} AGSEyefinityInfo; + +/// The display info struct used to describe a display enumerated by AGS +typedef struct AGSDisplayInfo_403 +{ + int iGridXCoord; // Contains horizontal SLS grid coordinate of the display. The value is zero based with + // increasing values from left to right of the overall SLS grid. For example, the left-most + // display of a 3x2 Eyefinity setup will have the value 0, and the right-most will have + // the value 2. + int iGridYCoord; // Contains vertical SLS grid coordinate of the display. The value is zero based with + // increasing values from top to bottom of the overall SLS grid. For example, the top + // display of a 3x2 Eyefinity setup will have the value 0, and the bottom will have the + // value 1. + + AGSRect displayRect; // Contains the base offset and dimensions in pixels of the SLS rendering + // area associated with this display. If bezel compensation is enabled, this + // area will be larger than what the display can natively present to account + // for bezel area. If bezel compensation is disabled, this area will be equal + // to what the display can support natively. + + AGSRect displayRectVisible; // Contains the base offset and dimensions in pixels of the SLS rendering area + // associated with this display that is visible to the end user. If bezel + // compensation is enabled, this area will be equal to what the display can + // natively, but smaller that the area described in the displayRect entry. If + // bezel compensation is disabled, this area will be equal to what the display + // can support natively and equal to the area described in the displayRect entry. + // Developers wishing to place UI, HUD, or other game assets on a given display + // so that it is visible and accessible to end users need to locate them inside + // of the region defined by this rect. + + int iPreferredDisplay; // Indicates whether or not this display is the preferred one for rendering of + // game HUD and UI elements. Only one display out of the whole SLS grid will have + // this be true if it is the preferred display and 0 otherwise. Developers wishing + // to place specific UI, HUD, or other game assets on a given display so that it + // is visible and accessible to end users need to locate them inside of the region + // defined by this rect. +} AGSDisplayInfo_403; + +typedef struct AGSDisplayInfo_511 +{ + char name[ 256 ]; ///< The name of the display + char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName + + unsigned int displayFlags; ///< Bitfield of \ref AGSDisplayFlags + + int maxResolutionX; ///< The maximum supported resolution of the unrotated display + int maxResolutionY; ///< The maximum supported resolution of the unrotated display + float maxRefreshRate; ///< The maximum supported refresh rate of the display + + AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation + AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will + ///< be the sub region in the Eyefinity single large surface (SLS) + float currentRefreshRate; ///< The current refresh rate + + int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1 + double screenSpecularReflectance; ///< Percentage expressed between 0 - 1 + + double minLuminance; ///< The minimum luminance of the display in nits + double maxLuminance; ///< The maximum luminance of the display in nits + double avgLuminance; ///< The average luminance of the display in nits + + int logicalDisplayIndex; ///< The internally used index of this display + int adlAdapterIndex; ///< The internally used ADL adapter index +} AGSDisplayInfo_511; + +/// The display info struct used to describe a display enumerated by AGS +typedef struct AGSDisplayInfo_600 +{ + char name[ 256 ]; ///< The name of the display + char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName + + unsigned int isPrimaryDisplay : 1; ///< Whether this display is marked as the primary display + unsigned int HDR10 : 1; ///< HDR10 is supported on this display + unsigned int dolbyVision : 1; ///< Dolby Vision is supported on this display + unsigned int freesync : 1; ///< Freesync is supported on this display + unsigned int freesyncHDR : 1; ///< Freesync HDR is supported on this display + unsigned int eyefinityInGroup : 1; ///< The display is part of the Eyefinity group + unsigned int eyefinityPreferredDisplay : 1; ///< The display is the preferred display in the Eyefinity group for displaying the UI + unsigned int eyefinityInPortraitMode : 1; ///< The display is in the Eyefinity group but in portrait mode + unsigned int reservedPadding : 24; ///< Reserved for future use + + int maxResolutionX; ///< The maximum supported resolution of the unrotated display + int maxResolutionY; ///< The maximum supported resolution of the unrotated display + float maxRefreshRate; ///< The maximum supported refresh rate of the display + + AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation + AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will + ///< be the sub region in the Eyefinity single large surface (SLS) + float currentRefreshRate; ///< The current refresh rate + + int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1 + double screenSpecularReflectance; ///< Percentage expressed between 0 - 1 + + double minLuminance; ///< The minimum luminance of the display in nits + double maxLuminance; ///< The maximum luminance of the display in nits + double avgLuminance; ///< The average luminance of the display in nits + + int logicalDisplayIndex; ///< The internally used index of this display + int adlAdapterIndex; ///< The internally used ADL adapter index + int reserved; ///< reserved field +} AGSDisplayInfo_600; + +/// The architecture version +typedef enum ArchitectureVersion +{ + ArchitectureVersion_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + ArchitectureVersion_PreGCN, ///< AMD architecture, pre-GCN + ArchitectureVersion_GCN ///< AMD GCN architecture +} ArchitectureVersion; + +/// The ASIC family +typedef enum AsicFamily +{ + AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + AsicFamily_PreGCN, ///< Pre GCN architecture. + AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti. + AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo. + AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. + AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. + AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). + AsicFamily_RDNA, ///< AMD RDNA architecture + AsicFamily_RDNA2, ///< AMD RDNA2 architecture + AsicFamily_RDNA3, ///< AMD RDNA3 architecture + + AsicFamily_Count ///< Number of enumerated ASIC families +} AsicFamily; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_511 +{ + ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware + const char* adapterString; ///< The adapter name string + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of GCN compute units. Zero if not GCN + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + float teraFlops; ///< Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_511; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_520 +{ + const char* adapterString; ///< The adapter name string + ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. Zero if not GCN onwards + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_520; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_540 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_540; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_541 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_541; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_542 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_542; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_600 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + unsigned int isAPU : 1; ///< Whether this device is an APU + unsigned int isPrimaryDevice : 1; ///< Whether this device is marked as the primary device + unsigned int isExternal :1; ///< Whether this device is a detachable, external device + unsigned int reservedPadding : 29; ///< Reserved for future use + + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_600* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters + int reserved; ///< reserved field +} AGSDeviceInfo_600; + +struct AGSDeviceInfo; + +/// \defgroup general General API functions +/// API for initialization, cleanup, HDR display modes and Crossfire GPU count +/// @{ + +typedef void* (__stdcall *AGS_ALLOC_CALLBACK_511)( int allocationSize ); ///< AGS user defined allocation prototype +typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype +typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype + +/// The different modes to control Crossfire behavior. +typedef enum AGSCrossfireMode +{ + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources + AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile + AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering +} AGSCrossfireMode; + +/// The configuration options that can be passed in to \ref agsInititalize +struct AGSConfiguration_403 +{ + AGSCrossfireMode crossfireMode; // Desired Crossfire mode. See AGSCrossfireMode for more details +}; + +typedef struct AGSConfiguration_511 +{ + AGS_ALLOC_CALLBACK_511 allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used + AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used +} AGSConfiguration_511; + +typedef struct AGSConfiguration_520 +{ + AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used + AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used +} AGSConfiguration_520; + +typedef union AGSConfiguration +{ + AGSConfiguration_511 agsConfiguration511; + AGSConfiguration_520 agsConfiguration520; +} AGSConfiguration; + +struct AGSGPUInfo_311 +{ + ArchitectureVersion version; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; + +struct AGSGPUInfo_320 +{ + int agsVersionMajor; // Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; // Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; // Patch field of Major.Minor.Patch AGS version number + + ArchitectureVersion architectureVersion; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; + +/// The top level GPU information returned from \ref agsInitialize +struct AGSGPUInfo_403 +{ + int agsVersionMajor; // Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; // Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; // Patch field of Major.Minor.Patch AGS version number + + ArchitectureVersion architectureVersion; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + const char* radeonSoftwareVersion; // The Radeon Software Version + + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; + +typedef struct AGSGPUInfo_511 +{ + int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; ///< Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; ///< Patch field of Major.Minor.Patch AGS version number + int isWACKCompliant; ///< 1 if WACK compliant. + + const char* driverVersion; ///< The AMD driver package version + const char* radeonSoftwareVersion; ///< The Radeon Software Version + + int numDevices; ///< Number of GPUs in the system + struct AGSDeviceInfo* devices; ///< List of GPUs in the system +} AGSGPUInfo_511; + +/// The top level GPU information returned from \ref agsInit +typedef struct AGSGPUInfo_600 +{ + const char* driverVersion; ///< The AMD driver package version + const char* radeonSoftwareVersion; ///< The Radeon Software Version + + int numDevices; ///< Number of GPUs in the system + struct AGSDeviceInfo* devices; ///< List of GPUs in the system +} AGSGPUInfo_600; + +/// The display mode +typedef enum AGSDisplaySettings_Mode_506 +{ + Mode_506_SDR, ///< SDR mode + Mode_506_scRGB, ///< scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. Uses REC709 primaries. + Mode_506_PQ, ///< PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Uses BT2020 primaries. + Mode_506_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain +} AGSDisplaySettings_Mode_506; + +typedef enum AGSDisplaySettings_Mode_600 +{ + Mode_600_SDR, ///< SDR mode + Mode_600_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. + Mode_600_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. + Mode_600_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. + Mode_600_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. + Mode_600_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + + Mode_600_Count ///< Number of enumerated display modes +} AGSDisplaySettings_Mode_600; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_506 +{ + AGSDisplaySettings_Mode_506 mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) +} AGSDisplaySettings_506; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_511 +{ + AGSDisplaySettings_Mode_600 mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) + + // ADDED IN 5.2.0 + int flags; ///< Bitfield of ::AGSDisplaySettingsFlags +} AGSDisplaySettings_511; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_600 +{ + AGSDisplaySettings_Mode_600 mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) + + unsigned int disableLocalDimming : 1; ///< Disables local dimming if possible + unsigned int reservedPadding : 31; ///< Reserved +} AGSDisplaySettings_600; + +typedef union AGSDisplaySettings +{ + AGSDisplaySettings_506 agsDisplaySettings506; + AGSDisplaySettings_511 agsDisplaySettings511; + AGSDisplaySettings_600 agsDisplaySettings600; +} AGSDisplaySettings; + +/// The result returned from \ref agsCheckDriverVersion +typedef enum AGSDriverVersionResult +{ + AGS_SOFTWAREVERSIONCHECK_OK, ///< The reported Radeon Software Version is newer or the same as the required version + AGS_SOFTWAREVERSIONCHECK_OLDER, ///< The reported Radeon Software Version is older than the required version + AGS_SOFTWAREVERSIONCHECK_UNDEFINED ///< The check could not determine as result. This could be because it is a private or custom driver or just invalid arguments. +} AGSDriverVersionResult; + +/// +/// Helper function to check the installed software version against the required software version. +/// +/// \param [in] radeonSoftwareVersionReported The Radeon Software Version returned from \ref AGSGPUInfo::radeonSoftwareVersion. +/// \param [in] radeonSoftwareVersionRequired The Radeon Software Version to check against. This is specificed using \ref AGS_MAKE_VERSION. +/// \return The result of the check. +/// +AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoftwareVersionReported, unsigned int radeonSoftwareVersionRequired ); + +/// +/// Function to return the AGS version number. +/// +/// \return The version number made using AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ). +/// +AMD_AGS_API int agsGetVersionNumber( void ); + +/// +/// Function used to initialize the AGS library. +/// Must be called prior to any of the subsequent AGS API calls. +/// Must be called prior to ID3D11Device or ID3D12Device creation. +/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInit if there is an AMD GPU present. +/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system. +/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20. +/// \note It is good practice to check the AGS version returned from AGSGPUInfo against the version defined in the header in case a mismatch between the dll and header has occurred. +/// +/// \param [in, out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. +/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. +/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. +/// +AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* config, AGSGPUInfo_511* gpuInfo ); + +/// +/// Function used to initialize the AGS library. +/// agsVersion must be specified as AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ) or the call will return \ref AGS_INVALID_ARGS. +/// Must be called prior to any of the subsequent AGS API calls. +/// Must be called prior to ID3D11Device or ID3D12Device creation. +/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInitialize if there is an AMD GPU present. +/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system. +/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20. +/// +/// \param [in] agsVersion The API version specified using the \ref AGS_MAKE_VERSION macro. If this does not match the version in the binary this initialization call will fail. +/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. +/// \param [out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. +/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. +/// +AMD_AGS_API AGSReturnCode agsInitialize( int agsVersion, const AGSConfiguration* config, AGSContext** context, AGSGPUInfo_600* gpuInfo ); + +/// +/// Function used to clean up the AGS library. +/// +/// \param [in] context Pointer to a context. This function will deallocate the context from the heap. +/// +AMD_AGS_API AGSReturnCode agsDeInit( AGSContext* context ); + +/// +/// Function used to clean up the AGS library. +/// +/// \param [in] context Pointer to a context. This function will deallocate the context from the heap. +/// +AMD_AGS_API AGSReturnCode agsDeInitialize( AGSContext* context ); + +/// +/// Function used to query the number of GPUs used for Crossfire acceleration. +/// This may be different from the total number of GPUs present in the system. +/// +/// \param [in] context Pointer to a context. +/// \param [out] numGPUs Number of GPUs used for Crossfire acceleration +/// +/// REMOVED IN 5.2.0 +AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* numGPUs ); + +/// +/// Function used to set a specific display into HDR mode +/// \note Setting all of the values apart from color space and transfer function to zero will cause the display to use defaults. +/// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc). +/// \note HDR10 PQ mode requires a 1010102 swapchain. +/// \note HDR10 scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR Gamma 2.2 mode requires a 1010102 swapchain. +/// \note Dolby Vision requires a 8888 UNORM swapchain. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize +/// \param [in] deviceIndex The index of the device listed in \ref AGSGPUInfo::devices. +/// \param [in] displayIndex The index of the display listed in \ref AGSDeviceInfo::displays. +/// \param [in] settings Pointer to the display settings to use. +/// +AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceIndex, int displayIndex, const AGSDisplaySettings* settings ); + +/// @} + +/// \defgroup dx12 DirectX12 Extensions +/// DirectX12 driver extensions +/// @{ + +/// \defgroup dx12init Device and device object creation and cleanup +/// It is now mandatory to call \ref agsDriverExtensionsDX12_CreateDevice when creating a device if the user wants to access any future DX12 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX12_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. +/// @{ + +/// The struct to specify the DX12 device creation parameters +typedef struct AGSDX12DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Pointer to the adapter to use when creating the device. This may be null. + IID iid; ///< The interface ID for the type of device to be created. + D3D_FEATURE_LEVEL FeatureLevel; ///< The minimum feature level to create the device with. +} AGSDX12DeviceCreationParams; + +/// The struct to specify DX12 additional device creation parameters +typedef struct AGSDX12ExtensionParams +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version + // ADDED IN 5.4.0 + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. Refer to the \ref agsDriverExtensionsDX12_CreateDevice documentation for more details. +} AGSDX12ExtensionParams; + +/// The struct to hold all the returned parameters from the device creation call +typedef struct AGSDX12ReturnedParams +{ + ID3D12Device* pDevice; ///< The newly created device + /* + This was changed to a struct in 6.0.0+ but it's still the size of an unsigned int. + Ignoring this change for now. + + typedef struct ExtensionsSupported /// Extensions for DX12 + { + unsigned int intrinsics16 : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. ReadFirstLane, ReadLane, LaneID, Swizzle, Ballot, MBCount, Med3, Barycentrics + unsigned int intrinsics17 : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. WaveReduce, WaveScan + unsigned int userMarkers : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int appRegistration : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int UAVBindSlot : 1; ///< Supported in Radeon Software Version 19.5.1 onwards. + unsigned int intrinsics19 : 1; ///< Supported in Radeon Software Version 19.12.2 onwards. DrawIndex, AtomicU64 + unsigned int baseVertex : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseInstance : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int getWaveSize : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. + unsigned int floatConversion : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. + unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. + unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. + unsigned int shaderClock : 1; ///< Supported in Radeon Software Version 23.1.1 onwards. + unsigned int padding : 19; ///< Reserved + } ExtensionsSupported; + ExtensionsSupported extensionsSupported; ///< List of supported extensions + */ + + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX12_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX12 +} AGSDX12ReturnedParams; + + +// Description +// Function used to query the number of GPUs in the system. +// This number may be different from agsGetCrossfireGPUCount as it reports +// all devices installed in the system, and not only those configured for +// Crossfire. +// +// Input params +// context - Pointer to a context. +// +// Output params +// numGPUs - Number of GPUs in the system. +// +AMD_AGS_API AGSReturnCode agsGetTotalGPUCount( AGSContext* context, int* numGPUs ); + +// Description +// Function used to query the memory size of a GPU. The number of GPUs should +// be obtained using agsGetTotalGPUCount +// +// Input params +// context - Pointer to a context. +// gpuIndex - The GPU index to query +// +// Output params +// sizeInBytes - Memory size on the device in bytes +// +AMD_AGS_API AGSReturnCode agsGetGPUMemorySize( AGSContext* context, int gpuIndex, long long* sizeInBytes ); + +// Description +// Function used to query Eyefinity configuration state information relevant to ISVs. State info returned +// includes: whether Eyefinity is enabled or not, SLS grid configuration, SLS dimensions, whether bezel +// compensation is enabled or not, SLS grid coordinate for each display, total rendering area for each +// display, visible rendering area for each display, and a preferred display flag. +// +// This function needs to be called twice. Firstly to null into eyefinityInfo and displaysInfo. This will +// return the number of AGSDisplayInfo objects to allocate. +// Second call requires valid pointers to eyefinityInfo and the newly allocated displaysInfo array. It is the +// responsibility of the caller to free this memory. +// +// +// Input params +// context - Pointer to a context. +// displayIndex - Operating system specific display index identifier. The value used should be the +// index of the display used for rendering operations. On Windows operating systems, +// the value can be queried using the EnumDisplayDevices() API. +// +// Output params +// eyefinityInfo - This is a pointer to an AGSEyefinityInfo structure that contains system Eyefinity +// configuration information. +// numDisplaysInfo - Pointer to the number of AGSDisplayInfo structures stored in the returned +// displaysInfo array. The value returned is equal to the number of displays +// used for the Eyefinity setup. +// displaysInfo - Pointer to an array of AGSDisplayInfo structures that contains per display +// Eyefinity configuration information. +// +AMD_AGS_API AGSReturnCode agsGetEyefinityConfigInfo( AGSContext *context, int displayIndex, AGSEyefinityInfo *eyefinityInfo, int *numDisplaysInfo, AGSDisplayInfo_403 *displaysInfo ); + +/// +/// Function used to create a D3D12 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. +/// * The intrinsic instructions require a 5.1 shader model. +/// * The Root Signature will need to reserve an extra UAV resource slot. This is not a real resource that requires allocating, it is just used to encode the intrinsic instructions. +/// +/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID. +/// The HLSL expects this as default and the set up code would look similar to this: +/// \code{.cpp} +/// CD3DX12_DESCRIPTOR_RANGE range[]; +/// ... +/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INTRINSICS_SPACE_ID ); // u0 at driver-reserved space id +/// \endcode +/// +/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGSDX12ReturnedParams::ExtensionsSupported::UAVBindSlot bit is set. +/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID must be used. +/// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize +/// \param [in] creationParams Pointer to the struct to specify the existing DX12 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX12 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_CreateDevice( AGSContext* context, const AGSDX12DeviceCreationParams* creationParams, const AGSDX12ExtensionParams* extensionParams, AGSDX12ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D12 device. +/// This call will also cleanup any AMD-specific driver extensions for D3D12. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D12 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DestroyDevice( AGSContext* context, ID3D12Device* device, unsigned int* deviceReferences ); + +/// +/// Function used to initialize the AMD-specific driver extensions for D3D12. +/// Extensions require support in the driver, therefore it is important to check the extensionsSupported bitfield. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION option, otherwise it will not work. +/// * The intrinsic instructions require a 5.1 shader model. +/// * The Root Signature will need to use an extra resource and sampler. These are not real resources/samplers, they are just used to encode the intrinsic instruction. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize +/// \param [in] device The D3D12 device. +/// \param [out] extensionsSupported Pointer to a bit mask that this function will fill in to indicate which extensions are supported. See ::AGSDriverExtensionDX12 +/// +/// REMOVED IN 5.2.0 +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ); + +/// +/// Function used to cleanup any AMD-specific driver extensions for D3D12 +/// +/// \param [in] context Pointer to a context. +/// +/// REMOVED IN 5.2.0 +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); + +/// @} + +/// \defgroup dx12usermarkers User Markers +/// @{ + +/// +/// Function used to push an AMD user marker onto the command list. +/// This is only has an effect if \ref AGSDX12ReturnedParams::ExtensionsSupported::userMarkers is present. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PushMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// +/// Function used to pop an AMD user marker on the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PopMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList ); + +/// +/// Function used to insert an single event AMD user marker onto the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// @} + +/// @} + +/// \defgroup dx11 DirectX11 Extensions +/// DirectX11 driver extensions +/// @{ + +/// \defgroup dx11init Device creation and cleanup +/// It is now mandatory to call \ref agsDriverExtensionsDX11_CreateDevice when creating a device if the user wants to access any DX11 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX11_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. +/// @{ + +/// The struct to specify the existing DX11 device creation parameters +typedef struct AGSDX11DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + D3D_DRIVER_TYPE DriverType; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + HMODULE Software; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT Flags; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const D3D_FEATURE_LEVEL* pFeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT FeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT SDKVersion; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc; ///< Optional swapchain description. Specify this to invoke D3D11CreateDeviceAndSwapChain instead of D3D11CreateDevice. This must be null on the WACK compliant version +} AGSDX11DeviceCreationParams; + +/// The struct to specify DX11 additional device creation parameters +typedef struct AGSDX11ExtensionParams_511 +{ + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. #define AmdDxExtShaderIntrinsicsUAVSlot. + /// The default slot is 7, but the caller is free to use an alternative slot. + const WCHAR* pAppName; ///< Application name + UINT appVersion; ///< Application version + const WCHAR* pEngineName; ///< Engine name + UINT engineVersion; ///< Engine version +} AGSDX11ExtensionParams_511; + +typedef struct AGSDX11ExtensionParams_520 +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version + unsigned int numBreadcrumbMarkers; ///< The number of breadcrumb markers to allocate. Each marker is a uint64 (ie 8 bytes). If 0, the system is disabled. + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. "#define AmdDxExtShaderIntrinsicsUAVSlot". + /// The default slot is 7, but the caller is free to use an alternative slot. + /// If 0 is specified, then the default of 7 will be used. + AGSCrossfireMode crossfireMode; ///< Desired Crossfire mode +} AGSDX11ExtensionParams_520; + +typedef union AGSDX11ExtensionParams +{ + AGSDX11ExtensionParams_511 agsDX11ExtensionParams511; + AGSDX11ExtensionParams_520 agsDX11ExtensionParams520; +} AGSDX11ExtensionParams; + +/// The struct to hold all the returned parameters from the device creation call +typedef struct AGSDX11ReturnedParams_511 +{ + ID3D11Device* pDevice; ///< The newly created device + D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See AGSDriverExtensionDX11 +} AGSDX11ReturnedParams_511; + +typedef struct AGSDX11ReturnedParams_520 +{ + ID3D11Device* pDevice; ///< The newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version + D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX11 + unsigned int crossfireGPUCount; ///< The number of GPUs that are active for this app + void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful. +} AGSDX11ReturnedParams_520; + +typedef struct AGSDX11ExtensionsSupported_600 /// Extensions for DX11 +{ + unsigned int quadList : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int screenRectList : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int uavOverlap : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int depthBoundsTest : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int multiDrawIndirect : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int multiDrawIndirectCountIndirect : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int crossfireAPI : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int createShaderControls : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int intrinsics16 : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. ReadFirstLane, ReadLane, LaneID, Swizzle, Ballot, MBCount, Med3, Barycentrics + unsigned int multiView : 1; ///< Supported in Radeon Software Version 16.12.1 onwards. + unsigned int intrinsics17 : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. WaveReduce, WaveScan + unsigned int appRegistration : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int breadcrumbMarkers : 1; ///< Supported in Radeon Software Version 17.11.1 onwards. + unsigned int MDIDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int UAVOverlapDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int depthBoundsDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int intrinsics19 : 1; ///< Supported in Radeon Software Version 19.12.2 onwards. DrawIndex, AtomicU64 + unsigned int getWaveSize : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseVertex : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseInstance : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int padding : 12; ///< Reserved +} AGSDX11ExtensionsSupported_600; + +typedef struct AGSDX11ReturnedParams_600 +{ + ID3D11Device* pDevice; ///< The newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. + D3D_FEATURE_LEVEL featureLevel; ///< The feature level supported by the newly created device + AGSDX11ExtensionsSupported_600 extensionsSupported; ///< List of supported extensions + unsigned int crossfireGPUCount; ///< The number of GPUs that are active for this app + void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful +} AGSDX11ReturnedParams_600; + +typedef union AGSDX11ReturnedParams +{ + AGSDX11ReturnedParams_511 agsDX11ReturnedParams511; + AGSDX11ReturnedParams_520 agsDX11ReturnedParams520; + AGSDX11ReturnedParams_600 agsDX11ReturnedParams600; +} AGSDX11ReturnedParams; + +/// +/// Function used to create a D3D11 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInititalize +/// \param [in] creationParams Pointer to the struct to specify the existing DX11 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX11 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* context, const AGSDX11DeviceCreationParams* creationParams, const AGSDX11ExtensionParams* extensionParams, AGSDX11ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D11 device and its immediate context. +/// This call will also cleanup any AMD-specific driver extensions for D3D11. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D11 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// \param [in] immediateContext Pointer to the D3D11 immediate device context. +/// \param [out] immediateContextReferences Optional pointer to an unsigned int that will be set to the value returned from immediateContext->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_520( AGSContext* context, ID3D11Device* device, unsigned int* deviceReferences, ID3D11DeviceContext* immediateContext, unsigned int* immediateContextReferences ); + + +/// +/// Function to destroy the D3D11 device. +/// This call will also cleanup any AMD-specific driver extensions for D3D11. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D11 device. +/// \param [out] references Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_511( AGSContext* context, ID3D11Device* device, unsigned int* references ); + +/// @} + + +/// \defgroup dx11appreg App Registration +/// @{ +/// This extension allows an apllication to voluntarily register itself with the driver, providing a more robust app detection solution and avoid the issue of the driver +/// relying on exe names to match the app to a driver profile. +/// This feature is supported in Radeon Software Version 17.9.2 onwards. +/// Rules: +/// * AppName or EngineName must be set, but both are not required. Engine profiles will be used only if app specific profiles do not exist. +/// * In an engine, the EngineName should be set, so a default profile can be built. If an app modifies the engine, the AppName should be set, to allow a profile for the specific app. +/// * Version number is not mandatory, but heavily suggested. The use of which can prevent the use of profiles for incompatible versions (for instance engine versions that introduce or change features), and can help prevent older profiles from being used (and introducing new bugs) before the profile is tested with new app builds. +/// * If Version numbers are used and a new version is introduced, a new profile will not be enabled until an AMD engineer has been able to update a previous profile, or make a new one. +/// +/// The cases for profile selection are as follows: +/// +/// |Case|Profile Applied| +/// |----|---------------| +/// | App or Engine Version has profile | The profile is used. | +/// | App or Engine Version num < profile version num | The closest profile > the version number is used. | +/// | App or Engine Version num > profile version num | No profile selected/The previous method is used. | +/// | App and Engine Version have profile | The App's profile is used. | +/// | App and Engine Version num < profile version | The closest App profile > the version number is used. | +/// | App and Engine Version, no App profile found | The Engine profile will be used. | +/// | App/Engine name but no Version, has profile | The latest profile is used. | +/// | No name or version, or no profile | The previous app detection method is used. | +/// +/// As shown above, if an App name is given, and a profile is found for that app, that will be prioritized. The Engine name and profile will be used only if no app name is given, or no viable profile is found for the app name. +/// In the case that App nor Engine have a profile, the previous app detection methods will be used. If given a version number that is larger than any profile version number, no profile will be selected. +/// This is specifically to prevent cases where an update to an engine or app will cause catastrophic breaks in the profile, allowing an engineer to test the profile before clearing it for public use with the new engine/app update. +/// +/// @} + +/// \defgroup breadcrumbs Breadcrumb API +/// API for writing top-of-pipe and bottom-of-pipe markers to help track down GPU hangs. +/// +/// The API is available if the \ref AGSDX11ReturnedParams::ExtensionsSupported::breadcrumbMarkers is present. +/// +/// To use the API, a non zero value needs to be specificed in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers. This enables the API (if available) and allocates a system memory buffer +/// which is returned to the user in \ref AGSDX11ReturnedParams::breadcrumbBuffer. +/// +/// The user can now write markers before and after draw calls using \ref agsDriverExtensionsDX11_WriteBreadcrumb. +/// +/// \section background Background +/// +/// A top-of-pipe (TOP) command is scheduled for execution as soon as the command processor (CP) reaches the command. +/// A bottom-of-pipe (BOP) command is scheduled for execution once the previous rendering commands (draw and dispatch) finish execution. +/// TOP and BOP commands do not block CP. i.e. the CP schedules the command for execution then proceeds to the next command without waiting. +/// To effectively use TOP and BOP commands, it is important to understand how they interact with rendering commands: +/// +/// When the CP encounters a rendering command it queues it for execution and moves to the next command. The queued rendering commands are issued in order. +/// There can be multiple rendering commands running in parallel. When a rendering command is issued we say it is at the top of the pipe. When a rendering command +/// finishes execution we say it has reached the bottom of the pipe. +/// +/// A BOP command remains in a waiting queue and is executed once prior rendering commands finish. The queue of BOP commands is limited to 64 entries in GCN generation 1, 2, 3, 4 and 5. +/// If the 64 limit is reached the CP will stop queueing BOP commands and also rendering commands. Developers should limit the number of BOP commands that write markers to avoid contention. +/// In general, developers should limit both TOP and BOP commands to avoid stalling the CP. +/// +/// \subsection eg1 Example 1: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(BottomOfPipe, 3) +/// DrawX +/// WriteMarker(BottomOfPipe, 4) +/// WriteMarker(BottomOfPipe, 5) +/// WriteMarker(TopOfPipe, 6) +/// // End of command buffer +/// \endcode +/// +/// In the above example, the CP writes markers 1, 2 and 3 without waiting: +/// Marker 1 is TOP so it's independent from other commands +/// There's no wait for marker 2 and 3 because there are no draws preceding the BOP commands +/// Marker 4 is only written once DrawX finishes execution +/// Marker 5 doesn't wait for additional draws so it is written right after marker 4 +/// Marker 6 can be written as soon as the CP reaches the command. For instance, it is very possible that CP writes marker 6 while DrawX +/// is running and therefore marker 6 gets written before markers 4 and 5 +/// +/// \subsection eg2 Example 2: +/// +/// \code{.cpp} +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(TopOfPipe, 3) +/// DrawY +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes execution +/// Similarly marker 3 is written before the start of DrawY +/// Marker 4 is written once DrawY finishes execution +/// In case of a GPU hang, if markers 1 and 3 are written but markers 2 and 4 are missing we can conclude that: +/// The CP has reached both DrawX and DrawY commands since marker 1 and 3 are present +/// The fact that marker 2 and 4 are missing means that either DrawX is hanging while DrawY is at the top of the pipe or both DrawX and DrawY +/// started and both are simultaneously hanging +/// +/// \subsection eg3 Example 3: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(BottomOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(BottomOfPipe, 3) +/// DrawZ +/// WriteMarker(BottomOfPipe, 4) +/// // End of command buffer +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes +/// Marker 3 is written once DrawY finishes +/// Marker 4 is written once DrawZ finishes +/// If the GPU hangs and only marker 1 is written we can conclude that the hang is happening in either DrawX, DrawY or DrawZ +/// If the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawY or DrawZ +/// If the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawZ +/// +/// \subsection eg4 Example 4: +/// +/// \code{.cpp} +/// Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(TopOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// DrawZ +/// // End of command buffer +/// \endcode +/// +/// In this example, in case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and all 3 markers are written we can conclude that the hang is happening in any of DrawX, DrawY or DrawZ +/// +/// \subsection eg5 Example 5: +/// +/// \code{.cpp} +/// DrawX +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// Marker 1 is written right after DrawX is queued for execution. +/// Marker 2 is only written once DrawX finishes execution. +/// Marker 3 is written right after DrawY is queued for execution. +/// Marker 4 is only written once DrawY finishes execution +/// If marker 1 is written we would know that the CP has reached the command DrawX (DrawX at the top of the pipe). +/// If marker 2 is written we can say that DrawX has finished execution (DrawX at the bottom of the pipe). +/// In case the GPU hangs and only marker 1 and 3 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawY +/// +/// \section data Retrieving GPU Data +/// +/// In the event of a GPU hang, the user can inspect the system memory buffer to determine which draw has caused the hang. +/// For example: +/// \code{.cpp} +/// // Force the work to be flushed to prevent CPU ahead of GPU +/// g_pImmediateContext->Flush(); +/// +/// // Present the information rendered to the back buffer to the front buffer (the screen) +/// HRESULT hr = g_pSwapChain->Present( 0, 0 ); +/// +/// // Read the marker data buffer once detect device lost +/// if ( hr != S_OK ) +/// { +/// for (UINT i = 0; i < g_NumMarkerWritten; i++) +/// { +/// UINT64* pTempData; +/// pTempData = static_cast(pMarkerBuffer); +/// +/// // Write the marker data to file +/// ofs << i << "\r\n"; +/// ofs << std::hex << *(pTempData + i * 2) << "\r\n"; +/// ofs << std::hex << *(pTempData + (i * 2 + 1)) << "\r\n"; +/// +/// WCHAR s1[256]; +/// setlocale(LC_NUMERIC, "en_US.iso88591"); +/// +/// // Output the marker data to console +/// swprintf(s1, 256, L" The Draw count is %d; The Top maker is % 016llX and the Bottom marker is % 016llX \r\n", i, *(pTempData + i * 2), *(pTempData + (i * 2 + 1))); +/// +/// OutputDebugStringW(s1); +/// } +/// } +/// \endcode +/// +/// The console output would resemble something like: +/// \code{.cpp} +/// D3D11: Removing Device. +/// D3D11 ERROR: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #378: DEVICE_REMOVAL_PROCESS_AT_FAULT] +/// The Draw count is 0; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 1; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 2; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 3; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 4; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 5; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 6; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 7; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// \endcode +/// +/// @{ + +/// The breadcrumb marker struct used by \ref agsDriverExtensionsDX11_WriteBreadcrumb +typedef struct AGSBreadcrumbMarker +{ + unsigned long long markerData; ///< The user data to write. + enum + { + TopOfPipe = 0, ///< Top-of-pipe marker + BottomOfPipe = 1 ///< Bottom-of-pipe marker + } type; ///< Whether this marker is top or bottom of pipe. + unsigned int index; ///< The index of the marker. This should be less than the value specified in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers +} AGSBreadcrumbMarker; + +/// +/// Function to write a breadcrumb marker. +/// +/// This method inserts a write marker operation in the GPU command stream. In the case where the GPU is hanging the write +/// command will never be reached and the marker will never get written to memory. +/// +/// In order to use this function, \ref AGSDX11ExtensionParams::numBreadcrumbMarkers must be set to a non zero value. +/// +/// \param [in] context Pointer to a context. +/// \param [in] marker Pointer to a marker. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* context, const AGSBreadcrumbMarker* marker ); + +/// @} + +/// \defgroup dx11Topology Extended Topology +/// API for primitive topologies +/// @{ + +/// Additional topologies supported via extensions +typedef enum AGSPrimitiveTopologyDX11 +{ + AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list + AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list +} AGSPrimitiveTopologyDX11; + +/// +/// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should +/// be called to set ALL topology types. +/// +/// The Quad List extension is a convenient way to submit quads without using an index buffer. Note that this still submits two triangles at the driver level. +/// In order to use this function, AGS must already be initialized and agsDriverExtensionsDX11_Init must have been called successfully. +/// +/// The Screen Rect extension, which is only available on GCN hardware, allows the user to pass in three of the four corners of a rectangle. +/// The hardware then uses the bounding box of the vertices to rasterize the rectangle primitive (i.e. as a rectangle rather than two triangles). +/// \note Note that this will not return valid interpolated values, only valid SV_Position values. +/// \note If either the Quad List or Screen Rect extension are used, then agsDriverExtensionsDX11_IASetPrimitiveTopology should be called in place of the native DirectX11 equivalent all the time. +/// +/// \param [in] context Pointer to a context. +/// \param [in] topology The topology to set on the D3D11 device. This can be either an AGS-defined topology such as AGS_PRIMITIVE_TOPOLOGY_QUADLIST +/// or a standard D3D-defined topology such as D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP. +/// NB. the AGS-defined types will require casting to a D3D_PRIMITIVE_TOPOLOGY type. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSContext* context, enum D3D_PRIMITIVE_TOPOLOGY topology ); + +/// @} + +/// \defgroup dx11UAVOverlap UAV Overlap +/// API for enabling overlapping UAV writes +/// @{ + +/// +/// Function used indicate to the driver that it doesn't need to sync the UAVs bound for the subsequent set of back-to-back dispatches. +/// When calling back-to-back draw calls or dispatch calls that write to the same UAV, the AMD DX11 driver will automatically insert a barrier to ensure there are no write after write (WAW) hazards. +/// If the app can guarantee there is no overlap between the writes between these calls, then this extension will remove those barriers allowing the work to run in parallel on the GPU. +/// +/// Usage would be as follows: +/// \code{.cpp} +/// m_device->Dispatch( ... ); // First call that writes to the UAV +/// +/// // Disable automatic WAW syncs +/// agsDriverExtensionsDX11_BeginUAVOverlap( m_agsContext ); +/// +/// // Submit other dispatches that write to the same UAV concurrently +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); +/// +/// // Reenable automatic WAW syncs +/// agsDriverExtensionsDX11_EndUAVOverlap( m_agsContext ); +/// \endcode +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap_520( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); + +/// +/// Function used indicate to the driver it can no longer overlap the batch of back-to-back dispatches that has been submitted. +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap_520( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); + +/// @} + +/// \defgroup dx11DepthBoundsTest Depth Bounds Test +/// API for enabling depth bounds testing +/// @{ + +/// +/// Function used to set the depth bounds test extension +/// +/// \param [in] context Pointer to a context +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] enabled Whether to enable or disable the depth bounds testing. If disabled, the next two args are ignored. +/// \param [in] minDepth The near depth range to clip against. +/// \param [in] maxDepth The far depth range to clip against. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, bool enabled, float minDepth, float maxDepth ); + +/* Since 5.3.0 */ +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_530( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ); + +/// @} + +/// \defgroup mdi Multi Draw Indirect (MDI) +/// API for dispatching multiple instanced draw commands. +/// The multi draw indirect extensions allow multiple sets of DrawInstancedIndirect to be submitted in one API call. +/// The draw calls are issued on the GPU's command processor (CP), potentially saving the significant CPU overheads incurred by submitting the equivalent draw calls on the CPU. +/// +/// The extension allows the following code: +/// \code{.cpp} +/// // Submit n batches of DrawIndirect calls +/// for ( int i = 0; i < n; i++ ) +/// deviceContext->DrawIndexedInstancedIndirect( buffer, i * sizeof( cmd ) ); +/// \endcode +/// To be replaced by the following call: +/// \code{.cpp} +/// // Submit all n batches in one call +/// agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( m_agsContext, deviceContext, n, buffer, 0, sizeof( cmd ) ); +/// \endcode +/// +/// The buffer used for the indirect args must be of the following formats: +/// \code{.cpp} +/// // Buffer layout for agsDriverExtensions_MultiDrawInstancedIndirect +/// struct DrawInstancedIndirectArgs +/// { +/// UINT VertexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// +/// // Buffer layout for agsDriverExtensions_MultiDrawIndexedInstancedIndirect +/// struct DrawIndexedInstancedIndirectArgs +/// { +/// UINT IndexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartIndexLocation; +/// UINT BaseVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// \endcode +/// +/// Example usage can be seen in AMD's GeometryFX (https://github.com/GPUOpen-Effects/GeometryFX). In particular, in this file: https://github.com/GPUOpen-Effects/GeometryFX/blob/master/amd_geometryfx/src/AMD_GeometryFX_Filtering.cpp +/// +/// @{ + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// @} + +/// \defgroup shadercompiler Shader Compiler Controls +/// API for controlling DirectX11 shader compilation. +/// Check support for this feature using the AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS bit. +/// Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. +/// @{ + +/// +/// This method can be used to limit the maximum number of threads the driver uses for asynchronous shader compilation. +/// Setting it to 0 will disable asynchronous compilation completely and force the shaders to be compiled "inline" on the threads that call Create*Shader. +/// +/// This method can only be called before any shaders are created and being compiled by the driver. +/// If this method is called after shaders have been created the function will return AGS_FAILURE. +/// This function only sets an upper limit.The driver may create fewer threads than allowed by this function. +/// +/// \param [in] context Pointer to a context. +/// \param [in] numberOfThreads The maximum number of threads to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount( AGSContext* context, unsigned int numberOfThreads ); + +/// +/// This method can be used to determine the total number of asynchronous shader compile jobs that are either +/// queued for waiting for compilation or being compiled by the driver’'s asynchronous compilation threads. +/// This method can be called at any during the lifetime of the driver. +/// +/// \param [in] context Pointer to a context. +/// \param [out] numberOfJobs Pointer to the number of jobs in flight currently. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NumPendingAsyncCompileJobs( AGSContext* context, unsigned int* numberOfJobs ); + +/// +/// This method can be used to enable or disable the disk based shader cache. +/// Enabling/disabling the disk cache is not supported if is it disabled explicitly via Radeon Settings or by an app profile. +/// Calling this method under these conditions will result in AGS_FAILURE being returned. +/// It is recommended that this method be called before any shaders are created by the application and being compiled by the driver. +/// Doing so at any other time may result in the cache being left in an inconsistent state. +/// +/// \param [in] context Pointer to a context. +/// \param [in] enable Whether to enable the disk cache. 0 to disable, 1 to enable. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDiskShaderCacheEnabled( AGSContext* context, int enable ); + +/// @} + +/// \defgroup multiview Multiview +/// API for multiview broadcasting. +/// Check support for this feature using the AGS_DX11_EXTENSION_MULTIVIEW bit. +/// Supported in Radeon Software Version 16.12.1 (driver version 16.50.2001) onwards. +/// @{ + +/// +/// Function to control draw calls replication to multiple viewports and RT slices. +/// Setting any mask to 0 disables draw replication. +/// +/// \param [in] context Pointer to a context. +/// \param [in] vpMask Viewport control bit mask. +/// \param [in] rtSliceMask RT slice control bit mask. +/// \param [in] vpMaskPerRtSliceEnabled If 0, 16 lower bits of vpMask apply to all RT slices; if 1 each 16 bits of 64-bit mask apply to corresponding 4 RT slices. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetViewBroadcastMasks( AGSContext* context, unsigned long long vpMask, unsigned long long rtSliceMask, int vpMaskPerRtSliceEnabled ); + +/// +/// Function returns max number of supported clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [out] maxRectCount Returned max number of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_GetMaxClipRects( AGSContext* context, unsigned int* maxRectCount ); + +/// The inclusion mode for the rect +typedef enum AGSClipRect_Mode +{ + ClipRectIncluded = 0, ///< Include the rect + ClipRectExcluded = 1 ///< Exclude the rect +} AGSClipRect_Mode; + +/// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects +typedef struct AGSClipRect +{ + AGSClipRect_Mode mode; ///< Include/exclude rect region + AGSRect rect; ///< The rect to include/exclude +} AGSClipRect; + + + +/// +/// Function sets clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [in] clipRectCount Number of specified clip rectangles. Use 0 to disable clip rectangles. +/// \param [in] clipRects Array of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetClipRects( AGSContext* context, unsigned int clipRectCount, const AGSClipRect* clipRects ); + +/// @} + +/// \defgroup cfxapi Explicit Crossfire API +/// API for explicit control over Crossfire +/// @{ + +/// The Crossfire API transfer types +typedef enum AGSAfrTransferType +{ + AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking + AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking + AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer + AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory + AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory +} AGSAfrTransferType; + +/// The Crossfire API transfer engines +typedef enum AGSAfrTransferEngine +{ + AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers +} AGSAfrTransferEngine; + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] buffer Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateBuffer( AGSContext* context, const D3D11_BUFFER_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Buffer** buffer, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture1D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture1D( AGSContext* context, const D3D11_TEXTURE1D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture1D** texture1D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture2D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture2D( AGSContext* context, const D3D11_TEXTURE2D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture2D** texture2D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture3D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture3D( AGSContext* context, const D3D11_TEXTURE3D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture3D** texture3D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to notify the driver that we have finished writing to the resource this frame. +/// This will initiate a transfer for AGS_AFR_TRANSFER_1STEP_P2P, +/// AGS_AFR_TRANSFER_2STEP_NO_BROADCAST, and AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// \param [in] transferRegions An array of transfer regions (can be null to specify the whole area). +/// \param [in] subresourceArray An array of subresource indices (can be null to specify all subresources). +/// \param [in] numSubresources The number of subresources in subresourceArray OR number of transferRegions. Use 0 to specify ALL subresources and one transferRegion (which may be null if specifying the whole area). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndWrites( AGSContext* context, ID3D11Resource* resource, const D3D11_RECT* transferRegions, const unsigned int* subresourceArray, unsigned int numSubresources ); + +/// +/// This will notify the driver that the app will begin read/write access to the resource. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceBeginAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// +/// This is used for AGS_AFR_TRANSFER_1STEP_P2P to notify when it is safe to initiate a transfer. +/// This call in frame N-(NumGpus-1) allows a 1 step P2P in frame N to start. +/// This should be called after agsDriverExtensionsDX11_NotifyResourceEndWrites. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// @} + +/// @} + +/// \defgroup typedefs Function pointer typedefs +/// List of function pointer typedefs for the API +/// @{ + +typedef AMD_AGS_API AGSDriverVersionResult (*AGS_CHECKDRIVERVERSION)( const char*, unsigned int ); ///< \ref agsCheckDriverVersion +typedef AMD_AGS_API int (*AGS_GETVERSIONNUMBER)( void ); ///< \ref agsGetVersionNumber +typedef AMD_AGS_API AGSReturnCode (*AGS_INITIALIZE)( int, const AGSConfiguration*, AGSContext**, AGSGPUInfo_600* ); ///< \ref agsInitialize +typedef AMD_AGS_API AGSReturnCode (*AGS_DEINITIALIZE)( AGSContext* ); ///< \ref agsDeInitialize +typedef AMD_AGS_API AGSReturnCode (*AGS_SETDISPLAYMODE)( AGSContext*, int, int, const AGSDisplaySettings* ); ///< \ref agsSetDisplayMode +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_CREATEDEVICE)( AGSContext*, const AGSDX12DeviceCreationParams*, const AGSDX12ExtensionParams*, AGSDX12ReturnedParams* ); ///< \ref agsDriverExtensionsDX12_CreateDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_DESTROYDEVICE)( AGSContext*, ID3D12Device*, unsigned int* ); ///< \ref agsDriverExtensionsDX12_DestroyDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_PUSHMARKER)( AGSContext*, ID3D12GraphicsCommandList*, const char* ); ///< \ref agsDriverExtensionsDX12_PushMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_POPMARKER)( AGSContext*, ID3D12GraphicsCommandList* ); ///< \ref agsDriverExtensionsDX12_PopMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_SETMARKER)( AGSContext*, ID3D12GraphicsCommandList*, const char* ); ///< \ref agsDriverExtensionsDX12_SetMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATEDEVICE)( AGSContext*, const AGSDX11DeviceCreationParams*, const AGSDX11ExtensionParams*, AGSDX11ReturnedParams* ); ///< \ref agsDriverExtensionsDX11_CreateDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_DESTROYDEVICE)( AGSContext*, ID3D11Device*, unsigned int*, ID3D11DeviceContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_DestroyDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_WRITEBREADCRUMB)( AGSContext*, const AGSBreadcrumbMarker* ); ///< \ref agsDriverExtensionsDX11_WriteBreadcrumb +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_IASETPRIMITIVETOPOLOGY)( AGSContext*, enum D3D_PRIMITIVE_TOPOLOGY ); ///< \ref agsDriverExtensionsDX11_IASetPrimitiveTopology +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_BEGINUAVOVERLAP)( AGSContext*, ID3D11DeviceContext* ); ///< \ref agsDriverExtensionsDX11_BeginUAVOverlap +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_ENDUAVOVERLAP)( AGSContext*, ID3D11DeviceContext* ); ///< \ref agsDriverExtensionsDX11_EndUAVOverlap +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETDEPTHBOUNDS)( AGSContext*, ID3D11DeviceContext*, bool, float, float ); ///< \ref agsDriverExtensionsDX11_SetDepthBounds +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINSTANCEDINDIRECT)( AGSContext*, ID3D11DeviceContext*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawInstancedIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINDEXEDINSTANCEDINDIRECT)( AGSContext*, ID3D11DeviceContext*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINSTANCEDINDIRECTCOUNTINDIRECT)( AGSContext*, ID3D11DeviceContext*, ID3D11Buffer*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINDEXEDINSTANCEDINDIRECTCOUNTINDIRECT)( AGSContext*, ID3D11DeviceContext*, ID3D11Buffer*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETMAXASYNCCOMPILETHREADCOUNT)( AGSContext*, unsigned int ); ///< \ref agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NUMPENDINGASYNCOMPILEJOBS)( AGSContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_NumPendingAsyncCompileJobs +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETDISKSHADERCACHEENABLED)( AGSContext*, int ); ///< \ref agsDriverExtensionsDX11_SetDiskShaderCacheEnabled +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETVIEWBROADCASTMASKS)( AGSContext*, unsigned long long, unsigned long long, int ); ///< \ref agsDriverExtensionsDX11_SetViewBroadcastMasks +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_GETMAXCLIPRECTS)( AGSContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_GetMaxClipRects +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETCLIPRECTS)( AGSContext*, unsigned int, const AGSClipRect* ); ///< \ref agsDriverExtensionsDX11_SetClipRects +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATEBUFFER)( AGSContext*, const D3D11_BUFFER_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Buffer**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateBuffer +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE1D)( AGSContext*, const D3D11_TEXTURE1D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture1D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture1D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE2D)( AGSContext*, const D3D11_TEXTURE2D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture2D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture2D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE3D)( AGSContext*, const D3D11_TEXTURE3D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture3D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture3D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEENDWRITES)( AGSContext*, ID3D11Resource*, const D3D11_RECT*, const unsigned int*, unsigned int ); ///< \ref agsDriverExtensionsDX11_NotifyResourceEndWrites +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEBEGINALLACCESS)( AGSContext*, ID3D11Resource* ); ///< \ref agsDriverExtensionsDX11_NotifyResourceBeginAllAccess +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEENDALLACCESS)( AGSContext*, ID3D11Resource* ); ///< \ref agsDriverExtensionsDX11_NotifyResourceEndAllAccess +/// @} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // AMD_AGS_H diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec new file mode 100644 index 00000000000..744035a9a69 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -0,0 +1,59 @@ +@ stdcall agsDeInit(ptr) +@ stdcall agsDeInitialize(ptr) +@ stdcall agsCheckDriverVersion(ptr long) +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_BeginUAVOverlap() DX11_BeginUAVOverlap_impl +@ stub agsDriverExtensions_IASetPrimitiveTopology +@ stub agsDriverExtensionsDX11_CreateBuffer +@ stub agsDriverExtensions_CreateBuffer +@ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr) +@ stub agsDriverExtensionsDX11_CreateFromDevice +@ stub agsDriverExtensionsDX11_CreateTexture1D +@ stub agsDriverExtensionsDX11_CreateTexture2D +@ stub agsDriverExtensionsDX11_CreateTexture3D +@ stub agsDriverExtensions_CreateTexture1D +@ stub agsDriverExtensions_CreateTexture2D +@ stub agsDriverExtensions_CreateTexture3D +@ stdcall agsDriverExtensions_DeInit(ptr) +@ stdcall agsDriverExtensionsDX11_DeInit(ptr) +@ stub agsDriverExtensionsDX11_Destroy +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_DestroyDevice() +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_EndUAVOverlap() DX11_EndUAVOverlap_impl +@ stub agsDriverExtensionsDX11_GetMaxClipRects +@ stub agsDriverExtensionsDX11_IASetPrimitiveTopology +@ stdcall agsDriverExtensions_Init(ptr ptr ptr) +@ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect() DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_MultiDrawInstancedIndirect() DX11_MultiDrawInstancedIndirect_impl +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect() DX11_MultiDrawInstancedIndirectCountIndirect_impl +@ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess +@ stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess +@ stub agsDriverExtensionsDX11_NotifyResourceEndWrites +@ stub agsDriverExtensions_NotifyResourceBeginAllAccess +@ stub agsDriverExtensions_NotifyResourceEndAllAccess +@ stub agsDriverExtensions_NotifyResourceEndWrites +@ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs +@ stub agsDriverExtensionsDX11_SetClipRects +@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl +@ stdcall agsDriverExtensionsDX11_SetDiskShaderCacheEnabled(ptr long) +@ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount +@ stub agsDriverExtensionsDX11_SetViewBroadcastMasks +@ stub agsDriverExtensionsDX11_WriteBreadcrumb +@ stdcall agsDriverExtensionsDX12_CreateDevice(ptr ptr ptr ptr) +@ stub agsDriverExtensionsDX12_CreateFromDevice +@ stdcall agsDriverExtensionsDX12_DeInit(ptr) +@ stub agsDriverExtensionsDX12_Destroy +@ stdcall agsDriverExtensionsDX12_DestroyDevice(ptr ptr ptr) +@ stdcall agsDriverExtensionsDX12_Init(ptr ptr ptr) +@ stdcall agsDriverExtensionsDX12_PopMarker(ptr ptr) +@ stdcall agsDriverExtensionsDX12_PushMarker(ptr ptr ptr) +@ stdcall agsDriverExtensionsDX12_SetMarker(ptr ptr ptr) +@ stdcall agsGetCrossfireGPUCount(ptr ptr) +@ stdcall agsGetVersionNumber() +@ stdcall agsInit(ptr ptr ptr) +@ stdcall agsInitialize(long ptr ptr ptr) +@ stdcall agsSetDisplayMode(ptr long long ptr) +@ stdcall agsGetTotalGPUCount(ptr ptr) +@ stdcall agsGetGPUMemorySize(ptr long ptr) +@ stdcall agsGetEyefinityConfigInfo(ptr long ptr ptr ptr) +@ stdcall agsDriverExtensions_SetCrossfireMode(ptr long) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c new file mode 100644 index 00000000000..75f74e86b20 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -0,0 +1,1935 @@ +#include +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "wine/debug.h" +#include "wine/heap.h" + +#include "wine/vulkan.h" +#include "wine/asm.h" + +#define COBJMACROS +#include "initguid.h" +#include "d3d11.h" +#include "d3d12.h" + +#include "dxgi1_6.h" + +#include "dxvk_interfaces.h" + +#include "amd_ags.h" + +#include "unixlib.h" + +WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); + +#define AMD_AGS_CALL(func, args) WINE_UNIX_CALL( unix_ ## func, args ) + +static INIT_ONCE unix_init_once = INIT_ONCE_STATIC_INIT; +static BOOL unix_lib_initialized; + +static BOOL WINAPI init_unix_lib_once( INIT_ONCE *once, void *param, void **context ) +{ + unix_lib_initialized = !__wine_init_unix_call() && !AMD_AGS_CALL( init, NULL ); + return TRUE; +} + +static BOOL init_unix_lib(void) +{ + InitOnceExecuteOnce( &unix_init_once, init_unix_lib_once, NULL, NULL ); + return unix_lib_initialized; +} + +static const char driver_version[] = "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition"; +static const char radeon_version[] = "23.10.2"; + +enum amd_ags_version +{ + AMD_AGS_VERSION_4_0_3, + AMD_AGS_VERSION_5_0_5, + AMD_AGS_VERSION_5_1_1, + AMD_AGS_VERSION_5_2_0, + AMD_AGS_VERSION_5_3_0, + AMD_AGS_VERSION_5_4_0, + AMD_AGS_VERSION_5_4_1, + AMD_AGS_VERSION_5_4_2, + AMD_AGS_VERSION_6_0_0, + AMD_AGS_VERSION_6_1_0, + + AMD_AGS_VERSION_COUNT +}; + +static const struct +{ + unsigned int ags_min_public_version; + unsigned int ags_max_public_version; + unsigned int device_size; + unsigned int dx11_returned_params_size; + int max_asicFamily; +} +amd_ags_info[AMD_AGS_VERSION_COUNT] = +{ + {AGS_MAKE_VERSION(3, 1, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 3, 0), AGS_MAKE_VERSION(5, 3, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 4, 0), AGS_MAKE_VERSION(5, 4, 0), sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 1), AGS_MAKE_VERSION(5, 4, 1), sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 2), AGS_MAKE_VERSION(5, 4, 2), sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(6, 0, 0), AGS_MAKE_VERSION(6, 0, 1), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {AGS_MAKE_VERSION(6, 1, 0), AGS_MAKE_VERSION(6, 2, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, +}; + +#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} +#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), -1, \ + -1, -1, -1, -1}} +#define DEF_FIELD_520_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} +#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, -1, \ + -1, offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} +#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, -1, \ + -1, offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + -1, -1}} +#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + -1, -1}} + +#define DEVICE_FIELD_adapterString 0 +#define DEVICE_FIELD_architectureVersion 1 +#define DEVICE_FIELD_asicFamily 2 +#define DEVICE_FIELD_vendorId 3 +#define DEVICE_FIELD_deviceId 4 +#define DEVICE_FIELD_isPrimaryDevice 5 +#define DEVICE_FIELD_localMemoryInBytes 6 +#define DEVICE_FIELD_numDisplays 7 +#define DEVICE_FIELD_displays 8 +#define DEVICE_FIELD_isAPU 9 + +#define DEVICE_FIELD_numCUs 10 +#define DEVICE_FIELD_coreClock 11 +#define DEVICE_FIELD_memoryClock 12 +#define DEVICE_FIELD_teraFlops 13 +#define DEVICE_FIELD_numWGPs 14 +#define DEVICE_FIELD_numROPs 15 +#define DEVICE_FIELD_memoryBandwidth 16 + +static const struct +{ + unsigned int field_index; + int offset[AMD_AGS_VERSION_COUNT]; +} +device_struct_fields[] = +{ + DEF_FIELD(adapterString), + DEF_FIELD_520_BELOW(architectureVersion), + DEF_FIELD_540_UP(asicFamily), + DEF_FIELD(vendorId), + DEF_FIELD(deviceId), + DEF_FIELD_600_BELOW(isPrimaryDevice), + DEF_FIELD(localMemoryInBytes), + DEF_FIELD(numDisplays), + DEF_FIELD(displays), + DEF_FIELD_540_600(isAPU), + DEF_FIELD(numCUs), + DEF_FIELD(coreClock), + DEF_FIELD(memoryClock), + DEF_FIELD(teraFlops), + DEF_FIELD_540_UP(numWGPs), + DEF_FIELD_520_UP(numROPs), + DEF_FIELD_520_UP(memoryBandwidth), +}; + +#undef DEF_FIELD + +#define GET_DEVICE_FIELD_ADDR(device, name, type, version) \ + (device_struct_fields[DEVICE_FIELD_##name].offset[version] == -1 ? NULL \ + : (type *)((BYTE *)device + device_struct_fields[DEVICE_FIELD_##name].offset[version])) + +#define SET_DEVICE_FIELD(device, name, type, version, value) { \ + type *addr; \ + if ((addr = GET_DEVICE_FIELD_ADDR(device, name, type, version))) \ + *addr = value; \ + } + +struct AGSContext +{ + enum amd_ags_version version; + unsigned int device_count; + struct AGSDeviceInfo *devices; + VkPhysicalDeviceProperties *properties; + VkPhysicalDeviceMemoryProperties *memory_properties; + ID3D11DeviceContext *d3d11_context; + AGSDX11ExtensionsSupported_600 extensions; + unsigned int public_version; +}; + +static HMODULE hd3d11, hd3d12; +static typeof(D3D12CreateDevice) *pD3D12CreateDevice; +static typeof(D3D11CreateDevice) *pD3D11CreateDevice; +static typeof(D3D11CreateDeviceAndSwapChain) *pD3D11CreateDeviceAndSwapChain; + +#define AGS_VER_MAJOR(ver) ((ver) >> 22) +#define AGS_VER_MINOR(ver) (((ver) >> 12) & ((1 << 10) - 1)) +#define AGS_VER_PATCH(ver) ((ver) & ((1 << 12) - 1)) + +static const char *debugstr_agsversion(unsigned int ags_version) +{ + return wine_dbg_sprintf("%d.%d.%d", AGS_VER_MAJOR(ags_version), AGS_VER_MINOR(ags_version), AGS_VER_PATCH(ags_version)); +} + +static BOOL load_d3d12_functions(void) +{ + if (hd3d12) + return TRUE; + + if (!(hd3d12 = LoadLibraryA("d3d12.dll"))) + return FALSE; + + pD3D12CreateDevice = (void *)GetProcAddress(hd3d12, "D3D12CreateDevice"); + return TRUE; +} + +static BOOL load_d3d11_functions(void) +{ + if (hd3d11) + return TRUE; + + if (!(hd3d11 = LoadLibraryA("d3d11.dll"))) + return FALSE; + + pD3D11CreateDevice = (void *)GetProcAddress(hd3d11, "D3D11CreateDevice"); + pD3D11CreateDeviceAndSwapChain = (void *)GetProcAddress(hd3d11, "D3D11CreateDeviceAndSwapChain"); + return TRUE; +} + +static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, + VkPhysicalDeviceProperties **out, VkPhysicalDeviceMemoryProperties **out_memory) +{ + VkPhysicalDeviceProperties *properties = NULL; + VkPhysicalDeviceMemoryProperties *memory_properties = NULL; + VkPhysicalDevice *vk_physical_devices = NULL; + VkInstance vk_instance = VK_NULL_HANDLE; + VkInstanceCreateInfo create_info; + AGSReturnCode ret = AGS_SUCCESS; + uint32_t count, i; + VkResult vr; + + *out = NULL; + *out_count = 0; + + memset(&create_info, 0, sizeof(create_info)); + create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + if ((vr = vkCreateInstance(&create_info, NULL, &vk_instance) < 0)) + { + WARN("Failed to create Vulkan instance, vr %d.\n", vr); + goto done; + } + + if ((vr = vkEnumeratePhysicalDevices(vk_instance, &count, NULL)) < 0) + { + WARN("Failed to enumerate devices, vr %d.\n", vr); + goto done; + } + + if (!(vk_physical_devices = heap_calloc(count, sizeof(*vk_physical_devices)))) + { + WARN("Failed to allocate memory.\n"); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + + if ((vr = vkEnumeratePhysicalDevices(vk_instance, &count, vk_physical_devices)) < 0) + { + WARN("Failed to enumerate devices, vr %d.\n", vr); + goto done; + } + + if (!(properties = heap_calloc(count, sizeof(*properties)))) + { + WARN("Failed to allocate memory.\n"); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + + if (!(memory_properties = heap_calloc(count, sizeof(*memory_properties)))) + { + WARN("Failed to allocate memory.\n"); + heap_free(properties); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + + for (i = 0; i < count; ++i) + { + vkGetPhysicalDeviceProperties(vk_physical_devices[i], &properties[i]); + if (properties[i].deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU + && properties[i].deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) + { + TRACE("Skipping device type %d.\n", properties[i].deviceType); + --i; + --count; + continue; + } + vkGetPhysicalDeviceMemoryProperties(vk_physical_devices[i], &memory_properties[i]); + } + + *out_count = count; + *out = properties; + *out_memory = memory_properties; + +done: + heap_free(vk_physical_devices); + if (vk_instance) + vkDestroyInstance(vk_instance, NULL); + return ret; +} + +static enum amd_ags_version get_version_number(int ags_version) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) + if (ags_version >= amd_ags_info[i].ags_min_public_version && ags_version <= amd_ags_info[i].ags_max_public_version) + { + TRACE("Found AGS v%s (internal %d).\n", debugstr_agsversion(ags_version), i); + return i; + } + ERR("Unknown ags_version %s, using 5.4.1.\n", debugstr_agsversion(ags_version)); + return AMD_AGS_VERSION_5_4_1; +} + +static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_version *ret, int *public_version) +{ + DWORD infosize; + void *infobuf; + void *val; + UINT vallen; + VS_FIXEDFILEINFO *info; + UINT16 major, minor, patch; + + infosize = GetFileVersionInfoSizeW(filename, NULL); + if (!infosize) + { + ERR("File version info not found, err %u.\n", GetLastError()); + return FALSE; + } + + if (!(infobuf = heap_alloc(infosize))) + { + ERR("Failed to allocate memory.\n"); + return FALSE; + } + + if (!GetFileVersionInfoW(filename, 0, infosize, infobuf)) + { + ERR("GetFileVersionInfoW failed, err %u.\n", GetLastError()); + heap_free(infobuf); + return FALSE; + } + + if (!VerQueryValueW(infobuf, L"\\", &val, &vallen) || (vallen != sizeof(VS_FIXEDFILEINFO))) + { + ERR("Version value not found, err %u.\n", GetLastError()); + heap_free(infobuf); + return FALSE; + } + + info = val; + major = info->dwFileVersionMS >> 16; + minor = info->dwFileVersionMS; + patch = info->dwFileVersionLS >> 16; + *public_version = AGS_MAKE_VERSION(major, minor, patch); + TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); + *ret = get_version_number(*public_version); + heap_free(infobuf); + return TRUE; +} + +static enum amd_ags_version guess_version_from_exports(HMODULE hnative, int *ags_version) +{ + /* Known DLL versions without version info: + * - An update to AGS 5.4.1 included an amd_ags_x64.dll with no file version info; + * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 + * (not tagged in AGSSDK history), compatible with 5.0.5. + */ + if (GetProcAddress(hnative, "agsDriverExtensions_SetCrossfireMode")) + { + /* agsDriverExtensions_SetCrossfireMode was deprecated in 3.2.0 */ + TRACE("agsDriverExtensions_SetCrossfireMode found.\n"); + *ags_version = AGS_MAKE_VERSION(3, 1, 1); + return AMD_AGS_VERSION_4_0_3; + } + if (GetProcAddress(hnative, "agsDriverExtensions_Init")) + { + /* agsGetEyefinityConfigInfo was deprecated in 4.0.0 */ + TRACE("agsDriverExtensions_Init found.\n"); + *ags_version = AGS_MAKE_VERSION(3, 2, 2); + return AMD_AGS_VERSION_4_0_3; + } + if (GetProcAddress(hnative, "agsGetEyefinityConfigInfo")) + { + /* agsGetEyefinityConfigInfo was deprecated in 5.0.0 */ + TRACE("agsGetEyefinityConfigInfo found.\n"); + return AMD_AGS_VERSION_4_0_3; + } + if (GetProcAddress(hnative, "agsDriverExtensionsDX11_Init")) + { + /* agsDriverExtensionsDX11_Init was deprecated in 5.3.0 */ + TRACE("agsDriverExtensionsDX11_Init found.\n"); + return AMD_AGS_VERSION_5_0_5; + } + TRACE("Returning 5.4.1.\n"); + return AMD_AGS_VERSION_5_4_1; +} + +static enum amd_ags_version determine_ags_version(int *ags_version) +{ + /* AMD AGS is not binary compatible between versions (even minor versions), and the game + * does not request a specific version when calling agsInit(). + * Checking the version of amd_ags_x64.dll shipped with the game is the only way to + * determine what version the game was built against. + */ + enum amd_ags_version ret = AMD_AGS_VERSION_5_4_1; + WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; + int (WINAPI *pagsGetVersionNumber)(void); + HMODULE hnative = NULL; + DWORD size; + + TRACE("*ags_version %#x.\n", *ags_version); + + if (*ags_version) + return get_version_number(*ags_version); + + *temp_name = 0; + if (!(size = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) + || size == ARRAY_SIZE(dllname)) + { + ERR("GetModuleFileNameW failed.\n"); + goto done; + } + if (!GetTempPathW(MAX_PATH, temp_path) || !GetTempFileNameW(temp_path, L"tmp", 0, temp_name)) + { + ERR("Failed getting temp file name.\n"); + goto done; + } + if (!CopyFileW(dllname, temp_name, FALSE)) + { + ERR("Failed to copy file.\n"); + goto done; + } + + if (get_ags_version_from_resource(temp_name, &ret, ags_version)) + goto done; + + if (!(hnative = LoadLibraryW(temp_name))) + { + ERR("LoadLibraryW failed for %s.\n", debugstr_w(temp_name)); + goto done; + } + + if ((pagsGetVersionNumber = (void *)GetProcAddress(hnative, "agsGetVersionNumber"))) + { + *ags_version = pagsGetVersionNumber(); + ret = get_version_number(*ags_version); + TRACE("Got version %s (%d) from agsGetVersionNumber.\n", debugstr_agsversion(*ags_version), ret); + goto done; + } + + ret = guess_version_from_exports(hnative, ags_version); + +done: + if (!*ags_version) + *ags_version = amd_ags_info[ret].ags_max_public_version; + + if (hnative) + FreeLibrary(hnative); + + if (*temp_name) + DeleteFileW(temp_name); + + TRACE("Using AGS v%s (internal %d) interface\n", debugstr_agsversion(*ags_version), ret); + return ret; +} + +struct monitor_enum_context_600 +{ + const char *adapter_name; + AGSDisplayInfo_600 **ret_displays; + int *ret_display_count; + IDXGIFactory1 *dxgi_factory; +}; + +static void create_dxgi_factory(HMODULE *hdxgi, IDXGIFactory1 **factory) +{ + typeof(CreateDXGIFactory1) *pCreateDXGIFactory1; + + *factory = NULL; + + if (!(*hdxgi = LoadLibraryW(L"dxgi.dll"))) + { + ERR("Could not load dxgi.dll.\n"); + return; + } + + if (!(pCreateDXGIFactory1 = (void *)GetProcAddress(*hdxgi, "CreateDXGIFactory1"))) + { + ERR("Could not find CreateDXGIFactory1.\n"); + return; + } + + if (FAILED(pCreateDXGIFactory1(&IID_IDXGIFactory1, (void**)factory))) + return; +} + +static void release_dxgi_factory(HMODULE hdxgi, IDXGIFactory1 *factory) +{ + if (factory) + IDXGIFactory1_Release(factory); + if (hdxgi) + FreeLibrary(hdxgi); +} + +static void fill_chroma_info(AGSDisplayInfo_600 *info, struct monitor_enum_context_600 *c, HMONITOR monitor) +{ + DXGI_OUTPUT_DESC1 output_desc; + IDXGIAdapter1 *adapter; + IDXGIOutput6 *output6; + IDXGIOutput *output; + BOOL found = FALSE; + unsigned int i, j; + HRESULT hr; + + i = 0; + while (!found && (SUCCEEDED(IDXGIFactory1_EnumAdapters1(c->dxgi_factory, i++, &adapter)))) + { + j = 0; + while (SUCCEEDED(IDXGIAdapter1_EnumOutputs(adapter, j++, &output))) + { + hr = IDXGIOutput_QueryInterface(output, &IID_IDXGIOutput6, (void**)&output6); + IDXGIOutput_Release(output); + if (FAILED(hr)) + { + WARN("Failed to query IDXGIOutput6.\n"); + continue; + } + hr = IDXGIOutput6_GetDesc1(output6, &output_desc); + IDXGIOutput6_Release(output6); + + if (FAILED(hr) || output_desc.Monitor != monitor) + continue; + found = TRUE; + + TRACE("output_desc.ColorSpace %#x.\n", output_desc.ColorSpace); + if (output_desc.ColorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020) + { + TRACE("Reporting monitor %s as HDR10 supported.\n", debugstr_a(info->displayDeviceName)); + info->HDR10 = 1; + } + + info->chromaticityRedX = output_desc.RedPrimary[0]; + info->chromaticityRedY = output_desc.RedPrimary[1]; + info->chromaticityGreenX = output_desc.GreenPrimary[0]; + info->chromaticityGreenY = output_desc.GreenPrimary[1]; + info->chromaticityBlueX = output_desc.BluePrimary[0]; + info->chromaticityBlueY = output_desc.BluePrimary[1]; + info->chromaticityWhitePointX = output_desc.WhitePoint[0]; + info->chromaticityWhitePointY = output_desc.WhitePoint[1]; + + TRACE("chromacity: (%.6lf, %.6lf) (%.6lf, %.6lf) (%.6lf, %.6lf).\n", info->chromaticityRedX, + info->chromaticityRedY, info->chromaticityGreenX, info->chromaticityGreenY, info->chromaticityBlueX, + info->chromaticityBlueY); + + info->screenDiffuseReflectance = 0; + info->screenSpecularReflectance = 0; + + info->minLuminance = output_desc.MinLuminance; + info->maxLuminance = output_desc.MaxLuminance; + info->avgLuminance = output_desc.MaxFullFrameLuminance; + } + IDXGIAdapter1_Release(adapter); + } + + if (!found) + WARN("dxgi output not found.\n"); +} + +static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, LPARAM context) +{ + struct monitor_enum_context_600 *c = (struct monitor_enum_context_600 *)context; + MONITORINFOEXA monitor_info; + AGSDisplayInfo_600 *new_alloc; + DISPLAY_DEVICEA device; + AGSDisplayInfo_600 *info; + unsigned int i, mode; + DEVMODEA dev_mode; + + + monitor_info.cbSize = sizeof(monitor_info); + GetMonitorInfoA(hmonitor, (MONITORINFO *)&monitor_info); + TRACE("monitor_info.szDevice %s.\n", debugstr_a(monitor_info.szDevice)); + + device.cb = sizeof(device); + i = 0; + while (EnumDisplayDevicesA(NULL, i, &device, 0)) + { + TRACE("device.DeviceName %s, device.DeviceString %s.\n", debugstr_a(device.DeviceName), debugstr_a(device.DeviceString)); + ++i; + if (strcmp(device.DeviceString, c->adapter_name) || strcmp(device.DeviceName, monitor_info.szDevice)) + continue; + + if (*c->ret_display_count) + { + if (!(new_alloc = heap_realloc(*c->ret_displays, sizeof(*new_alloc) * (*c->ret_display_count + 1)))) + { + ERR("No memory."); + return FALSE; + } + *c->ret_displays = new_alloc; + } + else if (!(*c->ret_displays = heap_alloc(sizeof(**c->ret_displays)))) + { + ERR("No memory."); + return FALSE; + } + info = &(*c->ret_displays)[*c->ret_display_count]; + memset(info, 0, sizeof(*info)); + strcpy(info->displayDeviceName, device.DeviceName); + if (EnumDisplayDevicesA(info->displayDeviceName, 0, &device, 0)) + { + strcpy(info->name, device.DeviceString); + } + else + { + ERR("Could not get monitor name for device %s.\n", debugstr_a(info->displayDeviceName)); + strcpy(info->name, "Unknown"); + } + if (monitor_info.dwFlags & MONITORINFOF_PRIMARY) + info->isPrimaryDisplay = 1; + + mode = 0; + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + while (EnumDisplaySettingsExA(monitor_info.szDevice, mode, &dev_mode, EDS_RAWMODE)) + { + ++mode; + if (dev_mode.dmPelsWidth > info->maxResolutionX) + info->maxResolutionX = dev_mode.dmPelsWidth; + if (dev_mode.dmPelsHeight > info->maxResolutionY) + info->maxResolutionY = dev_mode.dmPelsHeight; + if (dev_mode.dmDisplayFrequency > info->maxRefreshRate) + info->maxRefreshRate = dev_mode.dmDisplayFrequency; + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + } + + info->eyefinityGridCoordX = -1; + info->eyefinityGridCoordY = -1; + + info->currentResolution.offsetX = monitor_info.rcMonitor.left; + info->currentResolution.offsetY = monitor_info.rcMonitor.top; + info->currentResolution.width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left; + info->currentResolution.height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top; + info->visibleResolution = info->currentResolution; + + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + + if (EnumDisplaySettingsExA(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &dev_mode, EDS_RAWMODE)) + info->currentRefreshRate = dev_mode.dmDisplayFrequency; + else + ERR("Could not get current display settings.\n"); + + fill_chroma_info(info, c, hmonitor); + + ++*c->ret_display_count; + + TRACE("Added display %s for %s.\n", debugstr_a(monitor_info.szDevice), debugstr_a(c->adapter_name)); + } + + return TRUE; +} + +static void init_device_displays_600(const char *adapter_name, AGSDisplayInfo_600 **ret_displays, int *ret_display_count) +{ + struct monitor_enum_context_600 context; + HMODULE hdxgi; + + TRACE("adapter_name %s.\n", debugstr_a(adapter_name)); + + context.adapter_name = adapter_name; + context.ret_displays = ret_displays; + context.ret_display_count = ret_display_count; + create_dxgi_factory(&hdxgi, &context.dxgi_factory); + + EnumDisplayMonitors(NULL, NULL, monitor_enum_proc_600, (LPARAM)&context); + release_dxgi_factory(hdxgi, context.dxgi_factory); +} + +static void init_device_displays_511(const char *adapter_name, AGSDisplayInfo_511 **ret_displays, int *ret_display_count) +{ + AGSDisplayInfo_600 *displays = NULL; + int display_count = 0; + int i; + *ret_displays = NULL; + *ret_display_count = 0; + + init_device_displays_600(adapter_name, &displays, &display_count); + + if ((*ret_displays = heap_alloc(sizeof(**ret_displays) * display_count))) + { + for (i = 0; i < display_count; i++) + { + memcpy(&(*ret_displays)[i], &displays[i], sizeof(AGSDisplayInfo_511)); + } + *ret_display_count = display_count; + } + + heap_free(displays); +} + +static int hide_apu(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *s; + + cached = ((s = getenv("WINE_HIDE_APU"))) && *s != '0'; + if (cached) + FIXME("hack: hiding APU.\n"); + } + return cached; +} + +static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) +{ + AGSReturnCode ret; + unsigned int i, j; + BYTE *device; + + memset(context, 0, sizeof(*context)); + + context->version = determine_ags_version(&ags_version); + context->public_version = ags_version; + + ret = vk_get_physical_device_properties(&context->device_count, &context->properties, &context->memory_properties); + if (ret != AGS_SUCCESS || !context->device_count) + return ret; + + assert(context->version < AMD_AGS_VERSION_COUNT); + + if (!(context->devices = heap_calloc(context->device_count, amd_ags_info[context->version].device_size))) + { + WARN("Failed to allocate memory.\n"); + heap_free(context->properties); + heap_free(context->memory_properties); + return AGS_OUT_OF_MEMORY; + } + + device = (BYTE *)context->devices; + for (i = 0; i < context->device_count; ++i) + { + const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; + const VkPhysicalDeviceMemoryProperties *vk_memory_properties = &context->memory_properties[i]; + struct AGSDeviceInfo_600 *device_600 = (struct AGSDeviceInfo_600 *)device; + VkDeviceSize local_memory_size = 0; + + for (j = 0; j < vk_memory_properties->memoryHeapCount; j++) + { + if (vk_memory_properties->memoryHeaps[j].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + { + local_memory_size = vk_memory_properties->memoryHeaps[j].size; + break; + } + } + + TRACE("device %s, type %d, %04x:%04x, reporting local memory size 0x%s bytes\n", + debugstr_a(vk_properties->deviceName), vk_properties->deviceType, + vk_properties->vendorID, vk_properties->deviceID, wine_dbgstr_longlong(local_memory_size)); + + SET_DEVICE_FIELD(device, adapterString, const char *, context->version, vk_properties->deviceName); + SET_DEVICE_FIELD(device, vendorId, int, context->version, vk_properties->vendorID); + SET_DEVICE_FIELD(device, deviceId, int, context->version, vk_properties->deviceID); + if (vk_properties->vendorID == 0x1002) + { + struct get_device_info_params params = + { + .device_id = vk_properties->deviceID, + }; + + SET_DEVICE_FIELD(device, architectureVersion, ArchitectureVersion, context->version, ArchitectureVersion_GCN); + if (init_unix_lib() && !AMD_AGS_CALL(get_device_info, ¶ms)) + { + SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, + min(params.asic_family, amd_ags_info[context->version].max_asicFamily)); + SET_DEVICE_FIELD(device, numCUs, int, context->version, params.num_cu); + SET_DEVICE_FIELD(device, numWGPs, int, context->version, params.num_wgp); + SET_DEVICE_FIELD(device, numROPs, int, context->version, params.num_rops); + SET_DEVICE_FIELD(device, coreClock, int, context->version, params.core_clock); + SET_DEVICE_FIELD(device, memoryClock, int, context->version, params.memory_clock); + SET_DEVICE_FIELD(device, memoryBandwidth, int, context->version, params.memory_bandwidth); + SET_DEVICE_FIELD(device, teraFlops, float, context->version, params.teraflops); + } + else + { + SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); + } + if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && !hide_apu()) + { + if (context->version >= AMD_AGS_VERSION_6_0_0) + device_600->isAPU = 1; + else + SET_DEVICE_FIELD(device, isAPU, int, context->version, 1); + } + } + SET_DEVICE_FIELD(device, localMemoryInBytes, ULONG64, context->version, local_memory_size); + if (!i) + { + if (context->version >= AMD_AGS_VERSION_6_0_0) + { + // This is a bitfield now... Nice... + device_600->isPrimaryDevice = 1; + } + else + { + SET_DEVICE_FIELD(device, isPrimaryDevice, int, context->version, 1); + } + } + + if (context->version >= AMD_AGS_VERSION_6_0_0) + { + init_device_displays_600(vk_properties->deviceName, + GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo_600 *, context->version), + GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + } + else + { + init_device_displays_511(vk_properties->deviceName, + GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo_511 *, context->version), + GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + } + + device += amd_ags_info[context->version].device_size; + } + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *config, AGSGPUInfo_511 *gpu_info) +{ + struct AGSContext *object; + AGSReturnCode ret; + + TRACE("context %p, config %p, gpu_info %p.\n", context, config, gpu_info); + + if (!context) + return AGS_INVALID_ARGS; + + if (config) + FIXME("Ignoring config %p.\n", config); + + if (!(object = heap_alloc(sizeof(*object)))) + return AGS_OUT_OF_MEMORY; + + if ((ret = init_ags_context(object, 0)) != AGS_SUCCESS) + { + heap_free(object); + return ret; + } + + if (object->public_version <= AGS_MAKE_VERSION(3, 1, 1)) + { + /* Unfortunately it doesn't look sanely possible to distinguish 3.1.1 and 3.1.0 versions, while in + * 3.1.0 radeonSoftwareVersion was present, removed in 3.1.1 and brought back in 3.2.2. */ + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + /* config parameter was added in 3.2.0, so gpu_info is actually the second parameter. */ + struct AGSGPUInfo_311 *info = (struct AGSGPUInfo_311 *)config; + unsigned int i; + + if (!info) + goto done; + + TRACE("filling AGSGPUInfo_311.\n"); + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else if (object->public_version <= AGS_MAKE_VERSION(3, 2, 2)) + { + /* Unfortunately it doesn't look sanely possible to distinguish 3.2.2 and 3.2.0 versions, while in + * 3.2.2 radeonSoftwareVersion was added in the middle of the structure. So fill the shorter one + * to avoid out of bound write. */ + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + struct AGSGPUInfo_320 *info = (struct AGSGPUInfo_320 *)gpu_info; + unsigned int i; + + if (!gpu_info) + goto done; + + TRACE("filling AGSGPUInfo_320.\n"); + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + info->architectureVersion = device->architectureVersion; + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else if (object->version <= AMD_AGS_VERSION_4_0_3) + { + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + struct AGSGPUInfo_403 *info = (struct AGSGPUInfo_403 *)gpu_info; + unsigned int i; + + if (!gpu_info) + goto done; + + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + info->architectureVersion = device->architectureVersion; + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->radeonSoftwareVersion = radeon_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else + { + if (!gpu_info) + goto done; + + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + gpu_info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + gpu_info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + } + +done: + TRACE("Created context %p.\n", object); + + *context = object; + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *config, AGSContext **context, AGSGPUInfo_600 *gpu_info) +{ + struct AGSContext *object; + AGSReturnCode ret; + + TRACE("ags_verison %d, context %p, config %p, gpu_info %p.\n", ags_version, context, config, gpu_info); + + if (!context) + return AGS_INVALID_ARGS; + + if (config) + FIXME("Ignoring config %p.\n", config); + + if (!(object = heap_alloc(sizeof(*object)))) + return AGS_OUT_OF_MEMORY; + + if ((ret = init_ags_context(object, ags_version)) != AGS_SUCCESS) + { + heap_free(object); + return ret; + } + + if (gpu_info) + { + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + } + + TRACE("Created context %p.\n", object); + + *context = object; + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDeInit(AGSContext *context) +{ + return agsDeInitialize(context); +} + +AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) +{ + unsigned int i; + BYTE *device; + + TRACE("context %p.\n", context); + + if (!context) + return AGS_SUCCESS; + + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + heap_free(context->memory_properties); + heap_free(context->properties); + device = (BYTE *)context->devices; + for (i = 0; i < context->device_count; ++i) + { + heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, void *, context->version)); + device += amd_ags_info[context->version].device_size; + } + heap_free(context->devices); + heap_free(context); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsGetTotalGPUCount(AGSContext *context, int *numGPUs) +{ + TRACE("context %p, numGPUs %p.\n", context, numGPUs); + + *numGPUs = context->device_count; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsGetGPUMemorySize( AGSContext *context, int gpuIndex, long long *sizeInBytes ) +{ + struct AGSDeviceInfo_511 *device = &((struct AGSDeviceInfo_511 *)context->devices)[gpuIndex]; + + TRACE("context %p, gpuIndex %d, sizeInBytes %p.\n", context, gpuIndex, sizeInBytes); + + if ((unsigned)gpuIndex >= context->device_count) + return AGS_INVALID_ARGS; + + *sizeInBytes = device->localMemoryInBytes; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsGetEyefinityConfigInfo( AGSContext *context, int displayIndex, AGSEyefinityInfo *eyefinityInfo, + int *numDisplaysInfo, AGSDisplayInfo_403 *displaysInfo ) +{ + struct AGSDeviceInfo_511 *devices; + unsigned int i; + + TRACE("context %p, displayIndex %d, eyefinityInfo %p, numDisplaysInfo %p, displaysInfo %p\n", + context, displayIndex, eyefinityInfo, numDisplaysInfo, displaysInfo); + + devices = (struct AGSDeviceInfo_511 *)context->devices; + *numDisplaysInfo = 0; + for (i = 0; i < context->device_count; ++i) + *numDisplaysInfo += devices[i].numDisplays; + + if (!eyefinityInfo || !displaysInfo) + return AGS_SUCCESS; + + /* displaysInfo is not filled in on Windows if Eyefinity is not enabled. */ + memset(eyefinityInfo, 0, sizeof(*eyefinityInfo)); + memset(displaysInfo, 0, *numDisplaysInfo * sizeof(*displaysInfo)); + + return AGS_SUCCESS; +} + +static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_506(AGSDisplaySettings_Mode_506 mode) +{ + switch (mode) + { + default: + ERR("Unknown color space in AGS: %d.\n", mode); + /* fallthrough */ + case Mode_506_SDR: + TRACE("Setting Mode_506_SDR.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; + case Mode_506_PQ: + TRACE("Setting Mode_506_PQ.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; + case Mode_506_scRGB: + TRACE("Setting Mode_506_scRGB.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709; + } +} + +static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_600(AGSDisplaySettings_Mode_600 mode) +{ + switch (mode) + { + default: + ERR("Unknown color space in AGS: %d\n", mode); + /* fallthrough */ + case Mode_600_SDR: + TRACE("Setting Mode_600_SDR.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; + case Mode_600_HDR10_PQ: + TRACE("Setting Mode_600_HDR10_PQ.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; + case Mode_600_HDR10_scRGB: + TRACE("Setting Mode_600_HDR10_scRGB.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709; + } +} + +static DXGI_HDR_METADATA_HDR10 convert_ags_metadata(const AGSDisplaySettings_600 *settings) +{ + DXGI_HDR_METADATA_HDR10 metadata; + metadata.RedPrimary[0] = settings->chromaticityRedX * 50000; + metadata.RedPrimary[1] = settings->chromaticityRedY * 50000; + metadata.GreenPrimary[0] = settings->chromaticityGreenX * 50000; + metadata.GreenPrimary[1] = settings->chromaticityGreenY * 50000; + metadata.BluePrimary[0] = settings->chromaticityBlueX * 50000; + metadata.BluePrimary[1] = settings->chromaticityBlueY * 50000; + metadata.WhitePoint[0] = settings->chromaticityWhitePointX * 50000; + metadata.WhitePoint[1] = settings->chromaticityWhitePointY * 50000; + metadata.MaxMasteringLuminance = settings->maxLuminance; + metadata.MinMasteringLuminance = settings->minLuminance / 0.0001f; + metadata.MaxContentLightLevel = settings->maxContentLightLevel; + metadata.MaxFrameAverageLightLevel = settings->maxFrameAverageLightLevel; + return metadata; +} + +AGSReturnCode WINAPI agsSetDisplayMode(AGSContext *context, int device_index, int display_index, const AGSDisplaySettings *settings) +{ + const AGSDisplaySettings_506 *settings506 = &settings->agsDisplaySettings506; + const AGSDisplaySettings_600 *settings600 = &settings->agsDisplaySettings600; + IDXGIVkInteropFactory1 *dxgi_interop = NULL; + DXGI_COLOR_SPACE_TYPE colorspace; + DXGI_HDR_METADATA_HDR10 metadata; + AGSReturnCode ret = AGS_SUCCESS; + IDXGIFactory1 *dxgi_factory; + HMODULE hdxgi; + + TRACE("context %p device_index %d display_index %d settings %p\n", context, device_index, + display_index, settings); + + if (!context) + return AGS_INVALID_ARGS; + + create_dxgi_factory(&hdxgi, &dxgi_factory); + if (!dxgi_factory) + goto done; + + if (FAILED(IDXGIFactory1_QueryInterface(dxgi_factory, &IID_IDXGIVkInteropFactory1, (void**)&dxgi_interop))) + { + WARN("Failed to get IDXGIVkInteropFactory1.\n"); + goto done; + } + + colorspace = context->version < AMD_AGS_VERSION_5_1_1 + ? convert_ags_colorspace_506(settings506->mode) + : convert_ags_colorspace_600(settings600->mode); + /* Settings 506, 511 and 600 are identical aside from enum order + use + * of bitfield flags we do not use. */ + metadata = convert_ags_metadata(settings600); + + TRACE("chromacity: (%.6lf, %.6lf) (%.6lf, %.6lf) (%.6lf, %.6lf).\n", settings600->chromaticityRedX, + settings600->chromaticityRedY, settings600->chromaticityGreenX, settings600->chromaticityGreenY, + settings600->chromaticityBlueX, settings600->chromaticityBlueY); + + if (FAILED(IDXGIVkInteropFactory1_SetGlobalHDRState(dxgi_interop, colorspace, &metadata))) + ret = AGS_DX_FAILURE; + +done: + if (dxgi_interop) + IDXGIVkInteropFactory1_Release(dxgi_interop); + release_dxgi_factory(hdxgi, dxgi_factory); + return ret; +} + +AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count) +{ + TRACE("context %p gpu_count %p stub!\n", context, gpu_count); + + if (!context || !gpu_count) + return AGS_INVALID_ARGS; + + *gpu_count = 1; + return AGS_SUCCESS; +} + +static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11ExtensionsSupported_600 *extensions) +{ + ID3D11VkExtDevice *ext_device; + + if (FAILED(ID3D11Device_QueryInterface(device, &IID_ID3D11VkExtDevice, (void **)&ext_device))) + { + TRACE("No ID3D11VkExtDevice.\n"); + return; + } + + extensions->depthBoundsTest = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_DEPTH_BOUNDS); + extensions->uavOverlap = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_BARRIER_CONTROL); + extensions->multiDrawIndirect = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_MULTI_DRAW_INDIRECT); + extensions->multiDrawIndirectCountIndirect = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT); + extensions->UAVOverlapDeferredContexts = extensions->uavOverlap; + + ID3D11VkExtDevice_Release(ext_device); + + TRACE("extensions %#x.\n", *(unsigned int *)extensions); +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, + const AGSDX11DeviceCreationParams* creation_params, const AGSDX11ExtensionParams* extension_params, + AGSDX11ReturnedParams* returned_params ) +{ + ID3D11DeviceContext *device_context; + IDXGISwapChain *swapchain = NULL; + D3D_FEATURE_LEVEL feature_level; + ID3D11Device *device; + HRESULT hr; + + TRACE("feature levels %u, pSwapChainDesc %p, app %s, engine %s %#x %#x.\n", creation_params->FeatureLevels, + creation_params->pSwapChainDesc, + debugstr_w(extension_params->agsDX11ExtensionParams511.pAppName), + debugstr_w(extension_params->agsDX11ExtensionParams511.pEngineName), + extension_params->agsDX11ExtensionParams511.appVersion, + extension_params->agsDX11ExtensionParams511.engineVersion); + + if (!load_d3d11_functions()) + { + ERR("Could not load d3d11.dll.\n"); + return AGS_MISSING_D3D_DLL; + } + memset( returned_params, 0, amd_ags_info[context->version].dx11_returned_params_size ); + if (creation_params->pSwapChainDesc) + { + hr = pD3D11CreateDeviceAndSwapChain(creation_params->pAdapter, creation_params->DriverType, + creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels, + creation_params->FeatureLevels, creation_params->SDKVersion, creation_params->pSwapChainDesc, + &swapchain, &device, &feature_level, &device_context); + } + else + { + hr = pD3D11CreateDevice(creation_params->pAdapter, creation_params->DriverType, + creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels, + creation_params->FeatureLevels, creation_params->SDKVersion, + &device, &feature_level, &device_context); + } + if (FAILED(hr)) + { + ERR("Device creation failed, hr %#x.\n", hr); + return AGS_DX_FAILURE; + } + + get_dx11_extensions_supported(device, &context->extensions); + + if (context->version < AMD_AGS_VERSION_5_2_0) + { + AGSDX11ReturnedParams_511 *r = &returned_params->agsDX11ReturnedParams511; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->FeatureLevel = feature_level; + r->extensionsSupported = *(unsigned int *)&context->extensions; + } + else if (context->version < AMD_AGS_VERSION_6_0_0) + { + AGSDX11ReturnedParams_520 *r = &returned_params->agsDX11ReturnedParams520; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->FeatureLevel = feature_level; + r->extensionsSupported = *(unsigned int *)&context->extensions; + } + else + { + AGSDX11ReturnedParams_600 *r = &returned_params->agsDX11ReturnedParams600; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->featureLevel = feature_level; + r->extensionsSupported = context->extensions; + } + + if (context->version < AMD_AGS_VERSION_5_3_0) + { + /* Later versions pass context to functions explicitly, no need to keep it. */ + if (context->d3d11_context) + ID3D11DeviceContext_Release(context->d3d11_context); + ID3D11DeviceContext_AddRef(device_context); + context->d3d11_context = device_context; + } + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_CreateDevice(AGSContext *context, + const AGSDX12DeviceCreationParams *creation_params, const AGSDX12ExtensionParams *extension_params, + AGSDX12ReturnedParams *returned_params) +{ + HRESULT hr; + + TRACE("feature level %#x, app %s, engine %s %#x %#x.\n", creation_params->FeatureLevel, debugstr_w(extension_params->pAppName), + debugstr_w(extension_params->pEngineName), extension_params->appVersion, extension_params->engineVersion); + + if (!load_d3d12_functions()) + { + ERR("Could not load d3d12.dll.\n"); + return AGS_MISSING_D3D_DLL; + } + + memset(returned_params, 0, sizeof(*returned_params)); + if (FAILED(hr = pD3D12CreateDevice((IUnknown *)creation_params->pAdapter, creation_params->FeatureLevel, + &creation_params->iid, (void **)&returned_params->pDevice))) + { + ERR("D3D12CreateDevice failed, hr %#x.\n", hr); + return AGS_DX_FAILURE; + } + + TRACE("Created d3d12 device %p.\n", returned_params->pDevice); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_DestroyDevice(AGSContext* context, ID3D12Device* device, unsigned int* device_refs) +{ + ULONG ref_count; + + if (!device) + return AGS_SUCCESS; + + ref_count = ID3D12Device_Release(device); + if (device_refs) + *device_refs = (unsigned int)ref_count; + + return AGS_SUCCESS; +} + +AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported, unsigned int version_required) +{ + WARN("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); + + return AGS_SOFTWAREVERSIONCHECK_OK; +} + +int WINAPI agsGetVersionNumber(void) +{ + int public_version = 0; + enum amd_ags_version version = determine_ags_version(&public_version); + + TRACE("version %s (internal %d).\n", debugstr_agsversion(public_version), version); + + return public_version; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11Device *device, unsigned int uavSlot, unsigned int *extensionsSupported ) +{ + FIXME("context %p, device %p, uavSlot %u, extensionsSupported %p stub.\n", context, device, uavSlot, extensionsSupported); + + *extensionsSupported = 0; + if (device) + { + if (context->version < AMD_AGS_VERSION_5_3_0) + { + /* Later versions pass context to functions explicitly, no need to keep it. */ + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + ID3D11Device_GetImmediateContext(device, &context->d3d11_context); + } + get_dx11_extensions_supported(device, &context->extensions); + *extensionsSupported = *(unsigned int *)&context->extensions; + } + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensions_Init( AGSContext* context, ID3D11Device* device, unsigned int* extensionsSupported ) +{ + TRACE("context %p, device %p, extensionsSupported %p.\n", context, device, extensionsSupported); + + return agsDriverExtensionsDX11_Init(context, device, ~0u, extensionsSupported); +} + +AGSReturnCode WINAPI agsDriverExtensions_SetCrossfireMode(AGSContext *context, AGSCrossfireMode mode) +{ + FIXME("context %p, mode %d stub.\n", context, mode); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) +{ + TRACE("context %p.\n", context); + + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensions_DeInit(AGSContext *context) +{ + return agsDriverExtensionsDX11_DeInit(context); +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ) +{ + FIXME("context %p, device %p, extensionsSupported %p stub.\n", context, device, extensionsSupported); + + *extensionsSupported = 0; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_DeInit( AGSContext* context ) +{ + TRACE("context %p.\n", context); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_SetMarker( AGSContext *context, ID3D12GraphicsCommandList *command_list, const char *data) +{ + WARN("context %p, command_list %p, data %p stub.\n", context, command_list, data); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_PushMarker( AGSContext *context, ID3D12GraphicsCommandList *command_list, const char* data) +{ + WARN("context %p, command_list %p, data %p stub.\n", context, command_list, data); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_PopMarker(AGSContext *context, ID3D12GraphicsCommandList *command_list) +{ + WARN("context %p, command_list %p stub.\n", context, command_list); + + return AGS_SUCCESS; +} + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("%p, %u, %p.\n", instance, reason, reserved); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +#ifdef __x86_64__ + +static AGSReturnCode set_depth_bounds(AGSContext* context, ID3D11DeviceContext *dx_context, bool enabled, + float min_depth, float max_depth) +{ + ID3D11VkExtContext *ext_context; + + if (!context->extensions.depthBoundsTest) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + ID3D11VkExtContext_SetDepthBoundsTest(ext_context, enabled, min_depth, max_depth); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds(AGSContext* context, bool enabled, + float min_depth, float max_depth ) +{ + TRACE("context %p, enabled %d, min_depth %f, max_depth %f.\n", context, enabled, min_depth, max_depth); + + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return set_depth_bounds(context, context->d3d11_context, enabled, min_depth, max_depth); +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* context, + ID3D11DeviceContext* dx_context, bool enabled, float min_depth, float max_depth ) +{ + TRACE("context %p, dx_context %p, enabled %d, min_depth %f, max_depth %f.\n", context, dx_context, enabled, + min_depth, max_depth); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return set_depth_bounds(context, dx_context, enabled, min_depth, max_depth); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) + +static AGSReturnCode update_uav_overlap(AGSContext* context, ID3D11DeviceContext *dx_context, BOOL set) +{ + ID3D11VkExtContext *ext_context; + + if (!context->extensions.uavOverlap) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_SetBarrierControl(ext_context, set ? D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE : 0); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap_520(AGSContext *context) +{ + TRACE("context %p.\n", context); + + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, context->d3d11_context, TRUE); +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) +{ + TRACE("context %p, dx_context %p.\n", context, dx_context); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, dx_context, TRUE); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) + +AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap_520(AGSContext *context) +{ + TRACE("context %p.\n", context); + + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, context->d3d11_context, FALSE); +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) +{ + TRACE("context %p, dx_context %p.\n", context, dx_context); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, dx_context, FALSE); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + + TRACE("context %p, dx_context %p, draw_count %u, buffer_for_args %p, aligned_byte_offset_for_args %u, byte_stride_for_args %u.\n", + context, dx_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_MultiDrawIndexedIndirect(ext_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, + byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520(AGSContext *context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect(context, context->d3d11_context, draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawIndexedInstancedIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect") ) + + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + + TRACE("context %p, dx_context %p, draw_count %u, buffer_for_args %p, aligned_byte_offset_for_args %u, byte_stride_for_args %u.\n", + context, dx_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_MultiDrawIndirect(ext_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, + byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520( AGSContext* context, unsigned int draw_count, + ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawInstancedIndirect(context, context->d3d11_context, draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawInstancedIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect") ) + +static unsigned int get_max_draw_count(ID3D11Buffer *args, unsigned int offset, unsigned int stride, unsigned int size) +{ + D3D11_BUFFER_DESC desc; + unsigned int count; + + ID3D11Buffer_GetDesc(args, &desc); + if (offset >= desc.ByteWidth) + { + WARN("offset %u, buffer size %u.\n", offset, desc.ByteWidth); + return 0; + } + count = (desc.ByteWidth - offset) / stride; + if (desc.ByteWidth - offset - count * stride >= size) + ++count; + if (!count) + WARN("zero count, buffer size %u, offset %u, stride %u, size %u.\n", desc.ByteWidth, offset, stride, size); + return count; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + unsigned int max_draw_count; + + TRACE("context %p, dx_context %p, count buffer %p, offset %u, args buffer %p, offset %u, stride %u.\n", + context, dx_context, buffer_for_draw_count, aligned_byte_offset_for_draw_count, buffer_for_args, + aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirectCountIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + max_draw_count = get_max_draw_count(buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args, sizeof(D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS)); + ID3D11VkExtContext_MultiDrawIndexedIndirectCount(ext_context, max_draw_count, buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520(AGSContext *context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect(context, context->d3d11_context, + buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect") ) + + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + unsigned int max_draw_count; + + TRACE("context %p, dx_context %p, count buffer %p, offset %u, args buffer %p, offset %u, stride %u.\n", + context, dx_context, buffer_for_draw_count, aligned_byte_offset_for_draw_count, buffer_for_args, + aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirectCountIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + max_draw_count = get_max_draw_count(buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args, sizeof(D3D11_DRAW_INSTANCED_INDIRECT_ARGS)); + ID3D11VkExtContext_MultiDrawIndirectCount(ext_context, max_draw_count, buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520(AGSContext *context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect(context, context->d3d11_context, + buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawInstancedIndirectCountIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect") ) + +AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, + unsigned int *device_ref, ID3D11DeviceContext *device_context, + unsigned int *context_ref) +{ + ULONG ref; + + TRACE("context %p, device %p, device_ref %p, device_context %p, context_ref %p.\n", + context, device, device_ref, device_context, context_ref); + + if (!device) + return AGS_SUCCESS; + + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + + ref = ID3D11Device_Release(device); + if (device_ref) + *device_ref = ref; + + if (!device_context) + return AGS_SUCCESS; + + ref = ID3D11DeviceContext_Release(device_context); + if (context_ref) + *context_ref = ref; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_511(AGSContext *context, ID3D11Device *device, + unsigned int *references ) +{ + TRACE("context %p, device %p, references %p.\n", context, device, references); + + return agsDriverExtensionsDX11_DestroyDevice_520(context, device, references, NULL, NULL); +} + +C_ASSERT(AMD_AGS_VERSION_5_2_0 == 3); +__ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $3,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") ) +#endif + +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDiskShaderCacheEnabled(AGSContext *context, int enable) +{ + FIXME("context %p, enable %d stub.\n", context, enable); + return AGS_SUCCESS; +} diff --git a/dlls/amd_ags_x64/dxvk_interfaces.idl b/dlls/amd_ags_x64/dxvk_interfaces.idl new file mode 100644 index 00000000000..110cdb94896 --- /dev/null +++ b/dlls/amd_ags_x64/dxvk_interfaces.idl @@ -0,0 +1,151 @@ +/* + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "d3d11.idl"; +import "dxgi1_6.idl"; + +typedef struct VkInstance_T *VkInstance; +typedef void (__stdcall *PFN_vkVoidFunction)(void); +typedef PFN_vkVoidFunction (__stdcall *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); + +typedef enum D3D11_VK_EXTENSION +{ + D3D11_VK_EXT_MULTI_DRAW_INDIRECT, + D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT, + D3D11_VK_EXT_DEPTH_BOUNDS, + D3D11_VK_EXT_BARRIER_CONTROL, + D3D11_VK_NVX_BINARY_IMPORT, + D3D11_VK_NVX_IMAGE_VIEW_HANDLE, +} D3D11_VK_EXTENSION; + +typedef enum D3D11_VK_BARRIER_CONTROL +{ + D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE = 0x1, + D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 0x2, +} D3D11_VK_BARRIER_CONTROL; + +[ + object, + uuid(bb8a4fb9-3935-4762-b44b-35189a26414a), + local, + pointer_default(unique) +] +interface ID3D11VkExtShader : IUnknown +{ + HRESULT GetSpirvCode([in, out] SIZE_T *code_size, [out] void *code); +} + +[ + object, + uuid(8a6e3c42-f74c-45b7-8265-a231b677ca17), + local, + pointer_default(unique) +] +interface ID3D11VkExtDevice : IUnknown +{ + BOOL GetExtensionSupport([in] D3D11_VK_EXTENSION extension); +} + +[ + object, + uuid(cfcf64ef-9586-46d0-bca4-97cf2ca61b06), + local, + pointer_default(unique) +] +interface ID3D11VkExtDevice1 : ID3D11VkExtDevice +{ + BOOL GetResourceHandleGPUVirtualAddressAndSizeNVX([in] void *object, [out] UINT64 *gpu_va_start, + [out] UINT64 *gpu_va_size); + BOOL CreateUnorderedAccessViewAndGetDriverHandleNVX([in] ID3D11Resource *resource, + [in] const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, [out] ID3D11UnorderedAccessView **uav, + UINT32 *driver_handle); + BOOL CreateShaderResourceViewAndGetDriverHandleNVX([in] ID3D11Resource *resource, + [in] const D3D11_SHADER_RESOURCE_VIEW_DESC* desc, [out] ID3D11ShaderResourceView **srv, + UINT32 *dirver_handle); + BOOL CreateSamplerStateAndGetDriverHandleNVX([in] const D3D11_SAMPLER_DESC *sample_desc, + [out] ID3D11SamplerState **sample_state, UINT32 *driver_handle); + BOOL CreateCubinComputeShaderWithNameNVX([in] const void *cubin, [in] UINT32 size, [in] UINT32 block_x, + [in] UINT32 block_y, [in] UINT32 block_z, [in] const char *shader_name, [out] IUnknown **shader); + BOOL GetCudaTextureObjectNVX([in] UINT32 srv_driver_hadnle, [in] UINT32 sample_driver_handle, + [out] UINT32 *cuda_texture_handle); +} + +[ + object, + uuid(fd0bca13-5cb6-4c3a-987e-4750de2ca791), + local, + pointer_default(unique) +] +interface ID3D11VkExtContext : IUnknown +{ + void MultiDrawIndirect([in] UINT draw_count, [in] ID3D11Buffer *buffer_for_args, [in] UINT byte_offset_for_args, + [in] UINT byte_stride_for_args); + void MultiDrawIndexedIndirect([in] UINT draw_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void MultiDrawIndirectCount([in] UINT max_draw_count, [in] ID3D11Buffer *buffer_for_count, + [in] UINT byte_offset_for_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void MultiDrawIndexedIndirectCount([in] UINT max_draw_count, [in] ID3D11Buffer *buffer_for_count, + [in] UINT byte_offset_for_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void SetDepthBoundsTest([in] BOOL enable, [in] FLOAT min_depth_bounds, [in] FLOAT max_depth_bounds); + void SetBarrierControl([in] UINT control_flags); +} + +[ + object, + uuid(874b09b2-ae0b-41d8-8476-5f3b7a0e879d), + local, + pointer_default(unique) +] +interface ID3D11VkExtContext1 : ID3D11VkExtContext +{ + BOOL LaunchCubinShaderNVX([in] IUnknown *shader,[in] UINT32 grid_x, [in] UINT32 grid_y, [in] UINT32 grid_z, + [in] const void *params, [in] UINT32 param_size, [in] void * const *read_resources, + [in] UINT32 read_resource_count, [in] void* const *write_resources, [in] UINT32 write_resources_count); +} + +[ + object, + uuid(4c5e1b0d-b0c8-4131-bfd8-9b2476f7f408), + local, + pointer_default(unique) +] +interface IDXGIVkInteropFactory : IUnknown +{ + void GetVulkanInstance( + [out] VkInstance *pInstance, + [out] PFN_vkGetInstanceProcAddr *ppfnVkGetInstanceProcAddr); +} + +[ + object, + uuid(2a289dbd-2d0a-4a51-89f7-f2adce465cd6), + local, + pointer_default(unique) +] +interface IDXGIVkInteropFactory1 : IDXGIVkInteropFactory +{ + HRESULT GetGlobalHDRState( + [out] DXGI_COLOR_SPACE_TYPE *pOutColorSpace, + [out] DXGI_HDR_METADATA_HDR10 *ppOutMetadata) = 0; + + HRESULT SetGlobalHDRState( + [in] DXGI_COLOR_SPACE_TYPE ColorSpace, + [in] const DXGI_HDR_METADATA_HDR10 *pMetadata) = 0; +} diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c new file mode 100644 index 00000000000..7e5bc5bf4d6 --- /dev/null +++ b/dlls/amd_ags_x64/unixlib.c @@ -0,0 +1,277 @@ +/* + * Unix library for amd_ags_x64 functions + * + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "wine/debug.h" + +#include "unixlib.h" + +WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); + +#define MAX_DEVICE_COUNT 64 + +static unsigned int device_count; +static struct drm_amdgpu_info_device *amd_info; + +static NTSTATUS init( void *args ) +{ + drmDevicePtr devices[MAX_DEVICE_COUNT]; + amdgpu_device_handle h; + uint32_t major, minor; + int i, count, fd, ret; + + device_count = 0; + + if ((count = drmGetDevices(devices, MAX_DEVICE_COUNT)) <= 0) + { + ERR("drmGetDevices failed, err %d.\n", count); + return STATUS_UNSUCCESSFUL; + } + TRACE("Got %d devices.\n", count); + for (i = 0; i < count; ++i) + { + if (!devices[i] || !devices[i]->nodes[DRM_NODE_RENDER]) + { + TRACE("No render node, skipping.\n"); + continue; + } + if ((fd = open(devices[i]->nodes[DRM_NODE_RENDER], O_RDONLY | O_CLOEXEC)) < 0) + { + ERR("Failed to open device %s, errno %d.\n", devices[i]->nodes[DRM_NODE_RENDER], errno); + continue; + } + if ((ret = amdgpu_device_initialize(fd, &major, &minor, &h))) + { + WARN("Failed to initialize amdgpu device bustype %d, %04x:%04x, err %d.\n", devices[i]->bustype, + devices[i]->deviceinfo.pci->vendor_id, devices[i]->deviceinfo.pci->device_id, ret); + close(fd); + continue; + } + amd_info = realloc(amd_info, (device_count + 1) * sizeof(*amd_info)); + /* amdgpu_query_info() doesn't fail on short buffer (filling in the available buffer size). So older or + * newer DRM version should be fine but zero init the structure to avoid random values. */ + memset(&amd_info[device_count], 0, sizeof(*amd_info)); + if (!(ret = amdgpu_query_info(h, AMDGPU_INFO_DEV_INFO, sizeof(*amd_info), &amd_info[device_count]))) + { + TRACE("Got amdgpu info for device id %04x, family %#x, external_rev %#x, chip_rev %#x.\n", + amd_info[device_count].device_id, amd_info[device_count].family, amd_info[device_count].external_rev, + amd_info[device_count].chip_rev); + ++device_count; + } + else + { + ERR("amdgpu_query_info failed, ret %d.\n", ret); + } + amdgpu_device_deinitialize(h); + close(fd); + } + drmFreeDevices(devices, count); + return STATUS_SUCCESS; +} + +#ifndef AMDGPU_VRAM_TYPE_DDR5 +# define AMDGPU_VRAM_TYPE_DDR5 10 +#endif +#ifndef AMDGPU_VRAM_TYPE_LPDDR4 +# define AMDGPU_VRAM_TYPE_LPDDR4 11 +#endif +#ifndef AMDGPU_VRAM_TYPE_LPDDR5 +# define AMDGPU_VRAM_TYPE_LPDDR5 12 +#endif + +/* From Mesa source. */ +static uint32_t memory_ops_per_clock(uint32_t vram_type) +{ + /* Based on MemoryOpsPerClockTable from PAL. */ + switch (vram_type) { + case AMDGPU_VRAM_TYPE_GDDR1: + case AMDGPU_VRAM_TYPE_GDDR3: /* last in low-end Evergreen */ + case AMDGPU_VRAM_TYPE_GDDR4: /* last in R7xx, not used much */ + case AMDGPU_VRAM_TYPE_UNKNOWN: + default: + return 0; + case AMDGPU_VRAM_TYPE_DDR2: + case AMDGPU_VRAM_TYPE_DDR3: + case AMDGPU_VRAM_TYPE_DDR4: + case AMDGPU_VRAM_TYPE_LPDDR4: + case AMDGPU_VRAM_TYPE_HBM: /* same for HBM2 and HBM3 */ + return 2; + case AMDGPU_VRAM_TYPE_DDR5: + case AMDGPU_VRAM_TYPE_LPDDR5: + case AMDGPU_VRAM_TYPE_GDDR5: /* last in Polaris and low-end Navi14 */ + return 4; + case AMDGPU_VRAM_TYPE_GDDR6: + return 16; + } +} + +typedef enum AsicFamily +{ + AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + AsicFamily_PreGCN, ///< Pre GCN architecture. + AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti. + AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo. + AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. + AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. + AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). + AsicFamily_RDNA, ///< AMD RDNA architecture + AsicFamily_RDNA2, ///< AMD RDNA2 architecture + AsicFamily_RDNA3, ///< AMD RDNA3 architecture +} AsicFamily; + +/* Constants from Mesa source. */ +#define FAMILY_UNKNOWN 0x00 +#define FAMILY_TN 0x69 /* # 105 / Trinity APUs */ +#define FAMILY_SI 0x6E /* # 110 / Southern Islands: Tahiti, Pitcairn, CapeVerde, Oland, Hainan */ +#define FAMILY_CI 0x78 /* # 120 / Sea Islands: Bonaire, Hawaii */ +#define FAMILY_KV 0x7D /* # 125 / Kaveri APUs: Spectre, Spooky, Kalindi, Godavari */ +#define FAMILY_VI 0x82 /* # 130 / Volcanic Islands: Iceland, Tonga, Fiji */ +#define FAMILY_POLARIS 0x82 /* # 130 / Polaris: 10, 11, 12 */ +#define FAMILY_CZ 0x87 /* # 135 / Carrizo APUs: Carrizo, Stoney */ +#define FAMILY_AI 0x8D /* # 141 / Vega: 10, 20 */ +#define FAMILY_RV 0x8E /* # 142 / Raven */ +#define FAMILY_NV 0x8F /* # 143 / Navi: 10 */ +#define FAMILY_VGH 0x90 /* # 144 / Van Gogh */ +#define FAMILY_NV3 0x91 /* # 145 / Navi: 3x */ +#define FAMILY_RMB 0x92 /* # 146 / Rembrandt */ +#define FAMILY_RPL 0x95 /* # 149 / Raphael */ +#define FAMILY_GFX1103 0x94 +#define FAMILY_GFX1150 0x96 +#define FAMILY_MDN 0x97 /* # 151 / Mendocino */ + +#define ROUND_DIV(value, div) (((value) + (div) / 2) / (div)) + +static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_device_info_params *out) +{ + uint32_t erev = info->external_rev; + uint64_t max_engine_clock_khz, max_memory_clock_khz; + + out->asic_family = AsicFamily_Unknown; + switch (info->family) + { + case FAMILY_AI: + case FAMILY_RV: + out->asic_family = AsicFamily_Vega; + break; + + /* Treat pre-Polaris cards as Polaris. */ + case FAMILY_CZ: + case FAMILY_SI: + case FAMILY_CI: + case FAMILY_KV: + case FAMILY_POLARIS: + out->asic_family = AsicFamily_GCN4; + break; + + case FAMILY_NV: + if (erev >= 0x01 && erev < 0x28) + out->asic_family = AsicFamily_RDNA; + else if (erev >= 0x28 && erev < 0x50) + out->asic_family = AsicFamily_RDNA2; + break; + + case FAMILY_RMB: + case FAMILY_RPL: + case FAMILY_MDN: + case FAMILY_VGH: + out->asic_family = AsicFamily_RDNA2; + break; + + case FAMILY_NV3: + case FAMILY_GFX1103: + case FAMILY_GFX1150: + out->asic_family = AsicFamily_RDNA3; + break; + } + TRACE("family %u, erev %#x -> asicFamily %d.\n", info->family, erev, out->asic_family); + if (out->asic_family == AsicFamily_Unknown && info->family != FAMILY_UNKNOWN) + { + if (info->family > FAMILY_GFX1150) + out->asic_family = AsicFamily_RDNA3; + else + out->asic_family = AsicFamily_GCN4; + + FIXME("Unrecognized family %u, erev %#x -> defaulting to %d.\n", info->family, erev, + out->asic_family); + } + + out->num_cu = info->cu_active_number; + out->num_wgp = out->asic_family >= AsicFamily_RDNA ? out->num_cu / 2 : 0; + out->num_rops = info->num_rb_pipes * 4; + TRACE("num_cu %d, num_wgp %d, num_rops %d.\n", out->num_cu, out->num_wgp, out->num_rops); + /* These numbers are zero on Vangogh, workaround that (similar to how it is currently done + * in Mesa src/amd/common/ac_rgp.c. */ + if (!(max_engine_clock_khz = info->max_engine_clock)) + max_engine_clock_khz = 1300000; + if (!(max_memory_clock_khz = info->max_memory_clock)) + max_memory_clock_khz = 687000; + out->core_clock = ROUND_DIV(max_engine_clock_khz, 1000); + out->memory_clock = ROUND_DIV(max_memory_clock_khz, 1000); + out->memory_bandwidth = ROUND_DIV(max_memory_clock_khz * memory_ops_per_clock(info->vram_type) + * info->vram_bit_width / 8, 1000); + TRACE("core_clock %uMHz, memory_clock %uMHz, memory_bandwidth %u.\n", + out->core_clock, out->memory_clock, out->memory_bandwidth); + out->teraflops = 1e-9f * max_engine_clock_khz * info->cu_active_number * 64 * 2; + TRACE("teraflops %.2f.\n", out->teraflops); +} + +static NTSTATUS get_device_info( void *args ) +{ + struct get_device_info_params *params = args; + unsigned int i; + + for (i = 0; i < device_count; ++i) + { + if (amd_info[i].device_id != params->device_id) + continue; + TRACE("device %04x found.\n", params->device_id); + fill_device_info(&amd_info[i], params); + return STATUS_SUCCESS; + } + TRACE("Device %04x not found.\n", params->device_id); + return STATUS_NOT_FOUND; +} + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + init, + get_device_info, +}; diff --git a/dlls/amd_ags_x64/unixlib.h b/dlls/amd_ags_x64/unixlib.h new file mode 100644 index 00000000000..72422e1535c --- /dev/null +++ b/dlls/amd_ags_x64/unixlib.h @@ -0,0 +1,42 @@ +/* + * Unix library interface + * + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/unixlib.h" + +enum amd_ags_funcs +{ + unix_init, + unix_get_device_info, +}; + +struct get_device_info_params +{ + uint32_t device_id; + uint32_t _pad; + /* Output parameters. */ + uint32_t asic_family; + uint32_t num_cu; + uint32_t num_wgp; + uint32_t num_rops; + uint32_t core_clock; + uint32_t memory_clock; + uint32_t memory_bandwidth; + float teraflops; +}; diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index a2957c3040a..12d32a46216 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -56,10 +56,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl); #define GECKO_SHA "???" #endif -#define MONO_VERSION "8.1.0" +#define MONO_VERSION "9.0.0" #if defined(__i386__) || defined(__x86_64__) #define MONO_ARCH "x86" -#define MONO_SHA "0ed3ec533aef79b2f312155931cf7b1080009ac0c5b4c2bcfeb678ac948e0810" +#define MONO_SHA "79f6c43100675566c112f4199b9ea7b944d338164b34bd91fa11b0b0a414e1c4" #else #define MONO_ARCH "" #define MONO_SHA "???" diff --git a/dlls/atiadlxx/Makefile.in b/dlls/atiadlxx/Makefile.in new file mode 100644 index 00000000000..cc6b51bf2bc --- /dev/null +++ b/dlls/atiadlxx/Makefile.in @@ -0,0 +1,8 @@ +EXTRADEFS = -DWINE_NO_LONG_TYPES +MODULE = atiadlxx.dll +IMPORTS = dxgi + +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native + +SOURCES = \ + atiadlxx_main.c diff --git a/dlls/atiadlxx/atiadlxx.spec b/dlls/atiadlxx/atiadlxx.spec new file mode 100644 index 00000000000..1e447f38ded --- /dev/null +++ b/dlls/atiadlxx/atiadlxx.spec @@ -0,0 +1,1138 @@ +@ stub ADL2_ADC_CurrentProfileFromDrv_Get +@ stub ADL2_ADC_Display_AdapterDeviceProfileEx_Get +@ stub ADL2_ADC_DrvDataToProfile_Copy +@ stub ADL2_ADC_FindClosestMode_Get +@ stub ADL2_ADC_IsDevModeEqual_Get +@ stub ADL2_ADC_Profile_Apply +@ stub ADL2_APO_AudioDelayAdjustmentInfo_Get +@ stub ADL2_APO_AudioDelay_Restore +@ stub ADL2_APO_AudioDelay_Set +@ stub ADL2_AdapterLimitation_Caps +@ stub ADL2_AdapterX2_Caps +@ stub ADL2_Adapter_AMDAndNonAMDDIsplayClone_Get +@ stub ADL2_Adapter_ASICFamilyType_Get +@ stub ADL2_Adapter_ASICInfo_Get +@ stub ADL2_Adapter_Accessibility_Get +@ stub ADL2_Adapter_AceDefaults_Restore +@ stub ADL2_Adapter_Active_Get +@ stub ADL2_Adapter_Active_Set +@ stub ADL2_Adapter_Active_SetPrefer +@ stub ADL2_Adapter_AdapterInfoX2_Get +@ stub ADL2_Adapter_AdapterInfoX3_Get +@ stub ADL2_Adapter_AdapterInfoX4_Get +@ stub ADL2_Adapter_AdapterInfo_Get +@ stub ADL2_Adapter_AdapterList_Disable +@ stub ADL2_Adapter_AdapterLocationPath_Get +@ stub ADL2_Adapter_Aspects_Get +@ stub ADL2_Adapter_AudioChannelSplitConfiguration_Get +@ stub ADL2_Adapter_AudioChannelSplit_Disable +@ stub ADL2_Adapter_AudioChannelSplit_Enable +@ stub ADL2_Adapter_BigSw_Info_Get +@ stub ADL2_Adapter_BlackAndWhiteLevelSupport_Get +@ stub ADL2_Adapter_BlackAndWhiteLevel_Get +@ stub ADL2_Adapter_BlackAndWhiteLevel_Set +@ stub ADL2_Adapter_BoardLayout_Get +@ stub ADL2_Adapter_Caps +@ stub ADL2_Adapter_ChipSetInfo_Get +@ stub ADL2_Adapter_CloneTypes_Get +@ stub ADL2_Adapter_ConfigMemory_Cap +@ stub ADL2_Adapter_ConfigMemory_Get +@ stub ADL2_Adapter_ConfigureState_Get +@ stub ADL2_Adapter_ConnectionData_Get +@ stub ADL2_Adapter_ConnectionData_Remove +@ stub ADL2_Adapter_ConnectionData_Set +@ stub ADL2_Adapter_ConnectionState_Get +@ stub ADL2_Adapter_CrossDisplayPlatformInfo_Get +@ stub ADL2_Adapter_CrossGPUClone_Disable +@ stub ADL2_Adapter_CrossdisplayAdapterRole_Caps +@ stub ADL2_Adapter_CrossdisplayInfoX2_Set +@ stub ADL2_Adapter_CrossdisplayInfo_Get +@ stub ADL2_Adapter_CrossdisplayInfo_Set +@ stub ADL2_Adapter_CrossfireX2_Get +@ stub ADL2_Adapter_Crossfire_Caps +@ stub ADL2_Adapter_Crossfire_Get +@ stub ADL2_Adapter_Crossfire_Set +@ stub ADL2_Adapter_DefaultAudioChannelTable_Load +@ stub ADL2_Adapter_Desktop_Caps +@ stub ADL2_Adapter_Desktop_SupportedSLSGridTypes_Get +@ stub ADL2_Adapter_DeviceID_Get +@ stub ADL2_Adapter_DisplayAudioEndpoint_Enable +@ stub ADL2_Adapter_DisplayAudioEndpoint_Mute +@ stub ADL2_Adapter_DisplayAudioInfo_Get +@ stub ADL2_Adapter_DisplayGTCCaps_Get +@ stub ADL2_Adapter_Display_Caps +@ stub ADL2_Adapter_DriverSettings_Get +@ stub ADL2_Adapter_DriverSettings_Set +@ stub ADL2_Adapter_ECC_ErrorInjection_Set +@ stub ADL2_Adapter_ECC_ErrorRecords_Get +@ stub ADL2_Adapter_EDC_ErrorInjection_Set +@ stub ADL2_Adapter_EDC_ErrorRecords_Get +@ stub ADL2_Adapter_EDIDManagement_Caps +@ stub ADL2_Adapter_EmulationMode_Set +@ stub ADL2_Adapter_ExtInfo_Get +@ stub ADL2_Adapter_Feature_Caps +@ stub ADL2_Adapter_FrameMetrics_Caps +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Disable +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Enable +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Get +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Start +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Stop +@ stub ADL2_Adapter_FrameMetrics_Get +@ stub ADL2_Adapter_FrameMetrics_Start +@ stub ADL2_Adapter_FrameMetrics_Stop +@ stub ADL2_Adapter_Gamma_Get +@ stub ADL2_Adapter_Gamma_Set +@ stub ADL2_Adapter_Graphic_Core_Info_Get +@ stub ADL2_Adapter_HBC_Caps +@ stub ADL2_Adapter_HBM_ECC_UC_Check +@ stub ADL2_Adapter_Headless_Get +@ stub ADL2_Adapter_ID_Get +@ stub ADL2_Adapter_IsGamingDriver_Info_Get +@ stub ADL2_Adapter_LocalDisplayConfig_Get +@ stub ADL2_Adapter_LocalDisplayConfig_Set +@ stub ADL2_Adapter_LocalDisplayState_Get +@ stub ADL2_Adapter_MVPU_Set +@ stub ADL2_Adapter_MaxCursorSize_Get +@ stub ADL2_Adapter_MemoryInfo2_Get +@ stub ADL2_Adapter_MemoryInfo_Get +@ stub ADL2_Adapter_MirabilisSupport_Get +@ stub ADL2_Adapter_ModeSwitch +@ stub ADL2_Adapter_ModeTimingOverride_Caps +@ stub ADL2_Adapter_Modes_ReEnumerate +@ stub ADL2_Adapter_NumberOfActivatableSources_Get +@ stdcall ADL2_Adapter_NumberOfAdapters_Get(ptr ptr) +@ stub ADL2_Adapter_ObservedClockInfo_Get +@ stub ADL2_Adapter_PMLog_Start +@ stub ADL2_Adapter_PMLog_Stop +@ stub ADL2_Adapter_PMLog_Support_Get +@ stub ADL2_Adapter_PreFlipPostProcessing_Disable +@ stub ADL2_Adapter_PreFlipPostProcessing_Enable +@ stub ADL2_Adapter_PreFlipPostProcessing_Get_Status +@ stub ADL2_Adapter_PreFlipPostProcessing_Select_LUT_Algorithm +@ stub ADL2_Adapter_PreFlipPostProcessing_Select_LUT_Buffer +@ stub ADL2_Adapter_PreFlipPostProcessing_Unselect_LUT_Buffer +@ stub ADL2_Adapter_Primary_Get +@ stub ADL2_Adapter_Primary_Set +@ stub ADL2_Adapter_RAS_ErrorInjection_Set +@ stub ADL2_Adapter_RegValueInt_Get +@ stub ADL2_Adapter_RegValueInt_Set +@ stub ADL2_Adapter_RegValueString_Get +@ stub ADL2_Adapter_RegValueString_Set +@ stub ADL2_Adapter_SWInfo_Get +@ stub ADL2_Adapter_Speed_Caps +@ stub ADL2_Adapter_Speed_Get +@ stub ADL2_Adapter_Speed_Set +@ stub ADL2_Adapter_SupportedConnections_Get +@ stub ADL2_Adapter_TRNG_Get +@ stub ADL2_Adapter_Tear_Free_Cap +@ stub ADL2_Adapter_VRAMUsage_Get +@ stub ADL2_Adapter_VariBrightEnable_Set +@ stub ADL2_Adapter_VariBrightLevel_Get +@ stub ADL2_Adapter_VariBrightLevel_Set +@ stub ADL2_Adapter_VariBright_Caps +@ stub ADL2_Adapter_VerndorID_Int_get +@ stub ADL2_Adapter_VideoBiosInfo_Get +@ stub ADL2_Adapter_VideoTheaterModeInfo_Get +@ stub ADL2_Adapter_VideoTheaterModeInfo_Set +@ stub ADL2_Adapter_XConnectSupport_Get +@ stub ADL2_ApplicationProfilesX2_AppInterceptionList_Set +@ stub ADL2_ApplicationProfilesX2_AppStartStopInfo_Get +@ stub ADL2_ApplicationProfiles_AppInterceptionList_Set +@ stub ADL2_ApplicationProfiles_AppInterception_Set +@ stub ADL2_ApplicationProfiles_AppStartStopInfo_Get +@ stub ADL2_ApplicationProfiles_AppStartStop_Resume +@ stub ADL2_ApplicationProfiles_Applications_Get +@ stub ADL2_ApplicationProfiles_ConvertToCompact +@ stub ADL2_ApplicationProfiles_DriverAreaPrivacy_Get +@ stub ADL2_ApplicationProfiles_GetCustomization +@ stub ADL2_ApplicationProfiles_HitListsX2_Get +@ stub ADL2_ApplicationProfiles_HitListsX3_Get +@ stub ADL2_ApplicationProfiles_HitLists_Get +@ stub ADL2_ApplicationProfiles_ProfileApplicationX2_Assign +@ stub ADL2_ApplicationProfiles_ProfileApplication_Assign +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplicationX2_Search +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplication_InMemorySearch +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplication_Search +@ stub ADL2_ApplicationProfiles_Profile_Create +@ stub ADL2_ApplicationProfiles_Profile_Exist +@ stub ADL2_ApplicationProfiles_Profile_Remove +@ stub ADL2_ApplicationProfiles_PropertyType_Get +@ stub ADL2_ApplicationProfiles_Release_Get +@ stub ADL2_ApplicationProfiles_RemoveApplication +@ stub ADL2_ApplicationProfiles_StatusInfo_Get +@ stub ADL2_ApplicationProfiles_System_Reload +@ stub ADL2_ApplicationProfiles_User_Load +@ stub ADL2_ApplicationProfiles_User_Unload +@ stub ADL2_Audio_CurrentSampleRate_Get +@ stub ADL2_AutoTuningResult_Get +@ stub ADL2_BOOST_Settings_Get +@ stub ADL2_BOOST_Settings_Set +@ stub ADL2_Blockchain_BlockchainMode_Caps +@ stub ADL2_Blockchain_BlockchainMode_Get +@ stub ADL2_Blockchain_BlockchainMode_Set +@ stub ADL2_Blockchain_Hashrate_Set +@ stub ADL2_CDS_UnsafeMode_Set +@ stub ADL2_CHILL_SettingsX2_Get +@ stub ADL2_CHILL_SettingsX2_Set +@ stub ADL2_CV_DongleSettings_Get +@ stub ADL2_CV_DongleSettings_Reset +@ stub ADL2_CV_DongleSettings_Set +@ stub ADL2_Chill_Caps_Get +@ stub ADL2_Chill_Settings_Get +@ stub ADL2_Chill_Settings_Notify +@ stub ADL2_Chill_Settings_Set +@ stub ADL2_CustomFan_Caps +@ stub ADL2_CustomFan_Get +@ stub ADL2_CustomFan_Set +@ stub ADL2_DELAG_Settings_Get +@ stub ADL2_DELAG_Settings_Set +@ stub ADL2_DFP_AllowOnlyCETimings_Get +@ stub ADL2_DFP_AllowOnlyCETimings_Set +@ stub ADL2_DFP_BaseAudioSupport_Get +@ stub ADL2_DFP_GPUScalingEnable_Get +@ stub ADL2_DFP_GPUScalingEnable_Set +@ stub ADL2_DFP_HDMISupport_Get +@ stub ADL2_DFP_MVPUAnalogSupport_Get +@ stub ADL2_DFP_PixelFormat_Caps +@ stub ADL2_DFP_PixelFormat_Get +@ stub ADL2_DFP_PixelFormat_Set +@ stub ADL2_DVRSupport_Get +@ stub ADL2_Desktop_DOPP_Enable +@ stub ADL2_Desktop_DOPP_EnableX2 +@ stub ADL2_Desktop_Detach +@ stub ADL2_Desktop_Device_Create +@ stub ADL2_Desktop_Device_Destroy +@ stub ADL2_Desktop_ExclusiveModeX2_Get +@ stub ADL2_Desktop_HardwareCursor_SetBitmap +@ stub ADL2_Desktop_HardwareCursor_SetPosition +@ stub ADL2_Desktop_HardwareCursor_Toggle +@ stub ADL2_Desktop_PFPAComplete_Set +@ stub ADL2_Desktop_PFPAState_Get +@ stub ADL2_Desktop_PrimaryInfo_Get +@ stub ADL2_Desktop_TextureState_Get +@ stub ADL2_Desktop_Texture_Enable +@ stub ADL2_Device_PMLog_Device_Create +@ stub ADL2_Device_PMLog_Device_Destroy +@ stub ADL2_DisplayScaling_Set +@ stub ADL2_Display_AdapterID_Get +@ stub ADL2_Display_AdjustCaps_Get +@ stub ADL2_Display_AdjustmentCoherent_Get +@ stub ADL2_Display_AdjustmentCoherent_Set +@ stub ADL2_Display_AudioMappingInfo_Get +@ stub ADL2_Display_AvivoColor_Get +@ stub ADL2_Display_AvivoCurrentColor_Set +@ stub ADL2_Display_AvivoDefaultColor_Set +@ stub ADL2_Display_BackLight_Get +@ stub ADL2_Display_BackLight_Set +@ stub ADL2_Display_BezelOffsetSteppingSize_Get +@ stub ADL2_Display_BezelOffset_Set +@ stub ADL2_Display_BezelSupported_Validate +@ stub ADL2_Display_Capabilities_Get +@ stub ADL2_Display_ColorCaps_Get +@ stub ADL2_Display_ColorDepth_Get +@ stub ADL2_Display_ColorDepth_Set +@ stub ADL2_Display_ColorTemperatureSourceDefault_Get +@ stub ADL2_Display_ColorTemperatureSource_Get +@ stub ADL2_Display_ColorTemperatureSource_Set +@ stub ADL2_Display_Color_Get +@ stub ADL2_Display_Color_Set +@ stub ADL2_Display_ConnectedDisplays_Get +@ stub ADL2_Display_ContainerID_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentCaps_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentData_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentData_Set +@ stub ADL2_Display_CustomizedModeListNum_Get +@ stub ADL2_Display_CustomizedModeList_Get +@ stub ADL2_Display_CustomizedMode_Add +@ stub ADL2_Display_CustomizedMode_Delete +@ stub ADL2_Display_CustomizedMode_Validate +@ stub ADL2_Display_DCE_Get +@ stub ADL2_Display_DCE_Set +@ stub ADL2_Display_DDCBlockAccess_Get +@ stub ADL2_Display_DDCInfo2_Get +@ stub ADL2_Display_DDCInfo_Get +@ stub ADL2_Display_Deflicker_Get +@ stub ADL2_Display_Deflicker_Set +@ stub ADL2_Display_DeviceConfig_Get +@ stub ADL2_Display_DisplayContent_Cap +@ stub ADL2_Display_DisplayContent_Get +@ stub ADL2_Display_DisplayContent_Set +@ stub ADL2_Display_DisplayInfo_Get +@ stub ADL2_Display_DisplayMapConfigX2_Set +@ stub ADL2_Display_DisplayMapConfig_Get +@ stub ADL2_Display_DisplayMapConfig_PossibleAddAndRemove +@ stub ADL2_Display_DisplayMapConfig_Set +@ stub ADL2_Display_DisplayMapConfig_Validate +@ stub ADL2_Display_DitherState_Get +@ stub ADL2_Display_DitherState_Set +@ stub ADL2_Display_Downscaling_Caps +@ stub ADL2_Display_DpMstAuxMsg_Get +@ stub ADL2_Display_DpMstInfo_Get +@ stub ADL2_Display_DummyVirtual_Destroy +@ stub ADL2_Display_DummyVirtual_Get +@ stub ADL2_Display_EdidData_Get +@ stub ADL2_Display_EdidData_Set +@ stub ADL2_Display_EnumDisplays_Get +@ stub ADL2_Display_FilterSVideo_Get +@ stub ADL2_Display_FilterSVideo_Set +@ stub ADL2_Display_ForcibleDisplay_Get +@ stub ADL2_Display_ForcibleDisplay_Set +@ stub ADL2_Display_FormatsOverride_Get +@ stub ADL2_Display_FormatsOverride_Set +@ stub ADL2_Display_FreeSyncState_Get +@ stub ADL2_Display_FreeSyncState_Set +@ stub ADL2_Display_FreeSync_Cap +@ stub ADL2_Display_GamutMapping_Get +@ stub ADL2_Display_GamutMapping_Reset +@ stub ADL2_Display_GamutMapping_Set +@ stub ADL2_Display_Gamut_Caps +@ stub ADL2_Display_Gamut_Get +@ stub ADL2_Display_Gamut_Set +@ stub ADL2_Display_HDCP_Get +@ stub ADL2_Display_HDCP_Set +@ stub ADL2_Display_HDRState_Get +@ stub ADL2_Display_HDRState_Set +@ stub ADL2_Display_ImageExpansion_Get +@ stub ADL2_Display_ImageExpansion_Set +@ stub ADL2_Display_InfoPacket_Get +@ stub ADL2_Display_InfoPacket_Set +@ stub ADL2_Display_IsVirtual_Get +@ stub ADL2_Display_LCDRefreshRateCapability_Get +@ stub ADL2_Display_LCDRefreshRateOptions_Get +@ stub ADL2_Display_LCDRefreshRateOptions_Set +@ stub ADL2_Display_LCDRefreshRate_Get +@ stub ADL2_Display_LCDRefreshRate_Set +@ stub ADL2_Display_Limits_Get +@ stub ADL2_Display_MVPUCaps_Get +@ stub ADL2_Display_MVPUStatus_Get +@ stub ADL2_Display_ModeTimingOverrideInfo_Get +@ stub ADL2_Display_ModeTimingOverrideListX2_Get +@ stub ADL2_Display_ModeTimingOverrideListX3_Get +@ stub ADL2_Display_ModeTimingOverrideList_Get +@ stub ADL2_Display_ModeTimingOverrideX2_Get +@ stub ADL2_Display_ModeTimingOverrideX2_Set +@ stub ADL2_Display_ModeTimingOverrideX3_Get +@ stub ADL2_Display_ModeTimingOverride_Delete +@ stub ADL2_Display_ModeTimingOverride_Get +@ stub ADL2_Display_ModeTimingOverride_Set +@ stub ADL2_Display_Modes_Get +@ stub ADL2_Display_Modes_Set +@ stub ADL2_Display_Modes_X2_Get +@ stub ADL2_Display_MonitorPowerState_Set +@ stub ADL2_Display_NativeAUXChannel_Access +@ stub ADL2_Display_NeedWorkaroundFor5Clone_Get +@ stub ADL2_Display_NumberOfDisplays_Get +@ stub ADL2_Display_ODClockConfig_Set +@ stub ADL2_Display_ODClockInfo_Get +@ stub ADL2_Display_Overlap_NotifyAdjustment +@ stub ADL2_Display_Overlap_Set +@ stub ADL2_Display_Overscan_Get +@ stub ADL2_Display_Overscan_Set +@ stub ADL2_Display_PixelFormatDefault_Get +@ stub ADL2_Display_PixelFormat_Get +@ stub ADL2_Display_PixelFormat_Set +@ stub ADL2_Display_Position_Get +@ stub ADL2_Display_Position_Set +@ stub ADL2_Display_PossibleMapping_Get +@ stub ADL2_Display_PossibleMode_Get +@ stub ADL2_Display_PowerXpressActiveGPU_Get +@ stub ADL2_Display_PowerXpressActiveGPU_Set +@ stub ADL2_Display_PowerXpressActvieGPUR2_Get +@ stub ADL2_Display_PowerXpressVersion_Get +@ stub ADL2_Display_PowerXpress_AutoSwitchConfig_Get +@ stub ADL2_Display_PowerXpress_AutoSwitchConfig_Set +@ stub ADL2_Display_PreferredMode_Get +@ stub ADL2_Display_PreservedAspectRatio_Get +@ stub ADL2_Display_PreservedAspectRatio_Set +@ stub ADL2_Display_Property_Get +@ stub ADL2_Display_Property_Set +@ stub ADL2_Display_RcDisplayAdjustment +@ stub ADL2_Display_ReGammaCoefficients_Get +@ stub ADL2_Display_ReGammaCoefficients_Set +@ stub ADL2_Display_ReducedBlanking_Get +@ stub ADL2_Display_ReducedBlanking_Set +@ stub ADL2_Display_RegammaR1_Get +@ stub ADL2_Display_RegammaR1_Set +@ stub ADL2_Display_Regamma_Get +@ stub ADL2_Display_Regamma_Set +@ stub ADL2_Display_SLSBuilder_CommonMode_Get +@ stub ADL2_Display_SLSBuilder_Create +@ stub ADL2_Display_SLSBuilder_DisplaysCanBeNextCandidateInSLS_Get +@ stub ADL2_Display_SLSBuilder_DisplaysCanBeNextCandidateToEnabled_Get +@ stub ADL2_Display_SLSBuilder_Get +@ stub ADL2_Display_SLSBuilder_IsActive_Notify +@ stub ADL2_Display_SLSBuilder_MaxSLSLayoutSize_Get +@ stub ADL2_Display_SLSBuilder_TimeOut_Get +@ stub ADL2_Display_SLSBuilder_Update +@ stub ADL2_Display_SLSGrid_Caps +@ stub ADL2_Display_SLSMapConfigX2_Delete +@ stub ADL2_Display_SLSMapConfigX2_Get +@ stub ADL2_Display_SLSMapConfig_Create +@ stub ADL2_Display_SLSMapConfig_Delete +@ stub ADL2_Display_SLSMapConfig_Get +@ stub ADL2_Display_SLSMapConfig_ImageCropType_Set +@ stub ADL2_Display_SLSMapConfig_Rearrange +@ stub ADL2_Display_SLSMapConfig_SetState +@ stub ADL2_Display_SLSMapConfig_SupportedImageCropType_Get +@ stub ADL2_Display_SLSMapConfig_Valid +@ stub ADL2_Display_SLSMapIndexList_Get +@ stub ADL2_Display_SLSMapIndex_Get +@ stub ADL2_Display_SLSMiddleMode_Get +@ stub ADL2_Display_SLSMiddleMode_Set +@ stub ADL2_Display_SLSRecords_Get +@ stub ADL2_Display_Sharpness_Caps +@ stub ADL2_Display_Sharpness_Get +@ stub ADL2_Display_Sharpness_Info_Get +@ stub ADL2_Display_Sharpness_Set +@ stub ADL2_Display_Size_Get +@ stub ADL2_Display_Size_Set +@ stub ADL2_Display_SourceContentAttribute_Get +@ stub ADL2_Display_SourceContentAttribute_Set +@ stub ADL2_Display_SplitDisplay_Caps +@ stub ADL2_Display_SplitDisplay_Get +@ stub ADL2_Display_SplitDisplay_RestoreDesktopConfiguration +@ stub ADL2_Display_SplitDisplay_Set +@ stub ADL2_Display_SupportedColorDepth_Get +@ stub ADL2_Display_SupportedPixelFormat_Get +@ stub ADL2_Display_SwitchingCapability_Get +@ stub ADL2_Display_TVCaps_Get +@ stub ADL2_Display_TargetTimingX2_Get +@ stub ADL2_Display_TargetTiming_Get +@ stub ADL2_Display_UnderScan_Auto_Get +@ stub ADL2_Display_UnderScan_Auto_Set +@ stub ADL2_Display_UnderscanState_Get +@ stub ADL2_Display_UnderscanState_Set +@ stub ADL2_Display_UnderscanSupport_Get +@ stub ADL2_Display_Underscan_Get +@ stub ADL2_Display_Underscan_Set +@ stub ADL2_Display_Vector_Get +@ stub ADL2_Display_ViewPort_Cap +@ stub ADL2_Display_ViewPort_Get +@ stub ADL2_Display_ViewPort_Set +@ stub ADL2_Display_VirtualType_Get +@ stub ADL2_Display_WriteAndReadI2C +@ stub ADL2_Display_WriteAndReadI2CLargePayload +@ stub ADL2_Display_WriteAndReadI2CRev_Get +@ stub ADL2_ElmCompatibilityMode_Caps +@ stub ADL2_ElmCompatibilityMode_Status_Get +@ stub ADL2_ElmCompatibilityMode_Status_Set +@ stub ADL2_ExclusiveModeGet +@ stub ADL2_FPS_Caps +@ stub ADL2_FPS_Settings_Get +@ stub ADL2_FPS_Settings_Reset +@ stub ADL2_FPS_Settings_Set +@ stub ADL2_Feature_Settings_Get +@ stub ADL2_Feature_Settings_Set +@ stub ADL2_Flush_Driver_Data +@ stub ADL2_GPUVMPageSize_Info_Get +@ stub ADL2_GPUVMPageSize_Info_Set +@ stub ADL2_GPUVerInfo_Get +@ stub ADL2_GcnAsicInfo_Get +@ stub ADL2_Graphics_IsDetachableGraphicsPlatform_Get +@ stub ADL2_Graphics_IsGfx9AndAbove +@ stub ADL2_Graphics_MantleVersion_Get +@ stub ADL2_Graphics_Platform_Get +@ stdcall ADL2_Graphics_VersionsX2_Get(ptr ptr) +@ stub ADL2_Graphics_Versions_Get +@ stub ADL2_Graphics_VulkanVersion_Get +@ stub ADL2_HybridGraphicsGPU_Set +@ stub ADL2_MGPUSLS_Status_Set +@ stub ADL2_MMD_FeatureList_Get +@ stub ADL2_MMD_FeatureValuesX2_Get +@ stub ADL2_MMD_FeatureValuesX2_Set +@ stub ADL2_MMD_FeatureValues_Get +@ stub ADL2_MMD_FeatureValues_Set +@ stub ADL2_MMD_FeaturesX2_Caps +@ stub ADL2_MMD_Features_Caps +@ stub ADL2_MMD_VideoAdjustInfo_Get +@ stub ADL2_MMD_VideoAdjustInfo_Set +@ stub ADL2_MMD_VideoColor_Caps +@ stub ADL2_MMD_VideoColor_Get +@ stub ADL2_MMD_VideoColor_Set +@ stub ADL2_MMD_Video_Caps +@ stub ADL2_Main_ControlX2_Create +@ stdcall ADL2_Main_Control_Create(ptr long ptr) +@ stub ADL2_Main_Control_Destroy +@ stub ADL2_Main_Control_GetProcAddress +@ stub ADL2_Main_Control_IsFunctionValid +@ stub ADL2_Main_Control_Refresh +@ stub ADL2_Main_LogDebug_Set +@ stub ADL2_Main_LogError_Set +@ stub ADL2_New_QueryPMLogData_Get +@ stub ADL2_Overdrive5_CurrentActivity_Get +@ stub ADL2_Overdrive5_FanSpeedInfo_Get +@ stub ADL2_Overdrive5_FanSpeedToDefault_Set +@ stub ADL2_Overdrive5_FanSpeed_Get +@ stub ADL2_Overdrive5_FanSpeed_Set +@ stub ADL2_Overdrive5_ODParameters_Get +@ stub ADL2_Overdrive5_ODPerformanceLevels_Get +@ stub ADL2_Overdrive5_ODPerformanceLevels_Set +@ stub ADL2_Overdrive5_PowerControlAbsValue_Caps +@ stub ADL2_Overdrive5_PowerControlAbsValue_Get +@ stub ADL2_Overdrive5_PowerControlAbsValue_Set +@ stub ADL2_Overdrive5_PowerControlInfo_Get +@ stub ADL2_Overdrive5_PowerControl_Caps +@ stub ADL2_Overdrive5_PowerControl_Get +@ stub ADL2_Overdrive5_PowerControl_Set +@ stub ADL2_Overdrive5_Temperature_Get +@ stub ADL2_Overdrive5_ThermalDevices_Enum +@ stub ADL2_Overdrive6_AdvancedFan_Caps +@ stub ADL2_Overdrive6_CapabilitiesEx_Get +@ stub ADL2_Overdrive6_Capabilities_Get +@ stub ADL2_Overdrive6_ControlI2C +@ stub ADL2_Overdrive6_CurrentPower_Get +@ stub ADL2_Overdrive6_CurrentStatus_Get +@ stub ADL2_Overdrive6_FanPWMLimitData_Get +@ stub ADL2_Overdrive6_FanPWMLimitData_Set +@ stub ADL2_Overdrive6_FanPWMLimitRangeInfo_Get +@ stub ADL2_Overdrive6_FanSpeed_Get +@ stub ADL2_Overdrive6_FanSpeed_Reset +@ stub ADL2_Overdrive6_FanSpeed_Set +@ stub ADL2_Overdrive6_FuzzyController_Caps +@ stub ADL2_Overdrive6_MaxClockAdjust_Get +@ stub ADL2_Overdrive6_PowerControlInfo_Get +@ stub ADL2_Overdrive6_PowerControlInfo_Get_X2 +@ stub ADL2_Overdrive6_PowerControl_Caps +@ stub ADL2_Overdrive6_PowerControl_Get +@ stub ADL2_Overdrive6_PowerControl_Set +@ stub ADL2_Overdrive6_StateEx_Get +@ stub ADL2_Overdrive6_StateEx_Set +@ stub ADL2_Overdrive6_StateInfo_Get +@ stub ADL2_Overdrive6_State_Reset +@ stub ADL2_Overdrive6_State_Set +@ stub ADL2_Overdrive6_TargetTemperatureData_Get +@ stub ADL2_Overdrive6_TargetTemperatureData_Set +@ stub ADL2_Overdrive6_TargetTemperatureRangeInfo_Get +@ stub ADL2_Overdrive6_TemperatureEx_Get +@ stub ADL2_Overdrive6_Temperature_Get +@ stub ADL2_Overdrive6_ThermalController_Caps +@ stub ADL2_Overdrive6_ThermalLimitUnlock_Get +@ stub ADL2_Overdrive6_ThermalLimitUnlock_Set +@ stub ADL2_Overdrive6_VoltageControlInfo_Get +@ stub ADL2_Overdrive6_VoltageControl_Get +@ stub ADL2_Overdrive6_VoltageControl_Set +@ stub ADL2_Overdrive8_Current_SettingX2_Get +@ stub ADL2_Overdrive8_Current_SettingX3_Get +@ stub ADL2_Overdrive8_Current_Setting_Get +@ stub ADL2_Overdrive8_Init_SettingX2_Get +@ stub ADL2_Overdrive8_Init_Setting_Get +@ stub ADL2_Overdrive8_PMLogSenorRange_Caps +@ stub ADL2_Overdrive8_PMLogSenorType_Support_Get +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Read +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Start +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Stop +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Support +@ stub ADL2_Overdrive8_Setting_Set +@ stub ADL2_OverdriveN_AutoWattman_Caps +@ stub ADL2_OverdriveN_AutoWattman_Get +@ stub ADL2_OverdriveN_AutoWattman_Set +@ stub ADL2_OverdriveN_CapabilitiesX2_Get +@ stub ADL2_OverdriveN_Capabilities_Get +@ stub ADL2_OverdriveN_CountOfEvents_Get +@ stub ADL2_OverdriveN_FanControl_Get +@ stub ADL2_OverdriveN_FanControl_Set +@ stub ADL2_OverdriveN_MemoryClocksX2_Get +@ stub ADL2_OverdriveN_MemoryClocksX2_Set +@ stub ADL2_OverdriveN_MemoryClocks_Get +@ stub ADL2_OverdriveN_MemoryClocks_Set +@ stub ADL2_OverdriveN_MemoryTimingLevel_Get +@ stub ADL2_OverdriveN_MemoryTimingLevel_Set +@ stub ADL2_OverdriveN_PerformanceStatus_Get +@ stub ADL2_OverdriveN_PowerLimit_Get +@ stub ADL2_OverdriveN_PowerLimit_Set +@ stub ADL2_OverdriveN_SCLKAutoOverClock_Get +@ stub ADL2_OverdriveN_SCLKAutoOverClock_Set +@ stub ADL2_OverdriveN_SettingsExt_Get +@ stub ADL2_OverdriveN_SettingsExt_Set +@ stub ADL2_OverdriveN_SystemClocksX2_Get +@ stub ADL2_OverdriveN_SystemClocksX2_Set +@ stub ADL2_OverdriveN_SystemClocks_Get +@ stub ADL2_OverdriveN_SystemClocks_Set +@ stub ADL2_OverdriveN_Temperature_Get +@ stub ADL2_OverdriveN_Test_Set +@ stub ADL2_OverdriveN_ThrottleNotification_Get +@ stub ADL2_OverdriveN_ZeroRPMFan_Get +@ stub ADL2_OverdriveN_ZeroRPMFan_Set +@ stub ADL2_Overdrive_Caps +@ stub ADL2_PPLogSettings_Get +@ stub ADL2_PPLogSettings_Set +@ stub ADL2_PPW_Caps +@ stub ADL2_PPW_Status_Get +@ stub ADL2_PPW_Status_Set +@ stub ADL2_PageMigration_Settings_Get +@ stub ADL2_PageMigration_Settings_Set +@ stub ADL2_PerGPU_GDEvent_Register +@ stub ADL2_PerGPU_GDEvent_UnRegister +@ stub ADL2_PerfTuning_Status_Get +@ stub ADL2_PerfTuning_Status_Set +@ stub ADL2_PerformanceTuning_Caps +@ stub ADL2_PowerStates_Get +@ stub ADL2_PowerXpress_AncillaryDevices_Get +@ stub ADL2_PowerXpress_Config_Caps +@ stub ADL2_PowerXpress_Configuration_Get +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Caps +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Get +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Set +@ stub ADL2_PowerXpress_LongIdleDetect_Get +@ stub ADL2_PowerXpress_LongIdleDetect_Set +@ stub ADL2_PowerXpress_PowerControlMode_Get +@ stub ADL2_PowerXpress_PowerControlMode_Set +@ stub ADL2_PowerXpress_Scheme_Get +@ stub ADL2_PowerXpress_Scheme_Set +@ stub ADL2_RIS_Settings_Get +@ stub ADL2_RIS_Settings_Set +@ stub ADL2_RegisterEvent +@ stub ADL2_RegisterEventX2 +@ stub ADL2_Remap +@ stub ADL2_RemoteDisplay_Destroy +@ stub ADL2_RemoteDisplay_Display_Acquire +@ stub ADL2_RemoteDisplay_Display_Release +@ stub ADL2_RemoteDisplay_Display_Release_All +@ stub ADL2_RemoteDisplay_Hdcp20_Create +@ stub ADL2_RemoteDisplay_Hdcp20_Destroy +@ stub ADL2_RemoteDisplay_Hdcp20_Notify +@ stub ADL2_RemoteDisplay_Hdcp20_Process +@ stub ADL2_RemoteDisplay_IEPort_Set +@ stub ADL2_RemoteDisplay_Initialize +@ stub ADL2_RemoteDisplay_Nofitiation_Register +@ stub ADL2_RemoteDisplay_Notification_UnRegister +@ stub ADL2_RemoteDisplay_Support_Caps +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_InUse_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_Info_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_RadioState_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Change +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Get +@ stub ADL2_RemoteDisplay_WFDDeviceInfo_Get +@ stub ADL2_RemoteDisplay_WFDDeviceName_Change +@ stub ADL2_RemoteDisplay_WFDDevice_StatusInfo_Get +@ stub ADL2_RemoteDisplay_WFDDiscover_Start +@ stub ADL2_RemoteDisplay_WFDDiscover_Stop +@ stub ADL2_RemoteDisplay_WFDLink_Connect +@ stub ADL2_RemoteDisplay_WFDLink_Creation_Accept +@ stub ADL2_RemoteDisplay_WFDLink_Disconnect +@ stub ADL2_RemoteDisplay_WFDLink_WPS_Process +@ stub ADL2_RemoteDisplay_WFDWDSPSettings_Set +@ stub ADL2_RemoteDisplay_WirelessDisplayEnableDisable_Commit +@ stub ADL2_RemotePlay_ControlFlags_Set +@ stub ADL2_ScreenPoint_AudioMappingInfo_Get +@ stub ADL2_Send +@ stub ADL2_SendX2 +@ stub ADL2_Stereo3D_2DPackedFormat_Set +@ stub ADL2_Stereo3D_3DCursorOffset_Get +@ stub ADL2_Stereo3D_3DCursorOffset_Set +@ stub ADL2_Stereo3D_CurrentFormat_Get +@ stub ADL2_Stereo3D_Info_Get +@ stub ADL2_Stereo3D_Modes_Get +@ stub ADL2_SwitchableGraphics_Applications_Get +@ stub ADL2_TV_Standard_Get +@ stub ADL2_TV_Standard_Set +@ stub ADL2_TurboSyncSupport_Get +@ stub ADL2_UnRegisterEvent +@ stub ADL2_UnRegisterEventX2 +@ stub ADL2_User_Settings_Notify +@ stub ADL2_WS_Overdrive_Caps +@ stub ADL2_Win_IsHybridAI +@ stub ADL2_Workstation_8BitGrayscale_Get +@ stub ADL2_Workstation_8BitGrayscale_Set +@ stub ADL2_Workstation_AdapterNumOfGLSyncConnectors_Get +@ stub ADL2_Workstation_Caps +@ stub ADL2_Workstation_DeepBitDepthX2_Get +@ stub ADL2_Workstation_DeepBitDepthX2_Set +@ stub ADL2_Workstation_DeepBitDepth_Get +@ stub ADL2_Workstation_DeepBitDepth_Set +@ stub ADL2_Workstation_DisplayGLSyncMode_Get +@ stub ADL2_Workstation_DisplayGLSyncMode_Set +@ stub ADL2_Workstation_DisplayGenlockCapable_Get +@ stub ADL2_Workstation_ECCData_Get +@ stub ADL2_Workstation_ECCX2_Get +@ stub ADL2_Workstation_ECC_Caps +@ stub ADL2_Workstation_ECC_Get +@ stub ADL2_Workstation_ECC_Set +@ stub ADL2_Workstation_GLSyncCounters_Get +@ stub ADL2_Workstation_GLSyncGenlockConfiguration_Get +@ stub ADL2_Workstation_GLSyncGenlockConfiguration_Set +@ stub ADL2_Workstation_GLSyncModuleDetect_Get +@ stub ADL2_Workstation_GLSyncModuleInfo_Get +@ stub ADL2_Workstation_GLSyncPortState_Get +@ stub ADL2_Workstation_GLSyncPortState_Set +@ stub ADL2_Workstation_GLSyncSupportedTopology_Get +@ stub ADL2_Workstation_GlobalEDIDPersistence_Get +@ stub ADL2_Workstation_GlobalEDIDPersistence_Set +@ stub ADL2_Workstation_LoadBalancing_Caps +@ stub ADL2_Workstation_LoadBalancing_Get +@ stub ADL2_Workstation_LoadBalancing_Set +@ stub ADL2_Workstation_RAS_ErrorCounts_Get +@ stub ADL2_Workstation_RAS_ErrorCounts_Reset +@ stub ADL2_Workstation_SDISegmentList_Get +@ stub ADL2_Workstation_SDI_Caps +@ stub ADL2_Workstation_SDI_Get +@ stub ADL2_Workstation_SDI_Set +@ stub ADL2_Workstation_Stereo_Get +@ stub ADL2_Workstation_Stereo_Set +@ stub ADL2_Workstation_UnsupportedDisplayModes_Enable +@ stub ADL_ADC_CurrentProfileFromDrv_Get +@ stub ADL_ADC_Display_AdapterDeviceProfileEx_Get +@ stub ADL_ADC_DrvDataToProfile_Copy +@ stub ADL_ADC_FindClosestMode_Get +@ stub ADL_ADC_IsDevModeEqual_Get +@ stub ADL_ADC_Profile_Apply +@ stub ADL_APO_AudioDelayAdjustmentInfo_Get +@ stub ADL_APO_AudioDelay_Restore +@ stub ADL_APO_AudioDelay_Set +@ stub ADL_AdapterLimitation_Caps +@ stub ADL_AdapterX2_Caps +@ stdcall ADL_Adapter_ASICFamilyType_Get(long ptr ptr) +@ stub ADL_Adapter_ASICInfo_Get +@ stub ADL_Adapter_Accessibility_Get +@ stub ADL_Adapter_Active_Get +@ stub ADL_Adapter_Active_Set +@ stub ADL_Adapter_Active_SetPrefer +@ stub ADL_Adapter_AdapterInfoX2_Get +@ stdcall ADL_Adapter_AdapterInfo_Get(ptr long) +@ stub ADL_Adapter_AdapterList_Disable +@ stub ADL_Adapter_Aspects_Get +@ stub ADL_Adapter_AudioChannelSplitConfiguration_Get +@ stub ADL_Adapter_AudioChannelSplit_Disable +@ stub ADL_Adapter_AudioChannelSplit_Enable +@ stub ADL_Adapter_BigSw_Info_Get +@ stub ADL_Adapter_BlackAndWhiteLevelSupport_Get +@ stub ADL_Adapter_BlackAndWhiteLevel_Get +@ stub ADL_Adapter_BlackAndWhiteLevel_Set +@ stub ADL_Adapter_BoardLayout_Get +@ stub ADL_Adapter_Caps +@ stub ADL_Adapter_ChipSetInfo_Get +@ stub ADL_Adapter_ConfigMemory_Cap +@ stub ADL_Adapter_ConfigMemory_Get +@ stub ADL_Adapter_ConfigureState_Get +@ stub ADL_Adapter_ConnectionData_Get +@ stub ADL_Adapter_ConnectionData_Remove +@ stub ADL_Adapter_ConnectionData_Set +@ stub ADL_Adapter_ConnectionState_Get +@ stub ADL_Adapter_CrossDisplayPlatformInfo_Get +@ stub ADL_Adapter_CrossdisplayAdapterRole_Caps +@ stub ADL_Adapter_CrossdisplayInfoX2_Set +@ stub ADL_Adapter_CrossdisplayInfo_Get +@ stub ADL_Adapter_CrossdisplayInfo_Set +@ stub ADL_Adapter_CrossfireX2_Get +@ stdcall ADL_Adapter_Crossfire_Caps(long ptr ptr ptr) +@ stdcall ADL_Adapter_Crossfire_Get(long ptr ptr) +@ stub ADL_Adapter_Crossfire_Set +@ stub ADL_Adapter_DefaultAudioChannelTable_Load +@ stub ADL_Adapter_DisplayAudioEndpoint_Enable +@ stub ADL_Adapter_DisplayAudioEndpoint_Mute +@ stub ADL_Adapter_DisplayAudioInfo_Get +@ stub ADL_Adapter_DisplayGTCCaps_Get +@ stub ADL_Adapter_Display_Caps +@ stub ADL_Adapter_DriverSettings_Get +@ stub ADL_Adapter_DriverSettings_Set +@ stub ADL_Adapter_EDIDManagement_Caps +@ stub ADL_Adapter_EmulationMode_Set +@ stub ADL_Adapter_ExtInfo_Get +@ stub ADL_Adapter_Gamma_Get +@ stub ADL_Adapter_Gamma_Set +@ stub ADL_Adapter_ID_Get +@ stub ADL_Adapter_LocalDisplayConfig_Get +@ stub ADL_Adapter_LocalDisplayConfig_Set +@ stub ADL_Adapter_LocalDisplayState_Get +@ stub ADL_Adapter_MaxCursorSize_Get +@ stub ADL_Adapter_MemoryInfo2_Get +@ stdcall ADL_Adapter_MemoryInfo_Get(long ptr) +@ stub ADL_Adapter_MirabilisSupport_Get +@ stub ADL_Adapter_ModeSwitch +@ stub ADL_Adapter_ModeTimingOverride_Caps +@ stub ADL_Adapter_Modes_ReEnumerate +@ stub ADL_Adapter_NumberOfActivatableSources_Get +@ stdcall ADL_Adapter_NumberOfAdapters_Get(ptr) +@ stdcall ADL_Adapter_ObservedClockInfo_Get(long ptr ptr) +@ stub ADL_Adapter_ObservedGameClockInfo_Get +@ stub ADL_Adapter_Primary_Get +@ stub ADL_Adapter_Primary_Set +@ stub ADL_Adapter_RegValueInt_Get +@ stub ADL_Adapter_RegValueInt_Set +@ stub ADL_Adapter_RegValueString_Get +@ stub ADL_Adapter_RegValueString_Set +@ stub ADL_Adapter_SWInfo_Get +@ stub ADL_Adapter_Speed_Caps +@ stub ADL_Adapter_Speed_Get +@ stub ADL_Adapter_Speed_Set +@ stub ADL_Adapter_SupportedConnections_Get +@ stub ADL_Adapter_Tear_Free_Cap +@ stub ADL_Adapter_VariBrightEnable_Set +@ stub ADL_Adapter_VariBrightLevel_Get +@ stub ADL_Adapter_VariBrightLevel_Set +@ stub ADL_Adapter_VariBright_Caps +@ stub ADL_Adapter_VideoBiosInfo_Get +@ stub ADL_Adapter_VideoTheaterModeInfo_Get +@ stub ADL_Adapter_VideoTheaterModeInfo_Set +@ stub ADL_ApplicationProfiles_Applications_Get +@ stub ADL_ApplicationProfiles_ConvertToCompact +@ stub ADL_ApplicationProfiles_DriverAreaPrivacy_Get +@ stub ADL_ApplicationProfiles_GetCustomization +@ stub ADL_ApplicationProfiles_HitListsX2_Get +@ stub ADL_ApplicationProfiles_HitLists_Get +@ stub ADL_ApplicationProfiles_ProfileApplicationX2_Assign +@ stub ADL_ApplicationProfiles_ProfileApplication_Assign +@ stub ADL_ApplicationProfiles_ProfileOfAnApplicationX2_Search +@ stub ADL_ApplicationProfiles_ProfileOfAnApplication_InMemorySearch +@ stub ADL_ApplicationProfiles_ProfileOfAnApplication_Search +@ stub ADL_ApplicationProfiles_Profile_Create +@ stub ADL_ApplicationProfiles_Profile_Exist +@ stub ADL_ApplicationProfiles_Profile_Remove +@ stub ADL_ApplicationProfiles_PropertyType_Get +@ stub ADL_ApplicationProfiles_Release_Get +@ stub ADL_ApplicationProfiles_RemoveApplication +@ stub ADL_ApplicationProfiles_StatusInfo_Get +@ stub ADL_ApplicationProfiles_System_Reload +@ stub ADL_ApplicationProfiles_User_Load +@ stub ADL_ApplicationProfiles_User_Unload +@ stub ADL_Audio_CurrentSampleRate_Get +@ stub ADL_CDS_UnsafeMode_Set +@ stub ADL_CV_DongleSettings_Get +@ stub ADL_CV_DongleSettings_Reset +@ stub ADL_CV_DongleSettings_Set +@ stub ADL_DFP_AllowOnlyCETimings_Get +@ stub ADL_DFP_AllowOnlyCETimings_Set +@ stub ADL_DFP_BaseAudioSupport_Get +@ stub ADL_DFP_GPUScalingEnable_Get +@ stub ADL_DFP_GPUScalingEnable_Set +@ stub ADL_DFP_HDMISupport_Get +@ stub ADL_DFP_MVPUAnalogSupport_Get +@ stub ADL_DFP_PixelFormat_Caps +@ stub ADL_DFP_PixelFormat_Get +@ stub ADL_DFP_PixelFormat_Set +@ stub ADL_DisplayScaling_Set +@ stub ADL_Display_AdapterID_Get +@ stub ADL_Display_AdjustCaps_Get +@ stub ADL_Display_AdjustmentCoherent_Get +@ stub ADL_Display_AdjustmentCoherent_Set +@ stub ADL_Display_AudioMappingInfo_Get +@ stub ADL_Display_AvivoColor_Get +@ stub ADL_Display_AvivoCurrentColor_Set +@ stub ADL_Display_AvivoDefaultColor_Set +@ stub ADL_Display_BackLight_Get +@ stub ADL_Display_BackLight_Set +@ stub ADL_Display_BezelOffsetSteppingSize_Get +@ stub ADL_Display_BezelOffset_Set +@ stub ADL_Display_BezelSupported_Validate +@ stub ADL_Display_Capabilities_Get +@ stub ADL_Display_ColorCaps_Get +@ stub ADL_Display_ColorDepth_Get +@ stub ADL_Display_ColorDepth_Set +@ stub ADL_Display_ColorTemperatureSource_Get +@ stub ADL_Display_ColorTemperatureSource_Set +@ stub ADL_Display_Color_Get +@ stub ADL_Display_Color_Set +@ stub ADL_Display_ConnectedDisplays_Get +@ stub ADL_Display_ContainerID_Get +@ stub ADL_Display_ControllerOverlayAdjustmentCaps_Get +@ stub ADL_Display_ControllerOverlayAdjustmentData_Get +@ stub ADL_Display_ControllerOverlayAdjustmentData_Set +@ stub ADL_Display_CurrentPixelClock_Get +@ stub ADL_Display_CustomizedModeListNum_Get +@ stub ADL_Display_CustomizedModeList_Get +@ stub ADL_Display_CustomizedMode_Add +@ stub ADL_Display_CustomizedMode_Delete +@ stub ADL_Display_CustomizedMode_Validate +@ stub ADL_Display_DCE_Get +@ stub ADL_Display_DCE_Set +@ stub ADL_Display_DDCBlockAccess_Get +@ stub ADL_Display_DDCInfo2_Get +@ stub ADL_Display_DDCInfo_Get +@ stub ADL_Display_Deflicker_Get +@ stub ADL_Display_Deflicker_Set +@ stub ADL_Display_DeviceConfig_Get +@ stub ADL_Display_DisplayContent_Cap +@ stub ADL_Display_DisplayContent_Get +@ stub ADL_Display_DisplayContent_Set +@ stdcall ADL_Display_DisplayInfo_Get(long long ptr long) +@ stdcall ADL_Display_DisplayMapConfig_Get(long ptr ptr ptr ptr long) +@ stub ADL_Display_DisplayMapConfig_PossibleAddAndRemove +@ stub ADL_Display_DisplayMapConfig_Set +@ stub ADL_Display_DisplayMapConfig_Validate +@ stub ADL_Display_DitherState_Get +@ stub ADL_Display_DitherState_Set +@ stub ADL_Display_Downscaling_Caps +@ stub ADL_Display_DpMstInfo_Get +@ stub ADL_Display_EdidData_Get +@ stub ADL_Display_EdidData_Set +@ stub ADL_Display_EnumDisplays_Get +@ stub ADL_Display_FilterSVideo_Get +@ stub ADL_Display_FilterSVideo_Set +@ stub ADL_Display_ForcibleDisplay_Get +@ stub ADL_Display_ForcibleDisplay_Set +@ stub ADL_Display_FormatsOverride_Get +@ stub ADL_Display_FormatsOverride_Set +@ stub ADL_Display_FreeSyncState_Get +@ stub ADL_Display_FreeSyncState_Set +@ stub ADL_Display_FreeSync_Cap +@ stub ADL_Display_GamutMapping_Get +@ stub ADL_Display_GamutMapping_Reset +@ stub ADL_Display_GamutMapping_Set +@ stub ADL_Display_Gamut_Caps +@ stub ADL_Display_Gamut_Get +@ stub ADL_Display_Gamut_Set +@ stub ADL_Display_ImageExpansion_Get +@ stub ADL_Display_ImageExpansion_Set +@ stub ADL_Display_InfoPacket_Get +@ stub ADL_Display_InfoPacket_Set +@ stub ADL_Display_LCDRefreshRateCapability_Get +@ stub ADL_Display_LCDRefreshRateOptions_Get +@ stub ADL_Display_LCDRefreshRateOptions_Set +@ stub ADL_Display_LCDRefreshRate_Get +@ stub ADL_Display_LCDRefreshRate_Set +@ stub ADL_Display_Limits_Get +@ stub ADL_Display_MVPUCaps_Get +@ stub ADL_Display_MVPUStatus_Get +@ stub ADL_Display_ModeTimingOverrideInfo_Get +@ stub ADL_Display_ModeTimingOverrideListX2_Get +@ stub ADL_Display_ModeTimingOverrideList_Get +@ stub ADL_Display_ModeTimingOverrideX2_Get +@ stub ADL_Display_ModeTimingOverride_Delete +@ stub ADL_Display_ModeTimingOverride_Get +@ stub ADL_Display_ModeTimingOverride_Set +@ stub ADL_Display_Modes_Get +@ stub ADL_Display_Modes_Set +@ stub ADL_Display_MonitorPowerState_Set +@ stub ADL_Display_NativeAUXChannel_Access +@ stub ADL_Display_NeedWorkaroundFor5Clone_Get +@ stub ADL_Display_NumberOfDisplays_Get +@ stub ADL_Display_ODClockConfig_Set +@ stub ADL_Display_ODClockInfo_Get +@ stub ADL_Display_Overlap_Set +@ stub ADL_Display_Overscan_Get +@ stub ADL_Display_Overscan_Set +@ stub ADL_Display_PixelClockAllowableRange_Set +@ stub ADL_Display_PixelClockCaps_Get +@ stub ADL_Display_PixelFormat_Get +@ stub ADL_Display_PixelFormat_Set +@ stub ADL_Display_Position_Get +@ stub ADL_Display_Position_Set +@ stub ADL_Display_PossibleMapping_Get +@ stub ADL_Display_PossibleMode_Get +@ stub ADL_Display_PowerXpressActiveGPU_Get +@ stub ADL_Display_PowerXpressActiveGPU_Set +@ stub ADL_Display_PowerXpressActvieGPUR2_Get +@ stub ADL_Display_PowerXpressVersion_Get +@ stub ADL_Display_PowerXpress_AutoSwitchConfig_Get +@ stub ADL_Display_PowerXpress_AutoSwitchConfig_Set +@ stub ADL_Display_PreservedAspectRatio_Get +@ stub ADL_Display_PreservedAspectRatio_Set +@ stub ADL_Display_Property_Get +@ stub ADL_Display_Property_Set +@ stub ADL_Display_RcDisplayAdjustment +@ stub ADL_Display_ReGammaCoefficients_Get +@ stub ADL_Display_ReGammaCoefficients_Set +@ stub ADL_Display_ReducedBlanking_Get +@ stub ADL_Display_ReducedBlanking_Set +@ stub ADL_Display_RegammaR1_Get +@ stub ADL_Display_RegammaR1_Set +@ stub ADL_Display_Regamma_Get +@ stub ADL_Display_Regamma_Set +@ stub ADL_Display_SLSGrid_Caps +@ stub ADL_Display_SLSMapConfigX2_Get +@ stub ADL_Display_SLSMapConfig_Create +@ stub ADL_Display_SLSMapConfig_Delete +@ stub ADL_Display_SLSMapConfig_Get +@ stub ADL_Display_SLSMapConfig_Rearrange +@ stub ADL_Display_SLSMapConfig_SetState +@ stub ADL_Display_SLSMapIndexList_Get +@ stub ADL_Display_SLSMapIndex_Get +@ stub ADL_Display_SLSMiddleMode_Get +@ stub ADL_Display_SLSMiddleMode_Set +@ stub ADL_Display_SLSRecords_Get +@ stub ADL_Display_Sharpness_Caps +@ stub ADL_Display_Sharpness_Get +@ stub ADL_Display_Sharpness_Info_Get +@ stub ADL_Display_Sharpness_Set +@ stub ADL_Display_Size_Get +@ stub ADL_Display_Size_Set +@ stub ADL_Display_SourceContentAttribute_Get +@ stub ADL_Display_SourceContentAttribute_Set +@ stub ADL_Display_SplitDisplay_Caps +@ stub ADL_Display_SplitDisplay_Get +@ stub ADL_Display_SplitDisplay_RestoreDesktopConfiguration +@ stub ADL_Display_SplitDisplay_Set +@ stub ADL_Display_SupportedColorDepth_Get +@ stub ADL_Display_SupportedPixelFormat_Get +@ stub ADL_Display_SwitchingCapability_Get +@ stub ADL_Display_TVCaps_Get +@ stub ADL_Display_TargetTiming_Get +@ stub ADL_Display_UnderScan_Auto_Get +@ stub ADL_Display_UnderScan_Auto_Set +@ stub ADL_Display_Underscan_Get +@ stub ADL_Display_Underscan_Set +@ stub ADL_Display_Vector_Get +@ stub ADL_Display_ViewPort_Cap +@ stub ADL_Display_ViewPort_Get +@ stub ADL_Display_ViewPort_Set +@ stub ADL_Display_WriteAndReadI2C +@ stub ADL_Display_WriteAndReadI2CLargePayload +@ stub ADL_Display_WriteAndReadI2CRev_Get +@ stub ADL_Flush_Driver_Data +@ stdcall ADL_Graphics_Platform_Get(ptr) +@ stdcall ADL_Graphics_Versions_Get(ptr) +@ stub ADL_MMD_FeatureList_Get +@ stub ADL_MMD_FeatureValuesX2_Get +@ stub ADL_MMD_FeatureValuesX2_Set +@ stub ADL_MMD_FeatureValues_Get +@ stub ADL_MMD_FeatureValues_Set +@ stub ADL_MMD_FeaturesX2_Caps +@ stub ADL_MMD_Features_Caps +@ stub ADL_MMD_VideoAdjustInfo_Get +@ stub ADL_MMD_VideoAdjustInfo_Set +@ stub ADL_MMD_VideoColor_Caps +@ stub ADL_MMD_VideoColor_Get +@ stub ADL_MMD_VideoColor_Set +@ stub ADL_MMD_Video_Caps +@ stub ADL_Main_ControlX2_Create +@ stdcall ADL_Main_Control_Create(ptr long) +@ stdcall ADL_Main_Control_Destroy() +@ stub ADL_Main_Control_GetProcAddress +@ stub ADL_Main_Control_IsFunctionValid +@ stub ADL_Main_Control_Refresh +@ stub ADL_Main_LogDebug_Set +@ stub ADL_Main_LogError_Set +@ stub ADL_Overdrive5_CurrentActivity_Get +@ stub ADL_Overdrive5_FanSpeedInfo_Get +@ stub ADL_Overdrive5_FanSpeedToDefault_Set +@ stub ADL_Overdrive5_FanSpeed_Get +@ stub ADL_Overdrive5_FanSpeed_Set +@ stub ADL_Overdrive5_ODParameters_Get +@ stub ADL_Overdrive5_ODPerformanceLevels_Get +@ stub ADL_Overdrive5_ODPerformanceLevels_Set +@ stub ADL_Overdrive5_PowerControlAbsValue_Caps +@ stub ADL_Overdrive5_PowerControlAbsValue_Get +@ stub ADL_Overdrive5_PowerControlAbsValue_Set +@ stub ADL_Overdrive5_PowerControlInfo_Get +@ stub ADL_Overdrive5_PowerControl_Caps +@ stub ADL_Overdrive5_PowerControl_Get +@ stub ADL_Overdrive5_PowerControl_Set +@ stub ADL_Overdrive5_Temperature_Get +@ stub ADL_Overdrive5_ThermalDevices_Enum +@ stub ADL_Overdrive6_AdvancedFan_Caps +@ stub ADL_Overdrive6_CapabilitiesEx_Get +@ stub ADL_Overdrive6_Capabilities_Get +@ stub ADL_Overdrive6_CurrentStatus_Get +@ stub ADL_Overdrive6_FanPWMLimitData_Get +@ stub ADL_Overdrive6_FanPWMLimitData_Set +@ stub ADL_Overdrive6_FanPWMLimitRangeInfo_Get +@ stub ADL_Overdrive6_FanSpeed_Get +@ stub ADL_Overdrive6_FanSpeed_Reset +@ stub ADL_Overdrive6_FanSpeed_Set +@ stub ADL_Overdrive6_FuzzyController_Caps +@ stub ADL_Overdrive6_MaxClockAdjust_Get +@ stub ADL_Overdrive6_PowerControlInfo_Get +@ stub ADL_Overdrive6_PowerControl_Caps +@ stub ADL_Overdrive6_PowerControl_Get +@ stub ADL_Overdrive6_PowerControl_Set +@ stub ADL_Overdrive6_StateEx_Get +@ stub ADL_Overdrive6_StateEx_Set +@ stub ADL_Overdrive6_StateInfo_Get +@ stub ADL_Overdrive6_State_Reset +@ stub ADL_Overdrive6_State_Set +@ stub ADL_Overdrive6_TargetTemperatureData_Get +@ stub ADL_Overdrive6_TargetTemperatureData_Set +@ stub ADL_Overdrive6_TargetTemperatureRangeInfo_Get +@ stub ADL_Overdrive6_Temperature_Get +@ stub ADL_Overdrive6_ThermalController_Caps +@ stub ADL_Overdrive6_ThermalLimitUnlock_Get +@ stub ADL_Overdrive6_ThermalLimitUnlock_Set +@ stub ADL_Overdrive6_VoltageControlInfo_Get +@ stub ADL_Overdrive6_VoltageControl_Get +@ stub ADL_Overdrive6_VoltageControl_Set +@ stub ADL_Overdrive_Caps +@ stub ADL_PowerXpress_AncillaryDevices_Get +@ stub ADL_PowerXpress_Config_Caps +@ stub ADL_PowerXpress_ExtendedBatteryMode_Caps +@ stub ADL_PowerXpress_ExtendedBatteryMode_Get +@ stub ADL_PowerXpress_ExtendedBatteryMode_Set +@ stub ADL_PowerXpress_LongIdleDetect_Get +@ stub ADL_PowerXpress_LongIdleDetect_Set +@ stub ADL_PowerXpress_PowerControlMode_Get +@ stub ADL_PowerXpress_PowerControlMode_Set +@ stub ADL_PowerXpress_Scheme_Get +@ stub ADL_PowerXpress_Scheme_Set +@ stub ADL_Remap +@ stub ADL_RemoteDisplay_Destroy +@ stub ADL_RemoteDisplay_Display_Acquire +@ stub ADL_RemoteDisplay_Display_Release +@ stub ADL_RemoteDisplay_Display_Release_All +@ stub ADL_RemoteDisplay_Hdcp20_Create +@ stub ADL_RemoteDisplay_Hdcp20_Destroy +@ stub ADL_RemoteDisplay_Hdcp20_Notify +@ stub ADL_RemoteDisplay_Hdcp20_Process +@ stub ADL_RemoteDisplay_IEPort_Set +@ stub ADL_RemoteDisplay_Initialize +@ stub ADL_RemoteDisplay_Nofitiation_Register +@ stub ADL_RemoteDisplay_Notification_UnRegister +@ stub ADL_RemoteDisplay_Support_Caps +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_InUse_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_Info_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_RadioState_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Change +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Get +@ stub ADL_RemoteDisplay_WFDDeviceInfo_Get +@ stub ADL_RemoteDisplay_WFDDeviceName_Change +@ stub ADL_RemoteDisplay_WFDDevice_StatusInfo_Get +@ stub ADL_RemoteDisplay_WFDDiscover_Start +@ stub ADL_RemoteDisplay_WFDDiscover_Stop +@ stub ADL_RemoteDisplay_WFDLink_Connect +@ stub ADL_RemoteDisplay_WFDLink_Creation_Accept +@ stub ADL_RemoteDisplay_WFDLink_Disconnect +@ stub ADL_RemoteDisplay_WFDLink_WPS_Process +@ stub ADL_RemoteDisplay_WFDWDSPSettings_Set +@ stub ADL_RemoteDisplay_WirelessDisplayEnableDisable_Commit +@ stub ADL_ScreenPoint_AudioMappingInfo_Get +@ stub ADL_Stereo3D_2DPackedFormat_Set +@ stub ADL_Stereo3D_3DCursorOffset_Get +@ stub ADL_Stereo3D_3DCursorOffset_Set +@ stub ADL_Stereo3D_CurrentFormat_Get +@ stub ADL_Stereo3D_Info_Get +@ stub ADL_Stereo3D_Modes_Get +@ stub ADL_TV_Standard_Get +@ stub ADL_TV_Standard_Set +@ stub ADL_Win_IsHybridAI +@ stub ADL_Workstation_8BitGrayscale_Get +@ stub ADL_Workstation_8BitGrayscale_Set +@ stub ADL_Workstation_AdapterNumOfGLSyncConnectors_Get +@ stub ADL_Workstation_Caps +@ stub ADL_Workstation_DeepBitDepthX2_Get +@ stub ADL_Workstation_DeepBitDepthX2_Set +@ stub ADL_Workstation_DeepBitDepth_Get +@ stub ADL_Workstation_DeepBitDepth_Set +@ stub ADL_Workstation_DisplayGLSyncMode_Get +@ stub ADL_Workstation_DisplayGLSyncMode_Set +@ stub ADL_Workstation_DisplayGenlockCapable_Get +@ stub ADL_Workstation_ECCData_Get +@ stub ADL_Workstation_ECCX2_Get +@ stub ADL_Workstation_ECC_Caps +@ stub ADL_Workstation_ECC_Get +@ stub ADL_Workstation_ECC_Set +@ stub ADL_Workstation_GLSyncCounters_Get +@ stub ADL_Workstation_GLSyncGenlockConfiguration_Get +@ stub ADL_Workstation_GLSyncGenlockConfiguration_Set +@ stub ADL_Workstation_GLSyncModuleDetect_Get +@ stub ADL_Workstation_GLSyncModuleInfo_Get +@ stub ADL_Workstation_GLSyncPortState_Get +@ stub ADL_Workstation_GLSyncPortState_Set +@ stub ADL_Workstation_GLSyncSupportedTopology_Get +@ stub ADL_Workstation_GlobalEDIDPersistence_Get +@ stub ADL_Workstation_GlobalEDIDPersistence_Set +@ stub ADL_Workstation_LoadBalancing_Caps +@ stub ADL_Workstation_LoadBalancing_Get +@ stub ADL_Workstation_LoadBalancing_Set +@ stub ADL_Workstation_RAS_Get_Error_Counts +@ stub ADL_Workstation_RAS_Get_Features +@ stub ADL_Workstation_RAS_Reset_Error_Counts +@ stub ADL_Workstation_RAS_Set_Features +@ stub ADL_Workstation_SDISegmentList_Get +@ stub ADL_Workstation_SDI_Caps +@ stub ADL_Workstation_SDI_Get +@ stub ADL_Workstation_SDI_Set +@ stub ADL_Workstation_Stereo_Get +@ stub ADL_Workstation_Stereo_Set +@ stub ADL_Workstation_UnsupportedDisplayModes_Enable +@ stub AmdPowerXpressRequestHighPerformance +@ stub Desktop_Detach +@ stub Send +@ stub SendX2 diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c new file mode 100644 index 00000000000..8fdd2e55d02 --- /dev/null +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -0,0 +1,493 @@ +/* Headers: https://github.com/GPUOpen-LibrariesAndSDKs/display-library */ + +#include +#include +#include + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "initguid.h" +#include "wine/debug.h" + +#include "dxgi.h" + +#define MAX_GPUS 64 +#define VENDOR_AMD 0x1002 + +#define ADL_OK 0 +#define ADL_ERR -1 +#define ADL_ERR_INVALID_PARAM -3 +#define ADL_ERR_INVALID_ADL_IDX -5 +#define ADL_ERR_NOT_SUPPORTED -8 +#define ADL_ERR_NULL_POINTER -9 + +#define ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED 0x00000001 +#define ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED 0x00000002 +#define ADL_DISPLAY_DISPLAYINFO_MASK 0x31fff + +#define ADL_ASIC_DISCRETE (1 << 0) +#define ADL_ASIC_MASK 0xAF + +enum ADLPlatForm +{ + GRAPHICS_PLATFORM_DESKTOP = 0, + GRAPHICS_PLATFORM_MOBILE = 1 +}; +#define GRAPHICS_PLATFORM_UNKNOWN -1 + + +static IDXGIFactory *dxgi_factory; + +WINE_DEFAULT_DEBUG_CHANNEL(atiadlxx); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +typedef void *(CALLBACK *ADL_MAIN_MALLOC_CALLBACK)(int); +typedef void *ADL_CONTEXT_HANDLE; + +ADL_MAIN_MALLOC_CALLBACK adl_malloc; +#define ADL_MAX_PATH 256 + +typedef struct ADLVersionsInfo +{ + char strDriverVer[ADL_MAX_PATH]; + char strCatalystVersion[ADL_MAX_PATH]; + char strCatalystWebLink[ADL_MAX_PATH]; +} ADLVersionsInfo, *LPADLVersionsInfo; + +typedef struct ADLVersionsInfoX2 +{ + char strDriverVer[ADL_MAX_PATH]; + char strCatalystVersion[ADL_MAX_PATH]; + char strCrimsonVersion[ADL_MAX_PATH]; + char strCatalystWebLink[ADL_MAX_PATH]; +} ADLVersionsInfoX2, *LPADLVersionsInfoX2; + +typedef struct ADLAdapterInfo { + int iSize; + int iAdapterIndex; + char strUDID[ADL_MAX_PATH]; + int iBusNumber; + int iDeviceNumber; + int iFunctionNumber; + int iVendorID; + char strAdapterName[ADL_MAX_PATH]; + char strDisplayName[ADL_MAX_PATH]; + int iPresent; + int iExist; + char strDriverPath[ADL_MAX_PATH]; + char strDriverPathExt[ADL_MAX_PATH]; + char strPNPString[ADL_MAX_PATH]; + int iOSDisplayIndex; +} ADLAdapterInfo, *LPADLAdapterInfo; + +typedef struct ADLDisplayID +{ + int iDisplayLogicalIndex; + int iDisplayPhysicalIndex; + int iDisplayLogicalAdapterIndex; + int iDisplayPhysicalAdapterIndex; +} ADLDisplayID, *LPADLDisplayID; + +typedef struct ADLDisplayInfo +{ + ADLDisplayID displayID; + int iDisplayControllerIndex; + char strDisplayName[ADL_MAX_PATH]; + char strDisplayManufacturerName[ADL_MAX_PATH]; + int iDisplayType; + int iDisplayOutputType; + int iDisplayConnector; + int iDisplayInfoMask; + int iDisplayInfoValue; +} ADLDisplayInfo, *LPADLDisplayInfo; + +typedef struct ADLCrossfireComb +{ + int iNumLinkAdapter; + int iAdaptLink[3]; +} ADLCrossfireComb; + +typedef struct ADLCrossfireInfo +{ + int iErrorCode; + int iState; + int iSupported; +} ADLCrossfireInfo; + +typedef struct ADLMemoryInfo +{ + long long iMemorySize; + char strMemoryType[ADL_MAX_PATH]; + long long iMemoryBandwidth; +} ADLMemoryInfo, *LPADLMemoryInfo; + +typedef struct ADLDisplayTarget +{ + ADLDisplayID displayID; + int iDisplayMapIndex; + int iDisplayTargetMask; + int iDisplayTargetValue; +} ADLDisplayTarget, *LPADLDisplayTarget; + +typedef struct ADLMode +{ + int iAdapterIndex; + ADLDisplayID displayID; + int iXPos; + int iYPos; + int iXRes; + int iYRes; + int iColourDepth; + float fRefreshRate; + int iOrientation; + int iModeFlag; + int iModeMask; + int iModeValue; +} ADLMode, *LPADLMode; + +typedef struct ADLDisplayMap +{ + int iDisplayMapIndex; + ADLMode displayMode; + int iNumDisplayTarget; + int iFirstDisplayTargetArrayIndex; + int iDisplayMapMask; + int iDisplayMapValue; +} ADLDisplayMap, *LPADLDisplayMap; + +static const ADLVersionsInfo version = { + "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", + "", + "http://support.amd.com/drivers/xml/driver_09_us.xml", +}; + +static const ADLVersionsInfoX2 version2 = { + "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", + "", + "23.10.2", + "http://support.amd.com/drivers/xml/driver_09_us.xml", +}; + +int WINAPI ADL2_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg, ADL_CONTEXT_HANDLE *ptr) +{ + FIXME("cb %p, arg %d, ptr %p stub!\n", cb, arg, ptr); + return ADL_OK; +} + +int WINAPI ADL_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg) +{ + FIXME("cb %p, arg %d stub!\n", cb, arg); + adl_malloc = cb; + + + if (SUCCEEDED(CreateDXGIFactory(&IID_IDXGIFactory, (void**) &dxgi_factory))) + return ADL_OK; + else + return ADL_ERR; +} + +int WINAPI ADL_Main_Control_Destroy(void) +{ + FIXME("stub!\n"); + + if (dxgi_factory != NULL) + IUnknown_Release(dxgi_factory); + + return ADL_OK; +} + +int WINAPI ADL2_Adapter_NumberOfAdapters_Get(ADL_CONTEXT_HANDLE *ptr, int *count) +{ + FIXME("ptr %p, count %p stub!\n", ptr, count); + + *count = 0; + + return ADL_OK; +} + +int WINAPI ADL2_Graphics_VersionsX2_Get(ADL_CONTEXT_HANDLE *ptr, ADLVersionsInfoX2 *ver) +{ + FIXME("ptr %p, ver %p stub!\n", ptr, ver); + memcpy(ver, &version2, sizeof(version2)); + return ADL_OK; +} + +int WINAPI ADL_Graphics_Versions_Get(ADLVersionsInfo *ver) +{ + FIXME("ver %p stub!\n", ver); + memcpy(ver, &version, sizeof(version)); + return ADL_OK; +} + +int WINAPI ADL_Adapter_NumberOfAdapters_Get(int *count) +{ + IDXGIAdapter *adapter; + + FIXME("count %p stub!\n", count); + + *count = 0; + while (SUCCEEDED(IDXGIFactory_EnumAdapters(dxgi_factory, *count, &adapter))) + { + (*count)++; + IUnknown_Release(adapter); + } + + TRACE("*count = %d\n", *count); + return ADL_OK; +} + +static int get_adapter_desc(int adapter_index, DXGI_ADAPTER_DESC *desc) +{ + IDXGIAdapter *adapter; + HRESULT hr; + + if (FAILED(IDXGIFactory_EnumAdapters(dxgi_factory, adapter_index, &adapter))) + return ADL_ERR; + + hr = IDXGIAdapter_GetDesc(adapter, desc); + + IUnknown_Release(adapter); + + return SUCCEEDED(hr) ? ADL_OK : ADL_ERR; +} + +/* yep, seriously */ +static int convert_vendor_id(int id) +{ + char str[16]; + snprintf(str, ARRAY_SIZE(str), "%x", id); + return atoi(str); +} + +int WINAPI ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo *adapters, int input_size) +{ + int count, i; + DXGI_ADAPTER_DESC adapter_desc; + + FIXME("adapters %p, input_size %d, stub!\n", adapters, input_size); + + ADL_Adapter_NumberOfAdapters_Get(&count); + + if (!adapters) return ADL_ERR_INVALID_PARAM; + if (input_size != count * sizeof(ADLAdapterInfo)) return ADL_ERR_INVALID_PARAM; + + memset(adapters, 0, input_size); + + for (i = 0; i < count; i++) + { + adapters[i].iSize = sizeof(ADLAdapterInfo); + adapters[i].iAdapterIndex = i; + + if (get_adapter_desc(i, &adapter_desc) != ADL_OK) + return ADL_ERR; + + adapters[i].iVendorID = convert_vendor_id(adapter_desc.VendorId); + } + + return ADL_OK; +} + +int WINAPI ADL_Display_DisplayInfo_Get(int adapter_index, int *num_displays, ADLDisplayInfo **info, int force_detect) +{ + IDXGIAdapter *adapter; + IDXGIOutput *output; + int i; + + FIXME("adapter %d, num_displays %p, info %p stub!\n", adapter_index, num_displays, info); + + if (info == NULL || num_displays == NULL) return ADL_ERR_NULL_POINTER; + + if (FAILED(IDXGIFactory_EnumAdapters(dxgi_factory, adapter_index, &adapter))) + return ADL_ERR_INVALID_PARAM; + + *num_displays = 0; + + while (SUCCEEDED(IDXGIAdapter_EnumOutputs(adapter, *num_displays, &output))) + { + (*num_displays)++; + IUnknown_Release(output); + } + + IUnknown_Release(adapter); + + if (*num_displays == 0) + return ADL_OK; + + *info = adl_malloc(*num_displays * sizeof(**info)); + memset(*info, 0, *num_displays * sizeof(**info)); + + for (i = 0; i < *num_displays; i++) + { + (*info)[i].displayID.iDisplayLogicalIndex = i; + (*info)[i].iDisplayInfoValue = ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED | ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED; + (*info)[i].iDisplayInfoMask = (*info)[i].iDisplayInfoValue; + } + + return ADL_OK; +} + +int WINAPI ADL_Adapter_Crossfire_Caps(int adapter_index, int *preffered, int *num_comb, ADLCrossfireComb** comb) +{ + FIXME("adapter %d, preffered %p, num_comb %p, comb %p stub!\n", adapter_index, preffered, num_comb, comb); + return ADL_ERR; +} + +int WINAPI ADL_Adapter_Crossfire_Get(int adapter_index, ADLCrossfireComb *comb, ADLCrossfireInfo *info) +{ + FIXME("adapter %d, comb %p, info %p, stub!\n", adapter_index, comb, info); + return ADL_ERR; +} + +int WINAPI ADL_Adapter_ASICFamilyType_Get(int adapter_index, int *asic_type, int *valids) +{ + DXGI_ADAPTER_DESC adapter_desc; + + FIXME("adapter %d, asic_type %p, valids %p, stub!\n", adapter_index, asic_type, valids); + + if (asic_type == NULL || valids == NULL) + return ADL_ERR_NULL_POINTER; + + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) + return ADL_ERR_INVALID_ADL_IDX; + + if (adapter_desc.VendorId != VENDOR_AMD) + return ADL_ERR_NOT_SUPPORTED; + + *asic_type = ADL_ASIC_DISCRETE; + *valids = ADL_ASIC_MASK; + + return ADL_OK; +} + +static int get_max_clock(const char *clock, int default_value) +{ + char path[MAX_PATH], line[256]; + FILE *file; + int drm_card, value = 0; + + for (drm_card = 0; drm_card < MAX_GPUS; drm_card++) + { + sprintf(path, "/sys/class/drm/card%d/device/pp_dpm_%s", drm_card, clock); + file = fopen(path, "r"); + + if (file == NULL) + continue; + + while (fgets(line, sizeof(line), file) != NULL) + { + char *number; + + number = strchr(line, ' '); + if (number == NULL) + { + WARN("pp_dpm_%s file has unexpected format\n", clock); + break; + } + + number++; + value = max(strtol(number, NULL, 0), value); + } + } + + if (value != 0) + return value; + + return default_value; +} + +/* documented in the "Linux Specific APIs" section, present and used on Windows */ +/* the name and documentation suggests that this returns current freqs, but it's actually max */ +int WINAPI ADL_Adapter_ObservedClockInfo_Get(int adapter_index, int *core_clock, int *memory_clock) +{ + DXGI_ADAPTER_DESC adapter_desc; + + FIXME("adapter %d, core_clock %p, memory_clock %p, stub!\n", adapter_index, core_clock, memory_clock); + + if (core_clock == NULL || memory_clock == NULL) return ADL_ERR; + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) return ADL_ERR; + if (adapter_desc.VendorId != VENDOR_AMD) return ADL_ERR_INVALID_ADL_IDX; + + /* default values based on RX580 */ + *core_clock = get_max_clock("sclk", 1350); + *memory_clock = get_max_clock("mclk", 2000); + + TRACE("*core_clock: %i, *memory_clock %i\n", *core_clock, *memory_clock); + + return ADL_OK; +} + +/* documented in the "Linux Specific APIs" section, present and used on Windows */ +int WINAPI ADL_Adapter_MemoryInfo_Get(int adapter_index, ADLMemoryInfo *mem_info) +{ + DXGI_ADAPTER_DESC adapter_desc; + + FIXME("adapter %d, mem_info %p stub!\n", adapter_index, mem_info); + + if (mem_info == NULL) return ADL_ERR_NULL_POINTER; + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) return ADL_ERR_INVALID_ADL_IDX; + if (adapter_desc.VendorId != VENDOR_AMD) return ADL_ERR; + + mem_info->iMemorySize = adapter_desc.DedicatedVideoMemory; + mem_info->iMemoryBandwidth = 256000; /* not exposed on Linux, probably needs a lookup table */ + + TRACE("iMemoryBandwidth %s, iMemorySize %s\n", + wine_dbgstr_longlong(mem_info->iMemoryBandwidth), + wine_dbgstr_longlong(mem_info->iMemorySize)); + return ADL_OK; +} + +int WINAPI ADL_Graphics_Platform_Get(int *platform) +{ + DXGI_ADAPTER_DESC adapter_desc; + int count, i; + + FIXME("platform %p, stub!\n", platform); + + *platform = GRAPHICS_PLATFORM_UNKNOWN; + + ADL_Adapter_NumberOfAdapters_Get(&count); + + for (i = 0; i < count; i ++) + { + if (get_adapter_desc(i, &adapter_desc) != ADL_OK) + continue; + + if (adapter_desc.VendorId == VENDOR_AMD) + *platform = GRAPHICS_PLATFORM_DESKTOP; + } + + /* NOTE: The real value can be obtained by doing: + * 1. ioctl(DRM_AMDGPU_INFO) with AMDGPU_INFO_DEV_INFO - dev_info.ids_flags & AMDGPU_IDS_FLAGS_FUSION + * 2. VkPhysicalDeviceType() if we ever want to use Vulkan directly + */ + + return ADL_OK; +} + + +int WINAPI ADL_Display_DisplayMapConfig_Get(int adapter_index, int *display_map_count, ADLDisplayMap **display_maps, + int *display_target_count, ADLDisplayTarget **display_targets, int options) +{ + FIXME("adapter_index %d, display_map_count %p, display_maps %p, " + "display_target_count %p, display_targets %p, options %d stub.\n", + adapter_index, display_map_count, display_maps, display_target_count, + display_targets, options); + + return ADL_ERR; +} diff --git a/dlls/audioses/Makefile.in b/dlls/audioses/Makefile.in new file mode 100644 index 00000000000..370949ea4fe --- /dev/null +++ b/dlls/audioses/Makefile.in @@ -0,0 +1 @@ +MODULE = audioses.dll diff --git a/dlls/audioses/audioses.spec b/dlls/audioses/audioses.spec new file mode 100644 index 00000000000..a1884e53243 --- /dev/null +++ b/dlls/audioses/audioses.spec @@ -0,0 +1,11 @@ +# @ stub AUDIOSES_1 +# @ stub AUDIOSES_2 +# @ stub AUDIOSES_3 +# @ stub AUDIOSES_4 +# @ stub AUDIOSES_5 +# @ stub DllCanUnloadNow +# @ stub AUDIOSES_7 +# @ stub DllGetActivationFactory +# @ stub DllGetClassObject +# @ stub DllRegisterServer +# @ stub DllUnregisterServer diff --git a/dlls/avifil32/getframe.c b/dlls/avifil32/getframe.c index c6df7339256..0b58c3f064f 100644 --- a/dlls/avifil32/getframe.c +++ b/dlls/avifil32/getframe.c @@ -254,6 +254,8 @@ static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos) } /* for (lNext < lPos) */ } /* if (This->lCurrentFrame != lPos) */ + This->lCurrentFrame = lPos; + return (This->hic == NULL ? This->lpInFormat : This->lpOutFormat); } diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in index 542837b2a7a..782bd31b996 100644 --- a/dlls/bcrypt/Makefile.in +++ b/dlls/bcrypt/Makefile.in @@ -2,7 +2,7 @@ MODULE = bcrypt.dll IMPORTS = advapi32 IMPORTLIB = bcrypt UNIXLIB = bcrypt.so -UNIX_CFLAGS = $(GNUTLS_CFLAGS) +UNIX_CFLAGS = $(GNUTLS_CFLAGS) $(GMP_CFLAGS) SOURCES = \ bcrypt_main.c \ diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h index cfbc5d2ac83..e9b651db036 100644 --- a/dlls/bcrypt/bcrypt_internal.h +++ b/dlls/bcrypt/bcrypt_internal.h @@ -175,6 +175,8 @@ struct key_symmetric }; #define KEY_FLAG_LEGACY_DSA_V2 0x00000001 +#define KEY_FLAG_DH_PARAMS_SET 0x00000002 +#define KEY_FLAG_FINALIZED 0x00000004 struct key_asymmetric { @@ -242,6 +244,8 @@ struct key_asymmetric_decrypt_params UCHAR *output; ULONG output_len; ULONG *ret_len; + void *padding; + ULONG flags; }; struct key_asymmetric_encrypt_params @@ -252,6 +256,8 @@ struct key_asymmetric_encrypt_params UCHAR *output; ULONG output_len; ULONG *ret_len; + void *padding; + ULONG flags; }; struct key_asymmetric_duplicate_params @@ -285,6 +291,8 @@ struct key_asymmetric_verify_params #define KEY_EXPORT_FLAG_PUBLIC 0x00000001 #define KEY_EXPORT_FLAG_RSA_FULL 0x00000002 +#define KEY_EXPORT_FLAG_DH_PARAMETERS 0x00000004 + struct key_asymmetric_export_params { struct key *key; @@ -295,6 +303,7 @@ struct key_asymmetric_export_params }; #define KEY_IMPORT_FLAG_PUBLIC 0x00000001 +#define KEY_IMPORT_FLAG_DH_PARAMETERS 0x00000002 struct key_asymmetric_import_params { struct key *key; diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 26472cbfe2b..7217e96ab32 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -732,7 +732,7 @@ static NTSTATUS get_rsa_property( enum chain_mode mode, const WCHAR *prop, UCHAR { *ret_size = sizeof(ULONG); if (size < sizeof(ULONG)) return STATUS_BUFFER_TOO_SMALL; - if (buf) *(ULONG *)buf = BCRYPT_SUPPORTED_PAD_PKCS1_SIG; + if (buf) *(ULONG *)buf = BCRYPT_SUPPORTED_PAD_PKCS1_SIG | BCRYPT_SUPPORTED_PAD_OAEP; return STATUS_SUCCESS; } @@ -853,6 +853,21 @@ static NTSTATUS set_alg_property( struct algorithm *alg, const WCHAR *prop, UCHA static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags ) { + if (key->alg_id == ALG_ID_DH) + { + if (!lstrcmpW( prop, BCRYPT_DH_PARAMETERS )) + { + struct key_asymmetric_import_params params; + + params.key = key; + params.flags = KEY_IMPORT_FLAG_DH_PARAMETERS; + params.buf = value; + params.len = size; + return UNIX_CALL( key_asymmetric_import, ¶ms ); + } + return STATUS_NOT_IMPLEMENTED; + } + if (!wcscmp( prop, BCRYPT_CHAINING_MODE )) { if (!wcscmp( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB )) @@ -902,6 +917,20 @@ static NTSTATUS get_hash_property( const struct hash *hash, const WCHAR *prop, U return status; } +static NTSTATUS get_dh_property( const struct key *key, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) +{ + struct key_asymmetric_export_params params; + + if (wcscmp( prop, BCRYPT_DH_PARAMETERS )) return STATUS_NOT_SUPPORTED; + + params.key = (struct key *)key; + params.flags = KEY_EXPORT_FLAG_DH_PARAMETERS; + params.buf = buf; + params.len = size; + params.ret_len = ret_size; + return UNIX_CALL( key_asymmetric_export, ¶ms ); +} + static NTSTATUS get_key_property( const struct key *key, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) { if (!wcscmp( prop, BCRYPT_KEY_STRENGTH )) @@ -925,6 +954,9 @@ static NTSTATUS get_key_property( const struct key *key, const WCHAR *prop, UCHA if (!wcscmp( prop, BCRYPT_AUTH_TAG_LENGTH )) return STATUS_NOT_SUPPORTED; return get_aes_property( key->u.s.mode, prop, buf, size, ret_size ); + case ALG_ID_DH: + return get_dh_property( key, prop, buf, size, ret_size ); + default: FIXME( "unsupported algorithm %u\n", key->alg_id ); return STATUS_NOT_IMPLEMENTED; @@ -1176,6 +1208,8 @@ static NTSTATUS key_asymmetric_create( enum alg_id alg_id, ULONG bitlen, struct return STATUS_NOT_IMPLEMENTED; } + if (alg_id == ALG_ID_DH && bitlen < 512) return STATUS_INVALID_PARAMETER; + if (!(key = calloc( 1, sizeof(*key) ))) return STATUS_NO_MEMORY; key->hdr.magic = MAGIC_KEY; key->alg_id = alg_id; @@ -2233,11 +2267,6 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp } else { - if (flags & BCRYPT_PAD_NONE || flags & BCRYPT_PAD_OAEP) - { - FIXME( "flags %#lx not implemented\n", flags ); - return STATUS_NOT_IMPLEMENTED; - } if (!is_asymmetric_encryption_key( key )) return STATUS_NOT_SUPPORTED; asymmetric_params.input = input; @@ -2246,6 +2275,8 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp asymmetric_params.output = output; asymmetric_params.output_len = output_len; asymmetric_params.ret_len = ret_len; + asymmetric_params.padding = padding; + asymmetric_params.flags = flags; ret = UNIX_CALL(key_asymmetric_encrypt, &asymmetric_params); } @@ -2278,11 +2309,6 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp } else { - if (flags & BCRYPT_PAD_NONE || flags & BCRYPT_PAD_OAEP) - { - FIXME( "flags %#lx not implemented\n", flags ); - return STATUS_NOT_IMPLEMENTED; - } if (!is_asymmetric_encryption_key( key )) return STATUS_NOT_SUPPORTED; params.key = key; @@ -2291,6 +2317,8 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp params.output = output; params.output_len = output_len; params.ret_len = ret_len; + params.padding = padding; + params.flags = flags; ret = UNIX_CALL(key_asymmetric_decrypt, ¶ms); } @@ -2488,6 +2516,9 @@ NTSTATUS WINAPI BCryptSecretAgreement( BCRYPT_KEY_HANDLE privkey_handle, BCRYPT_ if (!privkey || !pubkey) return STATUS_INVALID_HANDLE; if (!is_agreement_key( privkey ) || !is_agreement_key( pubkey )) return STATUS_NOT_SUPPORTED; if (!ret_handle) return STATUS_INVALID_PARAMETER; + if (privkey->alg_id != pubkey->alg_id) return STATUS_INVALID_PARAMETER; + if (privkey->alg_id == ALG_ID_DH && !(privkey->u.a.flags & pubkey->u.a.flags & KEY_FLAG_FINALIZED)) return STATUS_INVALID_PARAMETER; + if (privkey->u.a.bitlen != pubkey->u.a.bitlen) return STATUS_INVALID_PARAMETER; if (!(secret = calloc( 1, sizeof(*secret) ))) return STATUS_NO_MEMORY; secret->hdr.magic = MAGIC_SECRET; diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index 68f84a553d2..115219a64f6 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -48,6 +48,19 @@ #include "wine/debug.h" +#include + +#ifdef HAVE_GMP_H +#include +#endif + +#include +#include + +#ifdef HAVE_GCRYPT_H +#include +#endif + WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -87,6 +100,11 @@ union key_data gnutls_privkey_t privkey; gnutls_pubkey_t pubkey; } a; + struct /* DH */ + { + UCHAR *privkey; + UCHAR *pubkey; + } d; }; C_ASSERT( sizeof(union key_data) <= sizeof(((struct key *)0)->private) ); @@ -95,6 +113,33 @@ static union key_data *key_data( struct key *key ) return (union key_data *)key->private; } +static unsigned int dh_pubkey_len( struct key *key ) +{ + return sizeof(BCRYPT_DH_KEY_BLOB) + key->u.a.bitlen / 8 * 3; +} + +static void dh_key_free( struct key *key ) +{ + free( key_data(key)->d.privkey ); + key_data(key)->d.privkey = NULL; + free( key_data(key)->d.pubkey ); + key_data(key)->d.pubkey = NULL; +} + +static void dh_key_alloc_pub( struct key *key ) +{ + if (key_data(key)->d.pubkey) return; + key_data(key)->d.pubkey = calloc( 1, dh_pubkey_len( key )); +} + +static void dh_key_alloc_priv( struct key *key ) +{ + unsigned int bitlen = key->u.a.bitlen; + + if (key_data(key)->d.privkey) return; + key_data(key)->d.privkey = calloc( 1, bitlen / 8 ); +} + /* Not present in gnutls version < 3.0 */ static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t, void *, size_t); static int (*pgnutls_cipher_add_auth)(gnutls_cipher_hd_t, const void *, size_t); @@ -155,6 +200,19 @@ static int (*pgnutls_privkey_import_dh_raw)(gnutls_privkey_t, const gnutls_dh_pa static int (*pgnutls_pubkey_import_dh_raw)(gnutls_pubkey_t, const gnutls_dh_params_t, const gnutls_datum_t *); static void *libgnutls_handle; + +static int (*pgnutls_dh_params_generate2)(gnutls_dh_params_t dparams, unsigned int bits); +static int (*pgnutls_dh_params_import_raw2)(gnutls_dh_params_t dh_params, const gnutls_datum_t * prime, + const gnutls_datum_t * generator, unsigned key_bits); +static int (*pgnutls_dh_params_export_raw)(gnutls_dh_params_t params, gnutls_datum_t * prime, + gnutls_datum_t * generator, unsigned int *bits); + +static int (*pgnutls_ecdh_compute_key)(gnutls_ecc_curve_t curve, + const gnutls_datum_t *x, const gnutls_datum_t *y, + const gnutls_datum_t *k, + const gnutls_datum_t *peer_x, const gnutls_datum_t *peer_y, + gnutls_datum_t *Z); + #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(gnutls_cipher_decrypt2); MAKE_FUNCPTR(gnutls_cipher_deinit); @@ -178,6 +236,43 @@ MAKE_FUNCPTR(gnutls_pubkey_deinit); MAKE_FUNCPTR(gnutls_pubkey_encrypt_data); MAKE_FUNCPTR(gnutls_pubkey_import_privkey); MAKE_FUNCPTR(gnutls_pubkey_init); + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +static BOOL dh_supported; +static void *libgmp_handle; + +MAKE_FUNCPTR(mpz_init); +MAKE_FUNCPTR(mpz_clear); +MAKE_FUNCPTR(mpz_cmp); +MAKE_FUNCPTR(_mpz_cmp_ui); +MAKE_FUNCPTR(mpz_sizeinbase); +MAKE_FUNCPTR(mpz_import); +MAKE_FUNCPTR(mpz_export); +MAKE_FUNCPTR(mpz_mod); +MAKE_FUNCPTR(mpz_powm); +MAKE_FUNCPTR(mpz_sub_ui); +#endif + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +static BOOL gcrypt_available; +static void *libgcrypt_handle; + +MAKE_FUNCPTR(gcry_control); +MAKE_FUNCPTR(gcry_check_version); +MAKE_FUNCPTR(gcry_sexp_build); +MAKE_FUNCPTR(gcry_pk_encrypt); +MAKE_FUNCPTR(gcry_pk_decrypt); +MAKE_FUNCPTR(gcry_mpi_new); +MAKE_FUNCPTR(gcry_mpi_print); +MAKE_FUNCPTR(gcry_sexp_release); +MAKE_FUNCPTR(gcry_mpi_release); +MAKE_FUNCPTR(gcry_strsource); +MAKE_FUNCPTR(gcry_strerror); +MAKE_FUNCPTR(gcry_sexp_find_token); +MAKE_FUNCPTR(gcry_sexp_nth_mpi); +MAKE_FUNCPTR(gcry_sexp_nth_data); +#endif + #undef MAKE_FUNCPTR static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void *tag, size_t tag_size) @@ -401,6 +496,76 @@ static NTSTATUS gnutls_process_attach( void *args ) LOAD_FUNCPTR(gnutls_pubkey_init); #undef LOAD_FUNCPTR +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +#define LOAD_FUNCPTR_STR(f) #f +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym( libgmp_handle, LOAD_FUNCPTR_STR(f) ))) \ + { \ + ERR( "failed to load %s\n", LOAD_FUNCPTR_STR(f) ); \ + goto fail; \ + } + + if ((libgmp_handle = dlopen( SONAME_LIBGMP, RTLD_NOW ))) + { + LOAD_FUNCPTR(mpz_init); + LOAD_FUNCPTR(mpz_clear); + LOAD_FUNCPTR(mpz_cmp); + LOAD_FUNCPTR(_mpz_cmp_ui); + LOAD_FUNCPTR(mpz_sizeinbase); + LOAD_FUNCPTR(mpz_import); + LOAD_FUNCPTR(mpz_export); + LOAD_FUNCPTR(mpz_mod); + LOAD_FUNCPTR(mpz_powm); + LOAD_FUNCPTR(mpz_sub_ui); + } + else + { + ERR_(winediag)( "failed to load libgmp, no support for DH\n" ); + goto fail; + } +#undef LOAD_FUNCPTR +#undef LOAD_FUNCPTR_STR +#endif + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym( libgcrypt_handle, #f ))) \ + { \ + WARN( "failed to load %s\n", #f ); \ + gcrypt_available = FALSE; \ + } + + if ((libgcrypt_handle = dlopen( SONAME_LIBGCRYPT, RTLD_NOW ))) + { + gcrypt_available = TRUE; + + LOAD_FUNCPTR(gcry_control); + LOAD_FUNCPTR(gcry_check_version); + LOAD_FUNCPTR(gcry_sexp_build); + LOAD_FUNCPTR(gcry_pk_encrypt); + LOAD_FUNCPTR(gcry_pk_decrypt); + LOAD_FUNCPTR(gcry_mpi_new); + LOAD_FUNCPTR(gcry_mpi_print); + LOAD_FUNCPTR(gcry_sexp_release); + LOAD_FUNCPTR(gcry_mpi_release); + LOAD_FUNCPTR(gcry_strsource); + LOAD_FUNCPTR(gcry_strerror); + LOAD_FUNCPTR(gcry_sexp_find_token); + LOAD_FUNCPTR(gcry_sexp_nth_mpi); + LOAD_FUNCPTR(gcry_sexp_nth_data); + + if (0) + { + pgcry_control(GCRYCTL_SET_VERBOSITY, 9); + pgcry_control(GCRYCTL_SET_DEBUG_FLAGS, ~0u); + } + } + else + WARN("failed to load gcrypt, no support for ECC secret agreement\n"); + +#undef LOAD_FUNCPTR +#endif + #define LOAD_FUNCPTR_OPT(f) \ if (!(p##f = dlsym( libgnutls_handle, #f ))) \ { \ @@ -445,6 +610,39 @@ static NTSTATUS gnutls_process_attach( void *args ) pgnutls_perror( ret ); goto fail; } + if (!(pgnutls_dh_params_init = dlsym( libgnutls_handle, "gnutls_dh_params_init" ))) + { + WARN("gnutls_dh_params_init not found\n"); + } + if (!(pgnutls_dh_params_deinit = dlsym( libgnutls_handle, "gnutls_dh_params_deinit" ))) + { + WARN("gnutls_dh_params_deinit not found\n"); + } + if (!(pgnutls_dh_params_generate2 = dlsym( libgnutls_handle, "gnutls_dh_params_generate2" ))) + { + WARN("gnutls_dh_params_generate2 not found\n"); + } + if (!(pgnutls_dh_params_import_raw2 = dlsym( libgnutls_handle, "gnutls_dh_params_import_raw2" ))) + { + WARN("gnutls_dh_params_import_raw2 not found\n"); + } + if (!(pgnutls_dh_params_export_raw = dlsym( libgnutls_handle, "gnutls_dh_params_export_raw" ))) + { + WARN("gnutls_dh_params_export_raw not found\n"); + } + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + dh_supported = pgnutls_dh_params_init && pgnutls_dh_params_generate2 && pgnutls_dh_params_import_raw2 + && libgmp_handle; +#else + ERR_(winediag)("Compiled without DH support.\n"); +#endif + + if (!(pgnutls_ecdh_compute_key = dlsym( libgnutls_handle, "_gnutls_ecdh_compute_key" )) + && !(pgnutls_ecdh_compute_key = dlsym( libgnutls_handle, "gnutls_ecdh_compute_key" ))) + { + WARN("gnutls_ecdh_compute_key not found\n"); + } if (TRACE_ON( bcrypt )) { @@ -457,6 +655,14 @@ static NTSTATUS gnutls_process_attach( void *args ) fail: dlclose( libgnutls_handle ); libgnutls_handle = NULL; + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + if (libgmp_handle) + { + dlclose( libgmp_handle ); + libgmp_handle = NULL; + } +#endif return STATUS_DLL_NOT_FOUND; } @@ -469,6 +675,16 @@ static NTSTATUS gnutls_process_detach( void *args ) libgnutls_handle = NULL; } return STATUS_SUCCESS; + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + dlclose( libgmp_handle ); + libgmp_handle = NULL; +#endif + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) + dlclose( libgcrypt_handle ); + libgcrypt_handle = NULL; +#endif } struct buffer @@ -1004,6 +1220,183 @@ static NTSTATUS key_export_dsa_capi_public( struct key *key, UCHAR *buf, ULONG l return status; } +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +static NTSTATUS CDECL gen_random(void *buffer, unsigned int length) +{ + unsigned int read_size; + int dev_random; + + dev_random = open("/dev/urandom", O_RDONLY); + if (dev_random == -1) + { + FIXME("couldn't open /dev/urandom.\n"); + return STATUS_INTERNAL_ERROR; + } + + read_size = read(dev_random, buffer, length); + close(dev_random); + if (read_size != length) + { + FIXME("Could not read from /dev/urandom."); + return STATUS_INTERNAL_ERROR; + } + return STATUS_SUCCESS; +} + +static void import_mpz(mpz_t value, const void *input, unsigned int length) +{ + pmpz_import(value, length, 1, 1, 0, 0, input); +} + +static void export_mpz(void *output, unsigned int length, const mpz_t value) +{ + size_t export_length; + unsigned int offset; + + export_length = (pmpz_sizeinbase(value, 2) + 7) / 8; + assert(export_length <= length); + offset = length - export_length; + memset(output, 0, offset); + pmpz_export((BYTE *)output + offset, &export_length, 1, 1, 0, 0, value); + if (!export_length) + { + ERR("Zero export length, value bits %u.\n", (unsigned)pmpz_sizeinbase(value, 2)); + memset((BYTE *)output + offset, 0, length - offset); + } + else + { + assert(export_length + offset == length); + } +} + +static NTSTATUS CDECL key_dh_generate( struct key *key ) +{ + NTSTATUS status = STATUS_SUCCESS; + mpz_t p, psub1, g, privkey, pubkey; + ULONG key_length; + unsigned int i; + int ret; + + if (!dh_supported) + { + ERR("DH is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (key->u.a.flags & KEY_FLAG_FINALIZED) + { + WARN( "Key is already finalized.\n" ); + return STATUS_INVALID_HANDLE; + } + + key_length = key->u.a.bitlen / 8; + + if (!(key->u.a.flags & KEY_FLAG_DH_PARAMS_SET)) + { + gnutls_datum_t prime, generator; + gnutls_dh_params_t dh_params; + + if ((ret = pgnutls_dh_params_init( &dh_params ))) + { + pgnutls_perror( ret ); + return STATUS_INTERNAL_ERROR; + } + dh_key_alloc_pub( key ); + + if ((ret = pgnutls_dh_params_generate2( dh_params, key->u.a.bitlen ))) + { + pgnutls_perror( ret ); + pgnutls_dh_params_deinit( dh_params ); + return STATUS_INTERNAL_ERROR; + } + if ((ret = pgnutls_dh_params_export_raw( dh_params, &prime, &generator, NULL ))) + { + pgnutls_perror( ret ); + pgnutls_dh_params_deinit( dh_params ); + return STATUS_INTERNAL_ERROR; + } + pgnutls_dh_params_deinit( dh_params ); + + + export_gnutls_datum( (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1), key_length, &prime, 1 ); + export_gnutls_datum( (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + key_length, + key_length, &generator, 1 ); + free( prime.data ); + free( generator.data ); + + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + } + dh_key_alloc_priv( key ); + + pmpz_init(p); + pmpz_init(psub1); + pmpz_init(g); + pmpz_init(pubkey); + pmpz_init(privkey); + + import_mpz(p, (BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, key_length); + if (!mpz_sgn(p)) + { + ERR("Got zero modulus.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + pmpz_sub_ui(psub1, p, 1); + + import_mpz(g, (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + key_length, key_length); + if (!mpz_sgn(g)) + { + ERR("Got zero generator.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + for (i = 0; i < 3; ++i) + { + if ((status = gen_random(key_data(key)->d.privkey, key_length))) + { + goto done; + } + import_mpz(privkey, key_data(key)->d.privkey, key_length); + + pmpz_mod(privkey, privkey, p); + pmpz_powm(pubkey, g, privkey, p); + if (p_mpz_cmp_ui(pubkey, 1)) + break; + } + if (i == 3) + { + ERR("Could not generate key after 3 iterations.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + if (pmpz_cmp(pubkey, psub1) >= 0) + { + ERR("pubkey > p - 1.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + export_mpz(key_data(key)->d.privkey, key_length, privkey); + export_mpz((UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + 2 * key_length, key_length, pubkey); + key->u.a.flags |= KEY_FLAG_FINALIZED; + +done: + pmpz_clear(psub1); + pmpz_clear(p); + pmpz_clear(g); + pmpz_clear(pubkey); + pmpz_clear(privkey); + return status; +} +#else +static NTSTATUS CDECL key_dh_generate( struct key *key ) +{ + ERR("Compiled without DH support.\n"); + return STATUS_NOT_IMPLEMENTED; +} +#endif + static NTSTATUS key_asymmetric_generate( void *args ) { struct key *key = args; @@ -1014,7 +1407,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) int ret; if (!libgnutls_handle) return STATUS_INTERNAL_ERROR; - if (key_data(key)->a.privkey) return STATUS_INVALID_HANDLE; + if (key->alg_id != ALG_ID_DH && key_data(key)->a.privkey) return STATUS_INVALID_HANDLE; switch (key->alg_id) { @@ -1025,9 +1418,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) break; case ALG_ID_DH: - pk_alg = GNUTLS_PK_DH; - bitlen = key->u.a.bitlen; - break; + return key_dh_generate( key ); case ALG_ID_DSA: pk_alg = GNUTLS_PK_DSA; @@ -1058,6 +1449,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) } if ((ret = pgnutls_pubkey_init( &pubkey ))) { + ERR("gnutls error bitlen %u.\n", bitlen); pgnutls_perror( ret ); pgnutls_privkey_deinit( privkey ); return STATUS_INTERNAL_ERROR; @@ -1582,109 +1974,6 @@ static NTSTATUS key_import_dsa_capi_public( struct key *key, UCHAR *buf, ULONG l return STATUS_SUCCESS; } -static NTSTATUS key_export_dh_public( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - ULONG size = key->u.a.bitlen / 8; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y, x = {0}; - UCHAR *dst; - int ret = GNUTLS_E_INVALID_REQUEST; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if (key_data(key)->a.pubkey) - ret = pgnutls_pubkey_export_dh_raw( key_data(key)->a.pubkey, params, &y, 0 ); - else if (key_data(key)->a.privkey) - ret = pgnutls_privkey_export_dh_raw( key_data(key)->a.privkey, params, &y, &x, 0 ); - - if (ret) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_export_raw( params, &p, &g, NULL )) < 0) - { - pgnutls_perror( ret ); - free( y.data ); free( x.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - *ret_len = sizeof(*dh_blob) + EXPORT_SIZE(p, size, 1) + EXPORT_SIZE(g, size, 1) + EXPORT_SIZE(y, size, 1); - if (len >= *ret_len && buf) - { - dst = (UCHAR *)(dh_blob + 1); - dst += export_gnutls_datum( dst, size, &p, 1 ); - dst += export_gnutls_datum( dst, size, &g, 1 ); - dst += export_gnutls_datum( dst, size, &y, 1 ); - - dh_blob->dwMagic = BCRYPT_DH_PUBLIC_MAGIC; - dh_blob->cbKey = size; - } - - free( p.data ); free( g.data ); free( y.data ); free( x.data ); - return STATUS_SUCCESS; -} - -static NTSTATUS key_export_dh( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - gnutls_datum_t p, g, y, x; - gnutls_dh_params_t params; - ULONG size = key->u.a.bitlen / 8; - UCHAR *dst; - int ret; - - if (!key_data(key)->a.privkey) return STATUS_INVALID_PARAMETER; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - ret = pgnutls_privkey_export_dh_raw( key_data(key)->a.privkey, params, &y, &x, 0 ); - if (ret) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_export_raw( params, &p, &g, NULL )) < 0) - { - pgnutls_perror( ret ); - free( y.data ); free( x.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - *ret_len = sizeof(*dh_blob) + EXPORT_SIZE(p, size, 1) + EXPORT_SIZE(g, size, 1) + - EXPORT_SIZE(y, size, 1) + EXPORT_SIZE(x, size, 1); - if (len >= *ret_len && buf) - { - dst = (UCHAR *)(dh_blob + 1); - dst += export_gnutls_datum( dst, size, &p, 1 ); - dst += export_gnutls_datum( dst, size, &g, 1 ); - dst += export_gnutls_datum( dst, size, &y, 1 ); - dst += export_gnutls_datum( dst, size, &x, 1 ); - - dh_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; - dh_blob->cbKey = size; - } - - free( p.data ); free( g.data ); free( y.data ); free( x.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_SUCCESS; -} - static NTSTATUS key_asymmetric_export( void *args ) { const struct key_asymmetric_export_params *params = args; @@ -1719,9 +2008,50 @@ static NTSTATUS key_asymmetric_export( void *args ) return STATUS_NOT_IMPLEMENTED; case ALG_ID_DH: - if (flags & KEY_EXPORT_FLAG_PUBLIC) - return key_export_dh_public( key, params->buf, params->len, params->ret_len ); - return key_export_dh( key, params->buf, params->len, params->ret_len ); + if (!(key->u.a.flags & KEY_FLAG_FINALIZED)) + { + WARN( "Key is not finalized.\n" ); + return STATUS_INVALID_HANDLE; + } + + if (flags & KEY_EXPORT_FLAG_DH_PARAMETERS) + { + BCRYPT_DH_PARAMETER_HEADER *h; + unsigned int data_size; + + data_size = sizeof(BCRYPT_DH_PARAMETER_HEADER) + key->u.a.bitlen / 8 * 2; + if (params->ret_len) *params->ret_len = data_size; + if (!params->buf) return STATUS_SUCCESS; + if (params->len < data_size) return STATUS_BUFFER_TOO_SMALL; + + h = (BCRYPT_DH_PARAMETER_HEADER *)params->buf; + h->cbLength = data_size; + h->dwMagic = BCRYPT_DH_PARAMETERS_MAGIC; + h->cbKeyLength = key->u.a.bitlen / 8; + memcpy( h + 1, (BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, h->cbKeyLength * 2); + } + else + { + BCRYPT_DH_KEY_BLOB *h = (BCRYPT_DH_KEY_BLOB *)params->buf; + BOOL dh_private = !(flags & KEY_EXPORT_FLAG_PUBLIC); + + if (!key_data(key)->d.pubkey || (dh_private && !key_data(key)->d.privkey)) + return STATUS_INVALID_HANDLE; + + *params->ret_len = dh_pubkey_len( key ); + if (dh_private) + *params->ret_len += key->u.a.bitlen / 8; + + if (params->len < *params->ret_len) return STATUS_SUCCESS; + + memcpy(params->buf, key_data(key)->d.pubkey, dh_pubkey_len( key )); + if (dh_private) + memcpy(params->buf + dh_pubkey_len( key ), key_data(key)->d.privkey, key->u.a.bitlen / 8); + + h->dwMagic = dh_private ? BCRYPT_DH_PRIVATE_MAGIC : BCRYPT_DH_PUBLIC_MAGIC; + h->cbKey = key->u.a.bitlen / 8; + } + return STATUS_SUCCESS; default: FIXME( "algorithm %u not yet supported\n", key->alg_id ); @@ -1729,111 +2059,7 @@ static NTSTATUS key_asymmetric_export( void *args ) } } -static NTSTATUS key_import_dh_public( struct key *key, UCHAR *buf, ULONG len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y; - gnutls_pubkey_t handle; - int ret; - - if ((ret = pgnutls_pubkey_init( &handle ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - p.data = buf + sizeof(*dh_blob); - p.size = dh_blob->cbKey; - g.data = buf + sizeof(*dh_blob) + dh_blob->cbKey; - g.size = dh_blob->cbKey; - y.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 2; - y.size = dh_blob->cbKey; - - if ((ret = pgnutls_dh_params_import_raw( params, &p, &g )) < 0) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - ret = pgnutls_pubkey_import_dh_raw( handle, params, &y ); - pgnutls_dh_params_deinit( params ); - if (ret < 0) - { - pgnutls_perror( ret ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); - key_data(key)->a.pubkey = handle; - return STATUS_SUCCESS; -} - -static NTSTATUS key_import_dh( struct key *key, UCHAR *buf, ULONG len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y, x; - gnutls_privkey_t handle; - int ret; - - if ((ret = pgnutls_privkey_init( &handle ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - p.data = buf + sizeof(*dh_blob); - p.size = dh_blob->cbKey; - g.data = buf + sizeof(*dh_blob) + dh_blob->cbKey; - g.size = dh_blob->cbKey; - y.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 2; - y.size = dh_blob->cbKey; - x.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 3; - x.size = dh_blob->cbKey; - - if ((ret = pgnutls_dh_params_import_raw( params, &p, &g )) < 0) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - ret = pgnutls_privkey_import_dh_raw( handle, params, &y, &x ); - pgnutls_dh_params_deinit( params ); - if (ret < 0) - { - pgnutls_perror( ret ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); - key_data(key)->a.privkey = handle; - return STATUS_SUCCESS; -} - -static NTSTATUS key_asymmetric_import( void *args ) +static NTSTATUS key_asymmetric_import( void *args ) { const struct key_asymmetric_import_params *params = args; struct key *key = params->key; @@ -1875,9 +2101,56 @@ static NTSTATUS key_asymmetric_import( void *args ) return STATUS_NOT_IMPLEMENTED; case ALG_ID_DH: - if (flags & KEY_IMPORT_FLAG_PUBLIC) - return key_import_dh_public( key, params->buf, params->len ); - return key_import_dh( key, params->buf, params->len ); + if (key->u.a.flags & KEY_FLAG_FINALIZED) + { + ERR( "Key is alrady finalized.\n" ); + return STATUS_INVALID_HANDLE; + } + if (flags & KEY_IMPORT_FLAG_DH_PARAMETERS) + { + const BCRYPT_DH_PARAMETER_HEADER *h = (const BCRYPT_DH_PARAMETER_HEADER *)params->buf; + ULONG param_size = sizeof(BCRYPT_DH_PARAMETER_HEADER) + key->u.a.bitlen / 8 * 2; + + if (params->len < param_size) return STATUS_BUFFER_TOO_SMALL; + if (!h || h->cbLength != param_size || h->dwMagic != BCRYPT_DH_PARAMETERS_MAGIC + || h->cbKeyLength != key->u.a.bitlen / 8) + return STATUS_INVALID_PARAMETER; + + dh_key_alloc_pub( key ); + memcpy((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, h + 1, h->cbKeyLength * 2); + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + } + else + { + BCRYPT_DH_KEY_BLOB *h = (BCRYPT_DH_KEY_BLOB *)params->buf; + BOOL dh_private = !(flags & KEY_IMPORT_FLAG_PUBLIC); + ULONG size; + + if (h->dwMagic != (dh_private ? BCRYPT_DH_PRIVATE_MAGIC : BCRYPT_DH_PUBLIC_MAGIC)) + { + WARN("unexpected dwMagic %#x.\n", (int)h->dwMagic); + return STATUS_INVALID_PARAMETER; + } + + size = sizeof(*h) + h->cbKey * 3; + if (dh_private) + size += h->cbKey; + if (params->len != size) return STATUS_INVALID_PARAMETER; + if (h->cbKey * 8 < 512) return STATUS_INVALID_PARAMETER; + + dh_key_alloc_pub( key ); + + memcpy( key_data(key)->d.pubkey, params->buf, dh_pubkey_len( key )); + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + + if (dh_private) + { + dh_key_alloc_priv( key ); + memcpy( key_data(key)->d.privkey, params->buf + sizeof(*h) + h->cbKey * 3, h->cbKey); + } + key->u.a.flags |= KEY_FLAG_FINALIZED; + } + return STATUS_SUCCESS; default: FIXME( "algorithm %u not yet supported\n", key->alg_id ); @@ -2298,8 +2571,15 @@ static NTSTATUS key_asymmetric_destroy( void *args ) { struct key *key = args; - if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); - if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); + if (key->alg_id == ALG_ID_DH) + { + dh_key_free( key ); + } + else + { + if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); + if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); + } return STATUS_SUCCESS; } @@ -2351,22 +2631,7 @@ static NTSTATUS dup_privkey( struct key *key_orig, struct key *key_copy ) free( x.data ); free( y.data ); free( k.data ); break; } - case ALG_ID_DH: - { - gnutls_dh_params_t params; - gnutls_datum_t y, x; - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) break; - if ((ret = pgnutls_privkey_export_dh_raw( key_data(key_orig)->a.privkey, params, &y, &x, 0 )) < 0) - { - pgnutls_dh_params_deinit( params ); - break; - } - ret = pgnutls_privkey_import_dh_raw( privkey, params, &y, &x ); - pgnutls_dh_params_deinit( params ); - free( x.data ); free( y.data ); - break; - } default: ERR( "unhandled algorithm %u\n", key_orig->alg_id ); pgnutls_privkey_deinit( privkey ); @@ -2430,22 +2695,6 @@ static NTSTATUS dup_pubkey( struct key *key_orig, struct key *key_copy ) free( x.data ); free( y.data ); break; } - case ALG_ID_DH: - { - gnutls_dh_params_t params; - gnutls_datum_t y; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) break; - if ((ret = pgnutls_pubkey_export_dh_raw( key_data(key_orig)->a.pubkey, params, &y, 0 )) < 0) - { - pgnutls_dh_params_deinit( params ); - break; - } - ret = pgnutls_pubkey_import_dh_raw( pubkey, params, &y ); - pgnutls_dh_params_deinit( params ); - free( y.data ); - break; - } default: ERR( "unhandled algorithm %u\n", key_orig->alg_id ); pgnutls_pubkey_deinit( pubkey ); @@ -2468,6 +2717,23 @@ static NTSTATUS key_asymmetric_duplicate( void *args ) const struct key_asymmetric_duplicate_params *params = args; NTSTATUS status; + if (params->key_orig->alg_id == ALG_ID_DH) + { + union key_data *s = key_data( params->key_orig ); + union key_data *d = key_data( params->key_copy ); + if (s->d.privkey) + { + dh_key_alloc_priv( params->key_copy ); + memcpy( d->d.privkey, s->d.privkey, params->key_orig->u.a.bitlen / 8 ); + } + if (s->d.pubkey) + { + dh_key_alloc_pub( params->key_copy ); + memcpy( d->d.pubkey, s->d.pubkey, dh_pubkey_len( params->key_orig )); + } + return STATUS_SUCCESS; + } + if (key_data(params->key_orig)->a.privkey && (status = dup_privkey( params->key_orig, params->key_copy ))) return status; @@ -2477,6 +2743,8 @@ static NTSTATUS key_asymmetric_duplicate( void *args ) return STATUS_SUCCESS; } +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ); + static NTSTATUS key_asymmetric_decrypt( void *args ) { const struct key_asymmetric_decrypt_params *params = args; @@ -2484,6 +2752,9 @@ static NTSTATUS key_asymmetric_decrypt( void *args ) NTSTATUS status = STATUS_SUCCESS; int ret; + if (params->flags == BCRYPT_PAD_NONE || params->flags == BCRYPT_PAD_OAEP) + return key_asymmetric_decrypt_gcrypt( args ); + e.data = params->input; e.size = params->input_len; if ((ret = pgnutls_privkey_decrypt_data( key_data(params->key)->a.privkey, 0, &e, &d ))) @@ -2500,6 +2771,300 @@ static NTSTATUS key_asymmetric_decrypt( void *args ) return status; } +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +const char * gcrypt_hash_algorithm_name(LPCWSTR alg_id) +{ + if (!wcscmp( alg_id, BCRYPT_SHA1_ALGORITHM )) return "sha1"; + if (!wcscmp( alg_id, BCRYPT_SHA256_ALGORITHM )) return "sha256"; + if (!wcscmp( alg_id, BCRYPT_SHA384_ALGORITHM )) return "sha384"; + if (!wcscmp( alg_id, BCRYPT_SHA512_ALGORITHM )) return "sha512"; + if (!wcscmp( alg_id, BCRYPT_MD2_ALGORITHM )) return "md2"; + if (!wcscmp( alg_id, BCRYPT_MD5_ALGORITHM )) return "md5"; + return NULL; +} + +static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) +{ + const struct key_asymmetric_encrypt_params *params = args; + struct key *key = params->key; + UCHAR *input = params->input; + ULONG input_len = params->input_len; + UCHAR *output = params->output; + ULONG *ret_len = params->ret_len; + void *padding = params->padding; + ULONG flags = params->flags; + BCRYPT_OAEP_PADDING_INFO *oaep_info = padding; + NTSTATUS status; + gcry_sexp_t sexp_pubkey = NULL; + gcry_sexp_t sexp_result = NULL; + gcry_sexp_t sexp_input = NULL; + BCRYPT_RSAKEY_BLOB *rsa_blob; + gcry_sexp_t mpi_a = NULL; + gnutls_datum_t result; + size_t result_len; + gcry_error_t err; + ULONG len; + + if (!gcrypt_available) + { + ERR("Asymmetric encryption not available.\n"); + return STATUS_INTERNAL_ERROR; + } + + if (key->alg_id != ALG_ID_RSA) + { + FIXME("Unsupported algorithm id: %u\n", key->alg_id); + return STATUS_INTERNAL_ERROR; + } + + if (flags == BCRYPT_PAD_NONE && input_len != key->u.a.bitlen / 8) + { + WARN( "Invalid input_len %u for BCRYPT_PAD_NONE.\n", (int)input_len ); + return STATUS_INVALID_PARAMETER; + } + + /* import RSA key */ + if ((status = key_export_rsa_public( key, NULL, 0, &len ))) + { + ERR( "Key export failed.\n" ); + return status; + } + rsa_blob = malloc( len ); + if ((status = key_export_rsa_public( key, (UCHAR *)rsa_blob, len, &len ))) + { + ERR( "Key export failed.\n" ); + return status; + } + err = pgcry_sexp_build(&sexp_pubkey, NULL, + "(public-key(rsa (e %b)(n %b)))", + rsa_blob->cbPublicExp, + (UCHAR *)(rsa_blob + 1), + rsa_blob->cbModulus, + (UCHAR *)(rsa_blob + 1) + rsa_blob->cbPublicExp); + free( rsa_blob ); + if (err) + { + ERR("Failed to build gcrypt public key\n"); + goto done; + } + + /* import input data with necessary padding */ + if (flags == BCRYPT_PAD_PKCS1) + { + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags pkcs1)(value %b))", + input_len, + input); + } + else if (flags == BCRYPT_PAD_OAEP) + { + if (oaep_info->pbLabel) + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags oaep)(hash-algo %s)(label %b)(value %b))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + oaep_info->cbLabel, + oaep_info->pbLabel, + input_len, + input); + else + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags oaep)(hash-algo %s)(value %b))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + input_len, + input); + } + else if (flags == BCRYPT_PAD_NONE) + { + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags raw)(value %b))", + input_len, + input); + } + else + { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (err) + { + ERR("Failed to build gcrypt padded input data\n"); + goto done; + } + + if ((err = pgcry_pk_encrypt(&sexp_result, sexp_input, sexp_pubkey))) + { + ERR("Failed to encrypt data\n"); + goto done; + } + + mpi_a = pgcry_sexp_find_token(sexp_result, "a", 0); + result.data = (void *)pgcry_sexp_nth_data(mpi_a, 1, &result_len); + + result.size = result_len; + result_len = EXPORT_SIZE(result, key->u.a.bitlen / 8, 1); + *ret_len = result_len; + + if (params->output_len >= result_len) export_gnutls_datum(output, result_len, &result, 1); + else if (params->output_len == 0) status = STATUS_SUCCESS; + else status = STATUS_BUFFER_TOO_SMALL; + +done: + pgcry_sexp_release(sexp_input); + pgcry_sexp_release(sexp_pubkey); + pgcry_sexp_release(sexp_result); + pgcry_sexp_release(mpi_a); + + if (status) + return status; + + if (err) + { + ERR("Error = %s/%s\n", pgcry_strsource (err), pgcry_strerror (err)); + return STATUS_INTERNAL_ERROR; + } + + return STATUS_SUCCESS; +} + +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ) +{ + const struct key_asymmetric_encrypt_params *params = args; + gnutls_datum_t m, e, d, p, q, u, e1, e2; + struct key *key = params->key; + UCHAR *input = params->input; + ULONG input_len = params->input_len; + UCHAR *output = params->output; + ULONG *ret_len = params->ret_len; + void *padding = params->padding; + ULONG flags = params->flags; + BCRYPT_OAEP_PADDING_INFO *oaep_info = padding; + NTSTATUS status; + gcry_sexp_t sexp_privkey = NULL; + gcry_sexp_t sexp_result = NULL; + gcry_sexp_t sexp_input = NULL; + gnutls_datum_t result; + size_t result_len; + gcry_error_t err; + int ret; + + if (!gcrypt_available) + { + ERR( "Asymmetric decryption not available.\n" ); + return STATUS_INTERNAL_ERROR; + } + + if (key->alg_id != ALG_ID_RSA) + { + FIXME( "Unsupported algorithm id: %u\n", key->alg_id ); + return STATUS_INTERNAL_ERROR; + } + + if ((ret = pgnutls_privkey_export_rsa_raw( key_data(key)->a.privkey, &m, &e, &d, &p, &q, &u, &e1, &e2 ))) + { + pgnutls_perror( ret ); + return STATUS_INTERNAL_ERROR; + } + err = pgcry_sexp_build(&sexp_privkey, NULL, + "(private-key(rsa (e %b)(n %b)(d %b)))", + e.size, e.data, + m.size, m.data, + d.size, d.data); + free( m.data ); free( e.data ); free( d.data ); free( p.data ); free( q.data ); free( u.data ); + free( e1.data ); free( e2.data ); + + if (err) + { + ERR( "Failed to build gcrypt private key\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (flags == BCRYPT_PAD_PKCS1) err = pgcry_sexp_build( &sexp_input, NULL, "(enc-val (flags pkcs1)(rsa (a %b)))", input_len, input ); + else if (flags == BCRYPT_PAD_OAEP) + { + if (oaep_info->pbLabel) + err = pgcry_sexp_build( &sexp_input, NULL, + "(enc-val (flags oaep)(hash-algo %s)(label %b)(rsa (a %b)))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + oaep_info->cbLabel, + oaep_info->pbLabel, + input_len, + input ); + else + err = pgcry_sexp_build( &sexp_input, NULL, + "(enc-val (flags oaep)(hash-algo %s)(rsa (a %b)))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + input_len, + input ); + } + else if (flags == BCRYPT_PAD_NONE) err = pgcry_sexp_build( &sexp_input, NULL, "(enc-val (flags raw)(rsa (a %b)))", input_len, input ); + else + { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (err) + { + ERR( "Failed to build gcrypt padded input data\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if ((err = pgcry_pk_decrypt( &sexp_result, sexp_input, sexp_privkey ))) + { + ERR( "Failed to decrypt data\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + result.data = (void *)pgcry_sexp_nth_data(sexp_result, 1, &result_len); + result.size = result_len; + if (flags == BCRYPT_PAD_NONE) result_len = EXPORT_SIZE(result, key->u.a.bitlen / 8, 1); + *ret_len = result_len; + + if (params->output_len >= result_len) + { + status = STATUS_SUCCESS; + if (flags == BCRYPT_PAD_NONE) + export_gnutls_datum(output, result_len, &result, 1); + else + memcpy(output, result.data, result_len); + } + else if (params->output_len == 0) status = STATUS_SUCCESS; + else status = STATUS_BUFFER_TOO_SMALL; + +done: + pgcry_sexp_release(sexp_input); + pgcry_sexp_release(sexp_privkey); + pgcry_sexp_release(sexp_result); + + if (status) return status; + + if (err) + { + ERR( "Error %s/%s\n", pgcry_strsource (err), pgcry_strerror (err) ); + return STATUS_INTERNAL_ERROR; + } + + return STATUS_SUCCESS; +} + +#else +static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) +{ + ERR("Asymmetric key encryption not supported without gcrypt.\n"); + return STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ) +{ + ERR("Asymmetric key encryption not supported without gcrypt.\n"); + return STATUS_NOT_IMPLEMENTED; +} +#endif + static NTSTATUS key_asymmetric_encrypt( void *args ) { const struct key_asymmetric_encrypt_params *params = args; @@ -2509,6 +3074,9 @@ static NTSTATUS key_asymmetric_encrypt( void *args ) if (!key_data(params->key)->a.pubkey) return STATUS_INVALID_HANDLE; + if (params->flags == BCRYPT_PAD_NONE || params->flags == BCRYPT_PAD_OAEP) + return key_asymmetric_encrypt_gcrypt( args ); + d.data = params->input; d.size = params->input_len; if ((ret = pgnutls_pubkey_encrypt_data(key_data(params->key)->a.pubkey, 0, &d, &e))) @@ -2526,17 +3094,244 @@ static NTSTATUS key_asymmetric_encrypt( void *args ) return status; } +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +static NTSTATUS gcrypt_extract_result_into_secret(gcry_sexp_t result, gnutls_datum_t *s) +{ + NTSTATUS status = STATUS_SUCCESS; + gcry_mpi_t fullcoords = NULL; + gcry_sexp_t fragment = NULL; + UCHAR *tmp_buffer = NULL; + gcry_error_t err; + size_t size; + + fragment = pgcry_sexp_find_token( result, "s", 0 ); + if (!fragment) + { + status = STATUS_NO_MEMORY; + goto done; + } + + fullcoords = pgcry_sexp_nth_mpi( fragment, 1, GCRYMPI_FMT_USG ); + if (!fullcoords) + { + status = STATUS_NO_MEMORY; + goto done; + } + + if ((err = pgcry_mpi_print( GCRYMPI_FMT_USG, NULL, 0, &size, fullcoords)) ) + { + ERR("Error = %s/%s.\n", pgcry_strsource( err ), pgcry_strerror( err )); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + tmp_buffer = malloc(size); + if ((err = pgcry_mpi_print( GCRYMPI_FMT_STD, tmp_buffer, size, NULL, fullcoords)) ) + { + ERR( "Error = %s/%s.\n", pgcry_strsource(err), pgcry_strerror(err) ); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + s->size = size / 2; + s->data = malloc( s->size ); + memcpy( s->data, tmp_buffer + size % 2, size / 2 ); + +done: + free( tmp_buffer ); + + pgcry_mpi_release( fullcoords ); + pgcry_sexp_release( fragment ); + + return status; +} +#endif + + static NTSTATUS key_asymmetric_derive_key( void *args ) { const struct key_asymmetric_derive_key_params *params = args; - gnutls_datum_t s; - int ret; + gnutls_datum_t s = { NULL }; + struct key *priv_key; + struct key *peer_key; - if ((ret = pgnutls_privkey_derive_secret( key_data(params->privkey)->a.privkey, - key_data(params->pubkey)->a.pubkey, NULL, &s, 0 ))) + priv_key = params->privkey; + peer_key = params->pubkey; + + switch (priv_key->alg_id) { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; + case ALG_ID_DH: +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + { + mpz_t p, priv, peer, k; + ULONG key_length; + + if (!dh_supported) + { + ERR("DH is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (!(priv_key->u.a.flags & KEY_FLAG_FINALIZED) || !(peer_key->u.a.flags & KEY_FLAG_FINALIZED) + || !key_data(priv_key)->d.privkey) + { + WARN( "Keys are not initialized.\n" ); + return STATUS_INVALID_HANDLE; + } + + key_length = priv_key->u.a.bitlen / 8; + + if (memcmp((BCRYPT_DH_KEY_BLOB *)key_data(priv_key)->d.pubkey + 1, + (BCRYPT_DH_KEY_BLOB *)key_data(peer_key)->d.pubkey + 1, 2 * key_length)) + { + ERR("peer DH paramaters do not match.\n"); + return STATUS_INTERNAL_ERROR; + } + + pmpz_init(p); + pmpz_init(priv); + pmpz_init(peer); + pmpz_init(k); + + import_mpz(p, (BCRYPT_DH_KEY_BLOB *)key_data(priv_key)->d.pubkey + 1, key_length); + if (pmpz_sizeinbase(p, 2) < 2) + { + ERR("Invalid prime.\n"); + pmpz_clear(p); + pmpz_clear(priv); + pmpz_clear(peer); + pmpz_clear(k); + return STATUS_INTERNAL_ERROR; + } + import_mpz(priv, key_data(priv_key)->d.privkey, key_length); + import_mpz(peer, key_data(peer_key)->d.pubkey + sizeof(BCRYPT_DH_KEY_BLOB) + 2 * key_length, key_length); + pmpz_powm(k, peer, priv, p); + + s.size = key_length; + s.data = malloc( s.size ); + export_mpz(s.data, key_length, k); + + pmpz_clear(p); + pmpz_clear(priv); + pmpz_clear(peer); + pmpz_clear(k); + break; + } +#else + ERR_(winediag)("Compiled without DH support.\n"); + return STATUS_NOT_IMPLEMENTED; +#endif + + case ALG_ID_ECDH_P256: + case ALG_ID_ECDH_P384: +/* this is necessary since GNUTLS doesn't support ECDH public key encryption, maybe we can replace this when it does: + https://github.com/gnutls/gnutls/blob/cdc4fc288d87f91f974aa23b6e8595a53970ce00/lib/nettle/pk.c#L495 */ +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) + { + gcry_sexp_t xchg_result = NULL; + gcry_sexp_t privkey = NULL; + gcry_sexp_t pubkey = NULL; + const char *pubkey_format; + BCRYPT_ECCKEY_BLOB *h; + UCHAR *privkey_blob; + UCHAR *pubkey_raw; + gcry_error_t err; + ULONG key_length; + NTSTATUS status; + ULONG key_len; + + if (!gcrypt_available) + { + ERR("ECDH secret agreement is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (priv_key->alg_id == ALG_ID_ECDH_P256) + { + pubkey_format = "NIST P-256"; + key_length = 32; + } + else if (priv_key->alg_id == ALG_ID_ECDH_P384) + { + pubkey_format = "NIST P-384"; + key_length = 48; + } + else return STATUS_NOT_IMPLEMENTED; + + if (key_length != priv_key->u.a.bitlen / 8) + { + ERR( "Key length mismatch, key->u.a.bitlen %u, key_length %u.\n", (int)priv_key->u.a.bitlen, + (int)key_length ); + return STATUS_INVALID_PARAMETER; + } + + if ((status = key_export_ecc( priv_key, NULL, 0, &key_len ))) + return status; + privkey_blob = malloc( key_len ); + if ((status = key_export_ecc( priv_key, privkey_blob, key_len, &key_len ))) + { + free( privkey_blob ); + return status; + } + + if ((status = key_export_ecc_public( peer_key, NULL, 0, &key_len ))) + return status; + h = malloc( key_len ); + if ((status = key_export_ecc_public( peer_key, (UCHAR *)h, key_len, &key_len ))) + { + free( privkey_blob ); + return status; + } + + /* copy public key into temporary buffer so we can prepend 0x04 (to indicate it is uncompressed) */ + pubkey_raw = malloc( (key_length * 2) + 1 ); + pubkey_raw[0] = 0x04; + memcpy( pubkey_raw + 1, h + 1, key_length * 2 ); + free( h ); + + err = pgcry_sexp_build( &pubkey, NULL, "(key-data(public-key(ecdh(curve %s)(q %b))))", pubkey_format, + (key_length * 2) + 1, pubkey_raw ); + free( pubkey_raw ); + if (err) + { + free( privkey_blob ); + ERR( "Failed to build gcrypt public key. err %s/%s\n", pgcry_strsource( err ), pgcry_strerror( err )); + return STATUS_INTERNAL_ERROR; + } + + err = pgcry_sexp_build( &privkey, NULL, "(data(flags raw)(value %b))", key_length, + privkey_blob + sizeof(BCRYPT_ECCKEY_BLOB) + key_length * 2 ); + free( privkey_blob ); + if (err) + { + pgcry_sexp_release( pubkey ); + return STATUS_INTERNAL_ERROR; + } + err = pgcry_pk_encrypt( &xchg_result, privkey, pubkey ); + pgcry_sexp_release( privkey ); + pgcry_sexp_release( pubkey ); + if (err) + { + ERR( "Failed to perform key exchange. err %s/%s\n", pgcry_strsource( err ), pgcry_strerror( err )); + return STATUS_INTERNAL_ERROR; + } + status = gcrypt_extract_result_into_secret( xchg_result, &s ); + pgcry_sexp_release(xchg_result); + if (status) + { + ERR("Failed to extract secret key.\n"); + return status; + } + break; + } +#else + WARN("Compiled without ECC secret support.\n"); + return STATUS_NOT_IMPLEMENTED; +#endif + + default: + ERR( "unhandled algorithm %u\n", priv_key->alg_id ); + return STATUS_INVALID_HANDLE; } if (!params->output) *params->ret_len = s.size; diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 45e03e5d15b..511ee7634b6 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -2478,7 +2478,6 @@ static void test_rsa_encrypt(void) ret = BCryptImportKeyPair(rsa, NULL, BCRYPT_RSAPRIVATE_BLOB, &key, rsaPrivateBlob, sizeof(rsaPrivateBlob), 0); ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); - todo_wine { /* No padding */ memset(input_no_padding, 0, sizeof(input_no_padding)); strcpy((char *)input_no_padding, "Hello World"); @@ -2486,12 +2485,12 @@ static void test_rsa_encrypt(void) ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); - encrypted_a = malloc(encrypted_size); + encrypted_a = malloc(encrypted_size * 2); memset(encrypted_a, 0, encrypted_size); - encrypted_b = malloc(encrypted_size); + encrypted_b = malloc(encrypted_size * 2); memset(encrypted_b, 0xff, encrypted_size); - ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size * 2, &encrypted_size, BCRYPT_PAD_NONE); ok(ret == STATUS_INVALID_PARAMETER, "got %lx\n", ret); ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, 12, &encrypted_size, BCRYPT_PAD_NONE); @@ -2504,11 +2503,11 @@ static void test_rsa_encrypt(void) ok(!memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs should be the same\n"); ok(!memcmp(encrypted_b, rsa_encrypted_no_padding, encrypted_size), "Data mismatch.\n"); + decrypted_size = 0xdeadbeef; BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_NONE); ok(decrypted_size == sizeof(input_no_padding), "got %lu\n", decrypted_size); - BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_NONE); + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size * 2, &decrypted_size, BCRYPT_PAD_NONE); ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "Decrypted output it's not what expected\n"); - } encrypted_size = 60; /* PKCS1 Padding */ @@ -2532,19 +2531,18 @@ static void test_rsa_encrypt(void) BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_PKCS1); ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n"); - todo_wine { encrypted_size = 60; /* OAEP Padding */ ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); - encrypted_a = realloc(encrypted_a, encrypted_size); - memset(encrypted_a, 0, encrypted_size); - encrypted_b = realloc(encrypted_b, encrypted_size); + encrypted_a = realloc(encrypted_a, encrypted_size * 2); + memset(encrypted_a, 0, encrypted_size * 2); + encrypted_b = realloc(encrypted_b, encrypted_size * 2); memset(encrypted_b, 0, encrypted_size); - ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP); + ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size * 2, &encrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); @@ -2552,11 +2550,13 @@ static void test_rsa_encrypt(void) decrypted_size = 0; memset(decrypted, 0, sizeof(decrypted)); - BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_OAEP); + ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_OAEP); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size); - BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_OAEP); + ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size * 2, &decrypted_size, BCRYPT_PAD_OAEP); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n"); - } + free(encrypted_a); free(encrypted_b); @@ -3057,10 +3057,13 @@ static void test_ECDH(void) win_skip("BCRYPT_KDF_RAW_SECRET not supported\n"); goto raw_secret_end; } - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); - if (status != STATUS_SUCCESS) goto raw_secret_end; + ok(status == STATUS_SUCCESS, "got %#lx\n", status); ok(size == 32, "size of secret key incorrect, got %lu, expected 32\n", size); + if (!size) + goto raw_secret_end; + + buf = malloc(size); status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buf, size, &size, 0); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -3069,7 +3072,7 @@ static void test_ECDH(void) raw_secret_end: status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); - todo_wine ok (status == STATUS_SUCCESS, "got %#lx\n", status); + ok (status == STATUS_SUCCESS, "got %#lx\n", status); if (status != STATUS_SUCCESS) goto derive_end; ok (size == 20, "got %lu\n", size); @@ -3236,12 +3239,7 @@ static void test_DH(void) ok(key != NULL, "key not set\n"); status = BCryptFinalizeKeyPair(key, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); - if (status != STATUS_SUCCESS) - { - BCryptDestroyKey(key); - return; - } + ok(status == STATUS_SUCCESS, "got %#lx\n", status); size = 0; status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, NULL, 0, &size, 0); @@ -3874,7 +3872,6 @@ static void test_SecretAgreement(void) ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDestroyHash(secret); @@ -3914,7 +3911,7 @@ static void test_SecretAgreement(void) BCryptCloseAlgorithmProvider(alg, 0); return; } - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptSecretAgreement(key, key, &secret, 0); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -3923,7 +3920,7 @@ static void test_SecretAgreement(void) ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDestroySecret(secret); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -3961,6 +3958,380 @@ static void test_RC4(void) ok(status == STATUS_SUCCESS, "got %#lx\n", status); } +static void test_dh_SecretAgreement(void) +{ + static BCryptBuffer hash_param_buffers[] = + { + { + sizeof(BCRYPT_SHA256_ALGORITHM), + KDF_HASH_ALGORITHM, + (void *)BCRYPT_SHA256_ALGORITHM, + } + }; + + static BCryptBufferDesc hash_params = + { + BCRYPTBUFFER_VERSION, + ARRAY_SIZE(hash_param_buffers), + hash_param_buffers, + }; + + static const ULONG private_key_data[] = + { + 0xc4caf69c, 0x57b4db27, 0x36f7135f, 0x5ccba686, 0xc37b8819, 0x1d35c9b2, 0xbb07a1cf, 0x0c5d1c1b, + 0xc79acb10, 0x31dfdabb, 0x702e02b9, 0x1efab345, 0x262a8074, 0x5edf7698, 0x9b9dc630, 0x13c34b93, + 0xacbc928b, 0xb79eed8c, 0x7413dce9, 0xa5521280, 0x88d8e695, 0xa310269f, 0xca7c5719, 0xcd0c775b, + 0x9a6e2cf2, 0x9e235c51, 0xf49db62d, 0x28e72424, 0x4a44da5a, 0x3d98268d, 0x8e4d2be3, 0x254e44e6, + + 0x18a67e55, 0x572e13a1, 0x46f81ca8, 0xc331c9b9, 0xf8fe3dd4, 0x8a889e5a, 0x6c0505fd, 0xbd97a121, + 0xed2dbd67, 0xf39efa8e, 0x36f9c287, 0xf6bbfa6c, 0x461e42ad, 0x17dc170e, 0xc002dc2e, 0x4813d9a4, + 0x0b6fabb8, 0x6a9e1860, 0xa8a8cbd9, 0xb7ed6b5d, 0xabb34d23, 0xf2fbe1fd, 0x8670df1e, 0xba7fa4e6, + 0xf7039712, 0x94448f30, 0xe10c812e, 0x3e311976, 0xcfdd72c4, 0xbdbea98f, 0xc9a540d6, 0x89646d57, + + 0x7ab63b33, 0x03a1e9b6, 0x947f7a9b, 0x5ae59eeb, 0x1d12eb05, 0x3f425d92, 0xe028c6ba, 0xbf90ddc9, + 0xb554f55a, 0x7aeb88b6, 0x4a443a5f, 0xbab35111, 0x82c78a0c, 0x298dd482, 0x02937cb1, 0xc94cdc2e, + 0x59b010eb, 0x3bbc0a2b, 0xd845fee0, 0x04c1d0db, 0x0c8c9424, 0x1cafd4b2, 0x9aa7aed9, 0x6a478486, + 0xa8841fd7, 0xbfeff40a, 0x8fd7bcc5, 0x3bb28977, 0x2b9a7955, 0xa55cd2e4, 0x1b6ad657, 0x067cdf21, + + 0x06f36920, 0x63280e1b, 0xf17d930f, 0xa06e74a8, 0x463b3a6f, 0x2a464507, 0x93f8a982, 0x8f620a7d, + 0xeda32d11, 0x9706a6d4, 0x33dce588, 0x75a1c446, 0x048ab567, 0xd735aafa, 0x806f7c1c, 0xdcb9651a, + 0x26acf3b4, 0x45f91cc9, 0x2a0de6fc, 0xf3c03d0c, 0xf5aee0aa, 0x3eeaaf36, 0x18ccee61, 0x83faa783, + 0x4b2b5250, 0xf4ccea22, 0x5ac0714b, 0x3f0b2bc6, 0x481b13ce, 0x12040ea7, 0x66e0bbed, 0x158e1a67, + }; + static const ULONG raw_shared_secret[] = + { + 0x375d89b5, 0x35a9c270, 0xfbc5ba82, 0x09eb3069, 0xd50965b0, 0xace510f7, 0x981e8731, 0x80a76115, + 0xf386d348, 0xca17b8df, 0x0b0e84ec, 0xf81f756e, 0x5030fa20, 0x03113b71, 0x97b7e879, 0x899b5fae, + 0xe6913299, 0x09270076, 0x39bc813a, 0xde3ef070, 0x65ad5b3a, 0x2b7c4ba4, 0x86c98ef9, 0x3236feaf, + 0x3e0253f7, 0x0489d2dd, 0x97669a3d, 0x50242fca, 0x5d4aecb1, 0xcf2d805f, 0x2258afff, 0x750e92cd, + }; + static const ULONG sha1_shared_secret[] = + { + 0x0babba9c, 0x0bdeacbd, 0x04e36574, 0xdd504dcd, 0x0cd88db0, + }; + static const ULONG sha256_shared_secret[] = + { + 0x3213db5b, 0x8cc8250b, 0xc829eaab, 0x00933709, 0x68160aa9, 0xfb9f1e20, 0xf92368e6, 0x2b8e18eb, + }; + + BCRYPT_DH_PARAMETER_HEADER *dh_header; + BCRYPT_SECRET_HANDLE secret, secret2; + BCRYPT_DH_KEY_BLOB *dh_key_blob; + static const ULONG length = 1024; + BCRYPT_KEY_HANDLE key, key2; + BCRYPT_ALG_HANDLE alg; + UCHAR buffer[2048]; + NTSTATUS status; + unsigned int i; + ULONG size; + + status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DH_ALGORITHM, NULL, 0); + ok(!status, "got %08lx\n", status); + if (status) + return; + + key = NULL; + + status = BCryptGenerateKeyPair(alg, &key, 256, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptGenerateKeyPair(alg, &key, length, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(key != NULL, "key not set\n"); + + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptFinalizeKeyPair(key, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, NULL, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, 28, &size, 0); + ok(status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buffer; + ok(dh_header->cbLength == sizeof(*dh_header) + length / 8 * 2, "Got unexpected length %lu.\n", dh_header->cbLength); + ok(dh_header->cbKeyLength == length / 8, "Got unexpected length %lu.\n", dh_header->cbKeyLength); + ok(dh_header->dwMagic == BCRYPT_DH_PARAMETERS_MAGIC, "Got unexpected magic %#lx.\n", dh_header->dwMagic); + + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, private_key_data, sizeof(private_key_data)); + size = sizeof(buffer); + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + size = sizeof(*dh_key_blob) + length / 8 * 4; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptFinalizeKeyPair(key, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + memset(buffer, 0xcc, sizeof(buffer)); + size = 0xdeadbeef; + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, NULL, 0, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + ok(dh_key_blob->dwMagic == BCRYPT_DH_PUBLIC_MAGIC, "Got unexpected magic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 3), "Key data does not match.\n"); + + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PUBLIC_BLOB, &key2, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %#lx.\n", status); + status = BCryptFinalizeKeyPair(key2, 0); + ok(status == STATUS_INVALID_HANDLE, "got %#lx.\n", status); + status = BCryptSecretAgreement(key2, key2, &secret, 0); + todo_wine ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + BCryptDestroyKey(key2); + + status = BCryptGenerateKeyPair(alg, &key2, length, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buffer; + dh_header->dwMagic = BCRYPT_DH_PARAMETERS_MAGIC; + dh_header->cbLength = sizeof(*dh_header) + length / 8 * 2; + dh_header->cbKeyLength = length / 8; + memcpy(dh_header + 1, private_key_data, length / 8 * 2); + status = BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptFinalizeKeyPair(key2, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + if (0) + { + /* Crashes on Windows. */ + BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + } + + status = BCryptExportKey(key2, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + ok(dh_key_blob->dwMagic == BCRYPT_DH_PUBLIC_MAGIC, "Got unexpected dwMagic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 2), "DH parameters do not match.\n"); + ok(memcmp((BYTE *)(dh_key_blob + 1) + length / 8 * 2, (BYTE *)private_key_data + length / 8 * 2, length / 8), + "Random public key data matches.\n"); + + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptExportKey(key, NULL, BCRYPT_DH_PRIVATE_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 4, "Got unexpected size %lu.\n", size); + ok(dh_key_blob->dwMagic == BCRYPT_DH_PRIVATE_MAGIC, "Got unexpected dwMagic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 4), "Private key data does not match.\n"); + + status = BCryptSecretAgreement(NULL, key, &secret, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, NULL, &secret, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(NULL, L"HASH", NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDeriveKey(key, L"HASH", NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, NULL, NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + size = 0xdeadbeef; + status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); + ok(size == 20, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, NULL, 0, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, raw_shared_secret, size), "Raw shared secret data does not match.\n"); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == 20, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, sha1_shared_secret, sizeof(sha1_shared_secret)), "sha1 shared secret data does not match.\n"); + + size = sizeof(buffer); + status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, buffer, size, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == 32, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, sha256_shared_secret, sizeof(sha256_shared_secret)), "sha1 shared secret data does not match.\n"); + + for (i = size; i < sizeof(buffer); ++i) + if (buffer[i] != 0xcc) + break; + ok(i == sizeof(buffer), "Buffer modified at %i, value %#x.\n", i, buffer[i]); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key2, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptSecretAgreement(key2, key, &secret2, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer + size, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(!memcmp(buffer, buffer + size, size), "Shared secrets do not match.\n"); + + status = BCryptDestroyHash(secret); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptDestroyKey(secret); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(NULL); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(alg); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key2); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptCloseAlgorithmProvider(alg, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); +} + +static void test_dh_SecretAgreement_values(void) +{ + static const ULONG private_key_data[] = + { + 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a, + 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2, + 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4, + 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff, + + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, + + 0xa0c3c734, 0xc130c92d, 0x5265abf8, 0xff409f17, 0xbcdce187, 0xff64dae3, 0x170560aa, 0xb2423ed8, + 0x9ee5a8b9, 0x92548030, 0x02bba1f9, 0x823e39a4, 0x69c438f5, 0xf91016ac, 0x89bfd166, 0x7f996446, + 0x86224203, 0x15bf689c, 0x619354a4, 0x0c1d3a1f, 0x11bcf3d2, 0x58aae029, 0x41c69824, 0x3fafc179, + 0xa742747c, 0x60658c7a, 0xd3b0bde4, 0x78d3f08b, 0x6cefa061, 0x33752536, 0xe84d4901, 0x48cd73f4, + + 0x8d449700, 0x1f95120e, 0xceb31745, 0x3663177b, 0xbd9bb2d5, 0x9c23c0d9, 0x814d34f8, 0xbc54edb0, + 0xb874659a, 0x3bac8a30, 0xa1f3dd46, 0x1705c900, 0xbc46fefe, 0x7d13875b, 0x3064351a, 0x4bd89a1c, + 0x9e938761, 0x931949db, 0x34490719, 0x84fb08ca, 0xa9dd355a, 0x5b3f5061, 0x2ac96663, 0xc594429e, + 0xbe58395d, 0x2f7d872a, 0x303d37b3, 0xa3a9b606, 0x735a6732, 0xa095bd95, 0x3d55a7c3, 0x00e54635, + }; + static const ULONG peer_key_data[] = + { + 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a, + 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2, + 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4, + 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff, + + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, + + 0x3bf7404b, 0x6284fffe, 0x97c0d565, 0xd830c658, 0xcc21bf39, 0xcae45bb6, 0x019df7df, 0xbf4cd293, + 0x6bf1989d, 0x78a81f52, 0xa4ed861c, 0x6bacf493, 0xa3e700d1, 0xd06cc206, 0x411b9727, 0x01e9c9ab, + 0x9b7e6efa, 0xf46bb25d, 0xd1027242, 0x6130787c, 0xa7b87d8b, 0xfee41492, 0x50db6213, 0x321199b6, + 0x7dace53a, 0xe8b1ec51, 0x2181b113, 0x3b33e3c0, 0x5b3a2d67, 0xbd34f0c1, 0x7037c542, 0x4a8d5540, + }; + static const ULONG raw_shared_secret[] = + { + 0x0815f37d, 0x19ee74ab, 0x9f63f123, 0xe1b3f10c, 0xbcc9be83, 0xaddf5b9d, 0x28174e72, 0xf8a33825, + 0xfc74e47d, 0x2c950888, 0xf5b776d9, 0xfc712fef, 0x5b213b32, 0x489a9829, 0xfc0a4d1d, 0x6e641d3b, + 0x3bb2ff57, 0x63500318, 0x081ee54f, 0xf33a2805, 0xb3759e98, 0xa9a64afe, 0x964b8897, 0x04691bbc, + 0x80f4aae1, 0x617405ee, 0xab71724d, 0x6c10c214, 0x6f60b96f, 0xdc777b0b, 0x22f40d4f, 0x8a1c4eb5, + }; + + BCRYPT_DH_KEY_BLOB *dh_key_blob; + static const ULONG length = 1024; + BCRYPT_KEY_HANDLE key, key2; + BCRYPT_SECRET_HANDLE secret; + BCRYPT_ALG_HANDLE alg; + UCHAR buffer[2048]; + NTSTATUS status; + ULONG size; + + status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DH_ALGORITHM, NULL, 0); + ok(!status, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, private_key_data, sizeof(private_key_data)); + + size = sizeof(*dh_key_blob) + length / 8 * 4; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PUBLIC_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, peer_key_data, sizeof(peer_key_data)); + + size = sizeof(*dh_key_blob) + length / 8 * 3; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PUBLIC_BLOB, &key2, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key2, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, raw_shared_secret, size), "Raw shared secret data does not match.\n"); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key2); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); +} + START_TEST(bcrypt) { HMODULE module; @@ -3999,6 +4370,8 @@ START_TEST(bcrypt) test_SecretAgreement(); test_rsa_encrypt(); test_RC4(); + test_dh_SecretAgreement(); + test_dh_SecretAgreement_values(); FreeLibrary(module); } diff --git a/dlls/cfgmgr32/cfgmgr32.spec b/dlls/cfgmgr32/cfgmgr32.spec index e4cd845e2a4..29de7bbdc55 100644 --- a/dlls/cfgmgr32/cfgmgr32.spec +++ b/dlls/cfgmgr32/cfgmgr32.spec @@ -91,7 +91,7 @@ @ stdcall CM_Get_Device_Interface_List_SizeW(ptr ptr wstr long) setupapi.CM_Get_Device_Interface_List_SizeW @ stdcall CM_Get_Device_Interface_List_Size_ExA(ptr ptr str long ptr) setupapi.CM_Get_Device_Interface_List_Size_ExA @ stdcall CM_Get_Device_Interface_List_Size_ExW(ptr ptr wstr long ptr) setupapi.CM_Get_Device_Interface_List_Size_ExW -@ stub CM_Get_Device_Interface_PropertyW +@ stdcall CM_Get_Device_Interface_PropertyW(wstr ptr ptr ptr ptr long) @ stub CM_Get_First_Log_Conf @ stub CM_Get_First_Log_Conf_Ex @ stub CM_Get_Global_State diff --git a/dlls/cfgmgr32/main.c b/dlls/cfgmgr32/main.c index f40068af0df..7d48a96be85 100644 --- a/dlls/cfgmgr32/main.c +++ b/dlls/cfgmgr32/main.c @@ -67,3 +67,16 @@ CONFIGRET WINAPI CM_Register_Notification( CM_NOTIFY_FILTER *filter, void *conte return CR_CALL_NOT_IMPLEMENTED; } + +/*********************************************************************** + * CM_Get_Device_Interface_PropertyW (cfgmgr32.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_PropertyW( LPCWSTR device_interface, const DEVPROPKEY *property_key, + DEVPROPTYPE *property_type, BYTE *property_buffer, + ULONG *property_buffer_size, ULONG flags ) +{ + FIXME("%s %p %p %p %p %ld stub!\n", debugstr_w(device_interface), property_key, property_type, + property_buffer, property_buffer_size, flags); + + return CR_CALL_NOT_IMPLEMENTED; +} diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c index 92f1e32c502..3bafac4b85d 100644 --- a/dlls/combase/apartment.c +++ b/dlls/combase/apartment.c @@ -719,7 +719,7 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst WCHAR src[MAX_PATH]; DWORD dwLength = dstlen * sizeof(WCHAR); - if ((ret = RegQueryValueExW(regdata->u.hkey, NULL, NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS) + if ((ret = RegQueryValueExW(regdata->u.hkey, L"", NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS) { if (keytype == REG_EXPAND_SZ) { diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index b61ed7ff8cc..298756ca541 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -111,8 +111,6 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep, i = 0; while (div > 0 && ptr < end) { - if (i && i % 64 == 0) - ptr += stradd(ptr, end, sep, strlen(sep)); /* first char is the first 6 bits of the first byte*/ chunk[0] = b64[ ( d[0] >> 2) & 0x3f ]; /* second char is the last 2 bits of the first byte and the first 4 @@ -127,6 +125,9 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep, i += 4; d += 3; div--; + + if (i && i % 64 == 0) + ptr += stradd(ptr, end, sep, strlen(sep)); } switch(pad_bytes) @@ -393,11 +394,6 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep, i = 0; while (div > 0) { - if (i && i % 64 == 0) - { - lstrcpyW(ptr, sep); - ptr += lstrlenW(sep); - } /* first char is the first 6 bits of the first byte*/ *ptr++ = b64[ ( d[0] >> 2) & 0x3f ]; /* second char is the last 2 bits of the first byte and the first 4 @@ -411,6 +407,12 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep, i += 4; d += 3; div--; + + if (i && i % 64 == 0) + { + lstrcpyW(ptr, sep); + ptr += lstrlenW(sep); + } } switch(pad_bytes) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index f640234d89b..373805e858f 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -2778,32 +2778,37 @@ BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) static BOOL CNG_PrepareSignatureECC(BYTE *encoded_sig, DWORD encoded_size, BYTE **sig_value, DWORD *sig_len) { CERT_ECC_SIGNATURE *ecc_sig; - DWORD size; + DWORD size, r_size, s_size, r_offset, s_offset; int i; if (!CryptDecodeObjectEx(X509_ASN_ENCODING, X509_ECC_SIGNATURE, encoded_sig, encoded_size, CRYPT_DECODE_ALLOC_FLAG, NULL, &ecc_sig, &size)) return FALSE; - if (!ecc_sig->r.cbData || !ecc_sig->s.cbData) + if (!(r_size = ecc_sig->r.cbData) || !(s_size = ecc_sig->s.cbData)) { LocalFree(ecc_sig); SetLastError(ERROR_INVALID_DATA); return FALSE; } + r_size = s_size = max( r_size, s_size ); - *sig_len = ecc_sig->r.cbData + ecc_sig->s.cbData; + *sig_len = r_size + s_size; if (!(*sig_value = CryptMemAlloc(*sig_len))) { LocalFree(ecc_sig); SetLastError(ERROR_OUTOFMEMORY); return FALSE; } + memset( *sig_value, 0, *sig_len ); + + r_offset = r_size - ecc_sig->r.cbData; + s_offset = s_size - ecc_sig->s.cbData; for (i = 0; i < ecc_sig->r.cbData; i++) - (*sig_value)[i] = ecc_sig->r.pbData[ecc_sig->r.cbData - i - 1]; + (*sig_value)[i + r_offset] = ecc_sig->r.pbData[ecc_sig->r.cbData - i - 1]; for (i = 0; i < ecc_sig->s.cbData; i++) - (*sig_value)[ecc_sig->r.cbData + i] = ecc_sig->s.pbData[ecc_sig->s.cbData - i - 1]; + (*sig_value)[r_size + i + s_offset] = ecc_sig->s.pbData[ecc_sig->s.cbData - i - 1]; LocalFree(ecc_sig); return TRUE; diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index e81a57c576d..2263b236fa8 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -57,6 +57,8 @@ static const BYTE toEncode4[] = static const BYTE toEncode5[] = "abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHI"; +static const BYTE toEncode6[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + static const struct BinTests tests[] = { { toEncode1, sizeof(toEncode1), "AA==\r\n", }, { toEncode2, sizeof(toEncode2), "AQI=\r\n", }, @@ -69,6 +71,9 @@ static const struct BinTests tests[] = { "SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\r\n" }, { toEncode5, sizeof(toEncode5), "YWJjZGVmZ2hpamxrbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5MEFCQ0RFRkdISQA=\r\n" }, + { toEncode6, sizeof(toEncode6), + "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\r\n" + "YQA=\r\n" }, }; static const struct BinTests testsNoCR[] = { @@ -83,6 +88,9 @@ static const struct BinTests testsNoCR[] = { "SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\n" }, { toEncode5, sizeof(toEncode5), "YWJjZGVmZ2hpamxrbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5MEFCQ0RFRkdISQA=\n" }, + { toEncode6, sizeof(toEncode6), + "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\n" + "YQA=\n" }, }; static WCHAR *strdupAtoW(const char *str) diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c index 72770caab5f..feb0c360d68 100644 --- a/dlls/crypt32/unixlib.c +++ b/dlls/crypt32/unixlib.c @@ -623,6 +623,7 @@ static const char * const CRYPT_knownLocations[] = { static void load_root_certs(void) { + const char *additional_dir; unsigned int i; #ifdef __APPLE__ @@ -660,6 +661,9 @@ static void load_root_certs(void) for (i = 0; i < ARRAY_SIZE(CRYPT_knownLocations) && list_empty(&root_cert_list); i++) import_certs_from_path( CRYPT_knownLocations[i], TRUE ); + + if ((additional_dir = getenv( "WINE_ADDITIONAL_CERTS_DIR" ))) + import_certs_from_path( additional_dir, TRUE ); } static NTSTATUS enum_root_certs( void *args ) diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec index 8791e4ec044..b3cb0bf2382 100644 --- a/dlls/d3dx9_24/d3dx9_24.spec +++ b/dlls/d3dx9_24/d3dx9_24.spec @@ -20,7 +20,7 @@ @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec index 0431a9f7f75..41e0235c00d 100644 --- a/dlls/d3dx9_25/d3dx9_25.spec +++ b/dlls/d3dx9_25/d3dx9_25.spec @@ -20,7 +20,7 @@ @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec index 5ab0a1d9fea..095a0cb4695 100644 --- a/dlls/d3dx9_26/d3dx9_26.spec +++ b/dlls/d3dx9_26/d3dx9_26.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec index 5ab0a1d9fea..095a0cb4695 100644 --- a/dlls/d3dx9_27/d3dx9_27.spec +++ b/dlls/d3dx9_27/d3dx9_27.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec index af5b6077202..bbd47d69fcf 100644 --- a/dlls/d3dx9_28/d3dx9_28.spec +++ b/dlls/d3dx9_28/d3dx9_28.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec index af5b6077202..bbd47d69fcf 100644 --- a/dlls/d3dx9_29/d3dx9_29.spec +++ b/dlls/d3dx9_29/d3dx9_29.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec index af5b6077202..bbd47d69fcf 100644 --- a/dlls/d3dx9_30/d3dx9_30.spec +++ b/dlls/d3dx9_30/d3dx9_30.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec index 8f77dc666a2..1250de7843d 100644 --- a/dlls/d3dx9_31/d3dx9_31.spec +++ b/dlls/d3dx9_31/d3dx9_31.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec index 2fdd2a00615..0691d18995b 100644 --- a/dlls/d3dx9_32/d3dx9_32.spec +++ b/dlls/d3dx9_32/d3dx9_32.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec index 2fdd2a00615..0691d18995b 100644 --- a/dlls/d3dx9_33/d3dx9_33.spec +++ b/dlls/d3dx9_33/d3dx9_33.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec index 2fdd2a00615..0691d18995b 100644 --- a/dlls/d3dx9_34/d3dx9_34.spec +++ b/dlls/d3dx9_34/d3dx9_34.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec index 2fdd2a00615..0691d18995b 100644 --- a/dlls/d3dx9_35/d3dx9_35.spec +++ b/dlls/d3dx9_35/d3dx9_35.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 4fbb44b826b..7ecbfaa775d 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -7614,6 +7614,24 @@ HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_seman return hr; } +/************************************************************************* + * D3DXComputeTangent (D3DX9_36.@) + */ +HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage_idx, DWORD tangent_idx, + DWORD binorm_idx, DWORD wrap, const DWORD *adjacency) +{ + TRACE("mesh %p, stage_idx %ld, tangent_idx %ld, binorm_idx %ld, wrap %ld, adjacency %p.\n", + mesh, stage_idx, tangent_idx, binorm_idx, wrap, adjacency); + + return D3DXComputeTangentFrameEx( mesh, D3DDECLUSAGE_TEXCOORD, stage_idx, + ( binorm_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_BINORMAL, + binorm_idx, + ( tangent_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_TANGENT, + tangent_idx, D3DX_DEFAULT, 0, + ( wrap ? D3DXTANGENT_WRAP_UV : 0 ) | D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_ORTHOGONALIZE_FROM_U, + adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL); +} + /************************************************************************* * D3DXComputeNormals (D3DX9_36.@) */ diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_37/d3dx9_37.spec +++ b/dlls/d3dx9_37/d3dx9_37.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_38/d3dx9_38.spec +++ b/dlls/d3dx9_38/d3dx9_38.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_39/d3dx9_39.spec +++ b/dlls/d3dx9_39/d3dx9_39.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_40/d3dx9_40.spec +++ b/dlls/d3dx9_40/d3dx9_40.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec index 5b7070145de..e2ea5b6cc0c 100644 --- a/dlls/d3dx9_41/d3dx9_41.spec +++ b/dlls/d3dx9_41/d3dx9_41.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec index 4a418d1508a..1792886d9ac 100644 --- a/dlls/d3dx9_42/d3dx9_42.spec +++ b/dlls/d3dx9_42/d3dx9_42.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec index 4a418d1508a..1792886d9ac 100644 --- a/dlls/d3dx9_43/d3dx9_43.spec +++ b/dlls/d3dx9_43/d3dx9_43.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/dbghelp/cpu_x86_64.c b/dlls/dbghelp/cpu_x86_64.c index eeae1f042b2..23ed5271128 100644 --- a/dlls/dbghelp/cpu_x86_64.c +++ b/dlls/dbghelp/cpu_x86_64.c @@ -951,44 +951,7 @@ static BOOL x86_64_fetch_minidump_thread(struct dump_context* dc, unsigned index static BOOL x86_64_fetch_minidump_module(struct dump_context* dc, unsigned index, unsigned flags) { - /* FIXME: not sure about the flags... */ - if (1) - { - /* FIXME: crop values across module boundaries, */ -#ifdef __x86_64__ - struct process* pcs; - struct module* module; - const RUNTIME_FUNCTION* rtf; - ULONG size; - - if (!(pcs = process_find_by_handle(dc->process->handle)) || - !(module = module_find_by_addr(pcs, dc->modules[index].base))) - return FALSE; - rtf = (const RUNTIME_FUNCTION*)pe_map_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size); - if (rtf) - { - const RUNTIME_FUNCTION* end = (const RUNTIME_FUNCTION*)((const char*)rtf + size); - UNWIND_INFO ui; - - while (rtf + 1 < end) - { - while (rtf->UnwindData & 1) /* follow chained entry */ - { - FIXME("RunTime_Function outside IMAGE_DIRECTORY_ENTRY_EXCEPTION unimplemented yet!\n"); - return FALSE; - /* we need to read into the other process */ - /* rtf = (RUNTIME_FUNCTION*)(module->module.BaseOfImage + (rtf->UnwindData & ~1)); */ - } - if (read_process_memory(dc->process, dc->modules[index].base + rtf->UnwindData, &ui, sizeof(ui))) - minidump_add_memory_block(dc, dc->modules[index].base + rtf->UnwindData, - FIELD_OFFSET(UNWIND_INFO, UnwindCode) + ui.CountOfCodes * sizeof(UNWIND_CODE), 0); - rtf++; - } - } -#endif - } - - return TRUE; + return FALSE; } struct cpu cpu_x86_64 = { diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 332c3da1059..56a8b93eb9b 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -4205,6 +4205,11 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, struct module_format* dwarf2_modfmt; dwarf2_parse_module_context_t module_ctx; +/* Our DWARF parser has been known to crash winedbg in some cases. Since + * probably no concerned parties are going to be using plain winedbg, just don't + * bother parsing anything. */ +return FALSE; + if (!dwarf2_init_section(&eh_frame, fmap, ".eh_frame", NULL, &eh_frame_sect)) /* lld produces .eh_fram to avoid generating a long name */ dwarf2_init_section(&eh_frame, fmap, ".eh_fram", NULL, &eh_frame_sect); diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 00e69d290e2..372dbf72a75 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -1464,6 +1464,59 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, ULONG_PTR load_addr, ULONG_PTR dyn_addr, BOOL is_system, void* user); +static BOOL elf_linkmap_validate_entry(const struct process* pcs, DWORD64 base, DWORD64 name_addr, WCHAR* buffer, SIZE_T buflen) +{ + static DWORD page_size; + MEMORY_BASIC_INFORMATION mem_info; + char bufstr[MAX_PATH]; + + if (!page_size) + { + SYSTEM_INFO sys_info; + GetSystemInfo(&sys_info); + page_size = sys_info.dwPageSize; + } + if (base & (page_size - 1)) + { + WARN("Unaligned base addr=%I64x page_size=%lx\n", base, page_size); + return FALSE; + } + if (VirtualQueryEx(pcs->handle, (void*)(ULONG_PTR)base, &mem_info, sizeof(mem_info))) + { + if (mem_info.BaseAddress != (void*)(ULONG_PTR)base) + { + WARN("Invalid base addr %I64x (beg map at %p)\n", base, mem_info.BaseAddress); + return FALSE; + } + } + else + { + /* Some ELF modules are loaded in 32bit mode above 2G limit, + * and virtual query will fail on these addresses when process is not large address aware. + * Don't consider this as an error for a 32bit debuggee. + */ + if (pcs->is_64bit) + { + WARN("Invalid base addr %I64x\n", base); + return FALSE; + } + } + + memset(bufstr, ' ', sizeof(bufstr)); + if (!read_process_memory(pcs, name_addr, bufstr, sizeof(bufstr))) + { + WARN("Invalid name_address %I64x\n", name_addr); + return FALSE; + } + if (!memchr(bufstr, '\0', sizeof(bufstr))) + { + WARN("Unterminated string %s\n", wine_dbgstr_an(bufstr, sizeof(bufstr))); + return FALSE; + } + MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, buffer, buflen); + return TRUE; +} + /****************************************************************** * elf_enum_modules_internal * @@ -1473,8 +1526,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, const WCHAR* main_name, enum_elf_modules_cb cb, void* user) { - WCHAR bufstrW[MAX_PATH]; - char bufstr[256]; + WCHAR bufstr[MAX_PATH]; ULONG_PTR lm_addr; if (pcs->is_host_64bit) @@ -1508,15 +1560,16 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, if (!read_process_memory(pcs, lm_addr, &lm, sizeof(lm))) return FALSE; - if (lm.l_prev && /* skip first entry, normally debuggee itself */ - lm.l_name && read_process_memory(pcs, lm.l_name, bufstr, sizeof(bufstr))) + /* skip first entry(normally debuggee itself) and entries without names */ + if (!lm.l_prev || !lm.l_name) continue; + if (!elf_linkmap_validate_entry(pcs, lm.l_addr, lm.l_name, bufstr, ARRAY_SIZE(bufstr))) { - bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); - if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) - break; + FIXME("Incorrect link_map entry, bailing out\n"); + return FALSE; } + if (main_name && !bufstr[0]) lstrcpyW(bufstr, main_name); + if (!cb(bufstr, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) + break; } } else @@ -1550,15 +1603,16 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, if (!read_process_memory(pcs, lm_addr, &lm, sizeof(lm))) return FALSE; - if (lm.l_prev && /* skip first entry, normally debuggee itself */ - lm.l_name && read_process_memory(pcs, lm.l_name, bufstr, sizeof(bufstr))) + /* skip first entry(normally debuggee itself) and entries without names */ + if (!lm.l_prev || !lm.l_name) continue; + if (!elf_linkmap_validate_entry(pcs, lm.l_addr, lm.l_name, bufstr, ARRAY_SIZE(bufstr))) { - bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); - if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) - break; + FIXME("Incorrect link_map entry, bailing out\n"); + return FALSE; } + if (main_name && !bufstr[0]) lstrcpyW(bufstr, main_name); + if (!cb(bufstr, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) + break; } } diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index f21733c7be9..644e92e9dc3 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -956,10 +956,12 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam } } - pcs->loader->synchronize_module_list(pcs); - /* this is a Wine extension to the API just to redo the synchronisation */ - if (!wImageName && !hFile) return 0; + if (!wImageName && !hFile) + { + pcs->loader->synchronize_module_list(pcs); + return 0; + } if (Flags & SLMFLAG_VIRTUAL) { @@ -968,27 +970,30 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam if (!module) return 0; module->module.SymType = SymVirtual; } - /* check if it's a builtin PE module with a containing ELF module */ - else if (wImageName && module_is_container_loaded(pcs, wImageName, BaseOfDll)) - { - /* force the loading of DLL as builtin */ - module = pe_load_builtin_module(pcs, wImageName, BaseOfDll, SizeOfDll); - } - if (!module) + else { - /* otherwise, try a regular PE module */ - if (!(module = pe_load_native_module(pcs, wImageName, hFile, BaseOfDll, SizeOfDll)) && - wImageName) + /* otherwise, try a regular PE image */ + module = pe_load_native_module(pcs, wImageName, hFile, BaseOfDll, SizeOfDll); + if (!module && wImageName) { - /* and finally an ELF or Mach-O module */ - module = pcs->loader->load_module(pcs, wImageName, BaseOfDll); + /* It could be either a dll.so file (for which we need the corresponding + * system module) or a system module. + * In both cases, ensure system module list is up-to-date. + */ + pcs->loader->synchronize_module_list(pcs); + /* try a dll.so... */ + if (module_is_container_loaded(pcs, wImageName, BaseOfDll)) + module = pe_load_builtin_module(pcs, wImageName, BaseOfDll, SizeOfDll); + /* at last, try ELF or Mach-O module */ + if (!module) + module = pcs->loader->load_module(pcs, wImageName, BaseOfDll); + } + if (!module) + { + WARN("Couldn't locate %s\n", debugstr_w(wImageName)); + SetLastError(ERROR_NO_MORE_FILES); + return 0; } - } - if (!module) - { - WARN("Couldn't locate %s\n", debugstr_w(wImageName)); - SetLastError(ERROR_NO_MORE_FILES); - return 0; } /* by default module_new fills module.ModuleName from a derivation * of LoadedImageName. Overwrite it, if we have better information diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 5887854556b..bfb7721c34d 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -420,6 +420,9 @@ static void ddraw_destroy_swapchain(struct ddraw *ddraw) *****************************************************************************/ static void ddraw_destroy(struct ddraw *This) { + struct d3d_device *device; + unsigned int i; + IDirectDraw7_SetCooperativeLevel(&This->IDirectDraw7_iface, NULL, DDSCL_NORMAL); IDirectDraw7_RestoreDisplayMode(&This->IDirectDraw7_iface); @@ -441,8 +444,43 @@ static void ddraw_destroy(struct ddraw *This) wined3d_device_decref(This->wined3d_device); wined3d_decref(This->wined3d); - if (This->d3ddevice) - This->d3ddevice->ddraw = NULL; + for (i = 0; i < This->handle_table.entry_count; ++i) + { + struct ddraw_handle_entry *entry = &This->handle_table.entries[i]; + + switch (entry->type) + { + case DDRAW_HANDLE_FREE: + break; + + case DDRAW_HANDLE_MATERIAL: + { + struct d3d_material *m = entry->object; + FIXME("Material handle %#x (%p) not unset properly.\n", i + 1, m); + m->Handle = 0; + break; + } + + case DDRAW_HANDLE_SURFACE: + { + struct ddraw_surface *surf = entry->object; + FIXME("Texture handle %#x (%p) not unset properly.\n", i + 1, surf); + surf->Handle = 0; + break; + } + + default: + FIXME("Handle %#x (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type); + break; + } + } + + ddraw_handle_table_destroy(&This->handle_table); + + LIST_FOR_EACH_ENTRY(device, &This->d3ddevice_list, struct d3d_device, ddraw_entry) + { + device->ddraw = NULL; + } /* Now free the object */ free(This); @@ -978,7 +1016,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, topmost bit unless the DDSCL_NOWINDOWCHANGES flag is set in this call that sets it to normal, not in the old coop level. */ if (!(cooplevel & DDSCL_NOWINDOWCHANGES)) - SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + SetWindowPos(ddraw->dest_window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface))) ERR("RestoreDisplayMode failed\n"); @@ -5124,6 +5162,16 @@ HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type de ddraw->immediate_context = wined3d_device_get_immediate_context(ddraw->wined3d_device); list_init(&ddraw->surface_list); + list_init(&ddraw->d3ddevice_list); + + if (!ddraw_handle_table_init(&ddraw->handle_table, 64)) + { + ERR("Failed to initialize handle table.\n"); + ddraw_handle_table_destroy(&ddraw->handle_table); + wined3d_device_decref(ddraw->wined3d_device); + wined3d_decref(ddraw->wined3d); + return DDERR_OUTOFMEMORY; + } if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &ddraw->state))) { diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index f40188f75ef..eed8c737037 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -19,6 +19,10 @@ #ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H #define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H +#ifdef __i386__ +#pragma GCC target ("fpmath=387") +#endif + #include #include #include @@ -77,6 +81,31 @@ enum ddraw_device_state DDRAW_DEVICE_STATE_NOT_RESTORED, }; +#define DDRAW_INVALID_HANDLE ~0U + +enum ddraw_handle_type +{ + DDRAW_HANDLE_FREE, + DDRAW_HANDLE_MATERIAL, + DDRAW_HANDLE_MATRIX, + DDRAW_HANDLE_STATEBLOCK, + DDRAW_HANDLE_SURFACE, +}; + +struct ddraw_handle_entry +{ + void *object; + enum ddraw_handle_type type; +}; + +struct ddraw_handle_table +{ + struct ddraw_handle_entry *entries; + struct ddraw_handle_entry *free_entries; + UINT table_size; + UINT entry_count; +}; + struct ddraw { /* Interfaces */ @@ -113,7 +142,7 @@ struct ddraw /* D3D things */ HWND d3d_window; - struct d3d_device *d3ddevice; + struct list d3ddevice_list; int d3dversion; /* Various HWNDs */ @@ -128,6 +157,8 @@ struct ddraw */ struct list surface_list; + struct ddraw_handle_table handle_table; + /* FVF management */ struct FvfToDecl *decls; UINT numConvertedDecls, declArraySize; @@ -281,31 +312,6 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 * struct ddraw_surface *unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface); struct ddraw_surface *unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface); -#define DDRAW_INVALID_HANDLE ~0U - -enum ddraw_handle_type -{ - DDRAW_HANDLE_FREE, - DDRAW_HANDLE_MATERIAL, - DDRAW_HANDLE_MATRIX, - DDRAW_HANDLE_STATEBLOCK, - DDRAW_HANDLE_SURFACE, -}; - -struct ddraw_handle_entry -{ - void *object; - enum ddraw_handle_type type; -}; - -struct ddraw_handle_table -{ - struct ddraw_handle_entry *entries; - struct ddraw_handle_entry *free_entries; - UINT table_size; - UINT entry_count; -}; - BOOL ddraw_handle_table_init(struct ddraw_handle_table *t, UINT initial_size); void ddraw_handle_table_destroy(struct ddraw_handle_table *t); DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type); @@ -329,6 +335,7 @@ struct d3d_device struct wined3d_device *wined3d_device; struct wined3d_device_context *immediate_context; struct ddraw *ddraw; + struct list ddraw_entry; IUnknown *rt_iface; struct wined3d_streaming_buffer vertex_buffer, index_buffer; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index bc1d91ee00b..b0f0bd910dc 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -303,14 +303,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface) case DDRAW_HANDLE_FREE: break; - case DDRAW_HANDLE_MATERIAL: - { - struct d3d_material *m = entry->object; - FIXME("Material handle %#lx (%p) not unset properly.\n", i + 1, m); - m->Handle = 0; - break; - } - case DDRAW_HANDLE_MATRIX: { /* No FIXME here because this might happen because of sloppy applications. */ @@ -327,14 +319,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface) break; } - case DDRAW_HANDLE_SURFACE: - { - struct ddraw_surface *surf = entry->object; - FIXME("Texture handle %#lx (%p) not unset properly.\n", i + 1, surf); - surf->Handle = 0; - break; - } - default: FIXME("Handle %#lx (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type); break; @@ -359,7 +343,10 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface) /* Releasing the render target above may have released the last * reference to the ddraw object. */ if (This->ddraw) - This->ddraw->d3ddevice = NULL; + { + list_remove(&This->ddraw_entry); + This->ddraw = NULL; + } /* Now free the structure */ free(This); @@ -2768,7 +2755,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, break; } - surf = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_SURFACE); + surf = ddraw_get_object(&device->ddraw->handle_table, value - 1, DDRAW_HANDLE_SURFACE); if (!surf) { WARN("Invalid texture handle.\n"); @@ -2936,7 +2923,7 @@ static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface, { struct d3d_material *m; - if (!(m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL))) + if (!(m = ddraw_get_object(&device->ddraw->handle_table, value - 1, DDRAW_HANDLE_MATERIAL))) { WARN("Invalid material handle.\n"); wined3d_mutex_unlock(); @@ -6890,7 +6877,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, c if (version != 1) IUnknown_AddRef(device->rt_iface); - ddraw->d3ddevice = device; + list_add_head(&ddraw->d3ddevice_list, &device->ddraw_entry); wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_ZENABLE, d3d_device_update_depth_stencil(device)); @@ -6938,12 +6925,6 @@ HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_su return DDERR_OUTOFMEMORY; } - if (ddraw->d3ddevice) - { - FIXME("Only one Direct3D device per DirectDraw object supported.\n"); - return DDERR_INVALIDPARAMS; - } - if (!(object = calloc(1, sizeof(*object)))) { ERR("Failed to allocate device memory.\n"); diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 320ce6649d4..f505eea37c6 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -347,13 +347,13 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d instr += size; - if (!(dst = ddraw_get_object(&device->handle_table, + if (!(dst = ddraw_get_object(&device->ddraw->handle_table, ci->hDestTexture - 1, DDRAW_HANDLE_SURFACE))) { WARN("Invalid destination texture handle %#lx.\n", ci->hDestTexture); continue; } - if (!(src = ddraw_get_object(&device->handle_table, + if (!(src = ddraw_get_object(&device->ddraw->handle_table, ci->hSrcTexture - 1, DDRAW_HANDLE_SURFACE))) { WARN("Invalid source texture handle %#lx.\n", ci->hSrcTexture); diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c index 1ba2900704f..52f82e3c256 100644 --- a/dlls/ddraw/main.c +++ b/dlls/ddraw/main.c @@ -874,8 +874,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) WARN("DirectDraw object %p has reference counts {%lu, %lu, %lu, %lu, %lu}.\n", ddraw, ddraw->ref7, ddraw->ref4, ddraw->ref3, ddraw->ref2, ddraw->ref1); - if (ddraw->d3ddevice) - WARN("DirectDraw object %p has Direct3D device %p attached.\n", ddraw, ddraw->d3ddevice); + if (!list_empty(&ddraw->d3ddevice_list)) + WARN("DirectDraw object %p has Direct3D device(s) attached.\n", ddraw); LIST_FOR_EACH_ENTRY(surface, &ddraw->surface_list, struct ddraw_surface, surface_list_entry) { diff --git a/dlls/ddraw/material.c b/dlls/ddraw/material.c index d8cb41f1733..4f8266f00d2 100644 --- a/dlls/ddraw/material.c +++ b/dlls/ddraw/material.c @@ -143,7 +143,7 @@ static ULONG WINAPI d3d_material3_Release(IDirect3DMaterial3 *iface) if (material->Handle) { wined3d_mutex_lock(); - ddraw_free_handle(&material->ddraw->d3ddevice->handle_table, material->Handle - 1, DDRAW_HANDLE_MATERIAL); + ddraw_free_handle(&material->ddraw->handle_table, material->Handle - 1, DDRAW_HANDLE_MATERIAL); wined3d_mutex_unlock(); } @@ -300,7 +300,7 @@ static HRESULT WINAPI d3d_material3_GetHandle(IDirect3DMaterial3 *iface, material->active_device = device_impl; if (!material->Handle) { - DWORD h = ddraw_allocate_handle(&device_impl->handle_table, material, DDRAW_HANDLE_MATERIAL); + DWORD h = ddraw_allocate_handle(&device_impl->ddraw->handle_table, material, DDRAW_HANDLE_MATERIAL); if (h == DDRAW_INVALID_HANDLE) { ERR("Failed to allocate a material handle.\n"); diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 5836a49f4fd..20f79c9453d 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1986,6 +1986,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface2_Blt(IDirectDrawSurface2 * *****************************************************************************/ static HRESULT ddraw_surface_attach_surface(struct ddraw_surface *This, struct ddraw_surface *Surf) { + struct d3d_device *device; + TRACE("surface %p, attachment %p.\n", This, Surf); if(Surf == This) @@ -2012,8 +2014,10 @@ static HRESULT ddraw_surface_attach_surface(struct ddraw_surface *This, struct d This->next_attached = Surf; /* Check if the WineD3D depth stencil needs updating */ - if (This->ddraw->d3ddevice) - d3d_device_update_depth_stencil(This->ddraw->d3ddevice); + LIST_FOR_EACH_ENTRY(device, &This->ddraw->d3ddevice_list, struct d3d_device, ddraw_entry) + { + d3d_device_update_depth_stencil(device); + } wined3d_mutex_unlock(); @@ -5419,7 +5423,7 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface, if (!surface->Handle) { - DWORD h = ddraw_allocate_handle(&device_impl->handle_table, surface, DDRAW_HANDLE_SURFACE); + DWORD h = ddraw_allocate_handle(&device_impl->ddraw->handle_table, surface, DDRAW_HANDLE_SURFACE); if (h == DDRAW_INVALID_HANDLE) { ERR("Failed to allocate a texture handle.\n"); @@ -6030,7 +6034,7 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren /* Having a texture handle set implies that the device still exists. */ if (surface->Handle) - ddraw_free_handle(&surface->ddraw->d3ddevice->handle_table, surface->Handle - 1, DDRAW_HANDLE_SURFACE); + ddraw_free_handle(&surface->ddraw->handle_table, surface->Handle - 1, DDRAW_HANDLE_SURFACE); /* Reduce the ddraw surface count. */ list_remove(&surface->surface_list_entry); @@ -6733,18 +6737,19 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ if (ddraw->cooperative_level & DDSCL_EXCLUSIVE) { struct wined3d_swapchain_desc swapchain_desc; + struct d3d_device *device; wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc); swapchain_desc.backbuffer_width = mode.width; swapchain_desc.backbuffer_height = mode.height; swapchain_desc.backbuffer_format = mode.format_id; - if (ddraw->d3ddevice) + LIST_FOR_EACH_ENTRY(device, &ddraw->d3ddevice_list, struct d3d_device, ddraw_entry) { - if (ddraw->d3ddevice->recording) - wined3d_stateblock_decref(ddraw->d3ddevice->recording); - ddraw->d3ddevice->recording = NULL; - ddraw->d3ddevice->update_state = ddraw->d3ddevice->state; + if (device->recording) + wined3d_stateblock_decref(device->recording); + device->recording = NULL; + device->update_state = device->state; } wined3d_stateblock_reset(ddraw->state); @@ -6808,11 +6813,19 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ { if (!(desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))) { - unsigned int bind_flags = WINED3D_BIND_SHADER_RESOURCE; + unsigned int bind_flags = 0; DWORD usage = 0; if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) + { usage |= WINED3DUSAGE_LEGACY_CUBEMAP; + bind_flags |= WINED3D_BIND_SHADER_RESOURCE; + } + else if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE) + { + bind_flags |= WINED3D_BIND_SHADER_RESOURCE; + } + if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) bind_flags |= WINED3D_BIND_DEPTH_STENCIL; else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 02d6adbb433..88569d01bf5 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -15457,6 +15457,85 @@ static void test_enum_devices(void) ok(!refcount, "Device has %lu references left.\n", refcount); } +static void test_multiple_devices(void) +{ + D3DTEXTUREHANDLE texture_handle, texture_handle2; + D3DMATERIALHANDLE mat_handle, mat_handle2; + IDirect3DViewport *viewport, *viewport2; + IDirect3DDevice *device, *device2; + IDirectDrawSurface *texture_surf; + IDirect3DMaterial *material; + DDSURFACEDESC surface_desc; + IDirect3DTexture *texture; + IDirectDraw *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + + window = create_window(); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + device2 = create_device_ex(ddraw, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice); + ok(!!device2, "got NULL.\n"); + + viewport = create_viewport(device, 0, 0, 640, 480); + viewport2 = create_viewport(device2, 0, 0, 640, 480); + + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + ok(mat_handle == mat_handle2, "got different handles.\n"); + + hr = IDirect3DMaterial_GetHandle(material, device2, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + todo_wine ok(mat_handle != mat_handle2, "got same handles.\n"); + + hr = IDirect3DViewport_SetBackground(viewport, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DViewport_SetBackground(viewport2, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 256; + surface_desc.dwHeight = 256; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &texture_surf, NULL); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirectDrawSurface_QueryInterface(texture_surf, &IID_IDirect3DTexture2, (void **)&texture); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DTexture_GetHandle(texture, device, &texture_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DTexture_GetHandle(texture, device2, &texture_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + ok(texture_handle != texture_handle2, "got same handles.\n"); + + IDirect3DTexture_Release(texture); + IDirectDrawSurface_Release(texture_surf); + IDirect3DMaterial_Release(material); + IDirect3DViewport_Release(viewport); + IDirect3DViewport_Release(viewport2); + + refcount = IDirect3DDevice_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirect3DDevice_Release(device2); + ok(!refcount, "Device has %lu references left.\n", refcount); + + IDirectDraw_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw1) { DDDEVICEIDENTIFIER identifier; @@ -15576,4 +15655,5 @@ START_TEST(ddraw1) run_for_each_device_type(test_texture_wrong_caps); test_filling_convention(); test_enum_devices(); + test_multiple_devices(); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index f4cc5df0558..1ddb36b3b4f 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -462,7 +462,8 @@ static IDirectDraw2 *create_ddraw(void) return ddraw2; } -static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, const GUID *device_guid) +static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, const GUID *device_guid, + IDirectDrawSurface **ret_surface) { /* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask * for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports @@ -541,13 +542,17 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR } IDirect3D2_Release(d3d); - IDirectDrawSurface_Release(surface); + if (ret_surface) + *ret_surface = surface; + else + IDirectDrawSurface_Release(surface); + return device; } static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level) { - return create_device_ex(ddraw, window, coop_level, &IID_IDirect3DHALDevice); + return create_device_ex(ddraw, window, coop_level, &IID_IDirect3DHALDevice, NULL); } static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UINT y, UINT w, UINT h) @@ -1330,7 +1335,7 @@ static void test_depth_blit(const GUID *device_guid) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); IDirectDraw2_Release(ddraw); @@ -1856,7 +1861,7 @@ static void test_zenable(const GUID *device_guid) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); IDirectDraw2_Release(ddraw); @@ -1971,7 +1976,7 @@ static void test_ck_rgba(const GUID *device_guid) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); IDirectDraw2_Release(ddraw); @@ -5204,7 +5209,7 @@ static void test_rt_caps(const GUID *device_guid) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); IDirectDraw2_Release(ddraw); @@ -15692,7 +15697,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -16442,6 +16447,105 @@ static void run_for_each_device_type(void (*test_func)(const GUID *)) test_func(&IID_IDirect3DRGBDevice); } +static void test_multiple_devices(void) +{ + D3DTEXTUREHANDLE texture_handle, texture_handle2; + IDirectDrawSurface *surface, *texture_surf; + D3DMATERIALHANDLE mat_handle, mat_handle2; + IDirect3DViewport2 *viewport, *viewport2; + IDirect3DDevice2 *device, *device2; + IDirect3DMaterial2 *material; + DDSURFACEDESC surface_desc; + IDirect3DTexture2 *texture; + IDirectDraw2 *ddraw; + IDirect3D2 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = create_window(); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice, &surface))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice2_GetDirect3D(device, &d3d); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + viewport = create_viewport(device, 0, 0, 640, 480); + viewport2 = create_viewport(device2, 0, 0, 640, 480); + hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DDevice2_SetCurrentViewport(device2, viewport); + ok(hr == DDERR_INVALIDPARAMS, "got %#lx.\n", hr); + hr = IDirect3DDevice2_SetCurrentViewport(device2, viewport2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + ok(mat_handle == mat_handle2, "got different handles.\n"); + + hr = IDirect3DMaterial2_GetHandle(material, device2, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + todo_wine ok(mat_handle != mat_handle2, "got same handles.\n"); + + hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice2_SetLightState(device2, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle2); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IDirect3DViewport2_SetBackground(viewport, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DViewport2_SetBackground(viewport2, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 256; + surface_desc.dwHeight = 256; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &texture_surf, NULL); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirectDrawSurface_QueryInterface(texture_surf, &IID_IDirect3DTexture2, (void **)&texture); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DTexture2_GetHandle(texture, device2, &texture_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + ok(texture_handle == texture_handle2, "got different handles.\n"); + + IDirect3DTexture2_Release(texture); + IDirectDrawSurface_Release(texture_surf); + IDirect3DMaterial2_Release(material); + IDirect3DViewport2_Release(viewport); + IDirect3DViewport2_Release(viewport2); + + refcount = IDirect3DDevice2_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirect3DDevice2_Release(device2); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Surface has %lu references left.\n", refcount); + + IDirectDraw2_Release(ddraw); + IDirect3D2_Release(d3d); + DestroyWindow(window); +} + START_TEST(ddraw2) { DDDEVICEIDENTIFIER identifier; @@ -16567,4 +16671,5 @@ START_TEST(ddraw2) run_for_each_device_type(test_texture_wrong_caps); test_filling_convention(); test_enum_devices(); + test_multiple_devices(); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 4811053a231..8c850ca2c93 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -450,7 +450,8 @@ static IDirectDraw4 *create_ddraw(void) return ddraw4; } -static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid) +static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid, + IDirectDrawSurface4 **ret_surface) { IDirectDrawSurface4 *surface, *ds; IDirect3DDevice3 *device = NULL; @@ -539,16 +540,22 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G hr = IDirect3D3_CreateDevice(d3d3, device_guid, surface, &device, NULL); IDirect3D3_Release(d3d3); - IDirectDrawSurface4_Release(surface); if (FAILED(hr)) + { + IDirectDrawSurface4_Release(surface); return NULL; + } + if (ret_surface) + *ret_surface = surface; + else + IDirectDrawSurface4_Release(surface); return device; } static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level) { - return create_device_ex(window, coop_level, &IID_IDirect3DHALDevice); + return create_device_ex(window, coop_level, &IID_IDirect3DHALDevice, NULL); } static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h) @@ -1506,7 +1513,7 @@ static void test_depth_blit(const GUID *device_guid) D3DRECT d3drect; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -2101,7 +2108,7 @@ static void test_zenable(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -2213,7 +2220,7 @@ static void test_ck_rgba(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -18750,7 +18757,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -19506,6 +19513,82 @@ static void test_enum_devices(void) ok(!refcount, "Device has %lu references left.\n", refcount); } +static void test_multiple_devices(void) +{ + D3DMATERIALHANDLE mat_handle, mat_handle2; + IDirect3DViewport3 *viewport, *viewport2; + IDirect3DDevice3 *device, *device2; + IDirect3DMaterial3 *material; + IDirectDrawSurface4 *surface; + IDirectDraw4 *ddraw; + IDirect3D3 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = create_window(); + if (!(device = create_device_ex(window, DDSCL_NORMAL, &IID_IDirect3DHALDevice, &surface))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice3_GetDirect3D(device, &d3d); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DDevice3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2, NULL); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + viewport = create_viewport(device, 0, 0, 640, 480); + viewport2 = create_viewport(device2, 0, 0, 640, 480); + hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DDevice3_SetCurrentViewport(device2, viewport); + ok(hr == DDERR_INVALIDPARAMS, "got %#lx.\n", hr); + hr = IDirect3DDevice3_SetCurrentViewport(device2, viewport2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + ok(mat_handle == mat_handle2, "got different handles.\n"); + + hr = IDirect3DMaterial3_GetHandle(material, device2, &mat_handle2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + todo_wine ok(mat_handle != mat_handle2, "got same handles.\n"); + + hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice3_SetLightState(device2, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle2); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IDirect3DViewport3_SetBackground(viewport, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DViewport3_SetBackground(viewport2, mat_handle); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + IDirect3DMaterial3_Release(material); + IDirect3DViewport3_Release(viewport); + IDirect3DViewport3_Release(viewport2); + + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirect3DDevice3_Release(device2); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirectDrawSurface4_Release(surface); + ok(!refcount, "Surface has %lu references left.\n", refcount); + IDirectDraw4_Release(ddraw); + IDirect3D3_Release(d3d); + DestroyWindow(window); +} + START_TEST(ddraw4) { DDDEVICEIDENTIFIER identifier; @@ -19647,4 +19730,5 @@ START_TEST(ddraw4) run_for_each_device_type(test_texture_wrong_caps); test_filling_convention(); test_enum_devices(); + test_multiple_devices(); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 2771a4ed368..2ec1ab611e4 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -498,7 +498,8 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 return DDENUMRET_OK; } -static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid) +static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid, + IDirectDrawSurface7 **ret_surface) { IDirectDrawSurface7 *surface, *ds; IDirect3DDevice7 *device = NULL; @@ -586,9 +587,16 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G hr = IDirect3D7_CreateDevice(d3d7, device_guid, surface, &device); IDirect3D7_Release(d3d7); - IDirectDrawSurface7_Release(surface); if (FAILED(hr)) + { + IDirectDrawSurface7_Release(surface); return NULL; + } + + if (ret_surface) + *ret_surface = surface; + else + IDirectDrawSurface7_Release(surface); return device; } @@ -615,7 +623,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) IDirect3D7_Release(d3d7); - return create_device_ex(window, coop_level, device_guid); + return create_device_ex(window, coop_level, device_guid, NULL); } static bool init_3d_test_context_guid(struct ddraw_test_context *context, const GUID *device_guid) @@ -625,7 +633,7 @@ static bool init_3d_test_context_guid(struct ddraw_test_context *context, const memset(context, 0, sizeof(*context)); context->window = create_window(); - if (!(context->device = create_device_ex(context->window, DDSCL_NORMAL, device_guid))) + if (!(context->device = create_device_ex(context->window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a D3D device.\n"); DestroyWindow(context->window); @@ -1586,7 +1594,7 @@ static void test_depth_blit(const GUID *device_guid) HWND window; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -1844,7 +1852,7 @@ static void test_zenable(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -1948,7 +1956,7 @@ static void test_ck_rgba(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -19134,7 +19142,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) HRESULT hr; window = create_window(); - if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) + if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL))) { skip("Failed to create a 3D device, skipping test.\n"); DestroyWindow(window); @@ -20001,6 +20009,43 @@ static void run_for_each_device_type(void (*test_func)(const GUID *)) winetest_pop_context(); } +static void test_multiple_devices(void) +{ + IDirect3DDevice7 *device, *device2; + IDirectDrawSurface7 *surface; + IDirectDraw7 *ddraw; + IDirect3D7 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = create_window(); + if (!(device = create_device_ex(window, DDSCL_NORMAL, &IID_IDirect3DTnLHalDevice, &surface))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice7_GetDirect3D(device, &d3d); + ok(hr == D3D_OK, "got %#lx.\n", hr); + hr = IDirect3DDevice7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + hr = IDirect3D7_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2); + ok(hr == D3D_OK, "got %#lx.\n", hr); + + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirect3DDevice3_Release(device2); + ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirectDrawSurface4_Release(surface); + ok(!refcount, "Surface has %lu references left.\n", refcount); + IDirectDraw4_Release(ddraw); + IDirect3D3_Release(d3d); + DestroyWindow(window); +} + START_TEST(ddraw7) { DDDEVICEIDENTIFIER2 identifier; @@ -20176,4 +20221,5 @@ START_TEST(ddraw7) test_enum_devices(); run_for_each_device_type(test_user_memory); test_flip_3d(); + test_multiple_devices(); } diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index 4eda2fe4763..db235721f75 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -627,7 +627,7 @@ static HRESULT WINAPI d3d_viewport_SetBackground(IDirect3DViewport3 *iface, D3DM wined3d_mutex_lock(); - if (!(m = ddraw_get_object(&viewport->ddraw->d3ddevice->handle_table, material - 1, DDRAW_HANDLE_MATERIAL))) + if (!(m = ddraw_get_object(&viewport->ddraw->handle_table, material - 1, DDRAW_HANDLE_MATERIAL))) { WARN("Invalid material handle %#lx.\n", material); wined3d_mutex_unlock(); diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index bc91b235804..16a2dcc565b 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -473,7 +473,7 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons static const WCHAR defaultW[] = L"Default DirectSound Device"; IPropertyBag *prop_bag = NULL; REGFILTERPINS2 rgpins = {0}; - REGPINTYPES rgtypes = {0}; + REGPINTYPES rgtypes[2] = {}; REGFILTER2 rgf = {0}; WCHAR clsid[CHARS_IN_GUID]; VARIANT var; @@ -504,10 +504,12 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons rgf.rgPins2 = &rgpins; rgpins.dwFlags = REG_PINFLAG_B_RENDERER; /* FIXME: native registers many more formats */ - rgpins.nMediaTypes = 1; - rgpins.lpMediaType = &rgtypes; - rgtypes.clsMajorType = &MEDIATYPE_Audio; - rgtypes.clsMinorType = &MEDIASUBTYPE_PCM; + rgpins.nMediaTypes = 2; + rgpins.lpMediaType = rgtypes; + rgtypes[0].clsMajorType = &MEDIATYPE_Audio; + rgtypes[0].clsMinorType = &MEDIASUBTYPE_PCM; + rgtypes[1].clsMajorType = &MEDIATYPE_Audio; + rgtypes[1].clsMinorType = &MEDIASUBTYPE_IEEE_FLOAT; write_filter_data(prop_bag, &rgf); diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index f99ebbc2404..384159eba0d 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -486,6 +486,9 @@ void check_dinput_events(void) MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); } +HANDLE steam_overlay_event; +HANDLE steam_keyboard_event; + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { TRACE( "inst %p, reason %lu, reserved %p.\n", inst, reason, reserved ); @@ -494,12 +497,16 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(inst); + steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); + steam_keyboard_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_KeyboardActivated"); DINPUT_instance = inst; register_di_em_win_class(); break; case DLL_PROCESS_DETACH: if (reserved) break; unregister_di_em_win_class(); + CloseHandle(steam_overlay_event); + CloseHandle(steam_keyboard_event); break; } return TRUE; diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h index 0609b816b3b..0dcf76d0564 100644 --- a/dlls/dinput/dinput_private.h +++ b/dlls/dinput/dinput_private.h @@ -46,6 +46,8 @@ struct dinput extern const IDirectInput7AVtbl dinput7_a_vtbl; extern const IDirectInput8AVtbl dinput8_a_vtbl; +extern HANDLE steam_overlay_event; +extern HANDLE steam_keyboard_event; extern void dinput_internal_addref( struct dinput *dinput ); extern void dinput_internal_release( struct dinput *dinput ); diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 3320ac92a1c..a28c3ba39e7 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -47,6 +47,9 @@ #include "wine/debug.h" #include "wine/hid.h" +#define VID_LOGITECH 0x046D +#define PID_LOGITECH_G920 0xC262 + WINE_DEFAULT_DEBUG_CHANNEL(dinput); DEFINE_GUID( GUID_DEVINTERFACE_WINEXINPUT,0x6c53d5fd,0x6480,0x440f,0xb6,0x18,0x47,0x67,0x50,0xc5,0xe1,0xa6 ); @@ -172,6 +175,7 @@ struct pid_effect_state struct hid_joystick { struct dinput_device base; + BOOL wgi_device; HANDLE device; OVERLAPPED read_ovl; @@ -540,6 +544,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, struct hid_collection_node *node, *node_end; WORD version = impl->base.dinput->dwVersion; BOOL ret, seen_axis[6] = {0}; + const GUID *hack_guid; + const WCHAR *hack_name; const WCHAR *tmp; button_ofs += impl->caps.NumberInputValueCaps * sizeof(LONG); @@ -559,6 +565,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, value_ofs += (caps->usage_max - caps->usage_min + 1) * sizeof(LONG); else for (j = caps->usage_min; j <= caps->usage_max; ++j) { + hack_name = NULL; + hack_guid = NULL; instance.dwOfs = value_ofs; switch (MAKELONG(j, caps->usage_page)) { @@ -568,7 +576,38 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, case MAKELONG(HID_USAGE_GENERIC_RX, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RY, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RZ, HID_USAGE_PAGE_GENERIC): - set_axis_type( &instance, seen_axis, j - HID_USAGE_GENERIC_X, &axis ); + if (!impl->wgi_device && impl->attrs.VendorID == VID_LOGITECH && impl->attrs.ProductID == PID_LOGITECH_G920) + { + if (j == HID_USAGE_GENERIC_X) + { + set_axis_type( &instance, seen_axis, 0, &axis ); + hack_guid = &GUID_XAxis; + hack_name = L"Wheel axis"; + } + else if (j == HID_USAGE_GENERIC_Y) + { + set_axis_type( &instance, seen_axis, 2, &axis ); + hack_guid = &GUID_YAxis; + hack_name = L"Accelerator"; + } + else if (j == HID_USAGE_GENERIC_Z) + { + set_axis_type( &instance, seen_axis, 5, &axis ); + hack_guid = &GUID_RzAxis; + hack_name = L"Brake"; + } + else if (j == HID_USAGE_GENERIC_RZ) + { + instance.dwType = DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 6 + axis++ ); + hack_guid = &GUID_Slider; + hack_name = L"Clutch"; + } + else WARN("unknown axis usage page %x usage %lx for Logitech G920\n", caps->usage_page, j); + } + else + { + set_axis_type( &instance, seen_axis, j - HID_USAGE_GENERIC_X, &axis ); + } instance.dwFlags = DIDOI_ASPECTPOSITION; break; case MAKELONG(HID_USAGE_SIMULATION_STEERING, HID_USAGE_PAGE_SIMULATION): @@ -605,12 +644,16 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, } instance.wUsagePage = caps->usage_page; instance.wUsage = j; - instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); + if (hack_guid) + instance.guidType = *hack_guid; + else + instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; - if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); + if (hack_name) lstrcpynW( instance.tszName, hack_name, MAX_PATH ); + else if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); else swprintf( instance.tszName, MAX_PATH, L"Unknown %u", DIDFT_GETINSTANCE( instance.dwType ) ); check_pid_effect_axis_caps( impl, &instance ); ret = enum_object( impl, filter, flags, callback, object, caps, &instance, data ); @@ -821,6 +864,16 @@ static HRESULT hid_joystick_get_property( IDirectInputDevice8W *iface, DWORD pro { DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header; value->guidClass = GUID_DEVCLASS_HIDCLASS; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (impl->attrs.VendorID == 0x28de && impl->attrs.ProductID == 0x11ff) + { + const WCHAR *tmp; + if ((tmp = wcschr( impl->device_path, '#' ))) tmp = wcschr( tmp + 1, '#' ); + lstrcpynW( value->wszPath, impl->device_path, tmp - impl->device_path + 1 ); + return DI_OK; + } + lstrcpynW( value->wszPath, impl->device_path, MAX_PATH ); return DI_OK; } @@ -1096,6 +1149,7 @@ struct parse_device_state_params { BYTE old_state[DEVICE_STATE_MAX_SIZE]; BYTE buttons[128]; + BOOL reset_state; DWORD time; DWORD seq; }; @@ -1111,6 +1165,8 @@ static BOOL check_device_state_button( struct dinput_device *device, UINT index, value = params->buttons[instance->wUsage - 1]; old_value = params->old_state[instance->dwOfs]; + if (params->reset_state) value = 0; + device->device_state[instance->dwOfs] = value; if (old_value != value) queue_event( iface, index, value, params->time, params->seq ); @@ -1196,6 +1252,16 @@ static BOOL read_device_state_value( struct dinput_device *device, UINT index, s if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, properties ); else value = scale_value( logical_value, properties ); + if (params->reset_state) + { + if (instance->dwType & DIDFT_POV) value = -1; + else if (instance->dwType & DIDFT_AXIS) + { + if (!properties->range_min) value = properties->range_max / 2; + else value = round( (properties->range_min + properties->range_max) / 2.0 ); + } + } + old_value = *(LONG *)(params->old_state + instance->dwOfs); *(LONG *)(impl->base.device_state + instance->dwOfs) = value; if (old_value != value) queue_event( iface, index, value, params->time, params->seq ); @@ -1225,6 +1291,12 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) ret = GetOverlappedResult( impl->device, &impl->read_ovl, &count, FALSE ); + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0 || /* steam overlay is enabled */ + WaitForSingleObject(steam_keyboard_event, 0) == WAIT_OBJECT_0) /* steam keyboard is enabled */ + params.reset_state = TRUE; + else + params.reset_state = FALSE; + EnterCriticalSection( &impl->base.crit ); while (ret) { @@ -1531,6 +1603,9 @@ static HRESULT hid_joystick_device_try_open( const WCHAR *path, HANDLE *device, break; } + if (attrs->VendorID == VID_LOGITECH && attrs->ProductID == PID_LOGITECH_G920) + type = DI8DEVTYPE_DRIVING | (DI8DEVTYPEDRIVING_DUALPEDALS << 8); + instance->dwDevType = device_type_for_version( type, version ) | DIDEVTYPE_HID; TRACE("detected device type %#lx\n", instance->dwDevType); @@ -2017,6 +2092,7 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi &attrs, &impl->caps, dinput->dwVersion ); else { + impl->wgi_device = TRUE; wcscpy( impl->device_path, *(const WCHAR **)guid ); hr = hid_joystick_device_try_open( impl->device_path, &impl->device, &impl->preparsed, &attrs, &impl->caps, &impl->base.instance, dinput->dwVersion ); diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index ec30c825733..2d4e0a6b42c 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -306,20 +306,13 @@ static void warp_check( struct mouse *impl, BOOL force ) if (force || (impl->need_warp && (now - impl->last_warped > interval))) { - RECT rect, new_rect; POINT mapped_center; + RECT rect; impl->last_warped = now; impl->need_warp = FALSE; if (!GetClientRect( impl->base.win, &rect )) return; MapWindowPoints( impl->base.win, 0, (POINT *)&rect, 2 ); - if (!impl->clipped) - { - mapped_center.x = (rect.left + rect.right) / 2; - mapped_center.y = (rect.top + rect.bottom) / 2; - TRACE( "Warping mouse to x %+ld, y %+ld.\n", mapped_center.x, mapped_center.y ); - SetCursorPos( mapped_center.x, mapped_center.y ); - } if (impl->base.dwCoopLevel & DISCL_EXCLUSIVE) { /* make sure we clip even if the window covers the whole screen */ @@ -328,8 +321,14 @@ static void warp_check( struct mouse *impl, BOOL force ) rect.right = min( rect.right, rect.left + GetSystemMetrics( SM_CXVIRTUALSCREEN ) - 2 ); rect.bottom = min( rect.bottom, rect.top + GetSystemMetrics( SM_CYVIRTUALSCREEN ) - 2 ); TRACE("Clipping mouse to %s\n", wine_dbgstr_rect( &rect )); - ClipCursor( &rect ); - impl->clipped = GetClipCursor( &new_rect ) && EqualRect( &rect, &new_rect ); + impl->clipped = ClipCursor( &rect ); + } + if (!impl->clipped) + { + mapped_center.x = (rect.left + rect.right) / 2; + mapped_center.y = (rect.top + rect.bottom) / 2; + TRACE( "Warping mouse to x %+ld, y %+ld.\n", mapped_center.x, mapped_center.y ); + SetCursorPos( mapped_center.x, mapped_center.y ); } } } diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h index ed1589ece1a..4644e060828 100644 --- a/dlls/dmime/dmime_private.h +++ b/dlls/dmime/dmime_private.h @@ -72,7 +72,7 @@ extern void set_audiopath_perf_pointer(IDirectMusicAudioPath*,IDirectMusicPerfor extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*); extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*); -extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, +extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, DWORD segment_flags, IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface); extern HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance); extern HRESULT segment_state_tick(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance); diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index bd596750f34..ca425c90a75 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1583,13 +1583,20 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface, if (FAILED(hr = IUnknown_QueryInterface(source, &IID_IDirectMusicSegment, (void **)&segment))) return hr; + if (primary && SUCCEEDED(hr = IDirectMusicPerformance8_GetSegmentState(iface, &state, start_time))) + { + if (FAILED(hr = IDirectMusicPerformance_Stop(&This->IDirectMusicPerformance8_iface, NULL, state, start_time, 0))) + ERR("Failed to stop current previous segment, hr %#lx\n", hr); + IDirectMusicSegmentState_Release(state); + } + EnterCriticalSection(&This->safe); if (primary) performance_set_primary_segment(This, segment); if (control) performance_set_control_segment(This, segment); if ((!(music_time = start_time) && FAILED(hr = IDirectMusicPerformance8_GetTime(iface, NULL, &music_time))) - || FAILED(hr = segment_state_create(segment, music_time, iface, &state))) + || FAILED(hr = segment_state_create(segment, music_time, segment_flags, iface, &state))) { if (primary) performance_set_primary_segment(This, NULL); if (control) performance_set_control_segment(This, NULL); diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 3b939bc95ca..fa6f2df098a 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -54,6 +54,7 @@ struct segment_state MUSIC_TIME played; BOOL auto_download; DWORD repeats; + DWORD flags; struct list tracks; }; @@ -106,7 +107,7 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface) if (!ref) { - segment_state_end_play((IDirectMusicSegmentState *)iface, NULL); + if (!(This->flags & DMUS_SEGF_SECONDARY)) segment_state_end_play((IDirectMusicSegmentState *)iface, NULL); if (This->segment) IDirectMusicSegment_Release(This->segment); free(This); } @@ -210,7 +211,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface) return hr; } -HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, +HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, DWORD segment_flags, IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface) { IDirectMusicSegmentState *iface; @@ -224,6 +225,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time if (FAILED(hr = create_dmsegmentstate(&IID_IDirectMusicSegmentState, (void **)&iface))) return hr; This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface); + This->flags = segment_flags; This->segment = segment; IDirectMusicSegment_AddRef(This->segment); @@ -319,6 +321,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic { MUSIC_TIME end_time = This->start_time + This->played; + if (This->flags & DMUS_SEGF_SECONDARY) return S_OK; if (FAILED(hr = performance_send_segment_end(performance, end_time, iface, FALSE))) { ERR("Failed to send segment end, hr %#lx\n", hr); diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 7f2fe4a8e5f..3dabbc645e6 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -139,7 +139,20 @@ static HRESULT WINAPI wave_track_InitPlay(IDirectMusicTrack8 *iface, static HRESULT WINAPI wave_track_EndPlay(IDirectMusicTrack8 *iface, void *pStateData) { struct wave_track *This = impl_from_IDirectMusicTrack8(iface); + struct wave_part *part; + struct wave_item *item; + FIXME("(%p, %p): stub\n", This, pStateData); + + LIST_FOR_EACH_ENTRY(part, &This->parts, struct wave_part, entry) + { + LIST_FOR_EACH_ENTRY(item, &part->items, struct wave_item, entry) + { + if (!item->buffer) continue; + IDirectSoundBuffer_Stop(item->buffer); + } + } + return S_OK; } diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index b35f9c7cbdd..247d1edcf6b 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -23,7 +23,6 @@ #include #include #include -#include #define COBJMACROS @@ -137,9 +136,9 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) device->ref = 1; device->priolevel = DSSCL_NORMAL; device->stopped = 1; - device->speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); - DSOUND_ParseSpeakerConfig(device); + device->speaker_config = 0; + device->num_speakers = 0; /* 3D listener initial parameters */ device->ds3dl.dwSize = sizeof(DS3DLISTENER); @@ -490,6 +489,9 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer( return DSERR_INVALIDPARAM; } + if (dsbd->lpwfxFormat->nChannels > 2 && dsbd->lpwfxFormat->wFormatTag != WAVE_FORMAT_EXTENSIBLE) + return DSERR_INVALIDPARAM; + if (dsbd->lpwfxFormat->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { WAVEFORMATEXTENSIBLE *pwfxe = (WAVEFORMATEXTENSIBLE*)dsbd->lpwfxFormat; @@ -1122,75 +1124,3 @@ HRESULT WINAPI DirectSoundCreate8( return hr; } - -void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) -{ - switch (DSSPEAKER_CONFIG(device->speaker_config)) { - case DSSPEAKER_MONO: - device->speaker_angles[0] = M_PI/180.0f * 0.0f; - device->speaker_num[0] = 0; - device->num_speakers = 1; - device->lfe_channel = -1; - break; - - case DSSPEAKER_STEREO: - case DSSPEAKER_HEADPHONE: - device->speaker_angles[0] = M_PI/180.0f * -90.0f; - device->speaker_angles[1] = M_PI/180.0f * 90.0f; - device->speaker_num[0] = 0; /* Left */ - device->speaker_num[1] = 1; /* Right */ - device->num_speakers = 2; - device->lfe_channel = -1; - break; - - case DSSPEAKER_QUAD: - device->speaker_angles[0] = M_PI/180.0f * -135.0f; - device->speaker_angles[1] = M_PI/180.0f * -45.0f; - device->speaker_angles[2] = M_PI/180.0f * 45.0f; - device->speaker_angles[3] = M_PI/180.0f * 135.0f; - device->speaker_num[0] = 2; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 1; /* Front right */ - device->speaker_num[3] = 3; /* Rear right */ - device->num_speakers = 4; - device->lfe_channel = -1; - break; - - case DSSPEAKER_5POINT1_BACK: - device->speaker_angles[0] = M_PI/180.0f * -135.0f; - device->speaker_angles[1] = M_PI/180.0f * -45.0f; - device->speaker_angles[2] = M_PI/180.0f * 0.0f; - device->speaker_angles[3] = M_PI/180.0f * 45.0f; - device->speaker_angles[4] = M_PI/180.0f * 135.0f; - device->speaker_angles[5] = 9999.0f; - device->speaker_num[0] = 4; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 2; /* Front centre */ - device->speaker_num[3] = 1; /* Front right */ - device->speaker_num[4] = 5; /* Rear right */ - device->speaker_num[5] = 3; /* LFE */ - device->num_speakers = 6; - device->lfe_channel = 3; - break; - - case DSSPEAKER_5POINT1_SURROUND: - device->speaker_angles[0] = M_PI/180.0f * -90.0f; - device->speaker_angles[1] = M_PI/180.0f * -30.0f; - device->speaker_angles[2] = M_PI/180.0f * 0.0f; - device->speaker_angles[3] = M_PI/180.0f * 30.0f; - device->speaker_angles[4] = M_PI/180.0f * 90.0f; - device->speaker_angles[5] = 9999.0f; - device->speaker_num[0] = 4; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 2; /* Front centre */ - device->speaker_num[3] = 1; /* Front right */ - device->speaker_num[4] = 5; /* Rear right */ - device->speaker_num[5] = 3; /* LFE */ - device->num_speakers = 6; - device->lfe_channel = 3; - break; - - default: - WARN("unknown speaker_config %lu\n", device->speaker_config); - } -} diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 34498125317..c79cb565373 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -208,7 +208,6 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv); HRESULT DSOUND_Create(REFIID riid, void **ppv); HRESULT DSOUND_Create8(REFIID riid, void **ppv); HRESULT IDirectSoundImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_ds8); -void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device); /* primary.c */ diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 2e2473b4db2..22cf475a674 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -24,6 +24,7 @@ */ #include +#include #define COBJMACROS #include "windef.h" @@ -107,6 +108,78 @@ static DWORD DSOUND_FindSpeakerConfig(IMMDevice *mmdevice, int channels) return def; } +static void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) +{ + switch (DSSPEAKER_CONFIG(device->speaker_config)) { + case DSSPEAKER_MONO: + device->speaker_angles[0] = M_PI/180.0f * 0.0f; + device->speaker_num[0] = 0; + device->num_speakers = 1; + device->lfe_channel = -1; + break; + + case DSSPEAKER_STEREO: + case DSSPEAKER_HEADPHONE: + device->speaker_angles[0] = M_PI/180.0f * -90.0f; + device->speaker_angles[1] = M_PI/180.0f * 90.0f; + device->speaker_num[0] = 0; /* Left */ + device->speaker_num[1] = 1; /* Right */ + device->num_speakers = 2; + device->lfe_channel = -1; + break; + + case DSSPEAKER_QUAD: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 45.0f; + device->speaker_angles[3] = M_PI/180.0f * 135.0f; + device->speaker_num[0] = 2; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 1; /* Front right */ + device->speaker_num[3] = 3; /* Rear right */ + device->num_speakers = 4; + device->lfe_channel = -1; + break; + + case DSSPEAKER_5POINT1_BACK: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 45.0f; + device->speaker_angles[4] = M_PI/180.0f * 135.0f; + device->speaker_angles[5] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 3; /* LFE */ + device->num_speakers = 6; + device->lfe_channel = 3; + break; + + case DSSPEAKER_5POINT1_SURROUND: + device->speaker_angles[0] = M_PI/180.0f * -90.0f; + device->speaker_angles[1] = M_PI/180.0f * -30.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 30.0f; + device->speaker_angles[4] = M_PI/180.0f * 90.0f; + device->speaker_angles[5] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 3; /* LFE */ + device->num_speakers = 6; + device->lfe_channel = 3; + break; + + default: + WARN("unknown speaker_config %lu\n", device->speaker_config); + } +} + static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client, BOOL forcewave, WAVEFORMATEX **wfx) { @@ -121,7 +194,7 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client if (FAILED(hr)) return hr; - if (mixwfe->Format.nChannels < device->num_speakers) { + if (device->num_speakers == 0 || mixwfe->Format.nChannels < device->num_speakers) { device->speaker_config = DSOUND_FindSpeakerConfig(device->mmdevice, mixwfe->Format.nChannels); DSOUND_ParseSpeakerConfig(device); } else if (mixwfe->Format.nChannels > device->num_speakers) { @@ -465,6 +538,9 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe return DSERR_INVALIDPARAM; } + if (passed_fmt->nChannels > 2 && passed_fmt->wFormatTag != WAVE_FORMAT_EXTENSIBLE) + return DSERR_ALLOCATED; + /* **** */ AcquireSRWLockExclusive(&device->buffer_list_lock); EnterCriticalSection(&(device->mixlock)); diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 9656a458415..500bc19f655 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -1481,6 +1481,49 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I fmtex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; rc = do_invalid_fmt_test(dso, buf, (WAVEFORMATEX*)&fmtex, &got_buf); ok(rc == E_INVALIDARG, "%s: SetFormat: %08lx\n", testname, rc); + + /* The following 4 tests show that formats with more than two channels require WAVEFORMATEXTENSIBLE */ + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf); + ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc); + IDirectSoundBuffer_Release(got_buf); + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = 4; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf); + ok(rc == (buf ? DSERR_ALLOCATED : DSERR_INVALIDPARAM), "%s: SetFormat: %08lx\n", testname, rc); + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = 6; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = do_invalid_fmt_test(dso, buf, &wfx, &got_buf); + ok(rc == (buf ? DSERR_ALLOCATED : DSERR_INVALIDPARAM), "%s: SetFormat: %08lx\n", testname, rc); + + fmtex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + fmtex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + fmtex.Format.nChannels = 6; + fmtex.Format.nSamplesPerSec = 44100; + fmtex.Format.wBitsPerSample = 16; + fmtex.Format.nBlockAlign = fmtex.Format.nChannels * fmtex.Format.wBitsPerSample / 8; + fmtex.Format.nAvgBytesPerSec = fmtex.Format.nSamplesPerSec * fmtex.Format.nBlockAlign; + fmtex.Samples.wValidBitsPerSample = fmtex.Format.wBitsPerSample; + fmtex.dwChannelMask = KSAUDIO_SPEAKER_5POINT1; + fmtex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + rc = do_invalid_fmt_test(dso, buf, (WAVEFORMATEX *)&fmtex, &got_buf); + ok(rc == S_OK, "%s: SetFormat: %08lx\n", testname, rc); + IDirectSoundBuffer_Release(got_buf); } static HRESULT test_invalid_fmts(LPGUID lpGuid) diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c index adc02552ba7..67b2d2bc25f 100644 --- a/dlls/dwmapi/dwmapi_main.c +++ b/dlls/dwmapi/dwmapi_main.c @@ -83,18 +83,6 @@ HRESULT WINAPI DwmGetColorizationColor(DWORD *colorization, BOOL *opaque_blend) return E_NOTIMPL; } -/********************************************************************** - * DwmFlush (DWMAPI.@) - */ -HRESULT WINAPI DwmFlush(void) -{ - static BOOL once; - - if (!once++) FIXME("() stub\n"); - - return S_OK; -} - /********************************************************************** * DwmInvalidateIconicBitmaps (DWMAPI.@) */ @@ -205,15 +193,24 @@ HRESULT WINAPI DwmGetWindowAttribute(HWND hwnd, DWORD attribute, PVOID pv_attrib return E_HANDLE; if (!IsWindow(hwnd)) return E_HANDLE; + if (!pv_attribute) + return E_INVALIDARG; switch (attribute) { + case DWMWA_NCRENDERING_ENABLED: + if (size < sizeof(BOOL)) + return E_INVALIDARG; + + WARN("DWMWA_NCRENDERING_ENABLED: always returning FALSE.\n"); + *(BOOL*)(pv_attribute) = FALSE; + hr = S_OK; + break; + case DWMWA_EXTENDED_FRAME_BOUNDS: { RECT *rect = (RECT *)pv_attribute; DPI_AWARENESS_CONTEXT context; - if (!rect) - return E_INVALIDARG; if (size < sizeof(*rect)) return E_NOT_SUFFICIENT_BUFFER; if (GetWindowLongW(hwnd, GWL_STYLE) & WS_CHILD) @@ -229,6 +226,15 @@ HRESULT WINAPI DwmGetWindowAttribute(HWND hwnd, DWORD attribute, PVOID pv_attrib SetThreadDpiAwarenessContext(context); break; } + case DWMWA_CLOAKED: + if (size < sizeof(DWORD)) + return E_INVALIDARG; + + FIXME("DWMWA_CLOAKED: always returning 0.\n"); + *(DWORD*)(pv_attribute) = 0; + hr = S_OK; + break; + default: FIXME("attribute %ld not implemented.\n", attribute); hr = E_NOTIMPL; @@ -301,6 +307,31 @@ HRESULT WINAPI DwmGetCompositionTimingInfo(HWND hwnd, DWM_TIMING_INFO *info) return S_OK; } +/********************************************************************** + * DwmFlush (DWMAPI.@) + */ +HRESULT WINAPI DwmFlush(void) +{ + LARGE_INTEGER qpf, qpc, delay; + LONG64 qpc_refresh_period; + int display_frequency; + static BOOL once; + + if (!once++) + FIXME("() stub\n"); + else + TRACE(".\n"); + + display_frequency = get_display_frequency(); + NtQueryPerformanceCounter(&qpc, &qpf); + qpc_refresh_period = qpf.QuadPart / display_frequency; + delay.QuadPart = (qpc.QuadPart - ((qpc.QuadPart + qpc_refresh_period - 1) / qpc_refresh_period) * qpc_refresh_period) + * 10000000 / qpf.QuadPart; + NtDelayExecution(FALSE, &delay); + + return S_OK; +} + /********************************************************************** * DwmAttachMilContent (DWMAPI.@) */ diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 8f7327278d7..c528a85c31f 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -248,7 +248,7 @@ system_fallback_config[] = { "0D00-0D7F", L"Noto Sans Malayalam" }, { "0D80-0DFF", L"Noto Sans Sinhala" }, - { "0E00-0E7F", L"Noto Sans Thai" }, + { "0E00-0E7F", L"Microsoft Sans Serif" }, { "0E80-0EFF", L"Noto Sans Lao" }, { "0F00-0FFF", L"Noto Serif Tibetan" }, @@ -268,7 +268,7 @@ system_fallback_config[] = { "1100-11FF, 3130-318F, " "3200-321F, 3260-327F, " "A960-A97F, AC00-D7FF, " - "D7B0-D7FF", L"Noto Sans CJK KR" }, + "D7B0-D7FF", L"Malgun Gothic" }, { "1680-169F", L"Noto Sans Ogham" }, @@ -297,27 +297,27 @@ system_fallback_config[] = /* CJK Radicals Supplement - 2E80-2EFF */ - { "2E80-2EFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "2E80-2EFF", L"Microsoft YaHei", L"zh-Hans" }, { "2E80-2EFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "2E80-2EFF", L"Noto Sans CJK KR", L"ko" }, + { "2E80-2EFF", L"Malgun Gothic", L"ko" }, /* CJK Symbols and Punctuation - 3000-303F Hiragana - 3040-309F Katakana - 30A0-30FF Katakana Phonetic Ext. - 31F0-31FF */ - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "3000-30FF, 31F0-31FF", L"Microsoft YaHei", L"zh-Hans" }, { "3000-30FF, 31F0-31FF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK KR", L"ko" }, - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK JP" }, + { "3000-30FF, 31F0-31FF", L"Malgun Gothic", L"ko" }, + { "3000-30FF, 31F0-31FF", L"MS Gothic" }, /* CJK Unified Ext A - 3400-4DBF CJK Unified - 4E00-9FFF */ - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "3400-4DBF, 4E00-9FFF", L"Microsoft YaHei", L"zh-Hans" }, { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK KR", L"ko" }, - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK JP" }, + { "3400-4DBF, 4E00-9FFF", L"Malgun Gothic", L"ko" }, + { "3400-4DBF, 4E00-9FFF", L"MS Gothic" }, { "A000-A4CF", L"Noto Sans Yi" }, { "A4D0-A4FF", L"Noto Sans Lisu" }, @@ -333,30 +333,30 @@ system_fallback_config[] = /* CJK Compatibility Ideographs - F900-FAFF */ - { "F900-FAFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "F900-FAFF", L"Microsoft YaHei", L"zh-Hans" }, { "F900-FAFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "F900-FAFF", L"Noto Sans CJK KR", L"ko" }, - { "F900-FAFF", L"Noto Sans CJK JP" }, + { "F900-FAFF", L"Malgun Gothic", L"ko" }, + { "F900-FAFF", L"MS Gothic" }, /* Vertical Forms - FE10-FE1F */ - { "FE10-FE1F", L"Noto Sans CJK SC", L"zh-Hans" }, - { "FE10-FE1F", L"Noto Sans CJK KR", L"ko" }, + { "FE10-FE1F", L"Microsoft YaHei", L"zh-Hans" }, + { "FE10-FE1F", L"Malgun Gothic", L"ko" }, { "FE10-FE1F", L"Noto Sans CJK TC" }, /* CJK Compatibility Forms - FE30-FE4F Small Form Variants - FE50-FE6F */ - { "FE30-FE6F", L"Noto Sans CJK SC", L"zh-Hans" }, - { "FE30-FE6F", L"Noto Sans CJK KR", L"ko" }, - { "FE30-FE6F", L"Noto Sans CJK JP", L"ja" }, + { "FE30-FE6F", L"Microsoft YaHei", L"zh-Hans" }, + { "FE30-FE6F", L"Malgun Gothic", L"ko" }, + { "FE30-FE6F", L"MS Gothic", L"ja" }, { "FE30-FE6F", L"Noto Sans CJK TC" }, /* Halfwidth and Fullwidth Forms */ - { "FF00-FFEF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "FF00-FFEF", L"Microsoft YaHei", L"zh-Hans" }, { "FF00-FFEF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "FF00-FFEF", L"Noto Sans CJK KR", L"ko" }, - { "FF00-FFEF", L"Noto Sans CJK JP" }, + { "FF00-FFEF", L"Malgun Gothic", L"ko" }, + { "FF00-FFEF", L"MS Gothic" }, }; struct text_source_context diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 0a6111fff25..a85fea13b54 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -612,7 +612,7 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1], print_buf[200], localized_pagefile_fmt[200]; DWORD_PTR args[2]; - hr = add_ui4_property(node, L"dwDirectXVersionMajor", 9); + hr = add_ui4_property(node, L"dwDirectXVersionMajor", 12); if (FAILED(hr)) return hr; @@ -620,15 +620,15 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionLetter", L"c"); + hr = add_bstr_property(node, L"szDirectXVersionLetter", L" "); if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionEnglish", L"4.09.0000.0904"); + hr = add_bstr_property(node, L"szDirectXVersionEnglish", L""); if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionLongEnglish", L"= \"DirectX 9.0c (4.09.0000.0904)"); + hr = add_bstr_property(node, L"szDirectXVersionLongEnglish", L"DirectX 12"); if (FAILED(hr)) return hr; diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c index 552e24b4b97..dfbc61739cc 100644 --- a/dlls/evr/presenter.c +++ b/dlls/evr/presenter.c @@ -2132,7 +2132,7 @@ static HRESULT video_presenter_init_d3d(struct video_presenter *presenter) present_params.Flags = D3DPRESENTFLAG_VIDEO; present_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, GetDesktopWindow(), - D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_params, &device); + D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &present_params, &device); IDirect3D9_Release(d3d); diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 0ad47111eaa..44783e3600a 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -79,6 +79,7 @@ @ stdcall D3DKMTCreateDevice(ptr) win32u.NtGdiDdDDICreateDevice @ stdcall D3DKMTDestroyDCFromMemory(ptr) win32u.NtGdiDdDDIDestroyDCFromMemory @ stdcall D3DKMTDestroyDevice(ptr) win32u.NtGdiDdDDIDestroyDevice +@ stdcall D3DKMTEnumAdapters2(ptr) @ stdcall D3DKMTEscape(ptr) win32u.NtGdiDdDDIEscape @ stdcall D3DKMTOpenAdapterFromDeviceName(ptr) win32u.NtGdiDdDDIOpenAdapterFromDeviceName @ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c index 070ce9c3885..bddc29a3007 100644 --- a/dlls/gdi32/objects.c +++ b/dlls/gdi32/objects.c @@ -971,6 +971,12 @@ NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDI return status; } +NTSTATUS WINAPI D3DKMTEnumAdapters2( const void *param ) +{ + FIXME( "param %p stub.\n", param ); + return STATUS_NOT_SUPPORTED; +} + /*********************************************************************** * SetObjectOwner (GDI32.@) */ diff --git a/dlls/gdiplus/Makefile.in b/dlls/gdiplus/Makefile.in index 382033be901..76474f2e086 100644 --- a/dlls/gdiplus/Makefile.in +++ b/dlls/gdiplus/Makefile.in @@ -1,6 +1,6 @@ MODULE = gdiplus.dll IMPORTLIB = gdiplus -IMPORTS = uuid shlwapi ole32 oleaut32 user32 gdi32 +IMPORTS = uuid shlwapi ole32 oleaut32 user32 gdi32 mlang DELAYIMPORTS = windowscodecs SOURCES = \ diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 0dcfad34bbb..67d75ed97f6 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -1037,13 +1037,13 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamil stat = GdipCreateFontFamilyFromName(L"Microsoft Sans Serif", NULL, nativeFamily); if (stat == FontFamilyNotFound) - stat = GdipCreateFontFamilyFromName(L"Arial", NULL, nativeFamily); + stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, nativeFamily); if (stat == FontFamilyNotFound) - stat = GdipCreateFontFamilyFromName(L"Liberation Sans", NULL, nativeFamily); + stat = GdipCreateFontFamilyFromName(L"Arial", NULL, nativeFamily); if (stat == FontFamilyNotFound) - stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, nativeFamily); + stat = GdipCreateFontFamilyFromName(L"Liberation Sans", NULL, nativeFamily); return stat; } @@ -1385,12 +1385,13 @@ static WCHAR *copy_name_table_string( const tt_name_record *name, const BYTE *da static WCHAR *load_ttf_name_id( const BYTE *mem, DWORD_PTR size, DWORD id ) { + static const WORD platform_id_table[] = {TT_PLATFORM_MICROSOFT, TT_PLATFORM_MACINTOSH, TT_PLATFORM_APPLE_UNICODE}; LANGID lang = GetSystemDefaultLangID(); const tt_header *header; const tt_name_table *name_table; - const tt_name_record *name_record; + const tt_name_record *name_record_table, *name_record; DWORD pos, ofs = 0, count; - int i, res, best_lang = 0, best_index = -1; + int i, j, res, best_lang = 0, best_index = -1; if (sizeof(tt_header) > size) return NULL; @@ -1421,26 +1422,33 @@ static WCHAR *load_ttf_name_id( const BYTE *mem, DWORD_PTR size, DWORD id ) if (pos > size) return NULL; name_table = (const tt_name_table*)&mem[ofs]; + name_record_table = (const tt_name_record *)&mem[pos]; count = GET_BE_WORD(name_table->count); if (GET_BE_WORD(name_table->string_offset) >= size - ofs) return NULL; ofs += GET_BE_WORD(name_table->string_offset); - for (i=0; i size) - return NULL; + for (j = 0; j < count; j++) + { + name_record = name_record_table + j; + if ((const BYTE *)name_record - mem > size) + return NULL; - if (GET_BE_WORD(name_record->name_id) != id) continue; - if (GET_BE_WORD(name_record->offset) >= size - ofs) return NULL; - if (GET_BE_WORD(name_record->length) > size - ofs - GET_BE_WORD(name_record->offset)) return NULL; + if (GET_BE_WORD(name_record->platform_id) != platform_id_table[i]) continue; + if (GET_BE_WORD(name_record->name_id) != id) continue; + if (GET_BE_WORD(name_record->offset) >= size - ofs) return NULL; + if (GET_BE_WORD(name_record->length) > size - ofs - GET_BE_WORD(name_record->offset)) return NULL; - res = match_name_table_language( name_record, lang ); - if (res > best_lang) - { - best_lang = res; - best_index = i; + res = match_name_table_language(name_record, lang); + if (res > best_lang) + { + best_lang = res; + best_index = j; + } } + + if (best_index != -1) + break; } if (best_lang) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 6f7e72124c2..0b302a405ea 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -127,6 +127,10 @@ extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, REAL tension, REAL *x, REAL *y); +extern void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, + GDIPCONST GpStringFormat *format, HFONT *hfont, + LOGFONTW *lfw_return, GDIPCONST GpMatrix *matrix); + extern void free_installed_fonts(void); extern BOOL lengthen_path(GpPath *path, INT len); @@ -606,13 +610,38 @@ static inline const void *buffer_read(struct memory_buffer *mbuf, INT size) return NULL; } -typedef GpStatus (*gdip_format_string_callback)(HDC hdc, - GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, - INT lineno, const RectF *bounds, INT *underlined_indexes, - INT underlined_index_count, void *user_data); +/* Represents a string section and the font it should use. */ +struct gdip_font_link_section { + struct list entry; + DWORD start; /* The starting index of the string where the font applies. */ + DWORD end; /* The end index of the string. */ + GpFont *font; +}; + +struct gdip_font_link_info { + GDIPCONST GpFont *base_font; + struct list sections; +}; + +struct gdip_format_string_info { + GpGraphics *graphics; + HDC hdc; + GDIPCONST WCHAR *string; + INT index; + INT length; + struct gdip_font_link_info font_link_info; + GDIPCONST RectF *rect; + GDIPCONST GpStringFormat *format; + INT lineno; + const RectF *bounds; + INT *underlined_indexes; + INT underlined_index_count; + void *user_data; +}; + +typedef GpStatus (*gdip_format_string_callback)(struct gdip_format_string_info *info); -GpStatus gdip_format_string(HDC hdc, +GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data); diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5101378d0e1..ce852e7c940 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -34,6 +34,7 @@ #include "winreg.h" #include "shlwapi.h" +#include "mlang.h" #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" @@ -2295,7 +2296,7 @@ void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf) lstrcpyW(lf->lfFaceName, font->family->FamilyName); } -static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, +void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, HFONT *hfont, LOGFONTW *lfw_return, GDIPCONST GpMatrix *matrix) { @@ -5161,7 +5162,110 @@ GpStatus WINGDIPAPI GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y, INT w return GdipIsVisibleRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, result); } -GpStatus gdip_format_string(HDC hdc, +/* Populates gdip_font_link_info struct based on the base_font and input string */ +static void generate_font_link_info(struct gdip_format_string_info *info, DWORD length, GDIPCONST GpFont *base_font) +{ + IUnknown *unk; + IMLangFontLink *iMLFL; + GpFont *gpfont; + HFONT map_hfont, hfont, old_font; + LONG processed, progress = 0; + struct gdip_font_link_section *section; + DWORD font_codepages, string_codepages; + + list_init(&info->font_link_info.sections); + info->font_link_info.base_font = base_font; + + GetGlobalFontLinkObject((void**)&unk); + IUnknown_QueryInterface(unk, &IID_IMLangFontLink, (void**)&iMLFL); + IUnknown_Release(unk); + + get_font_hfont(info->graphics, base_font, NULL, &hfont, NULL, NULL); + IMLangFontLink_GetFontCodePages(iMLFL, info->hdc, hfont, &font_codepages); + + while (progress < length) + { + section = calloc(1, sizeof(*section)); + section->start = progress; + IMLangFontLink_GetStrCodePages(iMLFL, &info->string[progress], length - progress, + font_codepages, &string_codepages, &processed); + + if (font_codepages & string_codepages) + { + section->font = (GpFont *)base_font; + } + else + { + IMLangFontLink_MapFont(iMLFL, info->hdc, string_codepages, hfont, &map_hfont); + old_font = SelectObject(info->hdc, map_hfont); + GdipCreateFontFromDC(info->hdc, &gpfont); + SelectObject(info->hdc, old_font); + IMLangFontLink_ReleaseFont(iMLFL, map_hfont); + section->font = gpfont; + } + + section->end = section->start + processed; + list_add_tail(&info->font_link_info.sections, §ion->entry); + progress += processed; + } + + DeleteObject(hfont); + IMLangFontLink_Release(iMLFL); +} + +static void font_link_get_text_extent_point(struct gdip_format_string_info *info, + INT index, int length, int max_ext, LPINT fit, SIZE *size) +{ + DWORD to_measure_length; + HFONT hfont, oldhfont; + SIZE sizeaux = { 0 }; + int i = index, fitaux = 0; + struct gdip_font_link_section *section; + + size->cx = 0; + size->cy = 0; + + if (fit) + *fit = 0; + + LIST_FOR_EACH_ENTRY(section, &info->font_link_info.sections, struct gdip_font_link_section, entry) + { + if (i >= section->end) continue; + + to_measure_length = min(length - (i - index), section->end - i); + + get_font_hfont(info->graphics, section->font, NULL, &hfont, NULL, NULL); + oldhfont = SelectObject(info->hdc, hfont); + GetTextExtentExPointW(info->hdc, &info->string[i], to_measure_length, max_ext, &fitaux, NULL, &sizeaux); + SelectObject(info->hdc, oldhfont); + DeleteObject(hfont); + + max_ext -= sizeaux.cx; + if (fit) + *fit += fitaux; + size->cx += sizeaux.cx; + size->cy = max(size->cy, sizeaux.cy); + + i += to_measure_length; + if ((i - index) >= length || fitaux < to_measure_length) break; + } +} + +static void release_font_link_info(struct gdip_font_link_info *font_link_info) +{ + struct list *entry; + + while ((entry = list_head(&font_link_info->sections))) + { + struct gdip_font_link_section *section = LIST_ENTRY(entry, struct gdip_font_link_section, entry); + list_remove(entry); + if (section->font != font_link_info->base_font) + GdipDeleteFont(section->font); + free(section); + } +} + +GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data) @@ -5178,15 +5282,26 @@ GpStatus gdip_format_string(HDC hdc, INT hotkeyprefix_count=0; INT hotkeyprefix_pos=0, hotkeyprefix_end_pos=0; BOOL seen_prefix = FALSE, unixstyle_newline = TRUE; + struct gdip_format_string_info info; + + info.graphics = graphics; + info.hdc = hdc; + info.rect = rect; + info.bounds = &bounds; + info.user_data = user_data; if(length == -1) length = lstrlenW(string); stringdup = calloc(length + 1, sizeof(WCHAR)); if(!stringdup) return OutOfMemory; + info.string = stringdup; + if (!format) format = &default_drawstring_format; + info.format = format; + nwidth = (int)(rect->Width + 0.005f); nheight = (int)(rect->Height + 0.005f); if (ignore_empty_clip) @@ -5242,9 +5357,10 @@ GpStatus gdip_format_string(HDC hdc, halign = format->align; + generate_font_link_info(&info, length, font); + while(sum < length){ - GetTextExtentExPointW(hdc, stringdup + sum, length - sum, - nwidth, &fit, NULL, &size); + font_link_get_text_extent_point(&info, sum, length - sum, nwidth, &fit, &size); fitcpy = fit; if(fit == 0) @@ -5292,8 +5408,7 @@ GpStatus gdip_format_string(HDC hdc, else lineend = fit; - GetTextExtentExPointW(hdc, stringdup + sum, lineend, - nwidth, &j, NULL, &size); + font_link_get_text_extent_point(&info, sum, lineend, nwidth, &j, &size); bounds.Width = size.cx; @@ -5326,10 +5441,13 @@ GpStatus gdip_format_string(HDC hdc, if (hotkeyprefix_offsets[hotkeyprefix_end_pos] >= sum + lineend) break; - stat = callback(hdc, stringdup, sum, lineend, - font, rect, format, lineno, &bounds, - &hotkeyprefix_offsets[hotkeyprefix_pos], - hotkeyprefix_end_pos-hotkeyprefix_pos, user_data); + info.index = sum; + info.length = lineend; + info.lineno = lineno; + info.underlined_indexes = &hotkeyprefix_offsets[hotkeyprefix_pos]; + info.underlined_index_count = hotkeyprefix_end_pos-hotkeyprefix_pos; + + stat = callback(&info); if (stat != Ok) break; @@ -5358,6 +5476,7 @@ GpStatus gdip_format_string(HDC hdc, break; } + release_font_link_info(&info.font_link_info); free(stringdup); free(hotkeyprefix_offsets); @@ -5392,35 +5511,30 @@ struct measure_ranges_args { REAL rel_width, rel_height; }; -static GpStatus measure_ranges_callback(HDC hdc, - GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, - INT lineno, const RectF *bounds, INT *underlined_indexes, - INT underlined_index_count, void *user_data) +static GpStatus measure_ranges_callback(struct gdip_format_string_info *info) { int i; GpStatus stat = Ok; - struct measure_ranges_args *args = user_data; + struct measure_ranges_args *args = info->user_data; + CharacterRange *ranges = info->format->character_ranges; - for (i=0; irange_count; i++) + for (i=0; i < info->format->range_count; i++) { - INT range_start = max(index, format->character_ranges[i].First); - INT range_end = min(index+length, format->character_ranges[i].First+format->character_ranges[i].Length); + INT range_start = max(info->index, ranges[i].First); + INT range_end = min(info->index + info->length, ranges[i].First + ranges[i].Length); if (range_start < range_end) { GpRectF range_rect; SIZE range_size; - range_rect.Y = bounds->Y / args->rel_height; - range_rect.Height = bounds->Height / args->rel_height; + range_rect.Y = info->bounds->Y / args->rel_height; + range_rect.Height = info->bounds->Height / args->rel_height; - GetTextExtentExPointW(hdc, string + index, range_start - index, - INT_MAX, NULL, NULL, &range_size); - range_rect.X = (bounds->X + range_size.cx) / args->rel_width; + font_link_get_text_extent_point(info, info->index, range_start - info->index, INT_MAX, NULL, &range_size); + range_rect.X = (info->bounds->X + range_size.cx) / args->rel_width; - GetTextExtentExPointW(hdc, string + index, range_end - index, - INT_MAX, NULL, NULL, &range_size); - range_rect.Width = (bounds->X + range_size.cx) / args->rel_width - range_rect.X; + font_link_get_text_extent_point(info, info->index, range_end - info->index, INT_MAX, NULL, &range_size); + range_rect.Width = (info->bounds->X + range_size.cx) / args->rel_width - range_rect.X; stat = GdipCombineRegionRect(args->regions[i], &range_rect, CombineModeUnion); if (stat != Ok) @@ -5496,7 +5610,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, gdi_transform_acquire(graphics); - stat = gdip_format_string(hdc, string, length, font, &scaled_rect, stringFormat, + stat = gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, stringFormat, (stringFormat->attr & StringFormatFlagsNoClip) != 0, measure_ranges_callback, &args); gdi_transform_release(graphics); @@ -5517,17 +5631,13 @@ struct measure_string_args { REAL rel_width, rel_height; }; -static GpStatus measure_string_callback(HDC hdc, - GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, - INT lineno, const RectF *bounds, INT *underlined_indexes, - INT underlined_index_count, void *user_data) +static GpStatus measure_string_callback(struct gdip_format_string_info *info) { - struct measure_string_args *args = user_data; + struct measure_string_args *args = info->user_data; REAL new_width, new_height; - new_width = bounds->Width / args->rel_width; - new_height = (bounds->Height + bounds->Y) / args->rel_height - args->bounds->Y; + new_width = info->bounds->Width / args->rel_width; + new_height = (info->bounds->Height + info->bounds->Y) / args->rel_height - args->bounds->Y; if (new_width > args->bounds->Width) args->bounds->Width = new_width; @@ -5536,7 +5646,7 @@ static GpStatus measure_string_callback(HDC hdc, args->bounds->Height = new_height; if (args->codepointsfitted) - *args->codepointsfitted = index + length; + *args->codepointsfitted = info->index + info->length; if (args->linesfilled) (*args->linesfilled)++; @@ -5567,6 +5677,15 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, if(!graphics || !string || !font || !rect || !bounds) return InvalidParameter; + if (length == 1 && string[0] == '\n') + { + /* Proton hack for SpriteFontX class used by TouHou Makuka Sai. + * Returned size is passed to Bitmap constructor, but we currently measure "\n" as zero size. */ + char const *sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "882710") || !strcmp(sgi, "1031480"))) + string = L" "; + } + if(!graphics->hdc) { hdc = temp_hdc = CreateCompatibleDC(0); @@ -5610,7 +5729,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, gdi_transform_acquire(graphics); - gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE, + gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE, measure_string_callback, &args); gdi_transform_release(graphics); @@ -5631,52 +5750,62 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, } struct draw_string_args { - GpGraphics *graphics; GDIPCONST GpBrush *brush; REAL x, y, rel_width, rel_height, ascent; }; -static GpStatus draw_string_callback(HDC hdc, - GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, - INT lineno, const RectF *bounds, INT *underlined_indexes, - INT underlined_index_count, void *user_data) +static GpStatus draw_string_callback(struct gdip_format_string_info *info) { - struct draw_string_args *args = user_data; + struct draw_string_args *args = info->user_data; + int i = info->index; PointF position; - GpStatus stat; + SIZE size; + DWORD to_draw_length; + struct gdip_font_link_section *section; + GpStatus stat = Ok; - position.X = args->x + bounds->X / args->rel_width; - position.Y = args->y + bounds->Y / args->rel_height + args->ascent; + position.X = args->x + info->bounds->X / args->rel_width; + position.Y = args->y + info->bounds->Y / args->rel_height + args->ascent; - stat = draw_driver_string(args->graphics, &string[index], length, font, format, - args->brush, &position, - DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, NULL); + LIST_FOR_EACH_ENTRY(section, &info->font_link_info.sections, struct gdip_font_link_section, entry) + { + if (i >= section->end) continue; + + to_draw_length = min(info->length - (i - info->index), section->end - i); + TRACE("index %d, todraw %ld, used %s\n", i, to_draw_length, section->font == info->font_link_info.base_font ? "base font" : "map"); + font_link_get_text_extent_point(info, i, to_draw_length, 0, NULL, &size); + stat = draw_driver_string(info->graphics, &info->string[i], to_draw_length, + section->font, info->format, args->brush, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, NULL); + position.X += size.cx / args->rel_width; + i += to_draw_length; + if (stat != Ok || (i - info->index) >= info->length) break; + } - if (stat == Ok && underlined_index_count) + if (stat == Ok && info->underlined_index_count) { OUTLINETEXTMETRICW otm; REAL underline_y, underline_height; int i; - GetOutlineTextMetricsW(hdc, sizeof(otm), &otm); + GetOutlineTextMetricsW(info->hdc, sizeof(otm), &otm); underline_height = otm.otmsUnderscoreSize / args->rel_height; underline_y = position.Y - otm.otmsUnderscorePosition / args->rel_height - underline_height / 2; - for (i=0; iunderlined_index_count; i++) { REAL start_x, end_x; SIZE text_size; - INT ofs = underlined_indexes[i] - index; + INT ofs = info->underlined_indexes[i] - info->index; - GetTextExtentExPointW(hdc, string + index, ofs, INT_MAX, NULL, NULL, &text_size); + font_link_get_text_extent_point(info, info->index, ofs, INT_MAX, NULL, &text_size); start_x = text_size.cx / args->rel_width; - GetTextExtentExPointW(hdc, string + index, ofs+1, INT_MAX, NULL, NULL, &text_size); + font_link_get_text_extent_point(info, info->index, ofs+1, INT_MAX, NULL, &text_size); end_x = text_size.cx / args->rel_width; - GdipFillRectangle(args->graphics, (GpBrush*)args->brush, position.X+start_x, underline_y, end_x-start_x, underline_height); + GdipFillRectangle(info->graphics, (GpBrush*)args->brush, position.X+start_x, underline_y, end_x-start_x, underline_height); } } @@ -5774,7 +5903,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string get_font_hfont(graphics, font, format, &gdifont, NULL, NULL); SelectObject(hdc, gdifont); - args.graphics = graphics; args.brush = brush; args.x = rect->X; @@ -5788,7 +5916,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string GetTextMetricsW(hdc, &textmetric); args.ascent = textmetric.tmAscent / rel_height; - gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE, + gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE, draw_string_callback, &args); gdi_transform_release(graphics); diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 24c2888cfe8..38a195a1371 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -949,33 +949,48 @@ struct format_string_args float ascent; }; -static GpStatus format_string_callback(HDC dc, - GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, - INT lineno, const RectF *bounds, INT *underlined_indexes, - INT underlined_index_count, void *priv) +static GpStatus format_string_callback(struct gdip_format_string_info* info) { static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; - struct format_string_args *args = priv; + struct format_string_args *args = info->user_data; + struct gdip_font_link_section *section = LIST_ENTRY(list_head(&info->font_link_info.sections), struct gdip_font_link_section, entry); + HFONT hfont = NULL, oldhfont = NULL; + int section_start = -1; GpPath *path = args->path; GpStatus status = Ok; - float x = rect->X + (bounds->X - rect->X) * args->scale; - float y = rect->Y + (bounds->Y - rect->Y) * args->scale; + float x = info->rect->X + (info->bounds->X - info->rect->X) * args->scale; + float y = info->rect->Y + (info->bounds->Y - info->rect->Y) * args->scale; int i; - if (underlined_index_count) + if (info->underlined_index_count) FIXME("hotkey underlines not drawn yet\n"); - if (y + bounds->Height * args->scale > args->maxY) - args->maxY = y + bounds->Height * args->scale; + if (y + info->bounds->Height * args->scale > args->maxY) + args->maxY = y + info->bounds->Height * args->scale; - for (i = index; i < length + index; ++i) + for (i = info->index; i < info->length + info->index; ++i) { GLYPHMETRICS gm; TTPOLYGONHEADER *ph = NULL, *origph; char *start; DWORD len, ofs = 0; - len = GetGlyphOutlineW(dc, string[i], GGO_BEZIER, &gm, 0, NULL, &identity); + + while (i >= section->end) + section = LIST_ENTRY(list_next(&info->font_link_info.sections, §ion->entry), struct gdip_font_link_section, entry); + + if (section_start != section->start) + { + if (hfont) + { + SelectObject(info->hdc, oldhfont); + DeleteObject(hfont); + } + get_font_hfont(info->graphics, section->font, NULL, &hfont, NULL, NULL); + oldhfont = SelectObject(info->hdc, hfont); + section_start = section->start; + } + + len = GetGlyphOutlineW(info->hdc, info->string[i], GGO_BEZIER, &gm, 0, NULL, &identity); if (len == GDI_ERROR) { status = GenericError; @@ -989,7 +1004,7 @@ static GpStatus format_string_callback(HDC dc, status = OutOfMemory; break; } - GetGlyphOutlineW(dc, string[i], GGO_BEZIER, &gm, len, start, &identity); + GetGlyphOutlineW(info->hdc, info->string[i], GGO_BEZIER, &gm, len, start, &identity); ofs = 0; while (ofs < len) @@ -1041,6 +1056,12 @@ static GpStatus format_string_callback(HDC dc, break; } + if (hfont) + { + SelectObject(info->hdc, oldhfont); + DeleteObject(hfont); + } + return status; } @@ -1097,8 +1118,6 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT } get_log_fontW(font, graphics, &lfw); - GdipDeleteFont(font); - GdipDeleteGraphics(graphics); hfont = CreateFontIndirectW(&lfw); if (!hfont) @@ -1106,6 +1125,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT WARN("Failed to create font\n"); DeleteDC(dc); GdipDeletePath(backup); + GdipDeleteFont(font); return GenericError; } @@ -1117,11 +1137,13 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT args.maxY = 0; args.scale = emSize / native_height; args.ascent = textmetric.tmAscent * args.scale; - status = gdip_format_string(dc, string, length, NULL, &scaled_layout_rect, + status = gdip_format_string(graphics, dc, string, length, font, &scaled_layout_rect, format, TRUE, format_string_callback, &args); DeleteDC(dc); DeleteObject(hfont); + GdipDeleteFont(font); + GdipDeleteGraphics(graphics); if (status != Ok) /* free backup */ { diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 8f0bbce0eb4..1bbb18f4c6d 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -43,11 +43,21 @@ static void set_rect_empty(RectF *rc) rc->Height = 0.0; } +#define load_resource(a, b, c) _load_resource(__LINE__, a, b, c) +static void _load_resource(int line, const WCHAR *filename, BYTE **data, DWORD *size) +{ + HRSRC resource = FindResourceW(NULL, filename, (const WCHAR *)RT_RCDATA); + ok_(__FILE__, line)(!!resource, "FindResourceW failed, error %lu\n", GetLastError()); + *data = LockResource(LoadResource(GetModuleHandleW(NULL), resource)); + ok_(__FILE__, line)(!!*data, "LockResource failed, error %lu\n", GetLastError()); + *size = SizeofResource(GetModuleHandleW(NULL), resource); + ok_(__FILE__, line)(*size > 0, "SizeofResource failed, error %lu\n", GetLastError()); +} + static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW[MAX_PATH]) { - DWORD written; + DWORD written, length; HANDLE file; - HRSRC res; void *ptr; GetTempPathW(MAX_PATH, pathW); @@ -56,11 +66,9 @@ static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW), GetLastError()); - res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(resource), (LPCSTR)RT_RCDATA); - ok(res != 0, "couldn't find resource\n"); - ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res)); - WriteFile(file, ptr, SizeofResource(GetModuleHandleA(NULL), res), &written, NULL); - ok(written == SizeofResource(GetModuleHandleA(NULL), res), "couldn't write resource\n"); + load_resource(MAKEINTRESOURCEW(resource), (BYTE **)&ptr, &length); + WriteFile(file, ptr, length, &written, NULL); + ok(written == length, "couldn't write resource\n"); CloseHandle(file); } @@ -1524,6 +1532,46 @@ static void test_CloneFont(void) GdipDeleteFontFamily(family); } +static void test_GdipPrivateAddMemoryFont(void) +{ + static const WORD resource_ids[] = + { + 3, /* A font that has an invalid full name on Mac platform and a valid full name on Microsoft platform */ + 4, /* A font that has an invalid full name on Unicode platform and a valid full name on Mac platform */ + }; + GpFontCollection *fonts; + GpStatus stat; + int count, i; + void *buffer; + DWORD size; + + for (i = 0; i < ARRAY_SIZE(resource_ids); i++) + { + winetest_push_context("test %d", i); + + stat = GdipNewPrivateFontCollection(&fonts); + ok(stat == Ok, "GdipNewPrivateFontCollection failed, error %d\n", stat); + + load_resource(MAKEINTRESOURCEW(resource_ids[i]), (BYTE **)&buffer, &size); + stat = GdipPrivateAddMemoryFont(fonts, buffer, size); + if (stat == Ok) + { + stat = GdipGetFontCollectionFamilyCount(fonts, &count); + ok(stat == Ok, "GdipGetFontCollectionFamilyCount failed, error %d\n", stat); + ok(count == 1, "Expected count 1, got %d\n", count); + } + else if (i == 1 && stat == FileNotFound) + win_skip("Fonts without Microsoft platform names are unsupported on win7.\n"); + else + ok(0, "GdipPrivateAddMemoryFont failed, error %d\n", stat); + + stat = GdipDeletePrivateFontCollection(&fonts); + ok(stat == Ok, "GdipDeletePrivateFontCollection failed, error %d\n", stat); + + winetest_pop_context(); + } +} + START_TEST(font) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1558,6 +1606,7 @@ START_TEST(font) test_heightgivendpi(); test_GdipGetFontCollectionFamilyList(); test_GdipGetFontCollectionFamilyCount(); + test_GdipPrivateAddMemoryFont(); GdiplusShutdown(gdiplusToken); } diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index d71bc78c2ae..18fe1078e76 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -2305,10 +2305,29 @@ static void test_GdipDrawString(void) } expect(Ok, status); - status = GdipCreateSolidFill((ARGB)0xdeadbeef, (GpSolidFill**)&brush); + status = GdipCreateStringFormat(0,0,&format); expect(Ok, status); - status = GdipCreateStringFormat(0,0,&format); + if (winetest_interactive) + { + status = GdipCreateSolidFill(0xFF000000, (GpSolidFill**)&brush); + expect(Ok, status); + rect.X = 0; + rect.Y = 0; + rect.Width = 0; + rect.Height = 14; + GdipRotateWorldTransform(graphics, 45, MatrixOrderPrepend); + GdipScaleWorldTransform(graphics, 2, 2, MatrixOrderPrepend); + GdipGraphicsClear(graphics, 0xFFFFFFFF); + status = GdipDrawString(graphics, L"\u8336Hola\u8336", 6, fnt, &rect, format, brush); + expect(Ok, status); + RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); /* FIXME: In Windows this test works without this line. */ + Sleep(4000); + GdipDeleteBrush(brush); + GdipResetWorldTransform(graphics); + } + + status = GdipCreateSolidFill((ARGB)0xdeadbeef, (GpSolidFill**)&brush); expect(Ok, status); rect.X = 0; diff --git a/dlls/gdiplus/tests/resource.rc b/dlls/gdiplus/tests/resource.rc index 2db8d6359ea..4af61fef65d 100644 --- a/dlls/gdiplus/tests/resource.rc +++ b/dlls/gdiplus/tests/resource.rc @@ -23,3 +23,11 @@ /* @makedep: wine_testfont0.ttf */ 2 RCDATA wine_testfont0.ttf + +/* Generated with: fonttools ttx wine_mac_win.ttx */ +/* @makedep: wine_mac_win.ttf */ +3 RCDATA wine_mac_win.ttf + +/* Generated with: fonttools ttx wine_unicode_mac.ttx */ +/* @makedep: wine_unicode_mac.ttf */ +4 RCDATA wine_unicode_mac.ttf diff --git a/dlls/gdiplus/tests/wine_mac_win.ttf b/dlls/gdiplus/tests/wine_mac_win.ttf new file mode 100644 index 00000000000..0a0493134de Binary files /dev/null and b/dlls/gdiplus/tests/wine_mac_win.ttf differ diff --git a/dlls/gdiplus/tests/wine_mac_win.ttx b/dlls/gdiplus/tests/wine_mac_win.ttx new file mode 100644 index 00000000000..c85a8abd50b --- /dev/null +++ b/dlls/gdiplus/tests/wine_mac_win.ttx @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2024 Zhiyi Zhang for CodeWeavers + + + wine_mac_win + + + Regular + + + wine_mac_win + + + invalid_full_name + + + Version 1.0 + + + wine_mac_win + + + Copyright (c) 2024 Zhiyi Zhang for CodeWeavers + + + wine_mac_win + + + Regular + + + wine_mac_win + + + wine_mac_win + + + Version 1.0 + + + wine_mac_win + + + + diff --git a/dlls/gdiplus/tests/wine_unicode_mac.ttf b/dlls/gdiplus/tests/wine_unicode_mac.ttf new file mode 100644 index 00000000000..4c0af94ade4 Binary files /dev/null and b/dlls/gdiplus/tests/wine_unicode_mac.ttf differ diff --git a/dlls/gdiplus/tests/wine_unicode_mac.ttx b/dlls/gdiplus/tests/wine_unicode_mac.ttx new file mode 100644 index 00000000000..377b4b3d4ed --- /dev/null +++ b/dlls/gdiplus/tests/wine_unicode_mac.ttx @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2024 Zhiyi Zhang for CodeWeavers + + + wine_unicode_mac + + + Regular + + + wine_unicode_mac + + + invalid_full_name + + + Version 1.0 + + + wine_unicode_mac + + + Copyright (c) 2024 Zhiyi Zhang for CodeWeavers + + + wine_unicode_mac + + + Regular + + + wine_unicode_mac + + + wine_unicode_mac + + + Version 1.0 + + + wine_unicode_mac + + + + diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 8fde1fe10a5..135e58bf587 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -223,6 +223,7 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack const BOOL polled = ext->u.pdo.information.Polled; ULONG size, report_len = polled ? packet->reportBufferLen : desc->InputLength; struct hid_report *last_report, *report; + BOOL steam_overlay_open = FALSE; struct hid_queue *queue; LIST_ENTRY completed, *entry; RAWINPUT *rawinput; @@ -231,7 +232,11 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack TRACE("device %p, packet %p\n", device, packet); - if (IsEqualGUID( ext->class_guid, &GUID_DEVINTERFACE_HID )) + if (WaitForSingleObject(ext->steam_overlay_event, 0) == WAIT_OBJECT_0 || /* steam overlay is open */ + WaitForSingleObject(ext->steam_keyboard_event, 0) == WAIT_OBJECT_0) /* steam keyboard is open */ + steam_overlay_open = TRUE; + + if (IsEqualGUID( ext->class_guid, &GUID_DEVINTERFACE_HID ) && !steam_overlay_open) { size = offsetof( RAWINPUT, data.hid.bRawData[report_len] ); if (!(rawinput = malloc( size ))) ERR( "Failed to allocate rawinput data!\n" ); @@ -385,6 +390,8 @@ struct device_strings static const struct device_strings device_strings[] = { + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + { .id = L"VID_28DE&PID_11FF", .product = L"Controller (XBOX 360 For Windows)" }, /* Microsoft controllers */ { .id = L"VID_045E&PID_028E", .product = L"Controller (XBOX 360 For Windows)" }, { .id = L"VID_045E&PID_028F", .product = L"Controller (XBOX 360 For Windows)" }, diff --git a/dlls/hidclass.sys/hid.h b/dlls/hidclass.sys/hid.h index 3eefbf87f63..e9bd85612fa 100644 --- a/dlls/hidclass.sys/hid.h +++ b/dlls/hidclass.sys/hid.h @@ -84,6 +84,9 @@ typedef struct _BASE_DEVICE_EXTENSION WCHAR container_id[MAX_GUID_STRING_LEN]; const GUID *class_guid; + HANDLE steam_overlay_event; + HANDLE steam_keyboard_event; + BOOL is_fdo; } BASE_DEVICE_EXTENSION; @@ -115,6 +118,9 @@ typedef struct _minidriver PDRIVER_ADD_DEVICE AddDevice; PDRIVER_DISPATCH PNPDispatch; + + HANDLE steam_overlay_event; + HANDLE steam_keyboard_event; } minidriver; void call_minidriver( ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index ab3cd5b2cb5..317bee640d7 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -178,6 +178,9 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b if (get_device_id(bus_pdo, BusQueryContainerID, ext->container_id)) ext->container_id[0] = 0; + ext->steam_overlay_event = minidriver->steam_overlay_event; + ext->steam_keyboard_event = minidriver->steam_keyboard_event; + is_xinput_class = !wcsncmp(device_id, L"WINEXINPUT\\", 7) && wcsstr(device_id, L"&XI_") != NULL; if (is_xinput_class) ext->class_guid = &GUID_DEVINTERFACE_WINEXINPUT; else ext->class_guid = &GUID_DEVINTERFACE_HID; @@ -242,6 +245,9 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) pdo_ext->u.pdo.information.VersionNumber = attr.VersionNumber; pdo_ext->u.pdo.information.Polled = minidriver->minidriver.DevicesArePolled; + pdo_ext->steam_overlay_event = minidriver->steam_overlay_event; + pdo_ext->steam_keyboard_event = minidriver->steam_keyboard_event; + call_minidriver( IOCTL_HID_GET_DEVICE_DESCRIPTOR, fdo, NULL, 0, &descriptor, sizeof(descriptor), &io ); if (io.Status != STATUS_SUCCESS) { @@ -591,6 +597,9 @@ static void WINAPI driver_unload(DRIVER_OBJECT *driver) if (md->DriverUnload) md->DriverUnload(md->minidriver.DriverObject); list_remove(&md->entry); + + CloseHandle(md->steam_overlay_event); + CloseHandle(md->steam_keyboard_event); free(md); } } @@ -606,6 +615,9 @@ NTSTATUS WINAPI HidRegisterMinidriver(HID_MINIDRIVER_REGISTRATION *registration) if (!(driver = calloc(1, sizeof(*driver)))) return STATUS_NO_MEMORY; + driver->steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); + driver->steam_keyboard_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_KeyboardActivated"); + driver->DriverUnload = registration->DriverObject->DriverUnload; registration->DriverObject->DriverUnload = driver_unload; diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index 402014a8c07..578bc5af125 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -172,6 +172,7 @@ static HRESULT hr_site_TranslateAccelerator = E_NOTIMPL; static const WCHAR *current_url; static int wb_version, expect_update_commands_enable, set_update_commands_enable; static BOOL nav_back_todo, nav_forward_todo; /* FIXME */ +static BOOL navigation_cancelled; enum SessionOp { @@ -191,6 +192,8 @@ static LONG (WINAPI *pSetQueryNetSessionCount)(DWORD); #define DWL_HTTP 0x10 #define DWL_REFRESH 0x20 #define DWL_BACK_ENABLE 0x40 +#define DWL_IFRAME_NAV_CANCEL 0x80 +#define DWL_FROM_IFRAME_NAV_CANCEL 0x100 static DWORD dwl_flags; @@ -290,6 +293,8 @@ static void _test_ready_state(unsigned line, READYSTATE exstate, VARIANT_BOOL ex hres = IWebBrowser2_get_Busy(wb, &busy); if(expect_busy != BUSY_FAIL) { ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08lx\n", hres); + todo_wine_if(dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL && state == READYSTATE_LOADING + && busy != expect_busy) ok_(__FILE__,line)(busy == expect_busy, "Busy = %x, expected %x for ready state %d\n", busy, expect_busy, state); }else { @@ -415,13 +420,13 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER || !nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); else - ok(!nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); + todo_wine_if(dwl_flags & DWL_IFRAME_NAV_CANCEL) ok(!nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut); ok(pvaIn != NULL, "pvaIn == NULL\n"); ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d\n", V_VT(pvaIn)); switch(V_I4(pvaIn)) { case 0: - CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_0); + todo_wine_if(dwl_flags & DWL_IFRAME_NAV_CANCEL) CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_0); break; case 1: CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_1); @@ -480,6 +485,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { switch(nCmdID) { case 63: /* win10 */ + case 65: case 105: /* TODO */ case 132: /* win10 */ case 133: /* IE11 */ @@ -719,11 +725,11 @@ static void _test_invoke_bool(unsigned line, const DISPPARAMS *params, BOOL stri static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const VARIANT *flags, const VARIANT *frame, const VARIANT *post_data, const VARIANT *headers, const VARIANT *cancel) { + BOOL cancel_nav = FALSE; BSTR str; ok(V_VT(disp) == VT_DISPATCH, "V_VT(disp)=%d, expected VT_DISPATCH\n", V_VT(disp)); ok(V_DISPATCH(disp) != NULL, "V_DISPATCH(disp) == NULL\n"); - ok(V_DISPATCH(disp) == (IDispatch*)wb, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp), wb); ok(V_VT(url) == (VT_BYREF|VT_VARIANT), "V_VT(url)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(url)); ok(V_VARIANTREF(url) != NULL, "V_VARIANTREF(url) == NULL)\n"); @@ -731,10 +737,21 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const ok(V_VT(V_VARIANTREF(url)) == VT_BSTR, "V_VT(V_VARIANTREF(url))=%d, expected VT_BSTR\n", V_VT(V_VARIANTREF(url))); ok(V_BSTR(V_VARIANTREF(url)) != NULL, "V_BSTR(V_VARIANTREF(url)) == NULL\n"); - ok(!lstrcmpW(V_BSTR(V_VARIANTREF(url)), current_url), "unexpected url %s, expected %s\n", - wine_dbgstr_w(V_BSTR(V_VARIANTREF(url))), wine_dbgstr_w(current_url)); + if (!wcscmp(V_BSTR(V_VARIANTREF(url)), L"invalid:///")) + cancel_nav = TRUE; + if (!(dwl_flags & DWL_IFRAME_NAV_CANCEL && cancel_nav)) + ok(!lstrcmpW(V_BSTR(V_VARIANTREF(url)), current_url), "unexpected url %s, expected %s\n", + wine_dbgstr_w(V_BSTR(V_VARIANTREF(url))), wine_dbgstr_w(current_url)); } + if (dwl_flags & DWL_IFRAME_NAV_CANCEL && cancel_nav) + { + ok(!!V_DISPATCH(disp), "Got NULL disp.\n"); + todo_wine ok(V_DISPATCH(disp) != (IDispatch*)wb, "Got the same browser.\n"); + } + else + ok(V_DISPATCH(disp) == (IDispatch*)wb, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp), wb); + ok(V_VT(flags) == (VT_BYREF|VT_VARIANT), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(flags)); ok(V_VT(flags) == (VT_BYREF|VT_VARIANT), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n", @@ -805,8 +822,15 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const V_VT(cancel)); ok(V_BOOLREF(cancel) != NULL, "V_BOOLREF(pDispParams->rgvarg[0] == NULL)\n"); if(V_BOOLREF(cancel)) + { ok(*V_BOOLREF(cancel) == VARIANT_FALSE, "*V_BOOLREF(cancel) = %x, expected VARIANT_FALSE\n", *V_BOOLREF(cancel)); + if (cancel_nav) + { + *V_BOOLREF(cancel) = TRUE; + navigation_cancelled = TRUE; + } + } } static void test_navigatecomplete2(DISPPARAMS *dp) @@ -821,6 +845,7 @@ static void test_navigatecomplete2(DISPPARAMS *dp) ok(V_VT(dp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(dp->rgvarg) = %d\n", V_VT(dp->rgvarg)); v = V_VARIANTREF(dp->rgvarg); ok(V_VT(v) == VT_BSTR, "V_VT(url) = %d\n", V_VT(v)); + todo_wine_if(!memcmp(V_BSTR(v), L"file:", 10)) ok(!lstrcmpW(V_BSTR(v), current_url), "url=%s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), wine_dbgstr_w(current_url)); @@ -845,6 +870,8 @@ static void test_documentcomplete(DISPPARAMS *dp) ok(V_VT(dp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(dp->rgvarg) = %d\n", V_VT(dp->rgvarg)); v = V_VARIANTREF(dp->rgvarg); ok(V_VT(v) == VT_BSTR, "V_VT(url) = %d\n", V_VT(v)); + + todo_wine_if(!memcmp(V_BSTR(v), L"file:", 10)) ok(!lstrcmpW(V_BSTR(v), current_url), "url=%s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), wine_dbgstr_w(current_url)); @@ -907,9 +934,19 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe pDispParams->rgvarg+3, pDispParams->rgvarg+2, pDispParams->rgvarg+1, pDispParams->rgvarg); if(dwl_flags & (DWL_FROM_PUT_HREF|DWL_FROM_GOFORWARD)) + { test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); + } + else if (dwl_flags & DWL_IFRAME_NAV_CANCEL) + { + test_ready_state(READYSTATE_LOADING, navigation_cancelled ? VARIANT_TRUE : VARIANT_FALSE); + if (!navigation_cancelled) + SET_EXPECT(Invoke_BEFORENAVIGATE2); + } else - test_ready_state(READYSTATE_LOADING, VARIANT_FALSE); + { + test_ready_state(READYSTATE_LOADING, dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL ? VARIANT_TRUE : VARIANT_FALSE); + } break; case DISPID_SETSECURELOCKICON: @@ -948,7 +985,7 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe CHECK_EXPECT2(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_FALSE); } } - else if (V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEBACK) + else if (V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEBACK && !(dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL)) { todo_wine_if(nav_back_todo) { if(V_BOOL(pDispParams->rgvarg)) @@ -1681,6 +1718,8 @@ static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, D { todo_wine_if(is_downloading && !(dwl_flags & DWL_EXPECT_BEFORE_NAVIGATE)) CHECK_EXPECT(TranslateUrl); + if (dwl_flags & DWL_IFRAME_NAV_CANCEL && wcscmp(pchURLIn, L"invalid:///")) + SET_EXPECT(TranslateUrl); return E_NOTIMPL; } @@ -2814,12 +2853,16 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init) static void test_Navigate2(IWebBrowser2 *webbrowser, const WCHAR *nav_url) { const WCHAR *title = L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X"; + const WCHAR *file_title = L"wine_test"; VARIANT url; BOOL is_file; HRESULT hres; test_LocationURL(webbrowser, is_first_load ? L"" : current_url); - test_LocationName(webbrowser, is_first_load ? L"" : (is_http ? title : current_url)); + if (current_url && !memcmp(current_url, L"file:", 10)) + test_LocationName(webbrowser, file_title); + else + test_LocationName(webbrowser, is_first_load ? L"" : (is_http ? title : current_url)); test_ready_state(is_first_load ? READYSTATE_UNINITIALIZED : READYSTATE_COMPLETE, VARIANT_FALSE); is_http = !memcmp(nav_url, "http:", 5); @@ -2990,6 +3033,8 @@ static void test_download(DWORD flags) BOOL *b = &called_Invoke_DOCUMENTCOMPLETE; MSG msg; + navigation_cancelled = FALSE; + if(flags & DWL_REFRESH) b = use_container_olecmd ? &called_Exec_SETDOWNLOADSTATE_0 : &called_Invoke_DOWNLOADCOMPLETE; else if((flags & DWL_FROM_PUT_HREF) && !use_container_olecmd && 0) @@ -3001,8 +3046,9 @@ static void test_download(DWORD flags) if(flags & (DWL_FROM_PUT_HREF|DWL_FROM_GOBACK|DWL_FROM_GOFORWARD|DWL_REFRESH)) test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); else - test_ready_state(READYSTATE_LOADING, VARIANT_FALSE); - + { + test_ready_state(READYSTATE_LOADING, flags & DWL_FROM_IFRAME_NAV_CANCEL ? VARIANT_TRUE : VARIANT_FALSE); + } if(flags & (DWL_EXPECT_BEFORE_NAVIGATE|(is_http ? DWL_FROM_PUT_HREF : 0)|DWL_FROM_GOFORWARD|DWL_REFRESH)) SET_EXPECT(Invoke_PROPERTYCHANGE); @@ -3065,7 +3111,7 @@ static void test_download(DWORD flags) SET_EXPECT(GetOverridesKeyPath); /* Called randomly on some VMs. */ trace("Downloading...\n"); - while(!*b && GetMessageW(&msg, NULL, 0, 0)) { + while(!navigation_cancelled && !*b && GetMessageW(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessageW(&msg); } @@ -3096,11 +3142,14 @@ static void test_download(DWORD flags) CLEAR_CALLED(EnableModeless_FALSE); /* IE 8 */ if(!(flags & DWL_REFRESH)) { - todo_wine_if(nav_back_todo) { - if(flags & (DWL_FROM_GOFORWARD|DWL_BACK_ENABLE)) - CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_TRUE); - else - CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_FALSE); + if (!(flags & DWL_FROM_IFRAME_NAV_CANCEL)) + { + todo_wine_if(nav_back_todo) { + if(flags & (DWL_FROM_GOFORWARD|DWL_BACK_ENABLE)) + CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_TRUE); + else + CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_FALSE); + } } if(flags & DWL_FROM_GOBACK) CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_TRUE); @@ -3117,20 +3166,26 @@ static void test_download(DWORD flags) if(!is_first_load) todo_wine CHECK_CALLED(GetHostInfo); if(use_container_olecmd) - CHECK_CALLED(Exec_SETDOWNLOADSTATE_0); + todo_wine_if(flags & DWL_IFRAME_NAV_CANCEL) CHECK_CALLED(Exec_SETDOWNLOADSTATE_0); else - CHECK_CALLED(Invoke_DOWNLOADCOMPLETE); + todo_wine_if(flags & DWL_IFRAME_NAV_CANCEL) CHECK_CALLED(Invoke_DOWNLOADCOMPLETE); todo_wine CHECK_CALLED(Invoke_TITLECHANGE); if(!(flags & DWL_REFRESH)) CHECK_CALLED(Invoke_NAVIGATECOMPLETE2); if(is_first_load) todo_wine CHECK_CALLED(GetDropTarget); - if(!(flags & DWL_REFRESH)) + if(!(flags & (DWL_REFRESH | DWL_IFRAME_NAV_CANCEL))) CHECK_CALLED(Invoke_DOCUMENTCOMPLETE); is_downloading = FALSE; - test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); + if (flags & DWL_IFRAME_NAV_CANCEL) + { + test_ready_state(READYSTATE_INTERACTIVE, VARIANT_TRUE); + SET_EXPECT(Invoke_TITLECHANGE); + } + else + test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); while(use_container_olecmd && !called_Exec_UPDATECOMMANDS && GetMessageA(&msg, NULL, 0, 0)) { TranslateMessage(&msg); @@ -3840,6 +3895,51 @@ static void init_test(IWebBrowser2 *webbrowser, DWORD flags) use_container_dochostui = !(flags & TEST_NODOCHOST); } +static const char iframe_doc_str[] = + ""; + +static void test_iframe_load(IWebBrowser2 *webbrowser) +{ + WCHAR file_path[MAX_PATH]; + WCHAR file_url[MAX_PATH]; + HRESULT hres; + HANDLE file; + VARIANT url; + DWORD size; + BOOL bret; + + GetTempPathW(MAX_PATH, file_path); + lstrcatW(file_path, L"wine_ifr_test.html"); + + file = CreateFileW(file_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, error %u.\n", GetLastError()); + if(file == INVALID_HANDLE_VALUE && GetLastError() != ERROR_FILE_EXISTS){ + ok(0, "CreateFile failed\n"); + return; + } + WriteFile(file, iframe_doc_str, strlen(iframe_doc_str), &size, NULL); + CloseHandle(file); + + GetLongPathNameW(file_path, file_path, ARRAY_SIZE(file_path)); + lstrcpyW(file_url, L"file://"); + lstrcatW(file_url, file_path); + + trace("iframe load...\n"); + test_Navigate2(webbrowser, file_url); + test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_IFRAME_NAV_CANCEL|DWL_BACK_ENABLE); + + V_VT(&url) = VT_BSTR; + V_BSTR(&url) = SysAllocString(current_url = L"about:blank"); + hres = IWebBrowser2_Navigate2(webbrowser, &url, NULL, NULL, NULL, NULL); + ok(hres == S_OK, "Navigate2 failed: %08x\n", hres); + VariantClear(&url); + + test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_FROM_IFRAME_NAV_CANCEL); + + bret = DeleteFileW(file_path); + ok(bret, "DeleteFileW failed, err %u.\n", GetLastError()); +} + static void test_WebBrowser(DWORD flags, BOOL do_close) { IWebBrowser2 *webbrowser; @@ -3868,6 +3968,7 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_LocationURL(webbrowser, L""); test_ConnectionPoint(webbrowser, TRUE); + test_ClientSite(webbrowser, &ClientSite, !do_download); test_Extent(webbrowser); test_wb_funcs(webbrowser, TRUE); @@ -3934,6 +4035,8 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) trace("GoForward...\n"); test_go_forward(webbrowser, L"http://test.winehq.org/tests/winehq_snapshot/", -1, 0); test_download(DWL_FROM_GOFORWARD|DWL_HTTP); + if (!(flags & TEST_NOOLECMD)) + test_iframe_load(webbrowser); }else { trace("Navigate2 repeated with the same URL...\n"); test_Navigate2(webbrowser, L"about:blank"); @@ -3942,7 +4045,6 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_EnumVerbs(webbrowser); test_TranslateAccelerator(webbrowser); - test_dochost_qs(webbrowser); }else { test_ExecWB(webbrowser, TRUE); diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 60672b366ab..f0f01b5a9c5 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -433,7 +433,7 @@ static LRESULT WINAPI ime_ui_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LP case WM_IME_CONTROL: FIXME( "hwnd %p, himc %p, msg %s, wparam %s, lparam %#Ix stub!\n", hwnd, himc, debugstr_wm_ime(msg), debugstr_imc(wparam), lparam ); - return 1; + return 0; } return DefWindowProcW( hwnd, msg, wparam, lparam ); @@ -696,7 +696,8 @@ BOOL WINAPI NotifyIME( HIMC himc, DWORD action, DWORD index, DWORD value ) } case CPS_CANCEL: input_context_set_comp_str( ctx, NULL, 0 ); - ImmSetOpenStatus( himc, FALSE ); + if ((msg = ime_set_composition_status( himc, FALSE ))) ime_send_message( himc, msg, 0, 0 ); + NtUserNotifyIMEStatus( ctx->hWnd, FALSE ); break; default: FIXME( "himc %p, action %#lx, index %#lx, value %#lx stub!\n", himc, action, index, value ); diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index cc843ce4a8e..264276d53d6 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -2539,6 +2539,9 @@ BOOL WINAPI ImmSetCompositionStringA( return FALSE; if (!(ime = imc_select_ime( data ))) return FALSE; + if (!lpComp) dwCompLen = 0; + if (!lpRead) dwReadLen = 0; + if (!ime_is_unicode( ime )) return ime->pImeSetCompositionString( hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen ); comp_len = MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, NULL, 0); @@ -2596,6 +2599,9 @@ BOOL WINAPI ImmSetCompositionStringW( return FALSE; if (!(ime = imc_select_ime( data ))) return FALSE; + if (!lpComp) dwCompLen = 0; + if (!lpRead) dwReadLen = 0; + if (ime_is_unicode( ime )) return ime->pImeSetCompositionString( hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen ); comp_len = WideCharToMultiByte(CP_ACP, 0, lpComp, dwCompLen, NULL, 0, NULL, diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 66ebbfd161d..c5d2b85558e 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -1077,12 +1077,24 @@ static void test_SCS_SETSTR(void) DWORD prop; imc = ImmGetContext(hwnd); - ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL, 0); if (!ret) { win_skip("Composition isn't supported\n"); ImmReleaseContext(hwnd, imc); return; } + + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, NULL, 128, NULL, 128); + ok(ret, "got error %lu.\n", GetLastError()); + + alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20); + ok(!alen, "got %ld.\n", alen); + wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 20); + ok(!wlen, "got %ld.\n", alen); + + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL, 2); + ok(ret, "got error %lu.\n", GetLastError()); + msg_spy_flush_msgs(); alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20); diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 9c7582b71fb..207c2ae20d0 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -993,6 +993,7 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG { struct nsi_ipv4_forward_key *key4; struct nsi_ipv6_forward_key *key6; + struct nsi_ip_forward_rw *rw; IP_ADAPTER_GATEWAY_ADDRESS *gw, **gw_next; IP_ADAPTER_PREFIX *prefix, **prefix_next; DWORD err, count, i, prefix_len, key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6); @@ -1002,11 +1003,14 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG void *key; err = NsiAllocateAndGetTable( 1, ip_module_id( family ), NSI_IP_FORWARD_TABLE, &key, key_size, - NULL, 0, NULL, 0, NULL, 0, &count, 0 ); + (void **)&rw, sizeof(*rw), NULL, 0, NULL, 0, &count, 0 ); if (err) return err; while (aa) { + if (family == AF_INET) aa->Ipv4Metric = ~0u; + else aa->Ipv6Metric = ~0u; + for (gw_next = &aa->FirstGatewayAddress; *gw_next; gw_next = &(*gw_next)->Next) ; for (prefix_next = &aa->FirstPrefix; *prefix_next; prefix_next = &(*prefix_next)->Next) @@ -1019,6 +1023,12 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG luid = (family == AF_INET) ? &key4->luid : &key6->luid; if (luid->Value != aa->Luid.Value) continue; + if (rw[i].metric) + { + if (family == AF_INET) aa->Ipv4Metric = min( aa->Ipv4Metric, rw[i].metric ); + else aa->Ipv6Metric = min( aa->Ipv6Metric, rw[i].metric ); + } + if (flags & GAA_FLAG_INCLUDE_GATEWAYS) { memset( &sockaddr, 0, sizeof(sockaddr) ); @@ -1103,7 +1113,7 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG } err: - NsiFreeTable( key, NULL, NULL, NULL ); + NsiFreeTable( key, rw, NULL, NULL ); return err; } @@ -1269,11 +1279,8 @@ static DWORD adapters_addresses_alloc( ULONG family, ULONG flags, IP_ADAPTER_ADD if (err) goto err; } - if (flags & (GAA_FLAG_INCLUDE_GATEWAYS | GAA_FLAG_INCLUDE_PREFIX)) - { - err = call_families( gateway_and_prefix_addresses_alloc, aa, family, flags ); - if (err) goto err; - } + err = call_families( gateway_and_prefix_addresses_alloc, aa, family, flags ); + if (err) goto err; err = dns_info_alloc( aa, family, flags ); if (err) goto err; diff --git a/dlls/ir50_32/ir50.c b/dlls/ir50_32/ir50.c index 65c93f7fe5e..69700359e99 100644 --- a/dlls/ir50_32/ir50.c +++ b/dlls/ir50_32/ir50.c @@ -252,7 +252,7 @@ static LRESULT IV50_Decompress( IMFTransform *decoder, ICDECOMPRESS *icd, DWORD mft_buf.pSample = out_sample; hr = IMFTransform_ProcessOutput( decoder, 0, 1, &mft_buf, &mft_status ); - if ( SUCCEEDED(hr) && (mft_status & MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE) ) + if ( hr == MF_E_TRANSFORM_STREAM_CHANGE ) hr = IMFTransform_ProcessOutput( decoder, 0, 1, &mft_buf, &mft_status ); if ( SUCCEEDED(hr) ) diff --git a/dlls/jscript/Makefile.in b/dlls/jscript/Makefile.in index c37b0dd69f3..86d9035800e 100644 --- a/dlls/jscript/Makefile.in +++ b/dlls/jscript/Makefile.in @@ -4,6 +4,7 @@ IMPORTS = oleaut32 ole32 user32 advapi32 SOURCES = \ activex.c \ array.c \ + arraybuf.c \ bool.c \ cc_parser.y \ compile.c \ diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 078e2ce7d4c..6d32f942306 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -633,7 +633,7 @@ static HRESULT sort_cmp(script_ctx_t *ctx, jsdisp_t *cmp_func, jsval_t v1, jsval jsval_t res; double n; - hres = jsdisp_call_value(cmp_func, jsval_undefined(), DISPATCH_METHOD, 2, args, &res); + hres = jsdisp_call_value(cmp_func, jsval_undefined(), DISPATCH_METHOD, 2, args, &res, &ctx->jscaller->IServiceProvider_iface); if(FAILED(hres)) return hres; @@ -948,8 +948,14 @@ static HRESULT Array_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsi TRACE("\n"); array = array_this(vthis); - if(!array) + if(!array) { + if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5) { + if(is_undefined(vthis) || is_null(vthis)) + return JS_E_OBJECT_EXPECTED; + return Object_toString(ctx, vthis, flags, argc, argv, r); + } return JS_E_ARRAY_EXPECTED; + } return array_join(ctx, &array->dispex, array->length, L",", 1, to_string, r); } diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c new file mode 100644 index 00000000000..d2807a7917e --- /dev/null +++ b/dlls/jscript/arraybuf.c @@ -0,0 +1,1465 @@ +/* + * Copyright 2023 Gabriel Ivăncescu for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include +#include +#include +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "ntsecapi.h" +#include "jscript.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(jscript); + +typedef struct { + jsdisp_t dispex; + DWORD size; + DECLSPEC_ALIGN(sizeof(double)) BYTE buf[]; +} ArrayBufferInstance; + +typedef struct { + jsdisp_t dispex; + + jsdisp_t *buffer; + DWORD offset; + DWORD size; +} DataViewInstance; + +typedef struct { + jsdisp_t dispex; + + jsdisp_t *buffer; + DWORD offset; + DWORD length; +} TypedArrayInstance; + +static inline ArrayBufferInstance *arraybuf_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, ArrayBufferInstance, dispex); +} + +static inline DataViewInstance *dataview_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, DataViewInstance, dispex); +} + +static inline TypedArrayInstance *typedarr_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, TypedArrayInstance, dispex); +} + +static inline ArrayBufferInstance *arraybuf_this(jsval_t vthis) +{ + jsdisp_t *jsdisp = is_object_instance(vthis) ? to_jsdisp(get_object(vthis)) : NULL; + return (jsdisp && is_class(jsdisp, JSCLASS_ARRAYBUFFER)) ? arraybuf_from_jsdisp(jsdisp) : NULL; +} + +static HRESULT create_arraybuf(script_ctx_t*,DWORD,jsdisp_t**); + +static HRESULT ArrayBuffer_get_byteLength(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(arraybuf_from_jsdisp(jsthis)->size); + return S_OK; +} + +static HRESULT ArrayBuffer_slice(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + ArrayBufferInstance *arraybuf; + DWORD begin = 0, end, size; + jsdisp_t *obj; + HRESULT hres; + double n; + + TRACE("\n"); + + if(!(arraybuf = arraybuf_this(vthis))) + return JS_E_ARRAYBUFFER_EXPECTED; + end = arraybuf->size; + if(!r) + return S_OK; + + if(argc) { + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + n += arraybuf->size; + if(n >= 0.0 && n < arraybuf->size) { + begin = n; + if(argc > 1 && !is_undefined(argv[1])) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + n += arraybuf->size; + if(n >= 0.0) { + end = n < arraybuf->size ? n : arraybuf->size; + end = end < begin ? begin : end; + }else + end = begin; + } + }else + end = 0; + } + + size = end - begin; + hres = create_arraybuf(ctx, size, &obj); + if(FAILED(hres)) + return hres; + memcpy(arraybuf_from_jsdisp(obj)->buf, arraybuf->buf + begin, size); + + *r = jsval_obj(obj); + return S_OK; +} + +static const builtin_prop_t ArrayBuffer_props[] = { + {L"byteLength", NULL, 0, ArrayBuffer_get_byteLength}, + {L"slice", ArrayBuffer_slice, PROPF_METHOD|2}, +}; + +static const builtin_info_t ArrayBuffer_info = { + JSCLASS_ARRAYBUFFER, + NULL, + ARRAY_SIZE(ArrayBuffer_props), + ArrayBuffer_props, + NULL, + NULL +}; + +static const builtin_prop_t ArrayBufferInst_props[] = { + {L"byteLength", NULL, 0, ArrayBuffer_get_byteLength}, +}; + +static const builtin_info_t ArrayBufferInst_info = { + JSCLASS_ARRAYBUFFER, + NULL, + ARRAY_SIZE(ArrayBufferInst_props), + ArrayBufferInst_props, + NULL, + NULL +}; + +static HRESULT create_arraybuf(script_ctx_t *ctx, DWORD size, jsdisp_t **ret) +{ + ArrayBufferInstance *arraybuf; + HRESULT hres; + + if(!(arraybuf = calloc(1, FIELD_OFFSET(ArrayBufferInstance, buf[size])))) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(&arraybuf->dispex, ctx, &ArrayBufferInst_info, ctx->arraybuf_constr); + if(FAILED(hres)) { + free(arraybuf); + return hres; + } + + arraybuf->size = size; + + *ret = &arraybuf->dispex; + return S_OK; +} + +static HRESULT ArrayBufferConstr_isView(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + BOOL ret = FALSE; + jsdisp_t *obj; + + TRACE("\n"); + + if(!r) + return S_OK; + + if(argc && is_object_instance(argv[0]) && (obj = to_jsdisp(get_object(argv[0]))) && + obj->builtin_info->class >= FIRST_VIEW_JSCLASS && obj->builtin_info->class <= LAST_VIEW_JSCLASS) + ret = TRUE; + + *r = jsval_bool(ret); + return S_OK; +} + +static HRESULT ArrayBufferConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + DWORD size = 0; + jsdisp_t *obj; + HRESULT hres; + + TRACE("\n"); + + switch(flags) { + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: { + if(argc) { + double n; + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + return JS_E_INVALID_LENGTH; + if(n > (UINT_MAX - FIELD_OFFSET(ArrayBufferInstance, buf[0]))) + return E_OUTOFMEMORY; + size = n; + } + + if(r) { + hres = create_arraybuf(ctx, size, &obj); + if(FAILED(hres)) + return hres; + *r = jsval_obj(obj); + } + break; + } + default: + FIXME("unimplemented flags: %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +static const builtin_prop_t ArrayBufferConstr_props[] = { + {L"isView", ArrayBufferConstr_isView, PROPF_METHOD|1}, +}; + +static const builtin_info_t ArrayBufferConstr_info = { + JSCLASS_FUNCTION, + Function_value, + ARRAY_SIZE(ArrayBufferConstr_props), + ArrayBufferConstr_props, + NULL, + NULL +}; + +static inline DataViewInstance *dataview_this(jsval_t vthis) +{ + jsdisp_t *jsdisp = is_object_instance(vthis) ? to_jsdisp(get_object(vthis)) : NULL; + return (jsdisp && is_class(jsdisp, JSCLASS_DATAVIEW)) ? dataview_from_jsdisp(jsdisp) : NULL; +} + +static HRESULT DataView_get_buffer(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + DataViewInstance *view; + + TRACE("\n"); + + if(!(view = dataview_this(vthis))) + return JS_E_NOT_DATAVIEW; + if(r) *r = jsval_obj(jsdisp_addref(view->buffer)); + return S_OK; +} + +static HRESULT DataView_get_byteLength(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + DataViewInstance *view; + + TRACE("\n"); + + if(!(view = dataview_this(vthis))) + return JS_E_NOT_DATAVIEW; + if(r) *r = jsval_number(view->size); + return S_OK; +} + +static HRESULT DataView_get_byteOffset(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + DataViewInstance *view; + + TRACE("\n"); + + if(!(view = dataview_this(vthis))) + return JS_E_NOT_DATAVIEW; + if(r) *r = jsval_number(view->offset); + return S_OK; +} + +static inline void copy_type_data(void *dst, const void *src, unsigned type_size, BOOL little_endian) +{ +#ifdef WORDS_BIGENDIAN + BOOL swap = little_endian; +#else + BOOL swap = !little_endian; +#endif + const BYTE *in = src; + BYTE *out = dst; + unsigned i; + + if(swap) + for(i = 0; i < type_size; i++) + out[i] = in[type_size - i - 1]; + else + memcpy(out, in, type_size); +} + +static HRESULT get_data(script_ctx_t *ctx, jsval_t vthis, unsigned argc, jsval_t *argv, unsigned type_size, void *ret) +{ + BOOL little_endian = FALSE; + DataViewInstance *view; + HRESULT hres; + DWORD offset; + BYTE *data; + double n; + + if(!(view = dataview_this(vthis))) + return JS_E_NOT_DATAVIEW; + if(!argc || is_undefined(argv[0])) + return JS_E_DATAVIEW_NO_ARGUMENT; + + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + + if(n < 0.0 || n >= view->size) + return JS_E_DATAVIEW_INVALID_ACCESS; + + offset = n; + if(view->size - offset < type_size) + return JS_E_DATAVIEW_INVALID_ACCESS; + data = &arraybuf_from_jsdisp(view->buffer)->buf[view->offset + offset]; + + if(type_size == 1) { + *(BYTE*)ret = data[0]; + return S_OK; + } + + if(argc > 1) { + hres = to_boolean(argv[1], &little_endian); + if(FAILED(hres)) + return hres; + } + + copy_type_data(ret, data, type_size, little_endian); + return S_OK; +} + +static HRESULT set_data(script_ctx_t *ctx, jsval_t vthis, unsigned argc, jsval_t *argv, unsigned type_size, const void *val) +{ + BOOL little_endian = FALSE; + DataViewInstance *view; + HRESULT hres; + DWORD offset; + BYTE *data; + double n; + + if(!(view = dataview_this(vthis))) + return JS_E_NOT_DATAVIEW; + if(is_undefined(argv[0]) || is_undefined(argv[1])) + return JS_E_DATAVIEW_NO_ARGUMENT; + + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + + if(n < 0.0 || n >= view->size) + return JS_E_DATAVIEW_INVALID_ACCESS; + + offset = n; + if(view->size - offset < type_size) + return JS_E_DATAVIEW_INVALID_ACCESS; + data = &arraybuf_from_jsdisp(view->buffer)->buf[view->offset + offset]; + + if(type_size == 1) { + data[0] = *(const BYTE*)val; + return S_OK; + } + + if(argc > 2) { + hres = to_boolean(argv[2], &little_endian); + if(FAILED(hres)) + return hres; + } + + copy_type_data(data, val, type_size, little_endian); + return S_OK; +} + +static HRESULT DataView_getFloat32(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + float v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getFloat64(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + double v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getInt8(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT8 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getInt16(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT16 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getInt32(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT32 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getUint8(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + UINT8 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getUint16(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + UINT16 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_getUint32(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + UINT32 v; + + TRACE("\n"); + + hres = get_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_number(v); + return S_OK; +} + +static HRESULT DataView_setFloat32(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + double n; + float v; + + TRACE("\n"); + + if(argc < 2) + return JS_E_DATAVIEW_NO_ARGUMENT; + hres = to_number(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + v = n; /* FIXME: don't assume rounding mode is round-to-nearest ties-to-even */ + + hres = set_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_undefined(); + return S_OK; +} + +static HRESULT DataView_setFloat64(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + double v; + + TRACE("\n"); + + if(argc < 2) + return JS_E_DATAVIEW_NO_ARGUMENT; + hres = to_number(ctx, argv[1], &v); + if(FAILED(hres)) + return hres; + + hres = set_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_undefined(); + return S_OK; +} + +static HRESULT DataView_setInt8(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT32 n; + INT8 v; + + TRACE("\n"); + + if(argc < 2) + return JS_E_DATAVIEW_NO_ARGUMENT; + hres = to_int32(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + v = n; + + hres = set_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_undefined(); + return S_OK; +} + +static HRESULT DataView_setInt16(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT32 n; + INT16 v; + + TRACE("\n"); + + if(argc < 2) + return JS_E_DATAVIEW_NO_ARGUMENT; + hres = to_int32(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + v = n; + + hres = set_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_undefined(); + return S_OK; +} + +static HRESULT DataView_setInt32(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + HRESULT hres; + INT32 v; + + TRACE("\n"); + + if(argc < 2) + return JS_E_DATAVIEW_NO_ARGUMENT; + hres = to_int32(ctx, argv[1], &v); + if(FAILED(hres)) + return hres; + + hres = set_data(ctx, vthis, argc, argv, sizeof(v), &v); + if(FAILED(hres)) + return hres; + if(r) *r = jsval_undefined(); + return S_OK; +} + +static const builtin_prop_t DataView_props[] = { + {L"getFloat32", DataView_getFloat32, PROPF_METHOD|1}, + {L"getFloat64", DataView_getFloat64, PROPF_METHOD|1}, + {L"getInt16", DataView_getInt16, PROPF_METHOD|1}, + {L"getInt32", DataView_getInt32, PROPF_METHOD|1}, + {L"getInt8", DataView_getInt8, PROPF_METHOD|1}, + {L"getUint16", DataView_getUint16, PROPF_METHOD|1}, + {L"getUint32", DataView_getUint32, PROPF_METHOD|1}, + {L"getUint8", DataView_getUint8, PROPF_METHOD|1}, + {L"setFloat32", DataView_setFloat32, PROPF_METHOD|1}, + {L"setFloat64", DataView_setFloat64, PROPF_METHOD|1}, + {L"setInt16", DataView_setInt16, PROPF_METHOD|1}, + {L"setInt32", DataView_setInt32, PROPF_METHOD|1}, + {L"setInt8", DataView_setInt8, PROPF_METHOD|1}, + {L"setUint16", DataView_setInt16, PROPF_METHOD|1}, + {L"setUint32", DataView_setInt32, PROPF_METHOD|1}, + {L"setUint8", DataView_setInt8, PROPF_METHOD|1}, +}; + +static void DataView_destructor(jsdisp_t *dispex) +{ + DataViewInstance *view = dataview_from_jsdisp(dispex); + if(view->buffer) + jsdisp_release(view->buffer); + free(view); +} + +static HRESULT DataView_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *dispex) +{ + DataViewInstance *view = dataview_from_jsdisp(dispex); + return gc_process_linked_obj(gc_ctx, op, dispex, view->buffer, (void**)&view->buffer); +} + +static void DataView_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + DataViewInstance *view = dataview_from_jsdisp(dispex); + if(view->buffer) + cc_api.note_edge((nsISupports*)&view->buffer->IDispatchEx_iface, "buffer", cb); +} + +static const builtin_info_t DataView_info = { + JSCLASS_DATAVIEW, + NULL, + ARRAY_SIZE(DataView_props), + DataView_props, + DataView_destructor, + NULL, + NULL, + NULL, + NULL, + DataView_gc_traverse, + DataView_cc_traverse +}; + +static const builtin_info_t DataViewInst_info = { + JSCLASS_DATAVIEW, + NULL, + 0, + NULL, + DataView_destructor, + NULL, + NULL, + NULL, + NULL, + DataView_gc_traverse, + DataView_cc_traverse +}; + +static HRESULT DataViewConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + ArrayBufferInstance *arraybuf; + DataViewInstance *view; + DWORD offset = 0, size; + HRESULT hres; + + TRACE("\n"); + + switch(flags) { + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: { + if(!argc || !(arraybuf = arraybuf_this(argv[0]))) + return JS_E_DATAVIEW_NO_ARGUMENT; + size = arraybuf->size; + + if(argc > 1) { + double offs, len, maxsize = size; + hres = to_integer(ctx, argv[1], &offs); + if(FAILED(hres)) + return hres; + if(offs < 0.0 || offs > maxsize) + return JS_E_DATAVIEW_INVALID_OFFSET; + offset = offs; + + if(argc > 2 && !is_undefined(argv[2])) { + hres = to_integer(ctx, argv[2], &len); + if(FAILED(hres)) + return hres; + if(len < 0.0 || offs+len > maxsize) + return JS_E_DATAVIEW_INVALID_OFFSET; + size = len; + }else + size -= offset; + } + + if(!r) + return S_OK; + + if(!(view = calloc(1, sizeof(DataViewInstance)))) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(&view->dispex, ctx, &DataViewInst_info, ctx->dataview_constr); + if(FAILED(hres)) { + free(view); + return hres; + } + + view->buffer = jsdisp_addref(&arraybuf->dispex); + view->offset = offset; + view->size = size; + + *r = jsval_obj(&view->dispex); + break; + } + default: + FIXME("unimplemented flags: %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +static const builtin_info_t DataViewConstr_info = { + JSCLASS_FUNCTION, + Function_value, + 0, + NULL, + NULL, + NULL +}; + +static HRESULT clamped_u8(script_ctx_t *ctx, jsval_t v, UINT8 *ret) +{ + HRESULT hres; + double n; + + hres = to_number(ctx, v, &n); + if(FAILED(hres)) + return hres; + + if(!isfinite(n)) + *ret = (n == INFINITY ? 255 : 0); + else + *ret = (n >= 255.0 ? 255 : n <= 0 ? 0 : lround(n)); + return S_OK; +} + +#define TYPEDARRAY_LIST \ +X(Int8Array, JSCLASS_INT8ARRAY, INT8, to_int32, INT) \ +X(Int16Array, JSCLASS_INT16ARRAY, INT16, to_int32, INT) \ +X(Int32Array, JSCLASS_INT32ARRAY, INT32, to_int32, INT) \ +X(Uint8Array, JSCLASS_UINT8ARRAY, UINT8, to_int32, INT) \ +X(Uint8ClampedArray, JSCLASS_UINT8CLAMPEDARRAY, UINT8, clamped_u8, UINT8) \ +X(Uint16Array, JSCLASS_UINT16ARRAY, UINT16, to_int32, INT) \ +X(Uint32Array, JSCLASS_UINT32ARRAY, UINT32, to_int32, INT) \ +X(Float32Array, JSCLASS_FLOAT32ARRAY, float, to_number, double) \ +X(Float64Array, JSCLASS_FLOAT64ARRAY, double, to_number, double) + +#define TYPEDARRAY_INDEX(JSCLASS) ((JSCLASS) - FIRST_TYPEDARRAY_JSCLASS) + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = L"" #NAME, +static const WCHAR *const TypedArray_name[] = { TYPEDARRAY_LIST }; +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = sizeof(TYPE), +static const unsigned TypedArray_elem_size[] = { TYPEDARRAY_LIST }; +#undef X + +static inline TypedArrayInstance *typedarr_this(jsval_t vthis, jsclass_t jsclass) +{ + jsdisp_t *jsdisp = is_object_instance(vthis) ? to_jsdisp(get_object(vthis)) : NULL; + return (jsdisp && is_class(jsdisp, jsclass)) ? typedarr_from_jsdisp(jsdisp) : NULL; +} + +static HRESULT create_typedarr(script_ctx_t*,jsclass_t,jsdisp_t*,DWORD,DWORD,jsdisp_t**); + +static HRESULT TypedArray_get_buffer(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_obj(jsdisp_addref(typedarr_from_jsdisp(jsthis)->buffer)); + return S_OK; +} + +static HRESULT TypedArray_get_byteLength(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->length * TypedArray_elem_size[TYPEDARRAY_INDEX(jsthis->builtin_info->class)]); + return S_OK; +} + +static HRESULT TypedArray_get_byteOffset(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->offset); + return S_OK; +} + +static HRESULT TypedArray_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->length); + return S_OK; +} + +static HRESULT fill_typedarr_data_from_object(script_ctx_t *ctx, BYTE *data, jsdisp_t *obj, DWORD length, jsclass_t jsclass) +{ + HRESULT hres = S_OK; + jsval_t val; + UINT32 i; + + switch(jsclass) { +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ + case JSCLASS: \ + for(i = 0; i < length; i++) { \ + NUM_TYPE n; \ + \ + hres = jsdisp_get_idx(obj, i, &val); \ + if(FAILED(hres)) { \ + if(hres != DISP_E_UNKNOWNNAME) \ + break; \ + val = jsval_undefined(); \ + } \ + \ + hres = CONVERT(ctx, val, &n); \ + jsval_release(val); \ + if(FAILED(hres)) \ + break; \ + *(TYPE*)&data[i * sizeof(TYPE)] = n; \ + } \ + break; + TYPEDARRAY_LIST + DEFAULT_UNREACHABLE; +#undef X + } + + return hres; +} + +static HRESULT TypedArray_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + const unsigned elem_size = TypedArray_elem_size[TYPEDARRAY_INDEX(jsclass)]; + TypedArrayInstance *typedarr; + DWORD begin = 0, size; + BYTE *dest, *data; + IDispatch *disp; + jsdisp_t *obj; + HRESULT hres; + jsval_t val; + UINT32 len; + double n; + + TRACE("\n"); + + if(!(typedarr = typedarr_this(vthis, jsclass))) + return JS_E_NOT_TYPEDARRAY; + if(!argc) + return JS_E_TYPEDARRAY_INVALID_SOURCE; + + hres = to_object(ctx, argv[0], &disp); + if(FAILED(hres)) + return JS_E_TYPEDARRAY_INVALID_SOURCE; + + if(!(obj = to_jsdisp(disp))) { + FIXME("Non-JS array object\n"); + hres = JS_E_TYPEDARRAY_INVALID_SOURCE; + goto done; + } + + hres = jsdisp_propget_name(obj, L"length", &val); + if(FAILED(hres)) + goto done; + + hres = to_uint32(ctx, val, &len); + jsval_release(val); + if(FAILED(hres)) + goto done; + + if(argc > 1) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + goto done; + if(n < 0.0 || n > typedarr->length) { + hres = JS_E_TYPEDARRAY_INVALID_OFFSLEN; + goto done; + } + begin = n; + } + + if(len > typedarr->length - begin) { + hres = JS_E_TYPEDARRAY_INVALID_OFFSLEN; + goto done; + } + size = len * elem_size; + dest = data = &arraybuf_from_jsdisp(typedarr->buffer)->buf[typedarr->offset + begin * elem_size]; + + /* If they overlap, make a temporary copy */ + if(obj->builtin_info->class >= FIRST_TYPEDARRAY_JSCLASS && obj->builtin_info->class <= LAST_TYPEDARRAY_JSCLASS) { + TypedArrayInstance *src_arr = typedarr_from_jsdisp(obj); + const BYTE *src = arraybuf_from_jsdisp(src_arr->buffer)->buf + src_arr->offset; + + if(dest < src + len * TypedArray_elem_size[TYPEDARRAY_INDEX(obj->builtin_info->class)] && + dest + size > src) { + if(!(data = malloc(size))) { + hres = E_OUTOFMEMORY; + goto done; + } + } + } + + hres = fill_typedarr_data_from_object(ctx, data, obj, len, jsclass); + if(SUCCEEDED(hres) && dest != data) { + memcpy(dest, data, size); + free(data); + } + +done: + IDispatch_Release(disp); + return hres; +} + +static HRESULT TypedArray_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + TypedArrayInstance *typedarr; + DWORD begin = 0, end; + jsdisp_t *obj; + HRESULT hres; + double n; + + TRACE("\n"); + + if(!(typedarr = typedarr_this(vthis, jsclass))) + return JS_E_NOT_TYPEDARRAY; + if(!argc) + return JS_E_TYPEDARRAY_INVALID_SUBARRAY; + if(!r) + return S_OK; + + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + end = typedarr->length; + if(n < 0.0) + n += typedarr->length; + if(n >= 0.0) + begin = n < typedarr->length ? n : typedarr->length; + + if(argc > 1 && !is_undefined(argv[1])) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + n += typedarr->length; + if(n >= 0.0) { + end = n < typedarr->length ? n : typedarr->length; + end = end < begin ? begin : end; + }else + end = begin; + } + + hres = create_typedarr(ctx, jsclass, typedarr->buffer, + typedarr->offset + begin * TypedArray_elem_size[TYPEDARRAY_INDEX(jsclass)], + end - begin, &obj); + if(FAILED(hres)) + return hres; + + *r = jsval_obj(obj); + return S_OK; +} + +static unsigned TypedArray_idx_length(jsdisp_t *jsdisp) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(jsdisp); + return typedarr->length; +} + +static void TypedArray_destructor(jsdisp_t *dispex) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + if(typedarr->buffer) + jsdisp_release(typedarr->buffer); + free(typedarr); +} + +static HRESULT TypedArray_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *dispex) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + return gc_process_linked_obj(gc_ctx, op, dispex, typedarr->buffer, (void**)&typedarr->buffer); +} + +static void TypedArray_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + if(typedarr->buffer) + cc_api.note_edge((nsISupports*)&typedarr->buffer->IDispatchEx_iface, "buffer", cb); +} + +static const builtin_prop_t TypedArrayInst_props[] = { + {L"buffer", NULL, 0, TypedArray_get_buffer}, + {L"byteLength", NULL, 0, TypedArray_get_byteLength}, + {L"byteOffset", NULL, 0, TypedArray_get_byteOffset}, + {L"length", NULL, 0, TypedArray_get_length}, +}; + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +static HRESULT NAME ##_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) \ +{ \ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(jsdisp); \ + \ + TRACE("%p[%u]\n", typedarr, idx); \ + \ + if(idx >= typedarr->length) \ + *r = jsval_undefined(); \ + else \ + *r = jsval_number(*(TYPE*)&arraybuf_from_jsdisp(typedarr->buffer)->buf[typedarr->offset + idx * sizeof(TYPE)]); \ + return S_OK; \ +} \ + \ +static HRESULT NAME ##_idx_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) \ +{ \ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(jsdisp); \ + HRESULT hres; \ + NUM_TYPE n; \ + \ + TRACE("%p[%u] = %s\n", typedarr, idx, debugstr_jsval(val)); \ + \ + if(idx >= typedarr->length) \ + return S_OK; \ + \ + hres = CONVERT(jsdisp->ctx, val, &n); \ + if(SUCCEEDED(hres)) \ + *(TYPE*)&arraybuf_from_jsdisp(typedarr->buffer)->buf[typedarr->offset + idx * sizeof(TYPE)] = n; \ + return hres; \ +} \ + \ +static HRESULT NAME ##_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, \ + jsval_t *r) \ +{ \ + return TypedArray_set(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} \ + \ +static HRESULT NAME ##_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, \ + jsval_t *r) \ +{ \ + return TypedArray_subarray(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} \ + \ +static const builtin_prop_t NAME ##_props[] = { \ + {L"buffer", NULL, 0, TypedArray_get_buffer}, \ + {L"byteLength", NULL, 0, TypedArray_get_byteLength}, \ + {L"byteOffset", NULL, 0, TypedArray_get_byteOffset}, \ + {L"length", NULL, 0, TypedArray_get_length}, \ + {L"set", NAME ##_set, PROPF_METHOD|2}, \ + {L"subarray", NAME ##_subarray, PROPF_METHOD|2}, \ +}; +TYPEDARRAY_LIST +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +[TYPEDARRAY_INDEX(JSCLASS)] = \ +{ \ + JSCLASS, \ + NULL, \ + ARRAY_SIZE(NAME ##_props), \ + NAME ##_props, \ + TypedArray_destructor, \ + NULL, \ + TypedArray_idx_length, \ + NAME ##_idx_get, \ + NAME ##_idx_put, \ + TypedArray_gc_traverse, \ + TypedArray_cc_traverse \ +}, +static const builtin_info_t TypedArray_info[] = { TYPEDARRAY_LIST }; +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +[TYPEDARRAY_INDEX(JSCLASS)] = \ +{ \ + JSCLASS, \ + NULL, \ + ARRAY_SIZE(TypedArrayInst_props), \ + TypedArrayInst_props, \ + TypedArray_destructor, \ + NULL, \ + TypedArray_idx_length, \ + NAME ##_idx_get, \ + NAME ##_idx_put, \ + TypedArray_gc_traverse, \ + TypedArray_cc_traverse \ +}, +static const builtin_info_t TypedArrayInst_info[] = { TYPEDARRAY_LIST }; +#undef X + +static HRESULT create_typedarr(script_ctx_t *ctx, jsclass_t jsclass, jsdisp_t *buffer, DWORD offset, DWORD length, + jsdisp_t **ret) +{ + TypedArrayInstance *typedarr; + HRESULT hres; + + if(!(typedarr = calloc(1, sizeof(TypedArrayInstance)))) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(&typedarr->dispex, ctx, &TypedArrayInst_info[TYPEDARRAY_INDEX(jsclass)], + ctx->typedarr_constr[TYPEDARRAY_INDEX(jsclass)]); + if(FAILED(hres)) { + free(typedarr); + return hres; + } + + typedarr->buffer = jsdisp_addref(buffer); + typedarr->offset = offset; + typedarr->length = length; + + *ret = &typedarr->dispex; + return S_OK; +} + +static HRESULT TypedArrayConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + const unsigned typedarr_idx = TYPEDARRAY_INDEX(jsclass); + unsigned elem_size = TypedArray_elem_size[typedarr_idx]; + jsdisp_t *typedarr, *buffer = NULL; + DWORD offset = 0, length = 0; + HRESULT hres; + double n; + + TRACE("\n"); + + switch(flags) { + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: { + if(argc) { + if(is_object_instance(argv[0])) { + jsdisp_t *obj = to_jsdisp(get_object(argv[0])); + + if(!obj) + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + + if(obj->builtin_info->class == JSCLASS_ARRAYBUFFER) { + ArrayBufferInstance *arraybuf = arraybuf_from_jsdisp(obj); + + if(argc > 1) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0 || n > arraybuf->size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + offset = n; + if(offset % elem_size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + } + if(argc > 2 && !is_undefined(argv[2])) { + hres = to_integer(ctx, argv[2], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0 || n > UINT_MAX) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + length = n; + if(offset + length * elem_size > arraybuf->size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + }else { + length = arraybuf->size - offset; + if(length % elem_size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + length /= elem_size; + } + buffer = jsdisp_addref(&arraybuf->dispex); + }else { + jsval_t val; + UINT32 len; + DWORD size; + + hres = jsdisp_propget_name(obj, L"length", &val); + if(FAILED(hres)) + return hres; + if(is_undefined(val)) + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + + hres = to_uint32(ctx, val, &len); + jsval_release(val); + if(FAILED(hres)) + return hres; + + length = len; + size = length * elem_size; + if(size < length || size > (UINT_MAX - FIELD_OFFSET(ArrayBufferInstance, buf[0]))) + return E_OUTOFMEMORY; + + hres = create_arraybuf(ctx, size, &buffer); + if(FAILED(hres)) + return hres; + + hres = fill_typedarr_data_from_object(ctx, arraybuf_from_jsdisp(buffer)->buf, + obj, length, jsclass); + if(FAILED(hres)) { + jsdisp_release(buffer); + return hres; + } + } + }else if(is_number(argv[0])) { + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + if(n * elem_size > (UINT_MAX - FIELD_OFFSET(ArrayBufferInstance, buf[0]))) + return E_OUTOFMEMORY; + length = n; + }else + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + } + + if(!r) + return S_OK; + + if(!buffer) { + hres = create_arraybuf(ctx, length * elem_size, &buffer); + if(FAILED(hres)) + return hres; + } + + hres = create_typedarr(ctx, jsclass, buffer, offset, length, &typedarr); + jsdisp_release(buffer); + if(FAILED(hres)) + return hres; + + *r = jsval_obj(typedarr); + break; + } + default: + FIXME("unimplemented flags: %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +static HRESULT NAME ## Constr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) \ +{ \ + return TypedArrayConstr_value(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} +TYPEDARRAY_LIST +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = NAME ## Constr_value, +static const builtin_invoke_t TypedArray_constr[] = { TYPEDARRAY_LIST }; +#undef X + +static const builtin_info_t TypedArrayConstr_info = { + JSCLASS_FUNCTION, + Function_value, + 0, + NULL, + NULL, + NULL +}; + +static inline jsdisp_t *impl_from_IWineDispatchProxyCbPrivate(IWineDispatchProxyCbPrivate *iface) +{ + return CONTAINING_RECORD((IDispatchEx*)iface, jsdisp_t, IDispatchEx_iface); +} + +HRESULT WINAPI WineDispatchProxyCbPrivate_CreateArrayBuffer(IWineDispatchProxyCbPrivate *iface, DWORD size, IDispatch **arraybuf, void **data) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + jsdisp_t *obj; + HRESULT hres; + + hres = create_arraybuf(This->ctx, size, &obj); + if(FAILED(hres)) + return hres; + + *arraybuf = (IDispatch*)&obj->IDispatchEx_iface; + *data = arraybuf_from_jsdisp(obj)->buf; + return S_OK; +} + +HRESULT WINAPI WineDispatchProxyCbPrivate_GetRandomValues(IDispatch *disp) +{ + jsdisp_t *obj = to_jsdisp(disp); + TypedArrayInstance *typedarr; + DWORD size; + + if(!obj || obj->builtin_info->class < FIRST_TYPEDARRAY_JSCLASS || obj->builtin_info->class > LAST_TYPEDARRAY_JSCLASS) + return E_INVALIDARG; + + if(obj->builtin_info->class == JSCLASS_FLOAT32ARRAY || obj->builtin_info->class == JSCLASS_FLOAT64ARRAY) { + /* FIXME: Return TypeMismatchError */ + return E_FAIL; + } + + typedarr = typedarr_from_jsdisp(obj); + size = typedarr->length * TypedArray_elem_size[TYPEDARRAY_INDEX(obj->builtin_info->class)]; + if(size > 65536) { + /* FIXME: Return QuotaExceededError */ + return E_FAIL; + } + + if(!RtlGenRandom(&arraybuf_from_jsdisp(typedarr->buffer)->buf[typedarr->offset], size)) + return HRESULT_FROM_WIN32(GetLastError()); + + return S_OK; +} + +HRESULT init_arraybuf_constructors(script_ctx_t *ctx) +{ + static const struct { + const WCHAR *name; + builtin_invoke_t get; + } DataView_getters[] = { + { L"buffer", DataView_get_buffer }, + { L"byteLength", DataView_get_byteLength }, + { L"byteOffset", DataView_get_byteOffset }, + }; + ArrayBufferInstance *arraybuf; + TypedArrayInstance *typedarr; + DataViewInstance *view; + property_desc_t desc; + HRESULT hres; + unsigned i; + + if(ctx->version < SCRIPTLANGUAGEVERSION_ES5) + return S_OK; + + if(!(arraybuf = calloc(1, FIELD_OFFSET(ArrayBufferInstance, buf[0])))) + return E_OUTOFMEMORY; + + hres = init_dispex(&arraybuf->dispex, ctx, &ArrayBuffer_info, ctx->object_prototype); + if(FAILED(hres)) { + free(arraybuf); + return hres; + } + + hres = create_builtin_constructor(ctx, ArrayBufferConstr_value, L"ArrayBuffer", &ArrayBufferConstr_info, + PROPF_CONSTR|1, &arraybuf->dispex, &ctx->arraybuf_constr); + jsdisp_release(&arraybuf->dispex); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->global, L"ArrayBuffer", PROPF_CONFIGURABLE | PROPF_WRITABLE, + jsval_obj(ctx->arraybuf_constr)); + if(FAILED(hres)) + return hres; + + if(!(view = calloc(1, sizeof(DataViewInstance)))) + return E_OUTOFMEMORY; + + hres = create_arraybuf(ctx, 0, &view->buffer); + if(FAILED(hres)) { + free(view); + return hres; + } + + hres = init_dispex(&view->dispex, ctx, &DataView_info, ctx->object_prototype); + if(FAILED(hres)) { + jsdisp_release(view->buffer); + free(view); + return hres; + } + + desc.flags = PROPF_CONFIGURABLE; + desc.mask = PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + desc.explicit_getter = desc.explicit_setter = TRUE; + desc.explicit_value = FALSE; + desc.setter = NULL; + + for(i = 0; i < ARRAY_SIZE(DataView_getters); i++) { + hres = create_builtin_function(ctx, DataView_getters[i].get, NULL, NULL, PROPF_METHOD, NULL, &desc.getter); + if(SUCCEEDED(hres)) { + hres = jsdisp_define_property(&view->dispex, DataView_getters[i].name, &desc); + jsdisp_release(desc.getter); + } + if(FAILED(hres)) { + jsdisp_release(&view->dispex); + return hres; + } + } + + hres = create_builtin_constructor(ctx, DataViewConstr_value, L"DataView", &DataViewConstr_info, + PROPF_CONSTR|1, &view->dispex, &ctx->dataview_constr); + jsdisp_release(&view->dispex); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->global, L"DataView", PROPF_CONFIGURABLE | PROPF_WRITABLE, + jsval_obj(ctx->dataview_constr)); + if(FAILED(hres)) + return hres; + + for(i = 0; i < ARRAY_SIZE(TypedArray_info); i++) { + if(!(typedarr = calloc(1, sizeof(TypedArrayInstance)))) + return E_OUTOFMEMORY; + + hres = create_arraybuf(ctx, 0, &typedarr->buffer); + if(FAILED(hres)) { + free(typedarr); + return hres; + } + + hres = init_dispex(&typedarr->dispex, ctx, &TypedArray_info[i], ctx->object_prototype); + if(FAILED(hres)) { + jsdisp_release(typedarr->buffer); + free(typedarr); + return hres; + } + + hres = create_builtin_constructor(ctx, TypedArray_constr[i], TypedArray_name[i], &TypedArrayConstr_info, + PROPF_CONSTR|1, &typedarr->dispex, &ctx->typedarr_constr[i]); + jsdisp_release(&typedarr->dispex); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->typedarr_constr[i], L"BYTES_PER_ELEMENT", 0, + jsval_number(TypedArray_elem_size[i])); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->global, TypedArray_name[i], PROPF_CONFIGURABLE | PROPF_WRITABLE, + jsval_obj(ctx->typedarr_constr[i])); + if(FAILED(hres)) + return hres; + } + + return hres; +} diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index ef72860f627..6cd5de0c9a4 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -17,6 +17,7 @@ */ #include +#include #include "jscript.h" #include "engine.h" @@ -35,6 +36,7 @@ typedef enum { PROP_BUILTIN, PROP_PROTREF, PROP_ACCESSOR, + PROP_PROXY, PROP_DELETED, PROP_IDX } prop_type_t; @@ -54,12 +56,15 @@ struct _dispex_prop_t { jsdisp_t *getter; jsdisp_t *setter; } accessor; + DISPID proxy_id; } u; int bucket_head; int bucket_next; }; +static HRESULT fix_overridden_prop(jsdisp_t *This, dispex_prop_t *prop); + static void fix_protref_prop(jsdisp_t *jsdisp, dispex_prop_t *prop) { DWORD ref; @@ -86,13 +91,16 @@ static inline DISPID prop_to_id(jsdisp_t *This, dispex_prop_t *prop) static inline dispex_prop_t *get_prop(jsdisp_t *This, DISPID id) { + dispex_prop_t *prop; DWORD idx = id - 1; if(idx >= This->prop_cnt) return NULL; - fix_protref_prop(This, &This->props[idx]); + prop = &This->props[idx]; - return This->props[idx].type == PROP_DELETED ? NULL : &This->props[idx]; + fix_overridden_prop(This, prop); + fix_protref_prop(This, prop); + return prop->type == PROP_DELETED ? NULL : prop; } static inline BOOL is_function_prop(dispex_prop_t *prop) @@ -108,6 +116,29 @@ static inline BOOL is_function_prop(dispex_prop_t *prop) return ret; } +static inline BOOL override_idx(jsdisp_t *This, const WCHAR *name, unsigned *ret_idx) +{ + /* Typed Arrays override every positive index */ + if(This->builtin_info->class >= FIRST_TYPEDARRAY_JSCLASS && This->builtin_info->class <= LAST_TYPEDARRAY_JSCLASS) { + const WCHAR *ptr; + unsigned idx = 0; + + for(ptr = name; is_digit(*ptr) && idx <= (UINT_MAX-9 / 10); ptr++) + idx = idx*10 + (*ptr-'0'); + if(!*ptr) { + *ret_idx = idx; + return TRUE; + }else { + while(is_digit(*ptr)) ptr++; + if(!*ptr) { + *ret_idx = UINT_MAX; + return TRUE; + } + } + } + return FALSE; +} + static DWORD get_flags(jsdisp_t *This, dispex_prop_t *prop) { if(prop->type == PROP_PROTREF) { @@ -232,6 +263,50 @@ static inline dispex_prop_t* alloc_prop(jsdisp_t *This, const WCHAR *name, prop_ return prop; } +static HRESULT alloc_proxy_prop(jsdisp_t *This, struct proxy_prop_info *info, dispex_prop_t **ret) +{ + dispex_prop_t *prop; + jsdisp_t *funcs[2]; + prop_type_t type; + HRESULT hres; + + if(!info->func[0].invoke) + type = PROP_PROXY; + else { + hres = create_proxy_functions(This, info, funcs); + if(FAILED(hres)) + return hres; + type = (info->flags & PROPF_METHOD) ? PROP_JSVAL : PROP_ACCESSOR; + } + + if((prop = *ret)) { + prop->type = type; + prop->flags = info->flags & PROPF_ALL; + }else { + prop = alloc_prop(This, info->name, type, info->flags & PROPF_ALL); + if(!prop) { + if(type != PROP_PROXY) { + jsdisp_release(funcs[0]); + if(funcs[1]) + jsdisp_release(funcs[1]); + } + return E_OUTOFMEMORY; + } + *ret = prop; + } + + if(type == PROP_PROXY) + prop->u.proxy_id = info->dispid; + else if(type == PROP_JSVAL) + prop->u.val = jsval_obj(funcs[0]); + else { + prop->u.accessor.getter = funcs[0]; + prop->u.accessor.setter = funcs[1]; + } + + return S_OK; +} + static dispex_prop_t *alloc_protref(jsdisp_t *This, const WCHAR *name, DWORD ref) { dispex_prop_t *ret; @@ -244,12 +319,9 @@ static dispex_prop_t *alloc_protref(jsdisp_t *This, const WCHAR *name, DWORD ref return ret; } -static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) +static dispex_prop_t *find_prop_name_raw(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens) { - const builtin_prop_t *builtin; unsigned bucket, pos, prev = ~0; - dispex_prop_t *prop; - HRESULT hres; bucket = get_props_idx(This, hash); pos = This->props[bucket].bucket_head; @@ -261,13 +333,37 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, This->props[bucket].bucket_head = pos; } - *ret = &This->props[pos]; - return S_OK; + return &This->props[pos]; } prev = pos; pos = This->props[pos].bucket_next; } + return NULL; +} + +static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) +{ + dispex_prop_t *prop = find_prop_name_raw(This, hash, name, case_insens); + const builtin_prop_t *builtin; + HRESULT hres; + + if(prop) { + hres = fix_overridden_prop(This, prop); + *ret = prop; + return hres; + } + + if(This->proxy) { + struct proxy_prop_info info; + hres = This->proxy->lpVtbl->PropGetInfo(This->proxy, name, case_insens, &info); + if(hres == S_OK) { + *ret = NULL; + return alloc_proxy_prop(This, &info, ret); + } + if(hres != DISP_E_UNKNOWNNAME) + return hres; + } builtin = find_builtin_prop(This, name, case_insens); if(builtin) { @@ -385,12 +481,72 @@ static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_ } prop->u.val = jsval_undefined(); + + if(This->proxy) { + struct proxy_prop_info info; + + info.name = name; + hres = This->proxy->lpVtbl->PropDefineOverride(This->proxy, &info); + if(hres == S_FALSE) + hres = S_OK; + else if(SUCCEEDED(hres)) + hres = alloc_proxy_prop(This, &info, &prop); + } } *ret = prop; return hres; } +static HRESULT fix_overridden_prop(jsdisp_t *This, dispex_prop_t *prop) +{ + struct proxy_prop_info info; + HRESULT hres; + + if(!This->proxy) + return S_OK; + + info.name = prop->name; + info.dispid = DISPID_UNKNOWN; + + switch(prop->type) { + case PROP_PROXY: + info.dispid = prop->u.proxy_id; + break; + case PROP_PROTREF: + case PROP_DELETED: + break; + default: + return S_OK; + } + + hres = This->proxy->lpVtbl->PropFixOverride(This->proxy, &info); + if(hres != S_OK) + return FAILED(hres) ? hres : S_OK; + + /* Either the prop was restored (to PROP_PROXY), or it was removed */ + if(info.dispid == DISPID_UNKNOWN) { + if(This->prototype) { + dispex_prop_t *prot_prop; + + hres = find_prop_name_prot(This->prototype, prop->hash, prop->name, FALSE, &prot_prop); + if(FAILED(hres)) + return hres; + if(prot_prop && prot_prop->type != PROP_DELETED) { + prop->type = PROP_PROTREF; + prop->u.ref = prot_prop - This->prototype->props; + return hres; + } + } + prop->type = PROP_DELETED; + }else { + info.func[0].invoke = NULL; + hres = alloc_proxy_prop(This, &info, &prop); + } + + return hres; +} + static IDispatch *get_this(DISPPARAMS *dp) { DWORD i; @@ -442,16 +598,88 @@ static HRESULT convert_params(script_ctx_t *ctx, const DISPPARAMS *dp, jsval_t * return S_OK; } -static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, jsval_t *r) +static HRESULT proxy_disp_call(jsdisp_t *This, jsval_t vthis, DISPID id, unsigned flags, unsigned argc, + jsval_t *argv, jsval_t *ret, IServiceProvider *caller) +{ + DISPPARAMS dp = { NULL, NULL, argc, 0 }; + IDispatch *this_obj, *converted = NULL; + script_ctx_t *ctx = This->ctx; + EXCEPINFO ei = { 0 }; + VARIANT buf[6], retv; + jsdisp_t *jsdisp; + HRESULT hres; + unsigned i; + + if(!ctx->global) + return E_UNEXPECTED; + + if(dp.cArgs <= ARRAY_SIZE(buf)) + dp.rgvarg = buf; + else if(!(dp.rgvarg = malloc(dp.cArgs * sizeof(*dp.rgvarg)))) + return E_OUTOFMEMORY; + + for(i = 0; i < dp.cArgs; i++) { + hres = jsval_to_variant(argv[i], &dp.rgvarg[dp.cArgs - i - 1]); + if(FAILED(hres)) + goto cleanup; + } + + if(is_undefined(vthis) || is_null(vthis)) + this_obj = lookup_global_host(ctx); + else { + hres = to_object(ctx, vthis, &converted); + if(FAILED(hres)) + goto cleanup; + this_obj = converted; + } + + jsdisp = to_jsdisp(this_obj); + if(jsdisp && jsdisp->proxy) + this_obj = (IDispatch*)jsdisp->proxy; + + V_VT(&retv) = VT_EMPTY; + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; + hres = This->proxy->lpVtbl->PropInvoke(This->proxy, this_obj, id, ctx->lcid, flags, &dp, ret ? &retv : NULL, &ei, caller); + if(converted) + IDispatch_Release(converted); + + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(ctx, &ei); + else if(SUCCEEDED(hres) && ret) { + hres = variant_to_jsval(ctx, &retv, ret); + VariantClear(&retv); + } + +cleanup: + while(i--) + VariantClear(&dp.rgvarg[i]); + if(dp.rgvarg != buf) + free(dp.rgvarg); + return hres; +} + +static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, jsval_t *r, IServiceProvider *caller) { jsdisp_t *prop_obj = This; HRESULT hres; + VARIANT var; while(prop->type == PROP_PROTREF) { prop_obj = prop_obj->prototype; prop = prop_obj->props + prop->u.ref; } + if(prop_obj->proxy) { + hres = prop_obj->proxy->lpVtbl->PropOverride(prop_obj->proxy, prop->name, &var); + if(hres != S_FALSE) { + if(SUCCEEDED(hres)) { + hres = variant_to_jsval(This->ctx, &var, r); + VariantClear(&var); + } + goto done; + } + } + switch(prop->type) { case PROP_BUILTIN: hres = prop->u.p->getter(This->ctx, prop_obj, r); @@ -462,12 +690,31 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, case PROP_ACCESSOR: if(prop->u.accessor.getter) { hres = jsdisp_call_value(prop->u.accessor.getter, jsval_disp(jsthis), - DISPATCH_METHOD, 0, NULL, r); + DISPATCH_METHOD, 0, NULL, r, caller); }else { *r = jsval_undefined(); hres = S_OK; } break; + case PROP_PROXY: { + DISPPARAMS dp = { 0 }; + EXCEPINFO ei = { 0 }; + jsdisp_t *jsdisp; + + if((jsdisp = to_jsdisp(jsthis)) && jsdisp->proxy) + jsthis = (IDispatch*)jsdisp->proxy; + + V_VT(&var) = VT_EMPTY; + hres = prop_obj->proxy->lpVtbl->PropInvoke(prop_obj->proxy, jsthis, prop->u.proxy_id, This->ctx->lcid, + DISPATCH_PROPERTYGET, &dp, &var, &ei, caller); + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(This->ctx, &ei); + else if(SUCCEEDED(hres)) { + hres = variant_to_jsval(This->ctx, &var, r); + VariantClear(&var); + } + break; + } case PROP_IDX: hres = prop_obj->builtin_info->idx_get(prop_obj, prop->u.idx, r); break; @@ -475,7 +722,10 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, ERR("type %d\n", prop->type); return E_FAIL; } + if(SUCCEEDED(hres)) + hres = convert_to_proxy(This->ctx, r); +done: if(FAILED(hres)) { TRACE("fail %08lx\n", hres); return hres; @@ -485,8 +735,9 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, return hres; } -static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) +static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServiceProvider *caller) { + jsdisp_t *prop_obj = This; HRESULT hres; if(prop->type == PROP_PROTREF) { @@ -498,8 +749,10 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) prop_iter = prototype_iter->props + prop_iter->u.ref; } while(prop_iter->type == PROP_PROTREF); - if(prop_iter->type == PROP_ACCESSOR) + if(prop_iter->type == PROP_ACCESSOR) { + prop_obj = prototype_iter; prop = prop_iter; + } } switch(prop->type) { @@ -528,7 +781,32 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) TRACE("no setter\n"); return S_OK; } - return jsdisp_call_value(prop->u.accessor.setter, jsval_obj(This), DISPATCH_METHOD, 1, &val, NULL); + return jsdisp_call_value(prop->u.accessor.setter, jsval_obj(This), DISPATCH_METHOD, 1, &val, NULL, caller); + case PROP_PROXY: { + static DISPID propput_dispid = DISPID_PROPERTYPUT; + EXCEPINFO ei = { 0 }; + VARIANT var; + DISPPARAMS dp = { &var, &propput_dispid, 1, 1 }; + + if(!(prop->flags & PROPF_WRITABLE)) + return S_OK; + hres = jsval_to_variant(val, &var); + if(FAILED(hres)) + return hres; + + hres = prop_obj->proxy->lpVtbl->PropInvoke(prop_obj->proxy, This->proxy ? (IDispatch*)This->proxy : to_disp(This), + prop->u.proxy_id, This->ctx->lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, caller); + VariantClear(&var); + if(hres == S_FALSE) { + prop->type = PROP_JSVAL; + prop->flags = PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE; + prop->u.val = jsval_undefined(); + break; + } + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(This->ctx, &ei); + return hres; + } case PROP_IDX: if(!This->builtin_info->idx_put) { TRACE("no put_idx\n"); @@ -579,7 +857,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t case PROP_IDX: { jsval_t val; - hres = prop_get(This, jsthis ? jsthis : (IDispatch *)&This->IDispatchEx_iface, prop, &val); + hres = prop_get(This, jsthis ? jsthis : (IDispatch *)&This->IDispatchEx_iface, prop, &val, caller); if(FAILED(hres)) return hres; @@ -595,6 +873,9 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t jsval_release(val); return hres; } + case PROP_PROXY: + return proxy_disp_call(This, jsval_disp(jsthis ? jsthis : (IDispatch*)&This->IDispatchEx_iface), + prop->u.proxy_id, flags, argc, argv, r, caller); case PROP_DELETED: assert(0); break; @@ -614,6 +895,12 @@ static HRESULT fill_props(jsdisp_t *obj) dispex_prop_t *prop; HRESULT hres; + if(obj->proxy) { + hres = obj->proxy->lpVtbl->PropEnum(obj->proxy); + if(FAILED(hres)) + return hres; + } + if(obj->builtin_info->idx_length) { unsigned i = 0, len = obj->builtin_info->idx_length(obj); WCHAR name[12]; @@ -632,6 +919,7 @@ static HRESULT fill_props(jsdisp_t *obj) static HRESULT fill_protrefs(jsdisp_t *This) { dispex_prop_t *iter, *prop; + unsigned idx; HRESULT hres; hres = fill_props(This); @@ -646,6 +934,8 @@ static HRESULT fill_protrefs(jsdisp_t *This) return hres; for(iter = This->prototype->props; iter < This->prototype->props+This->prototype->prop_cnt; iter++) { + if(override_idx(This, iter->name, &idx)) + continue; hres = find_prop_name(This, iter->hash, iter->name, FALSE, &prop); if(FAILED(hres)) return hres; @@ -783,6 +1073,7 @@ HRESULT gc_run(script_ctx_t *ctx) struct chunk *next; LONG ref[1020]; } *head, *chunk; + struct thread_data *thread_data = ctx->thread_data; jsdisp_t *obj, *obj2, *link, *link2; dispex_prop_t *prop, *props_end; struct gc_ctx gc_ctx = { 0 }; @@ -791,16 +1082,20 @@ HRESULT gc_run(script_ctx_t *ctx) struct list *iter; /* Prevent recursive calls from side-effects during unlinking (e.g. CollectGarbage from host object's Release) */ - if(ctx->gc_is_unlinking) + if(thread_data->gc_is_unlinking) return S_OK; + thread_data->gc_is_unlinking = TRUE; + cc_api.collect(); + thread_data->gc_is_unlinking = FALSE; + if(!(head = malloc(sizeof(*head)))) return E_OUTOFMEMORY; head->next = NULL; chunk = head; /* 1. Save actual refcounts and decrease them speculatively as-if we unlinked the objects */ - LIST_FOR_EACH_ENTRY(obj, &ctx->objects, jsdisp_t, entry) { + LIST_FOR_EACH_ENTRY(obj, &thread_data->objects, jsdisp_t, entry) { if(chunk_idx == ARRAY_SIZE(chunk->ref)) { if(!(chunk->next = malloc(sizeof(*chunk)))) { do { @@ -815,17 +1110,17 @@ HRESULT gc_run(script_ctx_t *ctx) } chunk->ref[chunk_idx++] = obj->ref; } - LIST_FOR_EACH_ENTRY(obj, &ctx->objects, jsdisp_t, entry) { + LIST_FOR_EACH_ENTRY(obj, &thread_data->objects, jsdisp_t, entry) { for(prop = obj->props, props_end = prop + obj->prop_cnt; prop < props_end; prop++) { switch(prop->type) { case PROP_JSVAL: - if(is_object_instance(prop->u.val) && (link = to_jsdisp(get_object(prop->u.val))) && link->ctx == ctx) + if(is_object_instance(prop->u.val) && (link = to_jsdisp(get_object(prop->u.val)))) link->ref--; break; case PROP_ACCESSOR: - if(prop->u.accessor.getter && prop->u.accessor.getter->ctx == ctx) + if(prop->u.accessor.getter) prop->u.accessor.getter->ref--; - if(prop->u.accessor.setter && prop->u.accessor.setter->ctx == ctx) + if(prop->u.accessor.setter) prop->u.accessor.setter->ref--; break; default: @@ -833,7 +1128,7 @@ HRESULT gc_run(script_ctx_t *ctx) } } - if(obj->prototype && obj->prototype->ctx == ctx) + if(obj->prototype) obj->prototype->ref--; if(obj->builtin_info->gc_traverse) obj->builtin_info->gc_traverse(&gc_ctx, GC_TRAVERSE_SPECULATIVELY, obj); @@ -841,8 +1136,8 @@ HRESULT gc_run(script_ctx_t *ctx) } /* 2. Clear mark on objects with non-zero "external refcount" and all objects accessible from them */ - LIST_FOR_EACH_ENTRY(obj, &ctx->objects, jsdisp_t, entry) { - if(!obj->ref || !obj->gc_marked) + LIST_FOR_EACH_ENTRY(obj, &thread_data->objects, jsdisp_t, entry) { + if(!obj->gc_marked || (!obj->ref && !obj->proxy)) continue; hres = gc_stack_push(&gc_ctx, NULL); @@ -869,12 +1164,12 @@ HRESULT gc_run(script_ctx_t *ctx) default: continue; } - if(link && link->gc_marked && link->ctx == ctx) { + if(link && link->gc_marked) { hres = gc_stack_push(&gc_ctx, link); if(FAILED(hres)) break; } - if(link2 && link2->gc_marked && link2->ctx == ctx) { + if(link2 && link2->gc_marked) { hres = gc_stack_push(&gc_ctx, link2); if(FAILED(hres)) break; @@ -884,7 +1179,7 @@ HRESULT gc_run(script_ctx_t *ctx) if(FAILED(hres)) break; - if(obj2->prototype && obj2->prototype->gc_marked && obj2->prototype->ctx == ctx) { + if(obj2->prototype && obj2->prototype->gc_marked) { hres = gc_stack_push(&gc_ctx, obj2->prototype); if(FAILED(hres)) break; @@ -899,7 +1194,7 @@ HRESULT gc_run(script_ctx_t *ctx) /* For weak refs, traverse paths accessible from it via the WeakMaps, if the WeakMaps are alive at this point. We need both the key and the WeakMap for the entry to actually be accessible (and thus traversed). */ if(obj2->has_weak_refs) { - struct list *list = &RB_ENTRY_VALUE(rb_get(&ctx->weak_refs, obj2), struct weak_refs_entry, entry)->list; + struct list *list = &RB_ENTRY_VALUE(rb_get(&thread_data->weak_refs, obj2), struct weak_refs_entry, entry)->list; struct weakmap_entry *entry; LIST_FOR_EACH_ENTRY(entry, list, struct weakmap_entry, weak_refs_entry) { @@ -926,7 +1221,7 @@ HRESULT gc_run(script_ctx_t *ctx) /* Restore */ chunk = head; chunk_idx = 0; - LIST_FOR_EACH_ENTRY(obj, &ctx->objects, jsdisp_t, entry) { + LIST_FOR_EACH_ENTRY(obj, &thread_data->objects, jsdisp_t, entry) { obj->ref = chunk->ref[chunk_idx++]; if(chunk_idx == ARRAY_SIZE(chunk->ref)) { struct chunk *next = chunk->next; @@ -940,13 +1235,13 @@ HRESULT gc_run(script_ctx_t *ctx) return hres; /* 3. Remove all the links from the marked objects, since they are dangling */ - ctx->gc_is_unlinking = TRUE; + thread_data->gc_is_unlinking = TRUE; - iter = list_head(&ctx->objects); + iter = list_head(&thread_data->objects); while(iter) { obj = LIST_ENTRY(iter, jsdisp_t, entry); if(!obj->gc_marked) { - iter = list_next(&ctx->objects, iter); + iter = list_next(&thread_data->objects, iter); continue; } @@ -956,12 +1251,12 @@ HRESULT gc_run(script_ctx_t *ctx) /* Releasing unlinked object should not delete any other object, so we can safely obtain the next pointer now */ - iter = list_next(&ctx->objects, iter); + iter = list_next(&thread_data->objects, iter); jsdisp_release(obj); } - ctx->gc_is_unlinking = FALSE; - ctx->gc_last_tick = GetTickCount(); + thread_data->gc_is_unlinking = FALSE; + thread_data->gc_last_tick = GetTickCount(); return S_OK; } @@ -973,8 +1268,6 @@ HRESULT gc_process_linked_obj(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsd return S_OK; } - if(link->ctx != obj->ctx) - return S_OK; if(op == GC_TRAVERSE_SPECULATIVELY) link->ref--; else if(link->gc_marked) @@ -993,7 +1286,7 @@ HRESULT gc_process_linked_val(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsd return S_OK; } - if(!is_object_instance(*link) || !(jsdisp = to_jsdisp(get_object(*link))) || jsdisp->ctx != obj->ctx) + if(!is_object_instance(*link) || !(jsdisp = to_jsdisp(get_object(*link)))) return S_OK; if(op == GC_TRAVERSE_SPECULATIVELY) jsdisp->ref--; @@ -1722,6 +2015,21 @@ static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, }else if(IsEqualGUID(&IID_IDispatchEx, riid)) { TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv); *ppv = &This->IDispatchEx_iface; + }else if(IsEqualGUID(&IID_nsXPCOMCycleCollectionParticipant, riid)) { + /* Only expose these during a full CC, as we can't have their refs change between incremental CC phases */ + if(This->ctx->html_mode && cc_api.is_full_cc()) { + *ppv = &cc_api.participant; + return S_OK; + } + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_nsCycleCollectionISupports, riid)) { + if(This->ctx->html_mode && cc_api.is_full_cc()) { + *ppv = &This->IDispatchEx_iface; + return S_OK; + } + *ppv = NULL; + return E_NOINTERFACE; }else { WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); *ppv = NULL; @@ -1871,7 +2179,7 @@ static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, if(cNames == 0) return S_OK; - hres = jsdisp_get_id(This, rgszNames[0], 0, rgDispId); + hres = jsdisp_get_id(This, rgszNames[0], This->proxy ? fdexNameCaseInsensitive : 0, rgDispId); if(FAILED(hres)) return hres; @@ -1957,7 +2265,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(prop) hres = invoke_prop_func(This, passed_this, prop, wFlags, argc, argv, pvarRes ? &r : NULL, pspCaller); else - hres = jsdisp_call_value(This, passed_this ? jsval_disp(passed_this) : jsval_undefined(), wFlags, argc, argv, pvarRes ? &r : NULL); + hres = jsdisp_call_value(This, passed_this ? jsval_disp(passed_this) : jsval_undefined(), + wFlags, argc, argv, pvarRes ? &r : NULL, pspCaller); while(argc--) jsval_release(argv[argc]); @@ -1973,7 +2282,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc jsval_t r; if(prop) - hres = prop_get(This, to_disp(This), prop, &r); + hres = prop_get(This, to_disp(This), prop, &r, pspCaller); else { hres = to_primitive(This->ctx, jsval_obj(This), &r, NO_HINT); if(hres == JS_E_TO_PRIMITIVE) @@ -2012,7 +2321,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(FAILED(hres)) break; - hres = prop_put(This, prop, val); + hres = prop_put(This, prop, val, pspCaller); jsval_release(val); break; } @@ -2028,13 +2337,21 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc return leave_script(This->ctx, hres); } -static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret) +static HRESULT delete_prop(jsdisp_t *prop_obj, dispex_prop_t *prop, BOOL *ret) { if(prop->type == PROP_PROTREF) { *ret = TRUE; return S_OK; } + if(prop_obj->proxy) { + HRESULT hres = prop_obj->proxy->lpVtbl->PropOverride(prop_obj->proxy, prop->name, NULL); + if(hres != S_FALSE) { + *ret = TRUE; + return hres; + } + } + if(!(prop->flags & PROPF_CONFIGURABLE)) { *ret = FALSE; return S_OK; @@ -2042,6 +2359,12 @@ static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret) *ret = TRUE; + if(prop->type == PROP_PROXY) { + HRESULT hres = prop_obj->proxy->lpVtbl->PropDelete(prop_obj->proxy, prop->u.proxy_id); + if(SUCCEEDED(hres)) + prop->type = PROP_DELETED; + return hres; + } if(prop->type == PROP_JSVAL) jsval_release(prop->u.val); if(prop->type == PROP_ACCESSOR) { @@ -2058,6 +2381,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst { jsdisp_t *This = impl_from_IDispatchEx(iface); dispex_prop_t *prop; + unsigned idx; BOOL b; HRESULT hres; @@ -2066,6 +2390,9 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %lx\n", grfdex); + if(override_idx(This, bstrName, &idx)) + return S_OK; + hres = find_prop_name(This, string_hash(bstrName), bstrName, grfdex & fdexNameCaseInsensitive, &prop); if(FAILED(hres)) return hres; @@ -2074,7 +2401,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst return S_OK; } - return delete_prop(prop, &b); + return delete_prop(This, prop, &b); } static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) @@ -2091,7 +2418,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID return DISP_E_MEMBERNOTFOUND; } - return delete_prop(prop, &b); + return delete_prop(This, prop, &b); } static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) @@ -2140,7 +2467,336 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown return E_NOTIMPL; } -static IDispatchExVtbl DispatchExVtbl = { +/* ECMA-262 5.1 Edition 15.1 */ +static HRESULT set_js_globals(jsdisp_t *obj) +{ + jsdisp_t *js_global = obj->ctx->js_global; + const builtin_prop_t *bprop, *bend; + dispex_prop_t *prop, *end, *dst; + HRESULT hres; + BOOL b; + + /* Reset builtins first */ + obj->builtin_info = js_global->builtin_info; + for(bprop = obj->builtin_info->props, bend = bprop + obj->builtin_info->props_cnt; bprop != bend; bprop++) { + unsigned hash = string_hash(bprop->name); + if(!(prop = find_prop_name_raw(obj, hash, bprop->name, FALSE)) || prop->type == PROP_BUILTIN) + continue; + if(bprop->flags & PROPF_METHOD) { + /* Make sure the builtin method is created as a function so it gets copied later */ + hres = find_prop_name(js_global, hash, bprop->name, FALSE, &prop); + if(FAILED(hres)) + return hres; + }else { + prop->flags |= PROPF_CONFIGURABLE; + delete_prop(obj, prop, &b); + prop->flags = (bprop->flags & PROPF_ALL) | (bprop->setter ? PROPF_WRITABLE : 0); + prop->type = PROP_BUILTIN; + prop->u.p = bprop; + } + } + + /* Copy the rest of the props */ + for(prop = js_global->props, end = prop + js_global->prop_cnt; prop != end; prop++) { + if(prop->type != PROP_JSVAL && prop->type != PROP_ACCESSOR) + continue; + + /* Alloc it ourselves so we don't look into proxy props when defining it */ + if(!(dst = find_prop_name_raw(obj, prop->hash, prop->name, FALSE))) { + if(!(dst = alloc_prop(obj, prop->name, PROP_DELETED, 0))) + return E_OUTOFMEMORY; + }else { + dst->flags |= PROPF_CONFIGURABLE; + delete_prop(obj, dst, &b); + } + + dst->flags = prop->flags; + dst->type = prop->type; + if(prop->type == PROP_JSVAL) { + hres = jsval_copy(prop->u.val, &dst->u.val); + if(FAILED(hres)) + return hres; + }else { + dst->u.accessor.getter = prop->u.accessor.getter ? jsdisp_addref(prop->u.accessor.getter) : NULL; + dst->u.accessor.setter = prop->u.accessor.setter ? jsdisp_addref(prop->u.accessor.setter) : NULL; + } + } + + return S_OK; +} + +static HRESULT get_proxy_default_prototype(script_ctx_t *ctx, IWineDispatchProxyPrivate *proxy, jsdisp_t **prot) +{ + IDispatch *disp = proxy->lpVtbl->GetDefaultPrototype(proxy, ctx->global->proxy); + HRESULT hres; + + if(!disp) + return E_OUTOFMEMORY; + + if(disp == WINE_DISP_PROXY_NULL_PROTOTYPE) + *prot = NULL; + else if(disp == WINE_DISP_PROXY_OBJECT_PROTOTYPE) + *prot = jsdisp_addref(ctx->object_prototype); + else { + jsval_t tmp = jsval_disp(disp); + hres = convert_to_proxy(ctx, &tmp); + if(FAILED(hres)) + return hres; + *prot = as_jsdisp(get_object(tmp)); + } + return S_OK; +} + +static HRESULT get_proxy_default_constructor(script_ctx_t *ctx, jsdisp_t *jsdisp, jsdisp_t **ctor) +{ + jsdisp_t *old_global = ctx->global; + IDispatch *disp; + HRESULT hres; + jsval_t tmp; + + /* This may end up in CreateConstructor from a nested GetDefaultConstructor via some + * prototype's setup, if we're actually calling it on the window, which would define + * all of the constructors, and that assumes the global to be the one required. But + * in this case we haven't even finished setting up the window, so set it temporarily. */ + ctx->global = jsdisp; + hres = jsdisp->proxy->lpVtbl->GetDefaultConstructor(jsdisp->proxy, old_global->proxy, &disp); + ctx->global = old_global; + if(FAILED(hres)) + return hres; + + if(!disp) { + /* Set the globals on it if we're the window itself (not the prototype). + * We also have to set the props on the constructor and prototype, because + * we had to skip them earlier, since our window was *not* set up yet... */ + if(hres == S_FALSE) { + hres = set_js_globals(jsdisp); + if(SUCCEEDED(hres)) { + dispex_prop_t *ctor_prop = find_prop_name_raw(jsdisp, string_hash(L"Window"), L"Window", FALSE); + jsdisp_t *ctor_obj; + + if(ctor_prop && ctor_prop->type == PROP_JSVAL && is_object_instance(ctor_prop->u.val) && + (ctor_obj = to_jsdisp(get_object(ctor_prop->u.val)))) + { + hres = jsdisp_define_data_property(ctor_obj, L"prototype", 0, jsval_obj(jsdisp->prototype)); + if(SUCCEEDED(hres)) + hres = jsdisp_define_data_property(jsdisp->prototype, L"constructor", PROPF_WRITABLE | PROPF_CONFIGURABLE, jsval_obj(ctor_obj)); + } + } + } + *ctor = NULL; + return hres; + } + + tmp = jsval_disp(disp); + hres = convert_to_proxy(ctx, &tmp); + if(FAILED(hres)) + return hres; + *ctor = as_jsdisp(get_object(tmp)); + + hres = jsdisp_define_data_property(*ctor, L"prototype", 0, jsval_obj(jsdisp)); + if(FAILED(hres)) + jsdisp_release(*ctor); + return hres; +} + +static inline jsdisp_t *impl_from_IWineDispatchProxyCbPrivate(IWineDispatchProxyCbPrivate *iface) +{ + return impl_from_IDispatchEx((IDispatchEx*)iface); +} + +static HRESULT WINAPI WineDispatchProxyCbPrivate_InitProxy(IWineDispatchProxyCbPrivate *iface, IDispatch *obj) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + script_ctx_t *ctx = This->ctx; + jsval_t val = jsval_disp(obj); + HRESULT hres; + + if(!ctx->global) + return E_UNEXPECTED; /* Let caller know it has to initialize the host */ + + IDispatch_AddRef(obj); + hres = convert_to_proxy(ctx, &val); + if(SUCCEEDED(hres)) + jsval_release(val); + return hres; +} + +static void WINAPI WineDispatchProxyCbPrivate_Unlinked(IWineDispatchProxyCbPrivate *iface, BOOL persist) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + + if(!persist) { + IWineDispatchProxyPrivate *proxy = This->proxy; + + This->proxy = NULL; + if(!This->ref) { + jsdisp_free(This); + return; + } + + /* We hold a ref only when we're not dangling */ + IDispatchEx_Release((IDispatchEx*)proxy); + } + unlink_jsdisp(This); +} + +static HRESULT WINAPI WineDispatchProxyCbPrivate_HostUpdated(IWineDispatchProxyCbPrivate *iface, IActiveScript *script) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + script_ctx_t *ctx = get_script_ctx(script); + dispex_prop_t *prop, *end; + jsdisp_t *prot, *ctor; + HRESULT hres; + BOOL b; + + if(!ctx || !ctx->global) + return S_OK; + + if(This->ctx != ctx) { + if(ctx->version < SCRIPTLANGUAGEVERSION_ES5) { + /* Incompatible compat mode, so unlink the proxy */ + *This->proxy->lpVtbl->GetProxyFieldRef(This->proxy) = NULL; + iface->lpVtbl->Unlinked(iface, FALSE); + return S_OK; + } + + hres = get_proxy_default_prototype(ctx, This->proxy, &prot); + if(FAILED(hres)) + return hres; + + if(This->ref) { + list_remove(&This->entry); + list_add_tail(&get_thread_data()->objects, &This->entry); + } + script_release(This->ctx); + script_addref(ctx); + This->ctx = ctx; + + hres = jsdisp_change_prototype(This, prot); + if(prot) + jsdisp_release(prot); + if(FAILED(hres)) + return hres; + } + + /* It's safe to repopulate the builtin proxy props now, since the mode is already locked */ + for(prop = This->props, end = prop + This->prop_cnt; prop < end; prop++) { + struct proxy_prop_info info; + + if(prop->type == PROP_PROXY) + prop->type = PROP_DELETED; + else { + prop->flags |= PROPF_CONFIGURABLE; + delete_prop(This, prop, &b); + } + + hres = This->proxy->lpVtbl->PropGetInfo(This->proxy, prop->name, FALSE, &info); + if(hres == S_OK) + alloc_proxy_prop(This, &info, &prop); + } + + /* Populate the constructors on the window */ + hres = get_proxy_default_constructor(ctx, This, &ctor); + assert(FAILED(hres) || ctor == NULL); + return hres; +} + +static IDispatch* WINAPI WineDispatchProxyCbPrivate_CreateConstructor(IWineDispatchProxyCbPrivate *iface, + IDispatch *disp, const char *name) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + jsdisp_t *ctor; + HRESULT hres; + + hres = create_proxy_constructor(disp, name, This, &ctor); + return SUCCEEDED(hres) ? (IDispatch*)&ctor->IDispatchEx_iface : NULL; +} + +static HRESULT WINAPI WineDispatchProxyCbPrivate_DefineConstructor(IWineDispatchProxyCbPrivate *iface, + const char *name, IDispatch *prot_disp, IDispatch *ctor_disp) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + jsval_t val = jsval_disp(prot_disp); + jsdisp_t *prot, *ctor; + unsigned i = 0, hash; + dispex_prop_t *prop; + WCHAR nameW[64]; + HRESULT hres; + BOOL b; + + do nameW[i] = name[i]; while(name[i++]); + assert(i <= ARRAY_SIZE(nameW)); + + hres = convert_to_proxy(This->ctx, &val); + if(FAILED(hres)) + return hres; + prot = as_jsdisp(get_object(val)); + + if(ctor_disp) + hres = create_proxy_constructor(ctor_disp, name, prot, &ctor); + else { + /* The prototype's proxy should have already set up the constructor, so this can't fail */ + IDispatch *tmp_disp; + prot->proxy->lpVtbl->GetDefaultConstructor(prot->proxy, This->proxy, &tmp_disp); + val = jsval_disp(tmp_disp); + convert_to_proxy(This->ctx, &val); + ctor = as_jsdisp(get_object(val)); + } + jsdisp_release(prot); + if(FAILED(hres)) + return hres; + + /* Remove the builtin proxy prop from the prototype (first time only), since it's part of the object itself */ + hash = string_hash(nameW); + if(!find_prop_name_raw(This->prototype, hash, nameW, FALSE) && !alloc_prop(This->prototype, nameW, PROP_DELETED, 0)) { + hres = E_OUTOFMEMORY; + goto end; + } + + /* Define the constructor forcefully, so make sure to not look into the underlying proxy dispids, + otherwise it might pick up elements by this id. And if any found, force it to be configurable. */ + prop = find_prop_name_raw(This, hash, nameW, FALSE); + if(prop) { + prop->flags |= PROPF_CONFIGURABLE; + delete_prop(This, prop, &b); + }else if(!(prop = alloc_prop(This, nameW, PROP_DELETED, 0))) { + hres = E_OUTOFMEMORY; + goto end; + } + + hres = jsval_copy(jsval_obj(ctor), &prop->u.val); + if(FAILED(hres)) + goto end; + prop->type = PROP_JSVAL; + prop->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; + +end: + jsdisp_release(ctor); + return hres; +} + +static HRESULT WINAPI WineDispatchProxyCbPrivate_CreateObject(IWineDispatchProxyCbPrivate *iface, IDispatchEx **obj) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + jsdisp_t *jsdisp; + HRESULT hres; + + hres = create_object(This->ctx, NULL, &jsdisp); + if(SUCCEEDED(hres)) + *obj = &jsdisp->IDispatchEx_iface; + return hres; +} + +static HRESULT WINAPI WineDispatchProxyCbPrivate_PropEnum(IWineDispatchProxyCbPrivate *iface, const WCHAR *name) +{ + jsdisp_t *This = impl_from_IWineDispatchProxyCbPrivate(iface); + dispex_prop_t *prop; + + return find_prop_name(This, string_hash(name), name, FALSE, &prop); +} + +static IWineDispatchProxyCbPrivateVtbl WineDispatchProxyCbPrivateVtbl = { + { DispatchEx_QueryInterface, DispatchEx_AddRef, DispatchEx_Release, @@ -2156,17 +2812,29 @@ static IDispatchExVtbl DispatchExVtbl = { DispatchEx_GetMemberName, DispatchEx_GetNextDispID, DispatchEx_GetNameSpaceParent + }, + + /* IWineDispatchProxyCbPrivate extension */ + WineDispatchProxyCbPrivate_InitProxy, + WineDispatchProxyCbPrivate_Unlinked, + WineDispatchProxyCbPrivate_HostUpdated, + WineDispatchProxyCbPrivate_CreateConstructor, + WineDispatchProxyCbPrivate_DefineConstructor, + WineDispatchProxyCbPrivate_CreateObject, + WineDispatchProxyCbPrivate_CreateArrayBuffer, + WineDispatchProxyCbPrivate_GetRandomValues, + WineDispatchProxyCbPrivate_PropEnum }; jsdisp_t *as_jsdisp(IDispatch *disp) { - assert(disp->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl); + assert(disp->lpVtbl == (IDispatchVtbl*)&WineDispatchProxyCbPrivateVtbl); return impl_from_IDispatchEx((IDispatchEx*)disp); } jsdisp_t *to_jsdisp(IDispatch *disp) { - return disp->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl ? impl_from_IDispatchEx((IDispatchEx*)disp) : NULL; + return disp->lpVtbl == (IDispatchVtbl*)&WineDispatchProxyCbPrivateVtbl ? impl_from_IDispatchEx((IDispatchEx*)disp) : NULL; } HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype) @@ -2174,12 +2842,12 @@ HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *b unsigned i; /* FIXME: Use better heuristics to decide when to run the GC */ - if(GetTickCount() - ctx->gc_last_tick > 30000) + if(GetTickCount() - ctx->thread_data->gc_last_tick > 30000) gc_run(ctx); TRACE("%p (%p)\n", dispex, prototype); - dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; + dispex->IDispatchEx_iface.lpVtbl = (const IDispatchExVtbl*)&WineDispatchProxyCbPrivateVtbl; dispex->ref = 1; dispex->builtin_info = builtin_info; dispex->extensible = TRUE; @@ -2201,7 +2869,7 @@ HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *b script_addref(ctx); dispex->ctx = ctx; - list_add_tail(&ctx->objects, &dispex->entry); + list_add_tail(&ctx->thread_data->objects, &dispex->entry); return S_OK; } @@ -2232,16 +2900,113 @@ HRESULT create_dispex(script_ctx_t *ctx, const builtin_info_t *builtin_info, jsd return S_OK; } +static const builtin_info_t proxy_dispex_info = { + JSCLASS_OBJECT, + NULL, + 0, NULL, + NULL, + NULL +}; + +HRESULT convert_to_proxy(script_ctx_t *ctx, jsval_t *val) +{ + IWineDispatchProxyCbPrivate **proxy_ref; + IWineDispatchProxyPrivate *proxy; + jsdisp_t *jsdisp, *prot, *ctor; + IDispatch *obj; + HRESULT hres; + + if(ctx->version < SCRIPTLANGUAGEVERSION_ES5 || !val || !is_object_instance(*val)) + return S_OK; + obj = get_object(*val); + if(to_jsdisp(obj)) + return S_OK; + + if(FAILED(IDispatch_QueryInterface(obj, &IID_IWineDispatchProxyPrivate, (void**)&proxy)) || !proxy) + return S_OK; + IDispatch_Release(obj); + + if(!*(proxy_ref = proxy->lpVtbl->GetProxyFieldRef(proxy))) { + if(!ctx->global) { + FIXME("Script is uninitialized?\n"); + hres = E_UNEXPECTED; + goto fail; + } + + hres = get_proxy_default_prototype(ctx, proxy, &prot); + if(FAILED(hres)) + goto fail; + if(!prot) + return hres; /* not a JS object */ + + /* It's possible for get_proxy_default_prototype to have initialized the proxy ref, + e.g. locking the document mode while obtaining the dispex info, so re-check it. */ + if(!*proxy_ref) { + jsdisp = NULL; + hres = create_dispex(ctx, &proxy_dispex_info, prot, &jsdisp); + jsdisp_release(prot); + if(FAILED(hres)) + goto fail; + + *proxy_ref = (IWineDispatchProxyCbPrivate*)&jsdisp->IDispatchEx_iface; + jsdisp->proxy = proxy; + + hres = get_proxy_default_constructor(ctx, jsdisp, &ctor); + if(SUCCEEDED(hres) && ctor) { + hres = jsdisp_define_data_property(jsdisp, L"constructor", PROPF_WRITABLE | PROPF_CONFIGURABLE, jsval_obj(ctor)); + jsdisp_release(ctor); + } + if(FAILED(hres)) { + *proxy_ref = NULL; + jsdisp->proxy = NULL; + jsdisp_release(jsdisp); + goto fail; + } + + *val = jsval_obj(jsdisp); + return S_OK; + } + + jsdisp_release(prot); + } + + /* Re-acquire the proxy if it's an old dangling proxy */ + jsdisp = impl_from_IWineDispatchProxyCbPrivate(*proxy_ref); + assert(jsdisp->proxy == proxy); + + if(!jsdisp->ref++) + list_add_tail(&get_thread_data()->objects, &jsdisp->entry); + else + IDispatchEx_Release((IDispatchEx*)proxy); /* already held by jsdisp */ + + TRACE("re-acquired %p\n", jsdisp); + *val = jsval_obj(jsdisp); + return S_OK; + +fail: + IDispatchEx_Release((IDispatchEx*)proxy); + return hres; +} + void jsdisp_free(jsdisp_t *obj) { dispex_prop_t *prop; list_remove(&obj->entry); + /* If it's a proxy, stay alive and keep it associated with the disp, since + we can be re-acquired at some later point. When the underlying disp is + actually destroyed, it should unlink us and then we free it for real. */ + if(obj->proxy) { + list_init(&obj->entry); + IDispatchEx_Release((IDispatchEx*)obj->proxy); + return; + } + TRACE("(%p)\n", obj); if(obj->has_weak_refs) { - struct list *list = &RB_ENTRY_VALUE(rb_get(&obj->ctx->weak_refs, obj), struct weak_refs_entry, entry)->list; + struct list *list = &RB_ENTRY_VALUE(rb_get(&obj->ctx->thread_data->weak_refs, obj), struct weak_refs_entry, entry)->list; do { remove_weakmap_entry(LIST_ENTRY(list->next, struct weakmap_entry, weak_refs_entry)); } while(obj->has_weak_refs); @@ -2274,12 +3039,21 @@ void jsdisp_free(jsdisp_t *obj) free(obj); } +void jsdisp_reacquire(jsdisp_t *jsdisp) +{ + list_add_tail(&get_thread_data()->objects, &jsdisp->entry); + if(jsdisp->proxy) + IDispatchEx_AddRef((IDispatchEx*)jsdisp->proxy); +} + #ifdef TRACE_REFCNT jsdisp_t *jsdisp_addref(jsdisp_t *jsdisp) { ULONG ref = ++jsdisp->ref; TRACE("(%p) ref=%ld\n", jsdisp, ref); + if(ref == 1) + jsdisp_reacquire(jsdisp); return jsdisp; } @@ -2305,7 +3079,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built if(SUCCEEDED(hres) && prop && prop->type!=PROP_DELETED) { jsval_t val; - hres = prop_get(constr, to_disp(constr), prop, &val); + hres = prop_get(constr, to_disp(constr), prop, &val, &ctx->jscaller->IServiceProvider_iface); if(FAILED(hres)) { ERR("Could not get prototype\n"); return hres; @@ -2328,17 +3102,110 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built jsdisp_t *iface_to_jsdisp(IDispatch *iface) { - return iface->lpVtbl == (const IDispatchVtbl*)&DispatchExVtbl + return iface->lpVtbl == (const IDispatchVtbl*)&WineDispatchProxyCbPrivateVtbl ? jsdisp_addref( impl_from_IDispatchEx((IDispatchEx*)iface)) : NULL; } +static HRESULT WINAPI jsdisp_cc_traverse(void *ccp, void *p, nsCycleCollectionTraversalCallback *cb) +{ + jsdisp_t *This = impl_from_IDispatchEx(p); + note_edge_t note_edge = cc_api.note_edge; + dispex_prop_t *prop = This->props, *end; + + /* If we have a proxy, we don't actually let it hold ref to us (to prevent cyclic refs on every one of them), + but we remain alive even with 0 refcount until it notifies us of being unlinked. However, for the CC to + work properly, we need to fake our reported refcount to it by letting it assume it does hold a ref to us. */ + cc_api.describe_node(This->ref + (This->proxy != NULL), "jsdisp", cb); + + for(end = prop + This->prop_cnt; prop < end; prop++) { + switch(prop->type) { + case PROP_JSVAL: + if(is_object_instance(prop->u.val)) + note_edge((nsISupports*)get_object(prop->u.val), "prop", cb); + break; + case PROP_ACCESSOR: + if(prop->u.accessor.getter) + note_edge((nsISupports*)&prop->u.accessor.getter->IDispatchEx_iface, "prop", cb); + if(prop->u.accessor.setter) + note_edge((nsISupports*)&prop->u.accessor.setter->IDispatchEx_iface, "prop", cb); + break; + default: + break; + } + } + + if(This->prototype) + note_edge((nsISupports*)&This->prototype->IDispatchEx_iface, "prototype", cb); + + if(This->builtin_info->cc_traverse) + This->builtin_info->cc_traverse(This, cb); + + /* We hold a ref when we're not kept alive only by the proxy */ + if(This->proxy && This->ref) + note_edge((nsISupports*)This->proxy, "proxy", cb); + + return S_OK; +} + +static HRESULT WINAPI jsdisp_cc_unlink(void *p) +{ + jsdisp_t *This = impl_from_IDispatchEx(p); + + if(This->proxy) { + IWineDispatchProxyPrivate *proxy = This->proxy; + + This->proxy = NULL; + *proxy->lpVtbl->GetProxyFieldRef(proxy) = NULL; + + if(!This->ref) { + jsdisp_free(This); + return S_OK; + } + IDispatchEx_Release((IDispatchEx*)proxy); + } + + unlink_jsdisp(This); + return S_OK; +} + +static BOOL __cdecl cc_api_stub_is_full_cc(void) { return FALSE; } +static void __cdecl cc_api_stub_collect(void) { } + +struct proxy_cc_api cc_api = { + .is_full_cc = cc_api_stub_is_full_cc, + .collect = cc_api_stub_collect, +}; + +void init_cc_api(IDispatch *disp) +{ + static const CCObjCallback jsdisp_ccp_callback = { + jsdisp_cc_traverse, + jsdisp_cc_unlink, + NULL /* delete_cycle_collectable shouldn't ever be called, since we're never part of the purple buffer */ + }; + IWineDispatchProxyPrivate *proxy; + + if(SUCCEEDED(IDispatch_QueryInterface(disp, &IID_IWineDispatchProxyPrivate, (void**)&proxy)) && proxy) { + proxy->lpVtbl->InitCC(&cc_api, &jsdisp_ccp_callback); + IDispatchEx_Release((IDispatchEx*)proxy); + } +} + HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID *id) { dispex_prop_t *prop; + unsigned idx; HRESULT hres; - if(jsdisp->extensible && (flags & fdexNameEnsure)) + if(override_idx(jsdisp, name, &idx)) { + if(idx >= jsdisp->builtin_info->idx_length(jsdisp)) { + *id = DISPID_UNKNOWN; + return DISP_E_UNKNOWNNAME; + } + hres = find_prop_name(jsdisp, string_hash(name), name, FALSE, &prop); + } + else if(jsdisp->extensible && (flags & fdexNameEnsure)) hres = ensure_prop_name(jsdisp, name, PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE, flags & fdexNameCaseInsensitive, &prop); else @@ -2364,14 +3231,17 @@ HRESULT jsdisp_get_idx_id(jsdisp_t *jsdisp, DWORD idx, DISPID *id) return jsdisp_get_id(jsdisp, name, 0, id); } -HRESULT jsdisp_call_value(jsdisp_t *jsfunc, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +HRESULT jsdisp_call_value(jsdisp_t *jsfunc, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, IServiceProvider *caller) { HRESULT hres; assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT|DISPATCH_JSCRIPT_INTERNAL_MASK))); if(is_class(jsfunc, JSCLASS_FUNCTION)) { - hres = Function_invoke(jsfunc, vthis, flags, argc, argv, r); + hres = Function_invoke(jsfunc, vthis, flags, argc, argv, r, caller); + }else if(jsfunc->proxy) { + hres = proxy_disp_call(jsfunc, vthis, DISPID_VALUE, flags, argc, argv, r, caller); }else { if(!jsfunc->builtin_info->call) { WARN("Not a function\n"); @@ -2384,6 +3254,8 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, jsval_t vthis, WORD flags, unsigned flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; hres = jsfunc->builtin_info->call(jsfunc->ctx, vthis, flags, argc, argv, r); } + if(SUCCEEDED(hres)) + hres = convert_to_proxy(jsfunc->ctx, r); return hres; } @@ -2410,7 +3282,8 @@ HRESULT jsdisp_call_name(jsdisp_t *disp, const WCHAR *name, WORD flags, unsigned if(!prop || prop->type == PROP_DELETED) return JS_E_INVALID_PROPERTY; - return invoke_prop_func(disp, to_disp(disp), prop, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); + hres = invoke_prop_func(disp, to_disp(disp), prop, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); + return (hres == DISP_E_MEMBERNOTFOUND) ? JS_E_INVALID_PROPERTY : hres; } static HRESULT disp_invoke(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *params, VARIANT *r, @@ -2444,22 +3317,28 @@ static HRESULT disp_invoke(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD f hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, params, r, &ei, &err); } - if(hres == DISP_E_EXCEPTION) { - TRACE("DISP_E_EXCEPTION: %08lx %s %s\n", ei.scode, debugstr_w(ei.bstrSource), debugstr_w(ei.bstrDescription)); - reset_ei(ctx->ei); - ctx->ei->error = (SUCCEEDED(ei.scode) || ei.scode == DISP_E_EXCEPTION) ? E_FAIL : ei.scode; - if(ei.bstrSource) - ctx->ei->source = jsstr_alloc_len(ei.bstrSource, SysStringLen(ei.bstrSource)); - if(ei.bstrDescription) - ctx->ei->message = jsstr_alloc_len(ei.bstrDescription, SysStringLen(ei.bstrDescription)); - SysFreeString(ei.bstrSource); - SysFreeString(ei.bstrDescription); - SysFreeString(ei.bstrHelpFile); - } + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(ctx, &ei); return hres; } +void disp_fill_exception(script_ctx_t *ctx, EXCEPINFO *ei) +{ + TRACE("DISP_E_EXCEPTION: %08lx %s %s\n", ei->scode, debugstr_w(ei->bstrSource), debugstr_w(ei->bstrDescription)); + reset_ei(ctx->ei); + if(ei->pfnDeferredFillIn) + ei->pfnDeferredFillIn(ei); + ctx->ei->error = (SUCCEEDED(ei->scode) || ei->scode == DISP_E_EXCEPTION) ? E_FAIL : ei->scode; + if(ei->bstrSource) + ctx->ei->source = jsstr_alloc_len(ei->bstrSource, SysStringLen(ei->bstrSource)); + if(ei->bstrDescription) + ctx->ei->message = jsstr_alloc_len(ei->bstrDescription, SysStringLen(ei->bstrDescription)); + SysFreeString(ei->bstrSource); + SysFreeString(ei->bstrDescription); + SysFreeString(ei->bstrHelpFile); +} + HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, unsigned argc, jsval_t *argv, jsval_t *ret) { VARIANT buf[6], retv; @@ -2577,7 +3456,7 @@ HRESULT disp_call_value_with_caller(script_ctx_t *ctx, IDispatch *disp, jsval_t jsdisp = iface_to_jsdisp(disp); if(jsdisp && jsdisp->ctx == ctx) { - hres = jsdisp_call_value(jsdisp, vthis, flags, argc, argv, r); + hres = jsdisp_call_value(jsdisp, vthis, flags, argc, argv, r, caller); jsdisp_release(jsdisp); return hres; } @@ -2585,7 +3464,7 @@ HRESULT disp_call_value_with_caller(script_ctx_t *ctx, IDispatch *disp, jsval_t jsdisp_release(jsdisp); if(is_object_instance(vthis) && (ctx->version < SCRIPTLANGUAGEVERSION_ES5 || - ((jsdisp = to_jsdisp(get_object(vthis))) && is_class(jsdisp, JSCLASS_OBJECT)))) + ((jsdisp = to_jsdisp(get_object(vthis))) && is_class(jsdisp, JSCLASS_OBJECT) && !jsdisp->proxy))) jsthis = get_object(vthis); else jsthis = NULL; @@ -2639,8 +3518,12 @@ HRESULT disp_call_value_with_caller(script_ctx_t *ctx, IDispatch *disp, jsval_t HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, BOOL throw, jsval_t val) { dispex_prop_t *prop; + unsigned idx; HRESULT hres; + if(override_idx(obj, name, &idx)) + return obj->builtin_info->idx_put(obj, idx, val); + if(obj->extensible) hres = ensure_prop_name(obj, name, flags, FALSE, &prop); else @@ -2650,7 +3533,7 @@ HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, BOOL throw if(!prop || (prop->type == PROP_DELETED && !obj->extensible)) return throw ? JS_E_INVALID_ACTION : S_OK; - return prop_put(obj, prop, val); + return prop_put(obj, prop, val, &obj->ctx->jscaller->IServiceProvider_iface); } HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val) @@ -2677,7 +3560,7 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val) prop = get_prop(jsdisp, id); if(prop) - hres = prop_put(jsdisp, prop, val); + hres = prop_put(jsdisp, prop, val, &ctx->jscaller->IServiceProvider_iface); else hres = DISP_E_MEMBERNOTFOUND; @@ -2743,8 +3626,12 @@ HRESULT disp_propput_name(script_ctx_t *ctx, IDispatch *disp, const WCHAR *name, HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) { dispex_prop_t *prop; + unsigned idx; HRESULT hres; + if(override_idx(obj, name, &idx)) + return obj->builtin_info->idx_get(obj, idx, val); + hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, &prop); if(FAILED(hres)) return hres; @@ -2754,7 +3641,12 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) return S_OK; } - return prop_get(obj, to_disp(obj), prop, val); + hres = prop_get(obj, to_disp(obj), prop, val, &obj->ctx->jscaller->IServiceProvider_iface); + if(hres == DISP_E_MEMBERNOTFOUND) { + *val = jsval_undefined(); + return S_OK; + } + return hres; } HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) @@ -2763,6 +3655,9 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) dispex_prop_t *prop; HRESULT hres; + if(obj->builtin_info->class >= FIRST_TYPEDARRAY_JSCLASS && obj->builtin_info->class <= LAST_TYPEDARRAY_JSCLASS) + return obj->builtin_info->idx_get(obj, idx, r); + swprintf(name, ARRAY_SIZE(name), L"%d", idx); hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, &prop); @@ -2774,7 +3669,12 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) return DISP_E_UNKNOWNNAME; } - return prop_get(obj, to_disp(obj), prop, r); + hres = prop_get(obj, to_disp(obj), prop, r, &obj->ctx->jscaller->IServiceProvider_iface); + if(hres == DISP_E_MEMBERNOTFOUND) { + *r = jsval_undefined(); + return DISP_E_UNKNOWNNAME; + } + return hres; } HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val) @@ -2785,7 +3685,7 @@ HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val) if(!prop) return DISP_E_MEMBERNOTFOUND; - return prop_get(jsdisp, to_disp(jsdisp), prop, val); + return prop_get(jsdisp, to_disp(jsdisp), prop, val, &jsdisp->ctx->jscaller->IServiceProvider_iface); } HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val) @@ -2820,13 +3720,16 @@ HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx) BOOL b; HRESULT hres; + if(obj->builtin_info->class >= FIRST_TYPEDARRAY_JSCLASS && obj->builtin_info->class <= LAST_TYPEDARRAY_JSCLASS) + return S_OK; + swprintf(buf, ARRAY_SIZE(buf), L"%d", idx); hres = find_prop_name(obj, string_hash(buf), buf, FALSE, &prop); if(FAILED(hres) || !prop) return hres; - hres = delete_prop(prop, &b); + hres = delete_prop(obj, prop, &b); if(FAILED(hres)) return hres; return b ? S_OK : JS_E_INVALID_ACTION; @@ -2844,7 +3747,7 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) prop = get_prop(jsdisp, id); if(prop) - hres = delete_prop(prop, ret); + hres = delete_prop(jsdisp, prop, ret); else hres = DISP_E_MEMBERNOTFOUND; @@ -2884,6 +3787,9 @@ HRESULT jsdisp_next_prop(jsdisp_t *obj, DISPID id, enum jsdisp_enum_type enum_ty } for(iter = &obj->props[idx]; iter < obj->props + obj->prop_cnt; iter++) { + hres = fix_overridden_prop(obj, iter); + if(FAILED(hres)) + return hres; if(iter->type == PROP_DELETED) continue; if(enum_type != JSDISP_ENUM_ALL && iter->type == PROP_PROTREF) @@ -2911,6 +3817,7 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL if(jsdisp) { dispex_prop_t *prop; const WCHAR *ptr; + unsigned idx; ptr = jsstr_flatten(name); if(!ptr) { @@ -2918,12 +3825,17 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL return E_OUTOFMEMORY; } - hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, &prop); - if(prop) { - hres = delete_prop(prop, ret); - }else { - *ret = TRUE; + if(override_idx(jsdisp, ptr, &idx)) { + *ret = FALSE; hres = S_OK; + }else { + hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, &prop); + if(prop) { + hres = delete_prop(jsdisp, prop, ret); + }else { + *ret = TRUE; + hres = S_OK; + } } jsdisp_release(jsdisp); @@ -2963,8 +3875,25 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl property_desc_t *desc) { dispex_prop_t *prop; + unsigned idx; HRESULT hres; + if(override_idx(obj, name, &idx)) { + if(idx >= obj->builtin_info->idx_length(obj)) + return DISP_E_UNKNOWNNAME; + + memset(desc, 0, sizeof(*desc)); + if(!flags_only) { + hres = obj->builtin_info->idx_get(obj, idx, &desc->value); + if(FAILED(hres)) + return hres; + } + desc->flags = PROPF_ENUMERABLE | PROPF_WRITABLE; + desc->mask = PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; + desc->explicit_value = TRUE; + return S_OK; + } + hres = find_prop_name(obj, string_hash(name), name, FALSE, &prop); if(FAILED(hres)) return hres; @@ -2978,12 +3907,13 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl case PROP_BUILTIN: case PROP_JSVAL: case PROP_IDX: + case PROP_PROXY: desc->mask |= PROPF_WRITABLE; desc->explicit_value = TRUE; if(!flags_only) { - hres = prop_get(obj, to_disp(obj), prop, &desc->value); + hres = prop_get(obj, to_disp(obj), prop, &desc->value, &obj->ctx->jscaller->IServiceProvider_iface); if(FAILED(hres)) - return hres; + return (hres == DISP_E_MEMBERNOTFOUND) ? DISP_E_UNKNOWNNAME : hres; } break; case PROP_ACCESSOR: @@ -3007,8 +3937,19 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t *desc) { dispex_prop_t *prop; + unsigned idx; HRESULT hres; + if(override_idx(obj, name, &idx)) { + if((desc->flags & desc->mask) != (desc->mask & (PROPF_WRITABLE | PROPF_ENUMERABLE))) + return throw_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + if(desc->explicit_value) + return obj->builtin_info->idx_put(obj, idx, desc->value); + if(desc->explicit_getter || desc->explicit_setter) + return throw_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + return obj->builtin_info->idx_put(obj, idx, jsval_undefined()); + } + hres = find_prop_name(obj, string_hash(name), name, FALSE, &prop); if(FAILED(hres)) return hres; @@ -3019,6 +3960,38 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t if(!prop && !(prop = alloc_prop(obj, name, PROP_DELETED, 0))) return E_OUTOFMEMORY; + if(obj->proxy && desc->explicit_value) { + struct proxy_prop_info info; + + info.name = name; + hres = obj->proxy->lpVtbl->PropDefineOverride(obj->proxy, &info); + if(hres != S_FALSE) { + dispex_prop_t bak = *prop; + if(FAILED(hres)) + return hres; + hres = alloc_proxy_prop(obj, &info, &prop); + if(SUCCEEDED(hres)) { + hres = prop_put(obj, prop, desc->value, &obj->ctx->jscaller->IServiceProvider_iface); + if(SUCCEEDED(hres)) { + switch(bak.type) { + case PROP_JSVAL: + jsval_release(bak.u.val); + break; + case PROP_ACCESSOR: + if(bak.u.accessor.getter) jsdisp_release(bak.u.accessor.getter); + if(bak.u.accessor.setter) jsdisp_release(bak.u.accessor.setter); + break; + default: + break; + } + return S_OK; + } + } + *prop = bak; + return hres; + } + } + if(prop->type == PROP_DELETED || prop->type == PROP_PROTREF) { prop->flags = desc->flags; if(desc->explicit_getter || desc->explicit_setter) { diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 76e6a271bdf..479de3fc423 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -544,6 +544,27 @@ static HRESULT scope_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, return scope->obj && (jsobj = to_jsdisp(scope->obj)) ? gc_process_linked_obj(gc_ctx, op, dispex, jsobj, (void**)&scope->obj) : S_OK; } +static void scope_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + scope_chain_t *scope = scope_from_dispex(dispex); + note_edge_t note_edge = cc_api.note_edge; + + if(scope->detached_vars) { + struct vars_buffer *vars = scope->detached_vars; + unsigned i, cnt = vars->argc; + + for(i = 0; i < cnt; i++) + if(is_object_instance(vars->var[i])) + note_edge((nsISupports*)get_object(vars->var[i]), "var", cb); + } + + if(scope->next) + note_edge((nsISupports*)&scope->next->dispex.IDispatchEx_iface, "next", cb); + + if(scope->obj) + note_edge((nsISupports*)scope->obj, "obj", cb); +} + static const builtin_info_t scope_info = { JSCLASS_NONE, NULL, @@ -554,7 +575,8 @@ static const builtin_info_t scope_info = { scope_idx_length, scope_idx_get, scope_idx_put, - scope_gc_traverse + scope_gc_traverse, + scope_cc_traverse }; static HRESULT scope_push(script_ctx_t *ctx, scope_chain_t *scope, IDispatch *obj, scope_chain_t **ret) @@ -630,15 +652,24 @@ static HRESULT disp_cmp(IDispatch *disp1, IDispatch *disp2, BOOL *ret) { IObjectIdentity *identity; IUnknown *unk1, *unk2; + jsdisp_t *jsdisp; HRESULT hres; - if(disp1 == disp2) { - *ret = TRUE; + if(!disp1 || !disp2) { + *ret = (disp1 == disp2); return S_OK; } - if(!disp1 || !disp2) { - *ret = FALSE; + jsdisp = to_jsdisp(disp1); + if(jsdisp && jsdisp->proxy) + disp1 = (IDispatch*)jsdisp->proxy; + + jsdisp = to_jsdisp(disp2); + if(jsdisp && jsdisp->proxy) + disp2 = (IDispatch*)jsdisp->proxy; + + if(disp1 == disp2) { + *ret = TRUE; return S_OK; } @@ -819,7 +850,7 @@ static BOOL lookup_global_members(script_ctx_t *ctx, BSTR identifier, exprval_t HRESULT hres; LIST_FOR_EACH_ENTRY(item, &ctx->named_items, named_item_t, entry) { - if(item->flags & SCRIPTITEM_GLOBALMEMBERS) { + if((item->flags & SCRIPTITEM_GLOBALMEMBERS) && item->disp != (IDispatch*)&ctx->global->IDispatchEx_iface) { hres = disp_get_id(ctx, item->disp, identifier, identifier, 0, &id); if(SUCCEEDED(hres)) { if(ret) @@ -2026,7 +2057,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx) return E_FAIL; } - if(is_class(obj, JSCLASS_FUNCTION)) { + if(is_class(obj, JSCLASS_FUNCTION) || (obj->proxy && obj->proxy->lpVtbl->IsConstructor(obj->proxy))) { hres = jsdisp_propget_name(obj, L"prototype", &prot); }else { hres = JS_E_FUNCTION_EXPECTED; diff --git a/dlls/jscript/enumerator.c b/dlls/jscript/enumerator.c index d962c65d229..81ebbbf3187 100644 --- a/dlls/jscript/enumerator.c +++ b/dlls/jscript/enumerator.c @@ -92,7 +92,25 @@ static void Enumerator_destructor(jsdisp_t *dispex) static HRESULT Enumerator_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *dispex) { - return gc_process_linked_val(gc_ctx, op, dispex, &enumerator_from_jsdisp(dispex)->item); + EnumeratorInstance *This = enumerator_from_jsdisp(dispex); + + if(op == GC_TRAVERSE_UNLINK) { + IEnumVARIANT *enumvar = This->enumvar; + if(enumvar) { + This->enumvar = NULL; + IEnumVARIANT_Release(enumvar); + } + } + return gc_process_linked_val(gc_ctx, op, dispex, &This->item); +} + +static void Enumerator_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + EnumeratorInstance *This = enumerator_from_jsdisp(dispex); + if(This->enumvar) + cc_api.note_edge((nsISupports*)This->enumvar, "enumvar", cb); + if(is_object_instance(This->item)) + cc_api.note_edge((nsISupports*)get_object(This->item), "item", cb); } static HRESULT Enumerator_atEnd(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -200,7 +218,8 @@ static const builtin_info_t EnumeratorInst_info = { NULL, NULL, NULL, - Enumerator_gc_traverse + Enumerator_gc_traverse, + Enumerator_cc_traverse }; static HRESULT alloc_enumerator(script_ctx_t *ctx, jsdisp_t *object_prototype, EnumeratorInstance **ret) @@ -251,11 +270,11 @@ static HRESULT create_enumerator(script_ctx_t *ctx, jsval_t *argv, jsdisp_t **re /* Try to get a IEnumVARIANT by _NewEnum */ VariantInit(&varresult); hres = IDispatch_Invoke(obj, DISPID_NEWENUM, &IID_NULL, LOCALE_NEUTRAL, - DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL); + DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL); if (FAILED(hres)) { WARN("Enumerator: no DISPID_NEWENUM.\n"); - return E_INVALIDARG; + return JS_E_OBJECT_NOT_COLLECTION; } if ((V_VT(&varresult) == VT_DISPATCH) || (V_VT(&varresult) == VT_UNKNOWN)) @@ -266,7 +285,7 @@ static HRESULT create_enumerator(script_ctx_t *ctx, jsval_t *argv, jsdisp_t **re else { FIXME("Enumerator: NewEnum unexpected type of varresult (%d).\n", V_VT(&varresult)); - hres = E_INVALIDARG; + hres = JS_E_OBJECT_NOT_COLLECTION; } VariantClear(&varresult); if (FAILED(hres)) diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index f6eda62b88d..14d23c70360 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -466,7 +466,9 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_INVALID_PROPERTY: case JS_E_INVALID_ACTION: case JS_E_MISSING_ARG: + case JS_E_OBJECT_NOT_COLLECTION: case JS_E_FUNCTION_EXPECTED: + case JS_E_STRING_EXPECTED: case JS_E_DATE_EXPECTED: case JS_E_NUMBER_EXPECTED: case JS_E_OBJECT_EXPECTED: @@ -477,14 +479,21 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_JSCRIPT_EXPECTED: case JS_E_ENUMERATOR_EXPECTED: case JS_E_REGEXP_EXPECTED: + case JS_E_ARRAY_OR_ARGS_EXPECTED: case JS_E_ARRAY_EXPECTED: case JS_E_CYCLIC_PROTO_VALUE: case JS_E_CANNOT_CREATE_FOR_NONEXTENSIBLE: case JS_E_OBJECT_NONEXTENSIBLE: case JS_E_NONCONFIGURABLE_REDEFINED: case JS_E_NONWRITABLE_MODIFIED: + case JS_E_TYPEDARRAY_BAD_CTOR_ARG: + case JS_E_NOT_TYPEDARRAY: + case JS_E_TYPEDARRAY_INVALID_SOURCE: + case JS_E_NOT_DATAVIEW: + case JS_E_DATAVIEW_NO_ARGUMENT: case JS_E_WRONG_THIS: case JS_E_KEY_NOT_OBJECT: + case JS_E_ARRAYBUFFER_EXPECTED: case JS_E_PROP_DESC_MISMATCH: case JS_E_INVALID_WRITABLE_PROP_DESC: constr = ctx->type_error_constr; @@ -494,6 +503,10 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_FRACTION_DIGITS_OUT_OF_RANGE: case JS_E_PRECISION_OUT_OF_RANGE: case JS_E_INVALID_LENGTH: + case JS_E_TYPEDARRAY_INVALID_OFFSLEN: + case JS_E_TYPEDARRAY_INVALID_SUBARRAY: + case JS_E_DATAVIEW_INVALID_ACCESS: + case JS_E_DATAVIEW_INVALID_OFFSET: constr = ctx->range_error_constr; break; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 68f841b38a1..5f4a70fdc5a 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -17,6 +17,7 @@ */ #include +#include #include "jscript.h" #include "engine.h" @@ -35,11 +36,12 @@ typedef struct { } FunctionInstance; struct _function_vtbl_t { - HRESULT (*call)(script_ctx_t*,FunctionInstance*,jsval_t,unsigned,unsigned,jsval_t*,jsval_t*); + HRESULT (*call)(script_ctx_t*,FunctionInstance*,jsval_t,unsigned,unsigned,jsval_t*,jsval_t*,IServiceProvider*); HRESULT (*toString)(FunctionInstance*,jsstr_t**); function_code_t* (*get_code)(FunctionInstance*); void (*destructor)(FunctionInstance*); HRESULT (*gc_traverse)(struct gc_ctx*,enum gc_traverse_op,FunctionInstance*); + void (*cc_traverse)(FunctionInstance*,nsCycleCollectionTraversalCallback*); }; typedef struct { @@ -55,6 +57,23 @@ typedef struct { const WCHAR *name; } NativeFunction; +typedef struct { + FunctionInstance function; + struct proxy_func_invoker func; + const WCHAR *name; +} ProxyFunction; + +typedef struct { + FunctionInstance function; + IDispatch *disp; + const char *name; +} ProxyConstructor; + +typedef struct { + FunctionInstance function; + ProxyConstructor *ctor; +} ProxyConstructorCreate; + typedef struct { FunctionInstance function; FunctionInstance *target; @@ -77,6 +96,10 @@ static HRESULT no_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, Fun return S_OK; } +static void no_cc_traverse(FunctionInstance *function, nsCycleCollectionTraversalCallback *cb) +{ +} + static inline FunctionInstance *function_from_jsdisp(jsdisp_t *jsdisp) { return CONTAINING_RECORD(jsdisp, FunctionInstance, dispex); @@ -184,6 +207,22 @@ static HRESULT Arguments_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op return S_OK; } +static void Arguments_cc_traverse(jsdisp_t *jsdisp, nsCycleCollectionTraversalCallback *cb) +{ + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); + note_edge_t note_edge = cc_api.note_edge; + unsigned i; + + if(arguments->buf) { + for(i = 0; i < arguments->argc; i++) + if(is_object_instance(arguments->buf[i])) + note_edge((nsISupports*)get_object(arguments->buf[i]), "buf", cb); + } + + if(arguments->scope) + note_edge((nsISupports*)&arguments->scope->dispex.IDispatchEx_iface, "scope", cb); +} + static const builtin_info_t Arguments_info = { JSCLASS_ARGUMENTS, Arguments_value, @@ -193,7 +232,8 @@ static const builtin_info_t Arguments_info = { Arguments_idx_length, Arguments_idx_get, Arguments_idx_put, - Arguments_gc_traverse + Arguments_gc_traverse, + Arguments_cc_traverse }; HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame) @@ -264,7 +304,7 @@ void detach_arguments_object(call_frame_t *frame) jsdisp_release(&arguments->jsdisp); } -HRESULT Function_invoke(jsdisp_t *func_this, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +HRESULT Function_invoke(jsdisp_t *func_this, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { FunctionInstance *function; @@ -278,7 +318,7 @@ HRESULT Function_invoke(jsdisp_t *func_this, jsval_t vthis, WORD flags, unsigned return E_UNEXPECTED; } - return function->vtbl->call(function->dispex.ctx, function, vthis, flags, argc, argv, r); + return function->vtbl->call(function->dispex.ctx, function, vthis, flags, argc, argv, r, caller); } static HRESULT Function_get_caller(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) @@ -368,6 +408,109 @@ static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, unsigned *a return S_OK; } +static HRESULT disp_to_args(script_ctx_t *ctx, IDispatch *disp, unsigned *argc, jsval_t **ret) +{ + IDispatchEx *dispex; + DWORD length, i; + jsval_t *argv; + DISPID dispid; + EXCEPINFO ei; + UINT err = 0; + HRESULT hres; + VARIANT var; + BSTR name; + + if(!(name = SysAllocString(L"length"))) + return E_OUTOFMEMORY; + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + if(SUCCEEDED(hres) && dispex) + hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseSensitive, &dispid); + else { + hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, &name, 1, 0, &dispid); + dispex = NULL; + } + SysFreeString(name); + if(SUCCEEDED(hres) && dispid == DISPID_UNKNOWN) + hres = DISP_E_UNKNOWNNAME; + if(FAILED(hres)) { + if(hres == DISP_E_UNKNOWNNAME) + hres = JS_E_ARRAY_OR_ARGS_EXPECTED; + goto fail; + } + + if(dispex) + hres = IDispatchEx_InvokeEx(dispex, dispid, ctx->lcid, DISPATCH_PROPERTYGET, NULL, + &var, &ei, &ctx->jscaller->IServiceProvider_iface); + else + hres = IDispatch_Invoke(disp, dispid, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYGET, NULL, &var, &ei, &err); + if(FAILED(hres)) { + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(ctx, &ei); + if(hres == DISP_E_MEMBERNOTFOUND) + hres = JS_E_ARRAY_OR_ARGS_EXPECTED; + goto fail; + } + + if(FAILED(VariantChangeType(&var, &var, 0, VT_UI4))) { + VariantClear(&var); + hres = JS_E_ARRAY_OR_ARGS_EXPECTED; + goto fail; + } + length = V_UI4(&var); + + argv = malloc(length * sizeof(*argv)); + if(!argv) { + hres = E_OUTOFMEMORY; + goto fail; + } + + for(i = 0; i < length; i++) { + WCHAR buf[12]; + + swprintf(buf, ARRAY_SIZE(buf), L"%u", i); + if(!(name = SysAllocString(buf))) + hres = E_OUTOFMEMORY; + else { + if(dispex) + hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseSensitive, &dispid); + else + hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, &name, 1, 0, &dispid); + SysFreeString(name); + } + if(SUCCEEDED(hres)) { + if(dispex) + hres = IDispatchEx_InvokeEx(dispex, dispid, ctx->lcid, DISPATCH_PROPERTYGET, NULL, + &var, &ei, &ctx->jscaller->IServiceProvider_iface); + else + hres = IDispatch_Invoke(disp, dispid, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYGET, NULL, &var, &ei, &err); + if(SUCCEEDED(hres)) { + hres = variant_to_jsval(ctx, &var, &argv[i]); + VariantClear(&var); + }else if(hres == DISP_E_EXCEPTION) { + disp_fill_exception(ctx, &ei); + } + } + if(FAILED(hres)) { + if(hres == DISP_E_UNKNOWNNAME || hres == DISP_E_MEMBERNOTFOUND) { + argv[i] = jsval_undefined(); + continue; + } + while(i--) + jsval_release(argv[i]); + free(argv); + goto fail; + } + } + + *argc = length; + *ret = argv; + hres = S_OK; +fail: + if(dispex) + IDispatchEx_Release(dispex); + return hres; +} + static HRESULT Function_apply(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { jsval_t this_val = jsval_undefined(); @@ -399,28 +542,37 @@ static HRESULT Function_apply(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsi if(argc >= 2) { jsdisp_t *arg_array = NULL; + IDispatch *obj = NULL; if(is_object_instance(argv[1])) { - arg_array = iface_to_jsdisp(get_object(argv[1])); - if(arg_array && - (!is_class(arg_array, JSCLASS_ARRAY) && !is_class(arg_array, JSCLASS_ARGUMENTS) )) { - jsdisp_release(arg_array); - arg_array = NULL; + obj = get_object(argv[1]); + arg_array = iface_to_jsdisp(obj); + + if(ctx->version < SCRIPTLANGUAGEVERSION_ES5) { + if(!arg_array) { + if(!ctx->html_mode) + obj = NULL; + }else if(!is_class(arg_array, JSCLASS_ARRAY) && !is_class(arg_array, JSCLASS_ARGUMENTS)) { + jsdisp_release(arg_array); + arg_array = NULL; + obj = NULL; + } } } if(arg_array) { hres = array_to_args(ctx, arg_array, &cnt, &args); jsdisp_release(arg_array); + }else if(obj) { + hres = disp_to_args(ctx, obj, &cnt, &args); }else { - FIXME("throw TypeError\n"); - hres = E_FAIL; + hres = ctx->html_mode ? JS_E_ARRAY_OR_ARGS_EXPECTED : JS_E_JSCRIPT_EXPECTED; } } if(SUCCEEDED(hres)) { if(function) { - hres = function->vtbl->call(ctx, function, this_val, flags, cnt, args, r); + hres = function->vtbl->call(ctx, function, this_val, flags, cnt, args, r, &ctx->jscaller->IServiceProvider_iface); }else { jsval_t res; hres = disp_call_value(ctx, get_object(vthis), this_val, DISPATCH_METHOD, cnt, args, &res); @@ -470,7 +622,7 @@ static HRESULT Function_call(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsig cnt = argc-1; } - hres = function->vtbl->call(ctx, function, this_val, flags, cnt, argv + 1, r); + hres = function->vtbl->call(ctx, function, this_val, flags, cnt, argv + 1, r, &ctx->jscaller->IServiceProvider_iface); jsval_release(this_val); return hres; @@ -525,7 +677,7 @@ HRESULT Function_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned ar return E_FAIL; } - return function->vtbl->call(ctx, function, vthis, flags, argc, argv, r); + return function->vtbl->call(ctx, function, vthis, flags, argc, argv, r, &ctx->jscaller->IServiceProvider_iface); } HRESULT Function_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) @@ -591,6 +743,12 @@ static HRESULT Function_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op o return function->vtbl->gc_traverse(gc_ctx, op, function); } +static void Function_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + FunctionInstance *function = function_from_jsdisp(dispex); + return function->vtbl->cc_traverse(function, cb); +} + static const builtin_prop_t Function_props[] = { {L"apply", Function_apply, PROPF_METHOD|2}, {L"arguments", NULL, PROPF_HTML, Function_get_arguments}, @@ -611,7 +769,8 @@ static const builtin_info_t Function_info = { NULL, NULL, NULL, - Function_gc_traverse + Function_gc_traverse, + Function_cc_traverse }; static const builtin_prop_t FunctionInst_props[] = { @@ -630,7 +789,8 @@ static const builtin_info_t FunctionInst_info = { NULL, NULL, NULL, - Function_gc_traverse + Function_gc_traverse, + Function_cc_traverse }; static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_info, const function_vtbl_t *vtbl, size_t size, @@ -663,7 +823,7 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_ } static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, - unsigned argc, jsval_t *argv, jsval_t *r) + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { NativeFunction *function = (NativeFunction*)func; @@ -672,9 +832,8 @@ static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, js return function->proc(ctx, vthis, flags & ~DISPATCH_JSCRIPT_INTERNAL_MASK, argc, argv, r); } -static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret) +static HRESULT native_code_toString(const WCHAR *name, jsstr_t **ret) { - NativeFunction *function = (NativeFunction*)func; DWORD name_len; jsstr_t *str; WCHAR *ptr; @@ -682,14 +841,14 @@ static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret) static const WCHAR native_prefixW[] = L"\nfunction "; static const WCHAR native_suffixW[] = L"() {\n [native code]\n}\n"; - name_len = function->name ? lstrlenW(function->name) : 0; + name_len = name ? lstrlenW(name) : 0; str = jsstr_alloc_buf(ARRAY_SIZE(native_prefixW) + ARRAY_SIZE(native_suffixW) + name_len - 2, &ptr); if(!str) return E_OUTOFMEMORY; memcpy(ptr, native_prefixW, sizeof(native_prefixW)); ptr += ARRAY_SIZE(native_prefixW) - 1; - memcpy(ptr, function->name, name_len*sizeof(WCHAR)); + memcpy(ptr, name, name_len*sizeof(WCHAR)); ptr += name_len; memcpy(ptr, native_suffixW, sizeof(native_suffixW)); @@ -697,6 +856,12 @@ static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret) return S_OK; } +static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret) +{ + NativeFunction *function = (NativeFunction*)func; + return native_code_toString(function->name, ret); +} + static function_code_t *NativeFunction_get_code(FunctionInstance *function) { return NULL; @@ -711,7 +876,8 @@ static const function_vtbl_t NativeFunctionVtbl = { NativeFunction_toString, NativeFunction_get_code, NativeFunction_destructor, - no_gc_traverse + no_gc_traverse, + no_cc_traverse }; HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, @@ -770,6 +936,319 @@ HRESULT create_builtin_constructor(script_ctx_t *ctx, builtin_invoke_t value_pro return S_OK; } +static HRESULT ProxyFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) +{ + ProxyFunction *function = (ProxyFunction*)func; + IDispatch *this_obj, *converted = NULL; + DISPPARAMS dp = { 0 }; + EXCEPINFO ei = { 0 }; + VARIANT buf[6], ret; + jsdisp_t *jsdisp; + HRESULT hres; + unsigned i; + + if(flags & DISPATCH_CONSTRUCT) + return E_UNEXPECTED; + + if(argc > function->function.length) + argc = function->function.length; + dp.cArgs = argc; + + if(argc <= ARRAY_SIZE(buf)) + dp.rgvarg = buf; + else if(!(dp.rgvarg = malloc(argc * sizeof(*dp.rgvarg)))) + return E_OUTOFMEMORY; + + for(i = 0; i < argc; i++) { + hres = jsval_to_variant(argv[i], &dp.rgvarg[argc - i - 1]); + if(FAILED(hres)) + goto cleanup; + } + + if(is_undefined(vthis) || is_null(vthis)) + this_obj = lookup_global_host(ctx); + else { + hres = to_object(ctx, vthis, &converted); + if(FAILED(hres)) + goto cleanup; + this_obj = converted; + } + + jsdisp = to_jsdisp(this_obj); + if(jsdisp && jsdisp->proxy) + this_obj = (IDispatch*)jsdisp->proxy; + + V_VT(&ret) = VT_EMPTY; + hres = function->func.invoke(this_obj, function->func.context, &dp, r ? &ret : NULL, &ei, caller); + if(converted) + IDispatch_Release(converted); + + if(hres == DISP_E_EXCEPTION) + disp_fill_exception(ctx, &ei); + else if(SUCCEEDED(hres) && r) { + hres = variant_to_jsval(ctx, &ret, r); + VariantClear(&ret); + } + +cleanup: + while(i) + VariantClear(&dp.rgvarg[argc - i--]); + if(dp.rgvarg != buf) + free(dp.rgvarg); + return hres; +} + +static HRESULT ProxyFunction_toString(FunctionInstance *func, jsstr_t **ret) +{ + ProxyFunction *function = (ProxyFunction*)func; + return native_code_toString(function->name, ret); +} + +static function_code_t *ProxyFunction_get_code(FunctionInstance *func) +{ + return NULL; +} + +static void ProxyFunction_destructor(FunctionInstance *func) +{ +} + +static const function_vtbl_t ProxyFunctionVtbl = { + ProxyFunction_call, + ProxyFunction_toString, + ProxyFunction_get_code, + ProxyFunction_destructor, + no_gc_traverse, + no_cc_traverse +}; + +HRESULT create_proxy_functions(jsdisp_t *jsdisp, const struct proxy_prop_info *info, jsdisp_t **funcs) +{ + ProxyFunction *function; + HRESULT hres; + + if(jsdisp->ctx->state == SCRIPTSTATE_UNINITIALIZED || jsdisp->ctx->state == SCRIPTSTATE_CLOSED) + return E_UNEXPECTED; + + /* Method or Getter */ + hres = create_function(jsdisp->ctx, NULL, &ProxyFunctionVtbl, sizeof(ProxyFunction), + (info->flags & PROPF_METHOD) ? info->flags : PROPF_METHOD, FALSE, + NULL, (void**)&function); + if(FAILED(hres)) + return hres; + function->func = info->func[0]; + function->name = info->name; + funcs[0] = &function->function.dispex; + funcs[1] = NULL; + + /* Setter */ + if(info->func[1].invoke) { + hres = create_function(jsdisp->ctx, NULL, &ProxyFunctionVtbl, sizeof(ProxyFunction), + PROPF_METHOD|1, FALSE, NULL, (void**)&function); + if(FAILED(hres)) { + jsdisp_release(funcs[0]); + return hres; + } + function->func = info->func[1]; + function->name = info->name; + funcs[1] = &function->function.dispex; + } + + return S_OK; +} + +static HRESULT ProxyConstructor_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) +{ + ProxyConstructor *constructor = (ProxyConstructor*)func; + + return disp_call_value_with_caller(ctx, constructor->disp, jsval_undefined(), flags & ~DISPATCH_JSCRIPT_INTERNAL_MASK, + argc, argv, r, caller); +} + +static HRESULT ProxyConstructor_toString(FunctionInstance *func, jsstr_t **ret) +{ + ProxyConstructor *constructor = (ProxyConstructor*)func; + WCHAR nameW[64]; + unsigned i = 0; + + do nameW[i] = constructor->name[i]; while(constructor->name[i++]); + assert(i <= ARRAY_SIZE(nameW)); + + return native_code_toString(nameW, ret); +} + +static function_code_t *ProxyConstructor_get_code(FunctionInstance *func) +{ + return NULL; +} + +static void ProxyConstructor_destructor(FunctionInstance *func) +{ + ProxyConstructor *constructor = (ProxyConstructor*)func; + if(constructor->disp) + IDispatch_Release(constructor->disp); +} + +static HRESULT ProxyConstructor_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, FunctionInstance *func) +{ + ProxyConstructor *constructor = (ProxyConstructor*)func; + + if(op == GC_TRAVERSE_UNLINK) { + IDispatch *disp = constructor->disp; + if(disp) { + constructor->disp = NULL; + IDispatch_Release(disp); + } + } + + return S_OK; +} + +static void ProxyConstructor_cc_traverse(FunctionInstance *func, nsCycleCollectionTraversalCallback *cb) +{ + ProxyConstructor *constructor = (ProxyConstructor*)func; + if(constructor->disp) + cc_api.note_edge((nsISupports*)constructor->disp, "disp", cb); +} + +static const function_vtbl_t ProxyConstructorVtbl = { + ProxyConstructor_call, + ProxyConstructor_toString, + ProxyConstructor_get_code, + ProxyConstructor_destructor, + ProxyConstructor_gc_traverse, + ProxyConstructor_cc_traverse +}; + +static const builtin_prop_t ProxyConstructor_props[] = { + {L"arguments", NULL, 0, Function_get_arguments} +}; + +static const builtin_info_t ProxyConstructor_info = { + JSCLASS_FUNCTION, + Function_value, + ARRAY_SIZE(ProxyConstructor_props), + ProxyConstructor_props, + Function_destructor, + NULL, + NULL, + NULL, + NULL, + Function_gc_traverse, + Function_cc_traverse +}; + +static HRESULT ProxyConstructorCreate_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) +{ + ProxyConstructorCreate *create = (ProxyConstructorCreate*)func; + + /* only allow calls since it's a method */ + if(!(flags & DISPATCH_METHOD)) + return E_UNEXPECTED; + + return disp_call_value_with_caller(ctx, create->ctor->disp, jsval_undefined(), flags & ~DISPATCH_JSCRIPT_INTERNAL_MASK, + argc, argv, r, caller); +} + +static HRESULT ProxyConstructorCreate_toString(FunctionInstance *func, jsstr_t **ret) +{ + return native_code_toString(L"create", ret); +} + +static function_code_t *ProxyConstructorCreate_get_code(FunctionInstance *func) +{ + return NULL; +} + +static void ProxyConstructorCreate_destructor(FunctionInstance *func) +{ + ProxyConstructorCreate *create = (ProxyConstructorCreate*)func; + if(create->ctor) + jsdisp_release(&create->ctor->function.dispex); +} + +static HRESULT ProxyConstructorCreate_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, FunctionInstance *func) +{ + ProxyConstructorCreate *create = (ProxyConstructorCreate*)func; + return gc_process_linked_obj(gc_ctx, op, &create->function.dispex, &create->ctor->function.dispex, (void**)&create->ctor); +} + +static void ProxyConstructorCreate_cc_traverse(FunctionInstance *func, nsCycleCollectionTraversalCallback *cb) +{ + ProxyConstructorCreate *create = (ProxyConstructorCreate*)func; + if(create->ctor) + cc_api.note_edge((nsISupports*)&create->ctor->function.dispex.IDispatchEx_iface, "ctor", cb); +} + +static const function_vtbl_t ProxyConstructorCreateVtbl = { + ProxyConstructorCreate_call, + ProxyConstructorCreate_toString, + ProxyConstructorCreate_get_code, + ProxyConstructorCreate_destructor, + ProxyConstructorCreate_gc_traverse, + ProxyConstructorCreate_cc_traverse +}; + +static const builtin_info_t ProxyConstructorCreate_info = { + JSCLASS_FUNCTION, + Function_value, + ARRAY_SIZE(ProxyConstructor_props), + ProxyConstructor_props, + Function_destructor, + NULL, + NULL, + NULL, + NULL, + Function_gc_traverse, + Function_cc_traverse +}; + +HRESULT create_proxy_constructor(IDispatch *disp, const char *name, jsdisp_t *prototype, jsdisp_t **ret) +{ + script_ctx_t *ctx = prototype->ctx; + ProxyConstructor *constructor; + HRESULT hres; + + /* create wrapper constructor function over the disp's value */ + hres = create_function(ctx, &ProxyConstructor_info, &ProxyConstructorVtbl, sizeof(ProxyConstructor), + PROPF_CONSTR, FALSE, NULL, (void**)&constructor); + if(FAILED(hres)) + return hres; + + IDispatch_AddRef(disp); + constructor->disp = disp; + constructor->name = name; + + hres = jsdisp_define_data_property(&constructor->function.dispex, L"prototype", 0, jsval_obj(prototype)); + + /* XMLHttpRequest and XDomainRequest constructors have a "create" method */ + if(SUCCEEDED(hres) && name[0] == 'X') { + ProxyConstructorCreate *create; + + hres = create_function(ctx, &ProxyConstructorCreate_info, &ProxyConstructorCreateVtbl, sizeof(ProxyConstructorCreate), + PROPF_METHOD, FALSE, NULL, (void**)&create); + if(SUCCEEDED(hres)) { + create->ctor = constructor; + jsdisp_addref(&constructor->function.dispex); + + hres = jsdisp_define_data_property(&create->function.dispex, L"prototype", 0, jsval_null()); + if(SUCCEEDED(hres)) + hres = jsdisp_define_data_property(&constructor->function.dispex, L"create", 0, jsval_obj(&create->function.dispex)); + jsdisp_release(&create->function.dispex); + } + } + if(FAILED(hres)) { + jsdisp_release(&constructor->function.dispex); + return hres; + } + + *ret = &constructor->function.dispex; + return S_OK; +} + /* * Create the actual prototype on demand, since it is a circular ref, which prevents the vast * majority of functions from being released quickly, leading to unnecessary scope detach. @@ -817,11 +1296,12 @@ static const builtin_info_t InterpretedFunction_info = { NULL, NULL, NULL, - Function_gc_traverse + Function_gc_traverse, + Function_cc_traverse }; static HRESULT InterpretedFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, - unsigned argc, jsval_t *argv, jsval_t *r) + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { InterpretedFunction *function = (InterpretedFunction*)func; IDispatch *this_obj = NULL; @@ -837,8 +1317,11 @@ static HRESULT InterpretedFunction_call(script_ctx_t *ctx, FunctionInstance *fun return hres; this_obj = to_disp(new_obj); }else if(is_object_instance(vthis)) { + IDispatch_AddRef(get_object(vthis)); + hres = convert_to_proxy(ctx, &vthis); + if(FAILED(hres)) + return hres; this_obj = get_object(vthis); - IDispatch_AddRef(this_obj); }else if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5 && !is_undefined(vthis) && !is_null(vthis)) { hres = to_object(ctx, vthis, &this_obj); if(FAILED(hres)) @@ -890,12 +1373,20 @@ static HRESULT InterpretedFunction_gc_traverse(struct gc_ctx *gc_ctx, enum gc_tr (void**)&function->scope_chain); } +static void InterpretedFunction_cc_traverse(FunctionInstance *func, nsCycleCollectionTraversalCallback *cb) +{ + InterpretedFunction *function = (InterpretedFunction*)func; + if(function->scope_chain) + cc_api.note_edge((nsISupports*)&function->scope_chain->dispex.IDispatchEx_iface, "scope_chain", cb); +} + static const function_vtbl_t InterpretedFunctionVtbl = { InterpretedFunction_call, InterpretedFunction_toString, InterpretedFunction_get_code, InterpretedFunction_destructor, - InterpretedFunction_gc_traverse + InterpretedFunction_gc_traverse, + InterpretedFunction_cc_traverse }; HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_code_t *func_code, @@ -949,11 +1440,12 @@ static const builtin_info_t BindFunction_info = { NULL, NULL, NULL, - Function_gc_traverse + Function_gc_traverse, + Function_cc_traverse }; static HRESULT BindFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, - unsigned argc, jsval_t *argv, jsval_t *r) + unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { BindFunction *function = (BindFunction*)func; jsval_t *call_args = NULL; @@ -974,7 +1466,7 @@ static HRESULT BindFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsva memcpy(call_args + function->argc, argv, argc * sizeof(*call_args)); } - hres = function->target->vtbl->call(ctx, function->target, function->this, flags, call_argc, call_args, r); + hres = function->target->vtbl->call(ctx, function->target, function->this, flags, call_argc, call_args, r, caller); free(call_args); return hres; @@ -1024,12 +1516,30 @@ static HRESULT BindFunction_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_ return gc_process_linked_val(gc_ctx, op, &function->function.dispex, &function->this); } +static void BindFunction_cc_traverse(FunctionInstance *func, nsCycleCollectionTraversalCallback *cb) +{ + BindFunction *function = (BindFunction*)func; + note_edge_t note_edge = cc_api.note_edge; + unsigned i; + + for(i = 0; i < function->argc; i++) + if(is_object_instance(function->args[i])) + note_edge((nsISupports*)get_object(function->args[i]), "arg", cb); + + if(function->target) + note_edge((nsISupports*)&function->target->dispex.IDispatchEx_iface, "target", cb); + + if(is_object_instance(function->this)) + note_edge((nsISupports*)get_object(function->this), "this", cb); +} + static const function_vtbl_t BindFunctionVtbl = { BindFunction_call, BindFunction_toString, BindFunction_get_code, BindFunction_destructor, - BindFunction_gc_traverse + BindFunction_gc_traverse, + BindFunction_cc_traverse }; static HRESULT create_bind_function(script_ctx_t *ctx, FunctionInstance *target, jsval_t bound_this, unsigned argc, diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 997b2542a9e..a7ebffb0867 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -946,7 +946,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Function", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Function", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->function_constr)); if(FAILED(hres)) return hres; @@ -955,7 +955,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Object", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Object", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->object_constr)); if(FAILED(hres)) return hres; @@ -964,7 +964,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Array", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Array", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->array_constr)); if(FAILED(hres)) return hres; @@ -973,7 +973,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Boolean", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Boolean", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->bool_constr)); if(FAILED(hres)) return hres; @@ -982,7 +982,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Date", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Date", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->date_constr)); if(FAILED(hres)) return hres; @@ -991,7 +991,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Enumerator", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Enumerator", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->enumerator_constr)); if(FAILED(hres)) return hres; @@ -1000,42 +1000,42 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Error", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Error", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"EvalError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"EvalError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->eval_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"RangeError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"RangeError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->range_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"ReferenceError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"ReferenceError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->reference_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"RegExpError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"RegExpError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->regexp_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"SyntaxError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"SyntaxError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->syntax_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"TypeError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"TypeError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->type_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"URIError", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"URIError", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->uri_error_constr)); if(FAILED(hres)) return hres; @@ -1044,7 +1044,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Number", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Number", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->number_constr)); if(FAILED(hres)) return hres; @@ -1053,7 +1053,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"RegExp", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"RegExp", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->regexp_constr)); if(FAILED(hres)) return hres; @@ -1062,7 +1062,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"String", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"String", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->string_constr)); if(FAILED(hres)) return hres; @@ -1071,7 +1071,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"VBArray", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"VBArray", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->vbarray_constr)); if(FAILED(hres)) return hres; @@ -1108,7 +1108,7 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Math", PROPF_WRITABLE, jsval_obj(math)); + hres = jsdisp_define_data_property(ctx->global, L"Math", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(math)); jsdisp_release(math); if(FAILED(hres)) return hres; @@ -1120,7 +1120,7 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"JSON", PROPF_WRITABLE, jsval_obj(json)); + hres = jsdisp_define_data_property(ctx->global, L"JSON", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(json)); jsdisp_release(json); if(FAILED(hres)) return hres; @@ -1130,7 +1130,7 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"ActiveXObject", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"ActiveXObject", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(constr)); jsdisp_release(constr); if(FAILED(hres)) @@ -1148,5 +1148,15 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - return init_set_constructor(ctx); + hres = init_arraybuf_constructors(ctx); + if(FAILED(hres)) + return hres; + + hres = init_set_constructor(ctx); + if(FAILED(hres)) + return hres; + + if(ctx->js_global) jsdisp_release(ctx->js_global); + ctx->js_global = jsdisp_addref(ctx->global); + return hres; } diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index b1940b770d3..2200629930e 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -51,8 +51,8 @@ typedef struct { LONG ref; DWORD safeopt; + struct thread_data *thread_data; script_ctx_t *ctx; - LONG thread_id; LCID lcid; DWORD version; BOOL html_mode; @@ -88,6 +88,7 @@ void script_release(script_ctx_t *ctx) ctx->jscaller->ctx = NULL; IServiceProvider_Release(&ctx->jscaller->IServiceProvider_iface); + release_thread_data(ctx->thread_data); free(ctx); } @@ -140,9 +141,11 @@ static void release_named_item_script_obj(named_item_t *item) item->script_obj = NULL; } -static HRESULT retrieve_named_item_disp(IActiveScriptSite *site, named_item_t *item) +static HRESULT retrieve_named_item_disp(script_ctx_t *ctx, IActiveScriptSite *site, named_item_t *item) { + IDispatch *disp; IUnknown *unk; + jsval_t val; HRESULT hr; if(!site) @@ -154,13 +157,19 @@ static HRESULT retrieve_named_item_disp(IActiveScriptSite *site, named_item_t *i return hr; } - hr = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp); + hr = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp); IUnknown_Release(unk); if(FAILED(hr)) { WARN("object does not implement IDispatch\n"); return hr; } + val = jsval_disp(disp); + hr = convert_to_proxy(ctx, &val); + if(FAILED(hr)) + return hr; + item->disp = get_object(val); + return S_OK; } @@ -177,7 +186,7 @@ named_item_t *lookup_named_item(script_ctx_t *ctx, const WCHAR *item_name, unsig } if(!item->disp && (flags || !(item->flags & SCRIPTITEM_CODEONLY))) { - hr = retrieve_named_item_disp(ctx->site, item); + hr = retrieve_named_item_disp(ctx, ctx->site, item); if(FAILED(hr)) continue; } @@ -524,8 +533,10 @@ static void decrease_state(JScript *This, SCRIPTSTATE state) FIXME("NULL ctx\n"); } - if(state == SCRIPTSTATE_UNINITIALIZED || state == SCRIPTSTATE_CLOSED) - This->thread_id = 0; + if((state == SCRIPTSTATE_UNINITIALIZED || state == SCRIPTSTATE_CLOSED) && This->thread_data) { + release_thread_data(This->thread_data); + This->thread_data = NULL; + } if(This->site) { IActiveScriptSite_Release(This->site); @@ -708,6 +719,8 @@ static ULONG WINAPI JScript_Release(IActiveScript *iface) This->ctx->active_script = NULL; script_release(This->ctx); } + if(This->thread_data) + release_thread_data(This->thread_data); free(This); unlock_module(); } @@ -715,17 +728,11 @@ static ULONG WINAPI JScript_Release(IActiveScript *iface) return ref; } -static int weak_refs_compare(const void *key, const struct rb_entry *entry) -{ - const struct weak_refs_entry *weak_refs_entry = RB_ENTRY_VALUE(entry, const struct weak_refs_entry, entry); - ULONG_PTR a = (ULONG_PTR)key, b = (ULONG_PTR)LIST_ENTRY(weak_refs_entry->list.next, struct weakmap_entry, weak_refs_entry)->key; - return (a > b) - (a < b); -} - static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass) { JScript *This = impl_from_IActiveScript(iface); + struct thread_data *thread_data; named_item_t *item; LCID lcid; HRESULT hres; @@ -738,8 +745,13 @@ static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, if(This->site) return E_UNEXPECTED; - if(InterlockedCompareExchange(&This->thread_id, GetCurrentThreadId(), 0)) + if(!(thread_data = get_thread_data())) + return E_OUTOFMEMORY; + + if(InterlockedCompareExchangePointer((void**)&This->thread_data, thread_data, NULL)) { + release_thread_data(thread_data); return E_UNEXPECTED; + } if(!This->ctx) { script_ctx_t *ctx = calloc(1, sizeof(script_ctx_t)); @@ -754,8 +766,6 @@ static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, ctx->html_mode = This->html_mode; ctx->acc = jsval_undefined(); list_init(&ctx->named_items); - list_init(&ctx->objects); - rb_init(&ctx->weak_refs, weak_refs_compare); heap_pool_init(&ctx->tmp_heap); hres = create_jscaller(ctx); @@ -764,13 +774,11 @@ static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, return hres; } + thread_data->ref++; + ctx->thread_data = thread_data; ctx->last_match = jsstr_empty(); - ctx = InterlockedCompareExchangePointer((void**)&This->ctx, ctx, NULL); - if(ctx) { - script_release(ctx); - return E_UNEXPECTED; - } + This->ctx = ctx; } /* Retrieve new dispatches for persistent named items */ @@ -778,7 +786,7 @@ static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, { if(!item->disp) { - hres = retrieve_named_item_disp(pass, item); + hres = retrieve_named_item_disp(This->ctx, pass, item); if(FAILED(hres)) return hres; } @@ -821,7 +829,7 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s TRACE("(%p)->(%d)\n", This, ss); - if(This->thread_id && GetCurrentThreadId() != This->thread_id) + if(This->thread_data && This->thread_data->thread_id != GetCurrentThreadId()) return E_UNEXPECTED; if(ss == SCRIPTSTATE_UNINITIALIZED) { @@ -865,7 +873,7 @@ static HRESULT WINAPI JScript_GetScriptState(IActiveScript *iface, SCRIPTSTATE * if(!pssState) return E_POINTER; - if(This->thread_id && This->thread_id != GetCurrentThreadId()) + if(This->thread_data && This->thread_data->thread_id != GetCurrentThreadId()) return E_UNEXPECTED; *pssState = This->ctx ? This->ctx->state : SCRIPTSTATE_UNINITIALIZED; @@ -878,7 +886,7 @@ static HRESULT WINAPI JScript_Close(IActiveScript *iface) TRACE("(%p)->()\n", This); - if(This->thread_id && This->thread_id != GetCurrentThreadId()) + if(This->thread_data && This->thread_data->thread_id != GetCurrentThreadId()) return E_UNEXPECTED; decrease_state(This, SCRIPTSTATE_CLOSED); @@ -897,11 +905,13 @@ static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface, TRACE("(%p)->(%s %lx)\n", This, debugstr_w(pstrName), dwFlags); - if(This->thread_id != GetCurrentThreadId() || !This->ctx || This->ctx->state == SCRIPTSTATE_CLOSED) + if(!This->thread_data || This->thread_data->thread_id != GetCurrentThreadId() || !This->ctx || This->ctx->state == SCRIPTSTATE_CLOSED) return E_UNEXPECTED; if(dwFlags & SCRIPTITEM_GLOBALMEMBERS) { + jsdisp_t *jsdisp; IUnknown *unk; + jsval_t val; hres = IActiveScriptSite_GetItemInfo(This->site, pstrName, SCRIPTINFO_IUNKNOWN, &unk, NULL); if(FAILED(hres)) { @@ -915,6 +925,20 @@ static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface, WARN("object does not implement IDispatch\n"); return hres; } + + if(This->ctx->html_mode) + init_cc_api(disp); + + val = jsval_disp(disp); + hres = convert_to_proxy(This->ctx, &val); + if(FAILED(hres)) + return hres; + disp = get_object(val); + + if((jsdisp = to_jsdisp(disp)) && jsdisp->proxy) { + jsdisp_release(This->ctx->global); + This->ctx->global = jsdisp_addref(jsdisp); + } } item = malloc(sizeof(*item)); @@ -959,7 +983,7 @@ static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR if(!ppdisp) return E_POINTER; - if(This->thread_id != GetCurrentThreadId() || !This->ctx->global) { + if(!This->thread_data || This->thread_data->thread_id != GetCurrentThreadId() || !This->ctx->global) { *ppdisp = NULL; return E_UNEXPECTED; } @@ -971,7 +995,7 @@ static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR if(item->script_obj) script_obj = item->script_obj; } - *ppdisp = to_disp(script_obj); + *ppdisp = script_obj->proxy ? (IDispatch*)script_obj->proxy : to_disp(script_obj); IDispatch_AddRef(*ppdisp); return S_OK; } @@ -1101,7 +1125,7 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter), wine_dbgstr_longlong(dwSourceContextCookie), ulStartingLine, dwFlags, pvarResult, pexcepinfo); - if(This->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED) + if(!This->thread_data || This->thread_data->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED) return E_UNEXPECTED; if(pstrItemName) { @@ -1204,7 +1228,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars debugstr_w(pstrProcedureName), debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter), wine_dbgstr_longlong(dwSourceContextCookie), ulStartingLineNumber, dwFlags, ppdisp); - if(This->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED) + if(!This->thread_data || This->thread_data->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED) return E_UNEXPECTED; if(pstrItemName) { @@ -1458,3 +1482,8 @@ HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv) IActiveScript_Release(&ret->IActiveScript_iface); return hres; } + +script_ctx_t *get_script_ctx(IActiveScript *script) +{ + return (script->lpVtbl == &JScriptVtbl) ? impl_from_IActiveScript(script)->ctx : NULL; +} diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 650c9278793..b681080946c 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -47,6 +47,104 @@ #define SCRIPTLANGUAGEVERSION_ES5 0x102 #define SCRIPTLANGUAGEVERSION_ES6 0x103 +/* + * These are Wine jscript extensions, used for mshtml objects so they act like JS objects. + * Both extend IDispatchEx. IWineDispatchProxyCbPrivate is always available on jscript side. + * + * NOTE: Keep in sync with mshtml_private.h in mshtml.dll + */ +DEFINE_GUID(IID_IWineDispatchProxyPrivate, 0xd359f2fe,0x5531,0x741b,0xa4,0x1a,0x5c,0xf9,0x2e,0xdc,0x97,0x1b); +typedef struct _IWineDispatchProxyPrivate IWineDispatchProxyPrivate; +typedef struct _IWineDispatchProxyCbPrivate IWineDispatchProxyCbPrivate; + +typedef IUnknown nsISupports; +DEFINE_GUID(IID_nsCycleCollectionISupports, 0xc61eac14,0x5f7a,0x4481,0x96,0x5e,0x7e,0xaa,0x6e,0xff,0xa8,0x5f); + +typedef struct { + void *vtbl; + int ref_flags; + void *callbacks; +} ExternalCycleCollectionParticipant; + +typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback; + +typedef struct { + HRESULT (WINAPI *traverse)(void*,void*,nsCycleCollectionTraversalCallback*); + HRESULT (WINAPI *unlink)(void*); + void (WINAPI *delete_cycle_collectable)(void*); +} CCObjCallback; + +DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9); + +struct proxy_func_invoker +{ + HRESULT (STDMETHODCALLTYPE *invoke)(IDispatch*,void*,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); + void *context; +}; + +struct proxy_prop_info +{ + struct proxy_func_invoker func[2]; + const WCHAR *name; + DISPID dispid; + unsigned flags; +}; + +typedef void (__cdecl *note_edge_t)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*); + +struct proxy_cc_api +{ + ExternalCycleCollectionParticipant participant; + BOOL (__cdecl *is_full_cc)(void); + void (__cdecl *collect)(void); + void (__cdecl *describe_node)(ULONG ref, const char *obj_name, nsCycleCollectionTraversalCallback *cb); + note_edge_t note_edge; +}; + +typedef struct { + IDispatchExVtbl dispex; + IWineDispatchProxyCbPrivate** (STDMETHODCALLTYPE *GetProxyFieldRef)(IWineDispatchProxyPrivate *This); + IDispatch* (STDMETHODCALLTYPE *GetDefaultPrototype)(IWineDispatchProxyPrivate *This, IWineDispatchProxyPrivate *window); + HRESULT (STDMETHODCALLTYPE *GetDefaultConstructor)(IWineDispatchProxyPrivate *This, IWineDispatchProxyPrivate *window, IDispatch **ret); + BOOL (STDMETHODCALLTYPE *IsConstructor)(IWineDispatchProxyPrivate *This); + HRESULT (STDMETHODCALLTYPE *PropFixOverride)(IWineDispatchProxyPrivate *This, struct proxy_prop_info *info); + HRESULT (STDMETHODCALLTYPE *PropOverride)(IWineDispatchProxyPrivate *This, const WCHAR *name, VARIANT *value); + HRESULT (STDMETHODCALLTYPE *PropDefineOverride)(IWineDispatchProxyPrivate *This, struct proxy_prop_info *info); + HRESULT (STDMETHODCALLTYPE *PropGetInfo)(IWineDispatchProxyPrivate *This, const WCHAR *name, BOOL case_insens, struct proxy_prop_info *info); + HRESULT (STDMETHODCALLTYPE *PropInvoke)(IWineDispatchProxyPrivate *This, IDispatch *this_obj, DISPID id, LCID lcid, + DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); + HRESULT (STDMETHODCALLTYPE *PropDelete)(IWineDispatchProxyPrivate *This, DISPID id); + HRESULT (STDMETHODCALLTYPE *PropEnum)(IWineDispatchProxyPrivate *This); + HRESULT (STDMETHODCALLTYPE *ToString)(IWineDispatchProxyPrivate *This, BSTR *string); + void (STDMETHODCALLTYPE *InitCC)(struct proxy_cc_api *cc_api, const CCObjCallback *callback); +} IWineDispatchProxyPrivateVtbl; + +typedef struct { + IDispatchExVtbl dispex; + HRESULT (STDMETHODCALLTYPE *InitProxy)(IWineDispatchProxyCbPrivate *This, IDispatch *obj); + void (STDMETHODCALLTYPE *Unlinked)(IWineDispatchProxyCbPrivate *This, BOOL persist); + HRESULT (STDMETHODCALLTYPE *HostUpdated)(IWineDispatchProxyCbPrivate *This, IActiveScript *script); + IDispatch* (STDMETHODCALLTYPE *CreateConstructor)(IWineDispatchProxyCbPrivate *This, IDispatch *disp, const char *name); + HRESULT (STDMETHODCALLTYPE *DefineConstructor)(IWineDispatchProxyCbPrivate *This, const char *name, IDispatch *prot, IDispatch *ctor); + HRESULT (STDMETHODCALLTYPE *CreateObject)(IWineDispatchProxyCbPrivate *This, IDispatchEx **obj); + HRESULT (STDMETHODCALLTYPE *CreateArrayBuffer)(IWineDispatchProxyCbPrivate *This, DWORD size, IDispatch **arraybuf, void **data); + HRESULT (STDMETHODCALLTYPE *GetRandomValues)(IDispatch *typedarr); + HRESULT (STDMETHODCALLTYPE *PropEnum)(IWineDispatchProxyCbPrivate *This, const WCHAR *name); +} IWineDispatchProxyCbPrivateVtbl; + +struct _IWineDispatchProxyPrivate { + const IWineDispatchProxyPrivateVtbl *lpVtbl; +}; + +struct _IWineDispatchProxyCbPrivate { + const IWineDispatchProxyCbPrivateVtbl *lpVtbl; +}; + +#define WINE_DISP_PROXY_NULL_PROTOTYPE ((IDispatch*)IntToPtr(-2)) +#define WINE_DISP_PROXY_OBJECT_PROTOTYPE ((IDispatch*)IntToPtr(-1)) + + + typedef struct _jsval_t jsval_t; typedef struct _jsstr_t jsstr_t; typedef struct _jsexcept_t jsexcept_t; @@ -72,9 +170,11 @@ heap_pool_t *heap_pool_mark(heap_pool_t*); typedef struct jsdisp_t jsdisp_t; +extern struct proxy_cc_api cc_api; extern HINSTANCE jscript_hinstance ; HRESULT get_dispatch_typeinfo(ITypeInfo**); +/* NOTE: Keep in sync with mshtml_private.h in mshtml.dll */ #define PROPF_ARGMASK 0x00ff #define PROPF_METHOD 0x0100 #define PROPF_CONSTR 0x0200 @@ -116,11 +216,29 @@ typedef enum { JSCLASS_ARGUMENTS, JSCLASS_VBARRAY, JSCLASS_JSON, + JSCLASS_ARRAYBUFFER, + JSCLASS_DATAVIEW, + JSCLASS_INT8ARRAY, + JSCLASS_INT16ARRAY, + JSCLASS_INT32ARRAY, + JSCLASS_UINT8ARRAY, + JSCLASS_UINT8CLAMPEDARRAY, + JSCLASS_UINT16ARRAY, + JSCLASS_UINT32ARRAY, + JSCLASS_FLOAT32ARRAY, + JSCLASS_FLOAT64ARRAY, JSCLASS_MAP, JSCLASS_SET, JSCLASS_WEAKMAP, + + FIRST_TYPEDARRAY_JSCLASS = JSCLASS_INT8ARRAY, + LAST_TYPEDARRAY_JSCLASS = JSCLASS_FLOAT64ARRAY, + FIRST_VIEW_JSCLASS = JSCLASS_DATAVIEW, + LAST_VIEW_JSCLASS = JSCLASS_FLOAT64ARRAY, } jsclass_t; +enum { NUM_TYPEDARRAY_TYPES = LAST_TYPEDARRAY_JSCLASS - FIRST_TYPEDARRAY_JSCLASS + 1 }; + jsdisp_t *iface_to_jsdisp(IDispatch*); typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); @@ -129,6 +247,20 @@ typedef HRESULT (*builtin_setter_t)(script_ctx_t*,jsdisp_t*,jsval_t); HRESULT builtin_set_const(script_ctx_t*,jsdisp_t*,jsval_t); +struct thread_data { + LONG ref; + LONG thread_id; + + BOOL gc_is_unlinking; + DWORD gc_last_tick; + + struct list objects; + struct rb_tree weak_refs; +}; + +struct thread_data *get_thread_data(void); +void release_thread_data(struct thread_data*); + typedef struct named_item_t { jsdisp_t *script_obj; IDispatch *disp; @@ -173,6 +305,7 @@ typedef struct { HRESULT (*idx_get)(jsdisp_t*,unsigned,jsval_t*); HRESULT (*idx_put)(jsdisp_t*,unsigned,jsval_t); HRESULT (*gc_traverse)(struct gc_ctx*,enum gc_traverse_op,jsdisp_t*); + void (*cc_traverse)(jsdisp_t*,nsCycleCollectionTraversalCallback*); } builtin_info_t; struct jsdisp_t { @@ -190,6 +323,7 @@ struct jsdisp_t { script_ctx_t *ctx; jsdisp_t *prototype; + IWineDispatchProxyPrivate *proxy; const builtin_info_t *builtin_info; struct list entry; @@ -202,6 +336,7 @@ static inline IDispatch *to_disp(jsdisp_t *jsdisp) jsdisp_t *as_jsdisp(IDispatch*); jsdisp_t *to_jsdisp(IDispatch*); +void jsdisp_reacquire(jsdisp_t*); void jsdisp_free(jsdisp_t*); #ifndef TRACE_REFCNT @@ -214,7 +349,8 @@ void jsdisp_free(jsdisp_t*); */ static inline jsdisp_t *jsdisp_addref(jsdisp_t *jsdisp) { - jsdisp->ref++; + if(!jsdisp->ref++) + jsdisp_reacquire(jsdisp); return jsdisp; } @@ -240,11 +376,14 @@ enum jsdisp_enum_type { HRESULT create_dispex(script_ctx_t*,const builtin_info_t*,jsdisp_t*,jsdisp_t**); HRESULT init_dispex(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*); HRESULT init_dispex_from_constr(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*); +HRESULT convert_to_proxy(script_ctx_t*,jsval_t*); +void init_cc_api(IDispatch*); +void disp_fill_exception(script_ctx_t*,EXCEPINFO*); HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,unsigned,jsval_t*,jsval_t*); HRESULT disp_call_name(script_ctx_t*,IDispatch*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*); HRESULT disp_call_value_with_caller(script_ctx_t*,IDispatch*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*,IServiceProvider*); -HRESULT jsdisp_call_value(jsdisp_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); +HRESULT jsdisp_call_value(jsdisp_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*,IServiceProvider*); HRESULT jsdisp_call(jsdisp_t*,DISPID,WORD,unsigned,jsval_t*,jsval_t*); HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*); HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,jsval_t*); @@ -274,7 +413,9 @@ HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,cons jsdisp_t*,jsdisp_t**); HRESULT create_builtin_constructor(script_ctx_t*,builtin_invoke_t,const WCHAR*,const builtin_info_t*,DWORD, jsdisp_t*,jsdisp_t**); -HRESULT Function_invoke(jsdisp_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); +HRESULT create_proxy_functions(jsdisp_t*,const struct proxy_prop_info*,jsdisp_t**); +HRESULT create_proxy_constructor(IDispatch*,const char*,jsdisp_t*,jsdisp_t**); +HRESULT Function_invoke(jsdisp_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*,IServiceProvider*); HRESULT Function_value(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); HRESULT Function_get_value(script_ctx_t*,jsdisp_t*,jsval_t*); @@ -375,10 +516,9 @@ struct _script_ctx_t { SCRIPTSTATE state; IActiveScript *active_script; + struct thread_data *thread_data; struct _call_frame_t *call_ctx; struct list named_items; - struct list objects; - struct rb_tree weak_refs; IActiveScriptSite *site; IInternetHostSecurityManager *secmgr; DWORD safeopt; @@ -391,9 +531,6 @@ struct _script_ctx_t { heap_pool_t tmp_heap; - BOOL gc_is_unlinking; - DWORD gc_last_tick; - jsval_t *stack; unsigned stack_top; jsval_t acc; @@ -406,6 +543,7 @@ struct _script_ctx_t { union { struct { jsdisp_t *global; + jsdisp_t *js_global; jsdisp_t *function_constr; jsdisp_t *array_constr; jsdisp_t *bool_constr; @@ -425,11 +563,14 @@ struct _script_ctx_t { jsdisp_t *regexp_constr; jsdisp_t *string_constr; jsdisp_t *vbarray_constr; + jsdisp_t *arraybuf_constr; + jsdisp_t *dataview_constr; + jsdisp_t *typedarr_constr[NUM_TYPEDARRAY_TYPES]; jsdisp_t *map_prototype; jsdisp_t *set_prototype; jsdisp_t *weakmap_prototype; }; - jsdisp_t *global_objects[23]; + jsdisp_t *global_objects[26 + NUM_TYPEDARRAY_TYPES]; }; }; C_ASSERT(RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, weakmap_prototype) == RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, global_objects)); @@ -454,6 +595,7 @@ HRESULT init_global(script_ctx_t*); HRESULT init_function_constr(script_ctx_t*,jsdisp_t*); HRESULT create_object_prototype(script_ctx_t*,jsdisp_t**); HRESULT init_set_constructor(script_ctx_t*); +HRESULT init_arraybuf_constructors(script_ctx_t*); HRESULT create_activex_constr(script_ctx_t*,jsdisp_t**); HRESULT create_array_constr(script_ctx_t*,jsdisp_t*,jsdisp_t**); @@ -487,6 +629,7 @@ HRESULT localize_number(script_ctx_t*,DOUBLE,BOOL,jsstr_t**); BOOL is_builtin_eval_func(jsdisp_t*); HRESULT builtin_eval(script_ctx_t*,struct _call_frame_t*,WORD,unsigned,jsval_t*,jsval_t*); HRESULT JSGlobal_eval(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); +HRESULT Object_toString(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); HRESULT Object_get_proto_(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); HRESULT Object_set_proto_(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); @@ -524,6 +667,7 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_INVALID_PROPERTY MAKE_JSERROR(IDS_NO_PROPERTY) #define JS_E_INVALID_ACTION MAKE_JSERROR(IDS_UNSUPPORTED_ACTION) #define JS_E_MISSING_ARG MAKE_JSERROR(IDS_ARG_NOT_OPT) +#define JS_E_OBJECT_NOT_COLLECTION MAKE_JSERROR(IDS_OBJECT_NOT_COLLECTION) #define JS_E_SYNTAX MAKE_JSERROR(IDS_SYNTAX_ERROR) #define JS_E_MISSING_SEMICOLON MAKE_JSERROR(IDS_SEMICOLON) #define JS_E_MISSING_LBRACKET MAKE_JSERROR(IDS_LBRACKET) @@ -541,6 +685,7 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_DISABLED_CC MAKE_JSERROR(IDS_DISABLED_CC) #define JS_E_EXPECTED_AT MAKE_JSERROR(IDS_EXPECTED_AT) #define JS_E_FUNCTION_EXPECTED MAKE_JSERROR(IDS_NOT_FUNC) +#define JS_E_STRING_EXPECTED MAKE_JSERROR(IDS_NOT_STRING) #define JS_E_DATE_EXPECTED MAKE_JSERROR(IDS_NOT_DATE) #define JS_E_NUMBER_EXPECTED MAKE_JSERROR(IDS_NOT_NUM) #define JS_E_OBJECT_EXPECTED MAKE_JSERROR(IDS_OBJECT_EXPECTED) @@ -559,6 +704,7 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_INVALID_URI_CHAR MAKE_JSERROR(IDS_URI_INVALID_CHAR) #define JS_E_FRACTION_DIGITS_OUT_OF_RANGE MAKE_JSERROR(IDS_FRACTION_DIGITS_OUT_OF_RANGE) #define JS_E_PRECISION_OUT_OF_RANGE MAKE_JSERROR(IDS_PRECISION_OUT_OF_RANGE) +#define JS_E_ARRAY_OR_ARGS_EXPECTED MAKE_JSERROR(IDS_ARRAY_OR_ARGS_EXPECTED) #define JS_E_INVALID_LENGTH MAKE_JSERROR(IDS_INVALID_LENGTH) #define JS_E_ARRAY_EXPECTED MAKE_JSERROR(IDS_ARRAY_EXPECTED) #define JS_E_CYCLIC_PROTO_VALUE MAKE_JSERROR(IDS_CYCLIC_PROTO_VALUE) @@ -566,8 +712,18 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_OBJECT_NONEXTENSIBLE MAKE_JSERROR(IDS_OBJECT_NONEXTENSIBLE) #define JS_E_NONCONFIGURABLE_REDEFINED MAKE_JSERROR(IDS_NONCONFIGURABLE_REDEFINED) #define JS_E_NONWRITABLE_MODIFIED MAKE_JSERROR(IDS_NONWRITABLE_MODIFIED) +#define JS_E_TYPEDARRAY_BAD_CTOR_ARG MAKE_JSERROR(IDS_TYPEDARRAY_BAD_CTOR_ARG) +#define JS_E_NOT_TYPEDARRAY MAKE_JSERROR(IDS_NOT_TYPEDARRAY) +#define JS_E_TYPEDARRAY_INVALID_OFFSLEN MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_OFFSLEN) +#define JS_E_TYPEDARRAY_INVALID_SUBARRAY MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_SUBARRAY) +#define JS_E_TYPEDARRAY_INVALID_SOURCE MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_SOURCE) +#define JS_E_NOT_DATAVIEW MAKE_JSERROR(IDS_NOT_DATAVIEW) +#define JS_E_DATAVIEW_NO_ARGUMENT MAKE_JSERROR(IDS_DATAVIEW_NO_ARGUMENT) +#define JS_E_DATAVIEW_INVALID_ACCESS MAKE_JSERROR(IDS_DATAVIEW_INVALID_ACCESS) +#define JS_E_DATAVIEW_INVALID_OFFSET MAKE_JSERROR(IDS_DATAVIEW_INVALID_OFFSET) #define JS_E_WRONG_THIS MAKE_JSERROR(IDS_WRONG_THIS) #define JS_E_KEY_NOT_OBJECT MAKE_JSERROR(IDS_KEY_NOT_OBJECT) +#define JS_E_ARRAYBUFFER_EXPECTED MAKE_JSERROR(IDS_ARRAYBUFFER_EXPECTED) #define JS_E_PROP_DESC_MISMATCH MAKE_JSERROR(IDS_PROP_DESC_MISMATCH) #define JS_E_INVALID_WRITABLE_PROP_DESC MAKE_JSERROR(IDS_INVALID_WRITABLE_PROP_DESC) @@ -579,6 +735,7 @@ static inline BOOL is_jscript_error(HRESULT hres) const char *debugstr_jsval(const jsval_t); HRESULT create_jscript_object(BOOL,REFIID,void**); +script_ctx_t *get_script_ctx(IActiveScript*); extern LONG module_ref ; @@ -591,3 +748,6 @@ static inline void unlock_module(void) { InterlockedDecrement(&module_ref); } + +HRESULT WINAPI WineDispatchProxyCbPrivate_CreateArrayBuffer(IWineDispatchProxyCbPrivate*,DWORD,IDispatch**,void**); +HRESULT WINAPI WineDispatchProxyCbPrivate_GetRandomValues(IDispatch*); diff --git a/dlls/jscript/jscript.rc b/dlls/jscript/jscript.rc index e5289a550a3..3ea790dd5ca 100644 --- a/dlls/jscript/jscript.rc +++ b/dlls/jscript/jscript.rc @@ -33,6 +33,7 @@ STRINGTABLE IDS_NO_PROPERTY "Object doesn't support this property or method" IDS_UNSUPPORTED_ACTION "Object doesn't support this action" IDS_ARG_NOT_OPT "Argument not optional" + IDS_OBJECT_NOT_COLLECTION "Object not a collection" IDS_SYNTAX_ERROR "Syntax error" IDS_SEMICOLON "Expected ';'" IDS_LBRACKET "Expected '('" @@ -50,6 +51,7 @@ STRINGTABLE IDS_DISABLED_CC "Conditional compilation is turned off" IDS_EXPECTED_AT "Expected '@'" IDS_NOT_FUNC "Function expected" + IDS_NOT_STRING "'[object]' is not a string object" IDS_NOT_DATE "'[object]' is not a date object" IDS_NOT_NUM "Number expected" IDS_OBJECT_EXPECTED "Object expected" @@ -68,6 +70,7 @@ STRINGTABLE IDS_URI_INVALID_CHAR "URI to be encoded contains invalid characters" IDS_FRACTION_DIGITS_OUT_OF_RANGE "Number of fraction digits is out of range" IDS_PRECISION_OUT_OF_RANGE "Precision is out of range" + IDS_ARRAY_OR_ARGS_EXPECTED "Array or arguments object expected" IDS_INVALID_LENGTH "Array length must be a finite positive integer" IDS_ARRAY_EXPECTED "Array object expected" IDS_INVALID_WRITABLE_PROP_DESC "'writable' attribute on the property descriptor cannot be set to 'true' on this object" @@ -76,8 +79,18 @@ STRINGTABLE IDS_OBJECT_NONEXTENSIBLE "Cannot define property '|': object is not extensible" IDS_NONCONFIGURABLE_REDEFINED "Cannot redefine non-configurable property '|'" IDS_NONWRITABLE_MODIFIED "Cannot modify non-writable property '|'" + IDS_NOT_TYPEDARRAY "'this' is not a typed array object" + IDS_TYPEDARRAY_BAD_CTOR_ARG "Typed array constructor argument is invalid" + IDS_TYPEDARRAY_INVALID_OFFSLEN "Invalid offset/length when creating typed array" + IDS_TYPEDARRAY_INVALID_SUBARRAY "Invalid begin/end value in typed array subarray method" + IDS_TYPEDARRAY_INVALID_SOURCE "Invalid source in typed array set" + IDS_NOT_DATAVIEW "'this' is not a DataView object" + IDS_DATAVIEW_NO_ARGUMENT "Required argument offset or value in DataView method is not specified" + IDS_DATAVIEW_INVALID_ACCESS "DataView operation access beyond specified buffer length" + IDS_DATAVIEW_INVALID_OFFSET "DataView constructor argument offset is invalid" IDS_WRONG_THIS "'this' is not a | object" IDS_KEY_NOT_OBJECT "'key' is not an object" + IDS_ARRAYBUFFER_EXPECTED "ArrayBuffer object expected" IDS_PROP_DESC_MISMATCH "Property cannot have both accessors and a value" IDS_COMPILATION_ERROR "Microsoft JScript compilation error" diff --git a/dlls/jscript/jscript_main.c b/dlls/jscript/jscript_main.c index 882c419ff83..ecbb5a713ab 100644 --- a/dlls/jscript/jscript_main.c +++ b/dlls/jscript/jscript_main.c @@ -37,8 +37,43 @@ LONG module_ref = 0; DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); HINSTANCE jscript_hinstance; +static DWORD jscript_tls; static ITypeInfo *dispatch_typeinfo; +static int weak_refs_compare(const void *key, const struct rb_entry *entry) +{ + const struct weak_refs_entry *weak_refs_entry = RB_ENTRY_VALUE(entry, const struct weak_refs_entry, entry); + ULONG_PTR a = (ULONG_PTR)key, b = (ULONG_PTR)LIST_ENTRY(weak_refs_entry->list.next, struct weakmap_entry, weak_refs_entry)->key; + return (a > b) - (a < b); +} + +struct thread_data *get_thread_data(void) +{ + struct thread_data *thread_data = TlsGetValue(jscript_tls); + + if(!thread_data) { + thread_data = calloc(1, sizeof(struct thread_data)); + if(!thread_data) + return NULL; + thread_data->thread_id = GetCurrentThreadId(); + list_init(&thread_data->objects); + rb_init(&thread_data->weak_refs, weak_refs_compare); + TlsSetValue(jscript_tls, thread_data); + } + + thread_data->ref++; + return thread_data; +} + +void release_thread_data(struct thread_data *thread_data) +{ + if(--thread_data->ref) + return; + + free(thread_data); + TlsSetValue(jscript_tls, NULL); +} + HRESULT get_dispatch_typeinfo(ITypeInfo **out) { ITypeInfo *typeinfo; @@ -164,13 +199,16 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstDLL); jscript_hinstance = hInstDLL; - if(!init_strings()) + jscript_tls = TlsAlloc(); + if(jscript_tls == TLS_OUT_OF_INDEXES || !init_strings()) return FALSE; break; case DLL_PROCESS_DETACH: if (lpv) break; if (dispatch_typeinfo) ITypeInfo_Release(dispatch_typeinfo); + if(jscript_tls != TLS_OUT_OF_INDEXES) TlsFree(jscript_tls); free_strings(); + break; } return TRUE; diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index 277a5e01144..eb1f6b14a0d 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -774,7 +774,8 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsdisp_t *object, const WCHAR *na } args[0] = jsval_string(name_str); args[1] = value; - hres = jsdisp_call_value(ctx->replacer, jsval_obj(object), DISPATCH_METHOD, ARRAY_SIZE(args), args, &v); + hres = jsdisp_call_value(ctx->replacer, jsval_obj(object), DISPATCH_METHOD, ARRAY_SIZE(args), args, + &v, &ctx->ctx->jscaller->IServiceProvider_iface); jsstr_release(name_str); jsval_release(value); if(FAILED(hres)) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 70673ec190e..f964eb40947 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -558,6 +558,13 @@ static HRESULT RegExp_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, return gc_process_linked_val(gc_ctx, op, dispex, ®exp_from_jsdisp(dispex)->last_index_val); } +static void RegExp_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + RegExpInstance *This = regexp_from_jsdisp(dispex); + if(is_object_instance(This->last_index_val)) + cc_api.note_edge((nsISupports*)get_object(This->last_index_val), "last_index_val", cb); +} + static const builtin_prop_t RegExp_props[] = { {L"exec", RegExp_exec, PROPF_METHOD|1}, {L"global", NULL,0, RegExp_get_global}, @@ -579,7 +586,8 @@ static const builtin_info_t RegExp_info = { NULL, NULL, NULL, - RegExp_gc_traverse + RegExp_gc_traverse, + RegExp_cc_traverse }; static const builtin_prop_t RegExpInst_props[] = { @@ -600,7 +608,8 @@ static const builtin_info_t RegExpInst_info = { NULL, NULL, NULL, - RegExp_gc_traverse + RegExp_gc_traverse, + RegExp_cc_traverse }; static HRESULT alloc_regexp(script_ctx_t *ctx, jsstr_t *str, jsdisp_t *object_prototype, RegExpInstance **ret) diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 80e068fc529..1d64959b398 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -286,7 +286,7 @@ HRESULT variant_to_jsval(script_ctx_t *ctx, VARIANT *var, jsval_t *r) } IDispatch_AddRef(V_DISPATCH(var)); *r = jsval_disp(V_DISPATCH(var)); - return S_OK; + return convert_to_proxy(ctx, r); } case VT_I1: *r = jsval_number(V_I1(var)); @@ -330,7 +330,7 @@ HRESULT variant_to_jsval(script_ctx_t *ctx, VARIANT *var, jsval_t *r) hres = IUnknown_QueryInterface(V_UNKNOWN(var), &IID_IDispatch, (void**)&disp); if(SUCCEEDED(hres)) { *r = jsval_disp(disp); - return S_OK; + return convert_to_proxy(ctx, r); } }else { *r = ctx->html_mode ? jsval_null() : jsval_null_disp(); @@ -344,6 +344,9 @@ HRESULT variant_to_jsval(script_ctx_t *ctx, VARIANT *var, jsval_t *r) HRESULT jsval_to_variant(jsval_t val, VARIANT *retv) { + jsdisp_t *jsdisp; + IDispatch *disp; + switch(jsval_type(val)) { case JSV_UNDEFINED: V_VT(retv) = VT_EMPTY; @@ -357,9 +360,14 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv) V_VT(retv) = VT_NULL; return S_OK; case JSV_OBJECT: + disp = get_object(val); + jsdisp = to_jsdisp(disp); + if(jsdisp && jsdisp->proxy) + disp = (IDispatch*)jsdisp->proxy; + + IDispatch_AddRef(disp); V_VT(retv) = VT_DISPATCH; - V_DISPATCH(retv) = get_object(val); - IDispatch_AddRef(get_object(val)); + V_DISPATCH(retv) = disp; return S_OK; case JSV_STRING: V_VT(retv) = VT_BSTR; @@ -390,6 +398,24 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv) return E_FAIL; } +static HRESULT proxy_tostring(jsdisp_t *jsdisp, jsval_t *ret) +{ + jsstr_t *str; + HRESULT hres; + BSTR bstr; + + /* Proxy prototype with custom toString fails when called on itself */ + hres = jsdisp->proxy->lpVtbl->ToString(jsdisp->proxy, &bstr); + if(FAILED(hres)) + return hres; + str = jsstr_alloc(bstr); + SysFreeString(bstr); + if(!str) + return E_OUTOFMEMORY; + *ret = jsval_string(str); + return S_OK; +} + /* ECMA-262 3rd Edition 9.1 */ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) { @@ -412,8 +438,11 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) if(SUCCEEDED(hres)) { hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim); if(FAILED(hres)) { - WARN("call error - forwarding exception\n"); + if(hres == E_UNEXPECTED && jsdisp->proxy) + hres = proxy_tostring(jsdisp, ret); jsdisp_release(jsdisp); + if(FAILED(hres)) + WARN("call error - forwarding exception\n"); return hres; }else if(!is_object_instance(prim)) { jsdisp_release(jsdisp); @@ -431,8 +460,11 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) if(SUCCEEDED(hres)) { hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim); if(FAILED(hres)) { - WARN("call error - forwarding exception\n"); + if(hres == E_UNEXPECTED && jsdisp->proxy) + hres = proxy_tostring(jsdisp, ret); jsdisp_release(jsdisp); + if(FAILED(hres)) + WARN("call error - forwarding exception\n"); return hres; }else if(!is_object_instance(prim)) { jsdisp_release(jsdisp); @@ -1035,6 +1067,14 @@ static HRESULT WINAPI JSCaller_QueryService(IServiceProvider *iface, REFGUID gui { JSCaller *This = impl_from_IServiceProvider(iface); + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + TRACE("(%p)->(IID_IActiveScriptSite)\n", This); + if(This->ctx && This->ctx->site) + return IActiveScriptSite_QueryInterface(This->ctx->site, riid, ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + if(IsEqualGUID(guidService, &SID_GetCaller)) { TRACE("(%p)->(SID_GetCaller)\n", This); *ppv = NULL; diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index 65b25cab239..f499d1dd6c0 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -24,12 +24,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); -static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, +HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { jsdisp_t *jsdisp; const WCHAR *str; + BSTR bstr = NULL; IDispatch *disp; + jsstr_t *ret; HRESULT hres; /* Keep in sync with jsclass_t enum */ @@ -50,6 +52,17 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns L"[object Object]", L"[object Object]", L"[object Object]", + L"[object ArrayBuffer]", + L"[object Object]", + L"[object Int8Array]", + L"[object Int16Array]", + L"[object Int32Array]", + L"[object Uint8Array]", + L"[object Uint8ClampedArray]", + L"[object Uint16Array]", + L"[object Uint32Array]", + L"[object Float32Array]", + L"[object Float64Array]", L"[object Object]", L"[object Object]", L"[object Object]" @@ -57,6 +70,9 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns TRACE("\n"); + if(!r) + return S_OK; + if(is_undefined(vthis) || is_null(vthis)) { if(ctx->version < SCRIPTLANGUAGEVERSION_ES5) str = L"[object Object]"; @@ -72,6 +88,9 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns jsdisp = to_jsdisp(disp); if(!jsdisp) { str = L"[object Object]"; + }else if(jsdisp->proxy) { + hres = jsdisp->proxy->lpVtbl->ToString(jsdisp->proxy, &bstr); + str = bstr; }else if(names[jsdisp->builtin_info->class]) { str = names[jsdisp->builtin_info->class]; }else { @@ -84,13 +103,11 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns return hres; set_output: - if(r) { - jsstr_t *ret; - ret = jsstr_alloc(str); - if(!ret) - return E_OUTOFMEMORY; - *r = jsval_string(ret); - } + ret = jsstr_alloc(str); + SysFreeString(bstr); + if(!ret) + return E_OUTOFMEMORY; + *r = jsval_string(ret); return S_OK; } diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 42d695e0846..5ba633235d0 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -221,7 +221,7 @@ static expression_t *new_prop_and_value_expression(parser_ctx_t*,property_list_t %type MemberExpression %type PrimaryExpression %type GetterSetterMethod -%type Identifier_opt +%type Identifier Identifier_opt %type VariableDeclarationList %type VariableDeclarationListNoIn %type VariableDeclaration @@ -241,10 +241,11 @@ static expression_t *new_prop_and_value_expression(parser_ctx_t*,property_list_t %type PropertyName %type BooleanLiteral %type AssignOper -%type IdentifierName ReservedAsIdentifier +%type IdentifierName ReservedAsIdentifier ES5Keyword %nonassoc LOWER_THAN_ELSE -%nonassoc kELSE +%nonassoc kELSE kIN kINSTANCEOF ':' +%nonassoc kGET kLET kSET %% @@ -268,9 +269,9 @@ FunctionStatementList FunctionExpression : kFUNCTION left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' { $$ = new_function_expression(ctx, NULL, $3, $6, NULL, ctx->begin + @1, @7 - @1 + 1); } - | kFUNCTION tIdentifier left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' + | kFUNCTION Identifier left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' { $$ = new_function_expression(ctx, $2, $4, $7, NULL, ctx->begin + @1, @8 - @1 + 1); } - | kFUNCTION tIdentifier kDCOL tIdentifier left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' + | kFUNCTION Identifier kDCOL Identifier left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' { $$ = new_function_expression(ctx, $4, $6, $9, $2, ctx->begin + @1, @10 - @1 + 1); } /* ECMA-262 10th Edition 14.1 */ @@ -279,8 +280,8 @@ FunctionBody /* ECMA-262 3rd Edition 13 */ FormalParameterList - : tIdentifier { $$ = new_parameter_list(ctx, $1); } - | FormalParameterList ',' tIdentifier + : Identifier { $$ = new_parameter_list(ctx, $1); } + | FormalParameterList ',' Identifier { $$ = parameter_list_add(ctx, $1, $3); } /* ECMA-262 3rd Edition 13 */ @@ -381,12 +382,12 @@ VariableDeclarationListNoIn /* ECMA-262 3rd Edition 12.2 */ VariableDeclaration - : tIdentifier Initialiser_opt + : Identifier Initialiser_opt { $$ = new_variable_declaration(ctx, $1, $2); } /* ECMA-262 3rd Edition 12.2 */ VariableDeclarationNoIn - : tIdentifier InitialiserNoIn_opt + : Identifier InitialiserNoIn_opt { $$ = new_variable_declaration(ctx, $1, $2); } /* ECMA-262 3rd Edition 12.2 */ @@ -479,6 +480,12 @@ WithStatement LabelledStatement : tIdentifier ':' Statement { $$ = new_labelled_statement(ctx, @$, $1, $3); } + | kGET ':' Statement + { $$ = new_labelled_statement(ctx, @$, $1, $3); } + | kSET ':' Statement + { $$ = new_labelled_statement(ctx, @$, $1, $3); } + | kLET ':' Statement + { $$ = new_labelled_statement(ctx, @$, $1, $3); } /* ECMA-262 3rd Edition 12.11 */ SwitchStatement @@ -527,7 +534,7 @@ TryStatement /* ECMA-262 3rd Edition 12.14 */ Catch - : kCATCH left_bracket tIdentifier right_bracket Block + : kCATCH left_bracket Identifier right_bracket Block { $$ = new_catch_block(ctx, $3, $5); } /* ECMA-262 3rd Edition 12.14 */ @@ -786,7 +793,7 @@ ArgumentList /* ECMA-262 3rd Edition 11.1 */ PrimaryExpression : kTHIS { $$ = new_expression(ctx, EXPR_THIS, 0); } - | tIdentifier { $$ = new_identifier_expression(ctx, $1); } + | Identifier { $$ = new_identifier_expression(ctx, $1); } | Literal { $$ = new_literal_expression(ctx, $1); } | ArrayLiteral { $$ = $1; } | ObjectLiteral { $$ = $1; } @@ -860,7 +867,11 @@ PropertyName /* ECMA-262 3rd Edition 7.6 */ Identifier_opt : /* empty*/ { $$ = NULL; } - | tIdentifier { $$ = $1; } + | Identifier { $$ = $1; } + +Identifier + : tIdentifier { $$ = $1; } + | ES5Keyword { $$ = $1; } /* ECMA-262 5.1 Edition 7.6 */ IdentifierName @@ -890,15 +901,12 @@ ReservedAsIdentifier | kFINALLY { $$ = $1; } | kFOR { $$ = $1; } | kFUNCTION { $$ = $1; } - | kGET { $$ = $1; } | kIF { $$ = $1; } | kIN { $$ = $1; } | kINSTANCEOF { $$ = $1; } - | kLET { $$ = $1; } | kNEW { $$ = $1; } | kNULL { $$ = $1; } | kRETURN { $$ = $1; } - | kSET { $$ = $1; } | kSWITCH { $$ = $1; } | kTHIS { $$ = $1; } | kTHROW { $$ = $1; } @@ -909,6 +917,12 @@ ReservedAsIdentifier | kVOID { $$ = $1; } | kWHILE { $$ = $1; } | kWITH { $$ = $1; } + | ES5Keyword { $$ = $1; } + +ES5Keyword + : kGET { $$ = $1; } + | kLET { $$ = $1; } + | kSET { $$ = $1; } /* ECMA-262 3rd Edition 7.8 */ Literal diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index ad771b67475..22bc3a551e3 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -31,6 +31,7 @@ #define IDS_NO_PROPERTY 0x01B6 #define IDS_UNSUPPORTED_ACTION 0x01BD #define IDS_ARG_NOT_OPT 0x01c1 +#define IDS_OBJECT_NOT_COLLECTION 0x01c3 #define IDS_SYNTAX_ERROR 0x03EA #define IDS_SEMICOLON 0x03EC #define IDS_LBRACKET 0x03ED @@ -48,6 +49,7 @@ #define IDS_DISABLED_CC 0x0406 #define IDS_EXPECTED_AT 0x0408 #define IDS_NOT_FUNC 0x138A +#define IDS_NOT_STRING 0x138D #define IDS_NOT_DATE 0x138E #define IDS_NOT_NUM 0x1389 #define IDS_OBJECT_EXPECTED 0x138F @@ -66,6 +68,7 @@ #define IDS_URI_INVALID_CODING 0x13A1 #define IDS_FRACTION_DIGITS_OUT_OF_RANGE 0x13A2 #define IDS_PRECISION_OUT_OF_RANGE 0x13A3 +#define IDS_ARRAY_OR_ARGS_EXPECTED 0x13A4 #define IDS_INVALID_LENGTH 0x13A5 #define IDS_ARRAY_EXPECTED 0x13A7 #define IDS_INVALID_WRITABLE_PROP_DESC 0x13AC @@ -74,8 +77,18 @@ #define IDS_OBJECT_NONEXTENSIBLE 0x13D5 #define IDS_NONCONFIGURABLE_REDEFINED 0x13D6 #define IDS_NONWRITABLE_MODIFIED 0x13D7 +#define IDS_TYPEDARRAY_BAD_CTOR_ARG 0x13DA +#define IDS_NOT_TYPEDARRAY 0x13DB +#define IDS_TYPEDARRAY_INVALID_OFFSLEN 0x13DC +#define IDS_TYPEDARRAY_INVALID_SUBARRAY 0x13DD +#define IDS_TYPEDARRAY_INVALID_SOURCE 0x13DE +#define IDS_NOT_DATAVIEW 0x13DF +#define IDS_DATAVIEW_NO_ARGUMENT 0x13E0 +#define IDS_DATAVIEW_INVALID_ACCESS 0x13E1 +#define IDS_DATAVIEW_INVALID_OFFSET 0x13E2 #define IDS_WRONG_THIS 0x13FC #define IDS_KEY_NOT_OBJECT 0x13FD +#define IDS_ARRAYBUFFER_EXPECTED 0x15E4 /* FIXME: This is not compatible with native, but we would * conflict with IDS_UNSUPPORTED_ACTION otherwise */ #define IDS_PROP_DESC_MISMATCH 0x1F00 diff --git a/dlls/jscript/set.c b/dlls/jscript/set.c index ac9efbb4da0..af9cbe133dd 100644 --- a/dlls/jscript/set.c +++ b/dlls/jscript/set.c @@ -387,6 +387,20 @@ static HRESULT Map_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, js return S_OK; } +static void Map_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + note_edge_t note_edge = cc_api.note_edge; + MapInstance *map = (MapInstance*)dispex; + struct jsval_map_entry *entry; + + LIST_FOR_EACH_ENTRY(entry, &map->entries, struct jsval_map_entry, list_entry) { + if(is_object_instance(entry->key)) + note_edge((nsISupports*)get_object(entry->key), "key", cb); + if(is_object_instance(entry->value)) + note_edge((nsISupports*)get_object(entry->value), "value", cb); + } +} + static const builtin_prop_t Map_prototype_props[] = { {L"clear", Map_clear, PROPF_METHOD}, {L"delete" , Map_delete, PROPF_METHOD|1}, @@ -419,7 +433,8 @@ static const builtin_info_t Map_info = { NULL, NULL, NULL, - Map_gc_traverse + Map_gc_traverse, + Map_cc_traverse }; static HRESULT Map_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -578,7 +593,8 @@ static const builtin_info_t Set_info = { NULL, NULL, NULL, - Map_gc_traverse + Map_gc_traverse, + Map_cc_traverse }; static HRESULT Set_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -658,7 +674,7 @@ void remove_weakmap_entry(struct weakmap_entry *entry) else { struct weak_refs_entry *weak_refs_entry = LIST_ENTRY(next, struct weak_refs_entry, list); entry->key->has_weak_refs = FALSE; - rb_remove(&entry->key->ctx->weak_refs, &weak_refs_entry->entry); + rb_remove(&entry->key->ctx->thread_data->weak_refs, &weak_refs_entry->entry); free(weak_refs_entry); } rb_remove(&weakmap->map, &entry->entry); @@ -745,11 +761,6 @@ static HRESULT WeakMap_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigne if(!key) return JS_E_KEY_NOT_OBJECT; - if(key->ctx != ctx) { - FIXME("different ctx not supported\n"); - return JS_E_KEY_NOT_OBJECT; - } - if((entry = get_weakmap_entry(weakmap, key))) { jsval_t val; hres = jsval_copy(value, &val); @@ -771,14 +782,14 @@ static HRESULT WeakMap_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigne } if(key->has_weak_refs) - weak_refs_entry = RB_ENTRY_VALUE(rb_get(&ctx->weak_refs, key), struct weak_refs_entry, entry); + weak_refs_entry = RB_ENTRY_VALUE(rb_get(&ctx->thread_data->weak_refs, key), struct weak_refs_entry, entry); else { if(!(weak_refs_entry = malloc(sizeof(*weak_refs_entry)))) { jsval_release(entry->value); free(entry); return E_OUTOFMEMORY; } - rb_put(&ctx->weak_refs, key, &weak_refs_entry->entry); + rb_put(&ctx->thread_data->weak_refs, key, &weak_refs_entry->entry); list_init(&weak_refs_entry->list); key->has_weak_refs = TRUE; } @@ -853,6 +864,19 @@ static HRESULT WeakMap_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op return S_OK; } +static void WeakMap_cc_traverse(jsdisp_t *dispex, nsCycleCollectionTraversalCallback *cb) +{ + WeakMapInstance *weakmap = (WeakMapInstance*)dispex; + note_edge_t note_edge = cc_api.note_edge; + struct weakmap_entry *entry; + + /* FIXME: WeakMaps need special handling (see above), but we can't do that with this API. + This will possibly leak objects that need the CC until the WeakMap has no more refs to it. */ + RB_FOR_EACH_ENTRY(entry, &weakmap->map, struct weakmap_entry, entry) + if(is_object_instance(entry->value)) + note_edge((nsISupports*)get_object(entry->value), "value", cb); +} + static const builtin_prop_t WeakMap_prototype_props[] = { {L"clear", WeakMap_clear, PROPF_METHOD}, {L"delete", WeakMap_delete, PROPF_METHOD|1}, @@ -880,7 +904,8 @@ static const builtin_info_t WeakMap_info = { NULL, NULL, NULL, - WeakMap_gc_traverse + WeakMap_gc_traverse, + WeakMap_cc_traverse }; static HRESULT WeakMap_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -932,7 +957,7 @@ HRESULT init_set_constructor(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Set", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Set", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(constructor)); jsdisp_release(constructor); if(FAILED(hres)) @@ -947,7 +972,7 @@ HRESULT init_set_constructor(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"Map", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"Map", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(constructor)); jsdisp_release(constructor); if(FAILED(hres)) @@ -962,7 +987,7 @@ HRESULT init_set_constructor(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_define_data_property(ctx->global, L"WeakMap", PROPF_WRITABLE, + hres = jsdisp_define_data_property(ctx->global, L"WeakMap", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(constructor)); jsdisp_release(constructor); return hres; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 4033f0a2b56..c5e944dcf7b 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -89,7 +89,7 @@ static HRESULT stringobj_to_string(jsval_t vthis, jsval_t *r) if(!(string = string_this(vthis))) { WARN("this is not a string object\n"); - return E_FAIL; + return JS_E_STRING_EXPECTED; } if(r) @@ -699,7 +699,7 @@ static HRESULT rep_call(script_ctx_t *ctx, jsdisp_t *func, } if(SUCCEEDED(hres)) - hres = jsdisp_call_value(func, jsval_undefined(), DISPATCH_METHOD, argc, argv, &val); + hres = jsdisp_call_value(func, jsval_undefined(), DISPATCH_METHOD, argc, argv, &val, &ctx->jscaller->IServiceProvider_iface); for(i=0; i <= match->paren_count; i++) jsstr_release(get_string(argv[i])); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index aea412347b9..4bc7e2de881 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2633,6 +2633,7 @@ var exception_array = { E_INVALID_LENGTH: { type: "RangeError", number: -2146823259 }, E_NOT_DATE: { type: "TypeError", number: -2146823282 }, + E_NOT_STRING: { type: "TypeError", number: -2146823283 }, E_NOT_BOOL: { type: "TypeError", number: -2146823278 }, E_ARG_NOT_OPT: { type: "TypeError", number: -2146827839 }, E_NO_PROPERTY: { type: "TypeError", number: -2146827850 }, @@ -2703,6 +2704,7 @@ testException(function() {date.setTime();}, "E_ARG_NOT_OPT"); testException(function() {date.setYear();}, "E_ARG_NOT_OPT"); testException(function() {arr.test();}, "E_NO_PROPERTY"); testException(function() {[1,2,3].sort(nullDisp);}, "E_JSCRIPT_EXPECTED"); +testException(function() {var o = new Object(); o.length = 1; o[0] = "a"; Array.prototype.toString.call(o);}, "E_NOT_ARRAY"); testException(function() {var o = new Object(); o.length = 1; o[0] = "a"; Array.prototype.toLocaleString.call(o);}, "E_NOT_ARRAY"); testException(function() {Number.prototype.toString.call(arr);}, "E_NOT_NUM"); testException(function() {Number.prototype.toFixed.call(arr);}, "E_NOT_NUM"); @@ -2718,6 +2720,7 @@ testException(function() {not_existing_variable.something();}, "E_UNDEFINED"); testException(function() {date();}, "E_NOT_FUNC"); testException(function() {arr();}, "E_NOT_FUNC"); testException(function() {(new Object) instanceof (new Object);}, "E_NOT_FUNC"); +testException(function() {var o = new Object(); o.prototype = new Object(); (new Object) instanceof o;}, "E_NOT_FUNC"); testException(function() {eval("nonexistingfunc()")}, "E_OBJECT_EXPECTED"); testException(function() {(new Object()) instanceof 3;}, "E_NOT_FUNC"); testException(function() {(new Object()) instanceof null;}, "E_NOT_FUNC"); @@ -2725,6 +2728,8 @@ testException(function() {(new Object()) instanceof nullDisp;}, "E_NOT_FUNC"); testException(function() {nullDisp instanceof Object;}, "E_OBJECT_EXPECTED"); testException(function() {Function.prototype.apply.call(nullDisp, Object, []);}, "E_OBJECT_REQUIRED"); testException(function() {Function.prototype.call.call(nullDisp, Object);}, "E_OBJECT_REQUIRED"); +testException(function() {String.prototype.toString.call(null);}, "E_NOT_STRING"); +testException(function() {String.prototype.toString.call([]);}, "E_NOT_STRING"); testException(function() {"test" in 3;}, "E_OBJECT_EXPECTED"); testException(function() {"test" in null;}, "E_OBJECT_EXPECTED"); testException(function() {"test" in nullDisp;}, "E_OBJECT_EXPECTED"); @@ -2916,6 +2921,8 @@ testFunctionThis("toString"); testFunctionThis("call"); testFunctionThis("apply"); +testException(function() {(function (a, b) {}).apply(null, testObj)}, "E_JSCRIPT_EXPECTED"); + function testArrayHostThis(func) { testException(function() { Array.prototype[func].call(testObj); }, "E_JSCRIPT_EXPECTED"); } diff --git a/dlls/jscript/tests/caller.c b/dlls/jscript/tests/caller.c index 99b6a21e7fb..7bb7d4a8fe1 100644 --- a/dlls/jscript/tests/caller.c +++ b/dlls/jscript/tests/caller.c @@ -75,6 +75,7 @@ static const CLSID CLSID_JScript = expect_ ## func = called_ ## func = FALSE DEFINE_EXPECT(sp_caller_QI_NULL); +DEFINE_EXPECT(site_QI_NULL); DEFINE_EXPECT(testArgConv); DEFINE_EXPECT(testGetCaller); DEFINE_EXPECT(testGetCallerJS); @@ -254,6 +255,7 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di static void test_caller(IServiceProvider *caller, IDispatch *arg_obj) { IVariantChangeType *change_type; + IUnknown *unk; HRESULT hres; hres = IServiceProvider_QueryService(caller, &SID_VariantConversion, &IID_IVariantChangeType, (void**)&change_type); @@ -263,6 +265,12 @@ static void test_caller(IServiceProvider *caller, IDispatch *arg_obj) test_change_types(change_type, arg_obj); IVariantChangeType_Release(change_type); + + SET_EXPECT(site_QI_NULL); + hres = IServiceProvider_QueryService(caller, &IID_IActiveScriptSite, &IID_NULL, (void**)&unk); + ok(hres == E_NOINTERFACE, "Querying for IActiveScriptSite->NULL returned: %08lx\n", hres); + ok(!unk, "unk != NULL\n"); + CHECK_CALLED(site_QI_NULL); } static IServiceProvider sp_caller_obj; @@ -567,6 +575,8 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, }else if(IsEqualGUID(&IID_IActiveScriptSite, riid)) { *ppv = iface; }else { + if(IsEqualGUID(&IID_NULL, riid)) + CHECK_EXPECT(site_QI_NULL); *ppv = NULL; return E_NOINTERFACE; } diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 509f01e3211..db1e95dc844 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -3596,9 +3596,14 @@ static void test_destructors(void) "a.ref = { 'ref': Math, 'a': a }; b.ref = Math.ref;\n" "a.self = a; b.self = b; c.self = c;\n" "})(), true"; + static DISPID propput_dispid = DISPID_PROPERTYPUT; + IActiveScript *script, *script2; + IDispatchEx *dispex, *dispex2; IActiveScriptParse *parser; - IActiveScript *script; + DISPPARAMS dp = { 0 }; VARIANT v; + DISPID id; + BSTR str; HRESULT hres; V_VT(&v) = VT_EMPTY; @@ -3643,6 +3648,74 @@ static void test_destructors(void) CHECK_CALLED(testdestrobj); IActiveScript_Release(script); + + /* Create a cyclic ref across two jscript engines */ + V_VT(&v) = VT_EMPTY; + hres = parse_script_expr(cyclic_refs, &v, &script); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); + ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); + + hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); + + V_VT(&v) = VT_EMPTY; + hres = IActiveScriptParse_ParseScriptText(parser, L"Math.ref", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &v, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); + + hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + VariantClear(&v); + + V_VT(&v) = VT_EMPTY; + hres = parse_script_expr(L"new Object()", &v, &script2); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); + + hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex2); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + VariantClear(&v); + + dp.cArgs = dp.cNamedArgs = 1; + dp.rgdispidNamedArgs = &propput_dispid; + dp.rgvarg = &v; + + str = SysAllocString(L"diff_ctx"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameEnsure, &id); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + SysFreeString(str); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch*)dispex2; + hres = IDispatchEx_Invoke(dispex, id, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); + + str = SysAllocString(L"ref"); + hres = IDispatchEx_GetDispID(dispex2, str, fdexNameEnsure, &id); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + SysFreeString(str); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch*)dispex; + hres = IDispatchEx_Invoke(dispex2, id, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); + + IDispatchEx_Release(dispex2); + IDispatchEx_Release(dispex); + + SET_EXPECT(testdestrobj); + V_VT(&v) = VT_EMPTY; + hres = IActiveScriptParse_ParseScriptText(parser, L"Math.ref = undefined, CollectGarbage(), true", + NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &v, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); + ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); + IActiveScriptParse_Release(parser); + CHECK_CALLED(testdestrobj); + + IActiveScript_Release(script2); + IActiveScript_Release(script); } static void test_eval(void) diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index 1ec2f5cce0d..10f6895478e 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -42,6 +42,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(globalmem); +extern BOOL WINAPI __wine_needs_override_large_address_aware(void); + /*********************************************************************** * HeapCreate (KERNEL32.@) * @@ -424,6 +426,7 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) OSVERSIONINFOW osver; #ifndef _WIN64 IMAGE_NT_HEADERS *nt = RtlImageNtHeader( GetModuleHandleW(0) ); + static int force_large_address_aware = -1; #endif /* Because GlobalMemoryStatus is identical to GlobalMemoryStatusEX save @@ -450,6 +453,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) lpBuffer->dwAvailVirtual = memstatus.ullAvailVirtual; #ifndef _WIN64 + if (force_large_address_aware == -1) + force_large_address_aware = __wine_needs_override_large_address_aware(); if ( osver.dwMajorVersion >= 5 || osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { lpBuffer->dwTotalPhys = min( memstatus.ullTotalPhys, MAXDWORD ); @@ -463,7 +468,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) /* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */ /* page file sizes are not limited (Adobe Illustrator 8 depends on this) */ - if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE)) + if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) && + !force_large_address_aware) { if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG; if (lpBuffer->dwAvailPhys > MAXLONG) lpBuffer->dwAvailPhys = MAXLONG; diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index bb9c8fbfe0e..fb4e21adc30 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -620,7 +620,7 @@ @ stdcall -import GetConsoleProcessList(ptr long) @ stdcall -import GetConsoleScreenBufferInfo(long ptr) @ stdcall -import GetConsoleScreenBufferInfoEx(long ptr) -# @ stub GetConsoleSelectionInfo +@ stdcall -import GetConsoleSelectionInfo(ptr) @ stdcall -import GetConsoleTitleA(ptr long) @ stdcall -import GetConsoleTitleW(ptr long) @ stdcall -import GetConsoleWindow() @@ -774,7 +774,8 @@ @ stdcall -import GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall GetPackageFamilyName(long ptr ptr) kernelbase.GetPackageFamilyName @ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName -@ stdcall GetPackagesByPackageFamily(wstr ptr ptr ptr ptr) kernelbase.GetPackagesByPackageFamily +@ stdcall -import GetPackagePath(ptr long ptr ptr) +@ stdcall -import GetPackagesByPackageFamily(wstr ptr ptr ptr ptr) @ stdcall GetPackagePathByFullName(wstr ptr wstr) kernelbase.GetPackagePathByFullName @ stdcall -import GetPhysicallyInstalledSystemMemory(ptr) @ stdcall -import GetPriorityClass(long) @@ -1163,6 +1164,7 @@ @ stdcall -import PeekConsoleInputW(ptr ptr long ptr) @ stdcall -import PeekNamedPipe(long ptr long ptr ptr ptr) @ stdcall -import PostQueuedCompletionStatus(long long ptr ptr) +@ stdcall -import PackageFullNameFromId(ptr ptr ptr) @ stdcall -import PackageIdFromFullName(wstr long ptr ptr) @ stdcall PowerClearRequest(long long) @ stdcall PowerCreateRequest(ptr) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 35c7c552dd5..7dd1125a0a6 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1627,6 +1627,98 @@ static void test_ddag_node(void) ok( se == node->Dependencies.Tail, "Expected end of the list.\n" ); } +#define check_dll_path(a, b) check_dll_path_( __LINE__, a, b ) +static void check_dll_path_( unsigned int line, HMODULE h, const char *expected ) +{ + char path[MAX_PATH]; + DWORD ret; + + *path = 0; + ret = GetModuleFileNameA( h, path, MAX_PATH); + ok_(__FILE__, line)( ret && ret < MAX_PATH, "Got %lu.\n", ret ); + ok_(__FILE__, line)( !stricmp( path, expected ), "Got %s.\n", debugstr_a(path) ); +} + +static void test_known_dlls_load(void) +{ + static const char apiset_dll[] = "ext-ms-win-base-psapi-l1-1-0.dll"; + char system_path[MAX_PATH], local_path[MAX_PATH]; + static const char dll[] = "psapi.dll"; + HMODULE hlocal, hsystem, hapiset, h; + BOOL ret; + + if (GetModuleHandleA( dll ) || GetModuleHandleA( apiset_dll )) + { + skip( "%s is already loaded, skipping test.\n", dll ); + return; + } + + hapiset = LoadLibraryA( apiset_dll ); + if (!hapiset) + { + win_skip( "%s is not available.\n", apiset_dll ); + return; + } + FreeLibrary( hapiset ); + + GetSystemDirectoryA( system_path, sizeof(system_path) ); + strcat( system_path, "\\" ); + strcat( system_path, dll ); + + GetCurrentDirectoryA( sizeof(local_path), local_path ); + strcat( local_path, "\\" ); + strcat( local_path, dll ); + + /* Known dll is always found in system dir, regardless of its presence in the application dir. */ + ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_USER_DIRS ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); + h = LoadLibraryA( dll ); + ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); + ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); + hapiset = GetModuleHandleA( apiset_dll ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); + ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); + hapiset = GetModuleHandleA( apiset_dll ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + /* Put dll to the current directory. */ + create_test_dll( dll ); + + h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); + ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); + hapiset = GetModuleHandleA( apiset_dll ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + /* Local version can still be loaded if dll name contains path. */ + hlocal = LoadLibraryA( local_path ); + ok( !!hlocal, "Got NULL.\n" ); + check_dll_path( hlocal, local_path ); + + /* dll without path will match the loaded one. */ + hsystem = LoadLibraryA( dll ); + ok( hsystem == hlocal, "Got %p, %p.\n", hsystem, hlocal ); + h = GetModuleHandleA( dll ); + ok( h == hlocal, "Got %p, %p.\n", h, hlocal ); + + /* apiset dll won't match the one loaded not from system dir. */ + hapiset = GetModuleHandleA( apiset_dll ); + ok( !hapiset, "Got %p.\n", hapiset ); + + FreeLibrary( hsystem ); + FreeLibrary( hlocal ); + + DeleteFileA( dll ); +} + START_TEST(module) { WCHAR filenameW[MAX_PATH]; @@ -1663,4 +1755,5 @@ START_TEST(module) test_LdrGetDllFullName(); test_apisets(); test_ddag_node(); + test_known_dlls_load(); } diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 56a9d6e4859..8c609b603dd 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -57,6 +57,7 @@ static BOOLEAN (WINAPI *pTryAcquireSRWLockShared)(PSRWLOCK); static NTSTATUS (WINAPI *pNtAllocateVirtualMemory)(HANDLE, PVOID *, ULONG_PTR, SIZE_T *, ULONG, ULONG); static NTSTATUS (WINAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG); +static NTSTATUS (WINAPI *pNtQuerySystemTime)(LARGE_INTEGER *); static NTSTATUS (WINAPI *pNtWaitForSingleObject)(HANDLE, BOOLEAN, const LARGE_INTEGER *); static NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); static PSLIST_ENTRY (__fastcall *pRtlInterlockedPushListSList)(PSLIST_HEADER list, PSLIST_ENTRY first, @@ -227,8 +228,23 @@ static void test_temporary_objects(void) ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError()); } +static HANDLE mutex, mutex2, mutices[2]; + +static DWORD WINAPI mutex_thread( void *param ) +{ + DWORD expect = (DWORD)(DWORD_PTR)param; + DWORD ret; + + ret = WaitForSingleObject( mutex, 0 ); + ok(ret == expect, "expected %lu, got %lu\n", expect, ret); + + if (!ret) ReleaseMutex( mutex ); + return 0; +} + static void test_mutex(void) { + HANDLE thread; DWORD wait_ret; BOOL ret; HANDLE hCreated; @@ -268,7 +284,8 @@ static void test_mutex(void) SetLastError(0xdeadbeef); hOpened = OpenMutexA(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex"); ok(hOpened != NULL, "OpenMutex failed with error %ld\n", GetLastError()); - wait_ret = WaitForSingleObject(hOpened, INFINITE); + wait_ret = WaitForSingleObject(hOpened, 0); +todo_wine_if(getenv("WINEESYNC")) /* XFAIL: validation is not implemented */ ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n"); CloseHandle(hOpened); @@ -299,6 +316,7 @@ static void test_mutex(void) SetLastError(0xdeadbeef); ret = ReleaseMutex(hCreated); +todo_wine_if(getenv("WINEESYNC")) /* XFAIL: due to the above */ ok(!ret && (GetLastError() == ERROR_NOT_OWNER), "ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %ld\n", GetLastError()); @@ -337,6 +355,85 @@ static void test_mutex(void) CloseHandle(hOpened); CloseHandle(hCreated); + + mutex = CreateMutexA( NULL, FALSE, NULL ); + ok(!!mutex, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + for (i = 0; i < 100; i++) + { + ret = WaitForSingleObject( mutex, 0 ); + ok(ret == 0, "got %u\n", ret); + } + + for (i = 0; i < 100; i++) + { + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + } + + ret = ReleaseMutex( mutex ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)0, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + WaitForSingleObject( mutex, 0 ); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)WAIT_TIMEOUT, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)0, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + mutex2 = CreateMutexA( NULL, TRUE, NULL ); + ok(!!mutex2, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + mutices[0] = mutex; + mutices[1] = mutex2; + + ret = WaitForMultipleObjects( 2, mutices, FALSE, 0 ); + ok(ret == 0, "got %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + ret = WaitForMultipleObjects( 2, mutices, TRUE, 0 ); + ok(ret == 0, "got %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + } static void test_slist(void) @@ -512,12 +609,13 @@ static void test_slist(void) static void test_event(void) { - HANDLE handle, handle2; + HANDLE handle, handle2, handles[2]; SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; ACL acl; DWORD ret; BOOL val; + int i; /* no sd */ handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); @@ -621,11 +719,130 @@ static void test_event(void) ok( ret, "QueryMemoryResourceNotification failed err %lu\n", GetLastError() ); ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); CloseHandle( handle ); + + handle = CreateEventA( NULL, TRUE, FALSE, NULL ); + ok(!!handle, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = SetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = SetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + for (i = 0; i < 100; i++) + { + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = ResetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handle2 = CreateEventA( NULL, FALSE, TRUE, NULL ); + ok(!!handle2, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = SetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = SetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handles[0] = handle; + handles[1] = handle2; + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ResetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle2 ); + ResetEvent( handle ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + handles[0] = handle2; + handles[1] = handle; + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = CloseHandle( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); } static void test_semaphore(void) { - HANDLE handle, handle2; + HANDLE handle, handle2, handles[2]; + DWORD ret; + LONG prev; + int i; /* test case sensitivity */ @@ -667,6 +884,99 @@ static void test_semaphore(void) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError()); CloseHandle( handle ); + + handle = CreateSemaphoreA( NULL, 0, 5, NULL ); + ok(!!handle, "CreateSemaphore failed: %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 0, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 1, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 5, &prev ); + ok(!ret, "got %ld\n", ret); + ok(GetLastError() == ERROR_TOO_MANY_POSTS, "got error %lu\n", GetLastError()); + ok(prev == 1, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 2, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 2, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 4, "got prev %ld\n", prev); + + for (i = 0; i < 5; i++) + { + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handle2 = CreateSemaphoreA( NULL, 3, 5, NULL ); + ok(!!handle2, "CreateSemaphore failed: %lu\n", GetLastError()); + + ret = ReleaseSemaphore( handle2, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 3, "got prev %ld\n", prev); + + for (i = 0; i < 4; i++) + { + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handles[0] = handle; + handles[1] = handle2; + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + ReleaseSemaphore( handle2, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + ReleaseSemaphore( handle2, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = CloseHandle( handle ); + ok(ret, "got error %lu\n", ret); + + ret = CloseHandle( handle2 ); + ok(ret, "got error %lu\n", ret); } static void test_waitable_timer(void) @@ -1221,11 +1531,15 @@ static HANDLE modify_handle(HANDLE handle, DWORD modify) return ULongToHandle(tmp); } +#define TIMEOUT_INFINITE (((LONGLONG)0x7fffffff) << 32 | 0xffffffff) + static void test_WaitForSingleObject(void) { HANDLE signaled, nonsignaled, invalid; + LARGE_INTEGER ntnow, ntthen; LARGE_INTEGER timeout; NTSTATUS status; + DWORD now, then; DWORD ret; signaled = CreateEventW(NULL, TRUE, TRUE, NULL); @@ -1310,6 +1624,68 @@ static void test_WaitForSingleObject(void) status = pNtWaitForSingleObject(GetCurrentThread(), FALSE, &timeout); ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08lx\n", status); + ret = WaitForSingleObject( signaled, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( nonsignaled, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + /* test that a timed wait actually does wait */ + now = GetTickCount(); + ret = WaitForSingleObject( nonsignaled, 100 ); + then = GetTickCount(); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + ok(abs((then - now) - 100) < 5, "got %lu ms\n", then - now); + + now = GetTickCount(); + ret = WaitForSingleObject( signaled, 100 ); + then = GetTickCount(); + ok(ret == 0, "got %lu\n", ret); + ok(abs(then - now) < 5, "got %lu ms\n", then - now); + + ret = WaitForSingleObject( signaled, INFINITE ); + ok(ret == 0, "got %lu\n", ret); + + /* test NT timeouts */ + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart + 100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs(((ntthen.QuadPart - ntnow.QuadPart) / 10000) - 100) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = -100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs(((ntthen.QuadPart - ntnow.QuadPart) / 10000) - 100) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + status = pNtWaitForSingleObject( signaled, FALSE, NULL ); + ok(status == 0, "got %#lx\n", status); + + timeout.QuadPart = TIMEOUT_INFINITE; + status = pNtWaitForSingleObject( signaled, FALSE, &timeout ); + ok(status == 0, "got %#lx\n", status); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs((ntthen.QuadPart - ntnow.QuadPart) / 10000) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart - 100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs((ntthen.QuadPart - ntnow.QuadPart) / 10000) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + CloseHandle(signaled); CloseHandle(nonsignaled); } @@ -2741,7 +3117,7 @@ static void test_crit_section(void) to override that. */ memset(&cs, 0, sizeof(cs)); InitializeCriticalSection(&cs); - ok(cs.DebugInfo != NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + todo_wine ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo); DeleteCriticalSection(&cs); ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo); @@ -2751,10 +3127,31 @@ static void test_crit_section(void) return; } + memset(&cs, 0, sizeof(cs)); + ret = pInitializeCriticalSectionEx(&cs, 0, 0); + ok(ret, "Failed to initialize critical section.\n"); + ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + DeleteCriticalSection(&cs); + ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + memset(&cs, 0, sizeof(cs)); ret = pInitializeCriticalSectionEx(&cs, 0, CRITICAL_SECTION_NO_DEBUG_INFO); ok(ret, "Failed to initialize critical section.\n"); ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + DeleteCriticalSection(&cs); + ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + + memset(&cs, 0, sizeof(cs)); + ret = pInitializeCriticalSectionEx(&cs, 0, 0); + ok(ret, "Failed to initialize critical section.\n"); + ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + DeleteCriticalSection(&cs); + ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo); + + memset(&cs, 0, sizeof(cs)); + ret = pInitializeCriticalSectionEx(&cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO); + ok(ret, "Failed to initialize critical section.\n"); + ok(cs.DebugInfo && cs.DebugInfo != (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo); ret = TryEnterCriticalSection(&cs); ok(ret, "Failed to enter critical section.\n"); @@ -2841,6 +3238,84 @@ static void test_QueueUserAPC(void) ok(apc_count == 1, "APC count %u\n", apc_count); } +static int zigzag_state, zigzag_count[2], zigzag_stop; + +static DWORD CALLBACK zigzag_event0(void *arg) +{ + HANDLE *events = arg; + + while (!zigzag_stop) + { + WaitForSingleObject(events[0], INFINITE); + ResetEvent(events[0]); + ok(zigzag_state == 0, "got wrong state %d\n", zigzag_state); + zigzag_state++; + SetEvent(events[1]); + zigzag_count[0]++; + } + trace("thread 0 got done\n"); + return 0; +} + +static DWORD CALLBACK zigzag_event1(void *arg) +{ + HANDLE *events = arg; + + while (!zigzag_stop) + { + WaitForSingleObject(events[1], INFINITE); + ResetEvent(events[1]); + ok(zigzag_state == 1, "got wrong state %d\n", zigzag_state); + zigzag_state--; + SetEvent(events[0]); + zigzag_count[1]++; + } + trace("thread 1 got done\n"); + return 0; +} + +static void test_zigzag_event(void) +{ + /* The basic idea is to test SetEvent/Wait back and forth between two + * threads. Each thread clears their own event, sets some common data, + * signals the other's, then waits on their own. We make sure the common + * data is always in the right state. We also print performance data. */ + + HANDLE threads[2], events[2]; + BOOL ret; + + events[0] = CreateEventA(NULL, FALSE, FALSE, NULL); + events[1] = CreateEventA(NULL, FALSE, FALSE, NULL); + + threads[0] = CreateThread(NULL, 0, zigzag_event0, events, 0, NULL); + threads[1] = CreateThread(NULL, 0, zigzag_event1, events, 0, NULL); + + zigzag_state = 0; + zigzag_count[0] = zigzag_count[1] = 0; + zigzag_stop = 0; + + trace("starting zigzag test (events)\n"); + SetEvent(events[0]); + Sleep(2000); + zigzag_stop = 1; + ret = WaitForMultipleObjects(2, threads, FALSE, INFINITE); + trace("%d\n", ret); + ok(ret == 0 || ret == 1, "wait failed: %u\n", ret); + + ok(zigzag_count[0] == zigzag_count[1] || zigzag_count[0] == zigzag_count[1] + 1, + "count did not match: %d != %d\n", zigzag_count[0], zigzag_count[1]); + + /* signal the other thread to finish, if it didn't already + * (in theory they both would at the same time, but there's a slight race on teardown if we get + * thread 1 SetEvent -> thread 0 ResetEvent -> thread 0 Wait -> thread 1 exits */ + zigzag_state = 1-ret; + SetEvent(events[1-ret]); + ret = WaitForSingleObject(threads[1-ret], 1000); + ok(!ret, "wait failed: %u\n", ret); + + trace("count: %d\n", zigzag_count[0]); +} + START_TEST(sync) { char **argv; @@ -2867,6 +3342,7 @@ START_TEST(sync) pTryAcquireSRWLockShared = (void *)GetProcAddress(hdll, "TryAcquireSRWLockShared"); pNtAllocateVirtualMemory = (void *)GetProcAddress(hntdll, "NtAllocateVirtualMemory"); pNtFreeVirtualMemory = (void *)GetProcAddress(hntdll, "NtFreeVirtualMemory"); + pNtQuerySystemTime = (void *)GetProcAddress(hntdll, "NtQuerySystemTime"); pNtWaitForSingleObject = (void *)GetProcAddress(hntdll, "NtWaitForSingleObject"); pNtWaitForMultipleObjects = (void *)GetProcAddress(hntdll, "NtWaitForMultipleObjects"); pRtlInterlockedPushListSList = (void *)GetProcAddress(hntdll, "RtlInterlockedPushListSList"); @@ -2911,5 +3387,6 @@ START_TEST(sync) test_srwlock_example(); test_alertable_wait(); test_apc_deadlock(); + test_zigzag_event(); test_crit_section(); } diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index 1c280d2b2eb..1db7053ea3b 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -23,8 +23,11 @@ #include "winternl.h" #include "appmodel.h" +static LONG (WINAPI * pGetPackagePath)(const PACKAGE_ID *, const UINT32, UINT32 *, WCHAR *); +static LONG (WINAPI * pGetPackagesByPackageFamily)(const WCHAR *, UINT32 *, WCHAR **, UINT32 *, WCHAR *); static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *); static UINT (WINAPI * pGetSystemFirmwareTable)(DWORD, DWORD, void *, DWORD); +static LONG (WINAPI * pPackageFullNameFromId)(const PACKAGE_ID *, UINT32 *, WCHAR *); static LONG (WINAPI * pPackageIdFromFullName)(const WCHAR *, UINT32, UINT32 *, BYTE *); static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *); static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *); @@ -43,8 +46,11 @@ static void init_function_pointers(void) hmod = GetModuleHandleA("kernel32.dll"); + GET_PROC(GetPackagePath); + GET_PROC(GetPackagesByPackageFamily); GET_PROC(GetProductInfo); GET_PROC(GetSystemFirmwareTable); + GET_PROC(PackageFullNameFromId); GET_PROC(PackageIdFromFullName); hmod = GetModuleHandleA("ntdll.dll"); @@ -801,9 +807,11 @@ static void test_PackageIdFromFullName(void) { 0, PROCESSOR_ARCHITECTURE_INTEL, {{.Major = 1, .Minor = 2, .Build = 3, .Revision = 4}}, - (WCHAR *)L"TestPackage", NULL, + (WCHAR *)L"TestPackage", (WCHAR *)L"TestResource", (WCHAR *)L"TestResourceId", (WCHAR *)L"0abcdefghjkme" }; + static const WCHAR test_package_fullname[] = + L"TestPackage_1.2.3.4_x86_TestResourceId_0abcdefghjkme"; UINT32 size, expected_size; PACKAGE_ID test_id; WCHAR fullname[512]; @@ -916,6 +924,22 @@ static void test_PackageIdFromFullName(void) size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_0abcdefghjkme", 0, &size, id_buffer); ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret); + + ret = pPackageFullNameFromId(&test_package_id, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + size = sizeof(fullname); + ret = pPackageFullNameFromId(&test_package_id, &size, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + size = 0; + ret = pPackageFullNameFromId(&test_package_id, &size, NULL); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(size == lstrlenW(test_package_fullname) + 1, "Got unexpected size %u.\n", size); + + ret = pPackageFullNameFromId(&test_package_id, &size, fullname); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!lstrcmpW(fullname, test_package_fullname), "Got unexpected fullname %s.\n", debugstr_w(fullname)); } #define TEST_VERSION_WIN7 1 @@ -1075,6 +1099,187 @@ static void test_pe_os_version(void) } } + +static void test_package_info(void) +{ + static const WCHAR package_family_msvc140[] = L"Microsoft.VCLibs.140.00_8wekyb3d8bbwe"; + UINT32 count, length, curr_length, size, path_length, total_length; + WCHAR buffer[2048], path[MAX_PATH]; + PACKAGE_ID *id, saved_id; + WCHAR *full_names[32]; + BYTE id_buffer[512]; + DWORD arch, attrib; + BOOL arch_found; + SYSTEM_INFO si; + unsigned int i; + LONG ret; + + if (!pGetPackagesByPackageFamily) + { + win_skip("GetPackagesByPackageFamily not available.\n"); + return; + } + + GetSystemInfo(&si); + arch = si.wProcessorArchitecture; + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_8wekyb3d8bbwe", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_iekyb3d8bbwe", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0xdeadbeef; + length = 0xdeadbeef; + ret = pGetPackagesByPackageFamily(L"Unknown", &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == 0xdeadbeef, "Got unexpected count %u.\n", count); + ok(length == 0xdeadbeef, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown", &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_8wekyb3d8bbwe_b", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + length = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, NULL, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + + count = ARRAY_SIZE(full_names); + length = ARRAY_SIZE(buffer); + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, full_names, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, buffer); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + length = 0; + ret = pGetPackagePath(NULL, 0, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, NULL); + if (!ret && !count && !length) + { + win_skip("Package VCLibs.140.00 is not installed.\n"); + return; + } + + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(count >= 1, "Got unexpected count %u.\n", count); + ok(length > 1, "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, full_names, &length, buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(count >= 1, "Got unexpected count %u.\n", count); + ok(length > 1, "Got unexpected length %u.\n", length); + + total_length = length; + id = (PACKAGE_ID *)id_buffer; + curr_length = 0; + arch_found = FALSE; + for (i = 0; i < count; ++i) + { + curr_length += lstrlenW(full_names[i]) + 1; + + size = sizeof(id_buffer); + ret = pPackageIdFromFullName(full_names[i], 0, &size, id_buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + + if (id->processorArchitecture == arch) + arch_found = TRUE; + + path_length = 0; + ret = pGetPackagePath(id, 0, &path_length, NULL); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(path_length > 1, "Got unexpected path_length %u.\n", path_length); + + length = path_length; + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(length == path_length, "Got unexpected length %u.\n", length); + attrib = GetFileAttributesW(path); + ok(attrib != INVALID_FILE_ATTRIBUTES && attrib & FILE_ATTRIBUTE_DIRECTORY, + "Got unexpected attrib %#x, GetLastError() %u.\n", attrib, GetLastError()); + } + ok(curr_length == total_length, "Got unexpected length %u.\n", length); + ok(arch_found, "Did not find package for current arch.\n"); + + size = sizeof(id_buffer); + ret = pPackageIdFromFullName(full_names[0], 0, &size, id_buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + saved_id = *id; + + id->publisherId = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->name = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->publisher = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->processorArchitecture = ~0u; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->name[0] = L'X'; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %u.\n", ret); +} + START_TEST(version) { char **argv; @@ -1102,4 +1307,5 @@ START_TEST(version) test_pe_os_version(); test_GetSystemFirmwareTable(); test_PackageIdFromFullName(); + test_package_info(); } diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index c54fb16ba15..bc573644d97 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1631,7 +1631,7 @@ static void test_write_watch(void) MEMORY_BASIC_INFORMATION info; HANDLE readpipe, writepipe, file; OVERLAPPED overlapped, *overlapped2; - void *results[64]; + void *results[2048]; ULONG_PTR count; ULONG i, pagesize; BOOL success; @@ -1671,6 +1671,7 @@ static void test_write_watch(void) SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, GetModuleHandleW(NULL), size, results, &count, &pagesize ); + ok(ret, "failed.\n"); if (ret) { ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); @@ -1694,6 +1695,7 @@ static void test_write_watch(void) ok( results[0] == base + pagesize, "wrong result %p\n", results[0] ); count = 64; + results[0] = (void *)0xdeadbeef; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %Iu\n", count ); @@ -2103,6 +2105,16 @@ static void test_write_watch(void) base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_NOACCESS ); ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + + ret = pResetWriteWatch( base, size ); + ok( !ret, "pResetWriteWatch failed %lu\n", GetLastError() ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_NOACCESS ); ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); @@ -2122,20 +2134,160 @@ static void test_write_watch(void) ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot ); count = 64; - ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ret = pGetWriteWatch( /*0*/WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); + ret = pResetWriteWatch( base, size ); + ret = pResetWriteWatch( base + 6*pagesize, size - 6 * pagesize ); + ok( !ret, "pResetWriteWatch failed %lu\n", GetLastError() ); + + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( /*0*/WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + ok( results[0] == (void *)0xdeadbeef, "wrong result %p\n", results[0] ); + + ret = VirtualFree( base + pagesize, pagesize, MEM_DECOMMIT ); + ok( ret, "VirtualFree failed %lu\n", GetLastError() ); + + ret = VirtualProtect( base + 2*pagesize, pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot ); + + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + ok( results[0] == (void *)0xdeadbeef, "wrong result %p\n", results[0] ); + + base[2*pagesize + 200] = 3; + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_NOACCESS ); + ok( !!base, "VirtualFree failed %lu\n", GetLastError() ); + + ret = VirtualProtect( base, 6*pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot ); + + base[3*pagesize + 200] = 3; + base[5*pagesize + 200] = 3; + ret = VirtualFree( base, size, MEM_DECOMMIT ); ok( ret, "VirtualFree failed %lu\n", GetLastError() ); count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 1 || broken(count == 0), /* win98 */ - "wrong count %Iu\n", count ); - if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); + ok( !count, "wrong count %Iu\n", count ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_READWRITE ); + ok(!!base, "VirtualAlloc failed.\n"); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( !count, "wrong count %Iu\n", count ); + + /* Looks like VirtualProtect latches write watch state somewhere, so if pages are decommitted after, + * (which normally clears write watch state), a page from range which previously had protection change + * is still reported as dirty. */ + base[3*pagesize + 200] = 3; + ret = VirtualProtect( base, 6*pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot ); + + base[5*pagesize + 200] = 3; + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong c ount %Iu\n", count ); + ok( results[0] == base + 3*pagesize && results[1] == base + 5*pagesize, "wrong result %p\n", results[0] ); + + ret = VirtualFree( base, size, MEM_DECOMMIT ); + ok( ret, "VirtualFree failed %lu\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 3*pagesize, "wrong result %p\n", results[0] ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_READWRITE ); + ok(!!base, "VirtualAlloc failed.\n"); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 3*pagesize, "wrong result %p\n", results[0] ); + + base[4*pagesize + 200] = 4; + base[2*pagesize + 200] = 4; + base[6*pagesize + 200] = 4; + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 4, "wrong count %Iu\n", count ); + ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[1] == base + 3*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[2] == base + 4*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[3] == base + 6*pagesize, "wrong result %p\n", results[0] ); + + VirtualFree( base, 0, MEM_RELEASE ); + + /* Test longer range */ + size = 2048 * pagesize; + base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + + count = 2048; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + + count = 2048; + for (i = 0; i < count; i += 2) + ++base[i * pagesize]; + + ret = VirtualProtect( base, size / 2, PAGE_READONLY, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1024, "wrong count %Iu\n", count ); + + for (i = 0; i < count; ++i) + { + ok( results[i] == base + i * 2 * pagesize, "wrong result %p\n", results[i] ); + if (results[i] != base + i * 2 * pagesize) + break; + } + + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1024, "wrong count %Iu\n", count ); + + for (i = 0; i < count; ++i) + { + ok( results[i] == base + i * 2 * pagesize, "wrong result %p\n", results[i] ); + if (results[i] != base + i * 2 * pagesize) + break; + } + + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); VirtualFree( base, 0, MEM_RELEASE ); } diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c index 0314b362e86..c4b4fc225a4 100644 --- a/dlls/kernel32/virtual.c +++ b/dlls/kernel32/virtual.c @@ -35,6 +35,7 @@ #include "psapi.h" #include "wine/exception.h" #include "wine/debug.h" +#include "wine/asm.h" #include "kernel_private.h" @@ -293,7 +294,8 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src ) * lstrcpyA (KERNEL32.@) * lstrcpy (KERNEL32.@) */ -LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) +#ifdef __x86_64__ +LPSTR WINAPI lstrcpyA_impl( LPSTR dst, LPCSTR src ) { __TRY { @@ -309,6 +311,42 @@ LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) return dst; } +__ASM_GLOBAL_FUNC( lstrcpyA, + ".byte 0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n\t" + "pushq %rbp\n\t" + __ASM_SEH(".seh_pushreg %rbp\n\t") + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") + "movq %rsp,%rbp\n\t" + __ASM_SEH(".seh_setframe %rbp,0\n\t") + __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") + __ASM_SEH(".seh_endprologue\n\t") + "subq $0x20,%rsp\n\t" + "andq $~15,%rsp\n\t" + "call " __ASM_NAME("lstrcpyA_impl") "\n\t" + "leaq 0(%rbp),%rsp\n\t" + __ASM_CFI(".cfi_def_cfa_register %rsp\n\t") + "popq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") + __ASM_CFI(".cfi_same_value %rbp\n\t") + "ret" ) +#else /* __x86_64__ */ +LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) +{ + __TRY + { + /* this is how Windows does it */ + memmove( dst, src, strlen(src)+1 ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +} +#endif /*********************************************************************** * lstrcpyW (KERNEL32.@) diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index 4209d2e6991..0f349f9939b 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1065,6 +1065,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleScreenBufferInfoEx( HANDLE handle, } +BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleSelectionInfo(CONSOLE_SELECTION_INFO *info) +{ + FIXME("stub (%p)\n", info); + info->dwFlags = CONSOLE_NO_SELECTION; + return TRUE; +} + + /****************************************************************************** * GetConsoleTitleA (kernelbase.@) */ diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index edb6d321a46..6423ff4573d 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -600,7 +600,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event ) startup.cb = sizeof(startup); startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL; - ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info ); + ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, CREATE_NO_WINDOW, env, NULL, &startup, &info ); FreeEnvironmentStringsW( env ); if (ret) @@ -635,6 +635,8 @@ static BOOL start_debugger_atomic( EXCEPTION_POINTERS *epointers ) { static HANDLE once; + if (!ERR_ON(seh)) return FALSE; + if (once == 0) { OBJECT_ATTRIBUTES attr; @@ -1665,7 +1667,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetWsChangesEx( HANDLE process, PSAPI_WS_WATCH_INF BOOL WINAPI /* DECLSPEC_HOTPATCH */ InitializeProcessForWsWatch( HANDLE process ) { FIXME( "(process=%p): stub\n", process ); - return TRUE; + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; } diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index ffb153a46ee..62b3b4d0488 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -472,6 +472,7 @@ @ stdcall GetConsoleProcessList(ptr long) @ stdcall GetConsoleScreenBufferInfo(long ptr) @ stdcall GetConsoleScreenBufferInfoEx(long ptr) +@ stdcall GetConsoleSelectionInfo(ptr) @ stdcall GetConsoleTitleA(ptr long) @ stdcall GetConsoleTitleW(ptr long) @ stdcall GetConsoleWindow() @@ -630,7 +631,7 @@ # @ stub GetPackageInfo # @ stub GetPackageInstallTime # @ stub GetPackageOSMaxVersionTested -# @ stub GetPackagePath +@ stdcall GetPackagePath(ptr long ptr ptr) @ stdcall GetPackagePathByFullName(wstr ptr wstr) # @ stub GetPackagePathOnVolume # @ stub GetPackageProperty @@ -1043,7 +1044,7 @@ # @ stub PackageFamilyNameFromFullName # @ stub PackageFamilyNameFromId # @ stub PackageFamilyNameFromProductId -# @ stub PackageFullNameFromId +@ stdcall PackageFullNameFromId(ptr ptr ptr) # @ stub PackageFullNameFromProductId @ stdcall PackageIdFromFullName(wstr long ptr ptr) # @ stub PackageIdFromProductId diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index 59b91596f13..cbb6e49dab2 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -301,7 +301,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameW( HMODULE module, LPWSTR filena UNICODE_STRING name; NTSTATUS status; - if (!module && ((win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name) + if (!module && (0 && (win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name) { len = min( size, win16_tib->exe_name->Length / sizeof(WCHAR) ); memcpy( filename, win16_tib->exe_name->Buffer, len * sizeof(WCHAR) ); @@ -536,6 +536,14 @@ HMODULE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW( LPCWSTR name, HANDLE file, DWOR SetLastError( ERROR_INVALID_PARAMETER ); return 0; } + + /* HACK: allow webservices.dll to be shipped together with remote debugger tools. */ + if (flags == LOAD_LIBRARY_SEARCH_SYSTEM32 && !file && !wcscmp( name, L"webservices.dll" )) + { + FIXME( "HACK: ignoring LOAD_LIBRARY_SEARCH_SYSTEM32 for webservices.dll\n" ); + flags = 0; + } + RtlInitUnicodeString( &str, name ); if (str.Buffer[str.Length/sizeof(WCHAR) - 1] != ' ') return load_library( &str, flags ); diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 1aeb8f55257..4267a8c57e6 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -26,12 +26,14 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" +#include "winver.h" #include "wincontypes.h" #include "winternl.h" #include "kernelbase.h" #include "wine/debug.h" #include "wine/condrv.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(process); @@ -504,6 +506,135 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char * return ret; } +/* Returns TRUE if the product name of the app matches the parameter */ +static BOOL product_name_matches(const WCHAR *app_name, const char *match) +{ + WCHAR full_path[MAX_PATH]; + DWORD *translation; + char *product_name; + char buf[100]; + void *block; + UINT size; + + if (!GetLongPathNameW( app_name, full_path, MAX_PATH )) lstrcpynW( full_path, app_name, MAX_PATH ); + if (!GetFullPathNameW( full_path, MAX_PATH, full_path, NULL )) lstrcpynW( full_path, app_name, MAX_PATH ); + + size = GetFileVersionInfoSizeExW(0, full_path, NULL); + if (!size) + return FALSE; + + block = HeapAlloc( GetProcessHeap(), 0, size ); + + if (!GetFileVersionInfoExW(0, full_path, 0, size, block)) + { + HeapFree( GetProcessHeap(), 0, block ); + return FALSE; + } + + if (!VerQueryValueA(block, "\\VarFileInfo\\Translation", (void **) &translation, &size) || size != 4) + { + HeapFree( GetProcessHeap(), 0, block ); + return FALSE; + } + + sprintf(buf, "\\StringFileInfo\\%08lx\\ProductName", MAKELONG(HIWORD(*translation), LOWORD(*translation))); + + if (!VerQueryValueA(block, buf, (void **) &product_name, &size)) + { + HeapFree( GetProcessHeap(), 0, block ); + return FALSE; + } + + if (strcmp(product_name, match)) + { + HeapFree( GetProcessHeap(), 0, block); + return FALSE; + } + + HeapFree( GetProcessHeap(), 0, block ); + return TRUE; +} + +static int battleye_launcher_redirect_hack( const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, + WCHAR **orig_app_name ) +{ + static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; + unsigned int len; + + /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ + if (!product_name_matches( app_name, "BattlEye Launcher" )) + return 0; + + TRACE( "Detected launch of a BattlEye Launcher, redirecting to Proton version.\n" ); + + if (new_name_len < wcslen( belauncherW ) + 1) + { + ERR( "Game executable path doesn't fit in buffer.\n" ); + return 0; + } + + len = (wcslen( app_name ) + 1) * sizeof(*app_name); + if (!(*orig_app_name = HeapAlloc( GetProcessHeap(), 0, len ))) + { + ERR( "No memory.\n" ); + return 0; + } + memcpy( *orig_app_name, app_name, len ); + wcscpy( new_name, belauncherW ); + return 1; +} + +static const WCHAR *hack_append_command_line( const WCHAR *cmd ) +{ + static const struct + { + const WCHAR *exe_name; + const WCHAR *append; + const char *steamgameid; + } + options[] = + { + {L"Bloody Walls\\game.exe", L" --disable_direct_composition=1"}, + {L"Insanitys Blade\\nw.exe", L" --use-gl=swiftshader"}, + {L"Warhammer2.exe", L" --in-process-gpu"}, + {L"SummerIslands.exe", L" --in-process-gpu"}, + {L"UplayWebCore.exe", L" --use-angle=vulkan"}, + {L"Paradox Launcher.exe", L" --use-angle=gl"}, + {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, + {L"Aisling and the Tavern of Elves\\nw.exe", L" --use-gl=swiftshader"}, + {L"Snares of Ruin 2\\SoR2.exe", L" --use-gl=swiftshader"}, + {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, + {L"\\EpicOnlineServicesUIHelper", L" --use-angle=vulkan"}, + {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, + {L"nw.exe.exe", L" --use-angle=d3d9"}, + {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"PlanetSide 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"PaladinLias\\Game.exe", L" --use-gl=desktop"}, + {L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"Red Tie Runner.exe", L" --use-angle=gl"}, + {L"UnrealCEFSubProcess.exe", L" --use-gl=swiftshader", "2316580"}, + {L"\\EACefSubProcess.exe", L" --use-angle=vulkan"}, + }; + unsigned int i; + char sgi[64]; + + if (!cmd) return NULL; + + for (i = 0; i < ARRAY_SIZE(options); ++i) + { + if (wcsstr( cmd, options[i].exe_name )) + { + if (options[i].steamgameid && !(GetEnvironmentVariableA( "SteamGameId", sgi, sizeof(sgi) ) + && !strcmp( sgi, options[i].steamgameid ))) + continue; + FIXME( "HACK: appending %s to command line.\n", debugstr_w(options[i].append) ); + return options[i].append; + } + } + return NULL; +} + /********************************************************************** * CreateProcessInternalW (kernelbase.@) */ @@ -516,10 +647,11 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR { const struct proc_thread_attr *handle_list = NULL, *job_list = NULL; WCHAR name[MAX_PATH]; - WCHAR *p, *tidy_cmdline = cmd_line; + WCHAR *p, *tidy_cmdline = cmd_line, *orig_app_name = NULL; RTL_USER_PROCESS_PARAMETERS *params = NULL; RTL_USER_PROCESS_INFORMATION rtl_info; HANDLE parent = 0, debug = 0; + const WCHAR *append; ULONG nt_flags = 0; USHORT machine = 0; NTSTATUS status; @@ -538,13 +670,45 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR return FALSE; swprintf( tidy_cmdline, lstrlenW(app_name) + 3, L"\"%s\"", app_name ); } + else if ((append = hack_append_command_line( app_name ))) + { + tidy_cmdline = RtlAllocateHeap( GetProcessHeap(), 0, + sizeof(WCHAR) * (lstrlenW(cmd_line) + lstrlenW(append) + 1) ); + lstrcpyW(tidy_cmdline, cmd_line); + lstrcatW(tidy_cmdline, append); + } } else { - if (!(tidy_cmdline = get_file_name( cmd_line, name, ARRAY_SIZE(name) ))) return FALSE; + WCHAR *cmdline_new = NULL; + + if ((append = hack_append_command_line( cmd_line ))) + { + cmdline_new = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(WCHAR) + * (lstrlenW(cmd_line) + lstrlenW(append) + 1) ); + lstrcpyW(cmdline_new, cmd_line); + lstrcatW(cmdline_new, append); + } + + tidy_cmdline = get_file_name( cmdline_new ? cmdline_new : cmd_line, name, ARRAY_SIZE(name) ); + + if (!tidy_cmdline) + { + HeapFree( GetProcessHeap(), 0, cmdline_new ); + return FALSE; + } + + if (cmdline_new) + { + if (cmdline_new == tidy_cmdline) cmd_line = NULL; + else HeapFree( GetProcessHeap(), 0, cmdline_new ); + } app_name = name; } + if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name), &orig_app_name )) + app_name = name; + /* Warn if unsupported features are used */ if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS | @@ -566,10 +730,44 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR if (!(params = create_process_params( app_name, tidy_cmdline, cur_dir, env, flags, startup_info ))) { + HeapFree( GetProcessHeap(), 0, orig_app_name ); status = STATUS_NO_MEMORY; goto done; } + /* Set PROTON_EAC_LAUNCHER_PROCESS when launching the EAC launcher to let ntdll know to load the native EAC client library. + - We don't do this check in ntdll itself because it's harder to get the product name there + - we don't overwrite WINEDLLOVERRIDES because it's fetched from the unix environment */ + { + UNICODE_STRING name, value; + + WCHAR *new_env = RtlAllocateHeap( GetProcessHeap(), 0, params->EnvironmentSize ); + memcpy(new_env, params->Environment, params->EnvironmentSize); + + RtlDestroyProcessParameters( params ); + + RtlInitUnicodeString( &name, L"PROTON_EAC_LAUNCHER_PROCESS" ); + RtlInitUnicodeString( &value, L"1" ); + RtlSetEnvironmentVariable( &new_env, &name, product_name_matches(app_name, "EasyAntiCheat Launcher") ? &value : NULL ); + + if (orig_app_name) + { + RtlInitUnicodeString( &name, L"PROTON_ORIG_LAUNCHER_NAME" ); + RtlInitUnicodeString( &value, orig_app_name ); + RtlSetEnvironmentVariable( &new_env, &name, &value ); + } + + HeapFree( GetProcessHeap(), 0, orig_app_name ); + params = create_process_params( app_name, tidy_cmdline, cur_dir, new_env, flags | CREATE_UNICODE_ENVIRONMENT, startup_info ); + + RtlFreeHeap(GetProcessHeap(), 0, new_env); + if (!params) + { + status = STATUS_NO_MEMORY; + goto done; + } + } + if (flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS)) { if ((status = DbgUiConnectToDbg())) goto done; @@ -1108,6 +1306,21 @@ HANDLE WINAPI DECLSPEC_HOTPATCH OpenProcess( DWORD access, BOOL inherit, DWORD i attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; + /* PROTON HACK: + * On Windows, the Steam client puts its process ID into the registry + * at: + * + * [HKCU\Software\Valve\Steam\ActiveProcess] + * PID=dword:00000008 + * + * Games get that pid from the registry and then query it with + * OpenProcess to ensure Steam is running. Since we aren't running the + * Windows Steam in Wine, instead we hack this magic number into the + * registry and then substitute the game's process itself in its place + * so it can query a valid process. + */ + if (id == 0xfffe) id = GetCurrentProcessId(); + cid.UniqueProcess = ULongToHandle(id); cid.UniqueThread = 0; @@ -1527,6 +1740,59 @@ LPSTR WINAPI DECLSPEC_HOTPATCH GetEnvironmentStringsA(void) return ret; } +static void hack_shrink_environment( WCHAR *env, SIZE_T len ) +{ + static int enabled = -1; + static const char *skip[] = + { + "SteamGenericControllers=", + "STEAM_RUNTIME_LIBRARY_PATH=", + "SDL_GAMECONTROLLER_IGNORE_DEVICES=", + "SDL_GAMECONTROLLERCONFIG=", + "LD_LIBRARY_PATH=", + "ORIG_LD_LIBRARY_PATH=", + "LS_COLORS=", + "BASH_FUNC_", + "XDG_DATA_DIRS=", + }; + SIZE_T l; + unsigned int i, j; + + if (enabled == -1) + { + WCHAR str[40]; + + *str = 0; + if (GetEnvironmentVariableW( L"WINE_SHRINK_ENV", str, sizeof(str)) ) + enabled = *str != '0'; + else if (GetEnvironmentVariableW( L"SteamGameId", str, sizeof(str)) ) + enabled = !wcscmp( str, L"431590" ); + else + enabled = 0; + + if (enabled) + ERR( "HACK: shrinking environment size.\n" ); + } + + if (!enabled) return; + + while (*env) + { + for (i = 0; i < ARRAY_SIZE(skip); ++i) + { + j = 0; + while (skip[i][j] && skip[i][j] == env[j]) + ++j; + if (!skip[i][j]) break; + } + l = lstrlenW( env ); + len -= (l + 1) * sizeof(WCHAR); + if (i == ARRAY_SIZE(skip)) + env += l + 1; + else + memmove( env, env + l + 1, len ); + } +} /*********************************************************************** * GetEnvironmentStringsW (kernelbase.@) @@ -1539,7 +1805,10 @@ LPWSTR WINAPI DECLSPEC_HOTPATCH GetEnvironmentStringsW(void) RtlAcquirePebLock(); len = get_env_length( NtCurrentTeb()->Peb->ProcessParameters->Environment ) * sizeof(WCHAR); if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) + { memcpy( ret, NtCurrentTeb()->Peb->ProcessParameters->Environment, len ); + hack_shrink_environment( ret, len ); + } RtlReleasePebLock(); return ret; } @@ -1727,6 +1996,47 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW( LPCWSTR name, LPCWSTR val return FALSE; } + if (name && !lstrcmpW( name, L"QT_OPENGL" ) && value && !lstrcmpW( value, L"angle" )) + { + static const WCHAR *names[] = + { + L"\\EADesktop.exe", + L"\\Link2EA.exe", + L"\\EAConnect_microsoft.exe", + L"\\EALaunchHelper.exe", + L"\\EACrashReporter.exe", + L"EA Desktop\\ErrorReporter.exe", + }; + unsigned int i, len; + WCHAR module[256]; + DWORD size; + + if ((size = GetModuleFileNameW( NULL, module, ARRAY_SIZE(module) )) && size < ARRAY_SIZE(module)) + { + for (i = 0; i < ARRAY_SIZE(names); ++i) + { + len = lstrlenW(names[i]); + if (size > len && !memcmp( module + size - len, names[i], len * sizeof(*module) )) + { + HMODULE h = GetModuleHandleW(L"Qt5Core.dll"); + void (WINAPI *QCoreApplication_setAttribute)(int attr, BOOL set); + + QCoreApplication_setAttribute = (void *)GetProcAddress(h, "?setAttribute@QCoreApplication@@SAXW4ApplicationAttribute@Qt@@_N@Z"); + if (QCoreApplication_setAttribute) + { + QCoreApplication_setAttribute(16 /* AA_UseOpenGLES */, 0); + QCoreApplication_setAttribute(15 /* AA_UseDesktopOpenGL */, 1); + } + else ERR("QCoreApplication_setAttribute not found, h %p.\n", h); + value = L"desktop"; + FIXME( "HACK: setting QT_OPENGL=desktop.\n" ); + break; + } + } + } + } + + RtlInitUnicodeString( &us_name, name ); if (value) { diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c index a767d993254..ee57a4acdd1 100644 --- a/dlls/kernelbase/registry.c +++ b/dlls/kernelbase/registry.c @@ -165,7 +165,7 @@ static HANDLE open_wow6432node( HANDLE key ) attr.Attributes = 0; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - if (NtOpenKeyEx( &ret, MAXIMUM_ALLOWED, &attr, 0 )) return key; + if (NtOpenKeyEx( &ret, MAXIMUM_ALLOWED | KEY_WOW64_64KEY, &attr, 0 )) return key; return ret; } @@ -211,7 +211,7 @@ static NTSTATUS open_key( HKEY *retkey, HKEY root, UNICODE_STRING *name, DWORD o static NTSTATUS open_subkey( HKEY *subkey, HKEY root, UNICODE_STRING *name, DWORD options, ACCESS_MASK access ) { BOOL is_wow64_key = (is_win64 && (access & KEY_WOW64_32KEY)) || (is_wow64 && !(access & KEY_WOW64_64KEY)); - ACCESS_MASK access_64 = access & ~KEY_WOW64_32KEY; + ACCESS_MASK access_64 = (access & ~KEY_WOW64_32KEY) | KEY_WOW64_64KEY; DWORD i = 0, len = name->Length / sizeof(WCHAR); WCHAR *buffer = name->Buffer; UNICODE_STRING str; @@ -592,6 +592,7 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD { UNICODE_STRING nameW, classW; + if (!retkey) return ERROR_BADKEY; if (reserved) return ERROR_INVALID_PARAMETER; if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE; @@ -633,6 +634,7 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD ANSI_STRING nameA, classA; NTSTATUS status; + if (!retkey) return ERROR_BADKEY; if (reserved) return ERROR_INVALID_PARAMETER; if (!is_version_nt()) { diff --git a/dlls/kernelbase/sync.c b/dlls/kernelbase/sync.c index b2086207caa..7406291ed78 100644 --- a/dlls/kernelbase/sync.c +++ b/dlls/kernelbase/sync.c @@ -284,7 +284,11 @@ DWORD WINAPI DECLSPEC_HOTPATCH SignalObjectAndWait( HANDLE signal, HANDLE wait, DWORD timeout, BOOL alertable ) { NTSTATUS status; +#ifdef __i386__ + DECLSPEC_ALIGN(4) LARGE_INTEGER time; +#else LARGE_INTEGER time; +#endif TRACE( "%p %p %ld %d\n", signal, wait, timeout, alertable ); @@ -1172,6 +1176,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetQueuedCompletionStatus( HANDLE port, LPDWORD co } if (status == STATUS_TIMEOUT) SetLastError( WAIT_TIMEOUT ); + else if (status == ERROR_WAIT_NO_CHILDREN) SetLastError( ERROR_ABANDONED_WAIT_0 ); else SetLastError( RtlNtStatusToDosError(status) ); return FALSE; } @@ -1193,6 +1198,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetQueuedCompletionStatusEx( HANDLE port, OVERLAPP if (ret == STATUS_SUCCESS) return TRUE; else if (ret == STATUS_TIMEOUT) SetLastError( WAIT_TIMEOUT ); else if (ret == STATUS_USER_APC) SetLastError( WAIT_IO_COMPLETION ); + else if (ret == ERROR_WAIT_NO_CHILDREN) SetLastError( ERROR_ABANDONED_WAIT_0 ); else SetLastError( RtlNtStatusToDosError(ret) ); return FALSE; } diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index 0636634badb..7a980493aaa 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -37,10 +37,12 @@ #include "winnls.h" #include "winternl.h" #include "winerror.h" +#include "winreg.h" #include "appmodel.h" #include "kernelbase.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(ver); @@ -159,6 +161,8 @@ static const struct } }; +static const WCHAR packages_key_name[] = L"Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows" + L"\\CurrentVersion\\AppModel\\PackageRepository\\Packages"; /****************************************************************************** * init_current_version @@ -776,6 +780,27 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD r if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE ))) { HRSRC hRsrc = NULL; + + static const char builtin_signature[] = "Wine builtin DLL"; + HMODULE mod = (HMODULE)((ULONG_PTR)hModule & ~(ULONG_PTR)3); + char *signature = (char *)((IMAGE_DOS_HEADER *)mod + 1); + WCHAR exe_name[MAX_PATH]; + IMAGE_NT_HEADERS *nt; + DWORD exe_name_len; + + if ((exe_name_len = GetModuleFileNameW( NULL, exe_name, ARRAY_SIZE(exe_name) )) + && exe_name_len >= 16 + && (!memcmp( exe_name + exe_name_len - 16, L"vcredist_x64.exe", 16 * sizeof(*exe_name) ) + || !memcmp( exe_name + exe_name_len - 16, L"vcredist_x86.exe", 16 * sizeof(*exe_name) )) + && (nt = RtlImageNtHeader( mod )) && (char *)nt - signature >= sizeof(builtin_signature) + && !memcmp( signature, builtin_signature, sizeof(builtin_signature) )) + { + ERR("HACK: not exposing version info.\n"); + FreeLibrary( hModule ); + SetLastError( ERROR_RESOURCE_NAME_NOT_FOUND ); + return 0; + } + if (!(flags & FILE_VER_GET_LOCALISED)) { LANGID english = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); @@ -1602,22 +1627,6 @@ LONG WINAPI /* DECLSPEC_HOTPATCH */ GetPackageFamilyName( HANDLE process, UINT32 return APPMODEL_ERROR_NO_PACKAGE; } -/*********************************************************************** - * GetPackagesByPackageFamily (kernelbase.@) - */ -LONG WINAPI DECLSPEC_HOTPATCH GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, - WCHAR *full_names, UINT32 *buffer_len, WCHAR *buffer) -{ - FIXME( "(%s %p %p %p %p): stub\n", debugstr_w(family_name), count, full_names, buffer_len, buffer ); - - if (!count || !buffer_len) - return ERROR_INVALID_PARAMETER; - - *count = 0; - *buffer_len = 0; - return ERROR_SUCCESS; -} - /*********************************************************************** * GetPackagePathByFullName (kernelbase.@) */ @@ -1656,6 +1665,16 @@ static UINT32 processor_arch_from_string(const WCHAR *str, unsigned int len) return ~0u; } +const WCHAR *string_from_processor_arch(UINT32 code) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(arch_names); ++i) + if (code == arch_names[i].code) + return arch_names[i].name; + return NULL; +} + /*********************************************************************** * PackageIdFromFullName (kernelbase.@) */ @@ -1744,3 +1763,229 @@ LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 * return ERROR_SUCCESS; } + + +/*********************************************************************** + * PackageFullNameFromId (kernelbase.@) + */ +LONG WINAPI PackageFullNameFromId(const PACKAGE_ID *package_id, UINT32 *length, WCHAR *full_name) +{ + WCHAR ver_str[5 * 4 + 3 + 1]; + const WCHAR *arch_str; + UINT32 have_length; + + TRACE("package_id %p, length %p, full_name %p.\n", package_id, length, full_name); + + if (!package_id || !length) + return ERROR_INVALID_PARAMETER; + if (!full_name && *length) + return ERROR_INVALID_PARAMETER; + if (!package_id->name || !package_id->resourceId || !package_id->publisherId + || !(arch_str = string_from_processor_arch(package_id->processorArchitecture))) + return ERROR_INVALID_PARAMETER; + + swprintf(ver_str, ARRAY_SIZE(ver_str), L"%u.%u.%u.%u", package_id->version.Major, + package_id->version.Minor, package_id->version.Build, package_id->version.Revision); + have_length = *length; + *length = lstrlenW(package_id->name) + 1 + lstrlenW(ver_str) + 1 + lstrlenW(arch_str) + 1 + + lstrlenW(package_id->resourceId) + 1 + lstrlenW(package_id->publisherId) + 1; + + if (have_length < *length) + return ERROR_INSUFFICIENT_BUFFER; + + swprintf(full_name, *length, L"%s_%s_%s_%s_%s", package_id->name, ver_str, arch_str, package_id->resourceId, package_id->publisherId); + return ERROR_SUCCESS; +} + + +/*********************************************************************** + * GetPackagesByPackageFamily (kernelbase.@) + */ +LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, + UINT32 *buffer_length, WCHAR *buffer) +{ + UINT32 curr_count, curr_length, package_id_buf_size, size; + unsigned int i, name_len, publisher_id_len; + DWORD subkey_count, max_key_len, length; + const WCHAR *publisher_id; + WCHAR *package_name; + BOOL short_buffer; + PACKAGE_ID *id; + HKEY key; + + TRACE("family_name %s, count %p, full_names %p, buffer_length %p, buffer %p.\n", + debugstr_w(family_name), count, full_names, buffer_length, buffer); + + if (!buffer_length || !count || !family_name) + return ERROR_INVALID_PARAMETER; + + if ((*buffer_length || *count) && (!full_names || !buffer)) + return ERROR_INVALID_PARAMETER; + + if (!(publisher_id = wcschr(family_name, L'_'))) + return ERROR_INVALID_PARAMETER; + + name_len = publisher_id - family_name; + ++publisher_id; + publisher_id_len = lstrlenW(publisher_id); + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, packages_key_name, 0, KEY_READ, &key)) + { + ERR("Key open failed.\n"); + *count = 0; + *buffer_length = 0; + return ERROR_SUCCESS; + } + if (RegQueryInfoKeyW(key, NULL, NULL, NULL, &subkey_count, &max_key_len, NULL, NULL, NULL, NULL, NULL, NULL)) + { + ERR("Query key info failed.\n"); + RegCloseKey(key); + *count = 0; + *buffer_length = 0; + return ERROR_SUCCESS; + } + + if (!(package_name = heap_alloc((max_key_len + 1) * sizeof(*package_name)))) + { + ERR("No memory.\n"); + RegCloseKey(key); + return ERROR_OUTOFMEMORY; + } + + package_id_buf_size = sizeof(*id) + (max_key_len + 1) * sizeof(WCHAR); + if (!(id = heap_alloc(package_id_buf_size))) + { + ERR("No memory.\n"); + heap_free(package_name); + RegCloseKey(key); + return ERROR_OUTOFMEMORY; + } + + curr_count = curr_length = 0; + for (i = 0; i < subkey_count; ++i) + { + length = max_key_len + 1; + if (RegEnumKeyExW(key, i, package_name, &length, NULL, NULL, NULL, NULL)) + { + ERR("Error enumerating key %u.\n", i); + continue; + } + + size = package_id_buf_size; + if (PackageIdFromFullName(package_name, 0, &size, (BYTE *)id)) + { + ERR("Error getting package id from full name.\n"); + continue; + } + + if (lstrlenW(id->name) != name_len) + continue; + if (wcsnicmp(family_name, id->name, name_len)) + continue; + + if (lstrlenW(id->publisherId) != publisher_id_len) + continue; + if (wcsnicmp(publisher_id, id->publisherId, publisher_id_len)) + continue; + if (curr_length + length < *buffer_length) + { + memcpy(buffer + curr_length, package_name, (length + 1) * sizeof(*package_name)); + if (curr_count < *count) + full_names[curr_count] = buffer + curr_length; + } + curr_length += length + 1; + ++curr_count; + } + + heap_free(id); + heap_free(package_name); + RegCloseKey(key); + + short_buffer = curr_length > *buffer_length || curr_count > *count; + *count = curr_count; + *buffer_length = curr_length; + + return short_buffer ? ERROR_INSUFFICIENT_BUFFER : ERROR_SUCCESS; +} + + +/*********************************************************************** + * GetPackagePath (kernelbase.@) + */ +LONG WINAPI GetPackagePath(const PACKAGE_ID *package_id, const UINT32 reserved, UINT32 *length, WCHAR *path) +{ + WCHAR *key_name = NULL, *expanded_path = NULL; + UINT32 required_length, have_length; + unsigned int offset; + HKEY key = NULL; + DWORD size; + LONG ret; + + TRACE("package_id %p, reserved %u, length %p, path %p.\n", package_id, reserved, length, path); + + if (!length) + return ERROR_INVALID_PARAMETER; + if (!path && *length) + return ERROR_INVALID_PARAMETER; + + required_length = 0; + if ((ret = PackageFullNameFromId(package_id, &required_length, NULL)) != ERROR_INSUFFICIENT_BUFFER) + return ret; + + offset = lstrlenW(packages_key_name) + 1; + if (!(key_name = heap_alloc((offset + required_length) * sizeof(WCHAR)))) + { + ERR("No memory."); + return ERROR_OUTOFMEMORY; + } + + if ((ret = PackageFullNameFromId(package_id, &required_length, key_name + offset))) + goto done; + + memcpy(key_name, packages_key_name, (offset - 1) * sizeof(WCHAR)); + key_name[offset - 1] = L'\\'; + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &key)) + { + WARN("Key %s not found.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + if (RegGetValueW(key, NULL, L"Path", RRF_RT_REG_SZ, NULL, NULL, &size)) + { + WARN("Path value not found in %s.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + if (!(expanded_path = heap_alloc(size))) + { + ERR("No memory."); + ret = ERROR_OUTOFMEMORY; + goto done; + } + if (RegGetValueW(key, NULL, L"Path", RRF_RT_REG_SZ, NULL, expanded_path, &size)) + { + WARN("Could not get Path value from %s.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + + have_length = *length; + *length = lstrlenW(expanded_path) + 1; + if (have_length >= *length) + { + memcpy(path, expanded_path, *length * sizeof(*path)); + ret = ERROR_SUCCESS; + } + else + { + ret = ERROR_INSUFFICIENT_BUFFER; + } + +done: + if (key) + RegCloseKey(key); + heap_free(expanded_path); + heap_free(key_name); + return ret; +} diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index db7053a1405..5ac526c9651 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -64,6 +64,7 @@ struct video_stream LONG refcount; unsigned int id; unsigned int flags; + unsigned int preroll_count; struct video_renderer *parent; IMFMediaEventQueue *event_queue; IMFVideoSampleAllocator *allocator; @@ -420,9 +421,16 @@ static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFS if (stream->flags & EVR_STREAM_PREROLLING) { - IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, &GUID_NULL, S_OK, NULL); - stream->flags &= ~EVR_STREAM_PREROLLING; - stream->flags |= EVR_STREAM_PREROLLED; + if (stream->preroll_count--) + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkRequestSample, + &GUID_NULL, S_OK, NULL); + else + { + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, + &GUID_NULL, S_OK, NULL); + stream->flags &= ~EVR_STREAM_PREROLLING; + stream->flags |= EVR_STREAM_PREROLLED; + } } } @@ -1528,6 +1536,7 @@ static HRESULT WINAPI video_renderer_preroll_NotifyPreroll(IMFMediaSinkPreroll * IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL); stream->flags |= EVR_STREAM_PREROLLING; + stream->preroll_count = 3; } LeaveCriticalSection(&stream->cs); } diff --git a/dlls/mf/mf.rgs b/dlls/mf/mf.rgs index f06576baccb..f127df76321 100644 --- a/dlls/mf/mf.rgs +++ b/dlls/mf/mf.rgs @@ -12,14 +12,6 @@ HKLM { val '{477ec299-1421-4bdd-971f-7ccb933f21ad}' = s 'File Scheme Handler' } - 'http:' - { - val '{9ec4b4f9-3029-45ad-947b-344de2a249e2}' = s 'Urlmon Scheme Handler' - } - 'https:' - { - val '{9ec4b4f9-3029-45ad-947b-344de2a249e2}' = s 'Urlmon Scheme Handler' - } } } } diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index 84824f954dd..970063497b1 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -1339,6 +1339,7 @@ static HRESULT stream_queue_sample(struct audio_renderer *renderer, IMFSample *s { struct queued_object *object; DWORD sample_len, sample_frames; + MFTIME time, clocktime, systime; HRESULT hr; if (FAILED(hr = IMFSample_GetTotalLength(sample, &sample_len))) @@ -1346,15 +1347,33 @@ static HRESULT stream_queue_sample(struct audio_renderer *renderer, IMFSample *s sample_frames = sample_len / renderer->frame_size; - if (!(object = calloc(1, sizeof(*object)))) - return E_OUTOFMEMORY; + if (FAILED(hr = IMFSample_GetSampleTime(sample, &time))) + { + WARN("Failed to get sample time, hr %#lx.\n", hr); + return hr; + } - object->type = OBJECT_TYPE_SAMPLE; - object->u.sample.sample = sample; - IMFSample_AddRef(object->u.sample.sample); + if (!renderer->clock) + clocktime = time; + else if (FAILED(hr = IMFPresentationClock_GetCorrelatedTime(renderer->clock, 0, &clocktime, &systime))) + { + WARN("Failed to get clock time, hr %#lx.\n", hr); + return hr; + } - list_add_tail(&renderer->queue, &object->entry); - renderer->queued_frames += sample_frames; + if (time < clocktime) + FIXME("Dropping sample %p, time %I64u, clocktime %I64u, systime %I64u.\n", sample, time, clocktime, systime); + else + { + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->type = OBJECT_TYPE_SAMPLE; + object->u.sample.sample = sample; + IMFSample_AddRef(object->u.sample.sample); + list_add_tail(&renderer->queue, &object->entry); + renderer->queued_frames += sample_frames; + } return S_OK; } diff --git a/dlls/mf/session.c b/dlls/mf/session.c index db742350161..ef707dea4de 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -785,7 +785,7 @@ static void session_shutdown_current_topology(struct media_session *session) WARN("Failed to shut down activation object for the sink, hr %#lx.\n", hr); IMFActivate_Release(activate); } - else if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) + if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) { if (SUCCEEDED(IMFStreamSink_GetMediaSink(stream_sink, &sink))) { @@ -1677,7 +1677,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod &IID_IMFVideoSampleAllocator, (void **)&topo_node->u.sink.allocator))) { if (FAILED(hr = IMFVideoSampleAllocator_InitializeSampleAllocator(topo_node->u.sink.allocator, - 2, media_type))) + 4, media_type))) { WARN("Failed to initialize sample allocator for the stream, hr %#lx.\n", hr); } @@ -1866,6 +1866,8 @@ static void session_set_topology(struct media_session *session, DWORD flags, IMF { hr = session_bind_output_nodes(topology); + IMFTopology_SetUINT32(topology, &MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES, TRUE); + if (SUCCEEDED(hr)) hr = IMFTopoLoader_Load(session->topo_loader, topology, &resolved_topology, NULL /* FIXME? */); if (SUCCEEDED(hr)) @@ -2572,6 +2574,13 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, EnterCriticalSection(&session->cs); + if ((session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) && op->command != SESSION_CMD_STOP) + { + WARN("session %p command is ending, waiting for it to complete.\n", session); + LeaveCriticalSection(&session->cs); + return S_OK; + } + if (session->presentation.flags & SESSION_FLAG_PENDING_COMMAND) { WARN("session %p command is in progress, waiting for it to complete.\n", session); @@ -2598,6 +2607,10 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, session_pause(session); break; case SESSION_CMD_STOP: + if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) + session_set_topo_status(session, S_OK, MF_TOPOSTATUS_ENDED); + if (session->presentation.topo_status != MF_TOPOSTATUS_INVALID) + session_clear_end_of_presentation(session); session_stop(session); break; case SESSION_CMD_CLOSE: @@ -2851,10 +2864,10 @@ static struct topo_node *session_get_node_object(struct media_session *session, LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) { if (node->type == node_type && object == node->object.object) - break; + return node; } - return node; + return NULL; } static BOOL session_set_node_object_state(struct media_session *session, IUnknown *object, @@ -2927,7 +2940,7 @@ static void session_set_source_object_state(struct media_session *session, IUnkn session_set_presentation_clock(session); - if (session->presentation.flags & SESSION_FLAG_NEEDS_PREROLL) + if ((session->presentation.flags & SESSION_FLAG_NEEDS_PREROLL) && session_is_output_nodes_state(session, OBJ_STATE_STOPPED)) { MFTIME preroll_time = 0; @@ -3578,7 +3591,7 @@ static void session_raise_end_of_presentation(struct media_session *session) { if (session_nodes_is_mask_set(session, MF_TOPOLOGY_MAX, SOURCE_FLAG_END_OF_PRESENTATION)) { - session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION | SESSION_FLAG_PENDING_COMMAND; + session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION; IMFMediaEventQueue_QueueEventParamVar(session->event_queue, MEEndOfPresentation, &GUID_NULL, S_OK, NULL); } } @@ -4151,6 +4164,13 @@ static HRESULT WINAPI session_rate_control_SetRate(IMFRateControl *iface, BOOL t TRACE("%p, %d, %f.\n", iface, thin, rate); + if (!rate) + { + /* The Anacrusis fails to play its video if we succeed here */ + ERR("Scrubbing not implemented!\n"); + return E_NOTIMPL; + } + if (FAILED(hr = create_session_op(SESSION_CMD_SET_RATE, &op))) return hr; diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 3dd0d9b076d..0a34329bd75 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2983,8 +2983,6 @@ static IMFSampleGrabberSinkCallback *create_test_grabber_callback(void) enum loader_test_flags { - LOADER_EXPECTED_DECODER = 0x1, - LOADER_EXPECTED_CONVERTER = 0x2, LOADER_TODO = 0x4, LOADER_NEEDS_VIDEO_PROCESSOR = 0x8, LOADER_SET_ENUMERATE_SOURCE_TYPES = 0x10, @@ -3066,6 +3064,18 @@ static void test_topology_loader(void) ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 1), ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 8), }; + static const media_type_desc audio_float_44100_stereo = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_Float), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2), + ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 2 * 4), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100), + ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 2 * 4 * 44100), + ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 4 * 8), + ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), + }; static const media_type_desc video_i420_1280 = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), @@ -3089,6 +3099,25 @@ static void test_topology_loader(void) ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32), }; + static const media_type_desc video_h264_1280 = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264), + ATTR_RATIO(MF_MT_FRAME_SIZE, 1280, 720), + }; + static const media_type_desc video_nv12_1280 = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_RATE, 30000, 1001), + ATTR_RATIO(MF_MT_FRAME_SIZE, 1280, 720), + ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, 1280 * 720 * 3 / 2), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 1280), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 7), + }; static const media_type_desc video_dummy = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), @@ -3099,10 +3128,13 @@ static void test_topology_loader(void) const media_type_desc *input_type; const media_type_desc *output_type; const media_type_desc *current_input; + const media_type_desc *decoded_type; MF_CONNECT_METHOD source_method; MF_CONNECT_METHOD sink_method; HRESULT expected_result; unsigned int flags; + GUID decoder_class; + GUID converter_class; } loader_tests[] = { @@ -3167,27 +3199,24 @@ static void test_topology_loader(void) { /* PCM -> PCM, different enumerated bps, no current type, sink allow converter */ .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_ALLOW_CONVERTER, .source_method = MF_CONNECT_DIRECT, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CResamplerMediaObject, }, { /* PCM -> PCM, different enumerated bps, same current type, sink allow converter, force enumerate */ .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_ALLOW_CONVERTER, .source_method = -1, .current_input = &audio_pcm_48000, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER | LOADER_SET_ENUMERATE_SOURCE_TYPES, + .expected_result = S_OK, .converter_class = CLSID_CResamplerMediaObject, + .flags = LOADER_SET_ENUMERATE_SOURCE_TYPES, }, { /* PCM -> PCM, different enumerated bps, no current type, sink allow decoder */ .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = MF_CONNECT_DIRECT, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CResamplerMediaObject, }, { /* PCM -> PCM, different enumerated bps, no current type, default methods */ .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = -1, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CResamplerMediaObject, }, { /* PCM -> PCM, different enumerated bps, no current type, source allow converter */ @@ -3198,14 +3227,14 @@ static void test_topology_loader(void) { /* Float -> PCM, refuse input type, add converter */ .input_type = &audio_float_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_DIRECT, .source_method = -1, - .expected_result = MF_E_NO_MORE_TYPES, - .flags = LOADER_SET_INVALID_INPUT | LOADER_ADD_RESAMPLER_MFT | LOADER_EXPECTED_CONVERTER, + .expected_result = MF_E_NO_MORE_TYPES, .converter_class = CLSID_CResamplerMediaObject, + .flags = LOADER_SET_INVALID_INPUT | LOADER_ADD_RESAMPLER_MFT, }, { /* Float -> PCM, refuse input type, add converter, allow resampler output type */ .input_type = &audio_float_44100, .output_type = &audio_pcm_48000_resampler, .sink_method = MF_CONNECT_DIRECT, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_SET_INVALID_INPUT | LOADER_ADD_RESAMPLER_MFT | LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CResamplerMediaObject, + .flags = LOADER_SET_INVALID_INPUT | LOADER_ADD_RESAMPLER_MFT, }, { @@ -3232,34 +3261,38 @@ static void test_topology_loader(void) /* MP3 -> PCM */ .input_type = &audio_mp3_44100, .output_type = &audio_pcm_44100, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = -1, .current_input = &audio_mp3_44100, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_DECODER | LOADER_TODO, + .expected_result = S_OK, .decoder_class = CLSID_CMP3DecMediaObject, + .flags = LOADER_TODO, }, { /* MP3 -> PCM, need both decoder and converter */ .input_type = &audio_mp3_44100, .output_type = &audio_float_48000, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = -1, - .current_input = &audio_mp3_44100, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_DECODER | LOADER_EXPECTED_CONVERTER | LOADER_TODO, + .current_input = &audio_mp3_44100, .decoded_type = &audio_float_44100_stereo, + .expected_result = S_OK, .decoder_class = CLSID_CMP3DecMediaObject, .converter_class = CLSID_CResamplerMediaObject, + .flags = LOADER_TODO, }, { /* I420 -> RGB32, Color Convert media type */ .input_type = &video_i420_1280, .output_type = &video_color_convert_1280_rgb32, .sink_method = -1, .source_method = -1, - .expected_result = MF_E_TOPO_CODEC_NOT_FOUND, - .flags = LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_EXPECTED_CONVERTER, + .expected_result = MF_E_TOPO_CODEC_NOT_FOUND, .converter_class = CLSID_CColorConvertDMO, + .flags = LOADER_NEEDS_VIDEO_PROCESSOR, }, { /* I420 -> RGB32, Video Processor media type */ .input_type = &video_i420_1280, .output_type = &video_video_processor_1280_rgb32, .sink_method = -1, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CColorConvertDMO, }, { /* I420 -> RGB32, Video Processor media type without frame size */ .input_type = &video_i420_1280, .output_type = &video_video_processor_rgb32, .sink_method = -1, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CColorConvertDMO, + }, + { + /* H264 -> RGB32, Video Processor media type */ + .input_type = &video_h264_1280, .output_type = &video_video_processor_1280_rgb32, .sink_method = -1, .source_method = -1, + .decoded_type = &video_nv12_1280, + .expected_result = S_OK, .decoder_class = CLSID_CMSH264DecoderMFT, .converter_class = CLSID_CColorConvertDMO, }, { /* RGB32 -> Any Video, no current output type */ @@ -3270,14 +3303,14 @@ static void test_topology_loader(void) { /* RGB32 -> Any Video, no current output type, refuse input type */ .input_type = &video_i420_1280, .output_type = &video_dummy, .sink_method = -1, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_NO_CURRENT_OUTPUT | LOADER_SET_INVALID_INPUT | LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CColorConvertDMO, + .flags = LOADER_NO_CURRENT_OUTPUT | LOADER_SET_INVALID_INPUT, }, { /* RGB32 -> Any Video, no current output type, refuse input type */ .input_type = &video_i420_1280, .output_type = &video_video_processor_rgb32, .sink_method = -1, .source_method = -1, - .expected_result = S_OK, - .flags = LOADER_NO_CURRENT_OUTPUT | LOADER_SET_INVALID_INPUT | LOADER_SET_MEDIA_TYPES | LOADER_EXPECTED_CONVERTER, + .expected_result = S_OK, .converter_class = CLSID_CColorConvertDMO, + .flags = LOADER_NO_CURRENT_OUTPUT | LOADER_SET_INVALID_INPUT | LOADER_SET_MEDIA_TYPES, }, }; @@ -3536,14 +3569,14 @@ todo_wine { ok(value == MF_TOPOLOGY_RESOLUTION_SUCCEEDED, "Unexpected value %#x.\n", value); } count = 2; - if (test->flags & LOADER_EXPECTED_DECODER) + if (!IsEqualGUID(&test->decoder_class, &GUID_NULL)) count++; - if (test->flags & LOADER_EXPECTED_CONVERTER) + if (!IsEqualGUID(&test->converter_class, &GUID_NULL)) count++; hr = IMFTopology_GetNodeCount(full_topology, &node_count); ok(hr == S_OK, "Failed to get node count, hr %#lx.\n", hr); - todo_wine_if(test->flags & LOADER_EXPECTED_DECODER) + todo_wine_if(IsEqualGUID(&test->decoder_class, &CLSID_CMP3DecMediaObject)) ok(node_count == count, "Unexpected node count %u.\n", node_count); hr = IMFTopologyNode_GetTopoNodeID(src_node, &node_id); @@ -3558,29 +3591,31 @@ todo_wine { hr = IMFTopology_GetNodeByID(full_topology, node_id, &sink_node2); ok(hr == S_OK, "Failed to get sink in resolved topology, hr %#lx.\n", hr); - if (test->flags & (LOADER_EXPECTED_DECODER | LOADER_EXPECTED_CONVERTER)) + if (!IsEqualGUID(&test->decoder_class, &GUID_NULL)) { + GUID class_id; + hr = IMFTopologyNode_GetOutput(src_node2, 0, &mft_node, &index); - ok(hr == S_OK, "Failed to get transform node in resolved topology, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to get decoder in resolved topology, hr %#lx.\n", hr); ok(!index, "Unexpected stream index %lu.\n", index); hr = IMFTopologyNode_GetNodeType(mft_node, &node_type); ok(hr == S_OK, "Failed to get transform node type in resolved topology, hr %#lx.\n", hr); ok(node_type == MF_TOPOLOGY_TRANSFORM_NODE, "Unexpected node type %u.\n", node_type); - hr = IMFTopologyNode_GetObject(mft_node, &node_object); - ok(hr == S_OK, "Failed to get object of transform node, hr %#lx.\n", hr); - - if (test->flags & LOADER_EXPECTED_DECODER) - { - value = 0; - hr = IMFTopologyNode_GetUINT32(mft_node, &MF_TOPONODE_DECODER, &value); - ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); - ok(value == 1, "Unexpected value.\n"); - } + value = 0; + hr = IMFTopologyNode_GetUINT32(mft_node, &MF_TOPONODE_DECODER, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(value == 1, "Unexpected value.\n"); - hr = IMFTopologyNode_GetItem(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, NULL); + class_id = GUID_NULL; + hr = IMFTopologyNode_GetGUID(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, &class_id); ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(IsEqualGUID(&class_id, &test->decoder_class), "got MF_TOPONODE_TRANSFORM_OBJECTID %s.\n", debugstr_guid(&class_id)); + + hr = IMFTopologyNode_GetObject(mft_node, &node_object); + ok(hr == S_OK, "Failed to get object of transform node, hr %#lx.\n", hr); + IMFTopologyNode_Release(mft_node); hr = IUnknown_QueryInterface(node_object, &IID_IMFTransform, (void **)&transform); ok(hr == S_OK, "Failed to get IMFTransform from transform node's object, hr %#lx.\n", hr); @@ -3588,51 +3623,75 @@ todo_wine { hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); - hr = IMFMediaType_Compare(input_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); ok(ret, "Input type of first transform doesn't match source node type.\n"); + IMFMediaType_Release(media_type); - IMFTopologyNode_Release(mft_node); + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); + if (IsEqualGUID(&test->converter_class, &GUID_NULL)) + { + hr = IMFMediaType_Compare(output_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); + ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); + ok(ret, "Output type of first transform doesn't match sink node type.\n"); + } + else if (test->decoded_type) + { + check_media_type(media_type, *test->decoded_type, -1); + } IMFMediaType_Release(media_type); + IMFTransform_Release(transform); + } + + if (!IsEqualGUID(&test->converter_class, &GUID_NULL)) + { + GUID class_id; hr = IMFTopologyNode_GetInput(sink_node2, 0, &mft_node, &index); - ok(hr == S_OK, "Failed to get transform node in resolved topology, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to get decoder in resolved topology, hr %#lx.\n", hr); ok(!index, "Unexpected stream index %lu.\n", index); hr = IMFTopologyNode_GetNodeType(mft_node, &node_type); ok(hr == S_OK, "Failed to get transform node type in resolved topology, hr %#lx.\n", hr); ok(node_type == MF_TOPOLOGY_TRANSFORM_NODE, "Unexpected node type %u.\n", node_type); - hr = IMFTopologyNode_GetItem(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, NULL); + class_id = GUID_NULL; + hr = IMFTopologyNode_GetGUID(mft_node, &MF_TOPONODE_TRANSFORM_OBJECTID, &class_id); ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + todo_wine_if(IsEqualGUID(&test->converter_class, &CLSID_CColorConvertDMO)) + ok(IsEqualGUID(&class_id, &test->converter_class), "got MF_TOPONODE_TRANSFORM_OBJECTID %s.\n", debugstr_guid(&class_id)); hr = IMFTopologyNode_GetObject(mft_node, &node_object); ok(hr == S_OK, "Failed to get object of transform node, hr %#lx.\n", hr); + IMFTopologyNode_Release(mft_node); - hr = IUnknown_QueryInterface(node_object, &IID_IMFTransform, (void**) &transform); + hr = IUnknown_QueryInterface(node_object, &IID_IMFTransform, (void **)&transform); ok(hr == S_OK, "Failed to get IMFTransform from transform node's object, hr %#lx.\n", hr); IUnknown_Release(node_object); - hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); - ok(hr == S_OK, "Failed to get transform output type, hr %#lx.\n", hr); - hr = IMFMediaType_Compare(output_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); - ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); - ok(ret, "Output type of last transform doesn't match sink node type.\n"); - IMFMediaType_Release(media_type); - hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); - if ((test->flags & (LOADER_EXPECTED_CONVERTER | LOADER_EXPECTED_DECODER)) != (LOADER_EXPECTED_CONVERTER | LOADER_EXPECTED_DECODER)) + if (IsEqualGUID(&test->decoder_class, &GUID_NULL)) { hr = IMFMediaType_Compare(input_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); - ok(ret, "Input type of transform doesn't match source node type.\n"); + ok(ret, "Input type of last transform doesn't match source node type.\n"); + } + else if (test->decoded_type) + { + check_media_type(media_type, *test->decoded_type, -1); } IMFMediaType_Release(media_type); - IMFTopologyNode_Release(mft_node); + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr); + hr = IMFMediaType_Compare(output_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret); + ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr); + ok(ret, "Output type of last transform doesn't match sink node type.\n"); + IMFMediaType_Release(media_type); + IMFTransform_Release(transform); } diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index f9e6b3b45cd..468239b0fd4 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -692,25 +692,27 @@ static void check_mft_set_input_type_required_(int line, IMFTransform *transform ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); } -static void check_mft_set_input_type(IMFTransform *transform, const struct attribute_desc *attributes) +#define check_mft_set_input_type(a, b) check_mft_set_input_type_(__LINE__, a, b, FALSE) +static void check_mft_set_input_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, BOOL todo) { IMFMediaType *media_type; HRESULT hr; hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1); hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); - ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); + todo_wine_if(todo) + ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr); IMFMediaType_Release(media_type); } -#define check_mft_get_input_current_type(a, b) check_mft_get_input_current_type_(a, b, FALSE, FALSE) -static void check_mft_get_input_current_type_(IMFTransform *transform, const struct attribute_desc *attributes, +#define check_mft_get_input_current_type(a, b) check_mft_get_input_current_type_(__LINE__, a, b, FALSE, FALSE) +static void check_mft_get_input_current_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, BOOL todo_current, BOOL todo_compare) { HRESULT hr, expect_hr = attributes ? S_OK : MF_E_TRANSFORM_TYPE_NOT_SET; @@ -719,19 +721,21 @@ static void check_mft_get_input_current_type_(IMFTransform *transform, const str hr = IMFTransform_GetInputCurrentType(transform, 0, ¤t_type); todo_wine_if(todo_current) - ok(hr == expect_hr, "GetInputCurrentType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == expect_hr, "GetInputCurrentType returned hr %#lx.\n", hr); if (FAILED(hr)) return; hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1); hr = IMFMediaType_Compare(current_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_ALL_ITEMS, &result); - ok(hr == S_OK, "Compare returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "Compare returned hr %#lx.\n", hr); todo_wine_if(todo_compare) - ok(result, "got result %u.\n", !!result); + ok_(__FILE__, line)(result, "got result %u.\n", !!result); + + check_attributes_(__FILE__, line, (IMFAttributes *)current_type, attributes, -1); IMFMediaType_Release(media_type); IMFMediaType_Release(current_type); @@ -785,24 +789,31 @@ static void check_mft_set_output_type(IMFTransform *transform, const struct attr IMFMediaType_Release(media_type); } -#define check_mft_get_output_current_type(a, b) check_mft_get_output_current_type_(a, b, FALSE) -static void check_mft_get_output_current_type_(IMFTransform *transform, const struct attribute_desc *attributes, - BOOL todo_current) +#define check_mft_get_output_current_type(a, b) check_mft_get_output_current_type_(__LINE__, a, b, FALSE, FALSE) +static void check_mft_get_output_current_type_(int line, IMFTransform *transform, const struct attribute_desc *attributes, + BOOL todo_current, BOOL todo_compare) { HRESULT hr, expect_hr = attributes ? S_OK : MF_E_TRANSFORM_TYPE_NOT_SET; IMFMediaType *media_type, *current_type; + BOOL result; hr = IMFTransform_GetOutputCurrentType(transform, 0, ¤t_type); todo_wine_if(todo_current) - ok(hr == expect_hr, "GetOutputCurrentType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == expect_hr, "GetOutputCurrentType returned hr %#lx.\n", hr); if (FAILED(hr)) return; hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); + ok_(__FILE__, line)(hr == S_OK, "MFCreateMediaType returned hr %#lx.\n", hr); init_media_type(media_type, attributes, -1); - check_attributes((IMFAttributes *)current_type, attributes, -1); + hr = IMFMediaType_Compare(current_type, (IMFAttributes *)media_type, + MF_ATTRIBUTES_MATCH_ALL_ITEMS, &result); + ok_(__FILE__, line)(hr == S_OK, "Compare returned hr %#lx.\n", hr); + todo_wine_if(todo_compare) + ok_(__FILE__, line)(result, "got result %u.\n", !!result); + + check_attributes_(__FILE__, line, (IMFAttributes *)current_type, attributes, -1); IMFMediaType_Release(media_type); IMFMediaType_Release(current_type); @@ -3191,11 +3202,11 @@ static void test_wma_decoder(void) /* setting output media type first doesn't work */ check_mft_set_output_type(transform, output_type_desc, MF_E_TRANSFORM_TYPE_NOT_SET); - check_mft_get_output_current_type_(transform, NULL, TRUE); + check_mft_get_output_current_type_(__LINE__, transform, NULL, TRUE, FALSE); check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, TRUE, FALSE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, TRUE, FALSE); check_mft_get_input_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); check_mft_get_output_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); @@ -3217,7 +3228,7 @@ static void test_wma_decoder(void) check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, TRUE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, TRUE, FALSE); check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -3828,6 +3839,7 @@ static void test_h264_encoder(void) ATTR_RATIO(MF_MT_FRAME_RATE, 30000, 1001), ATTR_UINT32(MF_MT_AVG_BITRATE, 193540), ATTR_BLOB(MF_MT_MPEG_SEQUENCE_HEADER, test_h264_sequence_header, sizeof(test_h264_sequence_header)), + ATTR_UINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive), {0}, }; static const MFT_OUTPUT_STREAM_INFO expect_output_info = {.cbSize = 0x8000}; @@ -4019,11 +4031,11 @@ static void test_h264_decoder(void) ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264), ATTR_RATIO(MF_MT_FRAME_SIZE, input_width, input_height), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 0), - ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 0), - ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 0), - ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0), - ATTR_UINT32(MF_MT_COMPRESSED, 1), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 1, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -4262,7 +4274,7 @@ static void test_h264_decoder(void) check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, TRUE, FALSE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE); check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -4284,7 +4296,7 @@ static void test_h264_decoder(void) check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, TRUE); /* check that the output media type we've selected don't change the enumeration */ @@ -4382,7 +4394,7 @@ static void test_h264_decoder(void) ok(i == 5, "%lu output media types\n", i); /* current output type is still the one we selected */ - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, TRUE); hr = MFCreateCollection(&output_samples); ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); @@ -4412,7 +4424,7 @@ static void test_h264_decoder(void) ret = IMFMediaType_Release(media_type); ok(ret == 1, "Release returned %lu\n", ret); - check_mft_get_output_current_type_(transform, expect_new_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_new_output_type_desc, FALSE, TRUE); output_sample = create_sample(NULL, actual_width * actual_height * 2); hr = check_mft_process_output(transform, output_sample, &output_status); @@ -4810,8 +4822,8 @@ static void test_audio_convert(void) ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050), ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 8), ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 22050 * 8), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), - ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -4939,7 +4951,7 @@ static void test_audio_convert(void) check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE); check_mft_get_input_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); check_mft_get_output_stream_info(transform, MF_E_TRANSFORM_TYPE_NOT_SET, NULL); @@ -4961,7 +4973,7 @@ static void test_audio_convert(void) check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, TRUE); check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -5414,11 +5426,11 @@ static void test_wmv_encoder(void) check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE); check_mft_set_output_type_required(transform, output_type_desc); check_mft_set_output_type(transform, output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, expect_output_type_desc, FALSE, FALSE); check_mft_get_input_stream_info(transform, S_OK, &expect_input_info); check_mft_get_output_stream_info(transform, S_OK, &expect_output_info); @@ -5975,7 +5987,7 @@ static void test_wmv_decoder(void) check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE); i = -1; while (SUCCEEDED(hr = IMFTransform_GetOutputAvailableType(transform, 0, ++i, &media_type))) @@ -5998,7 +6010,7 @@ static void test_wmv_decoder(void) check_mft_set_output_type_required(transform, transform_tests[j].output_type_desc); check_mft_set_output_type(transform, transform_tests[j].output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, transform_tests[j].expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, transform_tests[j].expect_output_type_desc, FALSE, FALSE); check_mft_get_input_stream_info(transform, S_OK, transform_tests[j].expect_input_info); check_mft_get_output_stream_info(transform, S_OK, transform_tests[j].expect_output_info); @@ -6914,10 +6926,10 @@ static void test_color_convert(void) ATTR_BLOB(MF_MT_MINIMUM_DISPLAY_APERTURE, &actual_aperture, 16), ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height), ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width), - ATTR_UINT32(MF_MT_SAMPLE_SIZE, actual_width * actual_height * 3 / 2), - ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), - ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1), - ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, actual_width * actual_height * 3 / 2, .todo = TRUE), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1, .todo = TRUE), + ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1, .todo = TRUE), {0}, }; const struct attribute_desc expect_output_type_desc[] = @@ -7077,14 +7089,14 @@ static void test_color_convert(void) check_mft_set_input_type_required(transform, input_type_desc); check_mft_set_input_type(transform, input_type_desc); - check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, expect_input_type_desc, FALSE, TRUE); for (i = 0; i < ARRAY_SIZE(color_conversion_tests); i++) { winetest_push_context("color conversion #%lu", i); check_mft_set_output_type_required(transform, color_conversion_tests[i].output_type_desc); check_mft_set_output_type(transform, color_conversion_tests[i].output_type_desc, S_OK); - check_mft_get_output_current_type_(transform, color_conversion_tests[i].expect_output_type_desc, FALSE); + check_mft_get_output_current_type_(__LINE__, transform, color_conversion_tests[i].expect_output_type_desc, FALSE, TRUE); check_mft_get_input_stream_info(transform, S_OK, &input_info); check_mft_get_output_stream_info(transform, S_OK, &output_info); @@ -7339,6 +7351,28 @@ static void test_video_processor(void) ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width * 2), {0}, }; + const struct attribute_desc nv12_no_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84), + {0}, + }; + const struct attribute_desc nv12_with_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height), + ATTR_BLOB(MF_MT_MINIMUM_DISPLAY_APERTURE, &actual_aperture, 16), + {0}, + }; + const struct attribute_desc rgb32_no_aperture[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32), + ATTR_RATIO(MF_MT_FRAME_SIZE, 82, 84), + {0}, + }; const MFT_OUTPUT_STREAM_INFO initial_output_info = {0}; const MFT_INPUT_STREAM_INFO initial_input_info = {0}; MFT_OUTPUT_STREAM_INFO output_info = {0}; @@ -7900,6 +7934,29 @@ static void test_video_processor(void) ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %ld\n", ret); + + /* check that it is possible to change input media type frame size using geometric aperture */ + + hr = CoCreateInstance(class_id, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFTransform, (void **)&transform); + ok(hr == S_OK, "got hr %#lx\n", hr); + + check_mft_set_input_type(transform, nv12_no_aperture); + check_mft_get_input_current_type(transform, nv12_no_aperture); + + check_mft_set_output_type(transform, rgb32_no_aperture, S_OK); + check_mft_get_output_current_type(transform, rgb32_no_aperture); + + check_mft_set_input_type_(__LINE__, transform, nv12_with_aperture, TRUE); + check_mft_get_input_current_type_(__LINE__, transform, nv12_with_aperture, TRUE, FALSE); + + /* output type is the same as before */ + check_mft_get_output_current_type(transform, rgb32_no_aperture); + + ret = IMFTransform_Release(transform); + ok(ret == 0, "Release returned %ld\n", ret); + + failed: winetest_pop_context(); CoUninitialize(); diff --git a/dlls/mf/topology_loader.c b/dlls/mf/topology_loader.c index 6b6d39d76d1..a56fb3e3909 100644 --- a/dlls/mf/topology_loader.c +++ b/dlls/mf/topology_loader.c @@ -296,6 +296,8 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC { struct topology_branch down_branch = {.up.node = node, .down = branch->down}; struct topology_branch up_branch = {.up = branch->up, .down.node = node}; + MF_CONNECT_METHOD method = method_mask; + IMFMediaType *media_type; if (FAILED(IMFActivate_ActivateObject(activates[i], &IID_IMFTransform, (void **)&transform))) continue; @@ -308,17 +310,22 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC hr = topology_branch_connect_down(topology, MF_CONNECT_DIRECT, &up_branch, up_type); if (down_type) { - if (SUCCEEDED(hr)) - hr = topology_branch_fill_media_type(up_type, down_type); - if (SUCCEEDED(hr)) - hr = IMFTransform_SetOutputType(transform, 0, down_type, 0); - if (SUCCEEDED(hr)) - method_mask = MF_CONNECT_DIRECT; + if (SUCCEEDED(topology_branch_fill_media_type(up_type, down_type)) + && SUCCEEDED(IMFTransform_SetOutputType(transform, 0, down_type, 0))) + method = MF_CONNECT_DIRECT; } IMFTransform_Release(transform); + if (SUCCEEDED(hr) && method != MF_CONNECT_DIRECT + && SUCCEEDED(IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type))) + { + if (SUCCEEDED(topology_branch_fill_media_type(up_type, media_type))) + IMFTransform_SetOutputType(transform, 0, media_type, 0); + IMFMediaType_Release(media_type); + } + if (SUCCEEDED(hr)) - hr = topology_branch_connect(topology, method_mask, &down_branch, !down_type); + hr = topology_branch_connect(topology, method, &down_branch, !down_type); if (SUCCEEDED(hr)) hr = IMFTopology_AddNode(topology, node); if (SUCCEEDED(hr)) @@ -347,7 +354,10 @@ static HRESULT get_first_supported_media_type(IMFMediaTypeHandler *handler, IMFM for (i = 0; SUCCEEDED(hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, i, &media_type)); i++) { - if (SUCCEEDED(hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, media_type, NULL))) + /* HACK: Force initialize media type here, this is now something the topology laoder should do + * according to conformance tests but it should hopefully going to solve uninitialized audio + * renderer issues. */ + if (SUCCEEDED(hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, media_type))) { *type = media_type; return hr; @@ -518,8 +528,11 @@ static HRESULT topology_loader_resolve_branches(struct topoloader_context *conte else if (FAILED(hr = topology_branch_clone_nodes(context, branch))) WARN("Failed to clone nodes for branch %s\n", debugstr_topology_branch(branch)); else - hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, - branch, enumerate_source_types || node_type == MF_TOPOLOGY_TRANSFORM_NODE); + { + hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, branch, enumerate_source_types); + if (hr == MF_E_INVALIDMEDIATYPE && !enumerate_source_types && node_type == MF_TOPOLOGY_TRANSFORM_NODE) + hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, branch, TRUE); + } topology_branch_destroy(branch); if (FAILED(hr)) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index d8694cf6011..3e05626f238 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -2242,6 +2242,7 @@ static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngineEx *iface, static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngineEx *iface) { struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); + IMFMediaSession *session = NULL; HRESULT hr = S_OK; TRACE("%p.\n", iface); @@ -2253,10 +2254,16 @@ static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngineEx *iface) { media_engine_set_flag(engine, FLAGS_ENGINE_SHUT_DOWN, TRUE); media_engine_clear_presentation(engine); - IMFMediaSession_Shutdown(engine->session); + IMFMediaSession_AddRef(engine->session); + session = engine->session; } LeaveCriticalSection(&engine->cs); + if (SUCCEEDED(hr)) + { + IMFMediaSession_Shutdown(session); + IMFMediaSession_Release(session); + } return hr; } @@ -2581,7 +2588,7 @@ static HRESULT WINAPI media_engine_SetBalance(IMFMediaEngineEx *iface, double ba { FIXME("%p, %f stub.\n", iface, balance); - return E_NOTIMPL; + return S_OK; } static BOOL WINAPI media_engine_IsPlaybackRateSupported(IMFMediaEngineEx *iface, double rate) diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c index 66a1f0b79e9..f9489f3dcb5 100644 --- a/dlls/mfmediaengine/tests/mfmediaengine.c +++ b/dlls/mfmediaengine/tests/mfmediaengine.c @@ -152,7 +152,7 @@ static void check_rgb32_data_(int line, const WCHAR *filename, const BYTE *data, expect_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource)); diff = compare_rgb32(data, &length, rect, expect_data); - ok_(__FILE__, line)(diff == 0, "Unexpected %lu%% diff\n", diff); + ok_(__FILE__, line)(diff <= 3 /* small difference in wine */, "Unexpected %lu%% diff\n", diff); } static void init_functions(void) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index aa987ff0496..3d1fe615a5a 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -6296,6 +6296,18 @@ static HRESULT resolver_get_bytestream_url_hint(IMFByteStream *stream, WCHAR con static HRESULT resolver_create_gstreamer_handler(IMFByteStreamHandler **handler) { static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; + static const GUID CLSID_GStreamerByteStreamHandler2 = {0x317df619, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; + + const char *env = getenv("WINE_NEW_MEDIA_SOURCE"), *sgi = getenv("SteamGameId"); + if (!env && sgi) + { + if (!strcmp(sgi, "399810") /* Call of Cthulhu */) env = "1"; + if (!strcmp(sgi, "606880") /* Greedfall */) env = "1"; + if (!strcmp(sgi, "692850") /* Bloodstained */) env = "1"; + if (!strcmp(sgi, "934700") /* Dead Island 2 */) env = "1"; + } + if (env && atoi(env)) return CoCreateInstance(&CLSID_GStreamerByteStreamHandler2, NULL, CLSCTX_INPROC_SERVER, &IID_IMFByteStreamHandler, (void **)handler); + return CoCreateInstance(&CLSID_GStreamerByteStreamHandler, NULL, CLSCTX_INPROC_SERVER, &IID_IMFByteStreamHandler, (void **)handler); } @@ -9211,9 +9223,16 @@ static const IMFDXGIDeviceManagerVtbl dxgi_device_manager_vtbl = HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **manager) { struct dxgi_device_manager *object; + const char *do_not_create = getenv("WINE_DO_NOT_CREATE_DXGI_DEVICE_MANAGER"); TRACE("%p, %p.\n", token, manager); + if (do_not_create && do_not_create[0] != '\0') + { + FIXME("stubbing out\n"); + return E_NOTIMPL; + } + if (!token || !manager) return E_POINTER; diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 2ba967c6719..a159ae4b56f 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -36,6 +36,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB1, D3DFMT_A1); DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB4, MAKEFOURCC('4','P','x','x')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB1555, D3DFMT_A1R5G5B5); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB4444, D3DFMT_A4R4G4B4); /* SDK MFVideoFormat_A2R10G10B10 uses D3DFMT_A2B10G10R10, let's name it the other way */ @@ -2709,6 +2710,7 @@ static const struct uncompressed_video_format video_formats[] = { &MFVideoFormat_RGB32, 32, 3, 1, 0, BI_RGB }, { &MFVideoFormat_RGB565, 16, 3, 1, 0, BI_BITFIELDS }, { &MFVideoFormat_RGB555, 16, 3, 1, 0, BI_RGB }, + { &MFVideoFormat_ABGR32, 32, 3, 1, 0, BI_RGB }, { &MFVideoFormat_A2R10G10B10, 32, 3, 1, 0, -1 }, { &MFVideoFormat_A2B10G10R10, 32, 3, 1, 0, -1 }, { &MFVideoFormat_RGB8, 8, 3, 1, 0, BI_RGB }, @@ -2963,10 +2965,10 @@ HRESULT WINAPI MFUnwrapMediaType(IMFMediaType *wrapper, IMFMediaType **ret) HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVEFORMATEX **ret_format, UINT32 *size, UINT32 flags) { - WAVEFORMATEXTENSIBLE *format_ext = NULL; + UINT32 value, extra_size = 0, user_size; WAVEFORMATEX *format; GUID major, subtype; - UINT32 value; + void *user_data; HRESULT hr; TRACE("%p, %p, %p, %#x.\n", mediatype, ret_format, size, flags); @@ -2980,36 +2982,24 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE if (!IsEqualGUID(&major, &MFMediaType_Audio)) return E_INVALIDARG; - if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float)) + if (FAILED(hr = IMFMediaType_GetBlobSize(mediatype, &MF_MT_USER_DATA, &user_size))) { - FIXME("Unsupported audio format %s.\n", debugstr_guid(&subtype)); - return E_NOTIMPL; + if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float)) + return hr; + user_size = 0; } - /* FIXME: probably WAVE_FORMAT_MPEG/WAVE_FORMAT_MPEGLAYER3 should be handled separately. */ if (flags == MFWaveFormatExConvertFlag_ForceExtensible) - { - format_ext = CoTaskMemAlloc(sizeof(*format_ext)); - *size = sizeof(*format_ext); - format = (WAVEFORMATEX *)format_ext; - } - else - { - format = CoTaskMemAlloc(sizeof(*format)); - *size = sizeof(*format); - } + extra_size = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(*format); - if (!format) + *size = sizeof(*format) + user_size + extra_size; + if (!(format = CoTaskMemAlloc(*size))) return E_OUTOFMEMORY; memset(format, 0, *size); - - if (format_ext) - format->wFormatTag = WAVE_FORMAT_EXTENSIBLE; - else if (IsEqualGUID(&subtype, &MFAudioFormat_Float)) - format->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; - else - format->wFormatTag = WAVE_FORMAT_PCM; + format->wFormatTag = subtype.Data1; + format->cbSize = user_size + extra_size; + user_data = format + 1; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, &value))) format->nChannels = value; @@ -3021,18 +3011,26 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE format->nBlockAlign = value; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_BITS_PER_SAMPLE, &value))) format->wBitsPerSample = value; - if (format_ext) + + if (flags == MFWaveFormatExConvertFlag_ForceExtensible) { - format->cbSize = sizeof(*format_ext) - sizeof(*format); + WAVEFORMATEXTENSIBLE *format_ext = CONTAINING_RECORD(format, WAVEFORMATEXTENSIBLE, Format); + + format_ext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + format_ext->SubFormat = subtype; + user_data = format_ext + 1; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, &value))) format_ext->Samples.wSamplesPerBlock = value; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, &value))) format_ext->dwChannelMask = value; - memcpy(&format_ext->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM, sizeof(format_ext->SubFormat)); + else if (format_ext->Format.nChannels < ARRAY_SIZE(default_channel_mask)) + format_ext->dwChannelMask = default_channel_mask[format_ext->Format.nChannels]; } + IMFMediaType_GetBlob(mediatype, &MF_MT_USER_DATA, user_data, user_size, NULL); + *ret_format = format; return S_OK; @@ -3124,6 +3122,15 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA mediatype_set_uint32(mediatype, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr); } + if (IsEqualGUID(&subtype, &MFAudioFormat_AAC)) + { + HEAACWAVEINFO *info = CONTAINING_RECORD(format, HEAACWAVEINFO, wfx); + if (format->cbSize < sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)) + return E_INVALIDARG; + mediatype_set_uint32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, info->wAudioProfileLevelIndication, &hr); + mediatype_set_uint32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, info->wPayloadType, &hr); + } + if (format->cbSize && format->wFormatTag != WAVE_FORMAT_EXTENSIBLE) mediatype_set_blob(mediatype, &MF_MT_USER_DATA, (const UINT8 *)(format + 1), format->cbSize, &hr); @@ -3617,6 +3624,8 @@ DXGI_FORMAT WINAPI MFMapDX9FormatToDXGIFormat(DWORD format) return DXGI_FORMAT_P8; case D3DFMT_A8P8: return DXGI_FORMAT_A8P8; + case D3DFMT_A8B8G8R8: + return DXGI_FORMAT_R8G8B8A8_UNORM; default: return DXGI_FORMAT_UNKNOWN; } diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c index a50f81c93d4..8e489d22acd 100644 --- a/dlls/mfplat/sample.c +++ b/dlls/mfplat/sample.c @@ -791,6 +791,62 @@ static HRESULT WINAPI sample_GetTotalLength(IMFSample *iface, DWORD *total_lengt return S_OK; } +static HRESULT copy_2d_buffer_from_contiguous(IMFMediaBuffer *src, IMF2DBuffer *dst) +{ + DWORD current_length; + HRESULT hr, hr2; + BYTE *ptr; + + hr = IMFMediaBuffer_Lock(src, &ptr, NULL, ¤t_length); + + if (SUCCEEDED(hr)) + { + hr = IMF2DBuffer_ContiguousCopyFrom(dst, ptr, current_length); + + hr2 = IMFMediaBuffer_Unlock(src); + if (FAILED(hr2)) + WARN("Unlocking source buffer %p failed with hr %#lx.\n", src, hr2); + if (FAILED(hr2) && SUCCEEDED(hr)) + hr = hr2; + } + + return hr; +} + +static HRESULT copy_2d_buffer(IMFMediaBuffer *src, IMFMediaBuffer *dst) +{ + IMF2DBuffer2 *src2d2 = NULL, *dst2d2 = NULL; + IMF2DBuffer *dst2 = NULL; + HRESULT hr; + + hr = IMFMediaBuffer_QueryInterface(src, &IID_IMF2DBuffer2, (void **)&src2d2); + + if (SUCCEEDED(hr)) + hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer2, (void **)&dst2d2); + + if (SUCCEEDED(hr)) + hr = IMF2DBuffer2_Copy2DTo(src2d2, dst2d2); + + if (src2d2) + IMF2DBuffer2_Release(src2d2); + + if (dst2d2) + IMF2DBuffer2_Release(dst2d2); + + if (SUCCEEDED(hr)) + return hr; + + hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer, (void **)&dst2); + + if (SUCCEEDED(hr)) + hr = copy_2d_buffer_from_contiguous(src, dst2); + + if (dst2) + IMF2DBuffer_Release(dst2); + + return hr; +} + static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buffer) { struct sample *sample = impl_from_IMFSample(iface); @@ -805,6 +861,15 @@ static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buff EnterCriticalSection(&sample->attributes.cs); + if (sample->buffer_count == 1) + { + if (SUCCEEDED(hr = copy_2d_buffer(sample->buffers[0], buffer))) + { + LeaveCriticalSection(&sample->attributes.cs); + return hr; + } + } + total_length = sample_get_total_length(sample); dst_current_length = 0; diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 7fab1598181..f785df89b32 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -3598,6 +3598,7 @@ static void test_scheduled_items(void) IMFAsyncResult *result; MFWORKITEM_KEY key, key2; HRESULT hr; + ULONG refcount; callback = create_test_callback(NULL); @@ -3610,6 +3611,9 @@ static void test_scheduled_items(void) hr = MFCancelWorkItem(key); ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + refcount = IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); + ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); + hr = MFCancelWorkItem(key); ok(hr == MF_E_NOT_FOUND || broken(hr == S_OK) /* < win10 */, "Unexpected hr %#lx.\n", hr); @@ -3619,6 +3623,8 @@ static void test_scheduled_items(void) return; } + callback = create_test_callback(NULL); + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); @@ -6947,6 +6953,11 @@ static void validate_media_type(IMFMediaType *mediatype, const WAVEFORMATEX *for } else ok(FAILED(hr), "Unexpected ALL_SAMPLES_INDEPENDENT.\n"); + + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_FIXED_SIZE_SAMPLES, &value); + ok(FAILED(hr), "Unexpected FIXED_SIZE_SAMPLES.\n"); + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_COMPRESSED, &value); + ok(FAILED(hr), "Unexpected COMPRESSED.\n"); } static void test_MFInitMediaTypeFromWaveFormatEx(void) @@ -6980,11 +6991,14 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) { WAVE_FORMAT_WMASPDIF }, }; - UINT8 buff[MPEGLAYER3_WFX_EXTRA_BYTES]; + UINT8 buff[1024]; WAVEFORMATEXTENSIBLE waveformatext; MPEGLAYER3WAVEFORMAT mp3format; + WAVEFORMATEXTENSIBLE *format; + HEAACWAVEFORMAT aacformat; IMFMediaType *mediatype; unsigned int i, size; + UINT32 value; HRESULT hr; hr = MFCreateMediaType(&mediatype); @@ -7037,6 +7051,68 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(size == mp3format.wfx.cbSize, "Unexpected size %u.\n", size); ok(!memcmp(buff, (WAVEFORMATEX *)&mp3format + 1, size), "Unexpected user data.\n"); + /* HEAACWAVEFORMAT */ + aacformat.wfInfo.wfx.wFormatTag = WAVE_FORMAT_MPEG_HEAAC; + aacformat.wfInfo.wfx.nChannels = 2; + aacformat.wfInfo.wfx.nSamplesPerSec = 44100; + aacformat.wfInfo.wfx.nAvgBytesPerSec = 16000; + aacformat.wfInfo.wfx.nBlockAlign = 1; + aacformat.wfInfo.wfx.wBitsPerSample = 0; + aacformat.wfInfo.wPayloadType = 2; + aacformat.wfInfo.wAudioProfileLevelIndication = 1; + aacformat.pbAudioSpecificConfig[0] = 0xcd; + + /* test with invalid format size */ + aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - 2 - sizeof(WAVEFORMATEX); + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)&aacformat, sizeof(aacformat) - 2); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + + aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - sizeof(WAVEFORMATEX); + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)&aacformat, sizeof(aacformat)); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + validate_media_type(mediatype, &aacformat.wfInfo.wfx); + + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(value == aacformat.wfInfo.wAudioProfileLevelIndication, "Unexpected AAC_AUDIO_PROFILE_LEVEL_INDICATION %u.\n", value); + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(value == aacformat.wfInfo.wPayloadType, "Unexpected AAC_PAYLOAD_TYPE %u.\n", value); + + hr = IMFMediaType_GetBlob(mediatype, &MF_MT_USER_DATA, buff, sizeof(buff), &size); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size == aacformat.wfInfo.wfx.cbSize, "Unexpected size %u.\n", size); + ok(!memcmp(buff, (WAVEFORMATEX *)&aacformat + 1, size), "Unexpected user data.\n"); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format, &size, MFWaveFormatExConvertFlag_ForceExtensible); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "got wFormatTag %#x\n", format->Format.wFormatTag); + ok(format->Format.cbSize == aacformat.wfInfo.wfx.cbSize + sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), + "got cbSize %u\n", format->Format.cbSize); + ok(IsEqualGUID(&format->SubFormat, &MFAudioFormat_AAC), "got SubFormat %s\n", debugstr_guid(&format->SubFormat)); + ok(format->dwChannelMask == 3, "got dwChannelMask %#lx\n", format->dwChannelMask); + ok(format->Samples.wSamplesPerBlock == 0, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); + ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); + CoTaskMemFree(format); + + /* test with invalid format size */ + aacformat.wfInfo.wfx.cbSize = 1; + hr = IMFMediaType_SetBlob(mediatype, &MF_MT_USER_DATA, buff, aacformat.wfInfo.wfx.cbSize); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format, &size, MFWaveFormatExConvertFlag_ForceExtensible); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "got wFormatTag %#x\n", format->Format.wFormatTag); + ok(format->Format.cbSize == aacformat.wfInfo.wfx.cbSize + sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), + "got cbSize %u\n", format->Format.cbSize); + ok(IsEqualGUID(&format->SubFormat, &MFAudioFormat_AAC), "got SubFormat %s\n", debugstr_guid(&format->SubFormat)); + ok(format->dwChannelMask == 3, "got dwChannelMask %#lx\n", format->dwChannelMask); + ok(format->Samples.wSamplesPerBlock == 0, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); + ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); + CoTaskMemFree(format); + IMFMediaType_Release(mediatype); } diff --git a/dlls/mfplay/tests/mfplay.c b/dlls/mfplay/tests/mfplay.c index fa66ccae57e..db23bb7de42 100644 --- a/dlls/mfplay/tests/mfplay.c +++ b/dlls/mfplay/tests/mfplay.c @@ -493,7 +493,7 @@ static void test_media_language(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); check_media_language(player, L"test-eng.mp4", L"en"); - check_media_language(player, L"test-ang.mp4", NULL); + todo_check_media_language(player, L"test-ang.mp4", NULL); check_media_language(player, L"test-und.mp4", NULL); check_media_language(player, L"test-en-US.mp4", L"en"); diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 057e771ca99..1461d7acd7b 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -242,6 +242,461 @@ static ULONG source_reader_release(struct source_reader *reader) return refcount; } +struct passthrough_transform +{ + IMFTransform IMFTransform_iface; + LONG refcount; + IMFMediaType *type; + IMFAttributes *attributes; + IMFAttributes *input_attributes; + IMFAttributes *output_attributes; + IMFSample *sample; +}; + +static inline struct passthrough_transform *impl_from_IMFTransform(IMFTransform *iface) +{ + return CONTAINING_RECORD(iface, struct passthrough_transform, IMFTransform_iface); +} + +static HRESULT WINAPI passthrough_transform_QueryInterface(IMFTransform *iface, REFIID riid, void **out) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IMFTransform)) + { + *out = &transform->IMFTransform_iface; + } + else + { + FIXME("(%s, %p)\n", debugstr_guid(riid), out); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI passthrough_transform_AddRef(IMFTransform *iface) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + ULONG refcount = InterlockedIncrement(&transform->refcount); + + TRACE("%p, refcount %lu.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI passthrough_transform_Release(IMFTransform *iface) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + ULONG refcount = InterlockedDecrement(&transform->refcount); + + TRACE("%p, refcount %lu.\n", iface, refcount); + + if (!refcount) + { + if (transform->type) + IMFMediaType_Release(transform->type); + IMFAttributes_Release(transform->attributes); + IMFAttributes_Release(transform->input_attributes); + IMFAttributes_Release(transform->output_attributes); + if (transform->sample) + IMFSample_Release(transform->sample); + } + + return refcount; +} +static HRESULT WINAPI passthrough_transform_GetStreamLimits(IMFTransform *iface, + DWORD *input_minimum, DWORD *input_maximum, DWORD *output_minimum, DWORD *output_maximum) +{ + TRACE("%p, %p, %p, %p, %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum); + + *input_minimum = 1; + *input_maximum = 1; + *output_minimum = 1; + *output_maximum = 1; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs) +{ + TRACE("%p, %p, %p.\n", iface, inputs, outputs); + + *inputs = 1; + *outputs = 1; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetStreamIDs(IMFTransform *iface, + DWORD input_size, DWORD *inputs, DWORD output_size, DWORD *outputs) +{ + TRACE("%p, %ld, %p, %ld, %p.\n", iface, input_size, inputs, output_size, outputs); + + if (input_size < 1 || output_size < 1) + return MF_E_BUFFERTOOSMALL; + + inputs[0] = 0; + outputs[0] = 0; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info) +{ + TRACE("%p, %ld, %p.\n", iface, id, info); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + info->hnsMaxLatency = 0; + info->dwFlags = MFT_INPUT_STREAM_PROCESSES_IN_PLACE; + info->cbSize = 0; + info->cbMaxLookahead = 0; + info->cbAlignment = 0; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info) +{ + TRACE("%p, %ld, %p.\n", iface, id, info); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; + info->cbSize = 0; + info->cbAlignment = 0; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %p.\n", iface, attributes); + + IMFAttributes_AddRef(transform->attributes); + + *attributes = transform->attributes; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p.\n", iface, id, attributes); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + IMFAttributes_AddRef(transform->input_attributes); + + *attributes = transform->input_attributes; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p.\n", iface, id, attributes); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + IMFAttributes_AddRef(transform->output_attributes); + + *attributes = transform->output_attributes; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_DeleteInputStream(IMFTransform *iface, DWORD id) +{ + TRACE("%p, %ld.\n", iface, id); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids) +{ + TRACE("%p, %ld, %p.\n", iface, streams, ids); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) +{ + TRACE("%p, %ld, %ld, %p.\n", iface, id, index, type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %ld, %p.\n", iface, id, index, type); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (index != 0) + return MF_E_NO_MORE_TYPES; + + if (!transform->type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + *type = transform->type; + IMFMediaType_AddRef(*type); + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p, %ld.\n", iface, id, type, flags); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (!(flags & MFT_SET_TYPE_TEST_ONLY)) + { + if (transform->type) + IMFMediaType_Release(transform->type); + transform->type = type; + IMFMediaType_AddRef(type); + } + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + DWORD cmp_flags; + HRESULT hr; + + TRACE("%p, %ld, %p, %ld.\n", iface, id, type, flags); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (!transform->type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + hr = IMFMediaType_IsEqual(transform->type, type, &cmp_flags); + if (FAILED(hr)) + return hr; + + if (!(cmp_flags & MF_MEDIATYPE_EQUAL_FORMAT_DATA)) + return MF_E_INVALIDMEDIATYPE; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p.\n", iface, id, type); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (!transform->type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + *type = transform->type; + IMFMediaType_AddRef(*type); + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p.\n", iface, id, type); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (!transform->type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + *type = transform->type; + IMFMediaType_AddRef(*type); + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p.\n", iface, id, flags); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + *flags = transform->sample ? 0 : MFT_INPUT_STATUS_ACCEPT_DATA; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %p.\n", iface, flags); + + *flags = transform->sample ? MFT_OUTPUT_STATUS_SAMPLE_READY : 0; + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper) +{ + FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event) +{ + FIXME("%p, %ld, %p.\n", iface, id, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) +{ + FIXME("%p, %u, %Iu.\n", iface, message, param); + + return E_NOTIMPL; +} + +static HRESULT WINAPI passthrough_transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + + TRACE("%p, %ld, %p, %ld.\n", iface, id, sample, flags); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (transform->sample) + return MF_E_NOTACCEPTING; + + transform->sample = sample; + IMFSample_AddRef(sample); + + return S_OK; +} + +static HRESULT WINAPI passthrough_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, + MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) +{ + struct passthrough_transform *transform = impl_from_IMFTransform(iface); + unsigned int i; + + TRACE("%p, %ld, %ld, %p, %p.\n", iface, flags, count, samples, status); + + if (!transform->sample) + return MF_E_TRANSFORM_NEED_MORE_INPUT; + + if (samples[0].dwStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + samples[0].pSample = transform->sample; + transform->sample = NULL; + + for (i = 1; i < count; ++i) + samples[i].dwStatus = MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE; + + *status = 0; + + return S_OK; +} + +static const IMFTransformVtbl passthrough_transform_vtbl = { + passthrough_transform_QueryInterface, + passthrough_transform_AddRef, + passthrough_transform_Release, + passthrough_transform_GetStreamLimits, + passthrough_transform_GetStreamCount, + passthrough_transform_GetStreamIDs, + passthrough_transform_GetInputStreamInfo, + passthrough_transform_GetOutputStreamInfo, + passthrough_transform_GetAttributes, + passthrough_transform_GetInputStreamAttributes, + passthrough_transform_GetOutputStreamAttributes, + passthrough_transform_DeleteInputStream, + passthrough_transform_AddInputStreams, + passthrough_transform_GetInputAvailableType, + passthrough_transform_GetOutputAvailableType, + passthrough_transform_SetInputType, + passthrough_transform_SetOutputType, + passthrough_transform_GetInputCurrentType, + passthrough_transform_GetOutputCurrentType, + passthrough_transform_GetInputStatus, + passthrough_transform_GetOutputStatus, + passthrough_transform_SetOutputBounds, + passthrough_transform_ProcessEvent, + passthrough_transform_ProcessMessage, + passthrough_transform_ProcessInput, + passthrough_transform_ProcessOutput, +}; + +static HRESULT create_passthrough_transform(IMFTransform **transform) +{ + struct passthrough_transform *obj; + HRESULT hr; + + if (!(obj = calloc(1, sizeof(*obj)))) + return E_OUTOFMEMORY; + + obj->IMFTransform_iface.lpVtbl = &passthrough_transform_vtbl; + obj->refcount = 1; + + hr = MFCreateAttributes(&obj->attributes, 0); + if (SUCCEEDED(hr)) + hr = MFCreateAttributes(&obj->input_attributes, 0); + if (SUCCEEDED(hr)) + hr = MFCreateAttributes(&obj->output_attributes, 0); + + if (SUCCEEDED(hr)) + { + *transform = &obj->IMFTransform_iface; + } + else + { + if (obj->attributes) + IMFAttributes_Release(obj->attributes); + if (obj->input_attributes) + IMFAttributes_Release(obj->input_attributes); + if (obj->output_attributes) + IMFAttributes_Release(obj->output_attributes); + free(obj); + } + + return hr; +} + static HRESULT WINAPI source_reader_async_command_QueryInterface(IUnknown *iface, REFIID riid, void **obj) { if (IsEqualIID(riid, &IID_IUnknown)) @@ -1222,6 +1677,8 @@ static HRESULT source_reader_flush(struct source_reader *reader, unsigned int in return hr; } +static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader, unsigned int index); + static HRESULT WINAPI source_reader_async_commands_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) { struct source_reader *reader = impl_from_async_commands_callback_IMFAsyncCallback(iface); @@ -1251,7 +1708,15 @@ static HRESULT WINAPI source_reader_async_commands_callback_Invoke(IMFAsyncCallb { stream = &reader->streams[stream_index]; - if (!(report_sample = source_reader_get_read_result(reader, stream, command->u.read.flags, &status, + if (!stream->allocator) + { + hr = source_reader_setup_sample_allocator(reader, stream_index); + + if (FAILED(hr)) + WARN("Failed to setup the sample allocator, hr %#lx.\n", hr); + } + + if (SUCCEEDED(hr) && !(report_sample = source_reader_get_read_result(reader, stream, command->u.read.flags, &status, &stream_index, &stream_flags, ×tamp, &sample))) { stream->requests++; @@ -1656,20 +2121,33 @@ static HRESULT source_reader_set_compatible_media_type(struct source_reader *rea } static HRESULT source_reader_create_sample_allocator_attributes(const struct source_reader *reader, - IMFAttributes **attributes) + struct media_stream *stream, IMFAttributes **attributes) { - UINT32 shared = 0, shared_without_mutex = 0; + UINT32 reader_shared = 0, reader_shared_without_mutex = 0; + UINT32 output_shared = 0, output_shared_without_mutex = 0; HRESULT hr; if (FAILED(hr = MFCreateAttributes(attributes, 1))) return hr; - IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED, &shared); - IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, &shared_without_mutex); + IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED, &reader_shared); + IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, &reader_shared_without_mutex); + + if (stream->decoder.transform) + { + IMFAttributes *output_attributes; + + if (SUCCEEDED(IMFTransform_GetOutputStreamAttributes(stream->decoder.transform, 0, &output_attributes))) + { + IMFAttributes_GetUINT32(output_attributes, &MF_SA_D3D11_SHARED, &output_shared); + IMFAttributes_GetUINT32(output_attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, &output_shared_without_mutex); + IMFAttributes_Release(output_attributes); + } + } - if (shared_without_mutex) + if (reader_shared_without_mutex || output_shared_without_mutex) hr = IMFAttributes_SetUINT32(*attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, TRUE); - else if (shared) + else if (reader_shared || output_shared) hr = IMFAttributes_SetUINT32(*attributes, &MF_SA_D3D11_SHARED, TRUE); return hr; @@ -1705,7 +2183,7 @@ static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader return hr; } - if (FAILED(hr = source_reader_create_sample_allocator_attributes(reader, &attributes))) + if (FAILED(hr = source_reader_create_sample_allocator_attributes(reader, stream, &attributes))) WARN("Failed to create allocator attributes, hr %#lx.\n", hr); if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(stream->allocator, 2, 8, @@ -1789,6 +2267,36 @@ static HRESULT source_reader_configure_decoder(struct source_reader *reader, DWO return MF_E_TOPO_CODEC_NOT_FOUND; } +static HRESULT source_reader_add_passthrough_transform(struct source_reader *reader, DWORD index, IMFMediaType *type) +{ + IMFTransform *transform; + HRESULT hr; + + if (FAILED(hr = create_passthrough_transform(&transform))) + return hr; + + if (FAILED(hr = IMFTransform_SetInputType(transform, 0, type, 0))) + { + WARN("Failed to set decoder input type, hr %#lx.\n", hr); + IMFTransform_Release(transform); + return hr; + } + + if (FAILED(hr = IMFTransform_SetOutputType(transform, 0, type, 0))) + { + WARN("Failed to set decoder input type, hr %#lx.\n", hr); + IMFTransform_Release(transform); + return hr; + } + + if (reader->streams[index].decoder.transform) + IMFTransform_Release(reader->streams[index].decoder.transform); + reader->streams[index].decoder.transform = transform; + reader->streams[index].decoder.min_buffer_size = 0; + + return S_OK; +} + static HRESULT source_reader_create_decoder_for_stream(struct source_reader *reader, DWORD index, IMFMediaType *output_type) { MFT_REGISTER_TYPE_INFO in_type, out_type; @@ -1877,8 +2385,14 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReaderEx *iface, D hr = source_reader_set_compatible_media_type(reader, index, type); if (hr == S_FALSE) hr = source_reader_create_decoder_for_stream(reader, index, type); - if (SUCCEEDED(hr)) - hr = source_reader_setup_sample_allocator(reader, index); + else if (hr == S_OK) + hr = source_reader_add_passthrough_transform(reader, index, reader->streams[index].current); + + if (reader->streams[index].allocator) + { + IMFVideoSampleAllocatorEx_Release(reader->streams[index].allocator); + reader->streams[index].allocator = NULL; + } LeaveCriticalSection(&reader->cs); @@ -1977,7 +2491,15 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind stream = &reader->streams[stream_index]; - if (!source_reader_get_read_result(reader, stream, flags, &hr, actual_index, stream_flags, + if (!stream->allocator) + { + hr = source_reader_setup_sample_allocator(reader, stream_index); + + if (FAILED(hr)) + WARN("Failed to setup the sample allocator, hr %#lx.\n", hr); + } + + if (SUCCEEDED(hr) && !source_reader_get_read_result(reader, stream, flags, &hr, actual_index, stream_flags, timestamp, sample)) { while (!source_reader_got_response_for_stream(reader, stream) && stream->state != STREAM_STATE_EOS) @@ -2104,8 +2626,19 @@ static HRESULT WINAPI src_reader_Flush(IMFSourceReaderEx *iface, DWORD index) struct source_reader *reader = impl_from_IMFSourceReaderEx(iface); HRESULT hr; + const char *sgi; + TRACE("%p, %#lx.\n", iface, index); + sgi = getenv("SteamGameId"); + if (sgi && strcmp(sgi, "1293160") == 0) + { + /* In The Medium flushes sometimes lead to the callback + calling objects that have already been destroyed. */ + WARN("ignoring flush\n"); + return S_OK; + } + EnterCriticalSection(&reader->cs); if (reader->async_callback) diff --git a/dlls/mfreadwrite/tests/Makefile.in b/dlls/mfreadwrite/tests/Makefile.in index 90bac9e0896..cada1bf22ff 100644 --- a/dlls/mfreadwrite/tests/Makefile.in +++ b/dlls/mfreadwrite/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = mfreadwrite.dll -IMPORTS = ole32 user32 d3d9 dxva2 mfplat mfreadwrite mfuuid +IMPORTS = ole32 user32 d3d9 dxva2 mfplat mfreadwrite mfuuid propsys SOURCES = \ mfplat.c \ diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index c3544a31ac6..2095d2f054d 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -38,11 +38,94 @@ DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); #include "mfidl.h" #include "mferror.h" #include "mfreadwrite.h" +#include "propvarutil.h" #include "d3d9.h" #include "dxva2api.h" #include "wine/test.h" +struct attribute_desc +{ + const GUID *key; + const char *name; + PROPVARIANT value; + BOOL ratio; + BOOL required; + BOOL todo; + BOOL todo_value; +}; + +#define ATTR_GUID(k, g, ...) {.key = &k, .name = #k, {.vt = VT_CLSID, .puuid = (GUID *)&g}, __VA_ARGS__ } +#define ATTR_UINT32(k, v, ...) {.key = &k, .name = #k, {.vt = VT_UI4, .ulVal = v}, __VA_ARGS__ } +#define ATTR_BLOB(k, p, n, ...) {.key = &k, .name = #k, {.vt = VT_VECTOR | VT_UI1, .caub = {.pElems = (void *)p, .cElems = n}}, __VA_ARGS__ } +#define ATTR_RATIO(k, n, d, ...) {.key = &k, .name = #k, {.vt = VT_UI8, .uhVal = {.HighPart = n, .LowPart = d}}, .ratio = TRUE, __VA_ARGS__ } +#define ATTR_UINT64(k, v, ...) {.key = &k, .name = #k, {.vt = VT_UI8, .uhVal = {.QuadPart = v}}, __VA_ARGS__ } + +#define check_media_type(a, b, c) check_attributes_(__FILE__, __LINE__, (IMFAttributes *)a, b, c) +#define check_attributes(a, b, c) check_attributes_(__FILE__, __LINE__, a, b, c) +void check_attributes_(const char *file, int line, IMFAttributes *attributes, + const struct attribute_desc *desc, ULONG limit) +{ + char buffer[1024], *buf = buffer; + PROPVARIANT value; + int i, j, ret; + HRESULT hr; + + for (i = 0; i < limit && desc[i].key; ++i) + { + hr = IMFAttributes_GetItem(attributes, desc[i].key, &value); + todo_wine_if(desc[i].todo) + ok_(file, line)(hr == S_OK, "%s missing, hr %#lx\n", debugstr_a(desc[i].name), hr); + if (hr != S_OK) continue; + + switch (value.vt) + { + default: sprintf(buffer, "??"); break; + case VT_CLSID: sprintf(buffer, "%s", debugstr_guid(value.puuid)); break; + case VT_UI4: sprintf(buffer, "%lu", value.ulVal); break; + case VT_UI8: + if (desc[i].ratio) + sprintf(buffer, "%lu:%lu", value.uhVal.HighPart, value.uhVal.LowPart); + else + sprintf(buffer, "%I64u", value.uhVal.QuadPart); + break; + case VT_VECTOR | VT_UI1: + buf += sprintf(buf, "size %lu, data {", value.caub.cElems); + for (j = 0; j < 128 && j < value.caub.cElems; ++j) + buf += sprintf(buf, "0x%02x,", value.caub.pElems[j]); + if (value.caub.cElems > 128) + buf += sprintf(buf, "...}"); + else + buf += sprintf(buf - (j ? 1 : 0), "}"); + break; + } + + ret = PropVariantCompareEx(&value, &desc[i].value, 0, 0); + todo_wine_if(desc[i].todo_value) + ok_(file, line)(ret == 0, "%s mismatch, type %u, value %s\n", + debugstr_a(desc[i].name), value.vt, buffer); + PropVariantClear(&value); + } +} + +#define init_media_type(a, b, c) init_attributes_(__FILE__, __LINE__, (IMFAttributes *)a, b, c) +#define init_attributes(a, b, c) init_attributes_(__FILE__, __LINE__, a, b, c) +static void init_attributes_(const char *file, int line, IMFAttributes *attributes, + const struct attribute_desc *desc, ULONG limit) +{ + HRESULT hr; + ULONG i; + + hr = IMFAttributes_DeleteAllItems(attributes); + ok_(file, line)(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + for (i = 0; i < limit && desc[i].key; ++i) + { + hr = IMFAttributes_SetItem(attributes, desc[i].key, &desc[i].value); + ok_(file, line)(hr == S_OK, "SetItem %s returned %#lx\n", debugstr_a(desc[i].name), hr); + } +} + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -357,48 +440,10 @@ static HRESULT WINAPI test_source_GetCharacteristics(IMFMediaSource *iface, DWOR static HRESULT WINAPI test_source_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **pd) { struct test_source *source = impl_from_IMFMediaSource(iface); - IMFStreamDescriptor *sds[ARRAY_SIZE(source->streams)]; - IMFMediaType *media_type; HRESULT hr = S_OK; - int i; - - EnterCriticalSection(&source->cs); - - if (source->pd) - { - *pd = source->pd; - IMFPresentationDescriptor_AddRef(*pd); - } - else - { - for (i = 0; i < source->stream_count; ++i) - { - hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - - hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = MFCreateStreamDescriptor(i, 1, &media_type, &sds[i]); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - - IMFMediaType_Release(media_type); - } - - hr = MFCreatePresentationDescriptor(source->stream_count, sds, &source->pd); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - for (i = 0; i < source->stream_count; ++i) - IMFStreamDescriptor_Release(sds[i]); - - *pd = source->pd; - IMFPresentationDescriptor_AddRef(*pd); - } - - LeaveCriticalSection(&source->cs); + *pd = source->pd; + IMFPresentationDescriptor_AddRef(*pd); return hr; } @@ -522,17 +567,22 @@ static struct test_media_stream *create_test_stream(DWORD stream_index, IMFMedia return stream; } -static IMFMediaSource *create_test_source(int stream_count) +static IMFMediaSource *create_test_source(IMFStreamDescriptor **streams, UINT stream_count) { struct test_source *source; + HRESULT hr; int i; source = calloc(1, sizeof(*source)); source->IMFMediaSource_iface.lpVtbl = &test_source_vtbl; source->refcount = 1; source->stream_count = stream_count; - MFCreateEventQueue(&source->event_queue); + hr = MFCreatePresentationDescriptor(stream_count, streams, &source->pd); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateEventQueue(&source->event_queue); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); InitializeCriticalSection(&source->cs); + for (i = 0; i < source->stream_count; ++i) source->streams[i] = create_test_stream(i, &source->IMFMediaSource_iface); @@ -899,7 +949,7 @@ static void test_source_reader(const char *filename, bool video) hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags, ×tamp, &sample); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine_if (video) ok(!actual_index, "Unexpected stream index %lu.\n", actual_index); + ok(!actual_index, "Unexpected stream index %lu.\n", actual_index); ok(!(stream_flags & ~MF_SOURCE_READERF_ENDOFSTREAM), "Unexpected stream flags %#lx.\n", stream_flags); if (stream_flags & MF_SOURCE_READERF_ENDOFSTREAM) @@ -920,7 +970,7 @@ static void test_source_reader(const char *filename, bool video) hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &actual_index, &stream_flags, ×tamp, &sample); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(actual_index == 1, "Unexpected stream index %lu.\n", actual_index); + ok(actual_index == 1, "Unexpected stream index %lu.\n", actual_index); ok(!(stream_flags & ~MF_SOURCE_READERF_ENDOFSTREAM), "Unexpected stream flags %#lx.\n", stream_flags); if (stream_flags & MF_SOURCE_READERF_ENDOFSTREAM) @@ -951,7 +1001,7 @@ static void test_source_reader(const char *filename, bool video) hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN, &actual_index, &stream_flags, ×tamp, &sample); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine_if (video) ok(actual_index == 0, "Unexpected stream index %lu.\n", actual_index); + ok(actual_index == 0, "Unexpected stream index %lu.\n", actual_index); ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags); ok(!sample, "Unexpected sample object.\n"); @@ -972,7 +1022,7 @@ static void test_source_reader(const char *filename, bool video) hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN, &actual_index, &stream_flags, NULL, &sample); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine_if (video) ok(!actual_index, "Unexpected stream index %lu.\n", actual_index); + ok(!actual_index, "Unexpected stream index %lu.\n", actual_index); ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags); ok(!sample, "Unexpected sample object.\n"); @@ -1028,7 +1078,15 @@ static void test_source_reader(const char *filename, bool video) static void test_source_reader_from_media_source(void) { static const DWORD expected_sample_order[10] = {0, 0, 1, 1, 0, 0, 0, 0, 1, 0}; + static const struct attribute_desc audio_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM), + ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32), + {0}, + }; + IMFStreamDescriptor *audio_streams[3]; struct async_callback *callback; IMFSourceReader *reader; IMFMediaSource *source; @@ -1043,7 +1101,18 @@ static void test_source_reader_from_media_source(void) int i; PROPVARIANT pos; - source = create_test_source(3); + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + { + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, audio_stream_type_desc, -1); + + hr = MFCreateStreamDescriptor(i, 1, &media_type, &audio_streams[i]); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + } + + source = create_test_source(audio_streams, 3); ok(!!source, "Failed to create test source.\n"); hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader); @@ -1122,7 +1191,7 @@ static void test_source_reader_from_media_source(void) IMFSourceReader_Release(reader); IMFMediaSource_Release(source); - source = create_test_source(1); + source = create_test_source(audio_streams, 1); ok(!!source, "Failed to create test source.\n"); hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader); @@ -1159,7 +1228,7 @@ static void test_source_reader_from_media_source(void) IMFMediaSource_Release(source); /* Request from stream 0. */ - source = create_test_source(3); + source = create_test_source(audio_streams, 3); ok(!!source, "Failed to create test source.\n"); hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader); @@ -1193,7 +1262,7 @@ static void test_source_reader_from_media_source(void) IMFMediaSource_Release(source); /* Request a non-native bit depth. */ - source = create_test_source(1); + source = create_test_source(audio_streams, 1); ok(!!source, "Failed to create test source.\n"); hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader); @@ -1241,7 +1310,7 @@ static void test_source_reader_from_media_source(void) IMFMediaSource_Release(source); /* Async mode. */ - source = create_test_source(3); + source = create_test_source(audio_streams, 3); ok(!!source, "Failed to create test source.\n"); callback = create_async_callback(); @@ -1286,7 +1355,7 @@ static void test_source_reader_from_media_source(void) IMFMediaSource_Release(source); /* RequestSample failure. */ - source = create_test_source(3); + source = create_test_source(audio_streams, 3); ok(!!source, "Failed to create test source.\n"); fail_request_sample = TRUE; @@ -1329,7 +1398,7 @@ static void test_source_reader_from_media_source(void) fail_request_sample = FALSE; /* MF_SOURCE_READER_ANY_STREAM with streams of different sample sizes */ - source = create_test_source(2); + source = create_test_source(audio_streams, 2); ok(!!source, "Failed to create test source.\n"); test_source = impl_from_IMFMediaSource(source); @@ -1359,19 +1428,32 @@ static void test_source_reader_from_media_source(void) IMFSourceReader_Release(reader); IMFMediaSource_Release(source); + + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + IMFStreamDescriptor_Release(audio_streams[i]); } static void test_reader_d3d9(void) { + static const struct attribute_desc audio_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM), + ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32), + {0}, + }; + + IMFStreamDescriptor *audio_streams[3]; IDirect3DDeviceManager9 *d3d9_manager; IDirect3DDevice9 *d3d9_device; IMFAttributes *attributes; + IMFMediaType *media_type; IMFSourceReader *reader; IMFMediaSource *source; IDirect3D9 *d3d9; HWND window; HRESULT hr; - UINT token; + UINT i, token; ULONG refcount; d3d9 = Direct3DCreate9(D3D_SDK_VERSION); @@ -1387,13 +1469,24 @@ static void test_reader_d3d9(void) goto done; } + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + { + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, audio_stream_type_desc, -1); + + hr = MFCreateStreamDescriptor(i, 1, &media_type, &audio_streams[i]); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + } + hr = DXVA2CreateDirect3DDeviceManager9(&token, &d3d9_manager); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDirect3DDeviceManager9_ResetDevice(d3d9_manager, d3d9_device, token); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - source = create_test_source(3); + source = create_test_source(audio_streams, 3); ok(!!source, "Failed to create test source.\n"); hr = MFCreateAttributes(&attributes, 1); @@ -1409,11 +1502,13 @@ static void test_reader_d3d9(void) IMFSourceReader_Release(reader); + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + IMFStreamDescriptor_Release(audio_streams[i]); + refcount = IDirect3DDeviceManager9_Release(d3d9_manager); ok(!refcount, "Unexpected refcount %lu.\n", refcount); IDirect3DDevice9_Release(d3d9_device); - done: IDirect3D9_Release(d3d9); DestroyWindow(window); @@ -1511,12 +1606,34 @@ static void test_sink_writer_mp4(void) static void test_interfaces(void) { + static const struct attribute_desc audio_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM), + ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32), + {0}, + }; + + IMFStreamDescriptor *audio_streams[1]; + IMFMediaType *media_type; IMFSourceReader *reader; IMFMediaSource *source; IUnknown *unk; HRESULT hr; + UINT i; + + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + { + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, audio_stream_type_desc, -1); + + hr = MFCreateStreamDescriptor(i, 1, &media_type, &audio_streams[i]); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + } - source = create_test_source(1); + source = create_test_source(audio_streams, 1); ok(!!source, "Failed to create test source.\n"); hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader); @@ -1529,6 +1646,596 @@ static void test_interfaces(void) IMFSourceReader_Release(reader); IMFMediaSource_Release(source); + + for (i = 0; i < ARRAY_SIZE(audio_streams); i++) + IMFStreamDescriptor_Release(audio_streams[i]); +} + +static void test_source_reader_transforms(BOOL enable_processing, BOOL enable_advanced) +{ + static const struct attribute_desc h264_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + {0}, + }; + static const struct attribute_desc nv12_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + {0}, + }; + static const struct attribute_desc nv12_expect_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_RATIO(MF_MT_FRAME_RATE, 30000, 1001), + ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), + ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 96), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 7), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, 13824), + ATTR_UINT32(MF_MT_VIDEO_ROTATION, 0), + {0}, + }; + static const struct attribute_desc nv12_expect_advanced_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12, .todo_value = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 2, .todo = TRUE), + {0}, + }; + static const struct attribute_desc yuy2_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_YUY2), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + {0}, + }; + static const struct attribute_desc yuy2_expect_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_YUY2), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_RATIO(MF_MT_FRAME_RATE, 30000, 1001), + ATTR_RATIO(MF_MT_PIXEL_ASPECT_RATIO, 1, 1), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), + ATTR_UINT32(MF_MT_AVG_BIT_ERROR_RATE, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 192), + ATTR_UINT32(MF_MT_FIXED_SIZE_SAMPLES, 1), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 7), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, 18432), + ATTR_UINT32(MF_MT_VIDEO_ROTATION, 0), + {0}, + }; + static const struct attribute_desc yuy2_expect_advanced_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_YUY2, .todo_value = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 2, .todo = TRUE), + {0}, + }; + static const struct attribute_desc rgb32_stream_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + {0}, + }; + static const struct attribute_desc rgb32_expect_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32, .todo_value = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, 384, .todo = TRUE), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 2, .todo = TRUE), + ATTR_UINT32(MF_MT_SAMPLE_SIZE, 36864, .todo = TRUE), + {0}, + }; + static const struct attribute_desc rgb32_expect_advanced_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32, .todo_value = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, 96, 96), + ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1, .todo = TRUE), + ATTR_UINT32(MF_MT_COMPRESSED, 0, .todo = TRUE), + ATTR_UINT32(MF_MT_INTERLACE_MODE, 2, .todo = TRUE), + }; + IMFStreamDescriptor *video_stream; + IMFSourceReaderEx *reader_ex; + IMFAttributes *attributes; + IMFMediaType *media_type; + IMFSourceReader *reader; + IMFTransform *transform; + IMFMediaSource *source; + GUID category; + HRESULT hr; + + winetest_push_context("vp %u adv %u", enable_processing, enable_advanced); + + hr = MFCreateAttributes(&attributes, 1); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFAttributes_SetUINT32(attributes, &MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, enable_processing); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFAttributes_SetUINT32(attributes, &MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, enable_advanced); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* test source reader with a RGB32 source */ + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, rgb32_stream_type_desc, -1); + hr = MFCreateStreamDescriptor(0, 1, &media_type, &video_stream); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + source = create_test_source(&video_stream, 1); + ok(!!source, "Failed to create test source.\n"); + + hr = MFCreateSourceReaderFromMediaSource(source, attributes, &reader); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* skip tests on Win7 which misses IMFSourceReaderEx and has uninteresting media types differences */ + hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#lx.\n", hr); + if (broken(hr == E_NOINTERFACE)) + { + win_skip("missing IMFSourceReaderEx interface, skipping tests on Win7\n"); + goto skip_tests; + } + IMFSourceReaderEx_Release(reader_ex); + + hr = IMFSourceReader_GetNativeMediaType(reader, 0, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* only one stream type and only one stream */ + hr = IMFSourceReader_GetNativeMediaType(reader, 0, 1, &media_type); + ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_GetNativeMediaType(reader, 1, 0, &media_type); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_GetCurrentMediaType(reader, 1, &media_type); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr); + + /* cannot request encoding to compressed media type */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, h264_stream_type_desc, -1); + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + /* SetCurrentMediaType needs major type and subtype */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, nv12_stream_type_desc, 1); + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + + /* RGB32 -> NV12 conversion with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + init_media_type(media_type, nv12_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + if (enable_advanced) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, nv12_expect_advanced_desc, -1); + else + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* video processor is accessible with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + if (!enable_advanced) + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + IMFSourceReader_Release(reader); + IMFMediaSource_Release(source); + IMFStreamDescriptor_Release(video_stream); + + + /* test source reader with a NV12 source */ + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, nv12_stream_type_desc, -1); + hr = MFCreateStreamDescriptor(0, 1, &media_type, &video_stream); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + source = create_test_source(&video_stream, 1); + ok(!!source, "Failed to create test source.\n"); + + hr = MFCreateSourceReaderFromMediaSource(source, attributes, &reader); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFSourceReader_GetNativeMediaType(reader, 0, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* NV12 -> RGB32 conversion with MF_SOURCE_READER_ENABLE_(ADVANCED_)VIDEO_PROCESSING */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, rgb32_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + if (enable_processing || enable_advanced) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, rgb32_expect_advanced_desc, -1); + else if (enable_processing) + check_media_type(media_type, rgb32_expect_desc, -1); + else + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* convert transform is only exposed with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + if (!enable_advanced) + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + /* NV12 -> YUY2 conversion with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, yuy2_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + if (enable_advanced) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, yuy2_expect_advanced_desc, -1); + else if (enable_processing) + check_media_type(media_type, rgb32_expect_desc, -1); + else + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* convert transform is only exposed with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + if (!enable_advanced) + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, yuy2_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 0, &category, &transform); + if (!enable_advanced) + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, yuy2_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 1, &category, &transform); + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + IMFSourceReaderEx_Release(reader_ex); + + IMFSourceReader_Release(reader); + IMFMediaSource_Release(source); + IMFStreamDescriptor_Release(video_stream); + + + /* test source reader with a H264 source */ + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, h264_stream_type_desc, -1); + hr = MFCreateStreamDescriptor(0, 1, &media_type, &video_stream); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + source = create_test_source(&video_stream, 1); + ok(!!source, "Failed to create test source.\n"); + + hr = MFCreateSourceReaderFromMediaSource(source, attributes, &reader); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFSourceReader_GetNativeMediaType(reader, 0, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* when H264 output is used, there's no decoder transform */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + + /* H264 -> RGB32 conversion with MF_SOURCE_READER_ENABLE_(ADVANCED_)VIDEO_PROCESSING */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, rgb32_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + if (enable_processing || enable_advanced) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, rgb32_expect_advanced_desc, -1); + else if (enable_processing) + check_media_type(media_type, rgb32_expect_desc, -1); + else + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* the exposed transform is the H264 decoder or the converter with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + if (!enable_processing && !enable_advanced) + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, nv12_stream_type_desc, -1); + else + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* with NV12 output */ + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (enable_advanced) + check_media_type(media_type, rgb32_stream_type_desc, -1); + else + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + /* H264 decoder transform is also available through the IMFSourceReaderEx interface */ + hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 0, &category, &transform); + if (!enable_processing && !enable_advanced) + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + /* the video processor can be accessed at index 1 with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING */ + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 1, &category, &transform); + if (!enable_advanced) + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, rgb32_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 2, &category, &transform); + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + IMFSourceReaderEx_Release(reader_ex); + + /* H264 -> NV12 conversion */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, nv12_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_expect_desc, -1); + IMFMediaType_Release(media_type); + + /* the H264 decoder transform can now be accessed */ + hr = IMFSourceReader_GetServiceForStream(reader, 0, &GUID_NULL, &IID_IMFTransform, (void **)&transform); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, nv12_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + + /* YUY2 output works too */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, yuy2_stream_type_desc, 2); /* doesn't need the frame size */ + hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, yuy2_expect_desc, -1); + IMFMediaType_Release(media_type); + + /* H264 decoder transform is also available through the IMFSourceReaderEx interface */ + hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 0, &category, &transform); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, h264_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, yuy2_stream_type_desc, -1); + IMFMediaType_Release(media_type); + + /* changing the transform media type doesn't change the reader output type */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + init_media_type(media_type, nv12_stream_type_desc, -1); + hr = IMFTransform_SetOutputType(transform, 0, media_type, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_media_type(media_type, yuy2_expect_desc, -1); + IMFMediaType_Release(media_type); + + IMFTransform_Release(transform); + } + + hr = IMFSourceReaderEx_GetTransformForStream(reader_ex, 0, 1, &category, &transform); + todo_wine ok(hr == MF_E_INVALIDINDEX, "Unexpected hr %#lx.\n", hr); + IMFSourceReaderEx_Release(reader_ex); + +skip_tests: + IMFSourceReader_Release(reader); + IMFMediaSource_Release(source); + IMFStreamDescriptor_Release(video_stream); + + IMFAttributes_Release(attributes); + + winetest_pop_context(); } START_TEST(mfplat) @@ -1545,6 +2252,9 @@ START_TEST(mfplat) test_source_reader("test.wav", false); test_source_reader("test.mp4", true); test_source_reader_from_media_source(); + test_source_reader_transforms(FALSE, FALSE); + test_source_reader_transforms(TRUE, FALSE); + test_source_reader_transforms(FALSE, TRUE); test_reader_d3d9(); test_sink_writer_create(); test_sink_writer_mp4(); diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index f424c87b860..c7e7f360f0b 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -44,6 +44,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang); #include "initguid.h" +static INIT_ONCE font_link_global_init_once = INIT_ONCE_STATIC_INIT; +static IUnknown *font_link_global = NULL; + static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj); static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj); static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum); @@ -3333,23 +3336,20 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* iface, for (i = 0; i < src_len; i++) { - DWORD cp, next_cp = 0; + DWORD cp = 0; HRESULT ret; ret = IMLangFontLink2_GetCharCodePages(iface, src[i], &cp); - if (i + 1 < src_len) - ret = IMLangFontLink2_GetCharCodePages(iface, src[i + 1], &next_cp); if (ret != S_OK) return E_FAIL; if (!cps) cps = cp; - else if ((cps & cp) != 0) cps &= cp; + else if ((cps & cp) != 0 && + !((priority_cp & cps) ^ (priority_cp & cp))) cps &= cp; else { i--; break; } - - if ((priority_cp & cps) && !(priority_cp & next_cp)) break; } if (codepages) *codepages = cps; @@ -3882,11 +3882,25 @@ HRESULT WINAPI DllCanUnloadNow(void) return dll_count == 0 ? S_OK : S_FALSE; } +static BOOL WINAPI allocate_font_link_cb(PINIT_ONCE init_once, PVOID args, PVOID *context) +{ + return SUCCEEDED(MultiLanguage_create(NULL, (void**)&font_link_global)); +} + HRESULT WINAPI GetGlobalFontLinkObject(void **unknown) { + TRACE("%p\n", unknown); + if (!unknown) return E_INVALIDARG; - FIXME("%p: stub\n", unknown); + if (!InitOnceExecuteOnce(&font_link_global_init_once, allocate_font_link_cb, NULL, NULL)) + { + ERR("Failed to create global font link object.\n"); + return E_FAIL; + } - return S_FALSE; + IUnknown_AddRef(font_link_global); + *unknown = font_link_global; + + return S_OK; } diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index ee5ef5af738..6bb973dc285 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -1324,6 +1324,14 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL) ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages); ok(processed == 2, "expected 2, got %ld\n", processed); + dwCmpCodePages = FS_JISJAPAN; + dwCodePages = 0; + processed = 0; + ret = IMLangFontLink_GetStrCodePages(iMLFL, L"\uff90a", 2, FS_LATIN1, &dwCodePages, &processed); + ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %lx\n", ret); + ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages); + ok(processed == 1, "expected 1, got %ld\n", processed); + dwCodePages = 0xffff; processed = -1; ret = IMLangFontLink_GetStrCodePages(iMLFL, &str[2], 1, 0, &dwCodePages, &processed); @@ -2295,17 +2303,41 @@ static void test_GetGlobalFontLinkObject(void) { HRESULT ret; void *unknown; + LONG refcount; + IMLangFontLink2 *IMLFL2; + IMLangFontLink *IMLFL; + IMLangCodePages *IMLCP; + IMultiLanguage *IML; ret = GetGlobalFontLinkObject(NULL); ok(ret == E_INVALIDARG, "expected E_INVALIDARG got %#lx\n", ret); unknown = (void *)0xdeadbeef; ret = GetGlobalFontLinkObject(&unknown); -todo_wine { ok(ret == S_OK, "expected S_OK got %#lx\n", ret); ok(unknown != NULL && unknown != (void *)0xdeadbeef, "GetGlobalFontLinkObject() returned %p\n", unknown); - } + if (unknown == (void *)0xdeadbeef || !unknown) return; + + ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink2, (void**)&IMLFL2); + todo_wine ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret); + if (ret == S_OK) IMLangFontLink2_Release(IMLFL2); + + ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMultiLanguage, (void**)&IML); + todo_wine ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret); + if (ret == S_OK) IMultiLanguage_Release(IML); + + ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink, (void**)&IMLFL); + ok(ret == S_OK, "expected S_OK got %#lx\n", ret); + IMLangFontLink_Release(IMLFL); + + ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangCodePages, (void**)&IMLCP); + ok(ret == S_OK, "expected S_OK got %#lx\n", ret); + IMLangCodePages_Release(IMLCP); + + + refcount = IUnknown_Release((IUnknown*)unknown); + ok(refcount == 1, "Got refcount %ld\n", refcount); } static void test_IMLangConvertCharset(IMultiLanguage *ml) @@ -2778,6 +2810,8 @@ START_TEST(mlang) if (!init_function_ptrs()) return; + test_GetGlobalFontLinkObject(); + CoInitialize(NULL); test_Rfc1766ToLcid(); test_LcidToRfc1766(); @@ -2785,8 +2819,6 @@ START_TEST(mlang) test_ConvertINetUnicodeToMultiByte(); test_JapaneseConversion(); - test_GetGlobalFontLinkObject(); - trace("IMultiLanguage\n"); ret = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, &IID_IMultiLanguage, (void **)&iML); diff --git a/dlls/mmdevapi/client.c b/dlls/mmdevapi/client.c index 3e0c70a44f4..0adb8bc5aa1 100644 --- a/dlls/mmdevapi/client.c +++ b/dlls/mmdevapi/client.c @@ -89,6 +89,11 @@ static inline struct audio_client *impl_from_IAudioClock2(IAudioClock2 *iface) return CONTAINING_RECORD(iface, struct audio_client, IAudioClock2_iface); } +static inline ACImpl *impl_from_IAudioClockAdjustment(IAudioClockAdjustment *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioClockAdjustment_iface); +} + static inline struct audio_client *impl_from_IAudioRenderClient(IAudioRenderClient *iface) { return CONTAINING_RECORD(iface, struct audio_client, IAudioRenderClient_iface); @@ -407,6 +412,8 @@ const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl = static HRESULT WINAPI client_QueryInterface(IAudioClient3 *iface, REFIID riid, void **ppv) { + struct audio_client *This = impl_from_IAudioClient3(iface); + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); if (!ppv) @@ -417,6 +424,8 @@ static HRESULT WINAPI client_QueryInterface(IAudioClient3 *iface, REFIID riid, v IsEqualIID(riid, &IID_IAudioClient2) || IsEqualIID(riid, &IID_IAudioClient3)) *ppv = iface; + else if (IsEqualIID(riid, &IID_IAudioClockAdjustment)) + *ppv = &This->IAudioClockAdjustment_iface; else if(IsEqualIID(riid, &IID_IMarshal)) { struct audio_client *This = impl_from_IAudioClient3(iface); return IUnknown_QueryInterface(This->marshal, riid, ppv); @@ -1131,6 +1140,52 @@ const IAudioClock2Vtbl AudioClock2_Vtbl = clock2_GetDevicePosition }; +static HRESULT WINAPI AudioClockAdjustment_QueryInterface(IAudioClockAdjustment *iface, + REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioClockAdjustment(iface); + return IAudioClock_QueryInterface(&This->IAudioClock_iface, riid, ppv); +} + +static ULONG WINAPI AudioClockAdjustment_AddRef(IAudioClockAdjustment *iface) +{ + ACImpl *This = impl_from_IAudioClockAdjustment(iface); + return IAudioClient_AddRef((IAudioClient *)&This->IAudioClient3_iface); +} + +static ULONG WINAPI AudioClockAdjustment_Release(IAudioClockAdjustment *iface) +{ + ACImpl *This = impl_from_IAudioClockAdjustment(iface); + return IAudioClient_Release((IAudioClient *)&This->IAudioClient3_iface); +} + +static HRESULT WINAPI AudioClockAdjustment_SetSampleRate(IAudioClockAdjustment *iface, + float new_rate) +{ + ACImpl *This = impl_from_IAudioClockAdjustment(iface); + struct set_sample_rate_params params; + + TRACE("(%p)->(%f)\n", This, new_rate); + + if (!This->stream) + return AUDCLNT_E_NOT_INITIALIZED; + + params.stream = This->stream; + params.new_rate = new_rate; + + wine_unix_call(set_sample_rate, ¶ms); + + return params.result; +} + +const IAudioClockAdjustmentVtbl AudioClockAdjustment_Vtbl = +{ + AudioClockAdjustment_QueryInterface, + AudioClockAdjustment_AddRef, + AudioClockAdjustment_Release, + AudioClockAdjustment_SetSampleRate +}; + static HRESULT WINAPI render_QueryInterface(IAudioRenderClient *iface, REFIID riid, void **ppv) { struct audio_client *This = impl_from_IAudioRenderClient(iface); @@ -1417,6 +1472,7 @@ HRESULT AudioClient_Create(GUID *guid, IMMDevice *device, IAudioClient **out) This->IAudioClient3_iface.lpVtbl = &AudioClient3_Vtbl; This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl; This->IAudioClock2_iface.lpVtbl = &AudioClock2_Vtbl; + This->IAudioClockAdjustment_iface.lpVtbl = &AudioClockAdjustment_Vtbl; This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl; This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl; diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index 246625286b8..daafb4a822e 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -497,6 +497,7 @@ static HRESULT set_format(MMDevice *dev) HRESULT hr; IAudioClient *client; WAVEFORMATEX *fmt; + WAVEFORMATEXTENSIBLE *fmtex; PROPVARIANT pv = { VT_EMPTY }; hr = AudioClient_Create(&dev->devguid, &dev->IMMDevice_iface, &client); @@ -511,6 +512,24 @@ static HRESULT set_format(MMDevice *dev) IAudioClient_Release(client); + /* for most devices, native Windows only allows PCM formats for + * DeviceFormat. GetMixFormat often returns float. */ + if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ + fmtex = (WAVEFORMATEXTENSIBLE *)fmt; + if(IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)){ + fmt->wBitsPerSample = 16; + fmt->nBlockAlign = fmt->wBitsPerSample * fmt->nChannels / 8; + fmt->nAvgBytesPerSec = fmt->nSamplesPerSec * fmt->nBlockAlign; + fmtex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + fmtex->Samples.wValidBitsPerSample = fmt->wBitsPerSample; + } + }else if(fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT){ + fmt->wFormatTag = WAVE_FORMAT_PCM; + fmt->wBitsPerSample = 16; + fmt->nBlockAlign = fmt->wBitsPerSample * fmt->nChannels / 8; + fmt->nAvgBytesPerSec = fmt->nSamplesPerSec * fmt->nBlockAlign; + } + pv.vt = VT_BLOB; pv.blob.cbSize = sizeof(WAVEFORMATEX) + fmt->cbSize; pv.blob.pBlobData = (BYTE*)fmt; diff --git a/dlls/mmdevapi/mmdevdrv.h b/dlls/mmdevapi/mmdevdrv.h index df21859cbad..004de87f11c 100644 --- a/dlls/mmdevapi/mmdevdrv.h +++ b/dlls/mmdevapi/mmdevdrv.h @@ -60,6 +60,7 @@ struct audio_client { IAudioCaptureClient IAudioCaptureClient_iface; IAudioClock IAudioClock_iface; IAudioClock2 IAudioClock2_iface; + IAudioClockAdjustment IAudioClockAdjustment_iface; IAudioStreamVolume IAudioStreamVolume_iface; LONG ref; diff --git a/dlls/mmdevapi/spatialaudio.c b/dlls/mmdevapi/spatialaudio.c index 23f3de31428..bc1b085f3cd 100644 --- a/dlls/mmdevapi/spatialaudio.c +++ b/dlls/mmdevapi/spatialaudio.c @@ -49,6 +49,36 @@ static UINT32 AudioObjectType_to_index(AudioObjectType type) return o - 2; } +static const char *debugstr_fmtex(const WAVEFORMATEX *fmt) +{ + static char buf[2048]; + + if (!fmt) + { + strcpy(buf, "(null)"); + } + else if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + { + const WAVEFORMATEXTENSIBLE *fmtex = (const WAVEFORMATEXTENSIBLE *)fmt; + snprintf(buf, sizeof(buf), "tag: 0x%x (%s), ch: %u (mask: 0x%lx), rate: %lu, depth: %u", + fmt->wFormatTag, debugstr_guid(&fmtex->SubFormat), + fmt->nChannels, fmtex->dwChannelMask, fmt->nSamplesPerSec, + fmt->wBitsPerSample); + } + else + { + snprintf(buf, sizeof(buf), "tag: 0x%x, ch: %u, rate: %lu, depth: %u", + fmt->wFormatTag, fmt->nChannels, fmt->nSamplesPerSec, + fmt->wBitsPerSample); + } + return buf; +} + +static BOOL formats_equal(const WAVEFORMATEX *fmt1, const WAVEFORMATEX *fmt2) +{ + return !memcmp(fmt1, fmt2, sizeof(*fmt1) + fmt1->cbSize); +} + typedef struct SpatialAudioImpl SpatialAudioImpl; typedef struct SpatialAudioStreamImpl SpatialAudioStreamImpl; typedef struct SpatialAudioObjectImpl SpatialAudioObjectImpl; @@ -610,9 +640,20 @@ static HRESULT WINAPI SAC_GetMaxFrameCount(ISpatialAudioClient *iface, static HRESULT WINAPI SAC_IsAudioObjectFormatSupported(ISpatialAudioClient *iface, const WAVEFORMATEX *format) { - SpatialAudioImpl *This = impl_from_ISpatialAudioClient(iface); - FIXME("(%p)->(%p)\n", This, format); - return E_NOTIMPL; + SpatialAudioImpl *sac = impl_from_ISpatialAudioClient(iface); + + TRACE("sac %p, format %s.\n", sac, debugstr_fmtex(format)); + + if (!format) + return E_POINTER; + + if (!formats_equal(&sac->object_fmtex.Format, format)) + { + FIXME("Reporting format %s as unsupported.\n", debugstr_fmtex(format)); + return E_INVALIDARG; + } + + return S_OK; } static HRESULT WINAPI SAC_IsSpatialAudioStreamAvailable(ISpatialAudioClient *iface, @@ -630,23 +671,6 @@ static WAVEFORMATEX *clone_fmtex(const WAVEFORMATEX *src) return r; } -static const char *debugstr_fmtex(const WAVEFORMATEX *fmt) -{ - static char buf[2048]; - if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ - const WAVEFORMATEXTENSIBLE *fmtex = (const WAVEFORMATEXTENSIBLE *)fmt; - snprintf(buf, sizeof(buf), "tag: 0x%x (%s), ch: %u (mask: 0x%lx), rate: %lu, depth: %u", - fmt->wFormatTag, debugstr_guid(&fmtex->SubFormat), - fmt->nChannels, fmtex->dwChannelMask, fmt->nSamplesPerSec, - fmt->wBitsPerSample); - }else{ - snprintf(buf, sizeof(buf), "tag: 0x%x, ch: %u, rate: %lu, depth: %u", - fmt->wFormatTag, fmt->nChannels, fmt->nSamplesPerSec, - fmt->wBitsPerSample); - } - return buf; -} - static void static_mask_to_channels(AudioObjectType static_mask, WORD *count, DWORD *mask, UINT32 *map) { UINT32 out_chan = 0, map_idx = 0; @@ -776,8 +800,7 @@ static HRESULT WINAPI SAC_ActivateSpatialAudioStream(ISpatialAudioClient *iface, return E_INVALIDARG; } - if(!params->ObjectFormat || - memcmp(params->ObjectFormat, &This->object_fmtex.Format, sizeof(*params->ObjectFormat) + params->ObjectFormat->cbSize)){ + if(!(params->ObjectFormat && formats_equal(params->ObjectFormat, &This->object_fmtex.Format))) { *stream = NULL; return AUDCLNT_E_UNSUPPORTED_FORMAT; } diff --git a/dlls/mmdevapi/tests/spatialaudio.c b/dlls/mmdevapi/tests/spatialaudio.c index a382b57e7a2..4d8073d49ce 100644 --- a/dlls/mmdevapi/tests/spatialaudio.c +++ b/dlls/mmdevapi/tests/spatialaudio.c @@ -64,6 +64,27 @@ static void test_formats(void) ok(fmt->nAvgBytesPerSec == 192000, "Wrong avg bytes per sec, expected 192000 got %lu\n", fmt->nAvgBytesPerSec); ok(fmt->cbSize == 0, "Wrong cbSize for simple format, expected 0, got %hu\n", fmt->cbSize); + hr = ISpatialAudioClient_IsAudioObjectFormatSupported(sac, NULL); + ok(hr == E_POINTER, "Got %#lx.\n", hr); + + memcpy(&format, fmt, sizeof(format)); + hr = ISpatialAudioClient_IsAudioObjectFormatSupported(sac, &format); + ok(hr == S_OK, "Got %#lx.\n", hr); + + format.nBlockAlign *= 2; + hr = ISpatialAudioClient_IsAudioObjectFormatSupported(sac, &format); + todo_wine ok(hr == S_OK, "Got %#lx.\n", hr); + + memcpy(&format, fmt, sizeof(format)); + format.wBitsPerSample *= 2; + hr = ISpatialAudioClient_IsAudioObjectFormatSupported(sac, &format); + ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); + + memcpy(&format, fmt, sizeof(format)); + format.nChannels = 2; + hr = ISpatialAudioClient_IsAudioObjectFormatSupported(sac, &format); + ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); + memcpy(&format, fmt, sizeof(format)); IAudioFormatEnumerator_Release(afe); diff --git a/dlls/mmdevapi/unixlib.h b/dlls/mmdevapi/unixlib.h index d83ed918a51..2b29f6441ce 100644 --- a/dlls/mmdevapi/unixlib.h +++ b/dlls/mmdevapi/unixlib.h @@ -216,6 +216,13 @@ struct set_event_handle_params HRESULT result; }; +struct set_sample_rate_params +{ + stream_handle stream; + float new_rate; + HRESULT result; +}; + struct test_connect_params { const WCHAR *name; @@ -323,6 +330,7 @@ enum unix_funcs get_position, set_volumes, set_event_handle, + set_sample_rate, test_connect, is_started, get_prop_value, diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index ad3c034fe0f..05dbaf9f7d2 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -609,6 +609,27 @@ static DWORD WINAPI run_loop_thread( void *arg ) return MOUNTMGR_CALL( run_loop, ¶ms ); } +static DWORD WINAPI registry_flush_thread( void *arg ) +{ + UNICODE_STRING name = RTL_CONSTANT_STRING( L"\\Registry" ); + OBJECT_ATTRIBUTES attr; + HANDLE root; + + InitializeObjectAttributes( &attr, &name, 0, 0, NULL ); + if (NtOpenKeyEx( &root, MAXIMUM_ALLOWED, &attr, 0 )) + { + ERR( "Failed opening root registry key.\n" ); + return 0; + } + + for (;;) + { + Sleep( 30000 ); + if (NtFlushKey( root )) ERR( "Failed flushing registry.\n" ); + } + + return 0; +} /* main entry point for the mount point manager driver */ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) @@ -652,6 +673,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL ); CloseHandle( CreateThread( NULL, 0, run_loop_thread, thread, 0, NULL )); + CloseHandle( CreateThread( NULL, 0, registry_flush_thread, thread, 0, NULL )); #ifdef _WIN64 /* create a symlink so that the Wine port overrides key can be edited with 32-bit reg or regedit */ diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c index c8d384730c0..f931473de7a 100644 --- a/dlls/mscoree/corruntimehost.c +++ b/dlls/mscoree/corruntimehost.c @@ -814,8 +814,12 @@ static ULONG WINAPI CLRRuntimeHost_Release(ICLRRuntimeHost* iface) static HRESULT WINAPI CLRRuntimeHost_Start(ICLRRuntimeHost* iface) { - FIXME("(%p)\n", iface); - return E_NOTIMPL; + RuntimeHost *This = impl_from_ICLRRuntimeHost( iface ); + MonoDomain *dummy; + + TRACE("%p\n", This); + + return RuntimeHost_GetDefaultDomain(This, NULL, &dummy); } static HRESULT WINAPI CLRRuntimeHost_Stop(ICLRRuntimeHost* iface) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index bb7e10ca0bf..21c1b07dde5 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1723,6 +1723,44 @@ static MonoAssembly* mono_assembly_try_load(WCHAR *path) return result; } +static BOOL compile_assembly(const char *source, const char *target, char *target_path, DWORD target_path_len) +{ + static const char *csc = "C:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe"; + char cmdline[2 * MAX_PATH + 74], tmp[MAX_PATH], tmpdir[MAX_PATH], source_path[MAX_PATH]; + STARTUPINFOA si = {.cb = sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION pi; + HANDLE file; + DWORD size; + BOOL ret; + LUID id; + + if (!PathFileExistsA(csc)) return FALSE; + if (!AllocateLocallyUniqueId(&id)) return FALSE; + + GetTempPathA(MAX_PATH, tmp); + if (!GetTempFileNameA(tmp, "assembly", id.LowPart, tmpdir)) return FALSE; + if (!CreateDirectoryA(tmpdir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) return FALSE; + + snprintf(source_path, MAX_PATH, "%s\\source.cs", tmpdir); + snprintf(target_path, target_path_len, "%s\\%s", tmpdir, target); + + file = CreateFileA(source_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (file == INVALID_HANDLE_VALUE) return FALSE; + ret = WriteFile(file, source, strlen(source), &size, NULL); + CloseHandle(file); + if (!ret) return FALSE; + + snprintf(cmdline, ARRAY_SIZE(cmdline), "%s /t:library /out:\"%s\" \"%s\"", csc, target_path, source_path); + ret = CreateProcessA(csc, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + if (!ret) return FALSE; + + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + return PathFileExistsA(target_path); +} + static MonoAssembly* CDECL mono_assembly_preload_hook_fn(MonoAssemblyName *aname, char **assemblies_path, void *user_data) { int flags = 0; @@ -1755,6 +1793,8 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam static const WCHAR dotdllW[] = {'.','d','l','l',0}; static const WCHAR dotexeW[] = {'.','e','x','e',0}; + const char *sgi = getenv("SteamGameId"); + stringname = mono_stringify_assembly_name(aname); assemblyname = mono_assembly_name_get_name(aname); culture = mono_assembly_name_get_culture(aname); @@ -1811,6 +1851,90 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam } } + if (!strcmp(assemblyname, "ManagedStarter")) + { + /* HACK for Mount & Blade II: Bannerlord + * + * The launcher executable uses an AssemblyResolve event handler + * to redirect loads of the "ManagedStarter" assembly to + * Bannerlord.exe. Due to Mono issue #11319, the runtime attempts + * to load ManagedStarter before executing the static constructor + * that adds this event handler. We work around this by doing the + * same thing in our own assembly load hook. */ + if (sgi && !strcmp(sgi, "261550")) + { + FIXME("hack, using Bannerlord.exe\n"); + + result = mono_assembly_open("Bannerlord.exe", &stat); + + if (result) + goto done; + else + ERR("Bannerlord.exe failed to load\n"); + } + } + + /* HACK for games which reference a type from a non-existing DLL. + * Native .NET framework normally gets away with it but Mono cannot + * due to some deeply rooted differences. */ + if (sgi) + { + size_t i; + + static const struct { + const char *assembly_name; + const char *module_name; + const char *appid; + const char *source; + } assembly_hacks[] = { + { + "CameraQuakeViewer", + "CameraQuakeViewer.dll", + "527280", /* Nights of Azure */ + "namespace CQViewer { class CQMgr {} }" + }, + { + "UnrealEdCSharp", + "UnrealEdCSharp.dll", + "317940", /* Karmaflow */ + "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " + }, + { + "UnrealEdCSharp", + "UnrealEdCSharp.dll", + "321360", /* Primal Carnage: Extinction */ + "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " + }, + { + "DockPanel", + "DockPanel.dll", + "46450", /* Grotesque Tactics: Evil Heroes */ + "namespace WeifenLuo.WinFormsUI { class DockPanel {} }" + }, + }; + + for (i = 0; i < ARRAY_SIZE(assembly_hacks); ++i) + { + if (!strcmp(assemblyname, assembly_hacks[i].assembly_name) && + !strcmp(sgi, assembly_hacks[i].appid)) + { + char assembly_path[MAX_PATH]; + + FIXME("HACK: Building %s\n", assembly_hacks[i].module_name); + + if (compile_assembly(assembly_hacks[i].source, assembly_hacks[i].module_name, assembly_path, MAX_PATH)) + result = mono_assembly_open(assembly_path, &stat); + else + ERR("HACK: Failed to build %s\n", assembly_hacks[i].assembly_name); + + if (result) + goto done; + + ERR("HACK: Failed to load %s\n", assembly_hacks[i].assembly_name); + } + } + } + if ((search_flags & ASSEMBLY_SEARCH_GAC) != 0) { stringnameW_size = MultiByteToWideChar(CP_UTF8, 0, stringname, -1, NULL, 0); diff --git a/dlls/mscoree/mscoree_private.h b/dlls/mscoree/mscoree_private.h index 06db53136e1..f27ff95be2d 100644 --- a/dlls/mscoree/mscoree_private.h +++ b/dlls/mscoree/mscoree_private.h @@ -45,7 +45,7 @@ extern HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version); extern HRESULT assembly_get_vtable_fixups(ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count); extern HRESULT assembly_get_native_entrypoint(ASSEMBLY *assembly, NativeEntryPointFunc *func); -#define WINE_MONO_VERSION "8.1.0" +#define WINE_MONO_VERSION "9.0.0" /* Mono embedding */ typedef struct _MonoDomain MonoDomain; diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c index e2dde836b12..a79a32afc02 100644 --- a/dlls/msctf/msctf.c +++ b/dlls/msctf/msctf.c @@ -67,7 +67,6 @@ static UINT array_size; static struct list AtsList = LIST_INIT(AtsList); static UINT activated = 0; -DWORD tlsIndex = 0; TfClientId processId = 0; ITfCompartmentMgr *globalCompartmentMgr = NULL; @@ -394,23 +393,19 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp) ActivatedTextService *actsvr; ITfCategoryMgr *catmgr; AtsEntry *entry; - ITfThreadMgrEx *tm = TlsGetValue(tlsIndex); + ITfThreadMgr *tm; ITfClientId *clientid; - if (!tm) return E_UNEXPECTED; + if (FAILED(TF_GetThreadMgr(&tm))) return E_UNEXPECTED; actsvr = malloc(sizeof(ActivatedTextService)); - if (!actsvr) return E_OUTOFMEMORY; + if (!actsvr) goto fail; - ITfThreadMgrEx_QueryInterface(tm, &IID_ITfClientId, (void **)&clientid); + ITfThreadMgr_QueryInterface(tm, &IID_ITfClientId, (void **)&clientid); ITfClientId_GetClientId(clientid, &lp->clsid, &actsvr->tid); ITfClientId_Release(clientid); - if (!actsvr->tid) - { - free(actsvr); - return E_OUTOFMEMORY; - } + if (!actsvr->tid) goto fail; actsvr->pITfTextInputProcessor = NULL; actsvr->LanguageProfile = *lp; @@ -437,20 +432,21 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp) deactivate_remove_conflicting_ts(&actsvr->LanguageProfile.catid); if (activated > 0) - activate_given_ts(actsvr, tm); + activate_given_ts(actsvr, (ITfThreadMgrEx *)tm); entry = malloc(sizeof(AtsEntry)); - - if (!entry) - { - free(actsvr); - return E_OUTOFMEMORY; - } + if (!entry) goto fail; entry->ats = actsvr; list_add_head(&AtsList, &entry->entry); + ITfThreadMgr_Release(tm); return S_OK; + +fail: + ITfThreadMgr_Release(tm); + free(actsvr); + return E_OUTOFMEMORY; } BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *profile) @@ -554,11 +550,9 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad) switch (fdwReason) { case DLL_PROCESS_ATTACH: - tlsIndex = TlsAlloc(); break; case DLL_PROCESS_DETACH: if (fImpLoad) break; - TlsFree(tlsIndex); break; } return TRUE; @@ -592,20 +586,6 @@ HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim) return ThreadMgr_Constructor(NULL,(IUnknown**)pptim); } -/*********************************************************************** - * TF_GetThreadMgr (MSCTF.@) - */ -HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim) -{ - TRACE("\n"); - *pptim = TlsGetValue(tlsIndex); - - if (*pptim) - ITfThreadMgr_AddRef(*pptim); - - return S_OK; -} - /*********************************************************************** * SetInputScope(MSCTF.@) */ diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index 24c8c017ff3..3696edf5500 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -36,7 +36,6 @@ #define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK 0x00b0 #define COOKIE_MAGIC_ACTIVELANGSINK 0x00c0 -extern DWORD tlsIndex; extern TfClientId processId; extern ITfCompartmentMgr *globalCompartmentMgr; diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 11c79c030ff..ff2b0b95ff7 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -37,6 +37,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); +static CRITICAL_SECTION ThreadMgrCs; +static CRITICAL_SECTION_DEBUG ThreadMgrCsDebug = +{ + 0, 0, &ThreadMgrCs, + {&ThreadMgrCsDebug.ProcessLocksList, + &ThreadMgrCsDebug.ProcessLocksList }, + 0, 0, {(DWORD_PTR)(__FILE__ ": ThreadMgrCs")} +}; +static CRITICAL_SECTION ThreadMgrCs = {&ThreadMgrCsDebug, -1, 0, 0, 0, 0}; +struct list ThreadMgrList = LIST_INIT(ThreadMgrList); + typedef struct tagPreservedKey { struct list entry; @@ -98,6 +109,9 @@ typedef struct tagACLMulti { struct list ThreadMgrEventSink; struct list UIElementSink; struct list InputProcessorProfileActivationSink; + + DWORD threadId; + struct list entry; } ThreadMgr; typedef struct tagEnumTfDocumentMgr { @@ -110,6 +124,11 @@ typedef struct tagEnumTfDocumentMgr { static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut); +static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface) +{ + return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface); +} + static inline ThreadMgr *impl_from_ITfThreadMgrEx(ITfThreadMgrEx *iface) { return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface); @@ -155,6 +174,35 @@ static inline EnumTfDocumentMgr *impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMg return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface); } +/*********************************************************************** + * TF_GetThreadMgr (MSCTF.@) + */ +HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim) +{ + DWORD id = GetCurrentThreadId(); + ThreadMgr *cursor; + + TRACE("%p\n", pptim); + + if (!pptim) + return E_INVALIDARG; + + EnterCriticalSection(&ThreadMgrCs); + LIST_FOR_EACH_ENTRY(cursor, &ThreadMgrList, ThreadMgr, entry) + { + if (cursor->threadId == id) + { + ITfThreadMgrEx_AddRef(&cursor->ITfThreadMgrEx_iface); + *pptim = (ITfThreadMgr *)&cursor->ITfThreadMgrEx_iface; + LeaveCriticalSection(&ThreadMgrCs); + return S_OK; + } + } + LeaveCriticalSection(&ThreadMgrCs); + *pptim = NULL; + return E_FAIL; +} + static void ThreadMgr_Destructor(ThreadMgr *This) { struct list *cursor, *cursor2; @@ -163,7 +211,9 @@ static void ThreadMgr_Destructor(ThreadMgr *This) if (This->focusHook) UnhookWindowsHookEx(This->focusHook); - TlsSetValue(tlsIndex,NULL); + EnterCriticalSection(&ThreadMgrCs); + list_remove(&This->entry); + LeaveCriticalSection(&ThreadMgrCs); TRACE("destroying %p\n", This); if (This->focus) ITfDocumentMgr_Release(This->focus); @@ -386,17 +436,20 @@ static HRESULT WINAPI ThreadMgr_SetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr * static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam) { + ITfThreadMgr *ThreadMgr_iface; ThreadMgr *This; - This = TlsGetValue(tlsIndex); - if (!This) + if (FAILED(TF_GetThreadMgr(&ThreadMgr_iface))) { ERR("Hook proc but no ThreadMgr for this thread. Serious Error\n"); return 0; } + + This = impl_from_ITfThreadMgr(ThreadMgr_iface); if (!This->focusHook) { ERR("Hook proc but no ThreadMgr focus Hook. Serious Error\n"); + ITfThreadMgr_Release(ThreadMgr_iface); return 0; } @@ -417,6 +470,7 @@ static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lPa } } + ITfThreadMgr_Release(ThreadMgr_iface); return CallNextHookEx(This->focusHook, nCode, wParam, lParam); } @@ -1346,13 +1400,8 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) return CLASS_E_NOAGGREGATION; /* Only 1 ThreadMgr is created per thread */ - This = TlsGetValue(tlsIndex); - if (This) - { - ThreadMgr_AddRef(&This->ITfThreadMgrEx_iface); - *ppOut = (IUnknown*)&This->ITfThreadMgrEx_iface; + if (SUCCEEDED(TF_GetThreadMgr((ITfThreadMgr **)ppOut))) return S_OK; - } This = calloc(1, sizeof(ThreadMgr)); if (This == NULL) @@ -1367,7 +1416,6 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl; This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl; This->refCount = 1; - TlsSetValue(tlsIndex,This); CompartmentMgr_Constructor((IUnknown*)&This->ITfThreadMgrEx_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); @@ -1384,6 +1432,11 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) list_init(&This->UIElementSink); list_init(&This->InputProcessorProfileActivationSink); + This->threadId = GetCurrentThreadId(); + EnterCriticalSection(&ThreadMgrCs); + list_add_tail(&ThreadMgrList, &This->entry); + LeaveCriticalSection(&ThreadMgrCs); + TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface; return S_OK; diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index 1e509a62e85..66c9f5ef1aa 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -3,6 +3,8 @@ IMPORTLIB = mshtml IMPORTS = strmiids uuid urlmon shlwapi shell32 ole32 oleaut32 user32 gdi32 advapi32 DELAYIMPORTS = wininet inetcomm +EXTRA_CFLAGS = $(MSHTML_CFLAGS) + SOURCES = \ conpoint.c \ dispex.c \ diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 07c26e2e762..624ee8e8c15 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -23,6 +23,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h" #include "mscoree.h" #include "wine/debug.h" @@ -84,8 +85,17 @@ typedef struct { DWORD flags; } dynamic_prop_t; +struct proxy_prototype { + DispatchEx dispex; +}; + +struct proxy_ctor { + DispatchEx dispex; +}; + #define DYNPROP_DELETED 0x01 #define DYNPROP_HIDDEN 0x02 +#define DYNPROP_PROTREF 0x04 /* V_VT(var) == VT_EMPTY and V_UI4(var) == the ref */ typedef struct { DispatchEx dispex; @@ -93,6 +103,11 @@ typedef struct { func_info_t *info; } func_disp_t; +typedef struct { + DispatchEx dispex; + DWORD idx; /* index into function_props */ +} func_prop_disp_t; + typedef struct { func_disp_t *func_obj; VARIANT val; @@ -124,6 +139,95 @@ PRIVATE_TID_LIST #undef XDIID }; +static const dispex_static_data_vtbl_t proxy_prototype_dispex_vtbl; +static void proxy_prototype_init_dispex_info(dispex_data_t*,compat_mode_t); +const dispex_static_data_vtbl_t no_dispex_vtbl = { 0 }; +const tid_t no_iface_tids[1] = { 0 }; + +static struct prototype_static_data { + dispex_static_data_t dispex; + dispex_static_data_t *desc; +} prototype_static_data[] = { +#define X(id, name, dispex, proto_id) \ +{ \ + { \ + name "Prototype", \ + &proxy_prototype_dispex_vtbl, \ + PROTO_ID_ ## proto_id, \ + NULL_tid, \ + no_iface_tids, \ + proxy_prototype_init_dispex_info \ + }, \ + &dispex \ +}, +LEGACY_PROTOTYPE_LIST +COMMON_PROTOTYPE_LIST +PROXY_PROTOTYPE_LIST +#undef X +}; + +static const char legacy_prototype_name[] = "legacy prototype"; +static void legacy_prototype_init_dispex_info(dispex_data_t*,compat_mode_t); +static const dispex_static_data_vtbl_t legacy_prototype_dispex_vtbl; + +static dispex_static_data_t legacy_prototype_dispex[] = { +#define X(id, name, dispex, proto_id) \ +{ \ + legacy_prototype_name, \ + &legacy_prototype_dispex_vtbl, \ + PROTO_ID_NULL, \ + NULL_tid, \ + no_iface_tids, \ + legacy_prototype_init_dispex_info \ +}, +LEGACY_PROTOTYPE_LIST +COMMON_PROTOTYPE_LIST +#undef X +}; + +static const dispex_static_data_vtbl_t proxy_ctor_dispex_vtbl; + +static dispex_static_data_t proxy_ctor_dispex[] = { +#define X(id, name, dispex, proto_id) \ +{ \ + name, \ + &proxy_ctor_dispex_vtbl, \ + PROTO_ID_Object, \ + NULL_tid, \ + no_iface_tids \ +}, +COMMON_PROTOTYPE_LIST +PROXY_PROTOTYPE_LIST +#undef X +}; + +static unsigned char proxy_ctor_mode_unavailable[PROTO_ID_TOTAL_COUNT - LEGACY_PROTOTYPE_COUNT] = { + [PROTO_ID_Console - LEGACY_PROTOTYPE_COUNT] = (1<dispex.info->desc, struct prototype_static_data, dispex)->desc; + return desc->info_cache[prot->dispex.info->compat_mode]; +} + +static HRESULT get_dynamic_prop(DispatchEx*,const WCHAR*,DWORD,dynamic_prop_t**); +static HRESULT invoke_builtin_function(IDispatch*,func_info_t*,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); +static inline BOOL is_legacy_prototype(IDispatch*); +static inline struct proxy_prototype *to_proxy_prototype(DispatchEx*); + static HRESULT load_typelib(void) { WCHAR module_path[MAX_PATH + 3]; @@ -427,6 +531,32 @@ static void add_func_info(dispex_data_t *data, tid_t tid, const FUNCDESC *desc, } } +static void copy_func_info(func_info_t *dst, func_info_t *src) +{ + unsigned i, argc = src->argc; + + *dst = *src; + dst->name = SysAllocString(src->name); + + if(src->arg_types) { + DWORD size = (argc + (src->prop_vt == VT_VOID ? 0 : 1)) * sizeof(*dst->arg_types); + dst->arg_types = malloc(size); + if(dst->arg_types) + memcpy(dst->arg_types, src->arg_types, size); + } + + if(src->arg_info) { + dst->arg_info = malloc(argc * sizeof(*dst->arg_info)); + if(dst->arg_info) { + for(i = 0; i < argc; i++) { + dst->arg_info[i].iid = src->arg_info[i].iid; + V_VT(&dst->arg_info[i].default_value) = VT_EMPTY; + VariantCopy(&dst->arg_info[i].default_value, &src->arg_info[i].default_value); + } + } + } +} + static HRESULT process_interface(dispex_data_t *data, tid_t tid, ITypeInfo *disp_typeinfo, const dispex_hook_t *hooks) { unsigned i = 7; /* skip IDispatch functions */ @@ -620,6 +750,23 @@ dispex_prop_type_t get_dispid_type(DISPID id) return DISPEXPROP_BUILTIN; } +BOOL is_custom_attribute(DispatchEx *dispex, const WCHAR *name) +{ + func_info_t **funcs = dispex->info->name_table; + DWORD i, a = 0, b = dispex->info->func_cnt; + int c; + + while(a < b) { + i = (a + b) / 2; + c = wcsicmp(funcs[i]->name, name); + if(!c) + return (funcs[i]->func_disp_idx >= 0); + if(c > 0) b = i; + else a = i + 1; + } + return TRUE; +} + static HRESULT variant_copy(VARIANT *dest, VARIANT *src) { if(V_VT(src) == VT_BSTR && !V_BSTR(src)) { @@ -631,6 +778,26 @@ static HRESULT variant_copy(VARIANT *dest, VARIANT *src) return VariantCopy(dest, src); } +static void fixup_prop_ref(DispatchEx *This, dynamic_prop_t *prop) +{ + dynamic_prop_t *prot_prop; + + if(prop->flags & DYNPROP_DELETED) { + if(!This->prototype || + FAILED(get_dynamic_prop(&This->prototype->dispex, prop->name, fdexNameCaseSensitive, &prot_prop))) + return; + if(!(prot_prop->flags & DYNPROP_DELETED)) { + prop->flags = DYNPROP_PROTREF; + V_UI4(&prop->var) = prot_prop - This->prototype->dispex.dynamic_data->props; + } + return; + } + + if((prop->flags & DYNPROP_PROTREF) && + (This->prototype->dispex.dynamic_data->props[V_UI4(&prop->var)].flags & DYNPROP_DELETED)) + prop->flags = DYNPROP_DELETED; +} + static inline dispex_dynamic_data_t *get_dynamic_data(DispatchEx *This) { if(This->dynamic_data) @@ -649,8 +816,8 @@ static inline dispex_dynamic_data_t *get_dynamic_data(DispatchEx *This) static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags, dynamic_prop_t **ret) { const BOOL alloc = flags & fdexNameEnsure; + dynamic_prop_t *prop, *prot_prop = NULL; dispex_dynamic_data_t *data; - dynamic_prop_t *prop; data = get_dynamic_data(This); if(!data) @@ -658,6 +825,7 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags for(prop = data->props; prop < data->props+data->prop_cnt; prop++) { if(flags & fdexNameCaseInsensitive ? !wcsicmp(prop->name, name) : !wcscmp(prop->name, name)) { + fixup_prop_ref(This, prop); if(prop->flags & DYNPROP_DELETED) { if(!alloc) return DISP_E_UNKNOWNNAME; @@ -668,7 +836,17 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags } } - if(!alloc) + if(This->prototype) { + HRESULT hres = get_dynamic_prop(&This->prototype->dispex, name, fdexNameCaseSensitive, &prot_prop); + if(hres != DISP_E_UNKNOWNNAME) { + if(FAILED(hres)) + return hres; + if(prot_prop->flags & DYNPROP_DELETED) + prot_prop = NULL; + } + } + + if(!alloc && !prot_prop) return DISP_E_UNKNOWNNAME; TRACE("creating dynamic prop %s\n", debugstr_w(name)); @@ -697,6 +875,10 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags VariantInit(&prop->var); prop->flags = 0; + if(prot_prop) { + prop->flags = DYNPROP_PROTREF; + V_UI4(&prop->var) = prot_prop - This->prototype->dispex.dynamic_data->props; + } data->prop_cnt++; *ret = prop; return S_OK; @@ -713,6 +895,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA if(alloc) prop->flags |= DYNPROP_HIDDEN; + prop->flags &= ~DYNPROP_PROTREF; *ret = &prop->var; return S_OK; } @@ -728,6 +911,7 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, BOOL hidden, DISPI if(hidden) prop->flags |= DYNPROP_HIDDEN; + prop->flags &= ~DYNPROP_PROTREF; *id = DISPID_DYNPROP_0 + (prop - This->dynamic_data->props); return S_OK; } @@ -737,9 +921,6 @@ static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS { HRESULT hres; - if(This->info->desc->vtbl->value) - return This->info->desc->vtbl->value(This, lcid, flags, params, res, ei, caller); - switch(flags) { case DISPATCH_PROPERTYGET: V_VT(res) = VT_BSTR; @@ -755,12 +936,11 @@ static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS return S_OK; } -static HRESULT typeinfo_invoke(DispatchEx *This, func_info_t *func, WORD flags, DISPPARAMS *dp, VARIANT *res, +static HRESULT typeinfo_invoke(IUnknown *iface, func_info_t *func, WORD flags, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei) { DISPPARAMS params = {dp->rgvarg, NULL, dp->cArgs, 0}; ITypeInfo *ti; - IUnknown *unk; UINT argerr=0; HRESULT hres; @@ -775,18 +955,240 @@ static HRESULT typeinfo_invoke(DispatchEx *This, func_info_t *func, WORD flags, return hres; } - hres = IDispatchEx_QueryInterface(&This->IDispatchEx_iface, tid_ids[func->tid], (void**)&unk); - if(FAILED(hres)) { - ERR("Could not get iface %s: %08lx\n", debugstr_mshtml_guid(tid_ids[func->tid]), hres); - return E_FAIL; + return ITypeInfo_Invoke(ti, iface, func->id, flags, ¶ms, res, ei, &argerr); +} + +static HRESULT get_disp_prop(IDispatch *disp, IDispatchEx *dispex, const WCHAR *name, LCID lcid, VARIANT *res, + EXCEPINFO *ei, IServiceProvider *caller) +{ + DISPPARAMS dp = { 0 }; + DISPID dispid; + HRESULT hres; + UINT err = 0; + BSTR bstr; + + if(!(bstr = SysAllocString(name))) + return E_OUTOFMEMORY; + + if(dispex) + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + else + hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, &bstr, 1, 0, &dispid); + SysFreeString(bstr); + if(FAILED(hres)) + return hres; + if(dispid == DISPID_UNKNOWN) + return DISP_E_UNKNOWNNAME; + + if(dispex) + hres = IDispatchEx_InvokeEx(dispex, dispid, lcid, DISPATCH_PROPERTYGET, &dp, res, ei, caller); + else + hres = IDispatch_Invoke(disp, dispid, &IID_NULL, lcid, DISPATCH_PROPERTYGET, &dp, res, ei, &err); + return hres; +} + +static HRESULT get_disp_prop_vt(IDispatch *disp, IDispatchEx *dispex, const WCHAR *name, LCID lcid, VARIANT *res, + VARTYPE vt, EXCEPINFO *ei, IServiceProvider *caller) +{ + HRESULT hres; + + hres = get_disp_prop(disp, dispex, name, lcid, res, ei, caller); + if(FAILED(hres)) + return hres; + if(V_VT(res) != vt) { + VARIANT tmp = *res; + hres = change_type(res, &tmp, vt, caller); + VariantClear(&tmp); + } + return hres; +} + +static HRESULT format_func_disp_string(const WCHAR *name, IServiceProvider *caller, VARIANT *res) +{ + unsigned name_len; + WCHAR *ptr; + BSTR str; + + static const WCHAR func_prefixW[] = + {'\n','f','u','n','c','t','i','o','n',' '}; + static const WCHAR func_suffixW[] = + {'(',')',' ','{','\n',' ',' ',' ',' ','[','n','a','t','i','v','e',' ','c','o','d','e',']','\n','}','\n'}; + + /* FIXME: This probably should be more generic. Also we should try to get IID_IActiveScriptSite and SID_GetCaller. */ + if(!caller) + return E_ACCESSDENIED; + + name_len = wcslen(name); + ptr = str = SysAllocStringLen(NULL, name_len + ARRAY_SIZE(func_prefixW) + ARRAY_SIZE(func_suffixW)); + if(!str) + return E_OUTOFMEMORY; + + memcpy(ptr, func_prefixW, sizeof(func_prefixW)); + ptr += ARRAY_SIZE(func_prefixW); + + memcpy(ptr, name, name_len * sizeof(WCHAR)); + ptr += name_len; + + memcpy(ptr, func_suffixW, sizeof(func_suffixW)); + + V_VT(res) = VT_BSTR; + V_BSTR(res) = str; + return S_OK; +} + +static HRESULT function_apply(func_disp_t *func, DISPPARAMS *dp, LCID lcid, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + IDispatchEx *dispex = NULL; + DISPPARAMS params = { 0 }; + HRESULT hres, errcode; + IDispatch *this_obj; + UINT argc = 0; + VARIANT *arg; + + arg = dp->rgvarg + dp->cArgs - 1; + if(dp->cArgs < 1 || V_VT(arg) != VT_DISPATCH || !V_DISPATCH(arg)) + return CTL_E_ILLEGALFUNCTIONCALL; + this_obj = V_DISPATCH(arg); + + errcode = is_legacy_prototype(this_obj) ? MSHTML_E_INVALID_PROPERTY : CTL_E_ILLEGALFUNCTIONCALL; + + if(dp->cArgs >= 2) { + IDispatch *disp; + UINT i; + + arg--; + if((V_VT(arg) & ~VT_BYREF) != VT_DISPATCH) + return errcode; + disp = (V_VT(arg) & VT_BYREF) ? *(IDispatch**)(V_BYREF(arg)) : V_DISPATCH(arg); + + /* FIXME: Native doesn't seem to detect jscript arrays by querying for length or indexed props, + and it doesn't QI nor call any other IDispatchEx methods (except AddRef) on external disps. + Array-like JS objects don't work either, they all return 0x800a01ae. So how does it do it?! */ + IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + hres = get_disp_prop_vt(disp, dispex, L"length", lcid, res, VT_I4, ei, caller); + if(FAILED(hres)) { + if(hres == DISP_E_UNKNOWNNAME) + hres = errcode; + goto fail; + } + if(V_I4(res) < 0) { + hres = errcode; + goto fail; + } + params.cArgs = V_I4(res); + + /* alloc new params */ + if(params.cArgs) { + if(!(params.rgvarg = malloc(params.cArgs * sizeof(VARIANTARG)))) { + hres = E_OUTOFMEMORY; + goto fail; + } + for(i = 0; i < params.cArgs; i++) { + WCHAR buf[12]; + + arg = params.rgvarg + params.cArgs - i - 1; + swprintf(buf, ARRAY_SIZE(buf), L"%u", i); + hres = get_disp_prop(disp, dispex, buf, lcid, arg, ei, caller); + if(FAILED(hres)) { + if(hres == DISP_E_UNKNOWNNAME) { + V_VT(arg) = VT_EMPTY; + continue; + } + break; + } + } + argc = i; + if(argc < params.cArgs) + goto cleanup; + } } - hres = ITypeInfo_Invoke(ti, unk, func->id, flags, ¶ms, res, ei, &argerr); + hres = invoke_builtin_function(this_obj, func->info, ¶ms, res, ei, caller); + +cleanup: + while(argc--) + VariantClear(¶ms.rgvarg[params.cArgs - argc - 1]); + free(params.rgvarg); +fail: + if(dispex) + IDispatchEx_Release(dispex); + return (hres == E_UNEXPECTED) ? errcode : hres; +} + +static HRESULT function_call(func_disp_t *func, DISPPARAMS *dp, LCID lcid, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + DISPPARAMS params = { dp->rgvarg, NULL, dp->cArgs - 1, 0 }; + VARIANT *arg; + HRESULT hres; + + arg = dp->rgvarg + dp->cArgs - 1; + if(dp->cArgs < 1 || V_VT(arg) != VT_DISPATCH || !V_DISPATCH(arg)) + return CTL_E_ILLEGALFUNCTIONCALL; + + hres = invoke_builtin_function(V_DISPATCH(arg), func->info, ¶ms, res, ei, caller); + + return (hres != E_UNEXPECTED) ? hres : + (is_legacy_prototype(V_DISPATCH(arg)) ? MSHTML_E_INVALID_PROPERTY : CTL_E_ILLEGALFUNCTIONCALL); +} + +static const struct { + const WCHAR *name; + HRESULT (*invoke)(func_disp_t*,DISPPARAMS*,LCID,VARIANT*,EXCEPINFO*,IServiceProvider*); +} function_props[] = { + { L"apply", function_apply }, + { L"call", function_call } +}; + +static inline func_prop_disp_t *func_prop_disp_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, func_prop_disp_t, dispex); +} + +static void function_prop_destructor(DispatchEx *dispex) +{ + func_prop_disp_t *This = func_prop_disp_from_DispatchEx(dispex); + free(This); +} + +static HRESULT function_prop_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + func_prop_disp_t *This = func_prop_disp_from_DispatchEx(dispex); + HRESULT hres; + + switch(flags) { + case DISPATCH_CONSTRUCT: + return MSHTML_E_INVALID_PROPERTY; + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + return MSHTML_E_INVALID_PROPERTY; + case DISPATCH_PROPERTYGET: + hres = format_func_disp_string(function_props[This->idx].name, caller, res); + break; + default: + FIXME("Unimplemented flags %x\n", flags); + hres = E_NOTIMPL; + } - IUnknown_Release(unk); return hres; } +static const dispex_static_data_vtbl_t function_prop_dispex_vtbl = { + .destructor = function_prop_destructor, + .value = function_prop_value +}; + +static dispex_static_data_t function_prop_dispex = { + "Function", + &function_prop_dispex_vtbl, + PROTO_ID_NULL, + NULL_tid, + no_iface_tids +}; + static inline func_disp_t *impl_from_DispatchEx(DispatchEx *iface) { return CONTAINING_RECORD(iface, func_disp_t, dispex); @@ -806,6 +1208,8 @@ static HRESULT function_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR HRESULT hres; switch(flags) { + case DISPATCH_CONSTRUCT: + return MSHTML_E_INVALID_PROPERTY; case DISPATCH_METHOD|DISPATCH_PROPERTYGET: if(!res) return E_INVALIDARG; @@ -813,59 +1217,91 @@ static HRESULT function_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR case DISPATCH_METHOD: if(!This->obj) return E_UNEXPECTED; - hres = dispex_call_builtin(This->obj, This->info->id, params, res, ei, caller); + hres = invoke_builtin_function((IDispatch*)&This->obj->IDispatchEx_iface, This->info, params, res, ei, caller); break; - case DISPATCH_PROPERTYGET: { - unsigned name_len; - WCHAR *ptr; - BSTR str; - - static const WCHAR func_prefixW[] = - {'\n','f','u','n','c','t','i','o','n',' '}; - static const WCHAR func_suffixW[] = - {'(',')',' ','{','\n',' ',' ',' ',' ','[','n','a','t','i','v','e',' ','c','o','d','e',']','\n','}','\n'}; - - /* FIXME: This probably should be more generic. Also we should try to get IID_IActiveScriptSite and SID_GetCaller. */ - if(!caller) - return E_ACCESSDENIED; - - name_len = SysStringLen(This->info->name); - ptr = str = SysAllocStringLen(NULL, name_len + ARRAY_SIZE(func_prefixW) + ARRAY_SIZE(func_suffixW)); - if(!str) - return E_OUTOFMEMORY; - - memcpy(ptr, func_prefixW, sizeof(func_prefixW)); - ptr += ARRAY_SIZE(func_prefixW); + case DISPATCH_PROPERTYGET: + hres = format_func_disp_string(This->info->name, caller, res); + break; + default: + FIXME("Unimplemented flags %x\n", flags); + hres = E_NOTIMPL; + } - memcpy(ptr, This->info->name, name_len*sizeof(WCHAR)); - ptr += name_len; + return hres; +} - memcpy(ptr, func_suffixW, sizeof(func_suffixW)); +static HRESULT function_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) +{ + DWORD i; - V_VT(res) = VT_BSTR; - V_BSTR(res) = str; + for(i = 0; i < ARRAY_SIZE(function_props); i++) { + if((flags & fdexNameCaseInsensitive) ? wcsicmp(name, function_props[i].name) : wcscmp(name, function_props[i].name)) + continue; + *dispid = MSHTML_DISPID_CUSTOM_MIN + i; return S_OK; } + return DISP_E_UNKNOWNNAME; +} + +static HRESULT function_get_name(DispatchEx *dispex, DISPID id, BSTR *name) +{ + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + + if(idx >= ARRAY_SIZE(function_props)) + return DISP_E_MEMBERNOTFOUND; + + return (*name = SysAllocString(function_props[idx].name)) ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT function_invoke(DispatchEx *dispex, IDispatch *this_obj, DISPID id, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + func_disp_t *This = impl_from_DispatchEx(dispex); + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + + if(idx >= ARRAY_SIZE(function_props)) + return DISP_E_MEMBERNOTFOUND; + + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + return function_props[idx].invoke(This, params, lcid, res, ei, caller); + case DISPATCH_PROPERTYGET: { + func_prop_disp_t *disp = calloc(1, sizeof(func_prop_disp_t)); + + if(!disp) + return E_OUTOFMEMORY; + disp->idx = idx; + init_dispatch(&disp->dispex, &function_prop_dispex, NULL, dispex_compat_mode(&This->dispex)); + + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)&disp->dispex.IDispatchEx_iface; + break; + } default: - FIXME("Unimplemented flags %x\n", flags); - hres = E_NOTIMPL; + return MSHTML_E_INVALID_PROPERTY; } - return hres; + return S_OK; } static const dispex_static_data_vtbl_t function_dispex_vtbl = { .destructor = function_destructor, .value = function_value, + .get_dispid = function_get_dispid, + .get_name = function_get_name, + .invoke = function_invoke }; -static const tid_t function_iface_tids[] = {0}; - static dispex_static_data_t function_dispex = { "Function", &function_dispex_vtbl, + PROTO_ID_NULL, NULL_tid, - function_iface_tids + no_iface_tids }; static func_disp_t *create_func_disp(DispatchEx *obj, func_info_t *info) @@ -876,14 +1312,14 @@ static func_disp_t *create_func_disp(DispatchEx *obj, func_info_t *info) if(!ret) return NULL; - init_dispatch(&ret->dispex, &function_dispex, dispex_compat_mode(obj)); + init_dispatch(&ret->dispex, &function_dispex, NULL, dispex_compat_mode(obj)); ret->obj = obj; ret->info = info; return ret; } -static HRESULT invoke_disp_value(DispatchEx *This, IDispatch *func_disp, LCID lcid, WORD flags, DISPPARAMS *dp, +static HRESULT invoke_disp_value(IDispatch *this_obj, IDispatch *func_disp, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { DISPID named_arg = DISPID_THIS; @@ -904,7 +1340,7 @@ static HRESULT invoke_disp_value(DispatchEx *This, IDispatch *func_disp, LCID lc memcpy(new_dp.rgvarg+1, dp->rgvarg, dp->cArgs*sizeof(VARIANTARG)); V_VT(new_dp.rgvarg) = VT_DISPATCH; - V_DISPATCH(new_dp.rgvarg) = (IDispatch*)&This->IDispatchEx_iface; + V_DISPATCH(new_dp.rgvarg) = this_obj; hres = IDispatch_QueryInterface(func_disp, &IID_IDispatchEx, (void**)&dispex); TRACE(">>>\n"); @@ -924,11 +1360,33 @@ static HRESULT invoke_disp_value(DispatchEx *This, IDispatch *func_disp, LCID lc return hres; } -static HRESULT get_func_obj_entry(DispatchEx *This, func_info_t *func, func_obj_entry_t **ret) +static HRESULT get_func_obj_entry(DispatchEx *This, struct legacy_prototype *prototype, func_info_t *func, + func_obj_entry_t **ret) { dispex_dynamic_data_t *dynamic_data; func_obj_entry_t *entry; + /* Use the prototype's if it's not the default while ours is */ + if(prototype && prototype->dispex.dynamic_data && prototype->dispex.dynamic_data->func_disps && + prototype->dispex.dynamic_data->func_disps[func->func_disp_idx].func_obj) { + func_obj_entry_t *prot_entry = prototype->dispex.dynamic_data->func_disps + func->func_disp_idx; + + if(V_VT(&prot_entry->val) != VT_DISPATCH || + V_DISPATCH(&prot_entry->val) != (IDispatch*)&prot_entry->func_obj->dispex.IDispatchEx_iface) { + entry = NULL; + if(This->dynamic_data && This->dynamic_data->func_disps && + This->dynamic_data->func_disps[func->func_disp_idx].func_obj) { + entry = This->dynamic_data->func_disps + func->func_disp_idx; + + if(V_VT(&entry->val) == VT_DISPATCH && + V_DISPATCH(&entry->val) == (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface) + entry = NULL; + } + *ret = entry ? entry : prot_entry; + return S_OK; + } + } + dynamic_data = get_dynamic_data(This); if(!dynamic_data) return E_OUTOFMEMORY; @@ -979,7 +1437,14 @@ static HRESULT get_builtin_func(dispex_data_t *data, DISPID id, func_info_t **re return DISP_E_MEMBERNOTFOUND; } -static HRESULT get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID *ret) +static HRESULT get_builtin_func_prot(DispatchEx *This, DISPID id, func_info_t **ret) +{ + if(This->proxy && !to_proxy_prototype(This) && id != DISPID_VALUE && This->info->desc->prototype_id >= 0) + return DISP_E_MEMBERNOTFOUND; + return get_builtin_func(This->info, id, ret); +} + +HRESULT dispex_get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID *ret) { int min, max, n, c; @@ -1004,17 +1469,34 @@ static HRESULT get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID min = n+1; } - if(This->info->desc->vtbl->get_dispid) { - HRESULT hres; - - hres = This->info->desc->vtbl->get_dispid(This, name, grfdex, ret); + if(This->info->desc->vtbl->get_static_dispid) { + HRESULT hres = This->info->desc->vtbl->get_static_dispid(dispex_compat_mode(This), name, grfdex, ret); if(hres != DISP_E_UNKNOWNNAME) return hres; } + if(This->info->desc->vtbl->get_dispid) + return This->info->desc->vtbl->get_dispid(This, name, grfdex, ret); + return DISP_E_UNKNOWNNAME; } +static inline DispatchEx *get_dispex_for_hook(IUnknown *iface) +{ + IWineDispatchProxyPrivate *itf; + DispatchEx *dispex; + + if(FAILED(IUnknown_QueryInterface(iface, &IID_IWineDispatchProxyPrivate, (void**)&itf)) || !itf) + return NULL; + dispex = CONTAINING_RECORD(itf->lpVtbl->GetProxyFieldRef(itf), DispatchEx, proxy); + + /* The dispex and the proxy interface requested might be different (e.g. inner vs outer windows) */ + IDispatchEx_AddRef(&dispex->IDispatchEx_iface); + IDispatchEx_Release((IDispatchEx*)itf); + + return dispex; +} + HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *caller) { V_VT(dst) = VT_EMPTY; @@ -1053,9 +1535,8 @@ HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *ca return VariantChangeType(dst, src, 0, vt); } -static HRESULT builtin_propget(DispatchEx *This, func_info_t *func, DISPPARAMS *dp, VARIANT *res) +static HRESULT builtin_propget(IUnknown *iface, func_info_t *func, DISPPARAMS *dp, VARIANT *res) { - IUnknown *iface; HRESULT hres; if(dp && dp->cArgs) { @@ -1065,24 +1546,20 @@ static HRESULT builtin_propget(DispatchEx *This, func_info_t *func, DISPPARAMS * assert(func->get_vtbl_off); - hres = IDispatchEx_QueryInterface(&This->IDispatchEx_iface, tid_ids[func->tid], (void**)&iface); - if(SUCCEEDED(hres)) { - switch(func->prop_vt) { + switch(func->prop_vt) { #define CASE_VT(vt,type,access) \ - case vt: { \ - type val; \ - hres = ((HRESULT (WINAPI*)(IUnknown*,type*))((void**)iface->lpVtbl)[func->get_vtbl_off])(iface,&val); \ - if(SUCCEEDED(hres)) \ - access(res) = val; \ - } \ - break - BUILTIN_TYPES_SWITCH; + case vt: { \ + type val; \ + hres = ((HRESULT (WINAPI*)(IUnknown*,type*))((void**)iface->lpVtbl)[func->get_vtbl_off])(iface,&val); \ + if(SUCCEEDED(hres)) \ + access(res) = val; \ + } \ + break + BUILTIN_TYPES_SWITCH; #undef CASE_VT - default: - FIXME("Unhandled vt %d\n", func->prop_vt); - hres = E_NOTIMPL; - } - IUnknown_Release(iface); + default: + FIXME("Unhandled vt %d\n", func->prop_vt); + hres = E_NOTIMPL; } if(FAILED(hres)) @@ -1093,10 +1570,9 @@ static HRESULT builtin_propget(DispatchEx *This, func_info_t *func, DISPPARAMS * return S_OK; } -static HRESULT builtin_propput(DispatchEx *This, func_info_t *func, DISPPARAMS *dp, IServiceProvider *caller) +static HRESULT builtin_propput(DispatchEx *This, IUnknown *iface, func_info_t *func, DISPPARAMS *dp, IServiceProvider *caller) { VARIANT *v, tmpv; - IUnknown *iface; HRESULT hres; if(dp->cArgs != 1 || (dp->cNamedArgs == 1 && *dp->rgdispidNamedArgs != DISPID_PROPERTYPUT) @@ -1122,21 +1598,16 @@ static HRESULT builtin_propput(DispatchEx *This, func_info_t *func, DISPPARAMS * v = &tmpv; } - hres = IDispatchEx_QueryInterface(&This->IDispatchEx_iface, tid_ids[func->tid], (void**)&iface); - if(SUCCEEDED(hres)) { - switch(func->prop_vt) { + switch(func->prop_vt) { #define CASE_VT(vt,type,access) \ - case vt: \ - hres = ((HRESULT (WINAPI*)(IUnknown*,type))((void**)iface->lpVtbl)[func->put_vtbl_off])(iface,access(v)); \ - break - BUILTIN_TYPES_SWITCH; + case vt: \ + hres = ((HRESULT (WINAPI*)(IUnknown*,type))((void**)iface->lpVtbl)[func->put_vtbl_off])(iface,access(v)); \ + break + BUILTIN_TYPES_SWITCH; #undef CASE_VT - default: - FIXME("Unimplemented vt %d\n", func->prop_vt); - hres = E_NOTIMPL; - } - - IUnknown_Release(iface); + default: + FIXME("Unimplemented vt %d\n", func->prop_vt); + hres = E_NOTIMPL; } if(v == &tmpv) @@ -1144,32 +1615,40 @@ static HRESULT builtin_propput(DispatchEx *This, func_info_t *func, DISPPARAMS * return hres; } -static HRESULT invoke_builtin_function(DispatchEx *This, func_info_t *func, DISPPARAMS *dp, +static HRESULT invoke_builtin_function(IDispatch *this_obj, func_info_t *func, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { VARIANT arg_buf[MAX_ARGS], *arg_ptrs[MAX_ARGS], *arg, retv, ret_ref, vhres; unsigned i, nconv = 0; + DispatchEx *dispex; IUnknown *iface; HRESULT hres; - if(func->hook) { - hres = func->hook(This, DISPATCH_METHOD, dp, res, ei, caller); - if(hres != S_FALSE) + hres = IDispatch_QueryInterface(this_obj, tid_ids[func->tid], (void**)&iface); + if(FAILED(hres) || !iface) + return E_UNEXPECTED; + + if(func->hook && (dispex = get_dispex_for_hook(iface))) { + hres = func->hook(dispex, DISPATCH_METHOD, dp, res, ei, caller); + IDispatchEx_Release(&dispex->IDispatchEx_iface); + if(hres != S_FALSE) { + IUnknown_Release(iface); return hres; + } } - if(!func->call_vtbl_off) - return typeinfo_invoke(This, func, DISPATCH_METHOD, dp, res, ei); + if(!func->call_vtbl_off) { + hres = typeinfo_invoke(iface, func, DISPATCH_METHOD, dp, res, ei); + IUnknown_Release(iface); + return hres; + } if(dp->cArgs + func->default_value_cnt < func->argc) { FIXME("Invalid argument count (expected %u, got %u)\n", func->argc, dp->cArgs); + IUnknown_Release(iface); return E_INVALIDARG; } - hres = IDispatchEx_QueryInterface(&This->IDispatchEx_iface, tid_ids[func->tid], (void**)&iface); - if(FAILED(hres)) - return hres; - for(i=0; i < func->argc; i++) { BOOL own_value = FALSE; if(i >= dp->cArgs) { @@ -1251,9 +1730,10 @@ static HRESULT invoke_builtin_function(DispatchEx *This, func_info_t *func, DISP return V_ERROR(&vhres); } -static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, DISPPARAMS *dp, VARIANT *res, +static HRESULT func_invoke(DispatchEx *This, IDispatch *this_obj, func_info_t *func, WORD flags, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { + func_obj_entry_t *entry; HRESULT hres; switch(flags) { @@ -1262,10 +1742,24 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, return E_INVALIDARG; /* fall through */ case DISPATCH_METHOD: - if(This->dynamic_data && This->dynamic_data->func_disps - && This->dynamic_data->func_disps[func->func_disp_idx].func_obj) { - func_obj_entry_t *entry = This->dynamic_data->func_disps + func->func_disp_idx; + entry = NULL; + if(This->dynamic_data && This->dynamic_data->func_disps && + This->dynamic_data->func_disps[func->func_disp_idx].func_obj) { + entry = This->dynamic_data->func_disps + func->func_disp_idx; + + if(V_VT(&entry->val) == VT_DISPATCH && + V_DISPATCH(&entry->val) == (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface) + entry = NULL; + } + + if(!entry && This->prototype) { + if(This->prototype->dispex.dynamic_data && This->prototype->dispex.dynamic_data->func_disps && + This->prototype->dispex.dynamic_data->func_disps[func->func_disp_idx].func_obj) + entry = This->prototype->dispex.dynamic_data->func_disps + func->func_disp_idx; + } + + if(entry) { if(V_VT(&entry->val) != VT_DISPATCH) { FIXME("calling %s not supported\n", debugstr_variant(&entry->val)); return E_NOTIMPL; @@ -1277,16 +1771,16 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, return E_FAIL; } - hres = invoke_disp_value(This, V_DISPATCH(&entry->val), 0, flags, dp, res, ei, NULL); + hres = invoke_disp_value(this_obj, V_DISPATCH(&entry->val), 0, flags, dp, res, ei, NULL); break; } } - hres = invoke_builtin_function(This, func, dp, res, ei, caller); + hres = invoke_builtin_function(this_obj, func, dp, res, ei, caller); + if(hres == E_UNEXPECTED && dispex_compat_mode(This) < COMPAT_MODE_IE9) + hres = MSHTML_E_INVALID_PROPERTY; break; - case DISPATCH_PROPERTYGET: { - func_obj_entry_t *entry; - + case DISPATCH_PROPERTYGET: if(func->id == DISPID_VALUE) { BSTR ret; @@ -1299,16 +1793,13 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, return S_OK; } - hres = get_func_obj_entry(This, func, &entry); + hres = get_func_obj_entry(This, This->prototype, func, &entry); if(FAILED(hres)) return hres; V_VT(res) = VT_EMPTY; return VariantCopy(res, &entry->val); - } - case DISPATCH_PROPERTYPUT: { - func_obj_entry_t *entry; - + case DISPATCH_PROPERTYPUT: if(dp->cArgs != 1 || (dp->cNamedArgs == 1 && *dp->rgdispidNamedArgs != DISPID_PROPERTYPUT) || dp->cNamedArgs > 1) { FIXME("invalid args\n"); @@ -1321,12 +1812,11 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, * Native probably uses some undocumented interface in this case, but it should * be fine for us to allow IDispatchEx handle that. */ - hres = get_func_obj_entry(This, func, &entry); + hres = get_func_obj_entry(This, NULL, func, &entry); if(FAILED(hres)) return hres; return VariantCopy(&entry->val, dp->rgvarg); - } default: FIXME("Unimplemented flags %x\n", flags); hres = E_NOTIMPL; @@ -1335,54 +1825,75 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, return hres; } -static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +static HRESULT invoke_builtin_prop(DispatchEx *This, IDispatch *this_obj, DISPID id, LCID lcid, WORD flags, + DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { + DispatchEx *dispex; func_info_t *func; + IUnknown *iface; HRESULT hres; - hres = get_builtin_func(This->info, id, &func); + if(id == DISPID_VALUE && This->info->desc->vtbl->value) { + hres = This->info->desc->vtbl->value(This, lcid, flags, dp, res, ei, caller); + if(hres != S_FALSE) + return hres; + } + + hres = get_builtin_func_prot(This, id, &func); if(id == DISPID_VALUE && hres == DISP_E_MEMBERNOTFOUND) return dispex_value(This, lcid, flags, dp, res, ei, caller); if(FAILED(hres)) return hres; if(func->func_disp_idx >= 0) - return function_invoke(This, func, flags, dp, res, ei, caller); + return func_invoke(This, this_obj, func, flags, dp, res, ei, caller); - if(func->hook) { - hres = func->hook(This, flags, dp, res, ei, caller); - if(hres != S_FALSE) + hres = IDispatch_QueryInterface(this_obj, tid_ids[func->tid], (void**)&iface); + if(FAILED(hres) || !iface) { + if(dispex_compat_mode(This) >= COMPAT_MODE_IE9) + return E_UNEXPECTED; + if(res) + V_VT(res) = VT_EMPTY; + return S_OK; + } + + if(func->hook && (dispex = get_dispex_for_hook(iface))) { + hres = func->hook(dispex, flags, dp, res, ei, caller); + IDispatchEx_Release(&dispex->IDispatchEx_iface); + if(hres != S_FALSE) { + IUnknown_Release(iface); return hres; + } } switch(flags) { case DISPATCH_PROPERTYPUT: if(res) V_VT(res) = VT_EMPTY; - hres = builtin_propput(This, func, dp, caller); + hres = builtin_propput(This, iface, func, dp, caller); break; case DISPATCH_PROPERTYGET: - hres = builtin_propget(This, func, dp, res); + hres = builtin_propget(iface, func, dp, res); break; default: if(!func->get_vtbl_off) { - hres = typeinfo_invoke(This, func, flags, dp, res, ei); + hres = typeinfo_invoke(iface, func, flags, dp, res, ei); }else { VARIANT v; - hres = builtin_propget(This, func, NULL, &v); + hres = builtin_propget(iface, func, NULL, &v); if(FAILED(hres)) - return hres; + break; if(flags != (DISPATCH_PROPERTYGET|DISPATCH_METHOD) || dp->cArgs) { if(V_VT(&v) != VT_DISPATCH) { FIXME("Not a function %s flags %08x\n", debugstr_variant(&v), flags); VariantClear(&v); - return E_FAIL; + hres = E_FAIL; + break; } - hres = invoke_disp_value(This, V_DISPATCH(&v), lcid, flags, dp, res, ei, caller); + hres = invoke_disp_value(this_obj, V_DISPATCH(&v), lcid, flags, dp, res, ei, caller); IDispatch_Release(V_DISPATCH(&v)); }else if(res) { *res = v; @@ -1392,6 +1903,7 @@ static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD } } + IUnknown_Release(iface); return hres; } @@ -1405,7 +1917,88 @@ HRESULT dispex_call_builtin(DispatchEx *dispex, DISPID id, DISPPARAMS *dp, if(FAILED(hres)) return hres; - return invoke_builtin_function(dispex, func, dp, res, ei, caller); + return invoke_builtin_function((IDispatch*)&dispex->IDispatchEx_iface, func, dp, res, ei, caller); +} + +BOOL dispex_is_builtin_attribute(DispatchEx *dispex, DISPID id) +{ + func_info_t *func; + + if(id == DISPID_VALUE) + return TRUE; + + if(get_dispid_type(id) != DISPEXPROP_BUILTIN) + return FALSE; + + if(FAILED(get_builtin_func(dispex->info, id, &func))) + return FALSE; + + return func->func_disp_idx < 0; +} + +BOOL dispex_is_builtin_method(DispatchEx *dispex, DISPID id) +{ + func_info_t *func; + + if(get_dispid_type(id) != DISPEXPROP_BUILTIN) + return FALSE; + + if(FAILED(get_builtin_func(dispex->info, id, &func)) || func->func_disp_idx < 0) + return FALSE; + + if(dispex->dynamic_data && dispex->dynamic_data->func_disps) { + func_obj_entry_t *entry = dispex->dynamic_data->func_disps + func->func_disp_idx; + + if(entry->func_obj && (V_VT(&entry->val) != VT_DISPATCH || + V_DISPATCH(&entry->val) != (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface)) + return FALSE; + } + + return TRUE; +} + +BOOL dispex_is_builtin_value(DispatchEx *dispex, DISPID id) +{ + func_info_t *func; + + if(get_dispid_type(id) != DISPEXPROP_BUILTIN) + return FALSE; + + if(FAILED(get_builtin_func(dispex->info, id, &func))) + return FALSE; + + if(func->func_disp_idx < 0) + return TRUE; + + if(dispex->dynamic_data && dispex->dynamic_data->func_disps) { + func_obj_entry_t *entry = dispex->dynamic_data->func_disps + func->func_disp_idx; + + if(entry->func_obj && (V_VT(&entry->val) != VT_DISPATCH || + V_DISPATCH(&entry->val) != (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface)) + return FALSE; + } + + return TRUE; +} + +static VARIANT_BOOL reset_builtin_func(DispatchEx *dispex, func_info_t *func) +{ + func_obj_entry_t *entry; + + if(!dispex->dynamic_data || !dispex->dynamic_data->func_disps || + !dispex->dynamic_data->func_disps[func->func_disp_idx].func_obj) + return VARIANT_FALSE; + + entry = dispex->dynamic_data->func_disps + func->func_disp_idx; + if(V_VT(&entry->val) == VT_DISPATCH && + V_DISPATCH(&entry->val) == (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface) + return VARIANT_FALSE; + + VariantClear(&entry->val); + V_VT(&entry->val) = VT_DISPATCH; + V_DISPATCH(&entry->val) = (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface; + IDispatch_AddRef(V_DISPATCH(&entry->val)); + return VARIANT_TRUE; } HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) @@ -1420,8 +2013,10 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) dynamic_prop_t *prop; prop = This->dynamic_data->props+idx; - VariantClear(&prop->var); - prop->flags |= DYNPROP_DELETED; + if(!(prop->flags & DYNPROP_PROTREF)) { + VariantClear(&prop->var); + prop->flags |= DYNPROP_DELETED; + } *success = VARIANT_TRUE; return S_OK; } @@ -1429,6 +2024,7 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) VARIANT var; DISPPARAMS dp = {&var,NULL,1,0}; func_info_t *func; + IUnknown *iface; HRESULT hres; hres = get_builtin_func(This->info, id, &func); @@ -1437,32 +2033,15 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) /* For builtin functions, we set their value to the original function. */ if(func->func_disp_idx >= 0) { - func_obj_entry_t *entry; - - if(!This->dynamic_data || !This->dynamic_data->func_disps - || !This->dynamic_data->func_disps[func->func_disp_idx].func_obj) { - *success = VARIANT_FALSE; - return S_OK; - } - - entry = This->dynamic_data->func_disps + func->func_disp_idx; - if(V_VT(&entry->val) == VT_DISPATCH - && V_DISPATCH(&entry->val) == (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface) { - *success = VARIANT_FALSE; - return S_OK; - } - - VariantClear(&entry->val); - V_VT(&entry->val) = VT_DISPATCH; - V_DISPATCH(&entry->val) = (IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface; - IDispatch_AddRef(V_DISPATCH(&entry->val)); - *success = VARIANT_TRUE; + *success = reset_builtin_func(This, func); return S_OK; } *success = VARIANT_TRUE; + IDispatchEx_QueryInterface(&This->IDispatchEx_iface, tid_ids[func->tid], (void**)&iface); + V_VT(&var) = VT_EMPTY; - hres = builtin_propput(This, func, &dp, NULL); + hres = builtin_propput(This, iface, func, &dp, NULL); if(FAILED(hres)) { VARIANT *ref; hres = dispex_get_dprop_ref(This, func->name, FALSE, &ref); @@ -1471,6 +2050,7 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) else VariantClear(ref); } + IUnknown_Release(iface); return S_OK; } default: @@ -1486,13 +2066,33 @@ compat_mode_t dispex_compat_mode(DispatchEx *dispex) : dispex->info->desc->vtbl->get_compat_mode(dispex); } +static dispex_data_t *ensure_dispex_info(dispex_static_data_t *desc, compat_mode_t compat_mode) +{ + if(!desc->info_cache[compat_mode]) { + EnterCriticalSection(&cs_dispex_static_data); + if(!desc->info_cache[compat_mode]) + desc->info_cache[compat_mode] = preprocess_dispex_data(desc, compat_mode); + LeaveCriticalSection(&cs_dispex_static_data); + } + return desc->info_cache[compat_mode]; +} + +static BOOL ensure_real_info(DispatchEx *dispex) +{ + if(dispex->info != dispex->info->desc->delayed_init_info) + return TRUE; + + dispex->info->desc->vtbl->finalize_dispex(dispex); + return dispex->info != NULL; +} + HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) { static const WCHAR prefix[8] = L"[object "; static const WCHAR suffix[] = L"]"; - WCHAR buf[ARRAY_SIZE(prefix) + 28 + ARRAY_SIZE(suffix)], *p = buf; + WCHAR buf[ARRAY_SIZE(prefix) + 36 + ARRAY_SIZE(suffix)], *p = buf; compat_mode_t compat_mode = dispex_compat_mode(dispex); - const char *name = dispex->info->desc->name; + const char *name; if(!ret) return E_INVALIDARG; @@ -1502,6 +2102,9 @@ HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) if(compat_mode < COMPAT_MODE_IE9) p--; else { + if(!ensure_real_info(dispex)) + return E_OUTOFMEMORY; + name = dispex->info->desc->name; while(*name) *p++ = *name++; assert(p + ARRAY_SIZE(suffix) - buf <= ARRAY_SIZE(buf)); @@ -1512,188 +2115,1366 @@ HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) return *ret ? S_OK : E_OUTOFMEMORY; } -static dispex_data_t *ensure_dispex_info(dispex_static_data_t *desc, compat_mode_t compat_mode) +struct legacy_prototype *get_legacy_prototype(HTMLInnerWindow *window, prototype_id_t prot_id, + compat_mode_t compat_mode) { - if(!desc->info_cache[compat_mode]) { - EnterCriticalSection(&cs_dispex_static_data); - if(!desc->info_cache[compat_mode]) - desc->info_cache[compat_mode] = preprocess_dispex_data(desc, compat_mode); - LeaveCriticalSection(&cs_dispex_static_data); + struct legacy_prototype *prot = window->legacy_prototypes[prot_id]; + + if(!prot) { + if(!(prot = malloc(sizeof(*prot)))) + return NULL; + + prot->window = window; + window->legacy_prototypes[prot_id] = prot; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); + + init_dispatch(&prot->dispex, &legacy_prototype_dispex[prot_id], NULL, compat_mode); } - return desc->info_cache[compat_mode]; + + IDispatchEx_AddRef(&prot->dispex.IDispatchEx_iface); + return prot; } -static BOOL ensure_real_info(DispatchEx *dispex) +static inline struct legacy_prototype *legacy_prototype_from_DispatchEx(DispatchEx *iface) { - if(dispex->info != dispex->info->desc->delayed_init_info) - return TRUE; - - dispex->info = ensure_dispex_info(dispex->info->desc, dispex_compat_mode(dispex)); - return dispex->info != NULL; + return CONTAINING_RECORD(iface, struct legacy_prototype, dispex); } -static inline DispatchEx *impl_from_IDispatchEx(IDispatchEx *iface) +static void legacy_prototype_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) { - return CONTAINING_RECORD(iface, DispatchEx, IDispatchEx_iface); + struct legacy_prototype *This = legacy_prototype_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); } -static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +static void legacy_prototype_unlink(DispatchEx *dispex) { - DispatchEx *This = impl_from_IDispatchEx(iface); - - TRACE("%s (%p)->(%s %p)\n", This->info->desc->name, This, debugstr_mshtml_guid(riid), ppv); + struct legacy_prototype *This = legacy_prototype_from_DispatchEx(dispex); - if(This->info->desc->vtbl->query_interface) { - *ppv = This->info->desc->vtbl->query_interface(This, riid); - if(*ppv) - goto ret; + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); } +} - if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) - *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_nsXPCOMCycleCollectionParticipant, riid)) { - *ppv = &dispex_ccp; - return S_OK; - }else if(IsEqualGUID(&IID_nsCycleCollectionISupports, riid)) { - *ppv = &This->IDispatchEx_iface; - return S_OK; - }else if(IsEqualGUID(&IID_IDispatchJS, riid) || - IsEqualGUID(&IID_UndocumentedScriptIface, riid) || - IsEqualGUID(&IID_IMarshal, riid) || - IsEqualGUID(&IID_IManagedObject, riid)) { - *ppv = NULL; - return E_NOINTERFACE; - }else { - *ppv = NULL; - WARN("%s (%p)->(%s %p)\n", This->info->desc->name, This, debugstr_mshtml_guid(riid), ppv); - return E_NOINTERFACE; - } +static void legacy_prototype_destructor(DispatchEx *dispex) +{ + struct legacy_prototype *This = legacy_prototype_from_DispatchEx(dispex); + free(This); +} -ret: - IDispatchEx_AddRef(&This->IDispatchEx_iface); +static HRESULT legacy_prototype_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: + return MSHTML_E_INVALID_ACTION; + case DISPATCH_PROPERTYGET: + if(!(V_BSTR(res) = SysAllocString(L"[Interface prototype object]"))) + return E_OUTOFMEMORY; + V_VT(res) = VT_BSTR; + break; + case DISPATCH_PROPERTYPUTREF|DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT: + break; + default: + return E_INVALIDARG; + } return S_OK; } -static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface) +static HRESULT legacy_prototype_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) { - DispatchEx *This = impl_from_IDispatchEx(iface); - LONG ref = ccref_incr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface); + if(dispex_compat_mode(dispex) == COMPAT_MODE_IE8) { + if((flags & fdexNameCaseInsensitive) ? !wcsicmp(name, L"constructor") : !wcscmp(name, L"constructor")) { + *dispid = MSHTML_DISPID_CUSTOM_MIN; + return S_OK; + } + } + return DISP_E_UNKNOWNNAME; +} - TRACE("%s (%p) ref=%ld\n", This->info->desc->name, This, ref); +static HRESULT legacy_prototype_get_name(DispatchEx *dispex, DISPID id, BSTR *name) +{ + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; - return ref; + if(idx > 0 || dispex_compat_mode(dispex) != COMPAT_MODE_IE8) + return DISP_E_MEMBERNOTFOUND; + return (*name = SysAllocString(L"constructor")) ? S_OK : E_OUTOFMEMORY; } -static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface) +static HRESULT legacy_prototype_invoke(DispatchEx *dispex, IDispatch *this_obj, DISPID id, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { - DispatchEx *This = impl_from_IDispatchEx(iface); - LONG ref = ccref_decr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface, &dispex_ccp); + static WCHAR ElementW[] = L"Element"; + struct legacy_prototype *This = legacy_prototype_from_DispatchEx(dispex); + prototype_id_t prot_id = This->dispex.info->desc - legacy_prototype_dispex; + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + HTMLInnerWindow *window = This->window; + DISPPARAMS dp = { 0 }; - TRACE("%s (%p) ref=%ld\n", This->info->desc->name, This, ref); + if(idx > 0 || dispex_compat_mode(dispex) != COMPAT_MODE_IE8) + return DISP_E_MEMBERNOTFOUND; - /* Gecko ccref may not free the object immediately when ref count reaches 0, so we need - * an extra care for objects that need an immediate clean up. See Gecko's - * NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE_WITH_LAST_RELEASE for details. */ - if(!ref && This->info->desc->vtbl->last_release) { - ccref_incr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface); - This->info->desc->vtbl->last_release(This); - ccref_decr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface, &dispex_ccp); + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + return MSHTML_E_INVALID_PROPERTY; + case DISPATCH_PROPERTYGET: + if(prot_id < PROTO_ID_HTMLGenericElement && prot_id != PROTO_ID_HTMLUnknownElement) + break; + if(FAILED(IDispatchEx_GetDispID(&window->base.IDispatchEx_iface, ElementW, fdexNameCaseSensitive, &id))) + break; + return IDispatchEx_InvokeEx(&window->base.IDispatchEx_iface, id, lcid, DISPATCH_PROPERTYGET, &dp, res, ei, caller); + case DISPATCH_PROPERTYPUTREF|DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT: + return S_OK; + default: + return MSHTML_E_INVALID_PROPERTY; } - return ref; + V_VT(res) = VT_NULL; + return S_OK; } -static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); +static const dispex_static_data_vtbl_t legacy_prototype_dispex_vtbl = { + .destructor = legacy_prototype_destructor, + .traverse = legacy_prototype_traverse, + .unlink = legacy_prototype_unlink, + .value = legacy_prototype_value, + .get_dispid = legacy_prototype_get_dispid, + .get_name = legacy_prototype_get_name, + .invoke = legacy_prototype_invoke +}; - TRACE("%s (%p)->(%p)\n", This->info->desc->name, This, pctinfo); +static void legacy_prototype_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) +{ + static const DISPID empty_exclude_list[] = { DISPID_UNKNOWN }; + static const DISPID window_exclude_list[] = { + DISPID_IHTMLWINDOW2_IMAGE, + DISPID_IHTMLWINDOW2_OPTION, + DISPID_IHTMLWINDOW5_XMLHTTPREQUEST, + DISPID_IHTMLWINDOW6_XDOMAINREQUEST, + DISPID_UNKNOWN + }; + prototype_id_t prot_id = info->desc - legacy_prototype_dispex; + dispex_data_t *data = ensure_dispex_info(prototype_static_data[prot_id].desc, compat_mode); + const DISPID *exclude = empty_exclude_list; + func_info_t *func; + unsigned i, j; - *pctinfo = 1; - return S_OK; -} + if(!data || !data->func_cnt) + return; -static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); - HRESULT hres; + if(prototype_static_data[prot_id].desc == &HTMLWindow_dispex) + exclude = window_exclude_list; - TRACE("%s (%p)->(%u %lu %p)\n", This->info->desc->name, This, iTInfo, lcid, ppTInfo); + /* Copy the info from the object instance data */ + func = realloc(info->funcs, data->func_size * sizeof(*func)); + if(!func) + return; + info->funcs = func; + info->func_disp_cnt = data->func_disp_cnt; + info->func_size = data->func_size; - hres = get_typeinfo(This->info->desc->disp_tid, ppTInfo); - if(FAILED(hres)) - return hres; + for(i = 0; i < data->func_cnt; i++) { + for(j = 0; exclude[j] != DISPID_UNKNOWN; j++) + if(exclude[j] == data->funcs[i].id) + break; + if(exclude[j] != DISPID_UNKNOWN) + continue; + copy_func_info(func, &data->funcs[i]); + func++; + } + info->func_cnt = func - info->funcs; + memset(func, 0, (info->func_size - info->func_cnt) * sizeof(*func)); +} - ITypeInfo_AddRef(*ppTInfo); - return S_OK; +static inline struct global_ctor *global_ctor_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, struct global_ctor, dispex); } -static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +void global_ctor_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) { - DispatchEx *This = impl_from_IDispatchEx(iface); - HRESULT hres = S_OK; + struct global_ctor *This = global_ctor_from_DispatchEx(dispex); - TRACE("%s (%p)->(%s %p %u %lu %p)\n", This->info->desc->name, This, debugstr_guid(riid), rgszNames, - cNames, lcid, rgDispId); + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} - /* Native ignores all cNames > 1, and doesn't even fill them */ - if(cNames) - hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[0], 0, rgDispId); +void global_ctor_unlink(DispatchEx *dispex) +{ + struct global_ctor *This = global_ctor_from_DispatchEx(dispex); - return hres; + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } } -static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +void global_ctor_destructor(DispatchEx *dispex) { - DispatchEx *This = impl_from_IDispatchEx(iface); + struct global_ctor *This = global_ctor_from_DispatchEx(dispex); + free(This); +} + +HRESULT global_ctor_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: + return MSHTML_E_INVALID_ACTION; + case DISPATCH_PROPERTYGET: { + static const WCHAR prefix[8] = L"[object "; + static const WCHAR suffix[] = L"]"; + WCHAR buf[ARRAY_SIZE(prefix) + 28 + ARRAY_SIZE(suffix)], *p = buf; + const char *name = dispex->info->desc->name; + + memcpy(p, prefix, sizeof(prefix)); + p += ARRAY_SIZE(prefix); + while(*name) + *p++ = *name++; + memcpy(p, suffix, sizeof(suffix)); + + if(!(V_BSTR(res) = SysAllocString(buf))) + return E_OUTOFMEMORY; + V_VT(res) = VT_BSTR; + break; + } + case DISPATCH_PROPERTYPUTREF|DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT: + break; + default: + return E_INVALIDARG; + } + return S_OK; +} + +HRESULT legacy_ctor_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) +{ + if((flags & fdexNameCaseInsensitive) ? !wcsicmp(name, L"prototype") : !wcscmp(name, L"prototype")) { + *dispid = MSHTML_DISPID_CUSTOM_MIN; + return S_OK; + } + return DISP_E_UNKNOWNNAME; +} + +HRESULT legacy_ctor_get_name(DispatchEx *dispex, DISPID id, BSTR *name) +{ + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + + if(idx > 0) + return DISP_E_MEMBERNOTFOUND; + return (*name = SysAllocString(L"prototype")) ? S_OK : E_OUTOFMEMORY; +} + +HRESULT legacy_ctor_invoke(DispatchEx *dispex, IDispatch *this_obj, DISPID id, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + struct global_ctor *This = CONTAINING_RECORD(dispex, struct global_ctor, dispex); + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + struct legacy_prototype *prot; + + if(idx > 0) + return DISP_E_MEMBERNOTFOUND; + + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + return MSHTML_E_INVALID_PROPERTY; + case DISPATCH_PROPERTYGET: + if(!(prot = get_legacy_prototype(This->window, This->prot_id, dispex_compat_mode(dispex)))) + return E_OUTOFMEMORY; + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)&prot->dispex.IDispatchEx_iface; + break; + default: + return MSHTML_E_INVALID_PROPERTY; + } + + return S_OK; +} + +HRESULT legacy_ctor_delete(DispatchEx *dispex, DISPID id) +{ + DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; + return dispex_compat_mode(dispex) < COMPAT_MODE_IE8 ? E_NOTIMPL : + idx > 0 ? S_OK : MSHTML_E_INVALID_PROPERTY; +} + +static inline struct proxy_prototype *proxy_prototype_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, struct proxy_prototype, dispex); +} + +static inline struct proxy_prototype *to_proxy_prototype(DispatchEx *dispex) +{ + if(dispex->info->desc >= &prototype_static_data[0].dispex && dispex->info->desc < &prototype_static_data[ARRAY_SIZE(prototype_static_data)].dispex) + return proxy_prototype_from_DispatchEx(dispex); + return NULL; +} + +static void proxy_prototype_destructor(DispatchEx *dispex) +{ + struct proxy_prototype *This = proxy_prototype_from_DispatchEx(dispex); + free(This); +} + +static const dispex_static_data_vtbl_t proxy_prototype_dispex_vtbl = { + .destructor = proxy_prototype_destructor +}; + +static void proxy_prototype_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) +{ + dispex_static_data_t *desc = CONTAINING_RECORD(info->desc, struct prototype_static_data, dispex)->desc; + dispex_data_t *data = ensure_dispex_info(desc, compat_mode); + prototype_id_t prot_id; + func_info_t *func; + unsigned i; + + if(!data || !data->func_cnt) + return; + + /* Copy the info from the object instance data, but + exclude builtins found up the prototype chain. */ + func = realloc(info->funcs, data->func_size * sizeof(*func)); + if(!func) + return; + info->funcs = func; + info->func_disp_cnt = 0; + + for(i = 0; i < data->func_cnt; i++) { + BOOL found = FALSE; + + for(prot_id = info->desc->prototype_id; prot_id >= 0; prot_id = prototype_static_data[prot_id].dispex.prototype_id) { + dispex_data_t *chain_data = ensure_dispex_info(prototype_static_data[prot_id].desc, compat_mode); + DWORD a = 0, b = chain_data->func_cnt; + + while(a < b) { + DWORD idx = (a + b) / 2; + int c = wcsicmp(chain_data->name_table[idx]->name, data->funcs[i].name); + if(!c) { + found = TRUE; + break; + } + if(c > 0) b = idx; + else a = idx + 1; + } + if(found) + break; + } + if(found) + continue; + + copy_func_info(func, &data->funcs[i]); + if(func->func_disp_idx >= 0) + info->func_disp_cnt++; + func++; + } + + info->func_cnt = func - info->funcs; + info->func_size = max(info->func_cnt, 16); + func = realloc(info->funcs, info->func_size * sizeof(*func)); + if(func) + info->funcs = func; + memset(info->funcs + info->func_cnt, 0, (info->func_size - info->func_cnt) * sizeof(*func)); +} + +static HRESULT get_prototype_builtin_id(struct proxy_prototype *prot, BSTR name, DWORD flags, DISPID *id) +{ + dispex_data_t *data = prot->dispex.info; + func_info_t **funcs = data->name_table; + DWORD i, a = 0, b = data->func_cnt; + int c; + + while(a < b) { + i = (a + b) / 2; + c = wcsicmp(funcs[i]->name, name); + if(!c) { + if((flags & fdexNameCaseSensitive) && wcscmp(funcs[i]->name, name)) + break; + *id = funcs[i]->id; + return S_OK; + } + if(c > 0) b = i; + else a = i + 1; + } + + data = proxy_prototype_object_info(prot); + if(data->desc->vtbl->get_static_dispid) + return data->desc->vtbl->get_static_dispid(dispex_compat_mode(&prot->dispex), name, flags, id); + return DISP_E_UNKNOWNNAME; +} + +static IDispatch *get_default_prototype(prototype_id_t prot_id, compat_mode_t compat_mode, HTMLInnerWindow *window) +{ + struct proxy_prototype *prot; + IDispatch **entry; + + if(!window->proxy_globals && (!(window->proxy_globals = calloc(1, sizeof(*window->proxy_globals))))) + return NULL; + + entry = &window->proxy_globals->prototype[prot_id - LEGACY_PROTOTYPE_COUNT]; + if(*entry) { + IDispatch_AddRef(*entry); + return *entry; + } + + if(!(prot = malloc(sizeof(*prot)))) + return NULL; + + init_dispatch(&prot->dispex, &prototype_static_data[prot_id].dispex, NULL, compat_mode); + + IDispatchEx_AddRef(&prot->dispex.IDispatchEx_iface); + *entry = (IDispatch*)&prot->dispex.IDispatchEx_iface; + return *entry; +} + +static IDispatch *get_proxy_constructor_disp(HTMLInnerWindow *window, prototype_id_t prot_id) +{ + static const struct { + prototype_id_t prot_id; + dispex_static_data_t *dispex; + const void *vtbl; + } ctors[] = { + { PROTO_ID_DOMParser, &DOMParserCtor_dispex }, + { PROTO_ID_MutationObserver, &mutation_observer_ctor_dispex }, + { PROTO_ID_HTMLImgElement, &HTMLImageCtor_dispex, &HTMLImageElementFactoryVtbl }, + { PROTO_ID_HTMLOptionElement, &HTMLOptionCtor_dispex, &HTMLOptionElementFactoryVtbl }, + { PROTO_ID_HTMLXMLHttpRequest, &HTMLXMLHttpRequestFactory_dispex, &HTMLXMLHttpRequestFactoryVtbl }, + { PROTO_ID_HTMLXDomainRequest, &HTMLXDomainRequestFactory_dispex, &HTMLXDomainRequestFactoryVtbl } + }; + struct global_ctor *ctor; + unsigned i; + + for(i = 0; i < ARRAY_SIZE(ctors); i++) + if(ctors[i].prot_id == prot_id) + break; + assert(i < ARRAY_SIZE(ctors)); + + if(!(ctor = malloc(sizeof(*ctor)))) + return NULL; + + ctor->IUnknown_iface.lpVtbl = ctors[i].vtbl; + ctor->prot_id = prot_id; + ctor->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); + + init_dispatch(&ctor->dispex, ctors[i].dispex, NULL, dispex_compat_mode(&window->event_target.dispex)); + + return (IDispatch*)&ctor->dispex.IDispatchEx_iface; +} + +HRESULT define_global_constructors(HTMLInnerWindow *window) +{ + static const struct { + const char *name; + prototype_id_t proto_id; + } extra_ctors[] = { + { "Image", PROTO_ID_HTMLImgElement }, + { "Option", PROTO_ID_HTMLOptionElement }, + }; + compat_mode_t compat_mode; + IDispatch *prot, *ctor; + unsigned int i; + HRESULT hres; + + if(!ensure_real_info(&window->event_target.dispex)) + return E_OUTOFMEMORY; + compat_mode = dispex_compat_mode(&window->event_target.dispex); + + for(i = 0; i < ARRAY_SIZE(proxy_ctor_dispex); i++) { + if(proxy_ctor_mode_unavailable[i] & (1 << compat_mode)) + continue; + + if(!(prot = get_default_prototype(i + LEGACY_PROTOTYPE_COUNT, compat_mode, window))) + return E_OUTOFMEMORY; + + hres = window->event_target.dispex.proxy->lpVtbl->DefineConstructor(window->event_target.dispex.proxy, proxy_ctor_dispex[i].name, prot, NULL); + if(FAILED(hres)) + return hres; + } + + for(i = 0; i < ARRAY_SIZE(extra_ctors); i++) { + if(!(ctor = get_proxy_constructor_disp(window, extra_ctors[i].proto_id))) + return E_OUTOFMEMORY; + + if(!(prot = get_default_prototype(extra_ctors[i].proto_id, compat_mode, window))) + hres = E_OUTOFMEMORY; + else + hres = window->event_target.dispex.proxy->lpVtbl->DefineConstructor(window->event_target.dispex.proxy, extra_ctors[i].name, prot, ctor); + + IDispatch_Release(ctor); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + +static inline struct proxy_ctor *proxy_ctor_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, struct proxy_ctor, dispex); +} + +static void proxy_ctor_destructor(DispatchEx *dispex) +{ + struct proxy_ctor *This = proxy_ctor_from_DispatchEx(dispex); + free(This); +} + +static HRESULT proxy_ctor_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + switch(flags) { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + if(!res) + return E_INVALIDARG; + /* fall through */ + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: + return MSHTML_E_INVALID_ACTION; + case DISPATCH_PROPERTYGET: + V_VT(res) = VT_BSTR; + return dispex_to_string(dispex, &V_BSTR(res)); + case DISPATCH_PROPERTYPUTREF|DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT: + break; + default: + return E_INVALIDARG; + } + return S_OK; +} + +static const dispex_static_data_vtbl_t proxy_ctor_dispex_vtbl = { + .destructor = proxy_ctor_destructor, + .value = proxy_ctor_value +}; + +static HRESULT proxy_get_dispid(DispatchEx *dispex, const WCHAR *name, BOOL case_insens, DISPID *id) +{ + DWORD grfdex = case_insens ? fdexNameCaseInsensitive : fdexNameCaseSensitive; + struct proxy_prototype *prot = to_proxy_prototype(dispex); + dynamic_prop_t *dprop; + HRESULT hres; + BSTR bstr; + + if(!ensure_real_info(dispex) || !(bstr = SysAllocString(name))) + return E_OUTOFMEMORY; + + if(!prot && dispex->info->desc->prototype_id < 0) { + hres = dispex_get_builtin_id(dispex, bstr, grfdex, id); + if(hres != DISP_E_UNKNOWNNAME) { + SysFreeString(bstr); + return hres; + } + }else { + if(prot) { + hres = get_prototype_builtin_id(prot, bstr, grfdex, id); + if(hres != DISP_E_UNKNOWNNAME) { + SysFreeString(bstr); + return hres; + } + } + + if(dispex->info->desc->vtbl->get_dispid) { + hres = dispex->info->desc->vtbl->get_dispid(dispex, bstr, grfdex, id); + if(hres != DISP_E_UNKNOWNNAME) { + SysFreeString(bstr); + return hres; + } + } + } + SysFreeString(bstr); + + hres = get_dynamic_prop(dispex, name, grfdex, &dprop); + if(FAILED(hres)) + return hres; + + *id = DISPID_DYNPROP_0 + (dprop - dispex->dynamic_data->props); + return S_OK; +} + +static HRESULT WINAPI proxy_func_invoke(IDispatch *this_obj, void *context, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + func_info_t *func = context; + return invoke_builtin_function(this_obj, func, dp, res, ei, caller); +} + +static HRESULT WINAPI proxy_getter_invoke(IDispatch *this_obj, void *context, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + func_info_t *func = context; + DispatchEx *dispex; + IUnknown *iface; + HRESULT hres; + + hres = IDispatch_QueryInterface(this_obj, tid_ids[func->tid], (void**)&iface); + if(FAILED(hres) || !iface) + return E_UNEXPECTED; + + if(func->hook && (dispex = get_dispex_for_hook(iface))) { + hres = func->hook(dispex, DISPATCH_PROPERTYGET, dp, res, ei, caller); + IDispatchEx_Release(&dispex->IDispatchEx_iface); + if(hres != S_FALSE) + goto done; + } + hres = builtin_propget(iface, func, dp, res); + +done: + IUnknown_Release(iface); + return hres; +} + +static HRESULT WINAPI proxy_setter_invoke(IDispatch *this_obj, void *context, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + static DISPID propput_dispid = DISPID_PROPERTYPUT; + func_info_t *func = context; + DispatchEx *dispex; + IUnknown *iface; + HRESULT hres; + + dp->cNamedArgs = 1; + dp->rgdispidNamedArgs = &propput_dispid; + + hres = IDispatch_QueryInterface(this_obj, tid_ids[func->tid], (void**)&iface); + if(FAILED(hres) || !iface) + return E_UNEXPECTED; + + if(func->hook && (dispex = get_dispex_for_hook(iface))) { + hres = func->hook(dispex, DISPATCH_PROPERTYPUT, dp, res, ei, caller); + IDispatchEx_Release(&dispex->IDispatchEx_iface); + if(hres != S_FALSE) + goto done; + } + hres = builtin_propput(NULL, iface, func, dp, caller); + +done: + IUnknown_Release(iface); + return hres; +} + +static inline DispatchEx *impl_from_IDispatchEx(IDispatchEx *iface) +{ + return CONTAINING_RECORD(iface, DispatchEx, IDispatchEx_iface); +} + +static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + TRACE("%s (%p)->(%s %p)\n", This->info->desc->name, This, debugstr_mshtml_guid(riid), ppv); + + if(This->info->desc->vtbl->query_interface) { + *ppv = This->info->desc->vtbl->query_interface(This, riid); + if(*ppv) + goto ret; + } + + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) + *ppv = &This->IDispatchEx_iface; + else if(IsEqualGUID(&IID_IWineDispatchProxyPrivate, riid)) + *ppv = &This->IDispatchEx_iface; + else if(IsEqualGUID(&IID_nsXPCOMCycleCollectionParticipant, riid)) { + *ppv = &dispex_ccp; + return S_OK; + }else if(IsEqualGUID(&IID_nsCycleCollectionISupports, riid)) { + *ppv = &This->IDispatchEx_iface; + return S_OK; + }else if(IsEqualGUID(&IID_IDispatchJS, riid) || + IsEqualGUID(&IID_UndocumentedScriptIface, riid) || + IsEqualGUID(&IID_IMarshal, riid) || + IsEqualGUID(&IID_IManagedObject, riid)) { + *ppv = NULL; + return E_NOINTERFACE; + }else { + *ppv = NULL; + WARN("%s (%p)->(%s %p)\n", This->info->desc->name, This, debugstr_mshtml_guid(riid), ppv); + return E_NOINTERFACE; + } + +ret: + IDispatchEx_AddRef(&This->IDispatchEx_iface); + return S_OK; +} + +static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + LONG ref = ccref_incr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface); + + TRACE("%s (%p) ref=%ld\n", This->info->desc->name, This, ref); + + return ref; +} + +static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + LONG ref = ccref_decr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface, &dispex_ccp); + + TRACE("%s (%p) ref=%ld\n", This->info->desc->name, This, ref); + + /* Gecko ccref may not free the object immediately when ref count reaches 0, so we need + * an extra care for objects that need an immediate clean up. See Gecko's + * NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE_WITH_LAST_RELEASE for details. */ + if(!ref && This->info->desc->vtbl->last_release) { + ccref_incr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface); + This->info->desc->vtbl->last_release(This); + ccref_decr(&This->ccref, (nsISupports*)&This->IDispatchEx_iface, &dispex_ccp); + } + + return ref; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + TRACE("%s (%p)->(%p)\n", This->info->desc->name, This, pctinfo); + + *pctinfo = 1; + return S_OK; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + HRESULT hres; + + TRACE("%s (%p)->(%u %lu %p)\n", This->info->desc->name, This, iTInfo, lcid, ppTInfo); + + hres = get_typeinfo(This->info->desc->disp_tid, ppTInfo); + if(FAILED(hres)) + return hres; + + ITypeInfo_AddRef(*ppTInfo); + return S_OK; +} + +static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + HRESULT hres = S_OK; + + if(This->proxy) + return IDispatchEx_GetIDsOfNames((IDispatchEx*)This->proxy, riid, rgszNames, + cNames, lcid, rgDispId); + + TRACE("%s (%p)->(%s %p %u %lu %p)\n", This->info->desc->name, This, debugstr_guid(riid), rgszNames, + cNames, lcid, rgDispId); + + /* Native ignores all cNames > 1, and doesn't even fill them */ + if(cNames) + hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[0], 0, rgDispId); + + return hres; +} + +static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + if(This->proxy && dispIdMember >= 0) + return IDispatchEx_Invoke((IDispatchEx*)This->proxy, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + + TRACE("%s (%p)->(%ld %s %ld %d %p %p %p %p)\n", This->info->desc->name, This, dispIdMember, + debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + return dispex_invoke(This, (IDispatch*)iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL); +} + +static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + dynamic_prop_t *dprop; + HRESULT hres; + + if(This->proxy) + return IDispatchEx_GetDispID((IDispatchEx*)This->proxy, bstrName, grfdex, pid); + + TRACE("%s (%p)->(%s %lx %p)\n", This->info->desc->name, This, debugstr_w(bstrName), grfdex, pid); + + if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) + FIXME("Unsupported grfdex %lx\n", grfdex); + + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + + hres = dispex_get_builtin_id(This, bstrName, grfdex, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + + hres = get_dynamic_prop(This, bstrName, grfdex, &dprop); + if(FAILED(hres)) + return hres; + + *pid = DISPID_DYNPROP_0 + (dprop - This->dynamic_data->props); + return S_OK; +} + +static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + if(This->proxy && id >= 0) + return IDispatchEx_InvokeEx((IDispatchEx*)This->proxy, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + + TRACE("%s (%p)->(%lx %lx %x %p %p %p %p)\n", This->info->desc->name, This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + + return dispex_invoke(This, (IDispatch*)iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR name, DWORD grfdex) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + DISPID id; + HRESULT hres; + + if(This->proxy) + return IDispatchEx_DeleteMemberByName((IDispatchEx*)This->proxy, name, grfdex); + + TRACE("%s (%p)->(%s %lx)\n", This->info->desc->name, This, debugstr_w(name), grfdex); + + hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, name, grfdex & ~fdexNameEnsure, &id); + if(FAILED(hres)) { + TRACE("property %s not found\n", debugstr_w(name)); + return dispex_compat_mode(This) < COMPAT_MODE_IE8 ? E_NOTIMPL : hres; + } + + return dispex_delete_prop(This, id); +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + if(This->proxy && id >= 0) + return IDispatchEx_DeleteMemberByDispID((IDispatchEx*)This->proxy, id); + + TRACE("%s (%p)->(%lx)\n", This->info->desc->name, This, id); + + return dispex_delete_prop(This, id); +} + +static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + + if(This->proxy && id >= 0) + return IDispatchEx_GetMemberProperties((IDispatchEx*)This->proxy, id, grfdexFetch, pgrfdex); + + FIXME("%s (%p)->(%lx %lx %p)\n", This->info->desc->name, This, id, grfdexFetch, pgrfdex); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + func_info_t *func; + HRESULT hres; + + if(This->proxy && id >= 0) + return IDispatchEx_GetMemberName((IDispatchEx*)This->proxy, id, pbstrName); + + TRACE("%s (%p)->(%lx %p)\n", This->info->desc->name, This, id, pbstrName); + + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + + if(is_custom_dispid(id)) { + if(This->info->desc->vtbl->get_name) + return This->info->desc->vtbl->get_name(This, id, pbstrName); + return DISP_E_MEMBERNOTFOUND; + } + + if(is_dynamic_dispid(id)) { + DWORD idx = id - DISPID_DYNPROP_0; + + if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx) + return DISP_E_MEMBERNOTFOUND; + + *pbstrName = SysAllocString(This->dynamic_data->props[idx].name); + if(!*pbstrName) + return E_OUTOFMEMORY; + + return S_OK; + } + + hres = get_builtin_func(This->info, id, &func); + if(FAILED(hres)) + return hres; + + *pbstrName = SysAllocString(func->name); + if(!*pbstrName) + return E_OUTOFMEMORY; + return S_OK; +} + +static HRESULT next_dynamic_id(DispatchEx *dispex, DWORD idx, DISPID *ret_id) +{ + /* FIXME: Go through PROTREFs? (must exclude props with same name as builtins) */ + while(idx < dispex->dynamic_data->prop_cnt && + (dispex->dynamic_data->props[idx].flags & (DYNPROP_DELETED | DYNPROP_HIDDEN | DYNPROP_PROTREF))) + idx++; + + if(idx == dispex->dynamic_data->prop_cnt) { + *ret_id = DISPID_STARTENUM; + return S_FALSE; + } + + *ret_id = DISPID_DYNPROP_0+idx; + return S_OK; +} + +static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + func_info_t *func; + HRESULT hres; + + if(This->proxy) + return IDispatchEx_GetNextDispID((IDispatchEx*)This->proxy, grfdex, id, pid); + + TRACE("%s (%p)->(%lx %lx %p)\n", This->info->desc->name, This, grfdex, id, pid); + + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + + if(is_dynamic_dispid(id)) { + DWORD idx = id - DISPID_DYNPROP_0; + + if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx) + return DISP_E_MEMBERNOTFOUND; + + return next_dynamic_id(This, idx+1, pid); + } + + if(!is_custom_dispid(id)) { + if(id == DISPID_STARTENUM) { + func = This->info->funcs; + }else { + hres = get_builtin_func(This->info, id, &func); + if(FAILED(hres)) + return hres; + func++; + } + + while(func < This->info->funcs + This->info->func_cnt) { + if(func->func_disp_idx == -1) { + *pid = func->id; + return S_OK; + } + func++; + } + + id = DISPID_STARTENUM; + } + + if(This->info->desc->vtbl->next_dispid) { + hres = This->info->desc->vtbl->next_dispid(This, id, pid); + if(hres != S_FALSE) + return hres; + } + + if(get_dynamic_data(This) && This->dynamic_data->prop_cnt) + return next_dynamic_id(This, 0, pid); + + *pid = DISPID_STARTENUM; + return S_FALSE; +} + +static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + DispatchEx *This = impl_from_IDispatchEx(iface); + FIXME("%s (%p)->(%p)\n", This->info->desc->name, This, ppunk); + return E_NOTIMPL; +} + +static inline DispatchEx *impl_from_IWineDispatchProxyPrivate(IWineDispatchProxyPrivate *iface) +{ + return impl_from_IDispatchEx((IDispatchEx*)iface); +} + +static IWineDispatchProxyCbPrivate** WINAPI WineDispatchProxyPrivate_GetProxyFieldRef(IWineDispatchProxyPrivate *iface) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + return &This->proxy; +} + +static IDispatch* WINAPI WineDispatchProxyPrivate_GetDefaultPrototype(IWineDispatchProxyPrivate *iface, IWineDispatchProxyPrivate *window) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + HTMLWindow *base_window; + prototype_id_t prot_id; + + if(!ensure_real_info(This)) + return NULL; + + prot_id = This->info->desc->prototype_id; + if(prot_id < 0) + return (IDispatch*)IntToPtr(prot_id); + + if(prot_id < LEGACY_PROTOTYPE_COUNT) + return (IDispatch*)IntToPtr(PROTO_ID_NULL); + + if(!(base_window = unsafe_HTMLWindow_from_IWineDispatchProxyPrivate(window))) + return (IDispatch*)IntToPtr(PROTO_ID_Object); + + return get_default_prototype(prot_id, dispex_compat_mode(This), base_window->inner_window); +} + +static HRESULT WINAPI WineDispatchProxyPrivate_GetDefaultConstructor(IWineDispatchProxyPrivate *iface, IWineDispatchProxyPrivate *window, IDispatch **ret) +{ + static const prototype_id_t special_ctors[] = { + PROTO_ID_DOMParser, + PROTO_ID_MutationObserver, + PROTO_ID_HTMLXMLHttpRequest, + PROTO_ID_HTMLXDomainRequest + }; + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + struct proxy_prototype *prot = to_proxy_prototype(This); + struct proxy_ctor *ctor; + HTMLWindow *base_window; + prototype_id_t prot_id; + IDispatch **entry; + unsigned i; + + if(!prot || !(base_window = unsafe_HTMLWindow_from_IWineDispatchProxyPrivate(window))) { + /* Not a prototype, so no constructor */ + *ret = NULL; + return S_OK; + } + + prot_id = CONTAINING_RECORD(prot->dispex.info->desc, struct prototype_static_data, dispex) - prototype_static_data; + + entry = &base_window->inner_window->proxy_globals->ctor[prot_id - LEGACY_PROTOTYPE_COUNT]; + if(*entry) { + *ret = *entry; + IDispatch_AddRef(*entry); + return S_OK; + } + + for(i = 0; i < ARRAY_SIZE(special_ctors); i++) { + IDispatch *disp; + if(prot_id != special_ctors[i]) + continue; + + disp = get_proxy_constructor_disp(CONTAINING_RECORD((IDispatchEx*)window, HTMLWindow, IDispatchEx_iface)->inner_window, prot_id); + if(!disp) + return E_OUTOFMEMORY; + + *entry = This->proxy->lpVtbl->CreateConstructor(This->proxy, disp, proxy_ctor_dispex[prot_id - LEGACY_PROTOTYPE_COUNT].name); + IDispatch_Release(disp); + if(!*entry) + return E_OUTOFMEMORY; + + *ret = *entry; + IDispatch_AddRef(*entry); + return S_OK; + } + + if(!(ctor = malloc(sizeof(*ctor)))) + return E_OUTOFMEMORY; + + init_dispatch(&ctor->dispex, &proxy_ctor_dispex[prot_id - LEGACY_PROTOTYPE_COUNT], NULL, dispex_compat_mode(This)); + + IDispatchEx_AddRef(&ctor->dispex.IDispatchEx_iface); + *entry = (IDispatch*)&ctor->dispex.IDispatchEx_iface; + *ret = *entry; + return S_OK; +} + +static BOOL WINAPI WineDispatchProxyPrivate_IsConstructor(IWineDispatchProxyPrivate *iface) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + return This->info->desc >= &proxy_ctor_dispex[0] && This->info->desc < &proxy_ctor_dispex[ARRAY_SIZE(proxy_ctor_dispex)]; +} + +static HRESULT WINAPI WineDispatchProxyPrivate_PropFixOverride(IWineDispatchProxyPrivate *iface, struct proxy_prop_info *info) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + HRESULT hres; + + if(!This->info->desc->vtbl->override) + return S_FALSE; + + /* We only care about custom props, as those are the only ones which can mismatch. + Some objects with custom props (such as the Storage objects) can be out of sync, + because the underlying storage is changed asynchronously (e.g. the backing file + in localStorage), so the prop may not exist at this point, even if it did before. */ + if(info->dispid != DISPID_UNKNOWN && !is_custom_dispid(info->dispid)) + return S_FALSE; + + hres = This->info->desc->vtbl->get_dispid(This, (WCHAR*)info->name, fdexNameCaseSensitive, &info->dispid); + if(hres == DISP_E_UNKNOWNNAME) { + if(info->dispid == DISPID_UNKNOWN) + return S_FALSE; + info->dispid = DISPID_UNKNOWN; + return S_OK; + } + if(FAILED(hres)) + return hres; + info->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + return S_OK; +} + +static HRESULT WINAPI WineDispatchProxyPrivate_PropOverride(IWineDispatchProxyPrivate *iface, const WCHAR *name, VARIANT *value) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + + if(!This->info->desc->vtbl->override) + return S_FALSE; + return This->info->desc->vtbl->override(This, name, value); +} + +static HRESULT WINAPI WineDispatchProxyPrivate_PropDefineOverride(IWineDispatchProxyPrivate *iface, struct proxy_prop_info *info) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + HRESULT hres; + + if(!This->info->desc->vtbl->override) + return S_FALSE; + + hres = This->info->desc->vtbl->get_dispid(This, (WCHAR*)info->name, fdexNameEnsure | fdexNameCaseSensitive, &info->dispid); + if(FAILED(hres)) + return (hres == DISP_E_UNKNOWNNAME) ? S_FALSE : hres; + + info->func[0].invoke = NULL; + info->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + return S_OK; +} + +static HRESULT WINAPI WineDispatchProxyPrivate_PropGetInfo(IWineDispatchProxyPrivate *iface, const WCHAR *name, + BOOL case_insens, struct proxy_prop_info *info) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + func_info_t *func; + HRESULT hres; + + info->func[0].invoke = NULL; + + hres = proxy_get_dispid(This, name, case_insens, &info->dispid); + if(FAILED(hres)) + return hres; + + if(is_dynamic_dispid(info->dispid)) { + info->name = This->dynamic_data->props[info->dispid - DISPID_DYNPROP_0].name; + info->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + return S_OK; + } + + if(is_custom_dispid(info->dispid)) { + info->name = name; /* FIXME */ + info->flags = PROPF_WRITABLE; + if(This->info->desc->vtbl->delete) + info->flags |= PROPF_CONFIGURABLE; + if(This->info->desc->vtbl->next_dispid) + info->flags |= PROPF_ENUMERABLE; + return S_OK; + } + + hres = get_builtin_func_prot(This, info->dispid, &func); + if(FAILED(hres)) + return (hres == DISP_E_MEMBERNOTFOUND) ? E_UNEXPECTED : hres; + info->func[0].context = info->func[1].context = func; + info->name = func->name; + + if(func->func_disp_idx >= 0) { + if(This->dynamic_data && This->dynamic_data->func_disps + && This->dynamic_data->func_disps[func->func_disp_idx].func_obj) { + func_obj_entry_t *entry = This->dynamic_data->func_disps + func->func_disp_idx; + + if((IDispatch*)&entry->func_obj->dispex.IDispatchEx_iface != V_DISPATCH(&entry->val)) { + info->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; + return S_OK; + } + } + info->flags = PROPF_METHOD | func->argc | PROPF_WRITABLE | PROPF_CONFIGURABLE; + info->func[0].invoke = proxy_func_invoke; + info->func[1].invoke = NULL; + return S_OK; + } + + info->flags = PROPF_CONFIGURABLE | (func->put_vtbl_off ? PROPF_WRITABLE : 0); + if(func->func_disp_idx == -1) + info->flags |= PROPF_ENUMERABLE; + info->func[0].invoke = proxy_getter_invoke; + info->func[1].invoke = func->put_vtbl_off ? proxy_setter_invoke : NULL; + return S_OK; +} + +static HRESULT WINAPI WineDispatchProxyPrivate_PropInvoke(IWineDispatchProxyPrivate *iface, IDispatch *this_obj, DISPID id, + LCID lcid, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); - TRACE("%s (%p)->(%ld %s %ld %d %p %p %p %p)\n", This->info->desc->name, This, dispIdMember, - debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + if(id == DISPID_VALUE && to_proxy_prototype(This)) + return dispex_value(This, lcid, flags, dp, ret, ei, caller); - return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, NULL); + return dispex_invoke(This, this_obj, id, lcid, flags, dp, ret, ei, caller); } -static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +static HRESULT WINAPI WineDispatchProxyPrivate_PropDelete(IWineDispatchProxyPrivate *iface, DISPID id) { - DispatchEx *This = impl_from_IDispatchEx(iface); - dynamic_prop_t *dprop; - HRESULT hres; + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); - TRACE("%s (%p)->(%s %lx %p)\n", This->info->desc->name, This, debugstr_w(bstrName), grfdex, pid); + return dispex_delete_prop(This, id); +} - if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) - FIXME("Unsupported grfdex %lx\n", grfdex); +static HRESULT WINAPI WineDispatchProxyPrivate_PropEnum(IWineDispatchProxyPrivate *iface) +{ + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); + struct proxy_prototype *prot = to_proxy_prototype(This); + IWineDispatchProxyCbPrivate *obj = This->proxy; + func_info_t *func = NULL, *func_end = NULL; + dynamic_prop_t *dyn_prop, *dyn_prop_end; + dispex_dynamic_data_t *dyn_data; + HRESULT hres; + HRESULT (STDMETHODCALLTYPE *callback)(IWineDispatchProxyCbPrivate*,const WCHAR*) = obj->lpVtbl->PropEnum; if(!ensure_real_info(This)) return E_OUTOFMEMORY; - hres = get_builtin_id(This, bstrName, grfdex, pid); - if(hres != DISP_E_UNKNOWNNAME) - return hres; + if(prot) { + dispex_data_t *info = prot->dispex.info; + func = info->funcs; + func_end = func + info->func_cnt; + }else if(This->info->desc->prototype_id < 0) { + func = This->info->funcs; + func_end = func + This->info->func_cnt; + } - hres = get_dynamic_prop(This, bstrName, grfdex, &dprop); - if(FAILED(hres)) - return hres; + for(; func != func_end; func++) { + if(func->func_disp_idx == -1) { + hres = callback(obj, func->name); + if(FAILED(hres)) + return hres; + } + } + + if(This->info->desc->vtbl->next_dispid) { + const dispex_static_data_vtbl_t *vtbl = This->info->desc->vtbl; + DISPID id = DISPID_STARTENUM; + BSTR name; + + do { + hres = vtbl->next_dispid(This, id, &id); + if(hres != S_OK) + break; + hres = vtbl->get_name(This, id, &name); + if(SUCCEEDED(hres)) { + hres = callback(obj, name); + SysFreeString(name); + } + } while(SUCCEEDED(hres)); + + if(FAILED(hres)) + return hres; + } + + if(!(dyn_data = get_dynamic_data(This))) + return E_OUTOFMEMORY; + + for(dyn_prop = dyn_data->props, dyn_prop_end = dyn_prop + dyn_data->prop_cnt; dyn_prop != dyn_prop_end; dyn_prop++) { + if(!(dyn_prop->flags & (DYNPROP_DELETED | DYNPROP_HIDDEN | DYNPROP_PROTREF))) { + hres = callback(obj, dyn_prop->name); + if(FAILED(hres)) + return hres; + } + } - *pid = DISPID_DYNPROP_0 + (dprop - This->dynamic_data->props); return S_OK; } -static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, - VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +static HRESULT WINAPI WineDispatchProxyPrivate_ToString(IWineDispatchProxyPrivate *iface, BSTR *string) { - DispatchEx *This = impl_from_IDispatchEx(iface); - HRESULT hres; + DispatchEx *This = impl_from_IWineDispatchProxyPrivate(iface); - TRACE("%s (%p)->(%lx %lx %x %p %p %p %p)\n", This->info->desc->name, This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return dispex_to_string(This, string); +} - if(!ensure_real_info(This)) +static IWineDispatchProxyPrivateVtbl WineDispatchProxyPrivateVtbl = { + { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + DispatchEx_InvokeEx, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent + }, + + /* IWineDispatchProxyPrivate extension */ + WineDispatchProxyPrivate_GetProxyFieldRef, + WineDispatchProxyPrivate_GetDefaultPrototype, + WineDispatchProxyPrivate_GetDefaultConstructor, + WineDispatchProxyPrivate_IsConstructor, + WineDispatchProxyPrivate_PropFixOverride, + WineDispatchProxyPrivate_PropOverride, + WineDispatchProxyPrivate_PropDefineOverride, + WineDispatchProxyPrivate_PropGetInfo, + WineDispatchProxyPrivate_PropInvoke, + WineDispatchProxyPrivate_PropDelete, + WineDispatchProxyPrivate_PropEnum, + WineDispatchProxyPrivate_ToString +}; + +static inline BOOL is_legacy_prototype(IDispatch *disp) +{ + DispatchEx *dispex; + + if(!disp || disp->lpVtbl != (const IDispatchVtbl*)&WineDispatchProxyPrivateVtbl) + return FALSE; + dispex = impl_from_IDispatchEx((IDispatchEx*)disp); + + return dispex->info->desc >= &legacy_prototype_dispex[0] && dispex->info->desc < &legacy_prototype_dispex[ARRAY_SIZE(legacy_prototype_dispex)]; +} + +HRESULT dispex_invoke(DispatchEx *dispex, IDispatch *this_obj, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *res, EXCEPINFO *pei, IServiceProvider *caller) +{ + HRESULT hres; + + if(!ensure_real_info(dispex)) return E_OUTOFMEMORY; if(wFlags == (DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF)) @@ -1701,36 +3482,45 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc switch(get_dispid_type(id)) { case DISPEXPROP_CUSTOM: - if(!This->info->desc->vtbl->invoke) + if(!dispex->info->desc->vtbl->invoke) return DISP_E_MEMBERNOTFOUND; - return This->info->desc->vtbl->invoke(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return dispex->info->desc->vtbl->invoke(dispex, this_obj, id, lcid, wFlags, pdp, res, pei, caller); case DISPEXPROP_DYNAMIC: { DWORD idx = id - DISPID_DYNPROP_0; dynamic_prop_t *prop; - if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx) + if(!get_dynamic_data(dispex) || dispex->dynamic_data->prop_cnt <= idx) return DISP_E_MEMBERNOTFOUND; - prop = This->dynamic_data->props+idx; + prop = dispex->dynamic_data->props+idx; switch(wFlags) { case DISPATCH_METHOD|DISPATCH_PROPERTYGET: - if(!pvarRes) + if(!res) return E_INVALIDARG; /* fall through */ case DISPATCH_METHOD: + fixup_prop_ref(dispex, prop); + if(prop->flags & DYNPROP_DELETED) + return DISP_E_MEMBERNOTFOUND; + if(prop->flags & DYNPROP_PROTREF) + prop = &dispex->prototype->dispex.dynamic_data->props[V_UI4(&prop->var)]; + if(V_VT(&prop->var) != VT_DISPATCH) { FIXME("invoke %s\n", debugstr_variant(&prop->var)); return E_NOTIMPL; } - return invoke_disp_value(This, V_DISPATCH(&prop->var), lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return invoke_disp_value(this_obj, V_DISPATCH(&prop->var), lcid, wFlags, pdp, res, pei, caller); case DISPATCH_PROPERTYGET: + fixup_prop_ref(dispex, prop); if(prop->flags & DYNPROP_DELETED) return DISP_E_MEMBERNOTFOUND; - V_VT(pvarRes) = VT_EMPTY; - return variant_copy(pvarRes, &prop->var); + if(prop->flags & DYNPROP_PROTREF) + prop = &dispex->prototype->dispex.dynamic_data->props[V_UI4(&prop->var)]; + V_VT(res) = VT_EMPTY; + return variant_copy(res, &prop->var); case DISPATCH_PROPERTYPUT: if(pdp->cArgs != 1 || (pdp->cNamedArgs == 1 && *pdp->rgdispidNamedArgs != DISPID_PROPERTYPUT) || pdp->cNamedArgs > 1) { @@ -1744,7 +3534,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(FAILED(hres)) return hres; - prop->flags &= ~DYNPROP_DELETED; + prop->flags &= ~(DYNPROP_DELETED | DYNPROP_PROTREF); return S_OK; default: FIXME("unhandled wFlags %x\n", wFlags); @@ -1754,8 +3544,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc case DISPEXPROP_BUILTIN: if(wFlags == DISPATCH_CONSTRUCT) { if(id == DISPID_VALUE) { - if(This->info->desc->vtbl->value) { - return This->info->desc->vtbl->value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(dispex->info->desc->vtbl->value) { + return dispex->info->desc->vtbl->value(dispex, lcid, wFlags, pdp, res, pei, caller); } FIXME("DISPATCH_CONSTRUCT flag but missing value function\n"); return E_FAIL; @@ -1764,203 +3554,115 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc return E_FAIL; } - return invoke_builtin_prop(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return invoke_builtin_prop(dispex, this_obj, id, lcid, wFlags, pdp, res, pei, caller); default: assert(0); return E_FAIL; } } -static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR name, DWORD grfdex) +HRESULT dispex_delete_prop(DispatchEx *dispex, DISPID id) { - DispatchEx *This = impl_from_IDispatchEx(iface); - DISPID id; HRESULT hres; - TRACE("%s (%p)->(%s %lx)\n", This->info->desc->name, This, debugstr_w(name), grfdex); - - hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, name, grfdex & ~fdexNameEnsure, &id); - if(FAILED(hres)) { - compat_mode_t compat_mode = dispex_compat_mode(This); - TRACE("property %s not found\n", debugstr_w(name)); - return compat_mode < COMPAT_MODE_IE8 ? E_NOTIMPL : - compat_mode < COMPAT_MODE_IE9 ? hres : S_OK; - } - - return IDispatchEx_DeleteMemberByDispID(&This->IDispatchEx_iface, id); -} - -static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); - - TRACE("%s (%p)->(%lx)\n", This->info->desc->name, This, id); - - if(is_custom_dispid(id) && This->info->desc->vtbl->delete) - return This->info->desc->vtbl->delete(This, id); + if(is_custom_dispid(id) && dispex->info->desc->vtbl->delete) + return dispex->info->desc->vtbl->delete(dispex, id); - if(dispex_compat_mode(This) < COMPAT_MODE_IE8) { + if(dispex_compat_mode(dispex) < COMPAT_MODE_IE8) { /* Not implemented by IE */ return E_NOTIMPL; } - if(is_dynamic_dispid(id)) { + switch(get_dispid_type(id)) { + case DISPEXPROP_DYNAMIC: { DWORD idx = id - DISPID_DYNPROP_0; dynamic_prop_t *prop; - if(!get_dynamic_data(This) || idx >= This->dynamic_data->prop_cnt) + if(!get_dynamic_data(dispex) || idx >= dispex->dynamic_data->prop_cnt) return S_OK; - prop = This->dynamic_data->props + idx; - VariantClear(&prop->var); - prop->flags |= DYNPROP_DELETED; + prop = dispex->dynamic_data->props + idx; + if(!(prop->flags & DYNPROP_PROTREF)) { + VariantClear(&prop->var); + prop->flags |= DYNPROP_DELETED; + } return S_OK; } + case DISPEXPROP_BUILTIN: { + func_info_t *func; - return S_OK; -} - -static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); - FIXME("%s (%p)->(%lx %lx %p)\n", This->info->desc->name, This, id, grfdexFetch, pgrfdex); - return E_NOTIMPL; -} - -static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); - func_info_t *func; - HRESULT hres; - - TRACE("%s (%p)->(%lx %p)\n", This->info->desc->name, This, id, pbstrName); - - if(!ensure_real_info(This)) - return E_OUTOFMEMORY; - - if(is_custom_dispid(id)) { - if(This->info->desc->vtbl->get_name) - return This->info->desc->vtbl->get_name(This, id, pbstrName); - return DISP_E_MEMBERNOTFOUND; - } - - if(is_dynamic_dispid(id)) { - DWORD idx = id - DISPID_DYNPROP_0; - - if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx) - return DISP_E_MEMBERNOTFOUND; - - *pbstrName = SysAllocString(This->dynamic_data->props[idx].name); - if(!*pbstrName) + if(!ensure_real_info(dispex)) return E_OUTOFMEMORY; + hres = get_builtin_func_prot(dispex, id, &func); + if(FAILED(hres)) + return hres; + + if(func->func_disp_idx >= 0) + reset_builtin_func(dispex, func); return S_OK; } - - hres = get_builtin_func(This->info, id, &func); - if(FAILED(hres)) - return hres; - - *pbstrName = SysAllocString(func->name); - if(!*pbstrName) - return E_OUTOFMEMORY; - return S_OK; -} - -static HRESULT next_dynamic_id(DispatchEx *dispex, DWORD idx, DISPID *ret_id) -{ - while(idx < dispex->dynamic_data->prop_cnt && - (dispex->dynamic_data->props[idx].flags & (DYNPROP_DELETED | DYNPROP_HIDDEN))) - idx++; - - if(idx == dispex->dynamic_data->prop_cnt) { - *ret_id = DISPID_STARTENUM; - return S_FALSE; + default: + break; } - *ret_id = DISPID_DYNPROP_0+idx; return S_OK; } -static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +HRESULT dispex_builtin_props_to_json(DispatchEx *dispex, VARIANT *ret) { - DispatchEx *This = impl_from_IDispatchEx(iface); - func_info_t *func; + static DISPID propput_dispid = DISPID_PROPERTYPUT; + static WCHAR toJSONW[] = L"toJSON"; + IWineDispatchProxyCbPrivate *proxy; + func_info_t *func, *end; + DispatchEx *subdispex; + DISPID id, to_json; + IDispatchEx *json; HRESULT hres; + VARIANT var; + DISPPARAMS dp = { 0 }, put_dp = { &var, &propput_dispid, 1, 1 }; - TRACE("%s (%p)->(%lx %lx %p)\n", This->info->desc->name, This, grfdex, id, pid); + if(!(proxy = dispex->proxy)) + return E_UNEXPECTED; - if(!ensure_real_info(This)) + if(!ensure_real_info(dispex)) return E_OUTOFMEMORY; - if(is_dynamic_dispid(id)) { - DWORD idx = id - DISPID_DYNPROP_0; - - if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx) - return DISP_E_MEMBERNOTFOUND; - - return next_dynamic_id(This, idx+1, pid); - } + hres = proxy->lpVtbl->CreateObject(proxy, &json); + if(FAILED(hres)) + return hres; - if(!is_custom_dispid(id)) { - if(id == DISPID_STARTENUM) { - func = This->info->funcs; - }else { - hres = get_builtin_func(This->info, id, &func); - if(FAILED(hres)) - return hres; - func++; - } + for(func = dispex->info->funcs, end = func + dispex->info->func_cnt; func < end; func++) { + if(func->func_disp_idx != -1) + continue; + hres = proxy_getter_invoke((IDispatch*)&dispex->IDispatchEx_iface, func, &dp, &var, NULL, NULL); + if(SUCCEEDED(hres)) { + hres = IDispatchEx_GetDispID(json, func->name, fdexNameEnsure | fdexNameCaseSensitive, &id); - while(func < This->info->funcs + This->info->func_cnt) { - if(func->func_disp_idx == -1) { - *pid = func->id; - return S_OK; + if(SUCCEEDED(hres) && V_VT(&var) == VT_DISPATCH && (subdispex = get_dispex_for_hook((IUnknown*)V_DISPATCH(&var)))) { + if(SUCCEEDED(dispex_get_builtin_id(subdispex, toJSONW, fdexNameCaseSensitive, &to_json))) { + VariantClear(&var); + hres = dispex_call_builtin(subdispex, to_json, &dp, &var, NULL, NULL); + } + IDispatchEx_Release(&subdispex->IDispatchEx_iface); } - func++; + if(SUCCEEDED(hres)) + hres = IDispatchEx_InvokeEx(json, id, 0, DISPATCH_PROPERTYPUT, &put_dp, NULL, NULL, NULL); + VariantClear(&var); } - - id = DISPID_STARTENUM; - } - - if(This->info->desc->vtbl->next_dispid) { - hres = This->info->desc->vtbl->next_dispid(This, id, pid); - if(hres != S_FALSE) + if(FAILED(hres)) { + IDispatchEx_Release(json); return hres; + } } - if(get_dynamic_data(This) && This->dynamic_data->prop_cnt) - return next_dynamic_id(This, 0, pid); - - *pid = DISPID_STARTENUM; - return S_FALSE; -} - -static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) -{ - DispatchEx *This = impl_from_IDispatchEx(iface); - FIXME("%s (%p)->(%p)\n", This->info->desc->name, This, ppunk); - return E_NOTIMPL; + if(ret) { + V_VT(ret) = VT_DISPATCH; + V_DISPATCH(ret) = (IDispatch*)json; + } + return hres; } -static IDispatchExVtbl DispatchExVtbl = { - DispatchEx_QueryInterface, - DispatchEx_AddRef, - DispatchEx_Release, - DispatchEx_GetTypeInfoCount, - DispatchEx_GetTypeInfo, - DispatchEx_GetIDsOfNames, - DispatchEx_Invoke, - DispatchEx_GetDispID, - DispatchEx_InvokeEx, - DispatchEx_DeleteMemberByName, - DispatchEx_DeleteMemberByDispID, - DispatchEx_GetMemberProperties, - DispatchEx_GetMemberName, - DispatchEx_GetNextDispID, - DispatchEx_GetNameSpaceParent -}; - static nsresult NSAPI dispex_traverse(void *ccp, void *p, nsCycleCollectionTraversalCallback *cb) { DispatchEx *This = impl_from_IDispatchEx(p); @@ -1968,6 +3670,12 @@ static nsresult NSAPI dispex_traverse(void *ccp, void *p, nsCycleCollectionTrave describe_cc_node(&This->ccref, This->info->desc->name, cb); + if(This->prototype) + note_cc_edge((nsISupports*)&This->prototype->dispex.IDispatchEx_iface, "prototype", cb); + + if(This->proxy) + note_cc_edge((nsISupports*)This->proxy, "proxy", cb); + if(This->info->desc->vtbl->traverse) This->info->desc->vtbl->traverse(This, cb); @@ -1995,6 +3703,18 @@ void dispex_props_unlink(DispatchEx *This) { dynamic_prop_t *prop; + if(This->prototype) { + struct legacy_prototype *prototype = This->prototype; + This->prototype = NULL; + IDispatchEx_Release(&prototype->dispex.IDispatchEx_iface); + } + + if(This->proxy) { + IWineDispatchProxyCbPrivate *proxy = This->proxy; + This->proxy = NULL; + proxy->lpVtbl->Unlinked(proxy, FALSE); + } + if(!This->dynamic_data) return; @@ -2038,6 +3758,12 @@ static void NSAPI dispex_delete_cycle_collectable(void *p) if(This->info->desc->vtbl->unlink) This->info->desc->vtbl->unlink(This); + if(This->prototype) + IDispatchEx_Release(&This->prototype->dispex.IDispatchEx_iface); + + if(This->proxy) + This->proxy->lpVtbl->Unlinked(This->proxy, FALSE); + if(!This->dynamic_data) goto destructor; @@ -2083,11 +3809,22 @@ const void *dispex_get_vtbl(DispatchEx *dispex) return dispex->info->desc->vtbl; } -void init_dispatch(DispatchEx *dispex, dispex_static_data_t *data, compat_mode_t compat_mode) +void finalize_delayed_init_dispex(DispatchEx *This, HTMLInnerWindow *window, dispex_static_data_t *data) +{ + compat_mode_t compat_mode = window->doc->document_mode; + + This->info = ensure_dispex_info(data, compat_mode); + if(!This->proxy && data->prototype_id < ARRAY_SIZE(window->legacy_prototypes)) + This->prototype = get_legacy_prototype(window, data->prototype_id, compat_mode); +} + +void init_dispatch(DispatchEx *dispex, dispex_static_data_t *data, HTMLInnerWindow *window, compat_mode_t compat_mode) { assert(compat_mode < COMPAT_MODE_CNT); - dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; + dispex->IDispatchEx_iface.lpVtbl = (const IDispatchExVtbl*)&WineDispatchProxyPrivateVtbl; + dispex->proxy = NULL; + dispex->prototype = NULL; dispex->dynamic_data = NULL; ccref_init(&dispex->ccref, 1); @@ -2107,5 +3844,28 @@ void init_dispatch(DispatchEx *dispex, dispex_static_data_t *data, compat_mode_t dispex->info = data->delayed_init_info; }else { dispex->info = ensure_dispex_info(data, compat_mode); + if(window) { + if(compat_mode >= COMPAT_MODE_IE9) { + IWineDispatchProxyCbPrivate *proxy = window->event_target.dispex.proxy; + if(!proxy) { + init_proxies(window); + proxy = window->event_target.dispex.proxy; + } + if(proxy) { + HRESULT hres = proxy->lpVtbl->InitProxy(proxy, (IDispatch*)&dispex->IDispatchEx_iface); + if(hres == E_UNEXPECTED) { + /* Possible element (e.g. + diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 9f46de12466..cc81a79bb39 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -58,7 +58,6 @@ if(window.addEventListener) { pageshow_fired = true; var r = Object.prototype.toString.call(e); - todo_wine. ok(r === "[object PageTransitionEvent]", "pageshow toString = " + r); ok("persisted" in e, "'persisted' not in pageshow event"); ok(document.readyState === "complete", "pageshow readyState = " + document.readyState); @@ -70,7 +69,6 @@ if(window.addEventListener) { ok(document.documentMode >= 11, "pagehide fired"); var r = Object.prototype.toString.call(e); - todo_wine. ok(r === "[object PageTransitionEvent]", "pagehide toString = " + r); ok("persisted" in e, "'persisted' not in pagehide event"); }, true); @@ -234,7 +232,7 @@ sync_test("builtin_toString", function() { ]; var v = document.documentMode, e; - function test(msg, obj, name, tostr) { + function test(msg, obj, name, tostr, ctor_name) { var s; if(obj.toString) { s = obj.toString(); @@ -242,8 +240,34 @@ sync_test("builtin_toString", function() { ok(s === (tostr ? tostr : (v < 9 ? "[object]" : "[object " + name + "]")), msg + " toString returned " + s); } s = Object.prototype.toString.call(obj); - todo_wine_if(v >= 9 && name != "Object"). + todo_wine_if(name !== "HTMLElement" && s === "[object HTMLElement]"). ok(s === (v < 9 ? "[object Object]" : "[object " + name + "]"), msg + " Object.toString returned " + s); + + if(v >= 9) { + eval("var c = window." + name + ";"); + todo_wine_if(name !== "HTMLElement" && s === "[object HTMLElement]"). + ok(c !== undefined, name + " is undefined"); + if(!ctor_name) ctor_name = name; + if(c === undefined) return; /* todo_wine */ + + s = Object.getPrototypeOf(obj); + if(name === "Object") { + ok(s === null, msg + "'s proto is not null: " + s); + + s = Object.prototype.toString.call(c); + ok(s === "[object Function]", msg + " Object.toString on constructor returned " + s); + }else { + ok(s === c.prototype, msg + "'s proto is not its constructor's prototype"); + + s = Object.prototype.toString.call(c); + todo_wine_if(name !== "HTMLElement" && s === "[object HTMLElement]"). + ok(s === "[object " + ctor_name + "]", msg + " Object.toString on constructor returned " + s); + + s = Object.prototype.toString.call(c.prototype); + todo_wine_if(name !== "HTMLElement" && s === "[object HTMLElementPrototype]"). + ok(s === "[object " + name + "Prototype]", msg + " Object.toString on constructor.prototype returned " + s); + } + } } for(var i = 0; i < tags.length; i++) @@ -293,12 +317,12 @@ sync_test("builtin_toString", function() { if(!localStorage) win_skip("localStorage is buggy and not available, skipping"); test("attribute", document.createAttribute("class"), "Attr"); - if(false /* todo_wine */) test("attributes", e.attributes, "NamedNodeMap"); + test("attributes", e.attributes, "NamedNodeMap"); test("childNodes", document.body.childNodes, "NodeList"); if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties"); - if(v >= 11 /* todo_wine */) test("document", document, v < 11 ? "Document" : "HTMLDocument"); + test("document", document, v < 11 ? "Document" : "HTMLDocument"); test("elements", document.getElementsByTagName("body"), "HTMLCollection"); test("history", window.history, "History"); test("implementation", document.implementation, "DOMImplementation"); @@ -320,17 +344,24 @@ sync_test("builtin_toString", function() { test("textNode", document.createTextNode("testNode"), "Text", v < 9 ? "testNode" : null); test("textRange", txtRange, "TextRange"); test("window", window, "Window", "[object Window]"); - test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest"); + test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest", null, "Function"); if(v < 10) { test("namespaces", document.namespaces, "MSNamespaceInfoCollection"); } if(v < 11) { test("eventObject", document.createEventObject(), "MSEventObj"); test("selection", document.selection, "MSSelection"); + test("XDomainRequest", new XDomainRequest(), "XDomainRequest", null, "Function"); } if(v >= 9) { + var xml = new DOMParser().parseFromString("foobar", "text/xml"); test("computedStyle", window.getComputedStyle(e), "CSSStyleDeclaration"); test("doctype", document.doctype, "DocumentType"); + test("domParser", new DOMParser(), "DOMParser", null, "Function"); + test("svgDocument", new DOMParser().parseFromString("foobar", "image/svg+xml"), v < 11 ? "Document" : "XMLDocument"); + test("xhtmlDocument", new DOMParser().parseFromString("foobar", "application/xhtml+xml"), v < 11 ? "Document" : "XMLDocument"); + test("xmlDocument", xml, v < 11 ? "Document" : "XMLDocument"); + test("xmlElement", xml.getElementsByTagName("tag")[0], "Element"); test("Event", document.createEvent("Event"), "Event"); test("CustomEvent", document.createEvent("CustomEvent"), "CustomEvent"); @@ -344,7 +375,9 @@ sync_test("builtin_toString", function() { test("mediaQueryList", window.matchMedia("(hover:hover)"), "MediaQueryList"); } if(v >= 11) { - test("MutationObserver", new window.MutationObserver(function() {}), "MutationObserver"); + test("crypto", window.msCrypto, "Crypto"); + test("crypto.subtle", window.msCrypto.subtle, "SubtleCrypto"); + test("MutationObserver", new window.MutationObserver(function() {}), "MutationObserver", null, "Function"); } if(v >= 9) { document.body.innerHTML = ""; @@ -352,6 +385,1184 @@ sync_test("builtin_toString", function() { } }); +sync_test("builtin_obj", function() { + var v = document.documentMode; + var f = document.createElement; + var e; + + if(v < 9) { + ok(!(window instanceof Object), "window instance of Object"); + ok(!(document instanceof Object), "document instance of Object"); + ok(!(f.apply instanceof Function), "f.apply instance of Function"); + ok(!(f.call instanceof Function), "f.call instance of Function"); + ok(!("arguments" in f), "arguments in f"); + ok(!("length" in f), "length in f"); + e = 0; + try { + f.toString(); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01b6 - 0x80000000, "[f.toString] e = " + e); + try { + window.toString.call(null); + ok(false, "expected exception calling window.toString with null context"); + }catch(ex) {} + }else { + ok(window instanceof Object, "window not instance of Object"); + ok(document instanceof Object, "document not instance of Object"); + ok(Object.isExtensible(window), "window is not extensible"); + ok(Object.isExtensible(document), "document is not extensible"); + + ok(f.toString() === "\nfunction createElement() {\n [native code]\n}\n", "f.toString() = " + f.toString()); + ok(Object.getPrototypeOf(f) === Function.prototype, "unexpected document.createElement prototype"); + ok(Object.getPrototypeOf(f.apply) === Function.prototype, "unexpected f.apply prototype"); + ok(Object.getPrototypeOf(f.call) === Function.prototype, "unexpected f.call prototype"); + + e = window.toString.call(null); + ok(e === "[object Window]", "window.toString with null context = " + e); + e = window.toString.call(external.nullDisp); + ok(e === "[object Window]", "window.toString with nullDisp context = " + e); + } + + e = 0; + try { + f.call(Object, "div"); + }catch(ex) { + e = ex.number; + } + ok(e === (v < 9 ? 0xa0005 : 0x0ffff) - 0x80000000, "[f.call(Object, 'div')] e = " + e); + + e = 0; + try { + f.call(null, "div"); + }catch(ex) { + e = ex.number; + } + ok(e === (v < 9 ? 0xa0005 : 0x0ffff) - 0x80000000, "[f.call(null, 'div')] e = " + e); + + var elem = f.call(document, "div"); + elem.setAttribute("class", "cls"); + elem.setAttribute("className", "cls"); + ok(elem.className === "cls", "elem.className = " + elem.className); + + document.body.click.call(elem); + + e = 0; + try { + new f(); + }catch(ex) { + e = ex.number; + } + ok(e === (v < 9 ? 0xa01b6 : 0x0ffff) - 0x80000000, "[new f()] e = " + e); + + if(v < 9) { + ok(!("call" in f.call), "call in f.call"); + ok(!("apply" in f.call), "apply in f.call"); + ok(!("call" in f.apply), "call in f.apply"); + ok(!("apply" in f.apply), "apply in f.apply"); + ok(f.call+"" === "\nfunction call() {\n [native code]\n}\n", "f.call = " + f.call); + ok(f.apply+"" === "\nfunction apply() {\n [native code]\n}\n", "f.apply = " + f.apply); + ok(external.getVT(f.call) === "VT_DISPATCH", "f.call not VT_DISPATCH"); + ok(external.getVT(f.apply) === "VT_DISPATCH", "f.apply not VT_DISPATCH"); + + elem = f.apply(document, ["style"]); + document.body.appendChild(elem); + + var enumerator = new Enumerator(document.getElementsByTagName("style")); + enumerator.moveNext(); + var enum_elem = enumerator.item(); + enumerator.moveNext(); + ok(enum_elem === elem, "enum_elem = " + enum_elem); + ok(enumerator.atEnd(), "enumerator not at end"); + + e = 0; + try { + f.apply = 0; + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01b6 - 0x80000000, "[f.apply = 0] e = " + e); + e = 0; + try { + f.call = function() { }; + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01b6 - 0x80000000, "[f.call = function() { }] e = " + e); + + ok(f.apply !== f.apply, "f.apply == f.apply"); + f = f.apply; + ok(!("arguments" in f), "arguments in f.apply"); + ok(!("length" in f), "length in f.apply"); + ok(!("call" in f), "call in f.apply"); + ok(!("apply" in f), "apply in f.apply"); + e = 0; + try { + f.toString(); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01b6 - 0x80000000, "[f.apply.toString] e = " + e); + e = 0; + try { + f(document, ["style"]); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01b6 - 0x80000000, "[f.apply() indirect] e = " + e); + }else { + elem = f.call.call(f, document, "div"); + f = f.bind(document); + elem = f.apply(null, ["style"]); + document.body.appendChild(elem); + + try { + var enumerator = new Enumerator(document.getElementsByTagName("style")); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa01c3 - 0x80000000, "[style Enumerator] e = " + e); + + f.apply = 0; + f.call = function() { }; + ok(f.apply === 0, "changed f.apply = ", f.apply); + ok(f.call instanceof Function, "changed f.call not instance of Function"); + + e = Array.isArray(document.body.childNodes); + ok(e === false, "isArray(childNodes) returned " + e); + e = Array.prototype.toString.call(Number); + ok(e === "[object Function]", "Array.toString(Number) = " + e); + } + + function test_toString(msg, constr, err) { + var e = 0; + if(typeof err == "string") { + e = constr.prototype.toString.call(document.body); + ok(e === err, msg + ".toString(body) = " + e); + return; + } + try { + constr.prototype.toString.call(document.body); + }catch(ex) { + e = ex.number; + } + ok(e === err - 0x80000000, "[" + msg + ".toString(body)] e = " + e); + } + + test_toString("Array", Array, v < 9 ? 0xa13a7 : "[object HTMLBodyElement]"); + test_toString("Boolean", Boolean, 0xa1392); + test_toString("Date", Date, 0xa138e); + test_toString("RegExp", RegExp, 0xa1398); + test_toString("Number", Number, 0xa1389); + test_toString("String", String, 0xa138d); + + if(v >= 9) { + var obj = { length: 2 }; + obj[0] = "foo"; + obj[1] = "bar"; + e = Array.prototype.toString.call(obj); + ok(e === "[object Object]", "Array.toString(array-like object) = " + e); + + obj = Object.create(null); + obj.length = 2; + obj[0] = "foo"; + obj[1] = "bar"; + e = Array.prototype.toString.call(obj); + ok(e === "[object Object]", "Array.toString(array-like object with no prototype) = " + e); + + e = 0; + try { + Array.prototype.toString.call(null); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa138f - 0x80000000, "Array.toString(null) e = " + e); + } + + (function(a, b, c) { + ok(a === document.body.childNodes[0], "a = " + a); + ok(b === document.body.childNodes[1], "b = " + b); + ok(c === document.body.childNodes[2], "c = " + c); + }).apply(null, document.body.childNodes); + + elem[0] = "a"; + elem[1] = "b"; + if(v < 9) { + try { + (function(a, b) {}).apply(null, elem); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa13a4 - 0x80000000, "[function.apply with elem without length] e = " + e); + }else { + (function(a, b) { + ok(a === undefined, "a = " + a); + ok(b === undefined, "b = " + b); + }).apply(null, elem); + } + + elem.length = 2; + (function(a, b) { + ok(a === "a", "a = " + a); + ok(b === "b", "b = " + b); + }).apply(null, elem); + + elem = new Object; + elem[0] = "c"; + elem[1] = "d"; + if(v < 9) { + try { + (function(c, d) {}).apply(null, elem); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa13a4 - 0x80000000, "[function.apply with Object without length] e = " + e); + }else { + (function(c, d) { + ok(c === undefined, "c = " + c); + ok(d === undefined, "d = " + d); + }).apply(null, elem); + } + + elem.length = 2; + if(v < 9) { + try { + (function(c, d) {}).apply(null, elem); + }catch(ex) { + e = ex.number; + } + ok(e === 0xa13a4 - 0x80000000, "[function.apply with Object with length] e = " + e); + }else { + (function(c, d) { + ok(c === "c", "c = " + c); + ok(d === "d", "d = " + d); + }).apply(null, elem); + } +}); + +sync_test("builtin_prototypes", function() { + var v = document.documentMode, r, obj, name, proto; + + function set_obj(n, o) { + name = n; + proto = null; + if(o) { + proto = window[n]["prototype"]; + if(typeof o !== "boolean") { + obj = o; + return; + } + } + try { + obj = new window[n](); + ok(o, "expected exception when creating " + name + "."); + }catch(ex) { + obj = null; + ok(!o, "did not expect exception when creating " + name + "."); + ok(ex.number == 0xa01bd - 0x80000000, "unexpected exception number when creating " + name + ": " + ex.number); + } + } + function test_prop(prop, own) { + if(own === undefined ? v < 9 : own) + ok(Object.prototype.hasOwnProperty.call(obj, prop), prop + " not a property of " + name + "."); + else + ok(!Object.prototype.hasOwnProperty.call(obj, prop), prop + " is a property of " + name + "."); + ok(Object.prototype.hasOwnProperty.call(proto, prop), prop + " not a property of " + name + ".prototype."); + } + function test_legacy_ctor(methods, props, non_props, set_prop, set_prop_val) { + if(v >= 9) + return; + ok(""+proto === "[Interface prototype object]", name + ".prototype = " + proto); + if(v < 8) + ok(proto.constructor === undefined, name + ".prototype.constructor = " + proto.constructor); + for(var i = 0; i < methods.length; i++) { + ok(methods[i] in proto, methods[i] + " not in " + name + ".prototype"); + var r = 0; + try { + eval("proto." + methods[i] + "();"); + }catch(ex) { + r = ex.number; + } + ok(r === 0xa01b6 - 0x80000000, name + ".prototype." + methods[i] + "() exception code = " + r); + eval("r = \"\"+proto." + methods[i] + ";"); + ok(r === "\nfunction " + methods[i] + "() {\n [native code]\n}\n", name + ".prototype." + methods[i] + " = " + r); + try { + eval("r = (delete proto." + methods[i] + ");"); + ok(v >= 8, "expected exception deleting " + name + ".prototype." + methods[i]); + ok(r === true, "delete " + name + ".prototype." + methods[i] + " returned " + r); + }catch(ex) { + ok(v < 8, "did not expect exception deleting " + name + ".prototype." + methods[i]); + } + eval("r = \"\"+proto." + methods[i] + ";"); + ok(r === "\nfunction " + methods[i] + "() {\n [native code]\n}\n", name + ".prototype." + methods[i] + " after delete = " + r); + ok(methods[i] in proto, methods[i] + " not in " + name + ".prototype after delete"); + + var func = function() { return "foobar"; } + eval("proto." + methods[i] + " = func;"); + eval("r = proto." + methods[i] + ";"); + ok(r === func, name + ".prototype." + methods[i] + " after set = " + r); + try { + eval("r = (delete proto." + methods[i] + ");"); + ok(v >= 8, "expected exception deleting " + name + ".prototype." + methods[i] + " after set"); + ok(r === true, "delete " + name + ".prototype." + methods[i] + " after set returned " + r); + eval("r = \"\"+proto." + methods[i] + ";"); + ok(r === "\nfunction " + methods[i] + "() {\n [native code]\n}\n", name + ".prototype." + methods[i] + " after second delete = " + r); + }catch(ex) { + ok(v < 8, "did not expect exception deleting " + name + ".prototype." + methods[i] + " after set"); + eval("r = proto." + methods[i] + ";"); + ok(r === func, name + ".prototype." + methods[i] + " after second delete = " + r); + } + eval("proto." + methods[i] + " = func;"); + eval("r = proto." + methods[i] + ";"); + ok(r === func, name + ".prototype." + methods[i] + " after second set = " + r); + } + for(var i = 0; i < props.length; i++) { + ok(props[i] in proto, props[i] + " not in " + name + ".prototype"); + eval("var r = proto." + props[i] + ";"); + ok(r === undefined, name + ".prototype." + props[i] + " = " + r); + try { + eval("r = (delete proto." + props[i] + ");"); + ok(v >= 8, "expected exception deleting " + name + ".prototype." + props[i]); + ok(r === true, "delete " + name + ".prototype." + props[i] + " returned " + r); + }catch(ex) { + ok(v < 8, "did not expect exception deleting " + name + ".prototype." + props[i]); + } + eval("r = proto." + props[i] + ";"); + ok(r === undefined, name + ".prototype." + props[i] + " after delete = " + r); + ok(props[i] in proto, props[i] + " not in " + name + ".prototype after delete"); + } + for(var i = 0; i < non_props.length; i++) + ok(!(non_props[i] in proto), non_props[i] + " in " + name + ".prototype"); + + eval("r = proto." + set_prop + ";"); + ok(r === undefined, name + ".prototype." + set_prop + " = " + r); + eval("proto." + set_prop + " = set_prop_val; r = proto." + set_prop + ";"); + ok(r === undefined, name + ".prototype." + set_prop + " after set = " + r); + + r = proto.winetestprop; + ok(r === undefined, name + ".prototype.winetestprop = " + r); + proto.winetestprop = "test"; + r = proto.winetestprop; + ok(r === "test", name + ".prototype.winetestprop after set = " + r); + } + + set_obj("XMLHttpRequest", true); + test_prop("open"); + test_prop("status"); + test_prop("onreadystatechange"); + test_legacy_ctor(["abort", "send"], ["readyState", "status"], ["selected", "src", "getAttribute"], "onreadystatechange", function(){}); + if(v < 9) { + r = obj.abort(); + ok(r === "foobar", "(new XMLHttpRequest).abort() returned " + r); + r = obj.winetestprop; + ok(r === "test", "(new XMLHttpRequest).winetestprop = " + r); + obj.winetestprop = "prop"; + r = obj.winetestprop; + ok(r === "prop", "(new XMLHttpRequest).winetestprop after set = " + r); + r = XMLHttpRequest.prototype.winetestprop; + ok(r === "test", "XMLHttpRequest.prototype.winetestprop after obj = " + r); + }else + ok(proto.constructor === window.XMLHttpRequest, "XMLHttpRequest.prototype.constructor = " + proto.constructor); + + if(v < 11) { + set_obj("XDomainRequest", true); + test_prop("open"); + test_prop("send"); + test_prop("timeout"); + test_legacy_ctor(["abort"], ["contentType", "responseText"], ["status", "onreadystatechange"], "onerror", function(){}); + if(v < 9) { + r = obj.abort(); + ok(r === "foobar", "(new XDomainRequest).abort() returned " + r); + r = obj.winetestprop; + ok(r === "test", "(new XDomainRequest).winetestprop = " + r); + obj.winetestprop = "prop"; + r = obj.winetestprop; + ok(r === "prop", "(new XDomainRequest).winetestprop after set = " + r); + r = XDomainRequest.prototype.winetestprop; + ok(r === "test", "XDomainRequest.prototype.winetestprop after obj = " + r); + }else + ok(proto.constructor === window.XDomainRequest, "XDomainRequest.prototype.constructor = " + proto.constructor); + } + + set_obj("Image", true); + test_prop("src"); + test_prop("border"); + test_legacy_ctor(["getAttribute", "toString"], ["isMap", "alt"], ["selected", "send"], "src", "about:blank"); + if(v < 9) { + r = obj.toString(); + ok(r === "foobar", "(new Image).toString() returned " + r); + r = obj.winetestprop; + ok(r === "test", "(new Image).winetestprop = " + r); + obj.winetestprop = "prop"; + r = obj.winetestprop; + ok(r === "prop", "(new Image).winetestprop after set = " + r); + r = window.Image.prototype.winetestprop; + ok(r === "test", "Image.prototype.winetestprop after obj = " + r); + try { + r = (delete obj.winetestprop); + ok(v >= 8, "expected exception deleting (new Image).winetestprop"); + ok(r === true, "delete (new Image).winetestprop returned " + r); + }catch(ex) { + ok(v < 8, "did not expect exception deleting (new Image).winetestprop"); + } + r = obj.winetestprop; + ok(r === (v < 8 ? "prop" : "test"), "(new Image).winetestprop after delete = " + r); + obj = new window.Image(); + r = obj.winetestprop; + ok(r === "test", "(new Image).winetestprop second time = " + r); + window.Image.prototype.winetestprop = "string"; + r = obj.winetestprop; + ok(r === "string", "(new Image).winetestprop after change in prototype = " + r); + }else + ok(proto.constructor === window.HTMLImageElement, "Image.prototype.constructor = " + proto.constructor); + + set_obj("Option", true); + test_prop("text"); + test_prop("selected"); + test_legacy_ctor(["setAttribute", "contains"], ["index", "value"], ["src", "send"], "text", "foo"); + if(v < 9) { + r = obj.setAttribute("a", "b"); + ok(r === "foobar", "(new Option).setAttribute() returned " + r); + r = obj.winetestprop; + ok(r === "test", "(new Option).winetestprop = " + r); + obj.winetestprop = "prop"; + r = obj.winetestprop; + ok(r === "prop", "(new Option).winetestprop after set = " + r); + r = window.Option.prototype.winetestprop; + ok(r === "test", "Option.prototype.winetestprop after obj = " + r); + try { + r = (delete obj.winetestprop); + ok(v >= 8, "expected exception deleting (new Option).winetestprop"); + ok(r === true, "delete (new Option).winetestprop returned " + r); + }catch(ex) { + ok(v < 8, "did not expect exception deleting (new Option).winetestprop"); + } + r = obj.winetestprop; + ok(r === (v < 8 ? "prop" : "test"), "(new Option).winetestprop after delete = " + r); + obj = new window.Option(); + r = obj.winetestprop; + ok(r === "test", "(new Option).winetestprop second time = " + r); + window.Option.prototype.winetestprop = "string"; + r = obj.winetestprop; + ok(r === "string", "(new Option).winetestprop after change in prototype = " + r); + }else + ok(proto.constructor === window.HTMLOptionElement, "Option.prototype.constructor = " + proto.constructor); + + if(v >= 9) { + set_obj("DOMParser", true); + test_prop("parseFromString"); + ok(proto.constructor === window.DOMParser, "DOMParser.prototype.constructor = " + proto.constructor); + } + + // other constructors don't support construction + set_obj("ClientRect"); + set_obj("ClientRectList"); + set_obj("Console"); + set_obj("CustomEvent"); + set_obj("DOMTokenList"); + set_obj("KeyboardEvent"); + set_obj("MessageEvent"); + set_obj("MouseEvent"); + set_obj("MSCSSRuleList"); + set_obj("MSCurrentStyleCSSProperties"); + set_obj("MSEventObj"); + set_obj("MSNamespaceInfoCollection"); + set_obj("MSSelection"); + set_obj("MSStyleCSSProperties"); + set_obj("Performance"); + set_obj("PerformanceNavigation"); + set_obj("PerformanceTiming"); + set_obj("UIEvent"); + if(v >= 9) { + set_obj("Attr"); + set_obj("CSSStyleDeclaration"); + set_obj("CSSStyleRule"); + set_obj("CSSStyleSheet"); + set_obj("DOMImplementation"); + set_obj("Event"); + set_obj("History"); + set_obj("HTMLCollection"); + set_obj("NamedNodeMap"); + set_obj("Navigator"); + set_obj("NodeList"); + set_obj("Screen"); + set_obj("Storage"); + set_obj("StyleSheetList"); + set_obj("Text"); + set_obj("TextRange"); + set_obj("Window"); + } + if(v >= 11) { + set_obj("Crypto"); + set_obj("SubtleCrypto"); + } + + if(v >= 8 && v < 11) { + set_obj(v < 9 ? "Event" : "MSEventObj", document.createEventObject()); + test_prop("x"); + test_prop("y"); + test_prop("srcElement"); + test_prop("returnValue"); + + if(Object.create) { + obj = Object.create(proto); + test_prop("reason"); + test_prop("srcFilter"); + r = Object.prototype.toString.call(obj); + ok(r === "[object Object]", "Object.toString on obj created from MSEventObj.prototype returned " + r); + } + + var ctor = function() {}; + ctor.prototype = proto; + ctor.prototype.testWineProp = function() { return 42; }; + obj = new ctor(); + test_prop("shiftKey", false); + test_prop("testWineProp", false); + r = Object.prototype.toString.call(obj); + ok(r === "[object Object]", "Object.toString on custom obj returned " + r); + + r = (delete proto.shiftKey); + ok(r === true, "delete shiftKey returned " + r); + if(v < 9) + ok(Object.prototype.hasOwnProperty.call(proto, "shiftKey"), "shiftKey not a property anymore of Event.prototype."); + else { + ok(!Object.prototype.hasOwnProperty.call(proto, "shiftKey"), "shiftKey still a property of MSEventObj.prototype."); + proto.shiftKey = ctor; + ok(proto.shiftKey === ctor, "shiftKey = " + proto.shiftKey); + } + + r = (delete proto.testWineProp); + ok(r === true, "delete testWineProp returned " + r); + ok(!Object.prototype.hasOwnProperty.call(proto, "testWineProp"), "testWineProp still a property of " + name + ".prototype."); + } + + if(v >= 9) { + set_obj("Event", document.createEvent("Event")); + test_prop("initEvent"); + test_prop("currentTarget"); + + obj = Object.create(proto); + test_prop("eventPhase"); + test_prop("preventDefault"); + r = Object.prototype.toString.call(obj); + ok(r === "[object Object]", "Object.toString on obj created from Event.prototype returned " + r); + + var ctor = function() {}; + ctor.prototype = proto; + ctor.prototype.testWineProp = function() { return 42; }; + obj = new ctor(); + test_prop("timeStamp"); + test_prop("testWineProp"); + r = Object.prototype.toString.call(obj); + ok(r === "[object Object]", "Object.toString on custom obj returned " + r); + + r = (delete proto.timeStamp); + ok(r === true, "delete timeStamp returned " + r); + ok(!Object.prototype.hasOwnProperty.call(proto, "timeStamp"), "timeStamp still a property of Event.prototype."); + + r = (delete proto.testWineProp); + ok(r === true, "delete testWineProp returned " + r); + ok(!Object.prototype.hasOwnProperty.call(proto, "testWineProp"), "testWineProp still a property of Event.prototype."); + + proto.timeStamp = ctor; + ok(proto.timeStamp === ctor, "timeStamp = " + proto.timeStamp); + + set_obj("HTMLImageElement", document.createElement("img")); + document.body.setAttribute.call(obj, "width", "100"); + obj = Object.create(proto); + r = 0; + try { + document.body.setAttribute.call(obj, "width", "100"); + }catch(ex) { + r = ex.number; + } + ok(r === 0xffff - 0x80000000, "document.body.setAttribute.call(obj ...) exception code = " + r); + } + + if(v >= 8) { + obj = window.HTMLMetaElement; + ok(!("charset" in obj), "charset in HTMLMetaElement constructor."); + ok(!("setAttribute" in obj), "setAttribute in HTMLMetaElement constructor."); + ok(!Object.prototype.hasOwnProperty.call(obj, "charset"), "charset is a property of HTMLMetaElement constructor."); + if(Object.getPrototypeOf) + ok(Object.getPrototypeOf(obj) === Object.prototype, "getPrototypeOf(HTMLMetaElement constructor) = " + Object.getPrototypeOf(obj)); + r = 0; + try { + document.body.setAttribute.call(obj, "charset", "UTF-8"); + }catch(ex) { + r = ex.number; + } + ok(r === (v < 9 ? 0xa0005 : 0xffff) - 0x80000000, "setAttribute on HTMLMetaElement constructor error code = " + r); + + proto = window.HTMLMetaElement.prototype; + try { + window.HTMLMetaElement.prototype = Object.prototype; + ok(v >= 9, "expected exception setting HTMLMetaElement.prototype"); + }catch(ex) { + ok(v < 9, "did not expect exception setting HTMLMetaElement.prototype"); + ok(ex.number === 0xa01b6 - 0x80000000, "exception code setting HTMLMetaElement.prototype = " + ex.number); + } + ok(window.HTMLMetaElement.prototype === proto, "HTMLMetaElement.prototype = " + window.HTMLMetaElement.prototype); + ok(proto !== Object.prototype, "old prototype is Object.prototype"); + + obj = document.createElement("meta"); + ok("tagName" in obj, "tagName not in HTMLMetaElement"); + if(Object.getPrototypeOf) + ok(Object.getPrototypeOf(obj) === proto, "getPrototypeOf(meta element) = " + Object.getPrototypeOf(obj)); + + try { + r = (delete window.HTMLMetaElement.prototype); + ok(r === false, "delete HTMLMetaElement.prototype returned " + r); + ok(v >= 9, "expected exception deleting HTMLMetaElement.prototype"); + }catch(ex) { + ok(v < 9, "did not expect exception deleting HTMLMetaElement.prototype"); + ok(ex.number === 0xa01b6 - 0x80000000, "exception code deleting HTMLMetaElement.prototype = " + ex.number); + } + ok(Object.prototype.hasOwnProperty.call(window.HTMLMetaElement, "prototype"), "prototype not a property anymore of HTMLMetaElement."); + + try { + r = (delete window.HTMLMetaElement); + ok(r === true, "delete HTMLMetaElement returned " + r); + ok(v >= 9, "expected exception deleting HTMLMetaElement"); + ok(!Object.prototype.hasOwnProperty.call(window, "HTMLMetaElement"), "HTMLMetaElement still a property of window."); + }catch(ex) { + ok(v < 9, "did not expect exception deleting HTMLMetaElement"); + ok(ex.number === 0xa01bd - 0x80000000, "exception code deleting HTMLMetaElement = " + ex.number); + ok(Object.prototype.hasOwnProperty.call(window, "HTMLMetaElement"), "HTMLMetaElement not a property anymore of window."); + } + + obj = document.createElement("meta"); + ok("tagName" in obj, "tagName not in HTMLMetaElement"); + if(Object.getPrototypeOf) { + ok(Object.getPrototypeOf(obj) === proto, "getPrototypeOf(meta element) = " + Object.getPrototypeOf(obj)); + ok(window.HTMLMetaElement === undefined, "HTMLMetaElement = " + window.HTMLMetaElement); + } + + ok("setAttribute" in proto, "setAttribute not in proto."); + r = 0; + try { + obj.setAttribute.call(proto, "charset", "UTF-8"); + }catch(ex) { + r = ex.number; + } + ok(r === (v < 9 ? 0xa01b6 : 0xffff) - 0x80000000, "setAttribute on proto error code = " + r); + r = 0; + try { + proto.setAttribute("charset", "UTF-8"); + }catch(ex) { + r = ex.number; + } + ok(r === (v < 9 ? 0xa01b6 : 0xffff) - 0x80000000, "proto.setAttribute error code = " + r); + + ok(Object.prototype.hasOwnProperty.call(proto, "charset"), "charset not a property of proto."); + if(v < 9) { + proto.charset = "UTF-8"; + ok(proto.charset === undefined, "proto.charset = " + proto.charset); + }else { + r = Object.getOwnPropertyDescriptor(proto, "charset"); + ok(r.get.toString() === "\nfunction charset() {\n [native code]\n}\n", "charset.get = " + r.get.toString()); + ok(r.set.toString() === "\nfunction charset() {\n [native code]\n}\n", "charset.set = " + r.set.toString()); + ok(Object.getPrototypeOf(r.get) === Function.prototype, "unexpected charset.get prototype"); + ok(Object.getPrototypeOf(r.set) === Function.prototype, "unexpected charset.set prototype"); + + r = 0; + try { + proto.charset; + }catch(ex) { + r = ex.number; + } + ok(r === 0xffff - 0x80000000, "proto.charset error code = " + r); + r = 0; + try { + proto.charset = "UTF-8"; + }catch(ex) { + r = ex.number; + } + ok(r === 0xffff - 0x80000000, "set proto.charset error code = " + r); + } + } + + if(v >= 9) { + var protos = [ + [ "Attr", "Node" ], + [ "CharacterData", "Node" ], + [ "ClientRect", "Object" ], + [ "ClientRectList", "Object" ], + [ "Comment", "CharacterData" ], + [ "Console", "Object" ], + [ "Crypto", "Object" ], + [ "CSSRule", "Object" ], + [ "CSSStyleDeclaration", "Object" ], + [ "CSSStyleRule", "CSSRule" ], + [ "CSSStyleSheet", "StyleSheet" ], + [ "CustomEvent", "Event" ], + [ "Document", "Node" ], + [ "DocumentType", "Node" ], + [ "DOMImplementation", "Object" ], + [ "DOMParser", "Object" ], + [ "DOMTokenList", "Object" ], + [ "Element", "Node" ], + [ "Event", "Object" ], + [ "History", "Object" ], + [ "HTMLAnchorElement", "HTMLElement" ], + [ "HTMLAreaElement", "HTMLElement" ], + [ "HTMLBodyElement", "HTMLElement" ], + [ "HTMLButtonElement", "HTMLElement" ], + [ "HTMLCollection", "Object" ], + [ "HTMLDocument", "Document" ], + [ "HTMLElement", "Element" ], + [ "HTMLEmbedElement", "HTMLElement" ], + [ "HTMLFormElement", "HTMLElement" ], + [ "HTMLFrameElement", "HTMLElement" ], + [ "HTMLHeadElement", "HTMLElement" ], + [ "HTMLHtmlElement", "HTMLElement" ], + [ "HTMLIFrameElement", "HTMLElement" ], + [ "HTMLImgElement", "HTMLElement" ], + [ "HTMLInputElement", "HTMLElement" ], + [ "HTMLLabelElement", "HTMLElement" ], + [ "HTMLLinkElement", "HTMLElement" ], + [ "HTMLMetaElement", "HTMLElement" ], + [ "HTMLObjectElement", "HTMLElement" ], + [ "HTMLOptionElement", "HTMLElement" ], + [ "HTMLScriptElement", "HTMLElement" ], + [ "HTMLSelectElement", "HTMLElement" ], + [ "HTMLStyleElement", "HTMLElement" ], + [ "HTMLTableCellElement", "HTMLElement" ], + [ "HTMLTableDataCellElement", "HTMLTableCellElement" ], + [ "HTMLTableElement", "HTMLElement" ], + [ "HTMLTableRowElement", "HTMLElement" ], + [ "HTMLTextAreaElement", "HTMLElement" ], + [ "HTMLTitleElement", "HTMLElement" ], + [ "HTMLUnknownElement", "HTMLElement" ], + [ "Image", "HTMLElement" ], + [ "KeyboardEvent", "UIEvent" ], + [ "MediaQueryList", "Object" ], + [ "MessageEvent", "Event" ], + [ "MimeTypeArray", "Object" ], + [ "MouseEvent", "UIEvent" ], + [ "MSCSSProperties", "CSSStyleDeclaration" ], + [ "MSCSSRuleList", "Object" ], + [ "MSCurrentStyleCSSProperties", "MSCSSProperties" ], + [ "MSEventObj", "Object" ], + [ "MSMimeTypesCollection", "Object" ], + [ "MSNamespaceInfoCollection", "Object" ], + [ "MSPluginsCollection", "Object" ], + [ "MSSelection", "Object" ], + [ "MSStyleCSSProperties", "MSCSSProperties" ], + [ "MutationObserver", "Object" ], + [ "NamedNodeMap", "Object" ], + [ "Navigator", "Object" ], + [ "Node", "Object" ], + [ "NodeList", "Object" ], + [ "Option", "HTMLElement" ], + [ "PageTransitionEvent", "Event" ], + [ "Performance", "Object" ], + [ "PerformanceNavigation", "Object" ], + [ "PerformanceTiming", "Object" ], + [ "PluginArray", "Object" ], + [ "ProgressEvent", "Event" ], + [ "Screen", "Object" ], + [ "Storage", "Object" ], + [ "StorageEvent", "Event" ], + [ "StyleSheet", "Object" ], + [ "StyleSheetList", "Object" ], + [ "SubtleCrypto", "Object" ], + [ "Text", "CharacterData" ], + [ "TextRange", "Object" ], + [ "UIEvent", "Event" ], + [ "Window", "Object" ], + [ "XDomainRequest", "Object" ], + [ "XMLDocument", "Document" ], + [ "XMLHttpRequest", "Object" ] + ]; + + for(var i = 0; i < protos.length; i++) { + if(!(protos[i][0] in window)) + continue; + var a, b; + eval("a = Object.getPrototypeOf(" + protos[i][0] + ".prototype); b = " + protos[i][1] + ".prototype;"); + ok(a === b, "getPrototypeOf(" + protos[i][0] + ".prototype) = " + a); + } + + var CSS_props = [ "accelerator","backgroundPositionX","backgroundPositionY","getAttribute","imeMode","layoutFlow","layoutGrid","layoutGridChar", + "layoutGridLine","layoutGridMode","layoutGridType","lineBreak","msBlockProgression","msInterpolationMode","removeAttribute", + "scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarDarkShadowColor","scrollbarFaceColor", + "scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","setAttribute","styleFloat","textAutospace", + "textJustifyTrim","textKashida","textKashidaSpace","writingMode","zoom" ]; + var Elem_props = [ "clientHeight","clientLeft","clientTop","clientWidth","firstElementChild","getAttribute","getAttributeNode","getAttributeNodeNS", + "getAttributeNS","getBoundingClientRect","getClientRects","getElementsByTagName","getElementsByTagNameNS","hasAttribute", + "hasAttributeNS","lastElementChild","msMatchesSelector","nextElementSibling","previousElementSibling","querySelector", + "removeAttribute","removeAttributeNode","removeAttributeNS","scrollHeight","scrollLeft","scrollTop","scrollWidth","setAttribute", + "setAttributeNode","setAttributeNodeNS","setAttributeNS","tagName" ]; + var Event_props = [ "bubbles","cancelable","cancelBubble","currentTarget","defaultPrevented","eventPhase","initEvent","isTrusted", + "preventDefault","srcElement","stopImmediatePropagation","stopPropagation","target","timeStamp","type" ]; + var HtmlElem_props = [ "accessKey","applyElement","blur","canHaveHTML","children","className","clearAttributes","click","componentFromPoint", + "contains","contentEditable","createControlRange","currentStyle","dir","disabled","dragDrop","focus","getAdjacentText", + "getElementsByClassName","hideFocus","id","innerHTML","innerText","insertAdjacentElement","insertAdjacentHTML", + "insertAdjacentText","isContentEditable","isDisabled","isMultiLine","isTextEdit","lang","language","mergeAttributes", + "offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","onabort","onactivate","onbeforeactivate","onbeforecopy", + "onbeforecut","onbeforedeactivate","onbeforepaste","onblur","oncanplay","oncanplaythrough","onchange","onclick", + "oncontextmenu","oncopy","oncut","ondblclick","ondeactivate","ondrag","ondragend","ondragenter","ondragleave","ondragover", + "ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onhelp", + "oninput","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown", + "onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpaste","onpause","onplay","onplaying", + "onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onselectstart","onstalled","onsubmit", + "onsuspend","ontimeupdate","onvolumechange","onwaiting","outerHTML","outerText","parentElement","parentTextEdit", + "recordNumber","releaseCapture","replaceAdjacentText","runtimeStyle","scrollIntoView","setActive","setCapture","sourceIndex", + "style","tabIndex","title","uniqueID","uniqueNumber" ]; + var Node_props = [ "addEventListener","appendChild","attributes","childNodes","cloneNode","compareDocumentPosition","dispatchEvent","firstChild", + "hasChildNodes","insertBefore","isDefaultNamespace","isEqualNode","isSameNode","isSupported","lastChild","localName", + "lookupNamespaceURI","lookupPrefix","namespaceURI","nextSibling","nodeName","nodeType","nodeValue","ownerDocument", + "parentNode","prefix","previousSibling","removeChild","removeEventListener","replaceChild","textContent" ]; + var TableCell_props = [ "align","background","bgColor","borderColor","borderColorDark","borderColorLight","cellIndex","colSpan","height","noWrap", + "rowSpan","vAlign","width" ]; + + protos = [ + [ "Attr", ["expando","name","specified","value"], Node_props ], + [ "CharacterData", ["data","length","appendData"], Node_props ], + [ "Comment", ["text"], ["insertData","replaceData","substringData"] ], + [ "CSSStyleRule", ["readOnly","selectorText","style"], ["cssText","parentRule","parentStyleSheet","type" ] ], + [ "CSSStyleSheet", ["addRule","cssRules","ownerRule","rules"], ["disabled","media","ownerNode","parentStyleSheet","title","type"] ], + [ "CustomEvent", ["detail","initCustomEvent"], Event_props ], + [ "Document", ["body","doctype","documentMode","onactivate","parentWindow","styleSheets","title"], Node_props ], + [ "DocumentType", ["entities","internalSubset","name","notations","publicId","systemId"], Node_props ], + [ "Element", Elem_props, Node_props ], + [ "HTMLElement", HtmlElem_props, Elem_props ], + [ "HTMLTableCellElement", TableCell_props, HtmlElem_props ], + [ "HTMLTableDataCellElement", [], TableCell_props ], + [ "HTMLUnknownElement", ["recordset","namedRecordset"], HtmlElem_props ], + [ "KeyboardEvent", ["altKey","ctrlKey","getModifierState","initKeyboardEvent","key","metaKey"], ["detail","initUIEvent","view"] ], + [ "MessageEvent", ["data","initMessageEvent","origin","source"], Event_props ], + [ "MouseEvent", ["button","clientX","initMouseEvent","offsetY","pageX","shiftKey","x","y"], ["detail","initUIEvent","view"] ], + [ "MSCSSProperties", CSS_props, ["background","border","clip","fontWeight","listStyle","quotes","setProperty","zIndex"] ], + [ "MSCurrentStyleCSSProperties", ["blockDirection","clipBottom","clipLeft","clipRight","clipTop","hasLayout"], CSS_props ], + [ "MSStyleCSSProperties", ["pixelTop","pixelWidth","posHeight","posLeft","textDecorationBlink","textDecorationNone"], CSS_props ], + [ "ProgressEvent", ["initProgressEvent","lengthComputable","loaded","total"], Event_props ], + [ "StorageEvent", ["initStorageEvent","key","newValue","oldValue","storageArea"], Event_props ], + [ "Text", ["splitText"], ["data","length","appendData","deleteData","insertData","replaceData","substringData"] ], + [ "UIEvent", ["detail","initUIEvent","view"], Event_props ] + ]; + + for(var i = 0; i < protos.length; i++) { + if(!(protos[i][0] in window)) + continue; + eval("r = " + protos[i][0] + ".prototype"); + for(var j = 0; j < protos[i][1].length; j++) + ok(Object.prototype.hasOwnProperty.call(r, protos[i][1][j]), protos[i][1][j] + " not a property of " + protos[i][0] + ".prototype"); + for(var j = 0; j < protos[i][2].length; j++) { + ok(!Object.prototype.hasOwnProperty.call(r, protos[i][2][j]), protos[i][2][j] + " is a property of " + protos[i][0] + ".prototype"); + ok(protos[i][2][j] in r, protos[i][2][j] + " not in " + protos[i][0] + ".prototype"); + } + } + } +}); + +sync_test("builtin_constructors", function() { + var v = document.documentMode; + + var special_ctors = [ + [ "DOMParser", [ "prototype", "arguments" ], [ "create", "length" ], 9 ], + [ "Image", [ "prototype", "arguments" ], [ "create", "length" ] ], + [ "MutationObserver", [ "prototype", "arguments" ], [ "create", "length" ], 11 ], + [ "Option", [ "prototype", "arguments" ], [ "create", "length" ] ], + [ "XDomainRequest", [ "prototype", "arguments", "create" ], [ "length" ], 0, 10 ], + [ "XMLHttpRequest", [ "prototype", "arguments", "create" ], [ "length" ] ] + ]; + for(var i = 0; i < special_ctors.length; i++) { + if((special_ctors[i].length > 3 && v < special_ctors[i][3]) || + (special_ctors[i].length > 4 && v > special_ctors[i][4])) + continue; + var name = special_ctors[i][0]; + ok(Object.prototype.hasOwnProperty.call(window, name), name + " not a property of window."); + var obj = window[name]; + if(v < 9) { + ok(!Object.prototype.hasOwnProperty.call(obj, "arguments"), "arguments is a property of " + name + " constructor."); + ok(Object.prototype.hasOwnProperty.call(obj, "create"), "create not a property of " + name + " constructor."); + ok(!Object.prototype.hasOwnProperty.call(obj, "length"), "length is a property of " + name + " constructor."); + ok(Object.prototype.hasOwnProperty.call(obj, "prototype"), "prototype not a property of " + name + " constructor."); + ok(!("length" in obj), "length in " + name + " constructor."); + if(window.Window) + ok(!Object.prototype.hasOwnProperty.call(window.Window.prototype, name), name + " is a property of window's prototype."); + }else { + for(var j = 0; j < special_ctors[i][1].length; j++) + ok(Object.prototype.hasOwnProperty.call(obj, special_ctors[i][1][j]), special_ctors[i][1][j] + " not a property of " + name + " constructor."); + + for(var j = 0; j < special_ctors[i][2].length; j++) + ok(!Object.prototype.hasOwnProperty.call(obj, special_ctors[i][2][j]), special_ctors[i][2][j] + " is a property of " + name + " constructor."); + + ok(Object.getPrototypeOf(obj) === Function.prototype, "getPrototypeOf(" + name + " constructor) = " + Object.getPrototypeOf(obj)); + ok(!Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(window), name), name + " is a property of window's prototype."); + + if(obj.create) { + var proto = obj.prototype, func = obj.create, s = Object.prototype.toString.call(func); + ok(s === "[object Function]", "obj.create toString = " + s); + ok(Object.getPrototypeOf(func) === Function.prototype, "getPrototypeOf(" + name + ".create) = " + Object.getPrototypeOf(func)); + ok(Object.prototype.hasOwnProperty.call(func, "arguments"), "arguments not a property of " + name + ".create"); + ok(!Object.prototype.hasOwnProperty.call(func, "length"), "length is a property of " + name + ".create"); + ok(Object.prototype.hasOwnProperty.call(func, "prototype"), "prototype not a property of " + name + ".create"); + + obj = func(); + ok(Object.getPrototypeOf(obj) === proto, "getPrototypeOf(obj.create()) = " + Object.getPrototypeOf(obj)); + obj = func.call(Object); + ok(Object.getPrototypeOf(obj) === proto, "getPrototypeOf(obj.create() on Object) = " + Object.getPrototypeOf(obj)); + } + } + } + + if(v < 9) { + // IHTMLDOMConstructorCollection props + var ctors = [ + [ "Attr" ], + [ "BehaviorUrnsCollection" ], + [ "BookmarkCollection" ], + [ "CSSCurrentStyleDeclaration" ], + [ "CSSRuleList" ], + [ "CSSRuleStyleDeclaration" ], + [ "CSSStyleDeclaration" ], + [ "CSSStyleRule" ], + [ "CSSStyleSheet" ], + [ "CompatibleInfo" ], + [ "CompatibleInfoCollection" ], + [ "ControlRangeCollection" ], + [ "DOMImplementation" ], + [ "DataTransfer" ], + [ "Element" ], + [ "Event" ], + [ "HTCElementBehaviorDefaults" ], + [ "HTMLAnchorElement" ], + [ "HTMLAreaElement" ], + [ "HTMLAreasCollection" ], + [ "HTMLBGSoundElement" ], + [ "HTMLBRElement" ], + [ "HTMLBaseElement" ], + [ "HTMLBaseFontElement" ], + [ "HTMLBlockElement" ], + [ "HTMLBodyElement" ], + [ "HTMLButtonElement" ], + [ "HTMLCollection" ], + [ "HTMLCommentElement" ], + [ "HTMLDDElement" ], + [ "HTMLDListElement" ], + [ "HTMLDTElement" ], + [ "HTMLDivElement" ], + [ "HTMLDocument" ], + [ "HTMLEmbedElement" ], + [ "HTMLFieldSetElement" ], + [ "HTMLFontElement" ], + [ "HTMLFormElement" ], + [ "HTMLFrameElement" ], + [ "HTMLFrameSetElement" ], + [ "HTMLGenericElement" ], + [ "HTMLHRElement" ], + [ "HTMLHeadElement" ], + [ "HTMLHeadingElement" ], + [ "HTMLHtmlElement" ], + [ "HTMLIFrameElement" ], + [ "HTMLImageElement" ], + [ "HTMLInputElement" ], + [ "HTMLIsIndexElement" ], + [ "HTMLLIElement" ], + [ "HTMLLabelElement" ], + [ "HTMLLegendElement" ], + [ "HTMLLinkElement" ], + [ "HTMLMapElement" ], + [ "HTMLMarqueeElement" ], + [ "HTMLMetaElement" ], + [ "HTMLModelessDialog" ], + [ "HTMLNamespaceInfo" ], + [ "HTMLNamespaceInfoCollection" ], + [ "HTMLNextIdElement" ], + [ "HTMLNoShowElement" ], + [ "HTMLOListElement" ], + [ "HTMLObjectElement" ], + [ "HTMLOptionElement" ], + [ "HTMLParagraphElement" ], + [ "HTMLParamElement" ], + [ "HTMLPhraseElement" ], + [ "HTMLPluginsCollection" ], + [ "HTMLPopup" ], + [ "HTMLScriptElement" ], + [ "HTMLSelectElement" ], + [ "HTMLSpanElement" ], + [ "HTMLStyleElement" ], + [ "HTMLTableCaptionElement" ], + [ "HTMLTableCellElement" ], + [ "HTMLTableColElement" ], + [ "HTMLTableElement" ], + [ "HTMLTableRowElement" ], + [ "HTMLTableSectionElement" ], + [ "HTMLTextAreaElement" ], + [ "HTMLTextElement" ], + [ "HTMLTitleElement" ], + [ "HTMLUListElement" ], + [ "HTMLUnknownElement" ], + [ "History" ], + [ "Image", 0, "HTMLImageElement" ], + [ "Location" ], + [ "NamedNodeMap" ], + [ "Navigator" ], + [ "NodeList" ], + [ "Option", 0, "HTMLOptionElement" ], + [ "Screen" ], + [ "Selection" ], + [ "StaticNodeList" ], + [ "Storage" ], + [ "StyleSheetList" ], + [ "StyleSheetPage" ], + [ "StyleSheetPageList" ], + [ "Text" ], + [ "TextRange" ], + [ "TextRangeCollection" ], + [ "TextRectangle" ], + [ "TextRectangleList" ], + [ "Window" ], + [ "XDomainRequest", 0 ], + [ "XMLHttpRequest", 0 ] + ]; + for(var i = 0; i < ctors.length; i++) { + if(!(ctors[i][0] in window) && v >= 8) { + todo_wine.ok(false, ctors[i][0] + " not implemented"); + continue; + } + var a, b, r = 0; + try { + eval("a = " + ctors[i][0] + "; b = window." + ctors[i][0] + ";"); + }catch(ex) { + r = ex.number; + } + if(v < 8 && (ctors[i].length < 2 || v < ctors[i][1])) + ok(r === 0xa1391 - 0x80000000, ctors[i][0] + " not undefined: " + r); + else { + ok(r === 0, ctors[i][0] + " exception code: " + r); + ok(a === b, ctors[i][0] + ": " + a + " != " + b); + ok(ctors[i][0] in window, ctors[i][0] + " in window"); + if(v >= 8) + ok(!(ctors[i][0] in window.Window.prototype), ctors[i][0] + " in Window.prototype"); + r = "" + a; + ok(r === "[object " + ctors[i][ctors[i].length < 3 ? 0 : 2] + "]", ctors[i][0] + " returned " + r); + r = "" + a.prototype; + ok(r === "[Interface prototype object]", ctors[i][0] + ".prototype returned " + r); + + var props = [ "LookupGetter", "LookupSetter", "DefineGetter", "DefineSetter" ]; + for(var j = 0; j < props.length; j++) { + ok(!(props[j] in a.prototype), props[j] + " in " + ctors[i][0] + ".prototype"); + ok(!(props[j] in a), props[j] + " in " + ctors[i][0]); + } + ok(!("constructor" in a), "constructor in " + ctors[i][0]); + + if(v < 8 || ctors[i][0] === "HTMLModelessDialog") { + ok(!("constructor" in a.prototype), "constructor in " + ctors[i][0] + ".prototype"); + }else { + ok("constructor" in a.prototype, "constructor not in " + ctors[i][0] + ".prototype"); + b = a.prototype.constructor; + r = ctors[i][(ctors[i].length > 2) ? 2 : 0]; + var ctor = (r.length > 7 && r.slice(-7) === "Element") ? window.Element : null; + ok(b === ctor, ctors[i][0] + ".prototype.constructor = " + b); + a.prototype.constructor = "foobar"; + b = a.prototype.constructor; + ok(b === ctor, ctors[i][0] + ".prototype.constructor after set = " + b); + r = (delete a.prototype.constructor); + ok(r === true, "delete " + ctors[i][0] + ".prototype.constructor returned " + r); + b = a.prototype.constructor; + ok(b === ctor, ctors[i][0] + ".prototype.constructor after delete = " + b); + } + } + } + }else { + var ctors = [ + [ "Attr" ], + [ "CharacterData" ], + [ "ClientRect" ], + [ "ClientRectList" ], + [ "Comment" ], + [ "Console", 10 ], + [ "Crypto", 11 ], + [ "CSSRule" ], + [ "CSSStyleDeclaration" ], + [ "CSSStyleRule" ], + [ "CSSStyleSheet" ], + [ "CustomEvent" ], + [ "Document" ], + [ "DocumentType" ], + [ "DOMImplementation" ], + [ "DOMTokenList", 10 ], + [ "Element" ], + [ "Event" ], + [ "History" ], + [ "HTMLAnchorElement" ], + [ "HTMLAreaElement" ], + [ "HTMLBodyElement" ], + [ "HTMLButtonElement" ], + [ "HTMLCollection" ], + [ "HTMLDocument", 11 ], + [ "HTMLElement" ], + [ "HTMLEmbedElement" ], + [ "HTMLFormElement" ], + [ "HTMLFrameElement" ], + [ "HTMLHeadElement" ], + [ "HTMLHtmlElement" ], + [ "HTMLIFrameElement" ], + [ "HTMLImageElement" ], + [ "HTMLInputElement" ], + [ "HTMLLabelElement" ], + [ "HTMLLinkElement" ], + [ "HTMLObjectElement" ], + [ "HTMLOptionElement" ], + [ "HTMLScriptElement" ], + [ "HTMLSelectElement" ], + [ "HTMLStyleElement" ], + [ "HTMLTableCellElement" ], + [ "HTMLTableDataCellElement" ], + [ "HTMLTableElement" ], + [ "HTMLTableRowElement" ], + [ "HTMLTextAreaElement" ], + [ "HTMLTitleElement" ], + [ "HTMLUnknownElement" ], + [ "KeyboardEvent" ], + [ "MediaQueryList", 10 ], + [ "MessageEvent" ], + [ "MimeTypeArray", 11 ], + [ "MouseEvent" ], + [ "MSCSSProperties" ], + [ "MSCSSRuleList" ], + [ "MSCurrentStyleCSSProperties" ], + [ "MSEventObj" ], + [ "MSNamespaceInfoCollection", 0, 9 ], + [ "MSSelection", 0, 10 ], + [ "MSStyleCSSProperties" ], + [ "MutationObserver", 11 ], + [ "NamedNodeMap" ], + [ "Navigator" ], + [ "Node" ], + [ "NodeList" ], + [ "PageTransitionEvent", 11 ], + [ "Performance" ], + [ "PerformanceNavigation" ], + [ "PerformanceTiming" ], + [ "PluginArray", 11 ], + [ "ProgressEvent", 10 ], + [ "Range" ], + [ "Screen" ], + [ "Storage" ], + [ "StorageEvent" ], + [ "StyleSheet" ], + [ "StyleSheetList" ], + [ "Text" ], + [ "TextRange" ], + [ "UIEvent" ], + [ "Window" ], + [ "XMLHttpRequest" ] + ]; + for(var i = 0; i < ctors.length; i++) { + if((ctors[i].length > 1 && v < ctors[i][1]) || (ctors[i].length > 2 && v > ctors[i][2])) + ok(!(ctors[i][0] in window), ctors[i][0] + " in window."); + else + ok(Object.prototype.hasOwnProperty.call(window, ctors[i][0]), ctors[i][0] + " not a property of window."); + } + } +}); + sync_test("elem_props", function() { var elem = document.documentElement; @@ -399,6 +1610,83 @@ sync_test("elem_props", function() { test_exposed("fileSize", v < 11); }); +sync_test("attr_props", function() { + var elem = document.createElement("style"), attr; + var v = document.documentMode; + elem.setAttribute("id", "test"); + elem.setAttribute("test", "wine"); + elem.setAttribute("z-index", "foobar"); + elem.setAttribute("removeAttribute", "funcattr"); + + function test_exposed(prop, expect) { + if(expect) + ok(prop in attr, prop + " not found in attribute."); + else + ok(!(prop in attr), prop + " found in attribute."); + } + + function test_attr(expando, specified) { + var r = attr.expando; + ok(r === expando, attr.name + " attr.expando = " + r); + r = attr.specified; + ok(r === specified, attr.name + " attr.specified = " + r); + } + + attr = elem.getAttributeNode("id"); + test_exposed("appendChild", true); + test_exposed("attributes", true); + test_exposed("childNodes", true); + test_exposed("cloneNode", true); + test_exposed("compareDocumentPosition", v >= 9); + test_exposed("expando", true); + test_exposed("firstChild", true); + test_exposed("hasChildNodes", true); + test_exposed("insertBefore", true); + test_exposed("isDefaultNamespace", v >= 9); + test_exposed("isEqualNode", v >= 9); + test_exposed("isSameNode", v >= 9); + test_exposed("isSupported", v >= 9); + test_exposed("lastChild", true); + test_exposed("localName", v >= 9); + test_exposed("lookupNamespaceURI", v >= 9); + test_exposed("lookupPrefix", v >= 9); + test_exposed("name", true); + test_exposed("namespaceURI", v >= 9); + test_exposed("nextSibling", true); + test_exposed("nodeName", true); + test_exposed("nodeType", true); + test_exposed("nodeValue", true); + test_exposed("ownerDocument", true); + test_exposed("parentNode", true); + test_exposed("prefix", v >= 9); + test_exposed("previousSibling", true); + test_exposed("removeChild", true); + test_exposed("replaceChild", true); + test_exposed("specified", true); + test_exposed("textContent", v >= 9); + test_exposed("value", true); + test_attr(false, true); + + attr = elem.getAttributeNode("test"); + test_attr(true, true); + + attr = elem.getAttributeNode("z-index"); + test_attr(true, true); + + attr = elem.getAttributeNode("removeAttribute"); + test_attr(true, true); + + attr = elem.getAttributeNode("tabIndex"); + if(v < 8) + test_attr(false, false); + else + todo_wine_if(v === 8). + ok(attr === null, "tabIndex attr not null."); + + attr = document.createAttribute("winetest"); + test_attr(false, v >= 9); +}); + sync_test("doc_props", function() { function test_exposed(prop, expect, is_todo) { var ok_ = is_todo ? todo_wine.ok : ok; @@ -477,8 +1765,11 @@ sync_test("window_props", function() { test_exposed("WeakSet", false); test_exposed("performance", true); test_exposed("console", v >= 10); + test_exposed("DOMParser", v >= 9); test_exposed("matchMedia", v >= 10); + test_exposed("msCrypto", v >= 11); test_exposed("MutationObserver", v >= 11); + test_exposed("XDomainRequest", v < 11); }); sync_test("domimpl_props", function() { @@ -498,6 +1789,56 @@ sync_test("domimpl_props", function() { test_exposed("createHTMLDocument", v >= 9); }); +sync_test("perf_props", function() { + var obj = window.performance, name = "Performance"; + var v = document.documentMode; + + function test_exposed(prop, expect) { + if(expect) + ok(prop in obj, prop + " not found in " + name + "."); + else + ok(!(prop in obj), prop + " found in " + name + "."); + } + + test_exposed("navigation", true); + test_exposed("timing", true); + test_exposed("toJSON", v >= 9); + test_exposed("toString", true); + + obj = window.performance.navigation, name = "PerformanceNavigation"; + + test_exposed("redirectCount", true); + test_exposed("type", true); + test_exposed("toJSON", v >= 9); + test_exposed("toString", true); + + obj = window.performance.timing, name = "PerformanceTiming"; + + test_exposed("connectEnd", true); + test_exposed("connectStart", true); + test_exposed("domComplete", true); + test_exposed("domContentLoadedEventEnd", true); + test_exposed("domContentLoadedEventStart", true); + test_exposed("domInteractive", true); + test_exposed("domLoading", true); + test_exposed("domainLookupEnd", true); + test_exposed("domainLookupStart", true); + test_exposed("fetchStart", true); + test_exposed("loadEventEnd", true); + test_exposed("loadEventStart", true); + test_exposed("msFirstPaint", true); + test_exposed("navigationStart", true); + test_exposed("redirectEnd", true); + test_exposed("redirectStart", true); + test_exposed("requestStart", true); + test_exposed("responseEnd", true); + test_exposed("responseStart", true); + test_exposed("unloadEventEnd", true); + test_exposed("unloadEventStart", true); + test_exposed("toJSON", v >= 9); + test_exposed("toString", true); +}); + sync_test("xhr_props", function() { var xhr = new XMLHttpRequest(); @@ -629,10 +1970,21 @@ sync_test("style_props", function() { test_exposed("float", true); test_exposed("css-float", false); test_exposed("style-float", false); + test_exposed("styleFloat", true); test_exposed("setProperty", v >= 9); test_exposed("removeProperty", v >= 9); test_exposed("background-clip", v >= 9); test_exposed("transform", v >= 10); + test_exposed("zoom", true); + + try { + style.styleFloat = "left"; + ok(false, "expected exception setting styleFloat"); + }catch(ex) {} + try { + style.zoom = "1.0"; + ok(false, "expected exception setting zoom"); + }catch(ex) {} if(window.getComputedStyle) { style = window.getComputedStyle(document.body); @@ -651,6 +2003,86 @@ sync_test("style_props", function() { } }); +sync_test("input_validation_props", function() { + var obj, v = document.documentMode; + if(v < 9) return; + + function test_exposed(prop, expect) { + if(expect) + ok(Object.prototype.hasOwnProperty.call(obj, prop), prop + " not a property of " + obj); + else + ok(!Object.prototype.hasOwnProperty.call(obj, prop), prop + " is a property of " + obj); + } + + obj = window.HTMLFormElement.prototype; + test_exposed("action", true); + test_exposed("autofocus", false); + test_exposed("checkValidity", v >= 10); + test_exposed("enctype", true); + test_exposed("formAction", false); + test_exposed("formEnctype", false); + test_exposed("formMethod", false); + test_exposed("formNoValidate", false); + test_exposed("formTarget", false); + test_exposed("method", true); + test_exposed("noValidate", v >= 10); + test_exposed("setCustomValidity", false); + test_exposed("target", true); + test_exposed("validationMessage", false); + test_exposed("validity", false); + test_exposed("willValidate", false); + + obj = window.HTMLInputElement.prototype; + test_exposed("autofocus", v >= 10); + test_exposed("checkValidity", v >= 10); + test_exposed("formAction", v >= 10); + test_exposed("formEnctype", v >= 10); + test_exposed("formMethod", v >= 10); + test_exposed("formNoValidate", v >= 10); + test_exposed("formTarget", v >= 10); + test_exposed("setCustomValidity", v >= 10); + test_exposed("validationMessage", v >= 10); + test_exposed("validity", v >= 10); + test_exposed("willValidate", v >= 10); + + obj = window.HTMLButtonElement.prototype; + test_exposed("autofocus", v >= 10); + test_exposed("checkValidity", v >= 10); + test_exposed("formAction", v >= 10); + test_exposed("formEnctype", v >= 10); + test_exposed("formMethod", v >= 10); + test_exposed("formNoValidate", v >= 10); + test_exposed("formTarget", v >= 10); + test_exposed("setCustomValidity", v >= 10); + test_exposed("validationMessage", v >= 10); + test_exposed("validity", v >= 10); + test_exposed("willValidate", v >= 10); + + obj = window.HTMLObjectElement.prototype; + test_exposed("autofocus", false); + test_exposed("checkValidity", v >= 10); + test_exposed("setCustomValidity", v >= 10); + test_exposed("validationMessage", v >= 10); + test_exposed("validity", v >= 10); + test_exposed("willValidate", v >= 10); + + obj = window.HTMLSelectElement.prototype; + test_exposed("autofocus", v >= 10); + test_exposed("checkValidity", v >= 10); + test_exposed("setCustomValidity", v >= 10); + test_exposed("validationMessage", v >= 10); + test_exposed("validity", v >= 10); + test_exposed("willValidate", v >= 10); + + obj = window.HTMLTextAreaElement.prototype; + test_exposed("autofocus", v >= 10); + test_exposed("checkValidity", v >= 10); + test_exposed("setCustomValidity", v >= 10); + test_exposed("validationMessage", v >= 10); + test_exposed("validity", v >= 10); + test_exposed("willValidate", v >= 10); +}); + sync_test("createElement_inline_attr", function() { var v = document.documentMode, e, s; @@ -921,7 +2353,6 @@ sync_test("elem_by_id", function() { name_elem = document.testname; ok(name_elem === "foo", "document.testname after set = " + name_elem); }catch(e) { - todo_wine_if(v >= 9). ok(v < 9 && e.number === 0xa01b6 - 0x80000000, "Setting document.testname threw = " + e.number); } @@ -946,7 +2377,6 @@ sync_test("elem_by_id", function() { delete document.testid; delete document.testname; }catch(e) { - todo_wine_if(v >= 9). ok(v < 9 && e.number === 0xa01b6 - 0x80000000, "Setting document.testid threw = " + e.number); } @@ -1127,7 +2557,7 @@ sync_test("navigator", function() { sync_test("delete_prop", function() { var v = document.documentMode; - var obj = document.createElement("div"), r, obj2; + var obj = document.createElement("div"), r, obj2, func, prop; obj.prop1 = true; r = false; @@ -1143,6 +2573,40 @@ sync_test("delete_prop", function() { ok(!r, "got an unexpected exception"); ok(!("prop1" in obj), "prop1 is still in obj"); + /* builtin properties don't throw any exception, but are not really deleted */ + r = (delete obj.tagName); + ok(r, "delete returned " + r); + ok("tagName" in obj, "tagName deleted from obj"); + ok(obj.tagName === "DIV", "tagName = " + obj.tagName); + + prop = obj.id; + r = (delete obj.id); + ok(r, "delete returned " + r); + ok("id" in obj, "id deleted from obj"); + ok(obj.id === prop, "id = " + obj.id); + + obj.id = "1234"; + ok(obj.id === "1234", "id after set to 1234 = " + obj.id); + r = (delete obj.id); + ok(r, "delete returned " + r); + ok("id" in obj, "id deleted from obj"); + ok(obj.id === "1234", "id = " + obj.id); + + /* builtin functions get reset to their original values */ + func = function() { } + prop = obj.setAttribute; + r = (delete obj.setAttribute); + ok(r, "delete returned " + r); + ok("setAttribute" in obj, "setAttribute deleted from obj"); + ok(obj.setAttribute === prop, "setAttribute = " + obj.setAttribute); + + obj.setAttribute = func; + ok(obj.setAttribute === func, "setAttribute after set to func = " + obj.setAttribute); + r = (delete obj.setAttribute); + ok(r, "delete returned " + r); + ok("setAttribute" in obj, "setAttribute deleted from obj"); + ok(obj.setAttribute === prop, "setAttribute = " + obj.setAttribute); + /* again, this time prop1 does not exist */ r = false; try { @@ -1163,12 +2627,6 @@ sync_test("delete_prop", function() { ok("className" in obj, "className deleted from obj"); ok(obj.className === "", "className = " + obj.className); - /* builtin propertiles don't throw any exception, but are not really deleted */ - r = (delete obj.tagName); - ok(r, "delete returned " + r); - ok("tagName" in obj, "tagName deleted from obj"); - ok(obj.tagName === "DIV", "tagName = " + obj.tagName); - obj = document.querySelectorAll("*"); ok("0" in obj, "0 is not in obj"); obj2 = obj[0]; @@ -1206,7 +2664,6 @@ sync_test("delete_prop", function() { ok(r, "did not get an expected globalprop2 exception"); }else { ok(!r, "got an unexpected exception"); - todo_wine. ok(!("globalprop2" in obj), "globalprop2 is still in obj"); } @@ -1230,7 +2687,6 @@ sync_test("delete_prop", function() { ok(obj.globalprop4, "globalprop4 = " + globalprop4); r = (delete globalprop4); ok(r, "delete returned " + r); - todo_wine. ok(!("globalprop4" in obj), "globalprop4 is still in obj"); }); @@ -1868,7 +3324,6 @@ async_test("storage events", function() { return; } var s = Object.prototype.toString.call(e); - todo_wine. ok(s === "[object StorageEvent]", "Object.toString = " + s); ok(e.key === key, "key = " + e.key + ", expected " + key); ok(e.oldValue === oldValue, "oldValue = " + e.oldValue + ", expected " + oldValue); @@ -2032,11 +3487,10 @@ sync_test("elem_attr", function() { var func = elem.setAttribute; try { func("testattr", arr); - todo_wine_if(v >= 9). ok(v < 9, "expected exception setting testattr via func"); }catch(ex) { ok(v >= 9, "did not expect exception setting testattr via func"); - elem.setAttribute("testattr", arr); + func.call(elem, "testattr", arr); } r = elem.getAttribute("testattr"); ok(r === (v < 8 ? arr : (v < 10 ? "arrval" : "42")), "testattr after setAttribute (as func) = " + r); @@ -2672,6 +4126,13 @@ sync_test("__proto__", function() { ok(e.number === 0xa13b6 - 0x80000000 && e.name === "TypeError", "changing __proto__ on non-extensible object threw exception " + e.number + " (" + e.name + ")"); } + + obj = document.createElement("img"); + obj.__proto__ = ctor.prototype; + document.body.setAttribute.call(obj, "height", "101"); + r = document.body.getAttribute.call(obj, "height"); + ok(r === "101", "getAttribute(height) = " + r); + ok(!("getAttribute" in obj), "getAttribute exposed in obj"); }); sync_test("__defineGetter__", function() { @@ -2857,6 +4318,96 @@ sync_test("__defineSetter__", function() { ok(x.setterVal === 9, "x.setterVal after setting bar = " + x.setterVal); }); +sync_test("Crypto", function() { + var crypto = window.msCrypto, arr, r; + if(!crypto) return; + + ok(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(window), "msCrypto"), "msCrypto not a property of window's prototype."); + r = Object.getPrototypeOf(crypto); + ok(r === window.Crypto.prototype, "getPrototypeOf(crypto) = " + r); + + ok("subtle" in crypto, "subtle not in crypto"); + ok("getRandomValues" in crypto, "getRandomValues not in crypto"); + ok(!("randomUUID" in crypto), "randomUUID is in crypto"); + + var list = [ "decrypt", "deriveKey", "digest", "encrypt", "exportKey", "generateKey", "importKey", "sign", "unwrapKey", "verify", "wrapKey" ]; + for(var i = 0; i < list.length; i++) + ok(list[i] in crypto.subtle, list[i] + " not in crypto.subtle"); + ok(!("deriveBits" in crypto.subtle), "deriveBits is in crypto.subtle"); + + list = [ + [ "Int8Array", 65536 ], + [ "Uint8Array", 65536 ], + [ "Int16Array", 32768 ], + [ "Uint16Array", 32768 ], + [ "Int32Array", 16384 ], + [ "Uint32Array", 16384 ] + ]; + for(var i = 0; i < list.length; i++) { + var arrType = list[i][0]; + arr = eval(arrType + "(" + list[i][1] + ")"); + + ok(arr[0] === 0, arrType + "[0] = " + arr[0]); + ok(arr[1] === 0, arrType + "[1] = " + arr[1]); + r = crypto.getRandomValues(arr); + ok(r === arr, "getRandomValues returned " + r); + + arr = eval(arrType + "(" + (list[i][1]+1) + ")"); + try { + crypto.getRandomValues(arr); + }catch(ex) { + var n = ex.number >>> 0; + todo_wine. + ok(ex.name === "QuotaExceededError", "getRandomValues(oversized " + arrType + ") threw " + ex.name); + todo_wine. + ok(n === 0, "getRandomValues(oversized " + arrType + ") threw code " + n); + todo_wine. + ok(ex.message === "QuotaExceededError", "getRandomValues(oversized " + arrType + ") threw message " + ex.message); + } + } + + try { + crypto.getRandomValues(null); + ok(false, "getRandomValues(null) did not throw exception"); + }catch(e) { + ok(e.number === 0x70057 - 0x80000000, "getRandomValues(null) threw " + e.number); + } + try { + crypto.getRandomValues(external.nullDisp); + ok(false, "getRandomValues(nullDisp) did not throw exception"); + }catch(e) { + ok(e.number === 0x70057 - 0x80000000, "getRandomValues(nullDisp) threw " + e.number); + } + try { + crypto.getRandomValues([1,2,3]); + ok(false, "getRandomValues([1,2,3]) did not throw exception"); + }catch(e) { + ok(e.number === 0x70057 - 0x80000000, "getRandomValues([1,2,3]) threw " + e.number); + } + arr = Float32Array(2); + try { + crypto.getRandomValues(arr); + ok(false, "getRandomValues(Float32Array) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + todo_wine. + ok(ex.name === "TypeMismatchError", "getRandomValues(Float32Array) threw " + ex.name); + todo_wine. + ok(n === 0, "getRandomValues(Float32Array) threw code " + n); + } + arr = Float64Array(2); + try { + crypto.getRandomValues(arr); + ok(false, "getRandomValues(Float64Array) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + todo_wine. + ok(ex.name === "TypeMismatchError", "getRandomValues(Float64Array) threw " + ex.name); + todo_wine. + ok(n === 0, "getRandomValues(Float64Array) threw code " + n); + } +}); + sync_test("MutationObserver", function() { if (!window.MutationObserver) { return; @@ -2919,6 +4470,32 @@ sync_test("MutationObserver", function() { test_exposed("takeRecords"); }); +sync_test("initMessageEvent", function() { + var e, v = document.documentMode; + if(!document.createEvent) + return; + e = document.createEvent("MessageEvent"); + ok(e.data === (v < 10 ? "" : undefined), "e.data = " + e.data); + ok(e.bubbles === false, "bubbles = " + e.bubbles); + ok(e.cancelable === false, "cancelable = " + e.cancelable); + ok(e.source === null, "e.source = " + e.source); + ok(e.origin === "", "e.origin = " + e.origin); + + e.initMessageEvent("blah", true, true, 137, "wine", 1234, window); + ok(e.data === "137", "e.data = " + e.data); + ok(e.bubbles === true, "bubbles = " + e.bubbles); + ok(e.cancelable === true, "cancelable = " + e.cancelable); + ok(e.source === window, "e.source = " + e.source); + ok(e.origin === "wine", "e.origin = " + e.origin); + + e.initMessageEvent("abcd", false, false, "testdata", "origin", 42, null); + ok(e.data === "testdata", "e.data = " + e.data); + ok(e.bubbles === false, "bubbles = " + e.bubbles); + ok(e.cancelable === false, "cancelable = " + e.cancelable); + ok(e.source === null, "e.source = " + e.source); + ok(e.origin === "origin", "e.origin = " + e.origin); +}); + async_test("postMessage", function() { var v = document.documentMode; var onmessage_called = false; @@ -2928,6 +4505,11 @@ async_test("postMessage", function() { ok(e === undefined, "e = " + e); else { ok(e.data === (v < 10 ? "10" : 10), "e.data = " + e.data); + ok(e.source === window, "e.source = " + e.source); + ok(e.origin === "http://winetest.example.org", "e.origin = " + e.origin); + + e = document.createEvent("MessageEvent"); + ok(e.data === (v < 10 ? "" : undefined), "created e.data = " + e.data); next_test(); } } diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index de3ff54966c..ceb59ee8a78 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -52,6 +52,16 @@ static enum { static const char doc_blank[] = ""; +static const char doc_blank_ie8[] = + "\n" + "" + " " + " " + " " + " " + " " + ""; + static const char doc_blank_ie9[] = "\n" "" @@ -753,7 +763,10 @@ static void _test_class_info(unsigned line, IUnknown *unk, const CLSID *clsid) #define test_disp2(a,b,c,d,e) _test_disp2(__LINE__,a,b,c,d,e) static void _test_disp2(unsigned line, IUnknown *unk, const IID *diid, const IID *diid2, const CLSID *clsid, const WCHAR *val) { + IDispatchEx *dispex; IUnknown *u; + DISPID id; + BSTR bstr; IID iid; HRESULT hres; @@ -784,6 +797,28 @@ static void _test_disp2(unsigned line, IUnknown *unk, const IID *diid, const IID ok_(__FILE__,line)(hres == E_NOINTERFACE, "Got IProvideClassInfo iface\n"); ok_(__FILE__,line)(!u, "u = %p\n", u); } + + if(compat_mode >= COMPAT_IE9) { + dispex = _get_dispex_iface(line, unk); + bstr = SysAllocString(L"hasOwnProperty"); + hres = IDispatchEx_GetDispID(dispex, bstr, 0, &id); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(hasOwnProperty) failed: %08lx\n", hres); + SysFreeString(bstr); + + bstr = SysAllocString(L"hasoWnPROperty"); + hres = IDispatchEx_GetIDsOfNames(dispex, &IID_NULL, &bstr, 1, 0, &id); + ok_(__FILE__,line)(hres == S_OK, "GetIDsOfNames(hasoWnPROperty) failed: %08lx\n", hres); + ok_(__FILE__,line)(id > 0, "Unexpected DISPID for hasoWnPROperty: %ld\n", id); + + hres = IDispatchEx_GetDispID(dispex, bstr, 0, &id); + ok_(__FILE__,line)(hres == DISP_E_UNKNOWNNAME, "GetDispID(hasoWnPROperty) returned %08lx\n", hres); + + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseInsensitive, &id); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(hasoWnPROperty) with fdexNameCaseInsensitive failed: %08lx\n", hres); + ok_(__FILE__,line)(id > 0, "Unexpected DISPID for hasoWnPROperty with fdexNameCaseInsensitive: %ld\n", id); + SysFreeString(bstr); + IDispatchEx_Release(dispex); + } } #define test_disp(a,b,c,d) _test_disp(__LINE__,a,b,c,d) @@ -2203,6 +2238,42 @@ static void _set_object_name(unsigned line, IHTMLElement *elem, const WCHAR *nam _test_object_name(line, elem, name); } +static void test_factory(void *window, void *factory, const WCHAR *name, const WCHAR *value) +{ + IDispatch *disp, *window_disp = window; + DISPPARAMS dp = { NULL, NULL, 0, 0 }; + BSTR bstr = SysAllocString(name); + VARIANT var, val; + DISPID dispid; + HRESULT hres; + + hres = IDispatch_GetIDsOfNames(window_disp, &IID_NULL, &bstr, 1, 0, &dispid); + SysFreeString(bstr); + ok(hres == S_OK, "GetIDsOfNames(%s) failed: %08lx\n", wine_dbgstr_w(name), hres); + + hres = IDispatch_Invoke(window_disp, dispid, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &var, NULL, NULL); + ok(hres == S_OK, "Invoke(%s) failed: %08lx\n", wine_dbgstr_w(name), hres); + ok(V_VT(&var) == VT_DISPATCH, "VT(%s) = %d\n", wine_dbgstr_w(name), V_VT(&var)); + + hres = IUnknown_QueryInterface((IUnknown*)factory, &IID_IDispatch, (void**)&disp); + ok(hres == S_OK, "Could not get IDispatch from %s factory: %08lx\n", wine_dbgstr_w(name), hres); + ok(disp != V_DISPATCH(&var), "window.%s and the builtin getter returned same dispatch\n", wine_dbgstr_w(name)); + + hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &val, NULL, NULL); + IDispatch_Release(disp); + ok(hres == S_OK, "Invoke(DISPID_VALUE) for %s builtin getter returned: %08lx\n", wine_dbgstr_w(name), hres); + ok(V_VT(&val) == VT_BSTR, "V_VT(value) for %s builtin getter = %d\n", wine_dbgstr_w(name), V_VT(&val)); + ok(!lstrcmpW(V_BSTR(&val), L"[object]"), "value for %s builtin getter = %s\n", wine_dbgstr_w(name), wine_dbgstr_w(V_BSTR(&val))); + VariantClear(&val); + + hres = IDispatch_Invoke(V_DISPATCH(&var), DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &val, NULL, NULL); + VariantClear(&var); + ok(hres == S_OK, "Invoke(DISPID_VALUE) for %s: %08lx\n", wine_dbgstr_w(name), hres); + ok(V_VT(&val) == VT_BSTR, "V_VT(value) for %s = %d\n", wine_dbgstr_w(name), V_VT(&val)); + ok(!lstrcmpW(V_BSTR(&val), value), "value for %s = %s\n", wine_dbgstr_w(name), wine_dbgstr_w(V_BSTR(&val))); + VariantClear(&val); +} + #define create_option_elem(d,t,v) _create_option_elem(__LINE__,d,t,v) static IHTMLOptionElement *_create_option_elem(unsigned line, IHTMLDocument2 *doc, const WCHAR *txt, const WCHAR *val) @@ -2222,6 +2293,7 @@ static IHTMLOptionElement *_create_option_elem(unsigned line, IHTMLDocument2 *do IHTMLWindow2_Release(window); ok_(__FILE__,line) (hres == S_OK, "get_Option failed: %08lx\n", hres); + test_factory(window, factory, L"Option", L"[object HTMLOptionElement]"); test_disp((IUnknown*)factory, &IID_IHTMLOptionElementFactory, NULL, L"[object]"); V_VT(&text) = VT_BSTR; @@ -2325,6 +2397,7 @@ static IHTMLImgElement *_create_img_elem(unsigned line, IHTMLDocument2 *doc, ok_(__FILE__,line) (hres == S_OK, "get_Image failed: %08lx\n", hres); test_ifaces((IUnknown*)factory, img_factory_iids); + test_factory(window, factory, L"Image", L"[object HTMLImageElement]"); test_disp((IUnknown*)factory, &IID_IHTMLImageElementFactory, NULL, L"[object]"); if(wdth >= 0){ @@ -7239,6 +7312,8 @@ static void test_xmlhttprequest(IHTMLWindow5 *window) ok(hres == S_OK, "QueryInterface(&IID_IHTMLXMLHttpRequestFactory) failed: %08lx\n", hres); ok(factory != NULL, "factory == NULL\n"); + test_factory(window, factory, L"XMLHttpRequest", L"[object XMLHttpRequest]"); + xml = NULL; hres = IHTMLXMLHttpRequestFactory_create(factory, &xml); ok(hres == S_OK, "create failed: %08lx\n", hres); @@ -7251,6 +7326,46 @@ static void test_xmlhttprequest(IHTMLWindow5 *window) VariantClear(&var); } +static void test_xdomainrequest(IHTMLWindow6 *window) +{ + IHTMLXDomainRequestFactory *factory; + IHTMLXDomainRequest *xdr; + HRESULT hres; + VARIANT var; + BSTR bstr; + + hres = IHTMLWindow6_get_XDomainRequest(window, &var); + ok(hres == S_OK, "get_XDomainRequest failed: %08lx\n", hres); + ok(V_VT(&var) == VT_DISPATCH || broken(V_VT(&var) == VT_EMPTY), "expect VT_DISPATCH, got %s\n", debugstr_variant(&var)); + + if(V_VT(&var) == VT_EMPTY) { + win_skip("Native XDomainRequest support is missing or disabled.\n"); + return; + } + + factory = NULL; + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLXDomainRequestFactory, (void**)&factory); + ok(hres == S_OK, "QueryInterface(&IID_IHTMLXDomainRequestFactory) failed: %08lx\n", hres); + ok(factory != NULL, "factory == NULL\n"); + + test_factory(window, factory, L"XDomainRequest", L"[object XDomainRequest]"); + + xdr = NULL; + hres = IHTMLXDomainRequestFactory_create(factory, &xdr); + ok(hres == S_OK, "create failed: %08lx\n", hres); + ok(xdr != NULL, "xdr == NULL\n"); + if(is_ie9plus) + test_disp((IUnknown*)xdr, &DIID_DispXDomainRequest, NULL, L"[object]"); + + hres = IHTMLXDomainRequest_get_contentType(xdr, &bstr); + ok(hres == S_OK, "get_contentType returned %08lx\n", hres); + ok(bstr == NULL, "contentType = %s\n", debugstr_w(bstr)); + + IHTMLXDomainRequest_Release(xdr); + IHTMLXDomainRequestFactory_Release(factory); + VariantClear(&var); +} + static void test_read_only_style(IHTMLCSSStyleDeclaration *style) { BSTR none = SysAllocString(L"none"), display = SysAllocString(L"display"), str; @@ -7276,7 +7391,9 @@ static void test_window(IHTMLDocument2 *doc) { IHTMLWindow2 *window, *window2, *self, *parent; IHTMLWindow5 *window5; + IHTMLWindow6 *window6; IHTMLWindow7 *window7; + IHTMLDOMConstructorCollection *ctor_col; IHTMLDocument2 *doc2 = NULL; IDispatch *disp; IUnknown *unk; @@ -7380,6 +7497,18 @@ static void test_window(IHTMLDocument2 *doc) win_skip("IHTMLWindow5 not supported!\n"); } + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow6, (void**)&window6); + if(SUCCEEDED(hres)) { + ok(window6 != NULL, "window6 == NULL\n"); + test_xdomainrequest(window6); + IHTMLWindow6_Release(window6); + }else { + win_skip("IHTMLWindow6 not supported!\n"); + } + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLDOMConstructorCollection, (void**)&ctor_col); + ok(hres == E_NOINTERFACE, "QueryInterface for IHTMLDOMConstructorCollection returned %08lx\n", hres); + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow7, (void**)&window7); if(SUCCEEDED(hres)) { IHTMLCSSStyleDeclaration *computed_style; @@ -7605,6 +7734,29 @@ static void test_xhr(IHTMLDocument2 *doc) IDispatchEx_Release(dispex); } +static void test_xdr(IHTMLDocument2 *doc) +{ + IHTMLWindow2 *window; + IDispatchEx *dispex; + DISPID id; + BSTR str; + HRESULT hres; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + + str = SysAllocString(L"XDomainRequest"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &id); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + SysFreeString(str); + + IHTMLWindow2_Release(window); + IDispatchEx_Release(dispex); +} + static void test_defaults(IHTMLDocument2 *doc) { IHTMLStyleSheetsCollection *stylesheetcol; @@ -7678,6 +7830,7 @@ static void test_defaults(IHTMLDocument2 *doc) } test_xhr(doc); + test_xdr(doc); hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLBodyElement, (void**)&body); ok(hres == S_OK, "Could not get IHTMBodyElement: %08lx\n", hres); @@ -11217,6 +11370,68 @@ static void test_quirks_mode_offsetHeight(IHTMLDocument2 *doc) IHTMLElement_Release(elem); } +static void test_quirks_mode_perf_toJSON(IHTMLDocument2 *doc) +{ + IHTMLPerformanceNavigation *nav; + IHTMLPerformanceTiming *timing; + IHTMLPerformance *perf; + DISPPARAMS dp = { 0 }; + IHTMLWindow2 *window; + IDispatchEx *dispex; + DISPID dispid; + HRESULT hres; + VARIANT var; + BSTR bstr; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "QueryInterface(IID_IDispatchEx) failed: %08lx\n", hres); + IHTMLWindow2_Release(window); + + bstr = SysAllocString(L"performance"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + ok(hres == S_OK, "GetDispID(performance) failed: %08lx\n", hres); + SysFreeString(bstr); + + V_VT(&var) = VT_EMPTY; + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_PROPERTYGET, &dp, &var, NULL, NULL); + ok(hres == S_OK, "InvokeEx(performance) failed: %08lx\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(performance) = %d\n", V_VT(&var)); + ok(V_DISPATCH(&var) != NULL, "V_DISPATCH(performance) = NULL\n"); + IDispatchEx_Release(dispex); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLPerformance, (void**)&perf); + ok(hres == S_OK, "QueryInterface(IID_IHTMLPerformance) failed: %08lx\n", hres); + ok(perf != NULL, "performance is NULL\n"); + VariantClear(&var); + + hres = IHTMLPerformance_toJSON(perf, &var); + ok(hres == E_UNEXPECTED, "toJSON() returned: %08lx\n", hres); + ok(V_VT(&var) == VT_EMPTY, "V_VT(toJSON()) = %d\n", V_VT(&var)); + + hres = IHTMLPerformance_get_navigation(perf, &nav); + ok(hres == S_OK, "get_navigation failed: %08lx\n", hres); + ok(nav != NULL, "performance.navigation is NULL\n"); + + hres = IHTMLPerformanceNavigation_toJSON(nav, &var); + ok(hres == E_UNEXPECTED, "navigation.toJSON() failed: %08lx\n", hres); + ok(V_VT(&var) == VT_EMPTY, "V_VT(navigation.toJSON()) = %d\n", V_VT(&var)); + IHTMLPerformanceNavigation_Release(nav); + + hres = IHTMLPerformance_get_timing(perf, &timing); + ok(hres == S_OK, "get_timing failed: %08lx\n", hres); + ok(timing != NULL, "performance.timing is NULL\n"); + + hres = IHTMLPerformanceTiming_toJSON(timing, &var); + ok(hres == E_UNEXPECTED, "timing.toJSON() failed: %08lx\n", hres); + ok(V_VT(&var) == VT_EMPTY, "V_VT(timing.toJSON()) = %d\n", V_VT(&var)); + IHTMLPerformanceTiming_Release(timing); + + IHTMLPerformance_Release(perf); +} + static IHTMLDocument2 *notif_doc; static BOOL doc_complete; @@ -11863,6 +12078,7 @@ static void test_document_mode_lock(void) IEventTarget *event_target; IPersistStreamInit *init; IHTMLWindow7 *window7; + IHTMLWindow6 *window6; IHTMLWindow5 *window5; IHTMLWindow2 *window; IDispatchEx *dispex; @@ -11916,6 +12132,14 @@ static void test_document_mode_lock(void) ok(V_VT(&var) == VT_EMPTY, "V_VT(XMLHttpRequest) = %d\n", V_VT(&var)); IHTMLWindow5_Release(window5); + V_VT(&var) = VT_NULL; + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow6, (void**)&window6); + ok(hres == S_OK, "Could not get IHTMLWindow6: %08lx\n", hres); + hres = IHTMLWindow6_get_XDomainRequest(window6, &var); + ok(hres == S_OK, "get_XDomainRequest failed: %08lx\n", hres); + ok(V_VT(&var) == VT_EMPTY, "V_VT(XDomainRequest) = %d\n", V_VT(&var)); + IHTMLWindow6_Release(window6); + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow7, (void**)&window7); ok(hres == S_OK, "Could not get IHTMLWindow7: %08lx\n", hres); hres = IHTMLWindow7_get_performance(window7, &var); @@ -12029,6 +12253,77 @@ static void test_document_mode_lock(void) IHTMLDocument2_Release(doc); } +static void test_document_mode_after_initnew(void) +{ + IHTMLDocument2 *doc; + IHTMLDocument6 *doc6; + IEventTarget *event_target; + IPersistStreamInit *init; + IStream *stream; + HRESULT hres; + HGLOBAL mem; + VARIANT var; + SIZE_T len; + MSG msg; + + notif_doc = doc = create_document(); + if(!doc) + return; + doc_complete = FALSE; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IEventTarget, (void**)&event_target); + ok(hres == E_NOINTERFACE, "QueryInterface(IID_IEventTarget) returned %08lx.\n", hres); + ok(event_target == NULL, "event_target != NULL\n"); + + len = strlen(doc_blank_ie9); + mem = GlobalAlloc(0, len); + memcpy(mem, doc_blank_ie9, len); + hres = CreateStreamOnHGlobal(mem, TRUE, &stream); + ok(hres == S_OK, "Failed to create stream: %08lx.\n", hres); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init); + ok(hres == S_OK, "QueryInterface(IID_IPersistStreamInit) failed: %08lx.\n", hres); + + IPersistStreamInit_InitNew(init); + IPersistStreamInit_Load(init, stream); + IPersistStreamInit_Release(init); + IStream_Release(stream); + + set_client_site(doc, TRUE); + do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument6, (void**)&doc6); + ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument6) failed: %08lx\n", hres); + + V_VT(&var) = VT_EMPTY; + hres = IHTMLDocument6_get_documentMode(doc6, &var); + ok(hres == S_OK, "get_documentMode failed: %08lx\n", hres); + ok(V_VT(&var) == VT_R4, "V_VT(documentMode) = %u\n", V_VT(&var)); + ok(V_R4(&var) == 5, "documentMode = %f, expected 5\n", V_R4(&var)); + VariantClear(&var); + + while(!doc_complete && GetMessageW(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IEventTarget, (void**)&event_target); + ok(hres == S_OK, "QueryInterface(IID_IEventTarget) returned %08lx.\n", hres); + ok(event_target != NULL, "event_target == NULL\n"); + IEventTarget_Release(event_target); + + V_VT(&var) = VT_EMPTY; + hres = IHTMLDocument6_get_documentMode(doc6, &var); + ok(hres == S_OK, "get_documentMode failed: %08lx\n", hres); + ok(V_VT(&var) == VT_R4, "V_VT(documentMode) = %u\n", V_VT(&var)); + ok(V_R4(&var) == 9, "documentMode = %f, expected 9\n", V_R4(&var)); + IHTMLDocument6_Release(doc6); + VariantClear(&var); + + set_client_site(doc, FALSE); + IHTMLDocument2_Release(doc); +} + static DWORD WINAPI create_document_proc(void *param) { IHTMLDocument2 *doc = NULL; @@ -12149,9 +12444,12 @@ START_TEST(dom) run_domtest(emptydiv_str, test_docfrag); run_domtest(doc_blank, test_replacechild_elems); run_domtest(doctype_str, test_doctype); + run_domtest(doc_blank, test_quirks_mode_perf_toJSON); + run_domtest(doc_blank_ie8, test_quirks_mode_perf_toJSON); test_quirks_mode(); test_document_mode_lock(); + test_document_mode_after_initnew(); test_threads(); /* Run this last since it messes with the process-wide user agent */ diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 0cbcb95e578..afa24d91d40 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -147,9 +147,18 @@ async_test("iframe_location", function() { iframe.onload = function() { ok(iframe.contentWindow.location.pathname === "/emptyfile", "path = " + iframe.contentWindow.location.pathname); + ok(iframe.contentWindow.Image !== undefined, "Image is undefined"); + ok(iframe.contentWindow.VBArray !== undefined, "VBArray is undefined"); + iframe.contentWindow.Image = undefined; + iframe.contentWindow.VBArray = undefined; + iframe.contentWindow.foobar = 1234; iframe.onload = function () { ok(iframe.contentWindow.location.pathname === "/empty/file", "path = " + iframe.contentWindow.location.pathname); + ok(iframe.contentWindow.Image !== undefined, "Image is undefined (2)"); + ok(iframe.contentWindow.VBArray !== undefined, "VBArray is undefined (2)"); + ok(!Object.prototype.hasOwnProperty.call(iframe.contentWindow, "foobar"), + "contentWindow has foobar"); next_test(); } iframe.src = "empty/file"; @@ -525,6 +534,7 @@ sync_test("storage", function() { sessionStorage.setItem("foobar", 42); ok("foobar" in sessionStorage, "foobar not in sessionStorage"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "foobar"), "foobar not prop of sessionStorage"); item = sessionStorage.getItem("foobar"); ok(item === "42", "'foobar' item = " + item); item = sessionStorage["foobar"]; @@ -535,10 +545,141 @@ sync_test("storage", function() { sessionStorage["barfoo"] = true; ok("barfoo" in sessionStorage, "barfoo not in sessionStorage"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "barfoo"), "barfoo not prop of sessionStorage"); item = sessionStorage["barfoo"]; ok(item === "true", "[barfoo] item = " + item); item = sessionStorage.getItem("barfoo"); ok(item === "true", "'barfoo' item = " + item); + + Object.defineProperty(sessionStorage, "barfoo", {writable: false, enumerable: false, configurable: false, value: 1234}); + var desc = Object.getOwnPropertyDescriptor(sessionStorage, "barfoo"); + ok(desc.value === "1234", "barfoo desc.value = " + desc.value); + ok(desc.writable === true, "barfoo desc.writable = " + desc.writable); + ok(desc.enumerable === true, "barfoo desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "barfoo desc.configurable = " + desc.configurable); + + item = sessionStorage.barfoo; + ok(item === "1234", "'barfoo' prop after defineProperty = " + item); + item = sessionStorage.getItem("barfoo"); + ok(item === "1234", "'barfoo' item after defineProperty = " + item); + + sessionStorage.barfoo = 4321; + item = sessionStorage.barfoo; + ok(item === "4321", "'barfoo' prop after re-set = " + item); + item = sessionStorage.getItem("barfoo"); + ok(item === "4321", "'barfoo' item after re-set = " + item); + + ok((delete sessionStorage.barfoo) === true, "delete sessionStorage.barfoo returned false"); + ok(!("barfoo" in sessionStorage), "barfoo in sessionStorage after defined prop deleted"); + ok(!Object.prototype.hasOwnProperty.call(sessionStorage, "barfoo"), "barfoo prop of sessionStorage after defined prop deleted"); + item = sessionStorage.barfoo; + ok(item === undefined, "[barfoo] item after second delete = " + item); + item = sessionStorage.getItem("barfoo"); + ok(item === null, "'barfoo' item after second delete = " + item); + + Object.defineProperty(sessionStorage, "winetest", {enumerable: false, configurable: true, + get: function() { return 42; }, set: function() { item = 1234; } }); + desc = Object.getOwnPropertyDescriptor(sessionStorage, "winetest"); + ok(desc.get() === 42, "winetest desc.get() = " + desc.get()); + ok(desc.enumerable === false, "winetest desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "winetest desc.configurable = " + desc.configurable); + + item = sessionStorage.winetest; + ok(item === 42, "'winetest' prop = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item = " + item); + + sessionStorage.winetest = 0; + ok(item === 1234, "'winetest' item after setter = " + item); + + sessionStorage.setItem("winetest", "test"); + item = sessionStorage.winetest; + ok(item === "test", "'winetest' prop after setItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === "test", "'winetest' item after setItem = " + item); + + desc = Object.getOwnPropertyDescriptor(sessionStorage, "winetest"); + ok(desc.get() === 42, "winetest desc.get() after setItem = " + desc.get()); + ok(desc.enumerable === false, "winetest desc.enumerable after setItem = " + desc.enumerable); + ok(desc.configurable === true, "winetest desc.configurable after setItem = " + desc.configurable); + + item = sessionStorage.winetest; + ok(item === "test", "'winetest' prop before second setter = " + item); + sessionStorage.winetest = 0; + ok(item === 1234, "'winetest' item after second setter = " + item); + item = sessionStorage.winetest; + ok(item === "test", "'winetest' prop after second setter = " + item); + + sessionStorage.removeItem("winetest"); + item = sessionStorage.winetest; + ok(item === 42, "'winetest' prop after removeItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item after removeItem = " + item); + + sessionStorage.setItem("winetest", "wine"); + item = sessionStorage.winetest; + ok(item === "wine", "'winetest' prop after second setItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === "wine", "'winetest' item after second setItem = " + item); + + ok((delete sessionStorage.winetest) === true, "delete sessionStorage.winetest returned false"); + ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after delete"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after delete"); + item = sessionStorage.winetest; + ok(item === 42, "'winetest' item after delete = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item after delete = " + item); + + ok((delete sessionStorage.winetest) === true, "second delete sessionStorage.winetest returned false"); + ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after second delete"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after second delete"); + item = sessionStorage.winetest; + ok(item === 42, "'winetest' item after second delete = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item after second delete = " + item); + + Object.defineProperty(sessionStorage, "nonconf", {enumerable: false, configurable: false, + get: function() { return 1; }, set: function() {} }); + desc = Object.getOwnPropertyDescriptor(sessionStorage, "nonconf"); + ok(desc.get() === 1, "nonconf desc.get() = " + desc.get()); + ok(desc.enumerable === false, "nonconf desc.enumerable = " + desc.enumerable); + ok(desc.configurable === false, "nonconf desc.configurable = " + desc.configurable); + + sessionStorage.setItem("nonconf", "test"); + item = sessionStorage.nonconf; + ok(item === "test", "'nonconf' prop after setItem = " + item); + item = sessionStorage.getItem("nonconf"); + ok(item === "test", "'nonconf' item after setItem = " + item); + + desc = Object.getOwnPropertyDescriptor(sessionStorage, "nonconf"); + ok(desc.get() === 1, "nonconf desc.get() after setItem = " + desc.get()); + ok(desc.enumerable === false, "nonconf desc.enumerable after setItem = " + desc.enumerable); + ok(desc.configurable === false, "nonconf desc.configurable after setItem = " + desc.configurable); + + ok((delete sessionStorage.nonconf) === true, "delete sessionStorage.nonconf returned false"); + ok("nonconf" in sessionStorage, "'nonconf' not in sessionStorage after delete"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "nonconf"), "'nonconf' not prop of sessionStorage after delete"); + item = sessionStorage.nonconf; + ok(item === 1, "'nonconf' item after delete = " + item); + item = sessionStorage.getItem("nonconf"); + ok(item === null, "'nonconf' item after delete = " + item); + + sessionStorage.setItem("protoprop", "1111"); + item = sessionStorage.protoprop; + ok(item === "1111", "'protoprop' = " + item); + + var obj = Object.create(sessionStorage); + ok("protoprop" in obj, "'protoprop' not in object with sessionStorage prototype"); + ok(!Object.prototype.hasOwnProperty.call(obj, "protoprop"), "'protoprop' prop of object with sessionStorage prototype"); + item = obj.protoprop; + ok(item === "1111", "'protoprop' on obj = " + item); + + var name = null; + for(name in obj) + ok(name === "protoprop", "got " + name + " prop enumerating"); + ok(name === "protoprop", "protoprop not enumerated"); + + sessionStorage.clear(); }); async_test("animation", function() { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index b6ce7be3c54..bbb616646a4 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -23,15 +23,27 @@ var JS_E_NUMBER_EXPECTED = 0x800a1389; var JS_E_FUNCTION_EXPECTED = 0x800a138a; var JS_E_DATE_EXPECTED = 0x800a138e; var JS_E_OBJECT_EXPECTED = 0x800a138f; +var JS_E_UNDEFINED_VARIABLE = 0x800a1391; var JS_E_BOOLEAN_EXPECTED = 0x800a1392; var JS_E_VBARRAY_EXPECTED = 0x800a1395; var JS_E_ENUMERATOR_EXPECTED = 0x800a1397; var JS_E_REGEXP_EXPECTED = 0x800a1398; var JS_E_UNEXPECTED_QUANTIFIER = 0x800a139a; +var JS_E_INVALID_LENGTH = 0x800a13a5; var JS_E_INVALID_WRITABLE_PROP_DESC = 0x800a13ac; var JS_E_NONCONFIGURABLE_REDEFINED = 0x800a13d6; var JS_E_NONWRITABLE_MODIFIED = 0x800a13d7; +var JS_E_TYPEDARRAY_BAD_CTOR_ARG = 0x800a13da; +var JS_E_NOT_TYPEDARRAY = 0x800a13db; +var JS_E_TYPEDARRAY_INVALID_OFFSLEN = 0x800a13dc; +var JS_E_TYPEDARRAY_INVALID_SUBARRAY = 0x800a13dd; +var JS_E_TYPEDARRAY_INVALID_SOURCE = 0x800a13de; +var JS_E_NOT_DATAVIEW = 0x800a13df; +var JS_E_DATAVIEW_NO_ARGUMENT = 0x800a13e0; +var JS_E_DATAVIEW_INVALID_ACCESS = 0x800a13e1; +var JS_E_DATAVIEW_INVALID_OFFSET = 0x800a13e2; var JS_E_WRONG_THIS = 0x800a13fc; +var JS_E_ARRAYBUFFER_EXPECTED = 0x800a15e4; var tests = []; @@ -458,7 +470,14 @@ sync_test("array_sort", function() { }); sync_test("identifier_keywords", function() { + function get(let, set) { { get instanceof (Object); } return let + set; } + set: var let = get(1, 2); + { get: 10 } + var set = 0; var o = { + get: get, + set: set, + let: let, if: 1, default: 2, function: 3, @@ -471,8 +490,8 @@ sync_test("identifier_keywords", function() { else: true, finally: true, for: true, - in: true, - instanceof: true, + set in(x) { }, + get instanceof() { return 3; }, new: true, return: true, switch: true, @@ -493,6 +512,19 @@ sync_test("identifier_keywords", function() { ok(o.if === 1, "o.if = " + o.if); ok(ro().default === 2, "ro().default = " + ro().default); ok(o.false === true, "o.false = " + o.false); + ok(o.get === get, "o.let = " + o.get); + ok(o.set === set, "o.let = " + o.set); + ok(o.let === let, "o.let = " + o.let); + ok(o.instanceof === 3, "o.instanceof = " + o.instanceof); + + var tmp = false; + try { + eval('function var() { }'); + } + catch(set) { + tmp = true; + } + ok(tmp === true, "Expected exception for 'function var() { }'"); }); function test_own_data_prop_desc(obj, prop, expected_writable, expected_enumerable, @@ -1131,7 +1163,6 @@ sync_test("toString", function() { todo_wine. ok(tmp === "[object Arguments]", "toString.call(arguments) = " + tmp); tmp = Object.prototype.toString.call(this); - todo_wine. ok(tmp === "[object Window]", "toString.call(null) = " + tmp); tmp = Object.prototype.toString.call(null); ok(tmp === "[object Null]", "toString.call(null) = " + tmp); @@ -1681,6 +1712,809 @@ sync_test("RegExp", function() { } }); +sync_test("ArrayBuffers & Views", function() { + var i, r, buf, buf2, view, view2, arr, arr2; + + var types = [ + [ "Int8", 1 ], + [ "Uint8", 1 ], + [ "Int16", 2 ], + [ "Uint16", 2 ], + [ "Int32", 4 ], + [ "Uint32", 4 ], + [ "Float32", 4 ], + [ "Float64", 8 ] + ]; + + function test_own_props(obj_name, props) { + var obj = eval(obj_name); + for(var i = 0; i < props.length; i++) + ok(Object.prototype.hasOwnProperty.call(obj, props[i]), props[i] + " not a property of " + obj_name); + } + + function test_not_own_props(obj_name, props) { + var obj = eval(obj_name); + for(var i = 0; i < props.length; i++) + ok(!Object.prototype.hasOwnProperty.call(obj, props[i]), props[i] + " is a property of " + obj_name); + } + + function test_readonly(obj, prop, val) { + var name = Object.getPrototypeOf(obj).constructor.toString(); + name = name.substring(9, name.indexOf("(", 9)) + ".prototype." + prop; + obj[prop] = val + 42; + ok(obj[prop] === val, name + " not read-only"); + } + + test_own_props("ArrayBuffer", [ "isView" ]); + test_own_props("ArrayBuffer.prototype", [ "byteLength", "slice" ]); + test_own_data_prop_desc(ArrayBuffer.prototype, "byteLength", false, false, false); + + r = Object.prototype.toString.call(new ArrayBuffer()); + ok(r === "[object ArrayBuffer]", "Object toString(new ArrayBuffer()) = " + r); + r = ArrayBuffer.length; + ok(r === 1, "ArrayBuffer.length = " + r); + r = ArrayBuffer.isView.length; + ok(r === 1, "ArrayBuffer.isView.length = " + r); + r = ArrayBuffer.prototype.slice.length; + ok(r === 2, "ArrayBuffer.prototype.slice.length = " + r); + + try { + ArrayBuffer.prototype.slice.call(null); + ok(false, "ArrayBuffer: calling slice with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_ARRAYBUFFER_EXPECTED, "ArrayBuffer: calling slice with null context threw " + n); + } + try { + ArrayBuffer.prototype.slice.call({}); + ok(false, "ArrayBuffer: calling slice with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_ARRAYBUFFER_EXPECTED, "ArrayBuffer: calling slice with an object context threw " + n); + } + try { + new ArrayBuffer(-1); + ok(false, "new ArrayBuffer(-1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_INVALID_LENGTH, "new ArrayBuffer(-1) threw " + n); + } + + buf = new ArrayBuffer(); + ok(buf.byteLength === 0, "ArrayBuffer().byteLength = " + buf.byteLength); + buf = new ArrayBuffer(13.1); + ok(buf.byteLength === 13, "ArrayBuffer(13).byteLength = " + buf.byteLength); + buf = ArrayBuffer("10"); + ok(buf.byteLength === 10, "ArrayBuffer(10).byteLength = " + buf.byteLength); + test_readonly(buf, "byteLength", 10); + test_own_data_prop_desc(buf, "byteLength", false, false, false); + + ok(ArrayBuffer.isView() === false, "ArrayBuffer.isView() returned true"); + ok(ArrayBuffer.isView([]) === false, "ArrayBuffer.isView([]) returned true"); + ok(ArrayBuffer.isView({}) === false, "ArrayBuffer.isView({}) returned true"); + ok(ArrayBuffer.isView(undefined) === false, "ArrayBuffer.isView(undefined) returned true"); + ok(ArrayBuffer.isView(null) === false, "ArrayBuffer.isView(null) returned true"); + ok(ArrayBuffer.isView(buf) === false, "ArrayBuffer.isView(ArrayBuffer) returned true"); + + test_own_props("DataView.prototype", [ + "buffer", "byteLength", "byteOffset", + "getInt8", "setInt8", "getUint8", "setUint8", + "getInt16", "setInt16", "getUint16", "setUint16", + "getInt32", "setInt32", "getUint32", "setUint32", + "getFloat32", "setFloat32", "getFloat64", "setFloat64" + ]); + + r = Object.prototype.toString.call(new DataView(buf)); + ok(r === "[object Object]", "Object toString(new DataView(buf)) = " + r); + r = DataView.length; + ok(r === 1, "DataView.length = " + r); + + /* DataView.prototype has actual accessors, but others don't */ + arr = [ "buffer", "byteLength", "byteOffset" ]; + for(i = 0; i < arr.length; i++) { + var prop = arr[i], desc = Object.getOwnPropertyDescriptor(DataView.prototype, prop); + ok(!("value" in desc), "DataView: value is in desc"); + ok(!("writable" in desc), "DataView: writable is in desc"); + ok(desc.enumerable === false, "DataView: desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "DataView: desc.configurable = " + desc.configurable); + ok(Object.getPrototypeOf(desc.get) === Function.prototype, "DataView: desc.get not a function: " + desc.get); + ok("set" in desc, "DataView: set is not in desc"); + ok(desc.set === undefined, "DataView: desc.set not undefined: " + desc.set); + try { + desc.get.call(null); + ok(false, "DataView: calling " + prop + " getter with null did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "DataView: calling " + prop + " getter with null threw " + n); + } + try { + desc.get.call({}); + ok(false, "DataView: calling " + prop + " getter with an object did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "DataView: calling " + prop + " getter with an object threw " + n); + } + try { + desc.get.call(DataView); + ok(false, "DataView: calling " + prop + " getter with DataView constructor did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "DataView: calling " + prop + " getter with DataView constructor threw " + n); + } + try { + desc.get.call(new ArrayBuffer()); + ok(false, "DataView: calling " + prop + " getter with ArrayBuffer did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "DataView: calling " + prop + " getter with ArrayBuffer threw " + n); + } + r = desc.get.call(DataView.prototype); + if(prop === "buffer") + ok(Object.getPrototypeOf(r) === ArrayBuffer.prototype, "DataView: calling " + prop + " getter with DataView.prototype returned " + r); + else + ok(r === 0, "DataView: calling " + prop + " getter with DataView.prototype returned " + r); + } + + try { + new DataView(); + ok(false, "new DataView() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_NO_ARGUMENT, "new DataView() threw " + n); + } + try { + new DataView(ArrayBuffer); + ok(false, "new DataView(ArrayBuffer) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_NO_ARGUMENT, "new DataView(ArrayBuffer) threw " + n); + } + try { + new DataView(buf, -1); + ok(false, "new DataView(buf, -1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_OFFSET, "new DataView(buf, -1) threw " + n); + } + try { + new DataView(buf, 11); + ok(false, "new DataView(buf, 11) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_OFFSET, "new DataView(buf, 11) threw " + n); + } + try { + new DataView(buf, 9, 2); + ok(false, "new DataView(buf, 9, 2) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_OFFSET, "new DataView(buf, 9, 2) threw " + n); + } + + view = new DataView(buf, 9, 1); + ok(view.buffer === buf, "DataView(buf, 9, 1).buffer = " + view.buffer); + ok(view.byteLength === 1, "DataView(buf, 9, 1).byteLength = " + view.byteLength); + ok(view.byteOffset === 9, "DataView(buf, 9, 1).byteOffset = " + view.byteOffset); + test_readonly(view, "byteLength", 1); + test_readonly(view, "byteOffset", 9); + test_not_own_props("view", [ "buffer", "byteLength", "byteOffset" ]); + + view = new DataView(buf, 10); + ok(view.buffer === buf, "DataView(buf, 10).buffer = " + view.buffer); + ok(view.byteLength === 0, "DataView(buf, 10).byteLength = " + view.byteLength); + ok(view.byteOffset === 10, "DataView(buf, 10).byteOffset = " + view.byteOffset); + view = new DataView(buf, 1, 7); + ok(view.buffer === buf, "DataView(buf, 1, 7).buffer = " + view.buffer); + ok(view.byteLength === 7, "DataView(buf, 1, 7).byteLength = " + view.byteLength); + ok(view.byteOffset === 1, "DataView(buf, 1, 7).byteOffset = " + view.byteOffset); + view2 = new DataView(buf, 6); + ok(view2.buffer === buf, "DataView(buf, 6).buffer = " + view2.buffer); + ok(view2.byteLength === 4, "DataView(buf, 6).byteLength = " + view2.byteLength); + ok(view2.byteOffset === 6, "DataView(buf, 6).byteOffset = " + view2.byteOffset); + view = DataView(buf); + ok(view.buffer === buf, "DataView(buf).buffer = " + view.buffer); + ok(view.byteLength === 10, "DataView(buf).byteLength = " + view.byteLength); + ok(view.byteOffset === 0, "DataView(buf).byteOffset = " + view.byteOffset); + + ok(ArrayBuffer.isView(DataView) === false, "ArrayBuffer.isView(DataView) returned true"); + ok(ArrayBuffer.isView(view) === true, "ArrayBuffer.isView(DataView(buf)) returned false"); + + for(i = 0; i < 10; i++) { + r = view.getInt8(i); + ok(r === 0, "view byte " + i + " = " + r); + } + + for(i = 0; i < types.length; i++) { + var method = "get" + types[i][0], offs = 11 - types[i][1]; + r = DataView.prototype[method].length; + ok(r === 1, "DataView.prototype." + method + ".length = " + r); + try { + view[method](); + ok(false, "view." + method + "() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_NO_ARGUMENT, "view." + method + "() threw " + n); + } + try { + view[method](-1); + ok(false, "view." + method + "(-1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_ACCESS, "view." + method + "(-1) threw " + n); + } + try { + view[method](offs); + ok(false, "view." + method + "(" + offs + ") did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_ACCESS, "view." + method + "(" + offs + ") threw " + n); + } + try { + view[method].call(null, 0); + ok(false, "view." + method + "(0) with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "view." + method + "(0) with null context threw " + n); + } + try { + view[method].call({}, 0); + ok(false, "view." + method + "(0) with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "view." + method + "(0) with an object context threw " + n); + } + method = "set" + types[i][0]; + r = DataView.prototype[method].length; + ok(r === 1, "DataView.prototype." + method + ".length = " + r); + try { + view[method](); + ok(false, "view." + method + "() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_NO_ARGUMENT, "view." + method + "() threw " + n); + } + try { + view[method](0); + ok(false, "view." + method + "(0) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_NO_ARGUMENT, "view." + method + "(0) threw " + n); + } + try { + view[method](-1, 0); + ok(false, "view." + method + "(-1, 0) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_ACCESS, "view." + method + "(-1, 0) threw " + n); + } + try { + view[method](offs, 0); + ok(false, "view." + method + "(" + offs + ", 0) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_DATAVIEW_INVALID_ACCESS, "view." + method + "(" + offs + ", 0) threw " + n); + } + try { + view[method].call(null, 0, 0); + ok(false, "view." + method + "(0, 0) with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "view." + method + "(0, 0) with null context threw " + n); + } + try { + view[method].call({}, 0, 0); + ok(false, "view." + method + "(0, 0) with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_DATAVIEW, "view." + method + "(0, 0) with an object context threw " + n); + } + } + + r = view.setInt8(1, -257); + ok(r === undefined, "view.setInt8(1, -1) returned " + r); + r = view.getUint16(0); + ok(r === 255, "view.getUint16(0) returned " + r); + r = view.getUint16(0, true); + ok(r === 65280, "view.getUint16(0, true) returned " + r); + r = view.setUint32(2, "12345678", true); + ok(r === undefined, "view.setUint32(2, '12345678', true) returned " + r); + r = view.getInt32(1); + ok(r === -11640388, "view.getInt32(1) returned " + r); + r = view.setInt16(3, 65535, true); + ok(r === undefined, "view.setInt16(3, 65535) returned " + r); + r = view.getUint16(3); + ok(r === 65535, "view.getUint16(3) returned " + r); + r = view.setUint32(0, -2, true); + ok(r === undefined, "view.setUint32(0, -2) returned " + r); + r = view.getInt32(0, true); + ok(r === -2, "view.getInt32(0) returned " + r); + r = view.setFloat32(6, 1234.5, true); + ok(r === undefined, "view.setFloat32(6, 1234.5) returned " + r); + r = view2.getFloat32(0, true); + ok(r === 1234.5, "view2.getFloat32(0) returned " + r); + + r = buf.slice(-9, 1); + ok(r instanceof ArrayBuffer, "buf.slice did not return an ArrayBuffer"); + ok(r.byteLength === 0, "buf.slice(-9, 1).byteLength = " + r.byteLength); + r = buf.slice(); + ok(r.byteLength === 10, "buf.slice().byteLength = " + r.byteLength); + r = buf.slice(9, 16); + ok(r.byteLength === 1, "buf.slice(9, 16).byteLength = " + r.byteLength); + r = buf.slice(-9, -1); + ok(r.byteLength === 8, "buf.slice(-9, -1).byteLength = " + r.byteLength); + + /* setters differing only in signedness have identical behavior, but they're not the same methods */ + ok(view.setInt8 !== view.setUint8, "setInt8 and setUint8 are the same method"); + ok(view.setInt16 !== view.setUint16, "setInt16 and setUint16 are the same method"); + ok(view.setInt32 !== view.setUint32, "setInt32 and setUint32 are the same method"); + + /* slice makes a copy */ + buf2 = buf.slice(-9); + ok(buf2.byteLength === 9, "buf.slice(-9).byteLength = " + buf2.byteLength); + view2 = DataView(buf2, 1); + ok(view2.byteLength === 8, "buf.slice(-9) view(1).byteLength = " + view2.byteLength); + ok(ArrayBuffer.isView(buf2) === false, "ArrayBuffer.isView(buf.slice(-9)) returned true"); + ok(ArrayBuffer.isView(view2) === true, "ArrayBuffer.isView(DataView(buf.slice(-9))) returned false"); + + r = view2.getUint32(0); + ok(r === 4294967040, "buf.slice(-9) view(1).getUint32(0) returned " + r); + view2.setInt16(0, -5); + r = view2.getUint16(1); + ok(r === 64511, "buf.slice(-9) view(1).getUint16(1) returned " + r); + r = view.getInt32(1); + ok(r === -1, "view.getInt32(1) after slice changed returned " + r); + + r = view2.setFloat64(0, 11.875); + ok(r === undefined, "buf.slice(-9) view(1).setFloat64(0, 11.875) returned " + r); + r = view2.getFloat64(0); + ok(r === 11.875, "buf.slice(-9) view(1).getFloat64(0) returned " + r); + + for(i = 0; i < types.length; i++) { + var arrType = types[i][0] + "Array", typeSz = types[i][1]; + test_own_props(arrType, [ "BYTES_PER_ELEMENT" ]); + test_not_own_props(arrType, [ "from", "of" ]); + test_own_props(arrType + ".prototype", [ "buffer", "byteLength", "byteOffset", "length", "set", "subarray" ]); + test_not_own_props(arrType + ".prototype", [ + "at", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", + "includes", "indexOf", "join", "keys", "lastIndexOf", "map", "reduce", "reduceRight", + "reverse", "slice", "some", "sort", "toLocaleString", "toString", "values" + ]); + + arr = eval(arrType); + test_own_data_prop_desc(arr, "BYTES_PER_ELEMENT", false, false, false); + ok(arr.BYTES_PER_ELEMENT === typeSz, arrType + ".BYTES_PER_ELEMENT = " + arr.BYTES_PER_ELEMENT); + r = arr.length; + ok(r === 1, arrType + ".length = " + r); + r = arr.prototype.set.length; + ok(r === 2, arrType + ".prototype.set.length = " + r); + r = arr.prototype.subarray.length; + ok(r === 2, arrType + ".prototype.subarray.length = " + r); + + r = eval("Object.getPrototypeOf(" + arrType + ")"); + ok(r === Function.prototype, arrType + "'s prototype is not Function.prototype: " + r); + r = eval("Object.getPrototypeOf(" + arrType + ".prototype)"); + ok(r === Object.prototype, arrType + ".prototype's prototype is not Object.prototype: " + r); + r = eval("Object.prototype.toString.call(new " + arrType + "(3))"); + ok(r === "[object " + arrType + "]", "Object toString(new " + arrType + "(3)) = " + r); + r = eval(arrType + ".prototype"); + test_own_data_prop_desc(r, "byteLength", false, false, false); + test_own_data_prop_desc(r, "byteOffset", false, false, false); + test_own_data_prop_desc(r, "length", false, false, false); + test_own_data_prop_desc(r, "buffer", false, false, false); + + buf = ArrayBuffer(34); + try { + eval("new " + arrType + "(-1)"); + ok(false, "new " + arrType + "(-1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(-1) threw " + n); + } + try { + eval("new " + arrType + "(buf, -1)"); + ok(false, "new " + arrType + "(buf, -1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, -1) threw " + n); + } + try { + eval("new " + arrType + "(buf, 36)"); + ok(false, "new " + arrType + "(buf, 36) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, 36) threw " + n); + } + try { + eval("new " + arrType + "(buf, 32, 4)"); + ok(false, "new " + arrType + "(buf, 32, 4) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, 32, 4) threw " + n); + } + try { + eval("new " + arrType + "('9')"); + ok(false, "new " + arrType + "('9') did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "('9') threw " + n); + } + try { + eval("new " + arrType + "(null)"); + ok(false, "new " + arrType + "(null) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "(null) threw " + n); + } + try { + eval("new " + arrType + "({})"); + ok(false, "new " + arrType + "({}) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "({}) threw " + n); + } + if(typeSz > 1) { + /* test misalignment */ + var a = typeSz >>> 1; + try { + eval("new " + arrType + "(buf, a, 1)"); + ok(false, "new " + arrType + "(buf, " + a + ", 1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, " + a + ", 1) threw " + n); + } + a += typeSz; + var b = new ArrayBuffer(a); + try { + eval("new " + arrType + "(b)"); + ok(false, "new " + arrType + "(new ArrayBuffer(" + a + ")) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(new ArrayBuffer(" + a + ")) threw " + n); + } + } + + arr = eval("new " + arrType + "()"); + ok(arr.byteLength === 0, arrType + "().byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, arrType + "().byteOffset = " + arr.byteOffset); + ok(arr.length === 0, arrType + "().length = " + arr.length); + ok(arr.buffer.byteLength === 0, arrType + "().buffer.byteLength = " + arr.buffer.byteLength); + test_readonly(arr, "byteLength", 0); + test_readonly(arr, "byteOffset", 0); + test_readonly(arr, "length", 0); + test_own_data_prop_desc(arr, "byteLength", false, false, false); + test_own_data_prop_desc(arr, "byteOffset", false, false, false); + test_own_data_prop_desc(arr, "length", false, false, false); + test_own_data_prop_desc(arr, "buffer", false, false, false); + + ok(ArrayBuffer.isView(arr) === true, "ArrayBuffer.isView(" + arrType + "()) returned false"); + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, arrType + "() not frozen"); + + arr = eval(arrType + "(9.1)"); + ok(arr.byteLength === 9 * typeSz, arrType + "(9.1).byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, arrType + "(9.1).byteOffset = " + arr.byteOffset); + ok(arr.length === 9, arrType + "(9.1).length = " + arr.length); + ok(arr.buffer.byteLength === arr.byteLength, arrType + "(9.1).buffer.byteLength = " + arr.buffer.byteLength); + for(var j = 0; j < 9; j++) + ok(arr[j] === 0, "arr[" + j + "] = " + arr[j]); + arr[5] = 42; + ok(arr[5] === 42, arrType + "(9.1)[5] = " + arr[5]); + arr[9] = 50; + ok(arr[9] === undefined, arrType + "(9.1)[9] = " + arr[9]); + + eval(arrType + ".prototype[6] = 'foo'"); + r = eval(arrType + ".prototype[6]"); + ok(r === undefined, arrType + ".prototype[6] = " + r); + ok(arr[6] === 0, arrType + "(9.1)[6] after set in prototype = " + arr[6]); + arr[6] = 0; + ok(Object.prototype.hasOwnProperty.call(arr, "6"), "'6' not a property of " + arrType + "(9.1)[6]"); + test_own_data_prop_desc(arr, "6", true, true, false); + r = (delete arr[6]); + ok(r === false, "delete " + arrType + "(9.1)[6] returned " + r); + try { + Object.defineProperty(arr, "6", {writable: false, enumerable: false, configurable: true, value: 10}); + ok(false, "redefining " + arrType + "(9.1)[6] with different flags did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NONCONFIGURABLE_REDEFINED, "redefining " + arrType + "(9.1)[6] with different flags threw " + n); + } + Object.defineProperty(arr, "6", {writable: true, enumerable: true, configurable: false, value: 10}); + ok(arr[6] === 10, arrType + "(9.1)[6] after definition = " + arr[6]); + Object.defineProperty(arr, "6", {writable: true, enumerable: true, configurable: false, value: "foo"}); + if(arrType.substr(0, 5) === "Float") + ok(arr[6] !== arr[6] /* NaN */, arrType + "(9.1)[6] after definition to string = " + arr[6]); + else + ok(arr[6] === 0, arrType + "(9.1)[6] after definition to string = " + arr[6]); + + eval(arrType + ".prototype[100] = 'foobar'"); + r = eval(arrType + ".prototype[100]"); + ok(r === undefined, arrType + ".prototype[100] = " + r); + ok(arr[100] === undefined, arrType + "(9.1)[100] after set in prototype = " + arr[100]); + arr[100] = 0; + ok(arr[100] === undefined, arrType + "(9.1)[100] after set to zero = " + arr[100]); + ok(!Object.prototype.hasOwnProperty.call(arr, "100"), "'100' is a property of " + arrType + "(9.1)[100]"); + r = (delete arr[100]); + ok(r === false, "delete " + arrType + "(9.1)[100] returned " + r); + try { + Object.defineProperty(arr, "100", {writable: false, enumerable: false, configurable: true, value: 10}); + ok(false, "redefining " + arrType + "(9.1)[100] with different flags did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NONCONFIGURABLE_REDEFINED, "redefining " + arrType + "(9.1)[100] with different flags threw " + n); + } + Object.defineProperty(arr, "100", {writable: true, enumerable: true, configurable: false, value: 10}); + ok(arr[100] === undefined, arrType + "(9.1)[100] after defined to 10 = " + arr[100]); + ok(!Object.prototype.hasOwnProperty.call(arr, "100"), "'100' is a property of " + arrType + "(9.1)[100] after definition"); + ok(arr[100] === undefined, arrType + "(9.1)[100] after definition = " + arr[100]); + + r = 0; + for(var idx in arr) { + ok(idx === ""+r, arrType + "(9.1) enum idx " + r + " = " + idx); + r++; + } + ok(r === 9, arrType + "(9.1) enum did " + r + " iterations"); + + eval(arrType + ".prototype[-1] = 'barfoo'"); + r = eval(arrType + ".prototype[-1]"); + ok(r === "barfoo", arrType + ".prototype[-1] = " + r); + ok(arr[-1] === "barfoo", arrType + "(9.1)[-1] after set in prototype = " + arr[-1]); + + eval(arrType + ".prototype.foo = 'bar'"); + r = eval(arrType + ".prototype.foo = 'bar'"); + ok(r === "bar", arrType + ".prototype.foo = " + r); + ok(arr.foo === "bar", arrType + "(9.1).foo after set in prototype = " + arr.foo); + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, arrType + "(9.1) not frozen"); + arr = eval(arrType + ".prototype"); + delete arr[-1]; + delete arr.foo; + + arr2 = { length: 4 }; + arr2[0] = 1.5; + arr2[1] = '3'; + arr2[3] = 12; + var name = arrType + "(array-like object)"; + arr = eval(arrType + "(arr2)"); + ok(arr.byteLength === 4 * typeSz, name + ".byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, name + ".byteOffset = " + arr.byteOffset); + ok(arr.length === 4, name + ".length = " + arr.length); + if(isNaN(arr[2])) { + ok(arr[0] === 1.5, name + "[0] = " + arr[0]); + ok(arr[1] === 3, name + "[1] = " + arr[1]); + ok(arr[3] === 12, name + "[3] = " + arr[3]); + }else + for(var j = 0; j < 4; j++) + ok(arr[j] === [1, 3, 0, 12][j], name + "[" + j + "] = " + arr[j]); + + name = arrType + "(buf, " + typeSz + ", 2)"; + arr = eval(name); + ok(arr.byteLength === 2 * typeSz, name + ".byteLength = " + arr.byteLength); + ok(arr.byteOffset === typeSz, name + ".byteOffset = " + arr.byteOffset); + ok(arr.length === 2, name + ".length = " + arr.length); + ok(arr.buffer === buf, name + ".buffer = " + arr.buffer); + view = DataView(buf); + view["set" + types[i][0]](typeSz, 10, true); + ok(arr[0] === 10, "arr[0] after DataView(buf).set" + types[i][0] + " = " + arr[0]); + arr[0] = 12; + r = view["get" + types[i][0]](typeSz, true); + ok(r === 12, "DataView(buf).get" + types[i][0] + " after arr[0] set = " + r); + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, name + " not frozen"); + + arr2 = eval(arrType + "(arr)"); + ok(arr2.byteLength === arr.byteLength, name + " copy.byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 0, name + " copy.byteOffset = " + arr2.byteOffset); + ok(arr2.length === arr.length, name + " copy.length = " + arr2.length); + ok(arr2.buffer !== arr.buffer, name + " copy.buffer = " + arr2.buffer); + arr2 = arr.subarray(undefined, "1"); + ok(arr2.byteLength === typeSz, name + " subarray(undefined, '1').byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === arr.byteOffset, name + " subarray(undefined, '1').byteOffset = " + arr2.byteOffset); + ok(arr2.length === 1, name + " subarray(undefined, '1').length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + " subarray(undefined, '1').buffer = " + arr2.buffer); + + name = arrType + "(10)"; + arr = eval(name); + try { + arr.subarray.call(null, 0); + ok(false, arrType + ": calling subarray with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling subarray with null context threw " + n); + } + try { + arr.subarray.call({}, 0); + ok(false, arrType + ": calling subarray with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling subarray with an object context threw " + n); + } + try { + arr.subarray(); + ok(false, name + " subarray() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SUBARRAY, name + " subarray() threw " + n); + } + arr2 = arr.subarray(4); + ok(arr2.byteLength === 6 * typeSz, name + ".subarray(4).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 4 * typeSz, name + ".subarray(4).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 6, name + ".subarray(4).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(4).buffer = " + arr2.buffer); + arr2 = arr.subarray(4, 2); + ok(arr2.byteLength === 0, name + ".subarray(4, 2).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 4 * typeSz, name + ".subarray(4, 2).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 0, name + ".subarray(4, 2).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(4, 2).buffer = " + arr2.buffer); + arr2 = arr.subarray(-3, 100); + ok(arr2.byteLength === 3 * typeSz, name + ".subarray(-3, 100).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 7 * typeSz, name + ".subarray(-3, 100).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 3, name + ".subarray(-3, 100).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(-3, 100).buffer = " + arr2.buffer); + arr2 = arr.subarray(42, -1); + ok(arr2.byteLength === 0, name + ".subarray(42, -1).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 10 * typeSz, name + ".subarray(42, -1).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 0, name + ".subarray(42, -1).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(42, -1).buffer = " + arr2.buffer); + arr2 = arr.subarray(2, -3); + ok(arr2.byteLength === 5 * typeSz, name + ".subarray(2, -3).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 2 * typeSz, name + ".subarray(2, -3).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 5, name + ".subarray(2, -3).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(2, -3).buffer = " + arr2.buffer); + + try { + arr.set.call(null, [1]); + ok(false, arrType + ": calling set with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling set with null context threw " + n); + } + try { + arr.set.call({}, [1]); + ok(false, arrType + ": calling set with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling set with an object context threw " + n); + } + try { + arr.set(); + ok(false, name + ".set() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SOURCE, name + ".set() threw " + n); + } + try { + arr.set(null); + ok(false, name + ".set(null) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SOURCE, name + ".set(null) threw " + n); + } + try { + arr.set([1,2,3], 8); + ok(false, name + ".set([1,2,3], 8) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, name + ".set([1,2,3], 8) threw " + n); + } + try { + arr.set([99], -3); + ok(false, name + ".set([99], -3) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, name + ".set([99], -3) threw " + n); + } + + r = arr.set(5); + ok(r === undefined, name + ".set(5) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === 0, name + ".set(5): arr[" + j + "] = " + arr[j]); + + r = arr.set({}); + ok(r === undefined, name + ".set({}) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === 0, name + ".set({}): arr[" + j + "] = " + arr[j]); + + r = arr.set("12"); + ok(r === undefined, name + ".set('12') returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 1, 2, 0, 0, 0, 0, 0, 0, 0, 0 ][j], name + ".set('12'): arr[" + j + "] = " + arr[j]); + + arr2 = { length: 2 }; + arr2[0] = 9; + arr2[1] = 7; + r = arr.set(arr2); + ok(r === undefined, name + ".set(array-like obj) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 0, 0, 0, 0, 0, 0, 0 ][j], name + ".set(array-like obj): arr[" + j + "] = " + arr[j]); + + r = arr.set([12, 10, 11], 3); + ok(r === undefined, name + ".set([12, 10, 11], 3) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 12, 10, 11, 0, 0, 0, 0 ][j], name + ".set([12, 10, 11], 3): arr[" + j + "] = " + arr[j]); + + r = arr.set(arr.subarray(4, 6), 5); + ok(r === undefined, name + ".set(arr.subarray(4, 2), 5) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 12, 10, 10, 11, 0, 0, 0 ][j], name + ".set(arr.subarray(4, 2), 5): arr[" + j + "] = " + arr[j]); + + r = arr.set(arr.subarray(3, 7), 2); + ok(r === undefined, name + ".set(arr.subarray(3, 7), 2) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 12, 10, 10, 11, 11, 0, 0, 0 ][j], name + ".set(arr.subarray(3, 7), 2): arr[" + j + "] = " + arr[j]); + } + + arr = new Float32Array(3); + arr[0] = 1.125; + arr[1] = 2.25; + arr[2] = 3.375; + arr2 = new Uint16Array(arr); + ok(arr[0] === 1.125, "arr[0] = " + arr[0]); + ok(arr[1] === 2.25, "arr[1] = " + arr[1]); + ok(arr[2] === 3.375, "arr[2] = " + arr[2]); + ok(arr2[0] === 1, "arr2[0] = " + arr2[0]); + ok(arr2[1] === 2, "arr2[1] = " + arr2[1]); + ok(arr2[2] === 3, "arr2[2] = " + arr2[2]); + arr2[0] = 100; + ok(arr[0] === 1.125, "arr[0] after arr2[0] changed = " + arr[0]); + ok(arr2[0] === 100, "arr2[0] after change = " + arr2[0]); + + arr = new Int16Array(2); + arr[0] = 65535; + arr[1] = -65535; + ok(arr[0] == -1, "16-bit arr[0] after overflow = " + arr[0]); + ok(arr[1] == 1, "16-bit arr[1] after overflow = " + arr[1]); + + arr = new Uint8Array(2); + arr[0] = -2; + arr[1] = 258; + ok(arr[0] == 254, "8-bit arr[0] after overflow = " + arr[0]); + ok(arr[1] == 2, "8-bit arr[1] after overflow = " + arr[1]); + + arr = new Int8Array(12); + arr.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + for(var j = 0; j < 12; j++) + ok(arr[j] === j + 1, "sequential arr[" + j + "] = " + arr[j]); + arr2 = new Int32Array(arr.buffer); + ok(arr2.buffer === arr.buffer, "arr2.buffer = " + arr2.buffer); + for(var j = 0; j < 3; j++) + ok(arr2[j] === [ 0x04030201, 0x08070605, 0x0c0b0a09 ][j], "sequential 32-bit arr[" + j + "] = " + arr2[j]); + + /* test overlap */ + arr2.set(arr.subarray(1, 4)); + for(var j = 0; j < 3; j++) + ok(arr2[j] === j + 2, "arr with overlap[" + j + "] = " + arr[j]); + + /* methods are incompatible, even though thrown error is not explicit */ + ok(Uint16Array.prototype.subarray !== Int32Array.prototype.subarray, "Uint16Array and Int32Array have same subarray methods"); + ok(Int8Array.prototype.set !== Float32Array.prototype.set, "Int8Array and Float32Array have same set methods"); + try { + Uint8Array.prototype.set.call(arr, [12, 50]); + ok(false, "calling Uint8Array's set with Int8Array context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, "calling Uint8Array's set with Int8Array context threw " + n); + } + try { + Uint32Array.prototype.subarray.call(arr2, 0); + ok(false, "calling Uint32Array's subarray with Int32Array context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, "calling Uint32Array's subarray with Int32Array context threw " + n); + } + + /* clamped array */ + arr = new Uint8ClampedArray(7); + arr2 = new Uint8Array(7); + arr.set ([42, -1, 999, 0.9, NaN, Infinity, -Infinity]); + arr2.set([42, -1, 999, 0.9, NaN, Infinity, -Infinity]); + for(var j = 0; j < 7; j++) { + ok(arr[j] === [42, 0, 255, 1, 0, 255, 0][j], "clamped arr[" + j + "] = " + arr[j]); + ok(arr2[j] === [42, 255, 231, 0, 0, 0, 0][j], "non-clamped arr[" + j + "] = " + arr2[j]); + } + r = Object.prototype.toString.call(arr); + ok(r === "[object Uint8ClampedArray]", "Object toString for Uint8ClampedArray = " + r); +}); + sync_test("builtin_context", function() { var nullDisp = external.nullDisp; var tests = [ @@ -1742,6 +2576,109 @@ sync_test("builtin_context", function() { ok(obj.length === 1, "obj.length = " + obj.length); }); +sync_test("builtin override", function() { + /* configurable */ + var builtins = [ + "ActiveXObject", + "Array", + "ArrayBuffer", + "Boolean", + "CollectGarbage", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "Enumerator", + "Error", + "escape", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "isFinite", + "isNaN", + "JSON", + "Map", + "Math", + "Number", + "parseFloat", + "parseInt", + "RangeError", + "ReferenceError", + "RegExp", + "ScriptEngine", + "ScriptEngineBuildVersion", + "ScriptEngineMajorVersion", + "ScriptEngineMinorVersion", + "Set", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint16Array", + "Uint32Array", + "unescape", + "URIError", + "VBArray", + "WeakMap" + ]; + + var override = { + value: 12, + configurable: true, + writable: true + }; + for(var i = 0; i < builtins.length; i++) { + var desc = Object.getOwnPropertyDescriptor(window, builtins[i]), r; + ok(desc !== undefined, "getOwnPropertyDescriptor('" + builtins[i] + "' returned undefined"); + ok(desc.configurable === true, builtins[i] + " not configurable"); + ok(desc.enumerable === false, builtins[i] + " is enumerable"); + ok(desc.writable === true, builtins[i] + " not writable"); + + r = Object.defineProperty(window, builtins[i], override); + ok(r === window, "defineProperty('" + builtins[i] + "' returned " + r); + r = Object.getOwnPropertyDescriptor(window, builtins[i]); + ok(r !== undefined, "getOwnPropertyDescriptor('" + builtins[i] + "' after override returned undefined"); + ok(r.value === 12, builtins[i] + " value = " + r.value); + + r = eval(builtins[i]); + ok(r === window[builtins[i]], "Global " + builtins[i] + " does not match redefined window." + builtins[i]); + r = (delete window[builtins[i]]); + ok(r === true, "delete window." + builtins[i] + " returned " + r); + ok(!(builtins[i] in window), builtins[i] + " in window after delete"); + try { + eval(builtins[i]); + ok(false, "expected exception retrieving global " + builtins[i] + " after delete."); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_UNDEFINED_VARIABLE, "retrieving global " + builtins[i] + " after delete threw " + n); + } + + r = Object.defineProperty(window, builtins[i], desc); + ok(r === window, "defineProperty('" + builtins[i] + "' to restore returned " + r); + } + + /* non-configurable */ + builtins = [ + "undefined", + "Infinity", + "NaN" + ]; + + for(var i = 0; i < builtins.length; i++) { + var desc = Object.getOwnPropertyDescriptor(window, builtins[i]), r; + ok(desc !== undefined, "getOwnPropertyDescriptor('" + builtins[i] + "' returned undefined"); + ok(desc.configurable === false, builtins[i] + " is configurable"); + ok(desc.enumerable === false, builtins[i] + " is enumerable"); + ok(desc.writable === false, builtins[i] + " is writable"); + } +}); + sync_test("host this", function() { var tests = [ undefined, null, external.nullDisp, function() {}, [0], "foobar", true, 42, new Number(42), external.testHostContext(true), window, document ]; var i, obj = Object.create(Function.prototype); @@ -1931,7 +2868,6 @@ sync_test("substituted this", function() { ok(r === "[object Undefined]", "detached scope Object.toString returned " + r); var r = (function() { this.f = Object.prototype.toString; return this.f(); })(); - todo_wine. ok(r === "[object Window]", "Object.toString returned " + r); var r = (function() { var f = Object.prototype.toString; return f(); })(); @@ -2081,6 +3017,88 @@ sync_test("functions scope", function() { })(); }); +sync_test("input validation", function() { + var fired, elem = document.createElement("input"); + elem.type = "number"; + elem.setAttribute("min", "1"); + elem.setAttribute("max", "4"); + elem.addEventListener("invalid", function(e) { + ok(e.target === elem, "unexpected target " + e.target); + fired = true; + }); + fired = false; + elem.value = 1; + ok(elem.checkValidity() === true, "input number (1-4) with value 1: invalid"); + ok(fired === false, "input number (1-4) with value 1 fired invalid event"); + fired = false; + elem.value = 0; + ok(elem.checkValidity() === false, "input number (1-4) with value 0: valid"); + ok(fired === true, "input number (1-4) with value 0 did not fire invalid event"); + fired = false; + elem.value = 5; + ok(elem.checkValidity() === false, "input number (1-4) with value 5: valid"); + ok(fired === true, "input number (1-4) with value 5 did not fire invalid event"); +}); + +sync_test("instanceof", function() { + var r; + + try { + ({} instanceof { prototype: {} }); + ok(false, "expected exception using it on non-function object"); + }catch(e) { + ok(e.number === 0xa138a - 0x80000000, "using it on non-function object threw " + e.number); + } + + r = (document.createElement("iframe") instanceof HTMLIFrameElement); + ok(r === true, "iframe element not instance of HTMLIFrameElement"); + r = (document.createElement("div") instanceof HTMLIFrameElement); + ok(r === false, "div element instance of HTMLIFrameElement"); + r = (document instanceof Node); + ok(r === true, "document not instance of Node"); +}); + +sync_test("perf toJSON", function() { + var tests = [ + [ "performance", "navigation", "timing" ], + [ "performance.navigation", "redirectCount", "type" ], + [ "performance.timing", "connectEnd", "connectStart", "domComplete", "domContentLoadedEventEnd", + "domContentLoadedEventStart", "domInteractive", "domLoading", "domainLookupEnd", "domainLookupStart", + "fetchStart", "loadEventEnd", "loadEventStart", "msFirstPaint", "navigationStart", "redirectEnd", + "redirectStart", "requestStart", "responseEnd", "responseStart", "unloadEventEnd", "unloadEventStart" ] + ]; + + for(var i = 0; i < tests.length; i++) { + var desc, name = tests[i][0], obj = eval("window." + name), json; + + Object.defineProperty(obj, "foobar", {writable: true, enumerable: true, configurable: true, value: 1}); + Object.defineProperty(Object.getPrototypeOf(obj), "barfoo", {writable: true, enumerable: true, configurable: true, value: 3}); + json = obj.toJSON(); + + ok(Object.getPrototypeOf(json) === Object.prototype, "prototype of " + name + ".toJSON() != Object.prototype"); + ok(typeof json === "object", "typeof " + name + ".toJSON() != object"); + for(var j = 1; j < tests[i].length; j++) { + desc = Object.getOwnPropertyDescriptor(json, tests[i][j]); + ok(json.hasOwnProperty(tests[i][j]), name + ".toJSON() does not have " + tests[i][j]); + ok(desc.writable === true, name + ".toJSON()." + tests[i][j] + " not writable"); + ok(desc.enumerable === true, name + ".toJSON()." + tests[i][j] + " not enumerable"); + ok(desc.configurable === true, name + ".toJSON()." + tests[i][j] + " not configurable"); + } + ok(!("foobar" in json), "foobar in " + name + ".toJSON()"); + ok(!("barfoo" in json), "barfoo in " + name + ".toJSON()"); + + delete obj.foobar; + delete Object.getPrototypeOf(obj).barfoo; + + desc = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), tests[i][1]); + delete Object.getPrototypeOf(obj)[tests[i][1]]; + ok(!(tests[i][1] in obj), tests[i][1] + " in " + name + " after delete"); + json = obj.toJSON(); + ok(json.hasOwnProperty(tests[i][1]), name + ".toJSON() does not have " + tests[i][1] + " after delete"); + Object.defineProperty(Object.getPrototypeOf(obj), tests[i][1], desc); + } +}); + sync_test("console", function() { var except @@ -2249,3 +3267,118 @@ sync_test("initProgressEvent", function() { ok(e.loaded === 99, "loaded after re-init = " + e.loaded); ok(e.total === 50, "total after re-init = " + e.total); }); + +sync_test("DOMParser", function() { + var p, r = DOMParser.length, mimeType; + ok(r === 0, "length = " + r); + + p = DOMParser(); + r = Object.getPrototypeOf(p); + ok(r === DOMParser.prototype, "prototype of instance created without new = " + r); + ok(p !== new DOMParser(), "DOMParser() == new DOMParser()"); + ok(new DOMParser() !== new DOMParser(), "new DOMParser() == new DOMParser()"); + + var teststr = { toString: function() { return "wine"; } }; + + // HTML mime types + mimeType = [ + "text/hTml" + ]; + for(var i = 0; i < mimeType.length; i++) { + var m = mimeType[i], html = p.parseFromString(teststr, m), e = external.getExpectedMimeType(m.toLowerCase()); + r = html.mimeType; + ok(r === e, "mimeType of HTML document with mime type " + m + " = " + r + ", expected " + e); + r = html.childNodes; + ok(r.length === 1 || r.length === 2, "childNodes.length of HTML document with mime type " + m + " = " + r.length); + var html_elem = r[r.length - 1]; + ok(html_elem.nodeName === "HTML", "child nodeName of HTML document with mime type " + m + " = " + r.nodeName); + ok(html_elem.nodeValue === null, "child nodeValue of HTML document with mime type " + m + " = " + r.nodeValue); + r = html.anchors; + ok(r.length === 1, "anchors.length of HTML document with mime type " + m + " = " + r.length); + r = r[0]; + ok(r.nodeName === "A", "anchor nodeName of HTML document with mime type " + m + " = " + r.nodeName); + ok(r.nodeValue === null, "anchor nodeValue of HTML document with mime type " + m + " = " + r.nodeValue); + r = r.parentNode; + ok(r.nodeName === "BODY", "anchor parent nodeName of HTML document with mime type " + m + " = " + r.nodeName); + ok(r.nodeValue === null, "anchor parent nodeValue of HTML document with mime type " + m + " = " + r.nodeValue); + r = r.parentNode; + ok(r === html_elem, "body parent of HTML document with mime type " + m + " = " + r); + } + + // XML mime types + mimeType = [ + "text/xmL", + "aPPlication/xml", + "application/xhtml+xml", + "image/svg+xml" + ]; + for(var i = 0; i < mimeType.length; i++) { + var m = mimeType[i], xml = p.parseFromString(teststr, m), e; + e = external.getExpectedMimeType(m === "aPPlication/xml" ? "text/xml" : m.toLowerCase()); + r = xml.mimeType; + ok(r === e, "mimeType of XML document with mime type " + m + " = " + r + ", expected " + e); + r = xml.childNodes; + ok(r.length === 1, "childNodes.length of XML document with mime type " + m + " = " + r.length); + r = r[0]; + ok(r.nodeName === "a", "child nodeName of XML document with mime type " + m + " = " + r.nodeName); + ok(r.nodeValue === null, "child nodeValue of XML document with mime type " + m + " = " + r.nodeValue); + r = r.childNodes; + ok(r.length === 1, "childNodes of child.length of XML document with mime type " + m + " = " + r.length); + r = r[0]; + ok(r.nodeName === "#text", "child of child nodeName of XML document with mime type " + m + " = " + r.nodeName); + ok(r.nodeValue === "wine", "child of child nodeValue of XML document with mime type " + m + " = " + r.nodeValue); + ok(!("test" in xml), "'test' in XML document with mime type " + m); + + // test HTMLDocument specific props, which are available in DocumentPrototype, + // so they are shared in XMLDocument since they both have the same prototype + r = xml.anchors; + if(m === "application/xhtml+xml") { + todo_wine. + ok(r.length === 1, "anchors.length of XML document with mime type " + m + " = " + r.length); + r = r[0]; + todo_wine. + ok(r === xml.childNodes[0], "anchor of XML document with mime type " + m + " = " + r); + r = Object.prototype.toString.call(xml.getElementsByTagName("a")[0]); + todo_wine. + ok(r === "[object HTMLAnchorElement]", "element's Object.toString of XML document with mime type " + m + " = " + r); + }else { + ok(r.length === 0, "anchors.length of XML document with mime type " + m + " = " + r.length); + r = Object.getPrototypeOf(xml.getElementsByTagName("a")[0]); + ok(r === Element.prototype, "element's prototype of XML document with mime type " + m + " = " + r); + r = document.importNode(xml.childNodes[0], true); + ok(r.nodeName === "a", "imported node name of XML document with mime type " + m + " = " + r.nodeName); + ok(r.nodeValue === null, "imported node value of XML document with mime type " + m + " = " + r.nodeValue); + r = Object.getPrototypeOf(r); + ok(r === Element.prototype, "imported node's prototype of XML document with mime type " + m + " = " + r); + } + } + + // Invalid mime types + mimeType = [ + "application/html", + "wine/test+xml", + "image/jpeg", + "text/plain", + "html", + "+xml", + "xml", + 42 + ]; + for(var i = 0; i < mimeType.length; i++) { + try { + p.parseFromString(teststr, mimeType[i]); + ok(false, "expected exception calling parseFromString with mime type " + mimeType[i]); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === E_INVALIDARG, "parseFromString with mime type " + mimeType[i] + " threw " + n); + } + } + + try { + r = p.parseFromString("xml", "text/xml"); + ok(false, "expected exception calling parseFromString with invalid xml"); + }catch(ex) { + ok(ex.name === "SyntaxError", "parseFromString with invalid xml threw " + ex.name); + } + p.parseFromString("", "text/xml"); +}); diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 606cbbc74ce..90a616c507c 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" #include "ole2.h" +#include "activscp.h" #include "mshtml.h" #include "mshtmdid.h" #include "mshtmhst.h" @@ -35,6 +36,8 @@ #include "shdeprecated.h" #include "dispex.h" +extern const IID IID_IActiveScriptSite; + #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -98,6 +101,7 @@ DEFINE_EXPECT(submit_onclick_attached_check_cancel); DEFINE_EXPECT(submit_onclick_setret); DEFINE_EXPECT(elem2_cp_onclick); DEFINE_EXPECT(iframe_onload); +DEFINE_EXPECT(onmessage); DEFINE_EXPECT(visibilitychange); DEFINE_EXPECT(onbeforeunload); DEFINE_EXPECT(iframe_onbeforeunload); @@ -113,6 +117,15 @@ DEFINE_EXPECT(doc2_onstoragecommit); DEFINE_EXPECT(window2_onstorage); DEFINE_EXPECT(async_xhr_done); DEFINE_EXPECT(sync_xhr_done); +DEFINE_EXPECT(QS_IActiveScriptSite); +DEFINE_EXPECT(QS_IActiveScriptSite_parent); +DEFINE_EXPECT(QS_IActiveScriptSite_parent2); +DEFINE_EXPECT(QS_IActiveScriptSite_parent3); +DEFINE_EXPECT(QS_IActiveScriptSite_parent4); +DEFINE_EXPECT(QS_GetCaller); +DEFINE_EXPECT(QS_GetCaller_parent2); +DEFINE_EXPECT(QS_GetCaller_parent3); +DEFINE_EXPECT(cmdtarget_Exec); static HWND container_hwnd = NULL; static IHTMLWindow2 *window; @@ -171,6 +184,14 @@ static const char input_doc_str[] = static const char iframe_doc_str[] = ""; +static const char iframe_doc_ie9_str[] = + "" + ""; + +static const char iframe_doc_ie11_str[] = + "" + ""; + static void navigate(IHTMLDocument2*,const WCHAR*); static BOOL iface_cmp(void *iface1, void *iface2) @@ -1484,11 +1505,105 @@ static HRESULT WINAPI iframe_onreadystatechange(IDispatchEx *iface, DISPID id, L EVENT_HANDLER_FUNC_OBJ(iframe_onreadystatechange); +static IHTMLWindow2 *onmessage_source; + +static HRESULT WINAPI onmessage(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + IHTMLWindow2 *source, *self; + HRESULT hres; + BSTR bstr; + + CHECK_EXPECT(onmessage); + + if(document_mode < 9) { + IHTMLEventObj5 *event_obj5; + IHTMLEventObj *event_obj; + IDispatch *disp; + + hres = IHTMLWindow2_get_event(window, &event_obj); + ok(hres == S_OK, "get_event failed: %08lx\n", hres); + + hres = IHTMLEventObj_get_type(event_obj, &bstr); + ok(hres == S_OK, "get_type failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"message"), "event type = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLEventObj_QueryInterface(event_obj, &IID_IHTMLEventObj5, (void**)&event_obj5); + ok(hres == S_OK, "Could not get IHTMLEventObj5: %08lx\n", hres); + IHTMLEventObj_Release(event_obj); + + hres = IHTMLEventObj5_get_url(event_obj5, &bstr); + ok(hres == S_OK, "get_url failed: %08lx\n", hres); + ok(!bstr, "url = %s\n", wine_dbgstr_w(bstr)); + + hres = IHTMLEventObj5_get_data(event_obj5, &bstr); + ok(hres == S_OK, "get_data failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "data = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLEventObj5_get_origin(event_obj5, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"about:"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLEventObj5_get_source(event_obj5, &disp); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + + hres = IDispatch_QueryInterface(disp, &IID_IHTMLWindow2, (void**)&source); + ok(hres == S_OK, "Could not get IHTMLWindow2: %08lx\n", hres); + IDispatch_Release(disp); + + hres = IHTMLWindow2_get_self(onmessage_source, &self); + ok(hres == S_OK, "get_self failed: %08lx\n", hres); + ok(source == self, "source != onmessage_source.self\n"); + IHTMLWindow2_Release(source); + IHTMLWindow2_Release(self); + + bstr = SysAllocString(L"foobar"); + hres = IHTMLEventObj5_put_url(event_obj5, bstr); + ok(hres == DISP_E_MEMBERNOTFOUND, "put_url returned: %08lx\n", hres); + + hres = IHTMLEventObj5_put_origin(event_obj5, bstr); + ok(hres == DISP_E_MEMBERNOTFOUND, "put_origin returned: %08lx\n", hres); + SysFreeString(bstr); + + IHTMLEventObj5_Release(event_obj5); + }else { + IDOMMessageEvent *msg; + + hres = IDispatch_QueryInterface(V_DISPATCH(&pdp->rgvarg[1]), &IID_IDOMMessageEvent, (void**)&msg); + ok(hres == S_OK, "Could not get IDOMMessageEvent: %08lx\n", hres); + + hres = IDOMMessageEvent_get_data(msg, &bstr); + ok(hres == S_OK, "get_data failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "data = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_origin(msg, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"about:"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_source(msg, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == onmessage_source, "source != onmessage_source\n"); + IHTMLWindow2_Release(source); + + IDOMMessageEvent_Release(msg); + } + return S_OK; +} + +EVENT_HANDLER_FUNC_OBJ(onmessage); + static HRESULT WINAPI onvisibilitychange(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { + DISPPARAMS dp = {0}; IDispatchEx *dispex; HRESULT hres; + VARIANT res; BSTR bstr; CHECK_EXPECT(visibilitychange); @@ -1499,10 +1614,15 @@ static HRESULT WINAPI onvisibilitychange(IDispatchEx *iface, DISPID id, LCID lci bstr = SysAllocString(L"toString"); hres = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - todo_wine ok(hres == S_OK, "GetDispID(\"toString\") failed: %08lx\n", hres); SysFreeString(bstr); + hres = IDispatchEx_InvokeEx(dispex, id, LOCALE_NEUTRAL, INVOKE_FUNC, &dp, &res, NULL, NULL); + ok(hres == S_OK, "InvokeEx(\"toString\") failed: %08lx\n", hres); + ok(V_VT(&res) == VT_BSTR, "V_VT(\"toString\") = %d\n", V_VT(&res)); + ok(!wcscmp(V_BSTR(&res), L"[object Event]"), "toString = %s\n", wine_dbgstr_w(V_BSTR(&res))); + VariantClear(&res); + return S_OK; } @@ -1889,6 +2009,359 @@ static void pump_msgs(BOOL *b) } } +static IOleCommandTarget cmdtarget, cmdtarget_stub; + +static HRESULT WINAPI cmdtarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IOleCommandTarget)) + *ppv = &cmdtarget; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static ULONG WINAPI cmdtarget_AddRef(IOleCommandTarget *iface) +{ + return 2; +} + +static ULONG WINAPI cmdtarget_Release(IOleCommandTarget *iface) +{ + return 1; +} + +static HRESULT WINAPI cmdtarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) +{ + ok(0, "unexpected call\n"); + return OLECMDERR_E_UNKNOWNGROUP; +} + +static HRESULT WINAPI cmdtarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) +{ + CHECK_EXPECT2(cmdtarget_Exec); + ok(pguidCmdGroup && IsEqualGUID(pguidCmdGroup, &CGID_ScriptSite), "pguidCmdGroup = %s\n", wine_dbgstr_guid(pguidCmdGroup)); + ok(nCmdID == CMDID_SCRIPTSITE_SECURITY_WINDOW, "nCmdID = %lu\n", nCmdID); + ok(!nCmdexecopt, "nCmdexecopt = %lu\n", nCmdexecopt); + ok(!pvaIn, "pvaIn != NULL\n"); + ok(pvaOut != NULL, "pvaOut = NULL\n"); + + /* Native ignores the VT and assumes VT_DISPATCH, and releases it + without VariantClear, since it crashes without AddRef below... */ + V_VT(pvaOut) = VT_NULL; + V_DISPATCH(pvaOut) = (IDispatch*)onmessage_source; + IDispatch_AddRef(V_DISPATCH(pvaOut)); + return S_OK; +} + +static const IOleCommandTargetVtbl cmdtarget_vtbl = { + cmdtarget_QueryInterface, + cmdtarget_AddRef, + cmdtarget_Release, + cmdtarget_QueryStatus, + cmdtarget_Exec +}; + +static IOleCommandTarget cmdtarget = { &cmdtarget_vtbl }; + +static HRESULT WINAPI cmdtarget_stub_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IOleCommandTarget)) + *ppv = &cmdtarget_stub; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI cmdtarget_stub_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) +{ + ok(0, "unexpected call\n"); + return OLECMDERR_E_UNKNOWNGROUP; +} + +static HRESULT WINAPI cmdtarget_stub_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) +{ + ok(0, "unexpected call\n"); + return OLECMDERR_E_UNKNOWNGROUP; +} + +static const IOleCommandTargetVtbl cmdtarget_stub_vtbl = { + cmdtarget_stub_QueryInterface, + cmdtarget_AddRef, + cmdtarget_Release, + cmdtarget_stub_QueryStatus, + cmdtarget_stub_Exec +}; + +static IOleCommandTarget cmdtarget_stub = { &cmdtarget_stub_vtbl }; + +static IServiceProvider caller_sp, caller_sp_parent, caller_sp_stub, caller_sp2, caller_sp2_parent, caller_sp2_parent3; + +static HRESULT WINAPI caller_sp_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static ULONG WINAPI caller_sp_AddRef(IServiceProvider *iface) +{ + return 2; +} + +static ULONG WINAPI caller_sp_Release(IServiceProvider *iface) +{ + return 1; +} + +static HRESULT WINAPI caller_sp_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT2(QS_IActiveScriptSite); + ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = (document_mode < 9) ? NULL : &cmdtarget; + return (document_mode < 9) ? E_NOINTERFACE : S_OK; + } + + if(IsEqualGUID(guidService, &SID_GetCaller)) { + CHECK_EXPECT(QS_GetCaller); + SET_EXPECT(QS_IActiveScriptSite_parent); + ok(IsEqualGUID(riid, &IID_IServiceProvider), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = &caller_sp_parent; + return S_OK; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp_vtbl = { + caller_sp_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp_QueryService +}; + +static IServiceProvider caller_sp = { &caller_sp_vtbl }; + +static HRESULT WINAPI caller_sp_parent_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp_parent; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI caller_sp_parent_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT(QS_IActiveScriptSite_parent); + ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp_parent_vtbl = { + caller_sp_parent_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp_parent_QueryService +}; + +static IServiceProvider caller_sp_parent = { &caller_sp_parent_vtbl }; + +static HRESULT WINAPI caller_sp_stub_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp_stub; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI caller_sp_stub_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT2(QS_IActiveScriptSite); + *ppv = NULL; + return E_NOINTERFACE; + } + + if(IsEqualGUID(guidService, &SID_GetCaller)) { + CHECK_EXPECT(QS_GetCaller); + ok(IsEqualGUID(riid, &IID_IServiceProvider), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return S_OK; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp_stub_vtbl = { + caller_sp_stub_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp_stub_QueryService +}; + +static IServiceProvider caller_sp_stub = { &caller_sp_stub_vtbl }; + +static HRESULT WINAPI caller_sp2_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp2; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI caller_sp2_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT2(QS_IActiveScriptSite_parent2); + ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = (document_mode < 9) ? &cmdtarget_stub : &cmdtarget; + return S_OK; + } + + if(IsEqualGUID(guidService, &SID_GetCaller)) { + CHECK_EXPECT(QS_GetCaller_parent2); + SET_EXPECT(QS_IActiveScriptSite_parent3); + ok(IsEqualGUID(riid, &IID_IServiceProvider), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = &caller_sp2_parent; + return S_OK; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp2_vtbl = { + caller_sp2_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp2_QueryService +}; + +static IServiceProvider caller_sp2 = { &caller_sp2_vtbl }; + +static HRESULT WINAPI caller_sp2_parent_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp2_parent; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI caller_sp2_parent_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT2(QS_IActiveScriptSite_parent3); + ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = &cmdtarget; + return S_OK; + } + + if(IsEqualGUID(guidService, &SID_GetCaller)) { + CHECK_EXPECT(QS_GetCaller_parent3); + SET_EXPECT(QS_IActiveScriptSite_parent4); + ok(IsEqualGUID(riid, &IID_IServiceProvider), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = &caller_sp2_parent3; + return S_OK; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp2_parent_vtbl = { + caller_sp2_parent_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp2_parent_QueryService +}; + +static IServiceProvider caller_sp2_parent = { &caller_sp2_parent_vtbl }; + +static HRESULT WINAPI caller_sp2_parent3_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) + *ppv = &caller_sp2_parent3; + else { + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + return S_OK; +} + +static HRESULT WINAPI caller_sp2_parent3_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + CHECK_EXPECT(QS_IActiveScriptSite_parent4); + ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return S_OK; + } + + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static const IServiceProviderVtbl caller_sp2_parent3_vtbl = { + caller_sp2_parent3_QueryInterface, + caller_sp_AddRef, + caller_sp_Release, + caller_sp2_parent3_QueryService +}; + +static IServiceProvider caller_sp2_parent3 = { &caller_sp2_parent3_vtbl }; + static IConnectionPoint *get_cp(IUnknown *unk, REFIID riid) { IConnectionPointContainer *cp_container; @@ -2726,6 +3199,291 @@ static void test_focus(IHTMLDocument2 *doc) IHTMLElement4_Release(div); } +static void test_message_event(IHTMLDocument2 *doc) +{ + IHTMLFrameBase2 *iframe; + DISPPARAMS dp = { 0 }; + IHTMLWindow6 *window6; + IHTMLDocument6 *doc6; + IHTMLElement2 *elem; + IHTMLWindow2 *child; + IDispatchEx *dispex; + DISPID dispid; + HRESULT hres; + VARIANT v[2]; + BSTR bstr; + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow6, (void**)&window6); + ok(hres == S_OK, "Could not get IHTMLWindow6 iface: %08lx\n", hres); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument6, (void**)&doc6); + ok(hres == S_OK, "Could not get IHTMLDocument6 iface: %08lx\n", hres); + bstr = SysAllocString(L"ifr"); + hres = IHTMLDocument6_getElementById(doc6, bstr, &elem); + ok(hres == S_OK, "getElementById failed: %08lx\n", hres); + IHTMLDocument6_Release(doc6); + SysFreeString(bstr); + + hres = IHTMLElement2_QueryInterface(elem, &IID_IHTMLFrameBase2, (void**)&iframe); + ok(hres == S_OK, "Could not get IHTMLFrameBase2 iface: %08lx\n", hres); + IHTMLElement2_Release(elem); + hres = IHTMLFrameBase2_get_contentWindow(iframe, &child); + ok(hres == S_OK, "get_contentWindow failed: %08lx\n", hres); + IHTMLFrameBase2_Release(iframe); + + dp.cArgs = 2; + dp.rgvarg = v; + V_VT(&v[0]) = VT_DISPATCH; + V_DISPATCH(&v[0]) = (IDispatch*)&onmessage_obj; + hres = IHTMLWindow6_put_onmessage(window6, v[0]); + ok(hres == S_OK, "put_onmessage failed: %08lx\n", hres); + + V_VT(&v[0]) = VT_EMPTY; + hres = IHTMLWindow6_get_onmessage(window6, &v[0]); + ok(hres == S_OK, "get_onmessage failed: %08lx\n", hres); + ok(V_VT(&v[0]) == VT_DISPATCH, "V_VT(onmessage) = %d\n", V_VT(&v[0])); + ok(V_DISPATCH(&v[0]) == (IDispatch*)&onmessage_obj, "V_DISPATCH(onmessage) = %p\n", V_DISPATCH(&v[0])); + + if(document_mode >= 9) + add_event_listener((IUnknown*)doc, L"message", (IDispatch*)&onmessage_obj, VARIANT_TRUE); + + V_VT(&v[1]) = VT_BSTR; + V_BSTR(&v[1]) = SysAllocString(L"foobar"); + V_VT(&v[0]) = VT_BSTR; + V_BSTR(&v[0]) = SysAllocString(L"*"); + bstr = SysAllocString(L"foobar"); + hres = IHTMLWindow6_postMessage(window6, V_BSTR(&v[1]), v[0]); + ok(hres == E_ABORT, "postMessage returned: %08lx\n", hres); + IHTMLWindow6_Release(window6); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + + bstr = SysAllocString(L"postMessage"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + ok(hres == S_OK, "GetDispID(postMessage) failed: %08lx\n", hres); + SysFreeString(bstr); + + onmessage_source = window; + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL); + ok(hres == (document_mode < 9 ? E_ABORT : S_OK), "InvokeEx(postMessage) returned: %08lx\n", hres); + if(hres == S_OK) { + SET_EXPECT(onmessage); + pump_msgs(&called_onmessage); + CHECK_CALLED(onmessage); + } + + if(document_mode < 9) + SET_EXPECT(QS_GetCaller); + SET_EXPECT(QS_IActiveScriptSite); + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_METHOD, &dp, NULL, NULL, &caller_sp_stub); + ok(hres == (document_mode < 9 ? E_ABORT : S_OK), "InvokeEx(postMessage) returned: %08lx\n", hres); + CHECK_CALLED(QS_IActiveScriptSite); + if(document_mode < 9) + CHECK_CALLED(QS_GetCaller); + else { + SET_EXPECT(onmessage); + pump_msgs(&called_onmessage); + CHECK_CALLED(onmessage); + } + + onmessage_source = child; + if(document_mode < 9) { + SET_EXPECT(QS_GetCaller); + SET_EXPECT(QS_IActiveScriptSite_parent); + }else { + SET_EXPECT(cmdtarget_Exec); + } + SET_EXPECT(QS_IActiveScriptSite); + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_METHOD, &dp, NULL, NULL, &caller_sp); + ok(hres == (document_mode < 9 ? E_ABORT : S_OK), "InvokeEx(postMessage) failed: %08lx\n", hres); + CHECK_CALLED(QS_IActiveScriptSite); + if(hres == S_OK) { + CHECK_CALLED(cmdtarget_Exec); + SET_EXPECT(onmessage); + pump_msgs(&called_onmessage); + CHECK_CALLED(onmessage); + } + + if(document_mode < 9) { + SET_EXPECT(QS_GetCaller_parent2); + SET_EXPECT(onmessage); + } + SET_EXPECT(QS_IActiveScriptSite_parent2); + SET_EXPECT(cmdtarget_Exec); + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_METHOD, &dp, NULL, NULL, &caller_sp2); + ok(hres == S_OK, "InvokeEx(postMessage) failed: %08lx\n", hres); + CHECK_CALLED(cmdtarget_Exec); + CHECK_CALLED(QS_IActiveScriptSite_parent2); + if(document_mode < 9) { + CHECK_CALLED(QS_IActiveScriptSite_parent3); + CHECK_CALLED(QS_GetCaller_parent2); + CHECK_CALLED(onmessage); + pump_msgs(NULL); + }else { + SET_EXPECT(onmessage); + pump_msgs(&called_onmessage); + CHECK_CALLED(onmessage); + } + + if(document_mode < 9) { + SET_EXPECT(QS_GetCaller_parent3); + SET_EXPECT(onmessage); + } + SET_EXPECT(QS_IActiveScriptSite_parent3); + SET_EXPECT(cmdtarget_Exec); + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_METHOD, &dp, NULL, NULL, &caller_sp2_parent); + ok(hres == S_OK, "InvokeEx(postMessage) failed: %08lx\n", hres); + CHECK_CALLED(cmdtarget_Exec); + CHECK_CALLED(QS_IActiveScriptSite_parent3); + if(document_mode < 9) { + CHECK_CALLED(QS_IActiveScriptSite_parent4); + CHECK_CALLED(QS_GetCaller_parent3); + CHECK_CALLED(onmessage); + pump_msgs(NULL); + }else { + SET_EXPECT(onmessage); + pump_msgs(&called_onmessage); + CHECK_CALLED(onmessage); + } + + onmessage_source = NULL; + VariantClear(&v[0]); + VariantClear(&v[1]); + IHTMLWindow2_Release(child); + IDispatchEx_Release(dispex); + + if(document_mode >= 9) { + IDOMMessageEvent *msg_event = NULL; + IDocumentEvent *doc_event; + IHTMLWindow2 *source; + IDOMEvent *event; + UINT argerr; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IDocumentEvent, (void**)&doc_event); + ok(hres == S_OK, "Could not get IDocumentEvent iface: %08lx\n", hres); + + bstr = SysAllocString(L"MessageEvent"); + hres = IDocumentEvent_createEvent(doc_event, bstr, &event); + ok(hres == S_OK, "createEvent failed: %08lx\n", hres); + IDocumentEvent_Release(doc_event); + SysFreeString(bstr); + + hres = IDOMEvent_QueryInterface(event, &IID_IDOMMessageEvent, (void**)&msg_event); + ok(hres == S_OK, "Could not get IDOMMessageEvent iface: %08lx\n", hres); + ok(msg_event != NULL, "msg_event = NULL\n"); + IDOMEvent_Release(event); + + hres = IDOMMessageEvent_get_source(msg_event, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == NULL, "uninitialized source != NULL\n"); + + hres = IDOMMessageEvent_get_origin(msg_event, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!bstr, "uninitialized origin = %s\n", wine_dbgstr_w(bstr)); + + /* IE10+ crash when using the get_data from the interface (because it's not a string yet?) */ + if(document_mode < 10) { + hres = IDOMMessageEvent_get_data(msg_event, &bstr); + ok(hres == S_OK, "get_data failed: %08lx\n", hres); + ok(!wcscmp(bstr, L""), "uninitialized data = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + bstr = SysAllocString(L"foobar"); + hres = IDOMMessageEvent_initMessageEvent(msg_event, bstr, VARIANT_FALSE, VARIANT_FALSE, bstr, bstr, NULL, window); + ok(hres == S_OK, "initMessageEvent failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_data(msg_event, &bstr); + ok(hres == S_OK, "get_data failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "data = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_source(msg_event, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == window, "source != window\n"); + IHTMLWindow2_Release(source); + + hres = IDOMMessageEvent_get_origin(msg_event, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + bstr = SysAllocString(L"barfoo"); + hres = IDOMMessageEvent_initMessageEvent(msg_event, bstr, VARIANT_FALSE, VARIANT_FALSE, NULL, NULL, NULL, NULL); + ok(hres == S_OK, "initMessageEvent failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_data(msg_event, &bstr); + ok(hres == S_OK, "get_data failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "data = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IDOMMessageEvent_get_source(msg_event, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == NULL, "source != NULL\n"); + + hres = IDOMMessageEvent_get_origin(msg_event, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + }else { + bstr = SysAllocString(L"data"); + hres = IDOMMessageEvent_GetIDsOfNames(msg_event, &IID_NULL, &bstr, 1, 0, &dispid); + ok(hres == S_OK, "GetIDsOfNames(data) failed: %08lx\n", hres); + SysFreeString(bstr); + + dp.cArgs = 0; + dp.rgvarg = NULL; + hres = IDOMMessageEvent_Invoke(msg_event, dispid, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v[0], NULL, &argerr); + ok(hres == S_OK, "Invoke(data) failed: %08lx\n", hres); + ok(V_VT(&v[0]) == VT_EMPTY, "V_VT(uninitialized data) = %d\n", V_VT(&v[0])); + + bstr = SysAllocString(L"foobar"); + hres = IDOMMessageEvent_initMessageEvent(msg_event, bstr, VARIANT_FALSE, VARIANT_FALSE, bstr, bstr, NULL, window); + ok(hres == S_OK, "initMessageEvent failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDOMMessageEvent_Invoke(msg_event, dispid, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v[0], NULL, &argerr); + ok(hres == S_OK, "Invoke(data) failed: %08lx\n", hres); + ok(V_VT(&v[0]) == VT_BSTR, "V_VT(data) = %d\n", V_VT(&v[0])); + ok(!wcscmp(V_BSTR(&v[0]), L"foobar"), "V_BSTR(data) = %s\n", wine_dbgstr_w(V_BSTR(&v[0]))); + VariantClear(&v[0]); + + hres = IDOMMessageEvent_get_source(msg_event, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == window, "source != window\n"); + IHTMLWindow2_Release(source); + + hres = IDOMMessageEvent_get_origin(msg_event, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + bstr = SysAllocString(L"barfoo"); + hres = IDOMMessageEvent_initMessageEvent(msg_event, bstr, VARIANT_FALSE, VARIANT_FALSE, NULL, NULL, NULL, NULL); + ok(hres == S_OK, "initMessageEvent failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDOMMessageEvent_Invoke(msg_event, dispid, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v[0], NULL, &argerr); + ok(hres == S_OK, "Invoke(data) failed: %08lx\n", hres); + ok(V_VT(&v[0]) == VT_BSTR, "V_VT(data) = %d\n", V_VT(&v[0])); + ok(!wcscmp(V_BSTR(&v[0]), L"foobar"), "V_BSTR(data) = %s\n", wine_dbgstr_w(V_BSTR(&v[0]))); + + hres = IDOMMessageEvent_get_source(msg_event, &source); + ok(hres == S_OK, "get_source failed: %08lx\n", hres); + ok(source == NULL, "source != NULL\n"); + + hres = IDOMMessageEvent_get_origin(msg_event, &bstr); + ok(hres == S_OK, "get_origin failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"foobar"), "origin = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + } + + IDOMMessageEvent_Release(msg_event); + } +} + static void test_visibilitychange(IHTMLDocument2 *doc) { if(!winetest_interactive) { @@ -3390,6 +4148,7 @@ static void test_doc_obj(IHTMLDocument2 *doc) IHTMLOptionElementFactory *option, *option2; IHTMLImageElementFactory *image, *image2; IHTMLXMLHttpRequestFactory *xhr, *xhr2; + IHTMLXDomainRequestFactory *xdr, *xdr2; IHTMLDocument2 *doc_node, *doc_node2; IOmNavigator *navigator, *navigator2; IHTMLLocation *location, *location2; @@ -3398,12 +4157,15 @@ static void test_doc_obj(IHTMLDocument2 *doc) IHTMLPerformance *perf, *perf2; IOmHistory *history, *history2; IHTMLScreen *screen, *screen2; + IOleCommandTarget *cmdtarget; IHTMLWindow2 *self, *window2; IEventTarget *event_target; + IUnknown *site, *site2; DISPPARAMS dp = { 0 }; IHTMLWindow7 *window7; IHTMLWindow6 *window6; IHTMLWindow5 *window5; + IServiceProvider *sp; IDispatchEx *dispex; IHTMLElement *body; VARIANT res, arg; @@ -3446,7 +4208,6 @@ static void test_doc_obj(IHTMLDocument2 *doc) bstr = NULL; hres = IHTMLDocument2_toString(doc, &bstr); ok(hres == S_OK, "toString failed: %08lx\n", hres); - todo_wine_if(document_mode >= 9) ok(!wcscmp(bstr, (document_mode < 9 ? L"[object]" : L"[object Document]")), "toString returned %s\n", wine_dbgstr_w(bstr)); SysFreeString(bstr); @@ -3485,7 +4246,6 @@ static void test_doc_obj(IHTMLDocument2 *doc) /* jscript prop on prototype chain */ bstr = SysAllocString(L"hasOwnProperty"); hres = IHTMLDocument2_GetIDsOfNames(doc, &IID_NULL, &bstr, 1, 0, &has_own_prop_id); - todo_wine_if(document_mode >= 9) ok(hres == (document_mode < 9 ? DISP_E_UNKNOWNNAME : S_OK), "GetIDsOfNames(hasOwnProperty) returned: %08lx\n", hres); SysFreeString(bstr); @@ -3497,7 +4257,6 @@ static void test_doc_obj(IHTMLDocument2 *doc) hres = IHTMLDocument2_Invoke(doc, has_own_prop_id, &IID_NULL, 0, DISPATCH_METHOD, &dp, &res, NULL, NULL); ok(hres == S_OK, "Invoke(hasOwnProperty(\"createElement\")) failed: %08lx\n", hres); ok(V_VT(&res) == VT_BOOL, "VT = %d\n", V_VT(&res)); - todo_wine ok(V_BOOL(&res) == VARIANT_FALSE, "hasOwnProperty(\"createElement\") = %d\n", V_BOOL(&res)); hres = IHTMLDocument2_GetIDsOfNames(doc, &IID_NULL, &V_BSTR(&arg), 1, 0, &dispid); @@ -3510,6 +4269,23 @@ static void test_doc_obj(IHTMLDocument2 *doc) ok(V_VT(&res) == VT_BOOL, "VT = %d\n", V_VT(&res)); ok(V_BOOL(&res) == VARIANT_TRUE, "hasOwnProperty(\"prop\") = %d\n", V_BOOL(&res)); SysFreeString(V_BSTR(&arg)); + + V_BSTR(&arg) = SysAllocString(L"proto_prop"); + hres = IHTMLDocument2_Invoke(doc, has_own_prop_id, &IID_NULL, 0, DISPATCH_METHOD, &dp, &res, NULL, NULL); + ok(hres == S_OK, "Invoke(hasOwnProperty(\"proto_prop\")) failed: %08lx\n", hres); + ok(V_VT(&res) == VT_BOOL, "VT = %d\n", V_VT(&res)); + ok(V_BOOL(&res) == VARIANT_FALSE, "hasOwnProperty(\"proto_prop\") = %d\n", V_BOOL(&res)); + + hres = IHTMLDocument2_GetIDsOfNames(doc, &IID_NULL, &V_BSTR(&arg), 1, 0, &dispid); + ok(hres == S_OK, "GetIDsOfNames(proto_prop) returned: %08lx\n", hres); + SysFreeString(V_BSTR(&arg)); + + dp.cArgs = 0; + dp.rgvarg = NULL; + hres = IHTMLDocument2_Invoke(doc, dispid, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &res, NULL, NULL); + ok(hres == S_OK, "Invoke(proto_prop) failed: %08lx\n", hres); + ok(V_VT(&res) == VT_BOOL, "VT(proto_prop) = %d\n", V_VT(&res)); + ok(V_BOOL(&res) == VARIANT_TRUE, "proto_prop = %d\n", V_BOOL(&res)); } /* test window props during navigation */ @@ -3548,7 +4324,14 @@ static void test_doc_obj(IHTMLDocument2 *doc) ok(hres == S_OK, "Could not get IHTMLWindow6: %08lx\n", hres); hres = IHTMLWindow6_get_sessionStorage(window6, &storage); ok(hres == S_OK, "get_sessionStorage failed: %08lx\n", hres); + + hres = IHTMLWindow6_get_XDomainRequest(window6, &res); + ok(hres == S_OK, "get_XDomainRequest failed: %08lx\n", hres); + ok(V_VT(&res) == VT_DISPATCH, "V_VT(XDomainRequest) = %d\n", V_VT(&res)); + hres = IDispatch_QueryInterface(V_DISPATCH(&res), &IID_IHTMLXDomainRequestFactory, (void**)&xdr); + ok(hres == S_OK, "Could not get IHTMLXDomainRequestFactory: %08lx\n", hres); IHTMLWindow6_Release(window6); + VariantClear(&res); hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow7, (void**)&window7); ok(hres == S_OK, "Could not get IHTMLWindow7: %08lx\n", hres); @@ -3565,6 +4348,16 @@ static void test_doc_obj(IHTMLDocument2 *doc) ok(hres == S_OK, "get_self failed: %08lx\n", hres); ok(self != NULL, "self == NULL\n"); + /* And script sites */ + hres = IHTMLDocument2_QueryInterface(doc_node, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&site); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + IOleCommandTarget_Release(cmdtarget); + IServiceProvider_Release(sp); + /* Add props to location, since it gets lost on navigation, despite being same object */ bstr = SysAllocString(L"wineTestProp"); hres = IHTMLLocation_QueryInterface(location, &IID_IDispatchEx, (void**)&dispex); @@ -3631,16 +4424,28 @@ static void test_doc_obj(IHTMLDocument2 *doc) hres = IHTMLWindow2_get_document(window, &doc_node2); ok(hres == S_OK, "get_document failed: %08lx\n", hres); ok(doc_node != doc_node2, "doc_node == doc_node2\n"); - IHTMLDocument2_Release(doc_node2); hres = IHTMLDocument2_get_parentWindow(doc_node, &window2); todo_wine ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); todo_wine ok(window == window2, "window != window2\n"); - IHTMLDocument2_Release(doc_node); if(hres == S_OK) IHTMLWindow2_Release(window2); + hres = IHTMLDocument2_QueryInterface(doc_node2, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&site2); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + ok(site != site2, "site == site2\n"); + IOleCommandTarget_Release(cmdtarget); + IHTMLDocument2_Release(doc_node2); + IHTMLDocument2_Release(doc_node); + IServiceProvider_Release(sp); + IUnknown_Release(site2); + IUnknown_Release(site); + hres = IHTMLWindow2_get_location(window, &location2); ok(hres == S_OK, "get_location failed: %08lx\n", hres); ok(location == location2, "location != location2\n"); @@ -3712,7 +4517,18 @@ static void test_doc_obj(IHTMLDocument2 *doc) ok(storage != storage2, "storage == storage2\n"); IHTMLStorage_Release(storage2); IHTMLStorage_Release(storage); + + ok(hres == S_OK, "Could not get IHTMLWindow6: %08lx\n", hres); + hres = IHTMLWindow6_get_XDomainRequest(window6, &res); + ok(hres == S_OK, "get_XDomainRequest failed: %08lx\n", hres); + ok(V_VT(&res) == VT_DISPATCH, "V_VT(XDomainRequest) = %d\n", V_VT(&res)); + hres = IDispatch_QueryInterface(V_DISPATCH(&res), &IID_IHTMLXDomainRequestFactory, (void**)&xdr2); + ok(hres == S_OK, "Could not get IHTMLXDomainRequestFactory: %08lx\n", hres); + ok(xdr != xdr2, "xdr == xdr2\n"); + IHTMLXDomainRequestFactory_Release(xdr2); + IHTMLXDomainRequestFactory_Release(xdr); IHTMLWindow6_Release(window6); + VariantClear(&res); hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow7, (void**)&window7); ok(hres == S_OK, "Could not get IHTMLWindow7: %08lx\n", hres); @@ -3876,8 +4692,10 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage) IHTMLEventObj *event_obj; IDOMStorageEvent *event; IDispatchEx *dispex; + DISPPARAMS dp = {0}; IDispatch *disp; HRESULT hres; + VARIANT res; unsigned i; DISPID id; BSTR bstr; @@ -3893,6 +4711,18 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage) hres = IDispatch_QueryInterface(V_DISPATCH(¶ms->rgvarg[1]), &IID_IDispatchEx, (void**)&dispex); ok_(__FILE__,line)(hres == S_OK, "Could not get IDispatchEx: %08lx\n", hres); + bstr = SysAllocString(L"toString"); + hres = IDispatchEx_GetDispID(dispex, bstr, 0, &id); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(\"toString\") failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDispatchEx_InvokeEx(dispex, id, LOCALE_NEUTRAL, INVOKE_FUNC, &dp, &res, NULL, NULL); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx(\"toString\") failed: %08lx\n", hres); + ok_(__FILE__,line)(V_VT(&res) == VT_BSTR, "V_VT(\"toString\") = %d\n", V_VT(&res)); + ok_(__FILE__,line)(!wcscmp(V_BSTR(&res), doc_onstorage ? L"[object MSEventObj]" : L"[object StorageEvent]"), + "toString = %s\n", wine_dbgstr_w(V_BSTR(&res))); + VariantClear(&res); + hres = IDispatchEx_QueryInterface(dispex, &IID_IDOMStorageEvent, (void**)&event); if(doc_onstorage) { static const WCHAR *props[] = { L"key", L"oldValue", L"newValue", L"storageArea" }; @@ -6719,10 +7549,13 @@ START_TEST(events) run_test(input_doc_str, test_focus); run_test(empty_doc_str, test_submit); run_test(empty_doc_ie9_str, test_submit); + run_test(iframe_doc_str, test_message_event); run_test(iframe_doc_str, test_iframe_connections); if(is_ie9plus) { run_test_from_res(L"doc_with_prop.html", test_doc_obj); run_test_from_res(L"doc_with_prop_ie9.html", test_doc_obj); + run_test(iframe_doc_ie9_str, test_message_event); + run_test(iframe_doc_ie11_str, test_message_event); run_test_from_res(L"doc_with_prop_ie9.html", test_visibilitychange); run_test_from_res(L"blank_ie10.html", test_visibilitychange); run_test_from_res(L"iframe.html", test_unload_event); diff --git a/dlls/mshtml/tests/events.html b/dlls/mshtml/tests/events.html index 6f9b3dacbbc..76473277e3c 100644 --- a/dlls/mshtml/tests/events.html +++ b/dlls/mshtml/tests/events.html @@ -284,7 +284,12 @@ } function test_event_obj_props(e) { - var i, props; + var i, props = [ + "altKey", "button", "cancelBubble", "clientX", "clientY", "ctrlKey", "data", "fromElement", "keyCode", "offsetX", "offsetY", + "origin", "qualifier", "reason", "returnValue", "screenX", "screenY", "shiftKey", "source", "srcElement", "srcFilter", + "toElement", "type", "url", "x", "y" ]; + for(i = 0; i < props.length; i++) + ok(props[i] in e, props[i] + " not in event obj"); props = [ "imeCompositionChange", "imeNotifyCommand", "imeNotifyData", "imeRequest", "imeRequestData", "issession", "keyboardLayout" ]; for(i = 0; i < props.length; i++) diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js index 3b29798e9a1..9282d48bacc 100644 --- a/dlls/mshtml/tests/events.js +++ b/dlls/mshtml/tests/events.js @@ -824,14 +824,27 @@ async_test("img_wrong_content_type", function() { }); async_test("message event", function() { - var listener_called = false; + var listener_called = false, iframe = document.createElement("iframe"); window.addEventListener("message", function(e) { + if(listener_called) { + ok(e.data === "echo", "e.data (diff origin) = " + e.data); + ok(e.source === iframe.contentWindow, "e.source (diff origin) not iframe.contentWindow"); + ok(e.origin === "http://winetest.different.org:1234", "e.origin (diff origin) = " + e.origin); + next_test(); + return; + } listener_called = true; + e.initMessageEvent("blah", true, true, "barfoo", "wine", 1234, window); ok(e.data === "test", "e.data = " + e.data); ok(e.bubbles === false, "bubbles = " + e.bubbles); ok(e.cancelable === false, "cancelable = " + e.cancelable); - next_test(); + ok(e.source === window, "e.source = " + e.source); + ok(e.origin === "http://winetest.example.org", "e.origin = " + e.origin); + + iframe.onload = function() { iframe.contentWindow.postMessage("echo", "hTtP://WinEtesT.difFerent.ORG:1234"); } + iframe.src = "http://winetest.different.org:1234/xhr_iframe.html"; + document.body.appendChild(iframe); }); window.postMessage("test", "httP://wineTest.example.org"); diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index f2ad881df39..f41d5749b3b 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -53,6 +53,7 @@ DEFINE_GUID(IID_IProxyManager,0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00, DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0); DEFINE_GUID(SID_SContainerDispatch,0xb722be00,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); DEFINE_GUID(outer_test_iid,0xabcabc00,0,0,0,0,0,0,0,0,0,0x66); +extern const IID IID_IActiveScriptSite; #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -8730,8 +8731,11 @@ static void test_submit(void) static void test_QueryService(IHTMLDocument2 *doc, BOOL success) { IHTMLWindow2 *window, *sp_window; + IOleCommandTarget *cmdtarget; + IHTMLDocument2 *doc_node; IServiceProvider *sp; IHlinkFrame *hf; + IUnknown *unk; HRESULT hres; hres = IHTMLDocument2_QueryInterface(doc, &IID_IServiceProvider, (void**)&sp); @@ -8748,6 +8752,9 @@ static void test_QueryService(IHTMLDocument2 *doc, BOOL success) ok(hf == &HlinkFrame, "hf != HlinkFrame\n"); IHlinkFrame_Release(hf); + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == E_NOINTERFACE, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) returned: %08lx\n", hres); + IServiceProvider_Release(sp); hres = IHTMLDocument2_get_parentWindow(doc, &window); @@ -8766,8 +8773,28 @@ static void test_QueryService(IHTMLDocument2 *doc, BOOL success) ok(hf == &HlinkFrame, "hf != HlinkFrame\n"); IHlinkFrame_Release(hf); + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == E_NOINTERFACE, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) returned: %08lx\n", hres); + IServiceProvider_Release(sp); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); IHTMLWindow2_Release(window); + + hres = IHTMLDocument2_QueryInterface(doc_node, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + IHTMLDocument2_Release(doc_node); + + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "cmdtarget == NULL\n"); + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&unk); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + IUnknown_Release(unk); + + IOleCommandTarget_Release(cmdtarget); + IServiceProvider_Release(sp); } static void test_HTMLDocument_StreamLoad(void) @@ -9281,8 +9308,10 @@ static BOOL check_ie(void) static void test_ServiceProvider(void) { IHTMLDocument3 *doc3, *doc3_2; + IOleCommandTarget *cmdtarget; IServiceProvider *provider; IHTMLDocument2 *doc, *doc2; + IHTMLWindow2 *window; IUnknown *unk; HRESULT hres; @@ -9318,6 +9347,29 @@ static void test_ServiceProvider(void) ok(hres == S_OK, "QueryService(HTMLEditServices) failed: %08lx\n", hres); IUnknown_Release(unk); + hres = IServiceProvider_QueryService(provider, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == E_NOINTERFACE, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) returned: %08lx\n", hres); + IServiceProvider_Release(provider); + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc2); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + IHTMLWindow2_Release(window); + + hres = IHTMLDocument2_QueryInterface(doc2, &IID_IServiceProvider, (void**)&provider); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + IHTMLDocument2_Release(doc2); + + hres = IServiceProvider_QueryService(provider, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "cmdtarget == NULL\n"); + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&unk); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + IUnknown_Release(unk); + + IOleCommandTarget_Release(cmdtarget); IServiceProvider_Release(provider); release_document(doc); } diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 68ad3002a7f..d53d0bfbd28 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -129,6 +129,7 @@ DEFINE_EXPECT(AddNamedItem); DEFINE_EXPECT(AddNamedItem2); DEFINE_EXPECT(ParseScriptText_script); DEFINE_EXPECT(ParseScriptText_script2); +DEFINE_EXPECT(ParseScriptText_script_with_prescript_site); DEFINE_EXPECT(ParseScriptText_execScript); DEFINE_EXPECT(GetScriptDispatch); DEFINE_EXPECT(funcDisp); @@ -186,6 +187,7 @@ static BOOL is_ie9plus, is_english; static IHTMLDocument2 *notif_doc; static IOleDocumentView *view; static IDispatchEx *window_dispex; +static IHTMLDocument2 *doc_obj; static BOOL doc_complete; static IDispatch *script_disp; static BOOL ax_objsafe; @@ -312,9 +314,40 @@ static BSTR get_mime_type_display_name(const WCHAR *content_type) return SysAllocString(L"File"); } +static void test_sp_caller(IServiceProvider *sp) +{ + IOleCommandTarget *cmdtarget; + IServiceProvider *caller; + IHTMLWindow2 *window; + HRESULT hres; + VARIANT var; + + hres = IServiceProvider_QueryService(sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&caller); + ok(hres == S_OK, "QueryService(SID_GetCaller) returned: %08lx\n", hres); + ok(!caller, "caller != NULL\n"); + + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IActiveScriptSite->IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "IOleCommandTarget is NULL\n"); + + V_VT(&var) = VT_EMPTY; + hres = IOleCommandTarget_Exec(cmdtarget, &CGID_ScriptSite, CMDID_SCRIPTSITE_SECURITY_WINDOW, 0, NULL, &var); + ok(hres == S_OK, "Exec failed: %08lx\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(CMDID_SCRIPTSITE_SECURITY_WINDOW) = %d\n", V_VT(&var)); + ok(V_DISPATCH(&var) != NULL, "V_DISPATCH(CMDID_SCRIPTSITE_SECURITY_WINDOW) = NULL\n"); + IOleCommandTarget_Release(cmdtarget); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLWindow2, (void**)&window); + ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres); + ok(window != NULL, "window is NULL\n"); + IHTMLWindow2_Release(window); + VariantClear(&var); +} + static void test_script_vars(unsigned argc, VARIANTARG *argv) { static const WCHAR *const jsobj_names[] = { L"abc", L"foO", L"bar", L"TostRing", L"hasownpropERty" }; + static const WCHAR *const body_names[] = { L"BAcKgRound", L"bGcoLor", L"fooBar", L"vaLUEof", L"hasownPROperty" }; IHTMLBodyElement *body; IDispatchEx *disp; DISPID id, id2; @@ -398,6 +431,21 @@ static void test_script_vars(unsigned argc, VARIANTARG *argv) ok(hres == S_OK, "Could not get IHTMLBodyElement iface: %08lx\n", hres); IHTMLBodyElement_Release(body); + for(i = 0; i < ARRAY_SIZE(body_names); i++) { + bstr = SysAllocString(body_names[i]); + hres = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, &bstr, 1, 0, &id); + ok(hres == S_OK, "GetIDsOfNames(%s) failed: %08lx\n", debugstr_w(bstr), hres); + ok(id > 0, "Unexpected DISPID for %s: %ld\n", debugstr_w(bstr), id); + + hres = IDispatchEx_GetDispID(disp, bstr, 0, &id); + ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx, expected %08lx\n", debugstr_w(bstr), hres, DISP_E_UNKNOWNNAME); + + hres = IDispatchEx_GetDispID(disp, bstr, fdexNameCaseInsensitive, &id); + ok(hres == S_OK, "GetDispID(%s) with fdexNameCaseInsensitive failed: %08lx\n", debugstr_w(bstr), hres); + ok(id > 0, "Unexpected DISPID for %s: %ld\n", debugstr_w(bstr), id); + SysFreeString(bstr); + } + IDispatchEx_Release(disp); } @@ -1169,6 +1217,7 @@ static HRESULT WINAPI externalDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID ok(!pvarRes, "pvarRes != NULL\n"); ok(pei != NULL, "pei == NULL\n"); + test_sp_caller(pspCaller); return S_OK; case DISPID_EXTERNAL_TODO_WINE_OK: @@ -1924,7 +1973,8 @@ static IHTMLDocument2 *create_document(void) todo_wine #endif ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres); - return SUCCEEDED(hres) ? doc : NULL; + doc_obj = SUCCEEDED(hres) ? doc : NULL; + return doc_obj; } static void load_string(IHTMLDocument2 *doc, const char *str) @@ -3059,9 +3109,34 @@ static void test_ui(void) static void test_sp(void) { - IServiceProvider *sp; + IServiceProvider *sp, *doc_sp, *doc_obj_sp, *window_sp; + IHTMLWindow2 *window, *cmdtarget_window; + IOleCommandTarget *cmdtarget; + IHTMLDocument2 *doc; IUnknown *unk; HRESULT hres; + VARIANT var; + + hres = IDispatchEx_QueryInterface(window_dispex, &IID_IHTMLWindow2, (void**)&window); + ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres); + ok(window != NULL, "window is NULL\n"); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IServiceProvider, (void**)&window_sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + ok(window_sp != NULL, "window service provider is NULL\n"); + + hres = IHTMLWindow2_get_document(window, &doc); + ok(hres == S_OK, "QueryInterface(IHTMLDocument2) failed: %08lx\n", hres); + ok(doc != NULL, "doc is NULL\n"); + ok(doc != doc_obj, "doc node == doc obj\n"); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IServiceProvider, (void**)&doc_sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + ok(doc_sp != NULL, "doc service provider is NULL\n"); + IHTMLDocument2_Release(doc); + hres = IHTMLDocument2_QueryInterface(doc_obj, &IID_IServiceProvider, (void**)&doc_obj_sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + ok(doc_obj_sp != NULL, "doc_obj service provider is NULL\n"); hres = IActiveScriptSite_QueryInterface(site, &IID_IServiceProvider, (void**)&sp); ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); @@ -3070,7 +3145,73 @@ static void test_sp(void) ok(hres == S_OK, "Could not get SID_SContainerDispatch service: %08lx\n", hres); IUnknown_Release(unk); + hres = IServiceProvider_QueryService(sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(SID_GetCaller) returned: %08lx\n", hres); + hres = IServiceProvider_QueryService(doc_sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(SID_GetCaller) returned: %08lx\n", hres); + hres = IServiceProvider_QueryService(doc_obj_sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(SID_GetCaller) returned: %08lx\n", hres); + hres = IServiceProvider_QueryService(window_sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(SID_GetCaller) returned: %08lx\n", hres); + + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IActiveScriptSite->IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "IOleCommandTarget is NULL\n"); + + hres = IActiveScriptSite_QueryInterface(site, &IID_IOleCommandTarget, (void**)&unk); + ok(hres == S_OK, "QueryInterface(IOleCommandTarget) failed: %08lx\n", hres); + ok(unk != NULL, "QueryInterface(IOleCommandTarget) is NULL\n"); + ok(cmdtarget == (IOleCommandTarget*)unk, "cmdtarget from QS not same as from QI\n"); + IUnknown_Release(unk); + hres = IServiceProvider_QueryService(doc_sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&unk); + ok(hres == S_OK, "QueryService(IActiveScriptSite->IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget == (IOleCommandTarget*)unk, "IActiveScriptSite service from document provider not same as site's\n"); + IUnknown_Release(unk); + hres = IServiceProvider_QueryService(doc_obj_sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(IActiveScriptSite->IOleCommandTarget) returned: %08lx\n", hres); + hres = IServiceProvider_QueryService(window_sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(IActiveScriptSite->IOleCommandTarget) returned: %08lx\n", hres); + + if(site2) { + IOleCommandTarget *cmdtarget2; + IServiceProvider *sp2; + + hres = IActiveScriptSite_QueryInterface(site2, &IID_IServiceProvider, (void**)&sp2); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + + hres = IServiceProvider_QueryService(sp2, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget2); + ok(hres == S_OK, "QueryService(IActiveScriptSite->IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget2 != NULL, "IOleCommandTarget is NULL\n"); + + hres = IActiveScriptSite_QueryInterface(site2, &IID_IOleCommandTarget, (void**)&unk); + ok(hres == S_OK, "QueryInterface(IOleCommandTarget) failed: %08lx\n", hres); + ok(unk != NULL, "QueryInterface(IOleCommandTarget) is NULL\n"); + ok(cmdtarget2 != (IOleCommandTarget*)unk, "cmdtarget from site2's QS same as from QI\n"); + ok(cmdtarget2 == cmdtarget, "site1's cmdtarget not same as site2's\n"); + IOleCommandTarget_Release(cmdtarget2); + IServiceProvider_Release(sp2); + IUnknown_Release(unk); + } + + V_VT(&var) = VT_EMPTY; + hres = IOleCommandTarget_Exec(cmdtarget, &CGID_ScriptSite, CMDID_SCRIPTSITE_SECURITY_WINDOW, 0, NULL, &var); + ok(hres == S_OK, "Exec failed: %08lx\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(CMDID_SCRIPTSITE_SECURITY_WINDOW) = %d\n", V_VT(&var)); + ok(V_DISPATCH(&var) != NULL, "V_DISPATCH(CMDID_SCRIPTSITE_SECURITY_WINDOW) = NULL\n"); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLWindow2, (void**)&cmdtarget_window); + ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres); + ok(cmdtarget_window != NULL, "cmdtarget_window is NULL\n"); + ok(window == cmdtarget_window, "window != cmdtarget_window\n"); + IHTMLWindow2_Release(cmdtarget_window); + VariantClear(&var); + + IOleCommandTarget_Release(cmdtarget); + IServiceProvider_Release(window_sp); + IServiceProvider_Release(doc_obj_sp); + IServiceProvider_Release(doc_sp); IServiceProvider_Release(sp); + IHTMLWindow2_Release(window); } static void test_script_run(void) @@ -3331,6 +3472,12 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac test_script_run(); return S_OK; + }else if(!lstrcmpW(pstrCode, L"with pre-script site")) { + CHECK_EXPECT(ParseScriptText_script_with_prescript_site); + ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); + ok(!lstrcmpW(pstrDelimiter, L""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); + ok(dwFlags == (SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %lx\n", dwFlags); + return S_OK; } ok(0, "unexpected script %s\n", wine_dbgstr_w(pstrCode)); @@ -3406,6 +3553,8 @@ static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveSc CHECK_EXPECT(SetScriptSite); ok(pass != NULL, "pass == NULL\n"); + if(site2) + ok(pass != site2, "pass == pre-script site\n"); hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteInterruptPoll, (void**)&poll); ok(hres == S_OK, "Could not get IActiveScriptSiteInterruptPoll interface: %08lx\n", hres); @@ -3695,6 +3844,7 @@ static HRESULT WINAPI ActiveScriptParse2_ParseScriptText(IActiveScriptParse *ifa ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); ok(!lstrcmpW(pstrDelimiter, L""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); ok(dwFlags == (SCRIPTTEXT_ISVISIBLE | SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %08lx\n", dwFlags); + test_sp(); return S_OK; } @@ -4447,6 +4597,12 @@ static const char simple_script_str[] = "" ""; +static const char simple_script_with_prescript_site_str[] = + "" + "" + "" + ""; + static void test_insert_script_elem(IHTMLDocument2 *doc, const WCHAR *code, const WCHAR *lang) { IHTMLDOMNode *node, *body_node, *inserted_node; @@ -4524,10 +4680,16 @@ static void test_exec_script(IHTMLDocument2 *doc, const WCHAR *codew, const WCHA static void test_simple_script(void) { + IOleCommandTarget *cmdtarget; IHTMLDocument2 *doc_node; + IServiceProvider *sp; IHTMLWindow2 *window; + IHTMLDocument6 *doc6; IHTMLDocument2 *doc; + DISPID dispid; HRESULT hres; + VARIANT v; + BSTR bstr; doc = create_document(); if(!doc) @@ -4591,13 +4753,6 @@ static void test_simple_script(void) test_exec_script(doc, L"execScript call", L"TestScript1"); - if(site) - IActiveScriptSite_Release(site); - if(site2) - IActiveScriptSite_Release(site2); - if(window_dispex) - IDispatchEx_Release(window_dispex); - hres = IHTMLDocument2_get_parentWindow(doc, &window); ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); @@ -4614,6 +4769,16 @@ static void test_simple_script(void) CHECK_CALLED(Close); CHECK_CALLED(Close2); + if(site) + IActiveScriptSite_Release(site); + if(site2) + IActiveScriptSite_Release(site2); + if(window_dispex) + IDispatchEx_Release(window_dispex); + site = NULL; + site2 = NULL; + window_dispex = NULL; + hres = IHTMLWindow2_get_document(window, &doc); ok(hres == S_OK, "get_document failed: %08lx\n", hres); ok(doc != doc_node, "doc == doc_node\n"); @@ -4621,6 +4786,112 @@ static void test_simple_script(void) IHTMLDocument2_Release(doc_node); IHTMLDocument2_Release(doc); IHTMLWindow2_Release(window); + + /* Obtaining the IActiveScriptSite before any script engines creates a site with JScript engine, + and is preserved after document gets loaded, and even keeps it from changing its compat mode. */ + doc = create_document(); + if(!doc) + return; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + IHTMLWindow2_Release(window); + + hres = IHTMLDocument2_QueryInterface(doc_node, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + IHTMLDocument2_Release(doc_node); + + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "cmdtarget == NULL\n"); + + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&site2); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + ok(site2 != NULL, "IActiveScriptSite is NULL\n"); + IOleCommandTarget_Release(cmdtarget); + IServiceProvider_Release(sp); + + SET_EXPECT(CreateInstance); + SET_EXPECT(GetInterfaceSafetyOptions); + SET_EXPECT(SetInterfaceSafetyOptions); + SET_EXPECT(SetProperty_INVOKEVERSIONING); + SET_EXPECT(SetProperty_HACK_TRIDENTEVENTSINK); + SET_EXPECT(InitNew); + SET_EXPECT(SetScriptSite); + SET_EXPECT(GetScriptState); + SET_EXPECT(SetScriptState_STARTED); + SET_EXPECT(AddNamedItem); + SET_EXPECT(SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION_FALSE); + SET_EXPECT(ParseScriptText_script_with_prescript_site); + SET_EXPECT(SetScriptState_CONNECTED); + + load_doc(doc, simple_script_with_prescript_site_str); + + CHECK_CALLED(CreateInstance); + CHECK_CALLED(GetInterfaceSafetyOptions); + CHECK_CALLED(SetInterfaceSafetyOptions); + CHECK_CALLED(SetProperty_INVOKEVERSIONING); + CHECK_CALLED(SetProperty_HACK_TRIDENTEVENTSINK); + CHECK_CALLED(InitNew); + CHECK_CALLED(SetScriptSite); + CHECK_CALLED(GetScriptState); + CHECK_CALLED(SetScriptState_STARTED); + CHECK_CALLED(AddNamedItem); + CHECK_CALLED(SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION_FALSE); + CHECK_CALLED(ParseScriptText_script_with_prescript_site); + CHECK_CALLED(SetScriptState_CONNECTED); + + if(site) + IActiveScriptSite_Release(site); + + bstr = SysAllocString(L"fail_prop"); + hres = IHTMLDocument2_GetIDsOfNames(doc, &IID_NULL, &bstr, 1, 0, &dispid); + ok(hres == DISP_E_UNKNOWNNAME, "GetIDsOfNames(fail_prop) returned: %08lx\n", hres); + SysFreeString(bstr); + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + IHTMLWindow2_Release(window); + + hres = IHTMLDocument2_QueryInterface(doc_node, &IID_IHTMLDocument6, (void**)&doc6); + ok(hres == S_OK, "Could not get IHTMLDocument6 iface: %08lx\n", hres); + hres = IHTMLDocument6_get_documentMode(doc6, &v); + ok(V_VT(&v) == VT_R4, "V_VT(documentMode) = %d\n", V_VT(&v)); + ok(V_R4(&v) == 5.0, "V_R4(documentMode) = %f\n", V_R4(&v)); + IHTMLDocument6_Release(doc6); + + hres = IHTMLDocument2_QueryInterface(doc_node, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); + IHTMLDocument2_Release(doc_node); + + hres = IServiceProvider_QueryService(sp, &IID_IActiveScriptSite, &IID_IOleCommandTarget, (void**)&cmdtarget); + ok(hres == S_OK, "QueryService(IID_IActiveScriptSite->IID_IOleCommandTarget) failed: %08lx\n", hres); + ok(cmdtarget != NULL, "cmdtarget == NULL\n"); + + hres = IOleCommandTarget_QueryInterface(cmdtarget, &IID_IActiveScriptSite, (void**)&site); + ok(hres == S_OK, "Command Target QI for IActiveScriptSite failed: %08lx\n", hres); + ok(site == site2, "site != site2\n"); + IOleCommandTarget_Release(cmdtarget); + IServiceProvider_Release(sp); + + SET_EXPECT(SetScriptState_DISCONNECTED); + SET_EXPECT(Close); + + IHTMLDocument2_Release(doc); + + CHECK_CALLED(SetScriptState_DISCONNECTED); + CHECK_CALLED(Close); + + IActiveScriptSite_Release(site2); + IActiveScriptSite_Release(site); + if(window_dispex) + IDispatchEx_Release(window_dispex); } static void run_from_moniker(IMoniker *mon) diff --git a/dlls/mshtml/tests/xhr.js b/dlls/mshtml/tests/xhr.js index 336f03c1b2f..65e14c86543 100644 --- a/dlls/mshtml/tests/xhr.js +++ b/dlls/mshtml/tests/xhr.js @@ -21,6 +21,7 @@ var xml = "\nwine function test_xhr() { var xhr = new XMLHttpRequest(); var complete_cnt = 0, loadstart = false; + var v = document.documentMode; xhr.onreadystatechange = function() { if(xhr.readyState != 4) @@ -29,6 +30,28 @@ function test_xhr() { ok(xhr.responseText === xml, "unexpected responseText " + xhr.responseText); ok(xhr.responseXML !== null, "unexpected null responseXML"); + var x = xhr.responseXML, r = Object.prototype.toString.call(x); + ok(r === (v < 10 ? "[object Object]" : (v < 11 ? "[object Document]" : "[object XMLDocument]")), + "XML document Object.toString = " + r); + + r = Object.getPrototypeOf(x); + if(v < 10) + ok(r === null, "prototype of returned XML document = " + r); + else if(v < 11) + ok(r === window.Document.prototype, "prototype of returned XML document = " + r); + else + ok(r === window.XMLDocument.prototype, "prototype of returned XML document" + r); + + if(v < 10) { + ok(!("anchors" in x), "anchors is in returned XML document"); + ok(Object.prototype.hasOwnProperty.call(x, "createElement"), "createElement not a prop of returned XML document"); + }else { + ok("anchors" in x, "anchors not in returned XML document"); + ok(!x.hasOwnProperty("createElement"), "createElement is a prop of returned XML document"); + r = x.anchors; + ok(r.length === 0, "anchors.length of returned XML document = " + r.length); + } + if(complete_cnt++ && !("onloadend" in xhr)) next_test(); } @@ -214,6 +237,29 @@ function test_sync_xhr() { }, 0); } +function test_xdr() { + if(!window.XDomainRequest) { next_test(); return; } + + var xdr = new XDomainRequest(); + xdr.open("POST", "echo.php"); + // send() on native aborts with custom pluggable protocol handler even with the right + // response headers (`XDomainRequestAllowed: 1` and `Access-Control-Allow-Origin: *`). + + // Only http/https schemes are allowed, and it must match with the origin's scheme + xdr = new XDomainRequest(); + xdr.open("GET", "http://www.winehq.org/"); + + xdr = new XDomainRequest(); + try { + xdr.open("GET", "https://www.winehq.org/"); + ok(false, "xdr scheme mismatch did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === 0x80070005, "xdr scheme mismatch threw " + n); + } + next_test(); +} + function test_content_types() { var xhr = new XMLHttpRequest(), types, i = 0, override = false; var v = document.documentMode; @@ -228,6 +274,7 @@ function test_content_types() { var xml_types = [ "text/xmL", "apPliCation/xml", + "application/xHtml+xml", "image/SvG+xml", "Wine/Test+xml", "++Xml", @@ -236,9 +283,16 @@ function test_content_types() { function onload() { ok(xhr.responseText === xml, "unexpected responseText " + xhr.responseText); - if(v < 10 || types === xml_types) + if(v < 10 || types === xml_types) { ok(xhr.responseXML !== null, "unexpected null responseXML for " + types[i]); - else + if(v >= 10) { + var r = xhr.responseXML.mimeType, e = "text/xml"; + if(types[i] === "application/xHtml+xml" || types[i] === "image/SvG+xml") + e = types[i].toLowerCase(); + e = external.getExpectedMimeType(e); + ok(r === e, "XML document mimeType for " + types[i] + " = " + r + ", expected " + e); + } + }else ok(xhr.responseXML === null, "unexpected non-null responseXML for " + (override ? "overridden " : "") + types[i]); if(("overrideMimeType" in xhr) && !override) { @@ -306,7 +360,6 @@ function test_timeout() { xhr.onload = function() { ok(false, "onload called"); } xhr.ontimeout = function(e) { var r = Object.prototype.toString.call(e); - todo_wine. ok(r === ("[object " + (v < 10 ? "Event" : "ProgressEvent") + "]"), "Object.toString = " + r); var props = [ "initProgressEvent", "lengthComputable", "loaded", "total" ]; for(r = 0; r < props.length; r++) { @@ -402,6 +455,20 @@ function test_response() { [ "arraybuffer", "image/png", function() { if(xhr.readyState < 4) ok(xhr.response === undefined, "response for arraybuffer with state " + state + " = " + xhr.response); + else { + var buf = xhr.response; + ok(buf instanceof ArrayBuffer, "response for arraybuffer not instanceof ArrayBuffer"); + ok(buf.byteLength === xml.length, "response for arraybuffer byteLength = " + buf.byteLength); + buf = new Uint8Array(buf); + for(var i = 0; i < buf.length; i++) { + if(buf[i] !== xml.charCodeAt(i)) { + var a = new Array(buf.length); + for(var j = 0; j < a.length; j++) a[j] = buf[j]; + ok(false, "response for arraybuffer is wrong (first bad char at pos " + i + "): " + a); + break; + } + } + } }], [ "blob", "wine/test", function() { if(xhr.readyState < 4) @@ -435,6 +502,7 @@ function test_response() { var tests = [ test_xhr, test_sync_xhr, + test_xdr, test_content_types, test_abort, test_timeout, diff --git a/dlls/mshtml/tests/xmlhttprequest.c b/dlls/mshtml/tests/xmlhttprequest.c index 6226461a502..c9e76ae7eb7 100644 --- a/dlls/mshtml/tests/xmlhttprequest.c +++ b/dlls/mshtml/tests/xmlhttprequest.c @@ -63,6 +63,7 @@ DEFINE_EXPECT(xmlhttprequest_onreadystatechange_opened); DEFINE_EXPECT(xmlhttprequest_onreadystatechange_headers_received); DEFINE_EXPECT(xmlhttprequest_onreadystatechange_loading); DEFINE_EXPECT(xmlhttprequest_onreadystatechange_done); +DEFINE_EXPECT(xdomainrequest_onload); #define test_disp(u,id) _test_disp(__LINE__,u,id) static void _test_disp(unsigned line, IUnknown *unk, const IID *diid, const IID *broken_diid) @@ -266,6 +267,58 @@ static IDispatchExVtbl xmlhttprequest_onreadystatechangeFuncVtbl = { }; static IDispatchEx xmlhttprequest_onreadystatechange_obj = { &xmlhttprequest_onreadystatechangeFuncVtbl }; +static HRESULT WINAPI xdomainrequest_onload(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + test_event_args(&DIID_DispXDomainRequest, &IID_IHTMLXDomainRequest, id, wFlags, pdp, pvarRes, pei, pspCaller); + CHECK_EXPECT(xdomainrequest_onload); + return S_OK; +} + +static IDispatchExVtbl xdomainrequest_onloadFuncVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + xdomainrequest_onload, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; +static IDispatchEx xdomainrequest_onload_obj = { &xdomainrequest_onloadFuncVtbl }; + +static HRESULT WINAPI xdomainrequest_ignore(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + return S_OK; +} + +static IDispatchExVtbl xdomainrequest_ignoreFuncVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + xdomainrequest_ignore, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; +static IDispatchEx xdomainrequest_ignore_obj = { &xdomainrequest_ignoreFuncVtbl }; + static BOOL doc_complete; static IHTMLDocument2 *notif_doc; @@ -519,10 +572,14 @@ static void _set_request_header(unsigned line, IHTMLXMLHttpRequest *xhr, const W static void test_responseXML(const WCHAR *expect_text) { IDispatch *disp; + IHTMLDocument2 *html_doc; IXMLDOMDocument *xmldom; IObjectSafety *safety; + IHTMLDOMNode *node; DWORD enabled = 0, supported = 0; + DISPID dispid; HRESULT hres; + BSTR str; disp = NULL; hres = IHTMLXMLHttpRequest_get_responseXML(xhr, &disp); @@ -545,6 +602,17 @@ static void test_responseXML(const WCHAR *expect_text) "Expected enabled: (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER), got 0x%08lx\n", enabled); IObjectSafety_Release(safety); + hres = IXMLDOMDocument_QueryInterface(xmldom, &IID_IHTMLDOMNode, (void**)&node); + ok(hres == E_NOINTERFACE, "QueryInterface(IHTMLDOMNode) returned: %08lx\n", hres); + + hres = IXMLDOMDocument_QueryInterface(xmldom, &IID_IHTMLDocument2, (void**)&html_doc); + ok(hres == E_NOINTERFACE, "QueryInterface(IHTMLDocument2) returned: %08lx\n", hres); + + str = SysAllocString(L"anchors"); + hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, &str, 1, LOCALE_USER_DEFAULT, &dispid); + ok(hres == DISP_E_UNKNOWNNAME, "GetIDsOfNames(\"anchors\") returned: %08lx\n", hres); + SysFreeString(str); + if(!expect_text) test_illegal_xml(xmldom); @@ -1066,6 +1134,117 @@ static void test_timeout(IHTMLDocument2 *doc) IHTMLXMLHttpRequest2_Release(xhr2); } +static void test_xdr(IHTMLDocument2 *doc) +{ + IHTMLXDomainRequestFactory *factory; + IHTMLXDomainRequest *xdr; + IHTMLWindow6 *window6; + IHTMLWindow2 *window; + BSTR bstr, url; + HRESULT hres; + LONG timeout; + VARIANT v; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + ok(window != NULL, "window == NULL\n"); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow6, (void**)&window6); + IHTMLWindow2_Release(window); + if(FAILED(hres)) { + win_skip("IHTMLWindow6 not supported\n"); + return; + } + + VariantInit(&v); + hres = IHTMLWindow6_get_XDomainRequest(window6, &v); + IHTMLWindow6_Release(window6); + ok(hres == S_OK, "get_XDomainRequest failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) is %08x, expected VT_DISPATCH\n", V_VT(&v)); + + hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IHTMLXDomainRequestFactory, (void**)&factory); + VariantClear(&v); + ok(hres == S_OK, "QueryInterface(IID_IXDomainRequestFactory) failed: %08lx\n", hres); + ok(factory != NULL, "factory == NULL\n"); + + hres = IHTMLXDomainRequestFactory_create(factory, &xdr); + IHTMLXDomainRequestFactory_Release(factory); + ok(hres == S_OK, "create failed: %08lx\n", hres); + ok(xdr != NULL, "xdr == NULL\n"); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch*)&xdomainrequest_onload_obj; + hres = IHTMLXDomainRequest_put_onload(xdr, v); + ok(hres == S_OK, "put_onload failed: %08lx\n", hres); + + V_VT(&v) = VT_EMPTY; + hres = IHTMLXDomainRequest_get_onload(xdr, &v); + ok(hres == S_OK, "get_onload failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(onload) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) == (IDispatch*)&xdomainrequest_onload_obj, "unexpected onload value\n"); + VariantClear(&v); + + /* Native IE9 sometimes (rarely) aborts if the other handlers are not set */ + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch*)&xdomainrequest_ignore_obj; + hres = IHTMLXDomainRequest_put_onerror(xdr, v); + ok(hres == S_OK, "put_onerror failed: %08lx\n", hres); + hres = IHTMLXDomainRequest_put_onprogress(xdr, v); + ok(hres == S_OK, "put_onprogress failed: %08lx\n", hres); + hres = IHTMLXDomainRequest_put_ontimeout(xdr, v); + ok(hres == S_OK, "put_ontimeout failed: %08lx\n", hres); + + hres = IHTMLXDomainRequest_get_contentType(xdr, &bstr); + ok(hres == S_OK, "get_contentType returned %08lx\n", hres); + ok(bstr == NULL, "contentType = %s\n", debugstr_w(bstr)); + + bstr = SysAllocString(L"GET"); + url = SysAllocString(L"http://test.winehq.org/tests/cors.html"); + hres = IHTMLXDomainRequest_open(xdr, bstr, url); + ok(hres == S_OK, "open failed: %08lx\n", hres); + SysFreeString(bstr); + SysFreeString(url); + + hres = IHTMLXDomainRequest_get_contentType(xdr, &bstr); + ok(hres == S_OK, "get_contentType returned %08lx\n", hres); + ok(bstr == NULL, "contentType = %s\n", debugstr_w(bstr)); + + hres = IHTMLXDomainRequest_get_timeout(xdr, NULL); + ok(hres == E_INVALIDARG, "get_timeout returned %08lx\n", hres); + hres = IHTMLXDomainRequest_get_timeout(xdr, &timeout); + ok(hres == S_OK, "get_timeout returned %08lx\n", hres); + ok(timeout == -1, "timeout = %ld\n", timeout); + + hres = IHTMLXDomainRequest_put_timeout(xdr, -1); + ok(hres == E_INVALIDARG || broken(hres == E_FAIL), "put_timeout returned %08lx\n", hres); + hres = IHTMLXDomainRequest_put_timeout(xdr, 1337); + ok(hres == S_OK, "put_timeout returned %08lx\n", hres); + hres = IHTMLXDomainRequest_get_timeout(xdr, &timeout); + ok(hres == S_OK, "get_timeout returned %08lx\n", hres); + ok(timeout == 1337, "timeout = %ld\n", timeout); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(L"test"); + SET_EXPECT(xdomainrequest_onload); + hres = IHTMLXDomainRequest_send(xdr, v); + ok(hres == S_OK, "send failed: %08lx\n", hres); + if(SUCCEEDED(hres)) + pump_msgs(&called_xdomainrequest_onload); + CHECK_CALLED(xdomainrequest_onload); + + hres = IHTMLXDomainRequest_get_responseText(xdr, &bstr); + ok(hres == S_OK, "get_contentType returned %08lx\n", hres); + ok(!lstrcmpW(bstr, L"test\n"), "responseText = %s\n", debugstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLXDomainRequest_get_contentType(xdr, &bstr); + ok(hres == S_OK, "get_contentType returned %08lx\n", hres); + ok(!lstrcmpW(bstr, L"text/html"), "contentType = %s\n", debugstr_w(bstr)); + SysFreeString(bstr); + + IHTMLXDomainRequest_Release(xdr); +} + static IHTMLDocument2 *create_doc_from_url(const WCHAR *start_url) { BSTR url; @@ -1132,6 +1311,7 @@ START_TEST(xmlhttprequest) test_async_xhr_abort(doc, large_page_url); test_xhr_post(doc); test_timeout(doc); + test_xdr(doc); IHTMLDocument2_Release(doc); } SysFreeString(content_type); diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 5314e5a15cb..01989ee76af 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -136,12 +136,15 @@ struct HTMLXMLHttpRequest { IHTMLXMLHttpRequest2 IHTMLXMLHttpRequest2_iface; IWineXMLHttpRequestPrivate IWineXMLHttpRequestPrivate_iface; IProvideClassInfo2 IProvideClassInfo2_iface; + IHTMLXDomainRequest IHTMLXDomainRequest_iface; /* only for XDomainRequests */ LONG task_magic; LONG ready_state; + document_type_t doctype_override; response_type_t response_type; BOOLEAN synchronous; DWORD magic; DWORD pending_events_magic; + IDispatch *response_obj; HTMLInnerWindow *window; nsIXMLHttpRequest *nsxhr; XMLHttpReqEventListener *event_listener; @@ -398,7 +401,7 @@ static nsresult NSAPI XMLHttpReqEventListener_HandleEvent(nsIDOMEventListener *i blocking_xhr = thread_data->blocking_xhr; compat_mode = dispex_compat_mode(&This->xhr->event_target.dispex); - hres = create_event_from_nsevent(nsevent, compat_mode, &event); + hres = create_event_from_nsevent(nsevent, This->xhr->window, compat_mode, &event); if(FAILED(hres)) { if(!blocking_xhr || This->xhr == blocking_xhr) This->xhr->ready_state = ready_state; @@ -611,7 +614,11 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *if } if(dispex_compat_mode(&This->event_target.dispex) >= COMPAT_MODE_IE10) { + nsACString header, nscstr; + document_type_t doctype; + HTMLDocumentNode *doc; nsIDOMDocument *nsdoc; + const char *type; nsresult nsres; nsres = nsIXMLHttpRequest_GetResponseXML(This->nsxhr, &nsdoc); @@ -621,7 +628,36 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *if *p = NULL; return S_OK; } + + if(!This->window->base.outer_window || !This->window->base.outer_window->browser) + hres = E_UNEXPECTED; + else { + if(This->doctype_override != DOCTYPE_INVALID) + doctype = This->doctype_override; + else { + doctype = DOCTYPE_XML; + nsACString_InitDepend(&header, "Content-Type"); + nsACString_InitDepend(&nscstr, NULL); + nsres = nsIXMLHttpRequest_GetResponseHeader(This->nsxhr, &header, &nscstr); + nsACString_Finish(&header); + if(NS_SUCCEEDED(nsres)) { + nsACString_GetData(&nscstr, &type); + if(!stricmp(type, "application/xhtml+xml")) + doctype = DOCTYPE_XHTML; + else if(!stricmp(type, "image/svg+xml")) + doctype = DOCTYPE_SVG; + } + nsACString_Finish(&nscstr); + } + hres = create_document_node(nsdoc, This->window->base.outer_window->browser, NULL, doctype, + dispex_compat_mode(&This->window->event_target.dispex), &doc); + } nsIDOMDocument_Release(nsdoc); + if(FAILED(hres)) + return hres; + + *p = (IDispatch*)&doc->IHTMLDocument2_iface; + return S_OK; } hres = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void**)&xmldoc); @@ -1159,10 +1195,21 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_Invoke(IWineXMLHttpRequestPriva static HRESULT WINAPI HTMLXMLHttpRequest_private_get_response(IWineXMLHttpRequestPrivate *iface, VARIANT *p) { HTMLXMLHttpRequest *This = impl_from_IWineXMLHttpRequestPrivate(iface); + IWineDispatchProxyCbPrivate *proxy; HRESULT hres = S_OK; + UINT32 buf_size; + nsresult nsres; + void *buf; TRACE("(%p)->(%p)\n", This, p); + if(This->response_obj) { + V_VT(p) = VT_DISPATCH; + V_DISPATCH(p) = This->response_obj; + IDispatch_AddRef(This->response_obj); + return S_OK; + } + switch(This->response_type) { case response_type_empty: case response_type_text: @@ -1181,10 +1228,22 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_get_response(IWineXMLHttpReques V_VT(p) = VT_EMPTY; break; } - if(This->response_type == response_type_arraybuf) { - FIXME("response_type_arraybuf\n"); + if(!(proxy = This->event_target.dispex.proxy)) { + FIXME("No proxy\n"); return E_NOTIMPL; } + nsres = nsIXMLHttpRequest_GetResponseBuffer(This->nsxhr, NULL, 0, &buf_size); + assert(nsres == NS_OK); + + if(This->response_type == response_type_arraybuf) { + hres = proxy->lpVtbl->CreateArrayBuffer(proxy, buf_size, &This->response_obj, &buf); + if(SUCCEEDED(hres)) { + nsres = nsIXMLHttpRequest_GetResponseBuffer(This->nsxhr, buf, buf_size, &buf_size); + assert(nsres == NS_OK); + } + break; + } + FIXME("response_type_blob\n"); return E_NOTIMPL; @@ -1196,6 +1255,11 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_get_response(IWineXMLHttpReques assert(0); } + if(SUCCEEDED(hres) && This->response_obj) { + V_VT(p) = VT_DISPATCH; + V_DISPATCH(p) = This->response_obj; + IDispatch_AddRef(This->response_obj); + } return hres; } @@ -1276,6 +1340,7 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_overrideMimeType(IWineXMLHttpRe { HTMLXMLHttpRequest *This = impl_from_IWineXMLHttpRequestPrivate(iface); static const WCHAR generic_type[] = L"application/octet-stream"; + document_type_t doctype = DOCTYPE_XML; const WCHAR *type = NULL; WCHAR *lowercase = NULL; nsAString nsstr; @@ -1289,6 +1354,11 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_overrideMimeType(IWineXMLHttpRe return E_OUTOFMEMORY; _wcslwr(lowercase); type = lowercase; + + if(!wcscmp(type, L"application/xhtml+xml")) + doctype = DOCTYPE_XHTML; + else if(!wcscmp(type, L"image/svg+xml")) + doctype = DOCTYPE_SVG; }else type = generic_type; } @@ -1297,6 +1367,8 @@ static HRESULT WINAPI HTMLXMLHttpRequest_private_overrideMimeType(IWineXMLHttpRe nsres = nsIXMLHttpRequest_SlowOverrideMimeType(This->nsxhr, &nsstr); nsAString_Finish(&nsstr); free(lowercase); + if(NS_SUCCEEDED(nsres)) + This->doctype_override = doctype; return map_nsresult(nsres); } @@ -1512,6 +1584,8 @@ static void HTMLXMLHttpRequest_traverse(DispatchEx *dispex, nsCycleCollectionTra note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); if(This->pending_progress_event) note_cc_edge((nsISupports*)&This->pending_progress_event->IDOMEvent_iface, "pending_progress_event", cb); + if(This->response_obj) + note_cc_edge((nsISupports*)This->response_obj, "response_obj", cb); if(This->nsxhr) note_cc_edge((nsISupports*)This->nsxhr, "nsxhr", cb); traverse_event_target(&This->event_target, cb); @@ -1535,6 +1609,7 @@ static void HTMLXMLHttpRequest_unlink(DispatchEx *dispex) This->pending_progress_event = NULL; IDOMEvent_Release(&pending_progress_event->IDOMEvent_iface); } + unlink_ref(&This->response_obj); unlink_ref(&This->nsxhr); release_event_target(&This->event_target); } @@ -1609,9 +1684,10 @@ static const tid_t HTMLXMLHttpRequest_iface_tids[] = { IHTMLXMLHttpRequest2_tid, 0 }; -static dispex_static_data_t HTMLXMLHttpRequest_dispex = { +dispex_static_data_t HTMLXMLHttpRequest_dispex = { "XMLHttpRequest", &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, + PROTO_ID_HTMLXMLHttpRequest, DispHTMLXMLHttpRequest_tid, HTMLXMLHttpRequest_iface_tids, HTMLXMLHttpRequest_init_dispex_info @@ -1619,39 +1695,39 @@ static dispex_static_data_t HTMLXMLHttpRequest_dispex = { /* IHTMLXMLHttpRequestFactory */ -static inline HTMLXMLHttpRequestFactory *impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface) +static inline struct global_ctor *impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface) { - return CONTAINING_RECORD(iface, HTMLXMLHttpRequestFactory, IHTMLXMLHttpRequestFactory_iface); + return CONTAINING_RECORD(iface, struct global_ctor, IHTMLXMLHttpRequestFactory_iface); } static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface(IHTMLXMLHttpRequestFactory *iface, REFIID riid, void **ppv) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_QueryInterface(&This->dispex.IDispatchEx_iface, riid, ppv); } static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef(IHTMLXMLHttpRequestFactory *iface) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_AddRef(&This->dispex.IDispatchEx_iface); } static ULONG WINAPI HTMLXMLHttpRequestFactory_Release(IHTMLXMLHttpRequestFactory *iface) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_Release(&This->dispex.IDispatchEx_iface); } static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfoCount(IHTMLXMLHttpRequestFactory *iface, UINT *pctinfo) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); } static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo(IHTMLXMLHttpRequestFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); } @@ -1659,7 +1735,7 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo(IHTMLXMLHttpRequestF static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames(IHTMLXMLHttpRequestFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); @@ -1668,25 +1744,22 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames(IHTMLXMLHttpReques static HRESULT WINAPI HTMLXMLHttpRequestFactory_Invoke(IHTMLXMLHttpRequestFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } -static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactory *iface, IHTMLXMLHttpRequest **p) +static HRESULT create_xhr(HTMLInnerWindow *window, dispex_static_data_t *dispex, HTMLXMLHttpRequest **p) { - HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface); - HTMLXMLHttpRequest *ret; - nsIXMLHttpRequest *nsxhr; - nsIDOMEventTarget *nstarget; - XMLHttpReqEventListener *event_listener; + XMLHttpReqEventListener *event_listener; + nsIDOMEventTarget *nstarget; + nsIXMLHttpRequest *nsxhr; + HTMLXMLHttpRequest *ret; nsresult nsres; unsigned i; - TRACE("(%p)->(%p)\n", This, p); - - nsxhr = create_nsxhr(This->window->dom_window); + nsxhr = create_nsxhr(window->dom_window); if(!nsxhr) return E_FAIL; @@ -1704,15 +1777,16 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor } ret->nsxhr = nsxhr; - ret->window = This->window; + ret->window = window; + ret->doctype_override = DOCTYPE_INVALID; ret->task_magic = get_task_target_magic(); - IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface); + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); ret->IHTMLXMLHttpRequest_iface.lpVtbl = &HTMLXMLHttpRequestVtbl; ret->IHTMLXMLHttpRequest2_iface.lpVtbl = &HTMLXMLHttpRequest2Vtbl; ret->IWineXMLHttpRequestPrivate_iface.lpVtbl = &WineXMLHttpRequestPrivateVtbl; ret->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfo2Vtbl; - EventTarget_Init(&ret->event_target, &HTMLXMLHttpRequest_dispex, This->window->doc->document_mode); + EventTarget_Init(&ret->event_target, dispex, window); /* Always register the handlers because we need them to track state */ event_listener->nsIDOMEventListener_iface.lpVtbl = &XMLHttpReqEventListenerVtbl; @@ -1738,11 +1812,25 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor } nsIDOMEventTarget_Release(nstarget); - *p = &ret->IHTMLXMLHttpRequest_iface; + *p = ret; return S_OK; } -static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl = { +static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactory *iface, IHTMLXMLHttpRequest **p) +{ + struct global_ctor *This = impl_from_IHTMLXMLHttpRequestFactory(iface); + HTMLXMLHttpRequest *xhr; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + hres = create_xhr(This->window, &HTMLXMLHttpRequest_dispex, &xhr); + if(SUCCEEDED(hres)) + *p = &xhr->IHTMLXMLHttpRequest_iface; + return hres; +} + +const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl = { HTMLXMLHttpRequestFactory_QueryInterface, HTMLXMLHttpRequestFactory_AddRef, HTMLXMLHttpRequestFactory_Release, @@ -1753,14 +1841,14 @@ static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl = { HTMLXMLHttpRequestFactory_create }; -static inline HTMLXMLHttpRequestFactory *factory_from_DispatchEx(DispatchEx *iface) +static inline struct global_ctor *ctor_from_DispatchEx(DispatchEx *iface) { - return CONTAINING_RECORD(iface, HTMLXMLHttpRequestFactory, dispex); + return CONTAINING_RECORD(iface, struct global_ctor, dispex); } static void *HTMLXMLHttpRequestFactory_query_interface(DispatchEx *dispex, REFIID riid) { - HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); + struct global_ctor *This = ctor_from_DispatchEx(dispex); if(IsEqualGUID(&IID_IHTMLXMLHttpRequestFactory, riid)) return &This->IHTMLXMLHttpRequestFactory_iface; @@ -1768,87 +1856,579 @@ static void *HTMLXMLHttpRequestFactory_query_interface(DispatchEx *dispex, REFII return NULL; } -static void HTMLXMLHttpRequestFactory_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) -{ - HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); - - if(This->window) - note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); -} - -static void HTMLXMLHttpRequestFactory_unlink(DispatchEx *dispex) -{ - HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); - - if(This->window) { - HTMLInnerWindow *window = This->window; - This->window = NULL; - IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); - } -} - -static void HTMLXMLHttpRequestFactory_destructor(DispatchEx *dispex) -{ - HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); - free(This); -} - static HRESULT HTMLXMLHttpRequestFactory_value(DispatchEx *iface, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { - HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(iface); - IHTMLXMLHttpRequest *xhr; + struct global_ctor *This = ctor_from_DispatchEx(iface); + HTMLXMLHttpRequest *xhr; HRESULT hres; TRACE("\n"); - if(flags != DISPATCH_CONSTRUCT) { - FIXME("flags %x not supported\n", flags); - return E_NOTIMPL; - } + if(flags != DISPATCH_CONSTRUCT) + return S_FALSE; - hres = IHTMLXMLHttpRequestFactory_create(&This->IHTMLXMLHttpRequestFactory_iface, &xhr); + hres = create_xhr(This->window, &HTMLXMLHttpRequest_dispex, &xhr); if(FAILED(hres)) return hres; V_VT(res) = VT_DISPATCH; - V_DISPATCH(res) = (IDispatch*)xhr; + V_DISPATCH(res) = (IDispatch*)&xhr->IHTMLXMLHttpRequest_iface; return S_OK; } static const dispex_static_data_vtbl_t HTMLXMLHttpRequestFactory_dispex_vtbl = { .query_interface = HTMLXMLHttpRequestFactory_query_interface, - .destructor = HTMLXMLHttpRequestFactory_destructor, - .traverse = HTMLXMLHttpRequestFactory_traverse, - .unlink = HTMLXMLHttpRequestFactory_unlink, - .value = HTMLXMLHttpRequestFactory_value + .destructor = global_ctor_destructor, + .traverse = global_ctor_traverse, + .unlink = global_ctor_unlink, + .value = HTMLXMLHttpRequestFactory_value, + .get_dispid = legacy_ctor_get_dispid, + .get_name = legacy_ctor_get_name, + .invoke = legacy_ctor_invoke, + .delete = legacy_ctor_delete }; static const tid_t HTMLXMLHttpRequestFactory_iface_tids[] = { IHTMLXMLHttpRequestFactory_tid, 0 }; -static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { - "Function", + +dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { + "XMLHttpRequest", &HTMLXMLHttpRequestFactory_dispex_vtbl, + PROTO_ID_NULL, IHTMLXMLHttpRequestFactory_tid, HTMLXMLHttpRequestFactory_iface_tids }; -HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, HTMLXMLHttpRequestFactory **ret_ptr) +static HRESULT HTMLXMLHttpRequestCtor_value(DispatchEx *iface, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { - HTMLXMLHttpRequestFactory *ret; + if(flags == DISPATCH_CONSTRUCT) + return HTMLXMLHttpRequestFactory_value(iface, lcid, flags, params, res, ei, caller); - ret = malloc(sizeof(*ret)); - if(!ret) - return E_OUTOFMEMORY; + return global_ctor_value(iface, lcid, flags, params, res, ei, caller); +} - ret->IHTMLXMLHttpRequestFactory_iface.lpVtbl = &HTMLXMLHttpRequestFactoryVtbl; - ret->window = window; - IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); +static const dispex_static_data_vtbl_t HTMLXMLHttpRequestCtor_dispex_vtbl = { + .query_interface = HTMLXMLHttpRequestFactory_query_interface, + .destructor = global_ctor_destructor, + .traverse = global_ctor_traverse, + .unlink = global_ctor_unlink, + .value = HTMLXMLHttpRequestCtor_value, + .get_dispid = legacy_ctor_get_dispid, + .get_name = legacy_ctor_get_name, + .invoke = legacy_ctor_invoke, + .delete = legacy_ctor_delete +}; + +dispex_static_data_t HTMLXMLHttpRequestCtor_dispex = { + "XMLHttpRequest", + &HTMLXMLHttpRequestCtor_dispex_vtbl, + PROTO_ID_NULL, + IHTMLXMLHttpRequestFactory_tid, + HTMLXMLHttpRequestFactory_iface_tids +}; + + +/* IHTMLXDomainRequest */ +static inline HTMLXMLHttpRequest *impl_from_IHTMLXDomainRequest(IHTMLXDomainRequest *iface) +{ + return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, IHTMLXDomainRequest_iface); +} + +static HRESULT WINAPI HTMLXDomainRequest_QueryInterface(IHTMLXDomainRequest *iface, REFIID riid, void **ppv) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_QueryInterface(&This->event_target.dispex.IDispatchEx_iface, riid, ppv); +} + +static ULONG WINAPI HTMLXDomainRequest_AddRef(IHTMLXDomainRequest *iface) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_AddRef(&This->event_target.dispex.IDispatchEx_iface); +} + +static ULONG WINAPI HTMLXDomainRequest_Release(IHTMLXDomainRequest *iface) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_Release(&This->event_target.dispex.IDispatchEx_iface); +} + +static HRESULT WINAPI HTMLXDomainRequest_GetTypeInfoCount(IHTMLXDomainRequest *iface, UINT *pctinfo) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_GetTypeInfoCount(&This->event_target.dispex.IDispatchEx_iface, pctinfo); +} - init_dispatch(&ret->dispex, &HTMLXMLHttpRequestFactory_dispex, dispex_compat_mode(&window->event_target.dispex)); +static HRESULT WINAPI HTMLXDomainRequest_GetTypeInfo(IHTMLXDomainRequest *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_GetTypeInfo(&This->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} - *ret_ptr = ret; +static HRESULT WINAPI HTMLXDomainRequest_GetIDsOfNames(IHTMLXDomainRequest *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_GetIDsOfNames(&This->event_target.dispex.IDispatchEx_iface, riid, rgszNames, cNames, + lcid, rgDispId); +} + +static HRESULT WINAPI HTMLXDomainRequest_Invoke(IHTMLXDomainRequest *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return IDispatchEx_Invoke(&This->event_target.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_responseText(IHTMLXDomainRequest *iface, BSTR *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return HTMLXMLHttpRequest_get_responseText(&This->IHTMLXMLHttpRequest_iface, p); +} + +static HRESULT WINAPI HTMLXDomainRequest_put_timeout(IHTMLXDomainRequest *iface, LONG v) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%ld)\n", This, v); + + if(v < 0) + return E_INVALIDARG; + return map_nsresult(nsIXMLHttpRequest_SetTimeout(This->nsxhr, v)); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_timeout(IHTMLXDomainRequest *iface, LONG *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + nsresult nsres; + UINT32 timeout; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_INVALIDARG; + + nsres = nsIXMLHttpRequest_GetTimeout(This->nsxhr, &timeout); + *p = timeout ? timeout : -1; + return map_nsresult(nsres); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_contentType(IHTMLXDomainRequest *iface, BSTR *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + nsAString nsstr; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + if(This->ready_state < READYSTATE_LOADED) { + *p = NULL; + return S_OK; + } + + nsAString_InitDepend(&nsstr, NULL); + nsres = nsIXMLHttpRequest_GetResponseText(This->nsxhr, &nsstr); + if(NS_SUCCEEDED(nsres)) { + const PRUnichar *data; + char text[256 * 3]; + unsigned len; + WCHAR *mime; + + nsAString_GetData(&nsstr, &data); + len = WideCharToMultiByte(CP_ACP, 0, data, wcsnlen(data, 256), text, ARRAY_SIZE(text), NULL, NULL); + nsAString_Finish(&nsstr); + + if(len) { + hres = FindMimeFromData(NULL, NULL, text, len, NULL, 0, &mime, 0); + if(SUCCEEDED(hres)) { + *p = SysAllocString(mime); + CoTaskMemFree(mime); + return *p ? S_OK : E_OUTOFMEMORY; + } + } + } + + *p = SysAllocString(L"text/plain"); + return *p ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI HTMLXDomainRequest_put_onprogress(IHTMLXDomainRequest *iface, VARIANT v) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_PROGRESS, &v); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_onprogress(IHTMLXDomainRequest *iface, VARIANT *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_PROGRESS, p); +} + +static HRESULT WINAPI HTMLXDomainRequest_put_onerror(IHTMLXDomainRequest *iface, VARIANT v) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_ERROR, &v); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_onerror(IHTMLXDomainRequest *iface, VARIANT *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_ERROR, p); +} + +static HRESULT WINAPI HTMLXDomainRequest_put_ontimeout(IHTMLXDomainRequest *iface, VARIANT v) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_TIMEOUT, &v); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_ontimeout(IHTMLXDomainRequest *iface, VARIANT *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_TIMEOUT, p); +} + +static HRESULT WINAPI HTMLXDomainRequest_put_onload(IHTMLXDomainRequest *iface, VARIANT v) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_LOAD, &v); +} + +static HRESULT WINAPI HTMLXDomainRequest_get_onload(IHTMLXDomainRequest *iface, VARIANT *p) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_LOAD, p); +} + +static HRESULT WINAPI HTMLXDomainRequest_abort(IHTMLXDomainRequest *iface) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return HTMLXMLHttpRequest_abort(&This->IHTMLXMLHttpRequest_iface); +} + +static HRESULT WINAPI HTMLXDomainRequest_open(IHTMLXDomainRequest *iface, BSTR bstrMethod, BSTR bstrUrl) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + VARIANT vtrue, vempty; + nsACString str1, str2; + nsAString nsstr; + nsresult nsres; + HRESULT hres; + DWORD magic; + WCHAR *p; + + TRACE("(%p)->(%s %s)\n", This, debugstr_w(bstrMethod), debugstr_w(bstrUrl)); + + if((p = wcschr(bstrUrl, ':')) && p[1] == '/' && p[2] == '/') { + size_t len = p - bstrUrl; + BSTR bstr; + + /* Native only allows http and https, and the scheme must match */ + if(len < 4 || len > 5 || wcsnicmp(bstrUrl, L"https", len) || !This->window->base.outer_window || !This->window->base.outer_window->uri) + return E_ACCESSDENIED; + + hres = IUri_GetSchemeName(This->window->base.outer_window->uri, &bstr); + if(FAILED(hres)) + return hres; + if(SysStringLen(bstr) != len || wcsnicmp(bstr, bstrUrl, len)) + hres = E_ACCESSDENIED; + SysFreeString(bstr); + if(FAILED(hres)) + return hres; + } + + V_VT(&vtrue) = VT_BOOL; + V_BOOL(&vtrue) = VARIANT_TRUE; + V_VT(&vempty) = VT_EMPTY; + magic = This->magic; + hres = HTMLXMLHttpRequest_open(&This->IHTMLXMLHttpRequest_iface, bstrMethod, bstrUrl, vtrue, vempty, vempty); + if(FAILED(hres) || magic != This->magic) + return hres; + + /* Prevent Gecko from parsing responseXML for no reason */ + nsAString_InitDepend(&nsstr, L"text/plain"); + nsIXMLHttpRequest_SlowOverrideMimeType(This->nsxhr, &nsstr); + nsAString_Finish(&nsstr); + + /* XDomainRequest only accepts text/plain */ + nsACString_InitDepend(&str1, "Accept"); + nsACString_InitDepend(&str2, "text/plain"); + nsres = nsIXMLHttpRequest_SetRequestHeader(This->nsxhr, &str1, &str2); + nsACString_Finish(&str1); + nsACString_Finish(&str2); + if(NS_FAILED(nsres)) { + ERR("nsIXMLHttpRequest_SetRequestHeader failed: %08lx\n", nsres); + return map_nsresult(nsres); + } + + /* IE always adds Origin header, even from same origin, but Gecko doesn't allow us to alter it. */ return S_OK; } + +static HRESULT WINAPI HTMLXDomainRequest_send(IHTMLXDomainRequest *iface, VARIANT varBody) +{ + HTMLXMLHttpRequest *This = impl_from_IHTMLXDomainRequest(iface); + return HTMLXMLHttpRequest_send(&This->IHTMLXMLHttpRequest_iface, varBody); +} + +static const IHTMLXDomainRequestVtbl HTMLXDomainRequestVtbl = { + HTMLXDomainRequest_QueryInterface, + HTMLXDomainRequest_AddRef, + HTMLXDomainRequest_Release, + HTMLXDomainRequest_GetTypeInfoCount, + HTMLXDomainRequest_GetTypeInfo, + HTMLXDomainRequest_GetIDsOfNames, + HTMLXDomainRequest_Invoke, + HTMLXDomainRequest_get_responseText, + HTMLXDomainRequest_put_timeout, + HTMLXDomainRequest_get_timeout, + HTMLXDomainRequest_get_contentType, + HTMLXDomainRequest_put_onprogress, + HTMLXDomainRequest_get_onprogress, + HTMLXDomainRequest_put_onerror, + HTMLXDomainRequest_get_onerror, + HTMLXDomainRequest_put_ontimeout, + HTMLXDomainRequest_get_ontimeout, + HTMLXDomainRequest_put_onload, + HTMLXDomainRequest_get_onload, + HTMLXDomainRequest_abort, + HTMLXDomainRequest_open, + HTMLXDomainRequest_send +}; + +static void *HTMLXDomainRequest_query_interface(DispatchEx *dispex, REFIID riid) +{ + HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex); + + if(IsEqualGUID(&IID_IHTMLXDomainRequest, riid)) + return &This->IHTMLXDomainRequest_iface; + + return EventTarget_query_interface(&This->event_target, riid); +} + +static const event_target_vtbl_t HTMLXDomainRequest_event_target_vtbl = { + { + .query_interface = HTMLXDomainRequest_query_interface, + .destructor = HTMLXMLHttpRequest_destructor, + .traverse = HTMLXMLHttpRequest_traverse, + .unlink = HTMLXMLHttpRequest_unlink, + .last_release = HTMLXMLHttpRequest_last_release + }, + .get_gecko_target = HTMLXMLHttpRequest_get_gecko_target, + .bind_event = HTMLXMLHttpRequest_bind_event +}; + +static void HTMLXDomainRequest_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) +{ + dispex_info_add_interface(info, IHTMLXDomainRequest_tid, NULL); +} + +dispex_static_data_t HTMLXDomainRequest_dispex = { + "XDomainRequest", + &HTMLXDomainRequest_event_target_vtbl.dispex_vtbl, + PROTO_ID_HTMLXDomainRequest, + DispXDomainRequest_tid, + no_iface_tids, + HTMLXDomainRequest_init_dispex_info +}; + + +/* IHTMLXDomainRequestFactory */ +static inline struct global_ctor *impl_from_IHTMLXDomainRequestFactory(IHTMLXDomainRequestFactory *iface) +{ + return CONTAINING_RECORD(iface, struct global_ctor, IHTMLXDomainRequestFactory_iface); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_QueryInterface(IHTMLXDomainRequestFactory *iface, REFIID riid, void **ppv) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_QueryInterface(&This->dispex.IDispatchEx_iface, riid, ppv); +} + +static ULONG WINAPI HTMLXDomainRequestFactory_AddRef(IHTMLXDomainRequestFactory *iface) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_AddRef(&This->dispex.IDispatchEx_iface); +} + +static ULONG WINAPI HTMLXDomainRequestFactory_Release(IHTMLXDomainRequestFactory *iface) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_Release(&This->dispex.IDispatchEx_iface); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_GetTypeInfoCount(IHTMLXDomainRequestFactory *iface, UINT *pctinfo) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_GetTypeInfo(IHTMLXDomainRequestFactory *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_GetIDsOfNames(IHTMLXDomainRequestFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, + lcid, rgDispId); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_Invoke(IHTMLXDomainRequestFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLXDomainRequestFactory_create(IHTMLXDomainRequestFactory *iface, IHTMLXDomainRequest **p) +{ + struct global_ctor *This = impl_from_IHTMLXDomainRequestFactory(iface); + HTMLXMLHttpRequest *xhr; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + hres = create_xhr(This->window, &HTMLXDomainRequest_dispex, &xhr); + if(FAILED(hres)) + return hres; + + xhr->IHTMLXDomainRequest_iface.lpVtbl = &HTMLXDomainRequestVtbl; + + *p = &xhr->IHTMLXDomainRequest_iface; + return hres; +} + +const IHTMLXDomainRequestFactoryVtbl HTMLXDomainRequestFactoryVtbl = { + HTMLXDomainRequestFactory_QueryInterface, + HTMLXDomainRequestFactory_AddRef, + HTMLXDomainRequestFactory_Release, + HTMLXDomainRequestFactory_GetTypeInfoCount, + HTMLXDomainRequestFactory_GetTypeInfo, + HTMLXDomainRequestFactory_GetIDsOfNames, + HTMLXDomainRequestFactory_Invoke, + HTMLXDomainRequestFactory_create +}; + +static void *HTMLXDomainRequestFactory_query_interface(DispatchEx *dispex, REFIID riid) +{ + struct global_ctor *This = ctor_from_DispatchEx(dispex); + + if(IsEqualGUID(&IID_IHTMLXDomainRequestFactory, riid)) + return &This->IHTMLXDomainRequestFactory_iface; + + return NULL; +} + +static HRESULT HTMLXDomainRequestFactory_value(DispatchEx *iface, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + struct global_ctor *This = ctor_from_DispatchEx(iface); + IHTMLXDomainRequest *xdr; + HRESULT hres; + + TRACE("\n"); + + if(flags != DISPATCH_CONSTRUCT) + return S_FALSE; + + hres = IHTMLXDomainRequestFactory_create(&This->IHTMLXDomainRequestFactory_iface, &xdr); + if(FAILED(hres)) + return hres; + + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)xdr; + return hres; +} + +static const dispex_static_data_vtbl_t HTMLXDomainRequestFactory_dispex_vtbl = { + .query_interface = HTMLXDomainRequestFactory_query_interface, + .destructor = global_ctor_destructor, + .traverse = global_ctor_traverse, + .unlink = global_ctor_unlink, + .value = HTMLXDomainRequestFactory_value, + .get_dispid = legacy_ctor_get_dispid, + .get_name = legacy_ctor_get_name, + .invoke = legacy_ctor_invoke, + .delete = legacy_ctor_delete +}; + +static const tid_t HTMLXDomainRequestFactory_iface_tids[] = { + IHTMLXDomainRequestFactory_tid, + 0 +}; + +dispex_static_data_t HTMLXDomainRequestFactory_dispex = { + "XDomainRequest", + &HTMLXDomainRequestFactory_dispex_vtbl, + PROTO_ID_NULL, + IHTMLXDomainRequestFactory_tid, + HTMLXDomainRequestFactory_iface_tids +}; + +static HRESULT HTMLXDomainRequestCtor_value(DispatchEx *iface, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + if(flags == DISPATCH_CONSTRUCT) + return HTMLXDomainRequestFactory_value(iface, lcid, flags, params, res, ei, caller); + + return global_ctor_value(iface, lcid, flags, params, res, ei, caller); +} + +static const dispex_static_data_vtbl_t HTMLXDomainRequestCtor_dispex_vtbl = { + .query_interface = HTMLXDomainRequestFactory_query_interface, + .destructor = global_ctor_destructor, + .traverse = global_ctor_traverse, + .unlink = global_ctor_unlink, + .value = HTMLXDomainRequestCtor_value, + .get_dispid = legacy_ctor_get_dispid, + .get_name = legacy_ctor_get_name, + .invoke = legacy_ctor_invoke, + .delete = legacy_ctor_delete +}; + +dispex_static_data_t HTMLXDomainRequestCtor_dispex = { + "XDomainRequest", + &HTMLXDomainRequestCtor_dispex_vtbl, + PROTO_ID_NULL, + IHTMLXDomainRequestFactory_tid, + HTMLXDomainRequestFactory_iface_tids +}; diff --git a/dlls/msv1_0/unixlib.c b/dlls/msv1_0/unixlib.c index b51dde2ef0a..42bef3a28ce 100644 --- a/dlls/msv1_0/unixlib.c +++ b/dlls/msv1_0/unixlib.c @@ -43,7 +43,6 @@ extern char **environ; WINE_DEFAULT_DEBUG_CHANNEL(ntlm); -WINE_DECLARE_DEBUG_CHANNEL(winediag); #define INITIAL_BUFFER_SIZE 200 @@ -233,7 +232,7 @@ static NTSTATUS ntlm_check_version( void *args ) status = STATUS_SUCCESS; } - if (status) ERR_(winediag)( "ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. " + if (status) WARN( "ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. " "Usually, you can find it in the winbind package of your distribution.\n" ); ntlm_cleanup( &ctx ); return status; diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 3c1d9572585..3de12d1087f 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -44,6 +44,7 @@ #include "mtdll.h" #include "wine/asm.h" #include "wine/debug.h" +#include "wine/asm.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); @@ -818,12 +819,28 @@ static int msvcrt_flush_buffer(FILE* file) /********************************************************************* * _isatty (MSVCRT.@) */ +#ifdef __x86_64__ +int CDECL MSVCRT__isatty(int fd) +{ + TRACE(":fd (%d)\n",fd); + + return get_ioinfo_nolock(fd)->wxflag & WX_TTY; +} +__ASM_GLOBAL_FUNC( _isatty, + "sub $0x30,%rsp\n\t" + "lea MSVCRT___pioinfo(%rip),%rdx\n\t" + "nop;nop;nop;nop;nop;nop;nop;nop;nop\n\t" + "add $0x30,%rsp\n\t" + "jmp " __ASM_NAME( "MSVCRT__isatty" ) ) +#else int CDECL _isatty(int fd) { TRACE(":fd (%d)\n",fd); return get_ioinfo_nolock(fd)->wxflag & WX_TTY; } +#endif + /* INTERNAL: Allocate stdio file buffer */ static BOOL msvcrt_alloc_buffer(FILE* file) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index a62705bc8f4..e86ee97f716 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -72,6 +72,16 @@ void msvcrt_init_math( void *module ) sse2_supported = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ); #if _MSVCR_VER <=71 sse2_enabled = FALSE; + { + char sgi[64]; + + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) + && (!strcmp(sgi, "560430") || !strcmp(sgi, "12330"))) + { + sse2_supported = FALSE; + FIXME("HACK: disabling sse2 support in msvcrt.\n"); + } + } #else sse2_enabled = sse2_supported; #endif diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 4ed17c940a9..8986839122e 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -55,6 +55,8 @@ static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); static struct tm* (__cdecl *p_gmtime32)(__time32_t*); static struct tm* (__cdecl *p_gmtime)(time_t*); static errno_t (__cdecl *p_gmtime32_s)(struct tm*, __time32_t*); +static struct tm* (__cdecl *p_gmtime64)(__time64_t*); +static errno_t (__cdecl *p_gmtime64_s)(struct tm*, __time64_t*); static errno_t (__cdecl *p_strtime_s)(char*,size_t); static errno_t (__cdecl *p_strdate_s)(char*,size_t); static errno_t (__cdecl *p_localtime32_s)(struct tm*, __time32_t*); @@ -76,6 +78,8 @@ static void init(void) p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); p_gmtime = (void*)GetProcAddress(hmod, "gmtime"); p_gmtime32_s = (void*)GetProcAddress(hmod, "_gmtime32_s"); + p_gmtime64 = (void*)GetProcAddress(hmod, "_gmtime64"); + p_gmtime64_s = (void*)GetProcAddress(hmod, "_gmtime64_s"); p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); p_strtime_s = (void*)GetProcAddress(hmod, "_strtime_s"); p_strdate_s = (void*)GetProcAddress(hmod, "_strdate_s"); @@ -208,6 +212,58 @@ static void test_gmtime(void) } } +static void test_gmtime64(void) +{ + struct tm *ptm, tm; + __time64_t t; + int ret; + + t = -1; + memset(&tm, 0xcc, sizeof(tm)); + ptm = p_gmtime64(&t); + ok(!!ptm, "got NULL.\n"); + ret = p_gmtime64_s(&tm, &t); + ok(!ret, "got %d.\n", ret); + ok(tm.tm_year == 69 && tm.tm_hour == 23 && tm.tm_min == 59 && tm.tm_sec == 59, "got %d, %d, %d, %d.\n", + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); + + t = -43200; + memset(&tm, 0xcc, sizeof(tm)); + ptm = p_gmtime64(&t); + ok(!!ptm, "got NULL.\n"); + ret = p_gmtime64_s(&tm, &t); + ok(!ret, "got %d.\n", ret); + ok(tm.tm_year == 69 && tm.tm_hour == 12 && tm.tm_min == 0 && tm.tm_sec == 0, "got %d, %d, %d, %d.\n", + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); + + t = -43201; + ptm = p_gmtime64(&t); + ok(!ptm, "got non-NULL.\n"); + memset(&tm, 0xcc, sizeof(tm)); + ret = p_gmtime64_s(&tm, &t); + ok(ret == EINVAL, "got %d.\n", ret); + ok(tm.tm_year == -1 && tm.tm_hour == -1 && tm.tm_min == -1 && tm.tm_sec == -1, "got %d, %d, %d, %d.\n", + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); + + t = _MAX__TIME64_T + 46800; + memset(&tm, 0xcc, sizeof(tm)); + ptm = p_gmtime64(&t); + ok(!!ptm, "got NULL.\n"); + ret = p_gmtime64_s(&tm, &t); + ok(!ret, "got %d.\n", ret); + ok(tm.tm_year == 1101 && tm.tm_hour == 20 && tm.tm_min == 59 && tm.tm_sec == 59, "got %d, %d, %d, %d.\n", + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); + + t = _MAX__TIME64_T + 46801; + ptm = p_gmtime64(&t); + ok(!ptm, "got non-NULL.\n"); + memset(&tm, 0xcc, sizeof(tm)); + ret = p_gmtime64_s(&tm, &t); + ok(ret == EINVAL, "got %d.\n", ret); + ok(tm.tm_year == -1 && tm.tm_hour == -1 && tm.tm_min == -1 && tm.tm_sec == -1, "got %d, %d, %d, %d.\n", + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); +} + static void test_mktime(void) { TIME_ZONE_INFORMATION tzinfo; @@ -963,6 +1019,7 @@ START_TEST(time) test_strftime(); test_ctime(); test_gmtime(); + test_gmtime64(); test_mktime(); test_localtime(); test_strdate(); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 56b80e84105..cddcb521502 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -35,6 +35,7 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); +WINE_DECLARE_DEBUG_CHANNEL(time); #undef _ctime32 #undef _difftime32 @@ -457,7 +458,7 @@ int CDECL _gmtime64_s(struct tm *res, const __time64_t *secs) SYSTEMTIME st; ULONGLONG time; - if (!res || !secs || *secs < 0 || *secs > _MAX__TIME64_T) { + if (!res || !secs || *secs < -43200 || *secs > _MAX__TIME64_T + 46800) { if (res) { write_invalid_msvcrt_tm(res); } @@ -497,6 +498,8 @@ struct tm* CDECL _gmtime64(const __time64_t *secs) { thread_data_t * const data = msvcrt_get_thread_data(); + TRACE_(time)("secs %p, %I64d.\n", secs, secs ? *secs : 0); + if(!data->time_buffer) data->time_buffer = malloc(sizeof(struct tm)); @@ -513,6 +516,13 @@ int CDECL _gmtime32_s(struct tm *res, const __time32_t *secs) __time64_t secs64; if(secs) { + if (*secs < 0) + { + if (res) + write_invalid_msvcrt_tm(res); + *_errno() = EINVAL; + return EINVAL; + } secs64 = *secs; return _gmtime64_s(res, &secs64); } @@ -529,6 +539,12 @@ struct tm* CDECL _gmtime32(const __time32_t* secs) if(!secs) return NULL; + if (*secs < 0) + { + *_errno() = EINVAL; + return NULL; + } + secs64 = *secs; return _gmtime64( &secs64 ); } diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index 7e59a223143..5044c4e2c79 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -1,5 +1,5 @@ MODULE = msxml3.dll -IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 +IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 rtworkq EXTRAINCL = $(XSLT_PE_CFLAGS) $(XML2_PE_CFLAGS) SOURCES = \ diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c index c2d3cd30c60..323c7b49848 100644 --- a/dlls/msxml3/factory.c +++ b/dlls/msxml3/factory.c @@ -31,6 +31,7 @@ #include "ole2.h" #include "msxml.h" #include "msxml2.h" +#include "msxml6.h" #include "xmlparser.h" /* undef the #define in msxml2 so that we can access the v.2 version @@ -278,6 +279,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create }; static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create }; +static ClassFactory httpreqcf2 = { { &ClassFactoryVtbl }, XMLHTTPRequest2_create }; static ClassFactory serverhttp = { { &ClassFactoryVtbl }, ServerXMLHTTP_create }; static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create }; static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create }; @@ -339,6 +341,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv ) { cf = &httpreqcf.IClassFactory_iface; } + else if( IsEqualCLSID( rclsid, &CLSID_FreeThreadedXMLHTTP60 )) + { + cf = &httpreqcf2.IClassFactory_iface; + } else if( IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP ) || IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP30 ) || IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP40 ) || diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index e21ece7d9c4..f63284e8577 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -37,10 +37,12 @@ #include "shlwapi.h" #include "msxml_dispex.h" +#include "initguid.h" +#include "rtworkq.h" #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(msxml); +WINE_DEFAULT_DEBUG_CHANNEL(xmlhttp); static const WCHAR colspaceW[] = {':',' ',0}; static const WCHAR crlfW[] = {'\r','\n',0}; @@ -99,6 +101,21 @@ typedef struct /* IObjectSafety */ DWORD safeopt; + + /* Properties */ + DWORD no_prompt; + DWORD no_auth; + DWORD timeout; + BOOL no_headeres; + BOOL redirect; + BOOL cache; + BOOL extended; + BOOL query_utf8; + BOOL ignore_errors; + BOOL threshold; + DWORD enterrprised_id; + DWORD max_connections; + } httprequest; typedef struct @@ -2054,6 +2071,553 @@ static const struct IServerXMLHTTPRequestVtbl ServerXMLHTTPRequestVtbl = ServerXMLHTTPRequest_setOption }; +static DWORD xhr2_work_queue; + +struct xml_http_request_2 +{ + httprequest req; + IXMLHTTPRequest3 IXMLHTTPRequest3_iface; + IRtwqAsyncCallback IRtwqAsyncCallback_iface; + IDispatch IDispatch_iface; + + IXMLHTTPRequest2Callback *callback; + IXMLHTTPRequest3Callback *callback3; + ISequentialStream *response_body; + ISequentialStream *request_body; + ULONGLONG request_body_size; +}; + +static inline struct xml_http_request_2 *impl_from_IXMLHTTPRequest3(IXMLHTTPRequest3 *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IXMLHTTPRequest3_iface); +} + +static inline struct xml_http_request_2 *xml_http_request_2_from_IRtwqAsyncCallback(IRtwqAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IRtwqAsyncCallback_iface); +} + +static inline struct xml_http_request_2 *xml_http_request_2_from_IDispatch(IDispatch *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IDispatch_iface); +} + +static HRESULT WINAPI xml_http_request_2_QueryInterface(IXMLHTTPRequest3 *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *obj = iface; + IUnknown_AddRef((IUnknown*)*obj); + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_AddRef(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + ULONG ref = InterlockedIncrement(&This->req.ref); + TRACE("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xml_http_request_2_Release(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + ULONG ref = InterlockedDecrement(&This->req.ref); + + TRACE("(%p)->(%lu)\n", This, ref); + + if (ref == 0) + { + /* do not call httprequest_put_onreadystatechange to avoid ref cycle */ + This->req.sink = NULL; + if (This->response_body) ISequentialStream_Release(This->response_body); + if (This->request_body) ISequentialStream_Release(This->request_body); + if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3); + if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback); + heap_free(This); + RtwqShutdown(); + } + + return ref; +} + +static HRESULT WINAPI xml_http_request_2_Open(IXMLHTTPRequest3 *iface, const WCHAR *method, + const WCHAR *url, IXMLHTTPRequest2Callback *callback, + const WCHAR *username, const WCHAR *password, + const WCHAR *proxy_username, const WCHAR *proxy_password) +{ + static const WCHAR accept_encoding[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',0}; + static const WCHAR empty = 0; + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + VARIANT async_v, username_v, password_v; + HRESULT hr; + + TRACE("(%p)->(%s %s %p %s %s %s %s)\n", This, debugstr_w(method), debugstr_w(url), callback, + debugstr_w(username), debugstr_w(password), debugstr_w(proxy_username), debugstr_w(proxy_password)); + + if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback); + if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3); + IXMLHTTPRequest2Callback_AddRef(callback); + This->callback = callback; + if (FAILED(IXMLHTTPRequest2Callback_QueryInterface(callback, &IID_IXMLHTTPRequest3Callback, (void **)&This->callback3))) + This->callback3 = NULL; + + if (proxy_username || proxy_password) FIXME("proxy credentials not implemented\n"); + + VariantInit(&async_v); + V_VT(&async_v) = VT_BOOL; + V_BOOL(&async_v) = FALSE; /* FIXME: TRUE needs a RTWQ_WINDOW_WORKQUEUE */ + + VariantInit(&username_v); + V_VT(&username_v) = VT_BSTR; + if (username) V_BSTR(&username_v) = SysAllocString(username); + else V_BSTR(&username_v) = SysAllocString(&empty); + + VariantInit(&password_v); + V_VT(&password_v) = VT_BSTR; + if (password) V_BSTR(&password_v) = SysAllocString(password); + else V_BSTR(&password_v) = SysAllocString(&empty); + + if (FAILED(hr = httprequest_open(&This->req, (BSTR)method, (BSTR)url, async_v, username_v, password_v))) + return hr; + return httprequest_setRequestHeader(&This->req, (BSTR)accept_encoding, (BSTR)&empty); +} + +static HRESULT WINAPI xml_http_request_2_Send(IXMLHTTPRequest3 *iface, ISequentialStream *body, ULONGLONG body_size) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + IRtwqAsyncResult *result; + HRESULT hr; + + TRACE("(%p)->(%p %s)\n", This, body, wine_dbgstr_longlong( body_size )); + + if (body_size) + { + ISequentialStream_AddRef(body); + This->request_body = body; + This->request_body_size = body_size; + } + + if (FAILED(hr = RtwqCreateAsyncResult(NULL, &This->IRtwqAsyncCallback_iface, NULL, &result))) + return hr; + // IRtwqAsyncCallback_Invoke(&This->IRtwqAsyncCallback_iface, result); + hr = RtwqPutWorkItem(xhr2_work_queue, 0, result); + if (result) IRtwqAsyncResult_Release(result); + + return hr; +} + +static HRESULT WINAPI xml_http_request_2_Abort(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + TRACE("(%p) stub!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetCookie(IXMLHTTPRequest3 *iface, const XHR_COOKIE *cookie, DWORD *state) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p %p) stub!\n", This, cookie, state); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetCustomResponseStream(IXMLHTTPRequest3 *iface, ISequentialStream *stream) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p) stub!\n", This, stream); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetProperty(IXMLHTTPRequest3 *iface, XHR_PROPERTY property, ULONGLONG value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + + TRACE("(%p)->(%#x %s) stub!\n", This, property, wine_dbgstr_longlong( value )); + + switch (property) + { + case XHR_PROP_NO_CRED_PROMPT: + This->req.no_prompt = value; + break; + case XHR_PROP_NO_AUTH: + This->req.no_auth = value; + break; + case XHR_PROP_TIMEOUT: + This->req.timeout = value; + break; + case XHR_PROP_NO_DEFAULT_HEADERS: + This->req.no_headeres = value != 0; + break; + case XHR_PROP_REPORT_REDIRECT_STATUS: + This->req.redirect = value != 0; + break; + case XHR_PROP_NO_CACHE: + This->req.cache = value != 0; + break; + case XHR_PROP_EXTENDED_ERROR: + This->req.extended = value != 0; + break; + case XHR_PROP_QUERY_STRING_UTF8: + This->req.query_utf8 = value != 0; + break; + case XHR_PROP_IGNORE_CERT_ERRORS: + This->req.ignore_errors = value != 0; + break; + case XHR_PROP_ONDATA_THRESHOLD: + This->req.threshold = value; + break; + case XHR_PROP_SET_ENTERPRISEID: + This->req.enterrprised_id = value; + break; + case XHR_PROP_MAX_CONNECTIONS: + This->req.max_connections = value; + break; + default: + WARN("Invalid property %#x\n", property); + return E_INVALIDARG; + } + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_SetRequestHeader(IXMLHTTPRequest3 *iface, + const WCHAR *header, const WCHAR *value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + TRACE("(%p)->(%s %s)\n", This, debugstr_w(header), debugstr_w(value)); + return httprequest_setRequestHeader(&This->req, (BSTR)header, (BSTR)value); +} + +static HRESULT WINAPI xml_http_request_2_GetAllResponseHeaders(IXMLHTTPRequest3 *iface, WCHAR **headers) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p) stub!\n", This, headers); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_GetCookie(IXMLHTTPRequest3 *iface, const WCHAR *url, + const WCHAR *name, DWORD flags, + ULONG *cookies_count, XHR_COOKIE **cookies) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%s %s %ld %p %p) stub!\n", This, debugstr_w(url), debugstr_w(name), flags, cookies_count, cookies); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_GetResponseHeader(IXMLHTTPRequest3 *iface, + const WCHAR *header, WCHAR **value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + HRESULT hr; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(header), value); + + hr = httprequest_getResponseHeader(&This->req, (BSTR)header, value); + +#define E_FILE_NOT_FOUND _HRESULT_TYPEDEF_(0x80070002) + + if (hr == S_FALSE) + { + *value = NULL; + return E_FILE_NOT_FOUND; + } + + return hr; +} + +static HRESULT WINAPI xml_http_request_3_SetClientCertificate(IXMLHTTPRequest3 *iface, DWORD count, const BYTE *hashes, const WCHAR *pin) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%ld %p %s) stub!\n", This, count, hashes, debugstr_w(pin)); + return E_NOTIMPL; +} + +static const struct IXMLHTTPRequest3Vtbl XMLHTTPRequest3Vtbl = { + /* IUnknown methods */ + xml_http_request_2_QueryInterface, + xml_http_request_2_AddRef, + xml_http_request_2_Release, + /* IXMLHTTPRequest2 methods */ + xml_http_request_2_Open, + xml_http_request_2_Send, + xml_http_request_2_Abort, + xml_http_request_2_SetCookie, + xml_http_request_2_SetCustomResponseStream, + xml_http_request_2_SetProperty, + xml_http_request_2_SetRequestHeader, + xml_http_request_2_GetAllResponseHeaders, + xml_http_request_2_GetCookie, + xml_http_request_2_GetResponseHeader, + /* IXMLHTTPRequest3 methods */ + xml_http_request_3_SetClientCertificate, +}; + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_QueryInterface(IRtwqAsyncCallback *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IRtwqAsyncCallback) || IsEqualGUID(riid, &IID_IUnknown)) + { + IRtwqAsyncCallback_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_AddRef(IRtwqAsyncCallback *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface); +} + +static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_Release(IRtwqAsyncCallback *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface); +} + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_GetParameters(IRtwqAsyncCallback *iface, + DWORD *flags, DWORD *queue) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + + TRACE("(%p)->(%p %p)\n", This, flags, queue); + + *flags = 0; + *queue = xhr2_work_queue; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCallback *iface, + IRtwqAsyncResult *result) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + IStream *stream = NULL; + SAFEARRAY *sa = NULL; + VARIANT body_v; + HRESULT hr; + ULONG read; + + TRACE("(%p)->(%p)\n", This, result); + + VariantInit(&body_v); + + if (This->request_body) + { + SAFEARRAYBOUND bound; + ULONGLONG body_size; + STATSTG stream_stat; + LARGE_INTEGER li; + void *ptr; + + if (SUCCEEDED(ISequentialStream_QueryInterface(This->request_body, &IID_IStream, (void **)&stream)) + && SUCCEEDED(IStream_Stat(stream, &stream_stat, 0))) + { + body_size = stream_stat.cbSize.QuadPart; + li.QuadPart = 0; + IStream_Seek(stream, li, STREAM_SEEK_SET, NULL); + } + else + { + body_size = This->request_body_size; + } + + TRACE("body_size %I64u.\n", body_size); + + bound.lLbound = 0; + bound.cElements = body_size; + if (!(sa = SafeArrayCreate(VT_UI1, 1, &bound))) + { + ERR("No memory.\n"); + hr = E_OUTOFMEMORY; + goto done; + } + V_ARRAY(&body_v) = sa; + V_VT(&body_v) = VT_ARRAY | VT_UI1; + SafeArrayAccessData(sa, &ptr); + + if (stream) + hr = IStream_Read(stream, ptr, body_size, &read); + else + hr = ISequentialStream_Read(This->request_body, ptr, body_size, &read); + SafeArrayUnaccessData(sa); + if (FAILED(hr) || read < body_size) + { + /* Windows doesn't send the body in this case but still sends request with Content-Length + * set to requested body size. */ + ERR("Failed to read from stream, hr %#lx, read %lu\n", hr, read); + SafeArrayDestroy(sa); + sa = NULL; + V_VT(&body_v) = VT_NULL; + } + + ISequentialStream_Release(This->request_body); + This->request_body = NULL; + } + + hr = httprequest_send(&This->req, body_v); + +done: + if (sa) + SafeArrayDestroy(sa); + if (stream) + IStream_Release(stream); + return IRtwqAsyncResult_SetStatus(result, hr); +} + +static const struct IRtwqAsyncCallbackVtbl xml_http_request_2_IRtwqAsyncCallbackVtbl = { + /* IUnknown methods */ + xml_http_request_2_IRtwqAsyncCallback_QueryInterface, + xml_http_request_2_IRtwqAsyncCallback_AddRef, + xml_http_request_2_IRtwqAsyncCallback_Release, + /* IRtwqAsyncCallback methods */ + xml_http_request_2_IRtwqAsyncCallback_GetParameters, + xml_http_request_2_IRtwqAsyncCallback_Invoke, +}; + +static HRESULT WINAPI xml_http_request_2_IDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IDispatch) || IsEqualGUID(riid, &IID_IUnknown)) + { + IDispatch_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_IDispatch_AddRef(IDispatch *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface); +} + +static ULONG WINAPI xml_http_request_2_IDispatch_Release(IDispatch *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface); +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfoCount(IDispatch *iface, UINT *value) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%p) stub!\n", This, value); + *value = 0; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfo(IDispatch *iface, UINT index, + LCID lcid, ITypeInfo **value) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%d %lu %p) stub!\n", This, index, lcid, value); + *value = NULL; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, + OLECHAR **names, UINT names_count, + LCID lcid, DISPID *disp_ids) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%s %p %d %lu %p) stub!\n", This, debugstr_guid(riid), names, names_count, lcid, disp_ids); + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid, + LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *result, EXCEPINFO *exception, UINT *arg_err) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + IXMLHTTPRequest2 *xhr2_iface = (IXMLHTTPRequest2*)&This->IXMLHTTPRequest3_iface; + HRESULT hr; + LONG status; + BSTR status_str = NULL; + + TRACE("(%p)->(%ld %s %lu %d %p %p %p %p) stub!\n", This, id, debugstr_guid(riid), lcid, flags, + params, result, exception, arg_err); + + if (This->req.state == READYSTATE_COMPLETE) + { + VARIANT body_v; + VariantInit(&body_v); + + IXMLHTTPRequest2Callback_AddRef(This->callback); + if (This->callback3) + { + IXMLHTTPRequest3Callback_AddRef(This->callback3); + IXMLHTTPRequest3Callback_OnServerCertificateReceived(This->callback3, (IXMLHTTPRequest3 *)xhr2_iface, 0, 1, NULL); + IXMLHTTPRequest3Callback_Release(This->callback3); + } + + if (FAILED(hr = httprequest_get_status(&This->req, &status)) || + FAILED(hr = httprequest_get_statusText(&This->req, &status_str))) + { + WARN("failed to get response status, error %#lx\n", hr); + IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr); + IXMLHTTPRequest2Callback_Release(This->callback); + return S_OK; + } + + IXMLHTTPRequest2Callback_OnHeadersAvailable(This->callback, xhr2_iface, status, status_str); + SysFreeString(status_str); + + if (This->response_body) ISequentialStream_Release(This->response_body); + This->response_body = NULL; + + if (FAILED(hr = httprequest_get_responseStream(&This->req, &body_v)) || + FAILED(hr = IUnknown_QueryInterface(V_UNKNOWN(&body_v), &IID_ISequentialStream, (void **)&This->response_body))) + { + WARN("failed to get response stream, error %#lx\n", hr); + IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr); + IXMLHTTPRequest2Callback_Release(This->callback); + return S_OK; + } + + IXMLHTTPRequest2Callback_OnDataAvailable(This->callback, xhr2_iface, This->response_body); + IXMLHTTPRequest2Callback_OnResponseReceived(This->callback, xhr2_iface, This->response_body); + IXMLHTTPRequest2Callback_Release(This->callback); + } + + return S_OK; +} + +static const struct IDispatchVtbl xml_http_request_2_IDispatchVtbl = { + /* IUnknown methods */ + xml_http_request_2_IDispatch_QueryInterface, + xml_http_request_2_IDispatch_AddRef, + xml_http_request_2_IDispatch_Release, + /* IDispatch methods */ + xml_http_request_2_IDispatch_GetTypeInfoCount, + xml_http_request_2_IDispatch_GetTypeInfo, + xml_http_request_2_IDispatch_GetIDsOfNames, + xml_http_request_2_IDispatch_Invoke, +}; + static void init_httprequest(httprequest *req) { req->IXMLHTTPRequest_iface.lpVtbl = &XMLHTTPRequestVtbl; @@ -2083,6 +2647,20 @@ static void init_httprequest(httprequest *req) req->site = NULL; req->safeopt = 0; + + /* Properties */ + req->no_prompt = XHR_CRED_PROMPT_ALL; + req->no_auth = XHR_AUTH_ALL; + req->timeout = 0xFFFFFFFF; + req->no_headeres = FALSE; + req->redirect = FALSE; + req->cache = FALSE; + req->extended = FALSE; + req->query_utf8 = FALSE;; + req->ignore_errors = FALSE;; + req->threshold = 0x100; + req->enterrprised_id = 0; + req->max_connections = 10; } HRESULT XMLHTTPRequest_create(void **obj) @@ -2103,6 +2681,35 @@ HRESULT XMLHTTPRequest_create(void **obj) return S_OK; } +HRESULT XMLHTTPRequest2_create(void **obj) +{ + struct xml_http_request_2 *xhr2; + TRACE("(%p)\n", obj); + + if (!(xhr2 = heap_alloc(sizeof(*xhr2)))) return E_OUTOFMEMORY; + + init_httprequest(&xhr2->req); + xhr2->IXMLHTTPRequest3_iface.lpVtbl = &XMLHTTPRequest3Vtbl; + xhr2->IRtwqAsyncCallback_iface.lpVtbl = &xml_http_request_2_IRtwqAsyncCallbackVtbl; + xhr2->IDispatch_iface.lpVtbl = &xml_http_request_2_IDispatchVtbl; + + /* do not call httprequest_put_onreadystatechange to avoid ref cycle */ + xhr2->req.sink = &xhr2->IDispatch_iface; + + xhr2->callback = NULL; + xhr2->callback3 = NULL; + xhr2->request_body = NULL; + xhr2->response_body = NULL; + + /* for async http requests we need window message queue */ + RtwqStartup(); + if (!xhr2_work_queue) RtwqAllocateWorkQueue(RTWQ_MULTITHREADED_WORKQUEUE, &xhr2_work_queue); + + *obj = &xhr2->IXMLHTTPRequest3_iface; + TRACE("returning iface %p\n", *obj); + return S_OK; +} + HRESULT ServerXMLHTTP_create(void **obj) { serverhttp *req; diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 449a86df5e8..3e5181fa6d8 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -344,6 +344,7 @@ extern HRESULT XMLDocument_create(void**); extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**); extern HRESULT SAXAttributes_create(MSXML_VERSION, void**); extern HRESULT XMLHTTPRequest_create(void **); +extern HRESULT XMLHTTPRequest2_create(void **); extern HRESULT ServerXMLHTTP_create(void **); extern HRESULT XSLTemplate_create(void**); extern HRESULT MXWriter_create(MSXML_VERSION, void**); diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c index bccfbaf582a..23d7680d196 100644 --- a/dlls/msxml3/tests/httpreq.c +++ b/dlls/msxml3/tests/httpreq.c @@ -26,9 +26,9 @@ #include #include "windows.h" - #include "msxml2.h" -#include "msxml2did.h" +#include "msxml6.h" +#include "msxml6did.h" #include "dispex.h" #include "initguid.h" @@ -1344,6 +1344,17 @@ static IXMLHttpRequest *create_xhr(void) return SUCCEEDED(hr) ? ret : NULL; } +static IXMLHTTPRequest2 *create_xhr2(void) +{ + IXMLHTTPRequest2 *ret; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_FreeThreadedXMLHTTP60, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLHTTPRequest2, (void**)&ret); + + return SUCCEEDED(hr) ? ret : NULL; +} + static IServerXMLHTTPRequest *create_server_xhr(void) { IServerXMLHTTPRequest *ret; @@ -1904,11 +1915,388 @@ static void test_supporterrorinfo(void) IServerXMLHTTPRequest_Release(server_xhr); } +struct xhr3_callback +{ + IXMLHTTPRequest3Callback IXMLHTTPRequest3Callback_iface; + LONG ref; + HANDLE event; +}; + +static inline struct xhr3_callback *xhr3_callback_from_IXMLHTTPRequest3Callback(IXMLHTTPRequest3Callback *iface) +{ + return CONTAINING_RECORD(iface, struct xhr3_callback, IXMLHTTPRequest3Callback_iface); +} + +static HRESULT WINAPI xhr3_callback_QueryInterface(IXMLHTTPRequest3Callback *iface, REFIID riid, void **obj) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3Callback) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2Callback) || IsEqualGUID(riid, &IID_IUnknown)) + { + IXMLHTTPRequest3Callback_AddRef(iface); + *obj = iface; + return S_OK; + } + + ok(0, "unexpected interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI xhr3_callback_AddRef(IXMLHTTPRequest3Callback *iface) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + ULONG ref = InterlockedIncrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xhr3_callback_Release(IXMLHTTPRequest3Callback *iface) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + ULONG ref = InterlockedDecrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + if (ref == 0) HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI xhr3_callback_OnRedirect(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, const WCHAR* redirect_url) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %s)\n", This, request, debugstr_w(redirect_url)); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnHeadersAvailable(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, DWORD status, const WCHAR *status_str) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + WCHAR *header = NULL; + HRESULT hr; + + trace("(%p)->(%p %lu %s)\n", This, request, status, debugstr_w(status_str)); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Length", &header); + trace("Content-Length: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnDataAvailable(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, ISequentialStream *response) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %p)\n", This, request, response); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnResponseReceived(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, ISequentialStream *response) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + WCHAR *header = NULL; + char *buffer = HeapAlloc( GetProcessHeap(), 0, 256 ); + ULONG read_size = 0; + HRESULT hr; + + memset(buffer, '?', 256); + buffer[255] = 0; + + trace("(%p)->(%p %p)\n", This, request, response); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Cache-Control", &header); + trace("Cache-Control: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Expires", &header); + trace("Expires: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Type", &header); + trace("Content-Type: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + read_size = 0xdeadbeef; + hr = ISequentialStream_Read(response, buffer, 214, &read_size); + trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr); + + read_size = 0xdeadbeef; + hr = ISequentialStream_Read(response, buffer, 1, &read_size); + trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr); + + HeapFree( GetProcessHeap(), 0, buffer ); + SetEvent(This->event); + + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnError(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, HRESULT error) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %#lx)\n", This, request, error); + SetEvent(This->event); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnServerCertificateReceived(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest3 *request, DWORD errors, DWORD chain_size, const XHR_CERT *chain) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %lu %lu %p)\n", This, request, errors, chain_size, chain); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnClientCertificateRequested(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest3 *request, DWORD issuers_size, const WCHAR **issuers) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %lu %p)\n", This, request, issuers_size, issuers); + return S_OK; +} + +static const IXMLHTTPRequest3CallbackVtbl xhr3_callback_vtbl = +{ + xhr3_callback_QueryInterface, + xhr3_callback_AddRef, + xhr3_callback_Release, + /* IXMLHTTPRequest2Callback methods */ + xhr3_callback_OnRedirect, + xhr3_callback_OnHeadersAvailable, + xhr3_callback_OnDataAvailable, + xhr3_callback_OnResponseReceived, + xhr3_callback_OnError, + /* IXMLHTTPRequest3Callback methods */ + xhr3_callback_OnServerCertificateReceived, + xhr3_callback_OnClientCertificateRequested, +}; + +static IXMLHTTPRequest2Callback* xhr3_callback_create(HANDLE event) +{ + struct xhr3_callback *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + ok(This != NULL, "failed to allocate object\n"); + if (!This) return NULL; + + This->IXMLHTTPRequest3Callback_iface.lpVtbl = &xhr3_callback_vtbl; + This->ref = 1; + This->event = event; + + return (IXMLHTTPRequest2Callback*)&This->IXMLHTTPRequest3Callback_iface; +} + +struct xhr2_stream +{ + IStream IStream_iface; + LONG ref; + IStream *stream; +}; + +static inline struct xhr2_stream *xhr2_stream_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct xhr2_stream, IStream_iface); +} + +static HRESULT WINAPI xhr2_stream_QueryInterface(IStream *iface, REFIID riid, void **obj) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_ISequentialStream) || IsEqualGUID(riid, &IID_IUnknown)) + { + IStream_AddRef(iface); + *obj = iface; + return S_OK; + } + + ok(0, "unexpected interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI xhr2_stream_AddRef(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + ULONG ref = InterlockedIncrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xhr2_stream_Release(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + if (ref == 0) + { + IStream_Release(This->stream); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static HRESULT WINAPI xhr2_stream_Read(IStream *iface, void *pv, ULONG cb, + ULONG *pcbRead) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbRead); + return IStream_Read(This->stream, pv, cb, pcbRead); +} + +static HRESULT WINAPI xhr2_stream_Write(IStream *iface, const void *pv, + ULONG cb, ULONG *pcbWritten) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbWritten); + return IStream_Write(This->stream, pv, cb, pcbWritten); +} + +static HRESULT WINAPI xhr2_stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, + DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u, %lu %p)\n", This, dlibMove.QuadPart, dwOrigin, plibNewPosition); + return IStream_Seek(This->stream, dlibMove, dwOrigin, plibNewPosition); +} + +static HRESULT WINAPI xhr2_stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u)\n", This, libNewSize.QuadPart); + return IStream_SetSize(This->stream, libNewSize); +} + +static HRESULT WINAPI xhr2_stream_CopyTo(IStream *iface, IStream *pstm, + ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %I64u %p %p)\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten); + return IStream_CopyTo(This->stream, pstm, cb, pcbRead, pcbWritten); +} + +static HRESULT WINAPI xhr2_stream_Commit(IStream *iface, DWORD grfCommitFlags) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%#lx)\n", This, grfCommitFlags); + return IStream_Commit(This->stream, grfCommitFlags); +} + +static HRESULT WINAPI xhr2_stream_Revert(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->()\n", This); + return IStream_Revert(This->stream); +} + +static HRESULT WINAPI xhr2_stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); + return IStream_LockRegion(This->stream, libOffset, cb, dwLockType); +} + +static HRESULT WINAPI xhr2_stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); + return IStream_UnlockRegion(This->stream, libOffset, cb, dwLockType); +} + +static HRESULT WINAPI xhr2_stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %#lx)\n", This, pstatstg, grfStatFlag); + return IStream_Stat(This->stream, pstatstg, grfStatFlag); +} + +static HRESULT WINAPI xhr2_stream_Clone(IStream *iface, IStream **ppstm) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p)\n", This, ppstm); + return IStream_Clone(This->stream, ppstm); +} + +static const IStreamVtbl xhr2_stream_vtbl = +{ + xhr2_stream_QueryInterface, + xhr2_stream_AddRef, + xhr2_stream_Release, + /* IStream methods */ + xhr2_stream_Read, + xhr2_stream_Write, + xhr2_stream_Seek, + xhr2_stream_SetSize, + xhr2_stream_CopyTo, + xhr2_stream_Commit, + xhr2_stream_Revert, + xhr2_stream_LockRegion, + xhr2_stream_UnlockRegion, + xhr2_stream_Stat, + xhr2_stream_Clone +}; + +static ISequentialStream *xhr2_stream_create(void) +{ + struct xhr2_stream *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + ok(This != NULL, "failed to allocate object\n"); + if (!This) return NULL; + + This->IStream_iface.lpVtbl = &xhr2_stream_vtbl; + This->ref = 1; + CreateStreamOnHGlobal(NULL, TRUE, &This->stream); + + return (ISequentialStream*)&This->IStream_iface; +} + +static void test_IXMLHTTPRequest2(void) +{ + IXMLHTTPRequest2 *xhr2[16]; + IXMLHTTPRequest2Callback *xhr3_callback; + ISequentialStream *stream; + HANDLE events[16]; + HRESULT hr; + int i = 0; + + if (!(xhr2[i] = create_xhr2())) + { + win_skip("IXMLHTTPRequest2 is not available\n"); + return; + } + + events[i] = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!(xhr3_callback = xhr3_callback_create(events[i]))) + return; + + trace("%lu: IXMLHTTPRequest2_Open (%p)->(L\"GET\", L\"http://test.winehq.org/\", xhr3_callback, NULL, NULL, NULL, NULL)\n", GetCurrentThreadId(), xhr2[i]); + hr = IXMLHTTPRequest2_Open(xhr2[i], L"GET", L"http://test.winehq.org/", xhr3_callback, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr); + + if ((stream = xhr2_stream_create())) + { + trace("%lu: IXMLHTTPRequest2_Send (%p)->(%p 0)\n", GetCurrentThreadId(), xhr2[i], stream); + hr = IXMLHTTPRequest2_Send(xhr2[i], stream, 0); + ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr); + + ISequentialStream_Release(stream); + } + + IXMLHTTPRequest2Callback_Release(xhr3_callback); + i++; + + while (i--) + { + WaitForSingleObject(events[i], INFINITE); + IXMLHTTPRequest2_Release(xhr2[i]); + } +} + START_TEST(httpreq) { IXMLHttpRequest *xhr; - CoInitialize(NULL); + CoInitializeEx(NULL, COINIT_MULTITHREADED); if (!(xhr = create_xhr())) { @@ -1923,6 +2311,7 @@ START_TEST(httpreq) test_server_xhr(); test_safe_httpreq(); test_supporterrorinfo(); + test_IXMLHTTPRequest2(); CoUninitialize(); } diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index e123d4eba5a..48cfa8f5593 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -29,6 +29,7 @@ #include "windows.h" #include "ole2.h" #include "msxml2.h" +#include "msxml6.h" #include "msxml2did.h" #include "ocidl.h" #include "dispex.h" diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c index efc3a8e56e3..fd244ee2e1c 100644 --- a/dlls/msxml3/tests/schema.c +++ b/dlls/msxml3/tests/schema.c @@ -32,6 +32,17 @@ #include "dispex.h" #include "cguid.h" +DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04); +DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c); +DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62); +DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb); + #include "wine/test.h" #define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c index 4abbe5e4763..1b4f0452c5f 100644 --- a/dlls/msxml3/uuid.c +++ b/dlls/msxml3/uuid.c @@ -41,6 +41,22 @@ #include "initguid.h" #include "msxml2.h" +/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */ +DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04); +DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c); +DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62); +DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb); + /* * Note that because of a #define in msxml2.h, we end up initializing * CLSID_DOMDocument2 to be the v.3 version independent DOMDocument diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index 8a720382bef..3511f8f2d3f 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -128,7 +128,9 @@ static SECURITY_STATUS set_object_property(struct object *object, const WCHAR *n static struct object *create_key_object(enum algid algid, NCRYPT_PROV_HANDLE provider) { + NCRYPT_SUPPORTED_LENGTHS supported_lengths = {512, 16384, 8, 1024}; struct object *object; + DWORD dw_value; switch (algid) { @@ -136,8 +138,16 @@ static struct object *create_key_object(enum algid algid, NCRYPT_PROV_HANDLE pro if (!(object = allocate_object(KEY))) return NULL; object->key.algid = RSA; + set_object_property(object, NCRYPT_ALGORITHM_PROPERTY, (BYTE *)BCRYPT_RSA_ALGORITHM, + sizeof(BCRYPT_RSA_ALGORITHM)); set_object_property(object, NCRYPT_ALGORITHM_GROUP_PROPERTY, (BYTE *)BCRYPT_RSA_ALGORITHM, sizeof(BCRYPT_RSA_ALGORITHM)); + set_object_property(object, NCRYPT_LENGTHS_PROPERTY, (BYTE *)&supported_lengths, + sizeof(supported_lengths)); + dw_value = 128; + set_object_property(object, NCRYPT_BLOCK_LENGTH_PROPERTY, (BYTE *)&dw_value, sizeof(dw_value)); + dw_value = 128; + set_object_property(object, BCRYPT_SIGNATURE_LENGTH, (BYTE *)&dw_value, sizeof(dw_value)); break; default: @@ -145,6 +155,12 @@ static struct object *create_key_object(enum algid algid, NCRYPT_PROV_HANDLE pro return NULL; } + dw_value = 0; + set_object_property(object, NCRYPT_EXPORT_POLICY_PROPERTY, (BYTE *)&dw_value, sizeof(dw_value)); + dw_value = NCRYPT_ALLOW_ALL_USAGES; + set_object_property(object, NCRYPT_KEY_USAGE_PROPERTY, (BYTE *)&dw_value, sizeof(dw_value)); + dw_value = 0; + set_object_property(object, NCRYPT_KEY_TYPE_PROPERTY, (BYTE *)&dw_value, sizeof(dw_value)); set_object_property(object, NCRYPT_PROVIDER_HANDLE_PROPERTY, (BYTE *)&provider, sizeof(provider)); return object; } @@ -181,6 +197,7 @@ SECURITY_STATUS WINAPI NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE provider, NCR } set_object_property(object, NCRYPT_LENGTH_PROPERTY, (BYTE *)&default_bitlen, sizeof(default_bitlen)); + set_object_property(object, BCRYPT_PUBLIC_KEY_LENGTH, (BYTE *)&default_bitlen, sizeof(default_bitlen)); } else { @@ -401,6 +418,7 @@ SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE provider, NCRYPT_KEY_H } set_object_property(object, NCRYPT_LENGTH_PROPERTY, (BYTE *)&rsablob->BitLength, sizeof(rsablob->BitLength)); + set_object_property(object, BCRYPT_PUBLIC_KEY_LENGTH, (BYTE *)&rsablob->BitLength, sizeof(rsablob->BitLength)); break; } default: diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index bd2f63bea87..5f32f62bbf7 100644 --- a/dlls/ncrypt/tests/ncrypt.c +++ b/dlls/ncrypt/tests/ncrypt.c @@ -40,6 +40,85 @@ static UCHAR rsa_key_blob[] = { 0x44, 0x81, 0x09, 0x41, 0x80, 0x23, 0x7b, 0xf6, 0x3f, 0xaf, 0x91, 0xa1, 0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd}; +static UCHAR rsa_private_key_blob[] = { + 0x52, 0x53, 0x41, 0x32, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x01, 0xaf, 0xc0, 0x68, 0x21, 0x76, 0xd7, 0x46, 0xf8, 0x23, + 0x78, 0x94, 0x22, 0xa3, 0x0f, 0x4e, 0xe8, 0xc6, 0x6a, 0x33, 0xdc, 0xbf, + 0x44, 0x6c, 0xb6, 0x95, 0x17, 0x78, 0x1e, 0x75, 0xca, 0xdc, 0x66, 0xe4, + 0x87, 0xbe, 0x91, 0xbf, 0xb3, 0xc0, 0xa5, 0x16, 0xa1, 0xb7, 0xfe, 0x4c, + 0x67, 0xaa, 0x03, 0x38, 0xe7, 0x13, 0x65, 0xfb, 0xb6, 0x4c, 0x52, 0x29, + 0xa4, 0xc4, 0x92, 0x34, 0xcd, 0x81, 0xa5, 0x0b, 0x7f, 0x5f, 0x56, 0xbf, + 0xa7, 0xf8, 0xec, 0x9a, 0xe7, 0xb3, 0x93, 0xba, 0x00, 0xe9, 0x48, 0x7a, + 0xf7, 0x04, 0x65, 0xa3, 0x14, 0x8d, 0x08, 0x78, 0xd8, 0x16, 0x5e, 0x82, + 0xeb, 0xd8, 0xea, 0x3c, 0xec, 0xcc, 0x64, 0x47, 0x97, 0x69, 0x43, 0x17, + 0x5d, 0x25, 0xd9, 0xb8, 0xdf, 0xfc, 0x80, 0x16, 0xbe, 0xbb, 0xa8, 0xe4, + 0xbf, 0x6a, 0x2f, 0xea, 0x9c, 0xe5, 0x58, 0x8a, 0xf4, 0x2b, 0xe5, 0xcf, + 0x67, 0x26, 0xe2, 0xeb, 0x92, 0x88, 0xde, 0x52, 0xee, 0x43, 0x44, 0x14, + 0x6d, 0xf7, 0x46, 0x9c, 0x87, 0xa8, 0x96, 0x85, 0xda, 0x19, 0xc3, 0x57, + 0x95, 0x09, 0x8d, 0xa2, 0x4e, 0xcd, 0x84, 0x67, 0x8e, 0x2c, 0x2d, 0x16, + 0xb0, 0xb4, 0xb4, 0x66, 0xcc, 0x7b, 0x7f, 0xaa, 0x2b, 0x14, 0x17, 0x4c, + 0x68, 0x4a, 0xa2, 0xd3, 0xfc, 0xe0, 0xb9, 0xcd, 0xa4, 0xbb, 0x44, 0x0b, + 0x84, 0xa7, 0x13, 0xd8, 0xee, 0xae, 0x8e, 0xdb, 0x0b, 0xd3, 0xc5, 0xc5, + 0x3b, 0xfd, 0x6c, 0xb0, 0x92, 0x14, 0xf0, 0x7b, 0xa7, 0x37, 0xd6, 0x21, + 0x73, 0x5d, 0x80, 0x9a, 0x49, 0x71, 0x2f, 0xc9, 0x05, 0xa5, 0x74, 0x81, + 0xc9, 0xd5, 0x2a, 0x6a, 0x7f, 0xe8, 0x8e, 0xa9, 0x7b, 0x79, 0x9e, 0x46, + 0x51, 0xe7, 0x08, 0xa1, 0x75, 0x51, 0x75, 0x7a, 0x4a, 0x43, 0x0e, 0x5b, + 0x5a, 0xb8, 0x1b, 0xa3, 0x85, 0x68, 0x27}; + +static UCHAR rsa_full_private_key_blob[] = { + 0x52, 0x53, 0x41, 0x33, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x01, 0xbb, 0x49, 0x0d, 0x3f, 0xfa, 0x15, 0x1a, 0xd7, 0xd4, + 0x7e, 0x51, 0xe7, 0x7f, 0xaf, 0xbb, 0x63, 0x8e, 0x88, 0x71, 0x8c, 0x67, + 0x91, 0xb0, 0x6b, 0xd2, 0x4f, 0x58, 0xb4, 0xd7, 0xdd, 0xcb, 0xa8, 0xc0, + 0x0c, 0xf5, 0x41, 0xfd, 0x28, 0xdf, 0xb9, 0x0d, 0x4e, 0x22, 0x24, 0x37, + 0xa5, 0xae, 0x3c, 0x9a, 0xbf, 0xae, 0x8f, 0xd9, 0xc1, 0x30, 0x87, 0x71, + 0xee, 0x5a, 0x2b, 0xfc, 0x2d, 0x5b, 0xf6, 0xe7, 0xf1, 0x69, 0xf2, 0x94, + 0x47, 0x55, 0x6e, 0xca, 0x4f, 0x66, 0xba, 0x82, 0xbb, 0x98, 0x09, 0xd0, + 0x3b, 0x8e, 0x30, 0x20, 0x0e, 0x8f, 0x44, 0xc8, 0x8d, 0xfd, 0x06, 0x65, + 0x6d, 0x7a, 0xbb, 0x0d, 0xad, 0x5c, 0x3f, 0xc5, 0x7c, 0x57, 0x0a, 0x3b, + 0x21, 0x54, 0x3e, 0xd1, 0x54, 0x07, 0x40, 0xbb, 0x85, 0x78, 0x55, 0x47, + 0x2a, 0x06, 0xbd, 0x81, 0xa7, 0x77, 0x32, 0x37, 0x56, 0x3c, 0x49, 0xf2, + 0x68, 0x32, 0x44, 0x8c, 0x6a, 0x0b, 0xfa, 0xa4, 0x66, 0xc9, 0xcc, 0x54, + 0xab, 0xb3, 0x90, 0x65, 0xce, 0x43, 0xba, 0xcd, 0xc1, 0x6a, 0x8a, 0x1b, + 0xdc, 0x16, 0x8f, 0xea, 0xf0, 0x25, 0x74, 0x6d, 0xc4, 0x84, 0x73, 0xc7, + 0xc9, 0x38, 0xa9, 0x59, 0x5b, 0xaf, 0x59, 0x9e, 0x2f, 0x56, 0x75, 0x30, + 0xc4, 0x5e, 0x80, 0x9b, 0x0b, 0x80, 0xc2, 0x5d, 0x2c, 0xb1, 0xd7, 0x65, + 0xd6, 0x7f, 0x2b, 0xc5, 0xc9, 0x92, 0x89, 0xa4, 0x83, 0x7c, 0xb2, 0x48, + 0xa2, 0x25, 0x4e, 0x8a, 0x59, 0x91, 0xbc, 0x53, 0x88, 0xa8, 0x51, 0x5d, + 0x19, 0xed, 0x5d, 0x5e, 0xde, 0x42, 0x09, 0xd7, 0x41, 0x1a, 0x3b, 0xa5, + 0xfc, 0x51, 0x7b, 0x93, 0x1e, 0x11, 0x18, 0xa0, 0x64, 0x89, 0xd5, 0x91, + 0xdf, 0x79, 0xed, 0x89, 0x49, 0x5c, 0x7d, 0x5f, 0x85, 0x54, 0x7c, 0x4d, + 0xcb, 0x8f, 0x0e, 0xbb, 0x01, 0x18, 0x5b, 0x46, 0x89, 0x27, 0x47, 0x67, + 0x0c, 0x5c, 0x9b, 0xfc, 0x46, 0xa4, 0xa5, 0xbe, 0x65, 0x90, 0x04, 0x8e, + 0x7b, 0x2c, 0x9e, 0x28, 0xcd, 0x05, 0x31, 0x56, 0xd5, 0xfe, 0x02, 0xb6, + 0xbc, 0x56, 0x49, 0xc0, 0xbf, 0x14, 0x43, 0x94, 0x78, 0xea, 0xf1, 0xec, + 0x3c, 0x8f, 0x93, 0xa6, 0x41, 0xe4, 0x08, 0x89, 0xbe, 0x3a, 0x39, 0x75, + 0xe4, 0x2c, 0xfd, 0x61, 0x9b, 0x65, 0xcc, 0x65, 0xa7, 0xba, 0xad, 0x15, + 0x46, 0xcb, 0xd6, 0xb6, 0xb5, 0xd6, 0x52, 0x2f, 0x72, 0x11, 0xe5, 0x53, + 0x08, 0xb3, 0x9e, 0xb8, 0xb5, 0xb8, 0xb5, 0x97, 0xf8, 0x54, 0x0a, 0x79, + 0x4c, 0x1b, 0x7a, 0x87, 0x87, 0x5f, 0x55, 0x0f, 0x54, 0x07, 0x47, 0xed, + 0xd9, 0x8c, 0x29, 0x44, 0x07, 0xcc, 0xb4, 0x06, 0xcf, 0x2d, 0x84, 0x9a, + 0x02, 0x24, 0x4a, 0xf0, 0x5d, 0x9d, 0x6b, 0x09, 0xcb, 0x5e, 0x06, 0x4d, + 0xa3, 0x9e, 0x85, 0x38, 0x89, 0xf4, 0x44, 0xbd, 0x4a, 0xe3, 0x2e, 0x3c, + 0x74, 0x5c, 0xad, 0xc3, 0x17, 0x6b, 0x84, 0x24, 0x94, 0xcd, 0xa1, 0x21, + 0xec, 0x0a, 0x4c, 0x66, 0x38, 0x95, 0xc1, 0x64, 0x78, 0xf5, 0x12, 0x46, + 0x58, 0x7f, 0x8a, 0x3f, 0xce, 0xda, 0x9b, 0x7e, 0xa5, 0xe4, 0xbe, 0x9c, + 0x15, 0xd4, 0xb0, 0x84, 0xf0, 0xed, 0x94, 0x37, 0x71, 0x41, 0xbe, 0x9a, + 0x02, 0x02, 0xd9, 0xc2, 0xaf, 0x44, 0x32, 0x6d, 0xcd, 0xee, 0xce, 0xcb, + 0xb9, 0x03, 0xfb, 0xf6, 0xc1, 0xf9, 0x13, 0x59, 0x71, 0x96, 0xd4, 0x50, + 0x04, 0xff, 0x4d, 0xea, 0x8b, 0x28, 0x7c, 0x8e, 0xd9, 0xa6, 0x90, 0xa0, + 0xdf, 0x91, 0x40, 0x67, 0x19, 0x31, 0xd2, 0x76, 0xb3, 0x38, 0x38, 0x2e, + 0xec, 0xd8, 0x67, 0x93, 0x98, 0xb8, 0x07, 0x20, 0x53, 0xb1, 0xec, 0xf5, + 0x26, 0xa7, 0x65, 0x42, 0x0f, 0x15, 0x1f, 0x24, 0xc3, 0x13, 0x5f, 0x35, + 0x97, 0x8f, 0x23, 0x3e, 0x7c, 0xaf, 0xe8, 0x19, 0xeb, 0xee, 0xc6, 0xd2, + 0x1d, 0x5b, 0x75, 0x31, 0xae, 0xea, 0xc1, 0x5a, 0x49, 0xa4, 0xf4, 0x37, + 0x65, 0x16, 0xc9, 0xfb, 0x0a, 0x9d, 0x33, 0x5a, 0x44, 0xaa, 0x9b, 0x0b, + 0x62, 0x48, 0x5f, 0x4c, 0xb5, 0xba, 0x3f, 0xf7, 0xb5, 0xb4, 0xed, 0x84, + 0xbe, 0xc7, 0x6c, 0x1f, 0xa4, 0xd1, 0xb8, 0x23, 0xf6, 0xa6, 0x47, 0x06, + 0x09, 0x4a, 0x61}; + static UCHAR rsa_key_blob_with_invalid_bit_length[] = { 0x52, 0x53, 0x41, 0x31, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -86,6 +165,136 @@ static UCHAR invalid_rsa_key_blob[] = { 0x44, 0x81, 0x09, 0x41, 0x80, 0x23, 0x7b, 0xf6, 0x3f, 0xaf, 0x91, 0xa1, 0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd}; +struct expected_property +{ + const WCHAR *name; + BYTE expected_data[64]; + DWORD expected_size; + SECURITY_STATUS expected_status; + BOOL todo; + SECURITY_STATUS broken_status; + BYTE broken_data[64]; +}; + +static void check_property(int line, NCRYPT_KEY_HANDLE key, const struct expected_property *property) +{ + BYTE buffer[64] = {0}; + SECURITY_STATUS ret; + unsigned int i; + DWORD size; + + winetest_push_context("%s", wine_dbgstr_w(property->name)); + + if (property->expected_status != ERROR_SUCCESS) + { + size = 0; + ret = NCryptGetProperty(key, property->name, buffer, sizeof(buffer), &size, 0); + todo_wine_if(property->todo) + ok_(__FILE__, line)(ret == property->expected_status || broken(ret == property->broken_status), + "got unexpected return value %#lx\n", ret); + if (ret == ERROR_SUCCESS) + ok_(__FILE__, line)(size == property->expected_size, "got unexpected size %lu\n", size); + + goto done; + } + + size = 0; + ret = NCryptGetProperty(key, property->name, NULL, 0, &size, 0); + todo_wine_if(property->todo) + ok_(__FILE__, line)(ret == property->expected_status || broken(ret == property->broken_status), + "got unexpected return value %#lx\n", ret); + if (ret != ERROR_SUCCESS) + goto done; + ok_(__FILE__, line)(size == property->expected_size, "got unexpected size %lu\n", size); + + size = 0; + ret = NCryptGetProperty(key, property->name, buffer, sizeof(buffer), &size, 0); + ok_(__FILE__, line)(ret == property->expected_status, "got unexpected return value %#lx\n", ret); + ok_(__FILE__, line)(size == property->expected_size, "got unexpected size %lu\n", size); + if (ret == ERROR_SUCCESS && memcmp(property->expected_data, buffer, property->expected_size) + && broken(memcmp(property->broken_data, buffer, property->expected_size))) + { + for (i = 0; i < size; i ++) + { + ok_(__FILE__, line)(0, "%#04x \n", buffer[i]); + } + } + +done: + winetest_pop_context(); +} + +#define check_properties(a, b) _check_properties(__LINE__, a, b) +static void _check_properties(int line, NCRYPT_PROV_HANDLE prov, NCRYPT_KEY_HANDLE key) +{ + struct expected_property properties[] = + { + /* NCrypt properties */ + {NCRYPT_NAME_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_UNIQUE_NAME_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_ALGORITHM_PROPERTY, {'R', 0, 'S', 0, 'A', 0}, sizeof(L"RSA"), ERROR_SUCCESS}, + {NCRYPT_LENGTH_PROPERTY, {0, 0x4} /* 1024 */, sizeof(DWORD)}, + {NCRYPT_LENGTHS_PROPERTY, {0, 0x2, 0, 0, 0, 0x40, 0, 0, 0x8, 0, 0, 0, 0, 0x4, 0, 0}, sizeof(DWORD) * 4 /* NCRYPT_SUPPORTED_LENGTHS */, ERROR_SUCCESS, FALSE, ERROR_SUCCESS, {0, 0x2, 0, 0, 0, 0x40, 0, 0, 0x40, 0, 0, 0, 0, 0x4, 0, 0}}, + {NCRYPT_BLOCK_LENGTH_PROPERTY, {0x80, 0, 0, 0}, sizeof(DWORD), ERROR_SUCCESS}, + {NCRYPT_UI_POLICY_PROPERTY, {0}, sizeof(NCRYPT_UI_POLICY), NTE_NOT_FOUND, TRUE}, + {NCRYPT_EXPORT_POLICY_PROPERTY, {0}, sizeof(DWORD), ERROR_SUCCESS}, + {NCRYPT_WINDOW_HANDLE_PROPERTY, {0}, 0, NTE_NOT_FOUND, TRUE}, + {NCRYPT_USE_CONTEXT_PROPERTY, {0}, 0, NTE_NOT_FOUND, TRUE}, + {NCRYPT_IMPL_TYPE_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_KEY_USAGE_PROPERTY, {0xff, 0xff, 0xff, 0} /* NCRYPT_ALLOW_ALL_USAGES */, sizeof(DWORD), ERROR_SUCCESS}, + {NCRYPT_KEY_TYPE_PROPERTY, {0}, sizeof(DWORD), ERROR_SUCCESS}, + {NCRYPT_VERSION_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SECURITY_DESCR_SUPPORT_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SECURITY_DESCR_PROPERTY, {0}, 0, NTE_BAD_FLAGS, TRUE}, + {NCRYPT_USE_COUNT_ENABLED_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_USE_COUNT_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_LAST_MODIFIED_PROPERTY, {0}, sizeof(FILETIME), NTE_NOT_FOUND, TRUE}, + {NCRYPT_WINDOW_HANDLE_PROPERTY, {0}, 0, NTE_NOT_FOUND, TRUE}, + {NCRYPT_MAX_NAME_LENGTH_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_ALGORITHM_GROUP_PROPERTY, {'R', 0, 'S', 0, 'A', 0}, sizeof(L"RSA")}, + {NCRYPT_PROVIDER_HANDLE_PROPERTY, {0}, sizeof(NCRYPT_PROV_HANDLE), ERROR_SUCCESS}, + {NCRYPT_PIN_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_READER_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SMARTCARD_GUID_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_CERTIFICATE_PROPERTY, {0}, 0, NTE_NOT_FOUND, TRUE, NTE_NOT_SUPPORTED /* Win 7 */}, + {NCRYPT_PIN_PROMPT_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_USER_CERTSTORE_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_ROOT_CERTSTORE_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SECURE_PIN_PROPERTY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_ASSOCIATED_ECDH_KEY, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SCARD_PIN_ID, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {NCRYPT_SCARD_PIN_INFO, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + /* BCrypt properties */ + {BCRYPT_ALGORITHM_NAME, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_AUTH_TAG_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_BLOCK_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_BLOCK_SIZE_LIST, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_CHAINING_MODE, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_EFFECTIVE_KEY_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_HASH_BLOCK_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_HASH_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_HASH_OID_LIST, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_KEY_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_KEY_LENGTHS, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_KEY_OBJECT_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_KEY_STRENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_OBJECT_LENGTH, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_PADDING_SCHEMES, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_PROVIDER_HANDLE, {0}, 0, NTE_NOT_SUPPORTED, TRUE}, + {BCRYPT_SIGNATURE_LENGTH, {0x80, 0, 0, 0} /* 128 */, sizeof(DWORD), ERROR_SUCCESS, FALSE, NTE_NOT_SUPPORTED /* <= Win 8 */}, + {BCRYPT_PUBLIC_KEY_LENGTH, {0, 0x4} /* 1024 */, sizeof(DWORD), ERROR_SUCCESS, FALSE, NTE_NOT_SUPPORTED /* <= Win 8 */}, + }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(properties); i++) + { + if (!lstrcmpW(properties[i].name, NCRYPT_PROVIDER_HANDLE_PROPERTY)) + memcpy(properties[i].expected_data, &prov, sizeof(prov)); + + check_property(line, key, &properties[i]); + } +} + static void test_key_import_rsa(void) { NCRYPT_PROV_HANDLE prov; @@ -168,39 +377,28 @@ static void test_get_property(void) NCRYPT_PROV_HANDLE prov; NCRYPT_KEY_HANDLE key; SECURITY_STATUS ret; - WCHAR value[4]; DWORD keylength, size; ret = NCryptOpenStorageProvider(&prov, NULL, 0); ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ret = NCryptImportKey(prov, 0, BCRYPT_RSAPUBLIC_BLOB, NULL, &key, rsa_key_blob, sizeof(rsa_key_blob), 0); - ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - - size = 0; - ret = NCryptGetProperty(key, NCRYPT_ALGORITHM_GROUP_PROPERTY, NULL, 0, &size, 0); - ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == 8, "got %lu\n", size); + ret = NCryptGetProperty(0, NCRYPT_LENGTH_PROPERTY, (BYTE *)&keylength, size, &size, 0); + ok(ret == NTE_INVALID_HANDLE, "got %#lx\n", ret); - size = 0; - value[0] = 0; - ret = NCryptGetProperty(key, NCRYPT_ALGORITHM_GROUP_PROPERTY, (BYTE *)value, sizeof(value), &size, 0); + ret = NCryptImportKey(prov, 0, BCRYPT_RSAPUBLIC_BLOB, NULL, &key, rsa_key_blob, sizeof(rsa_key_blob), 0); ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == 8, "got %lu\n", size); - ok(!lstrcmpW(value, L"RSA"), "The string doesn't match with 'RSA'\n"); + check_properties(prov, key); + NCryptFreeObject(key); - size = 0; - ret = NCryptGetProperty(key, NCRYPT_LENGTH_PROPERTY, NULL, 0, &size, 0); + ret = NCryptImportKey(prov, 0, BCRYPT_RSAPRIVATE_BLOB, NULL, &key, rsa_private_key_blob, sizeof(rsa_private_key_blob), 0); ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == sizeof(DWORD), "got %lu\n", size); + check_properties(prov, key); + NCryptFreeObject(key); - keylength = 0; - ret = NCryptGetProperty(key, NCRYPT_LENGTH_PROPERTY, (BYTE *)&keylength, size, &size, 0); + ret = NCryptImportKey(prov, 0, BCRYPT_RSAFULLPRIVATE_BLOB, NULL, &key, rsa_full_private_key_blob, sizeof(rsa_full_private_key_blob), 0); ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(keylength == 1024, "got %lu\n", keylength); - - ret = NCryptGetProperty(0, NCRYPT_LENGTH_PROPERTY, (BYTE *)&keylength, size, &size, 0); - ok(ret == NTE_INVALID_HANDLE, "got %#lx\n", ret); + check_properties(prov, key); + NCryptFreeObject(key); NCryptFreeObject(prov); } @@ -258,8 +456,6 @@ static void test_create_persisted_key(void) NCRYPT_PROV_HANDLE prov; NCRYPT_KEY_HANDLE key; SECURITY_STATUS ret; - DWORD size, keylength; - WCHAR alggroup[4]; ret = NCryptOpenStorageProvider(&prov, NULL, 0); ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); @@ -275,21 +471,7 @@ static void test_create_persisted_key(void) ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); ok(key, "got null handle\n"); - ret = NCryptGetProperty(key, NCRYPT_ALGORITHM_GROUP_PROPERTY, NULL, 0, &size, 0); - ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == 8, "got %lu\n", size); - - size = 0; - alggroup[0] = 0; - ret = NCryptGetProperty(key, NCRYPT_ALGORITHM_GROUP_PROPERTY, (BYTE *)alggroup, sizeof(alggroup), &size, 0); - ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == 8, "got %lu\n", size); - ok(!lstrcmpW(alggroup, L"RSA"), "The string doesn't match with 'RSA'\n"); - - ret = NCryptGetProperty(key, NCRYPT_LENGTH_PROPERTY, (BYTE *)&keylength, sizeof(keylength), &size, 0); - ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); - ok(size == 4, "got %lu\n", size); - ok(keylength == 1024, "got %lu\n", keylength); + check_properties(prov, key); NCryptFinalizeKey(key, 0); NCryptFreeObject(key); diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index fe49caa6e57..09f033ac634 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -1544,7 +1544,7 @@ struct in6_addr str_to_in6_addr(char *nptr, char **endptr) for (int i = 0; i < sizeof(ret); i++) { - if (!isxdigit( *nptr ) || !isxdigit( *nptr + 1 )) + if (!isxdigit( *nptr ) || !isxdigit( *(nptr + 1) )) { /* invalid hex string */ if (endptr) *endptr = nptr; @@ -1574,7 +1574,7 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void #ifdef __linux__ { - char buf[512], *ptr; + char buf[512], *ptr, *end; UINT rtf_flags; FILE *fp; @@ -1582,9 +1582,6 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void while ((ptr = fgets( buf, sizeof(buf), fp ))) { - while (!isspace( *ptr )) ptr++; - *ptr++ = '\0'; - entry.prefix = str_to_in6_addr( ptr, &ptr ); entry.prefix_len = strtoul( ptr + 1, &ptr, 16 ); str_to_in6_addr( ptr + 1, &ptr ); /* source network, skip */ @@ -1597,6 +1594,10 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void entry.protocol = (rtf_flags & RTF_GATEWAY) ? MIB_IPPROTO_NETMGMT : MIB_IPPROTO_LOCAL; entry.loopback = entry.protocol == MIB_IPPROTO_LOCAL && entry.prefix_len == 32; + while (isspace( *ptr )) ptr++; + end = ptr; + while (*end && !isspace(*end)) ++end; + *end = 0; if (!convert_unix_name_to_luid( ptr, &entry.luid )) continue; if (!convert_luid_to_index( &entry.luid, &entry.if_index )) continue; diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index 372272dd115..9e9bb8aaac2 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -105,6 +105,8 @@ struct if_entry static struct list if_list = LIST_INIT( if_list ); static pthread_mutex_t if_list_lock = PTHREAD_MUTEX_INITIALIZER; +static BOOL have_ethernet_iface; + static struct if_entry *find_entry_from_index( UINT index ) { struct if_entry *entry; @@ -275,7 +277,22 @@ static WCHAR *strdupAtoW( const char *str ) return ret; } -static struct if_entry *add_entry( UINT index, char *name ) +static int fake_ethernet_adapter(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *s; + if ((s = getenv( "WINE_FAKE_ETH_PRESENCE" ))) + cached = atoi( s ); + else + cached = (s = getenv( "SteamGameId" )) && !strcmp( s, "1293830" ); + } + return cached; +} + +static struct if_entry *add_entry( UINT index, const char *name ) { struct if_entry *entry; int name_len = strlen( name ); @@ -304,6 +321,10 @@ static struct if_entry *add_entry( UINT index, char *name ) memcpy( entry->if_guid.Data4 + 2, "NetDev", 6 ); list_add_tail( &if_list, &entry->entry ); + + if (entry->if_luid.Info.IfType == MIB_IF_TYPE_ETHERNET) + have_ethernet_iface = TRUE; + return entry; } @@ -311,6 +332,7 @@ static unsigned int update_if_table( void ) { struct if_nameindex *indices = if_nameindex(), *entry; unsigned int append_count = 0; + struct if_entry *if_entry; for (entry = indices; entry->if_index; entry++) { @@ -319,6 +341,14 @@ static unsigned int update_if_table( void ) } if_freenameindex( indices ); + + if (!have_ethernet_iface && fake_ethernet_adapter() && (if_entry = add_entry( 0xdeadbeef, "eth0faked" ))) + { + if_entry->if_type = if_entry->if_luid.Info.IfType = MIB_IF_TYPE_ETHERNET; + have_ethernet_iface = TRUE; + ++append_count; + } + return append_count; } diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index d3f2a0e5523..0ce1f44a34d 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -48,7 +48,9 @@ SOURCES = \ unix/cdrom.c \ unix/debug.c \ unix/env.c \ + unix/esync.c \ unix/file.c \ + unix/fsync.c \ unix/loader.c \ unix/loadorder.c \ unix/process.c \ diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 04e4ba94563..1f31629d569 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -586,7 +586,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu if (!DllPath) DllPath = &null_str; if (!CurrentDirectoryName) { - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ curdir = ((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else curdir = cur_params->CurrentDirectory.DosPath; diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 7a230237f0c..d4b5f901e10 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -797,6 +797,52 @@ static const struct context_parameters *context_get_parameters( ULONG context_fl return NULL; } +/* offset is from the start of XSAVE_AREA_HEADER. */ +static int next_compacted_xstate_offset( int off, UINT64 compaction_mask, int feature_idx ) +{ + const UINT64 feature_mask = (UINT64)1 << feature_idx; + + if (compaction_mask & feature_mask) off += user_shared_data->XState.Features[feature_idx].Size; + if (user_shared_data->XState.AlignedFeatures & (feature_mask << 1)) + off = (off + 63) & ~63; + return off; +} + +/* size includes XSAVE_AREA_HEADER but not XSAVE_FORMAT (legacy save area). */ +static int xstate_get_compacted_size( UINT64 mask ) +{ + UINT64 compaction_mask; + unsigned int i; + int off; + + compaction_mask = ((UINT64)1 << 63) | mask; + mask >>= 2; + off = sizeof(XSAVE_AREA_HEADER); + i = 2; + while (mask) + { + if (mask == 1) return off + user_shared_data->XState.Features[i].Size; + off = next_compacted_xstate_offset( off, compaction_mask, i ); + mask >>= 1; + ++i; + } + return off; +} + +static int xstate_get_size( UINT64 mask ) +{ + unsigned int i; + + mask >>= 2; + if (!mask) return sizeof(XSAVE_AREA_HEADER); + i = 2; + while (mask != 1) + { + mask >>= 1; + ++i; + } + return user_shared_data->XState.Features[i].Offset + user_shared_data->XState.Features[i].Size - sizeof(XSAVE_FORMAT); +} /********************************************************************** * RtlGetExtendedContextLength2 (NTDLL.@) @@ -822,12 +868,12 @@ NTSTATUS WINAPI RtlGetExtendedContextLength2( ULONG context_flags, ULONG *length if (!(supported_mask = RtlGetEnabledExtendedFeatures( ~(ULONG64)0) )) return STATUS_NOT_SUPPORTED; - compaction_mask &= supported_mask; - - size = p->context_size + p->context_ex_size + offsetof(XSTATE, YmmContext) + 63; + size = p->context_size + p->context_ex_size + 63; - if (compaction_mask & supported_mask & (1 << XSTATE_AVX)) - size += sizeof(YMMCONTEXT); + compaction_mask &= supported_mask & ~(ULONG64)3; + if (user_shared_data->XState.CompactionEnabled) size += xstate_get_compacted_size( compaction_mask ); + else if (compaction_mask) size += xstate_get_size( compaction_mask ); + else size += sizeof(XSAVE_AREA_HEADER); *length = size; return STATUS_SUCCESS; @@ -878,11 +924,11 @@ NTSTATUS WINAPI RtlInitializeExtendedContext2( void *context, ULONG context_flag xs = (XSTATE *)(((ULONG_PTR)c_ex + p->context_ex_size + 63) & ~(ULONG_PTR)63); c_ex->XState.Offset = (ULONG_PTR)xs - (ULONG_PTR)c_ex; - c_ex->XState.Length = offsetof(XSTATE, YmmContext); compaction_mask &= supported_mask; - if (compaction_mask & (1 << XSTATE_AVX)) - c_ex->XState.Length += sizeof(YMMCONTEXT); + if (user_shared_data->XState.CompactionEnabled) c_ex->XState.Length = xstate_get_compacted_size( compaction_mask ); + else if (compaction_mask & ~(ULONG64)3) c_ex->XState.Length = xstate_get_size( compaction_mask ); + else c_ex->XState.Length = sizeof(XSAVE_AREA_HEADER); memset( xs, 0, c_ex->XState.Length ); if (user_shared_data->XState.CompactionEnabled) @@ -916,6 +962,10 @@ NTSTATUS WINAPI RtlInitializeExtendedContext( void *context, ULONG context_flags void * WINAPI RtlLocateExtendedFeature2( CONTEXT_EX *context_ex, ULONG feature_id, XSTATE_CONFIGURATION *xstate_config, ULONG *length ) { + UINT64 feature_mask = (ULONG64)1 << feature_id; + XSAVE_AREA_HEADER *xs; + unsigned int offset, i; + TRACE( "context_ex %p, feature_id %lu, xstate_config %p, length %p.\n", context_ex, feature_id, xstate_config, length ); @@ -931,16 +981,31 @@ void * WINAPI RtlLocateExtendedFeature2( CONTEXT_EX *context_ex, ULONG feature_i return NULL; } - if (feature_id != XSTATE_AVX) + if (feature_id < 2 || feature_id >= 64) return NULL; + xs = (XSAVE_AREA_HEADER *)((BYTE *)context_ex + context_ex->XState.Offset); + if (length) - *length = sizeof(YMMCONTEXT); + *length = xstate_config->Features[feature_id].Size; + + if (xstate_config->CompactionEnabled) + { + if (!(xs->CompactionMask & feature_mask)) return NULL; + offset = sizeof(XSAVE_AREA_HEADER); + for (i = 2; i < feature_id; ++i) + offset = next_compacted_xstate_offset( offset, xs->CompactionMask, i ); + } + else + { + if (!(feature_mask & xstate_config->EnabledFeatures)) return NULL; + offset = xstate_config->Features[feature_id].Offset - sizeof(XSAVE_FORMAT); + } - if (context_ex->XState.Length < sizeof(XSTATE)) + if (context_ex->XState.Length < offset + xstate_config->Features[feature_id].Size) return NULL; - return (BYTE *)context_ex + context_ex->XState.Offset + offsetof(XSTATE, YmmContext); + return (BYTE *)xs + offset; } @@ -1070,8 +1135,9 @@ NTSTATUS WINAPI RtlCopyContext( CONTEXT *dst, DWORD context_flags, CONTEXT *src NTSTATUS WINAPI RtlCopyExtendedContext( CONTEXT_EX *dst, ULONG context_flags, CONTEXT_EX *src ) { const struct context_parameters *p; - XSTATE *dst_xs, *src_xs; + XSAVE_AREA_HEADER *dst_xs, *src_xs; ULONG64 feature_mask; + unsigned int i, off, size; TRACE( "dst %p, context_flags %#lx, src %p.\n", dst, context_flags, src ); @@ -1086,18 +1152,35 @@ NTSTATUS WINAPI RtlCopyExtendedContext( CONTEXT_EX *dst, ULONG context_flags, CO if (!(context_flags & 0x40)) return STATUS_SUCCESS; - if (dst->XState.Length < offsetof(XSTATE, YmmContext)) + if (dst->XState.Length < sizeof(XSAVE_AREA_HEADER)) return STATUS_BUFFER_OVERFLOW; - dst_xs = (XSTATE *)((BYTE *)dst + dst->XState.Offset); - src_xs = (XSTATE *)((BYTE *)src + src->XState.Offset); + dst_xs = (XSAVE_AREA_HEADER *)((BYTE *)dst + dst->XState.Offset); + src_xs = (XSAVE_AREA_HEADER *)((BYTE *)src + src->XState.Offset); - memset(dst_xs, 0, offsetof(XSTATE, YmmContext)); + memset(dst_xs, 0, sizeof(XSAVE_AREA_HEADER)); dst_xs->Mask = (src_xs->Mask & ~(ULONG64)3) & feature_mask; dst_xs->CompactionMask = user_shared_data->XState.CompactionEnabled ? ((ULONG64)1 << 63) | (src_xs->CompactionMask & feature_mask) : 0; - if (dst_xs->Mask & 4 && src->XState.Length >= sizeof(XSTATE) && dst->XState.Length >= sizeof(XSTATE)) - memcpy( &dst_xs->YmmContext, &src_xs->YmmContext, sizeof(dst_xs->YmmContext) ); + + if (dst_xs->CompactionMask) feature_mask &= dst_xs->CompactionMask; + feature_mask = dst_xs->Mask >> 2; + + i = 2; + off = sizeof(XSAVE_AREA_HEADER); + while (1) + { + if (feature_mask & 1) + { + if (!dst_xs->CompactionMask) off = user_shared_data->XState.Features[i].Offset - sizeof(XSAVE_FORMAT); + size = user_shared_data->XState.Features[i].Size; + if (src->XState.Length < off + size || dst->XState.Length < off + size) break; + memcpy( (BYTE *)dst_xs + off, (BYTE *)src_xs + off, size ); + } + if (!(feature_mask >>= 1)) break; + if (dst_xs->CompactionMask) off = next_compacted_xstate_offset( off, dst_xs->CompactionMask, i); + ++i; + } return STATUS_SUCCESS; } diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 4dc3e7296b6..981836f28a7 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -328,6 +328,9 @@ C_ASSERT( HEAP_MIN_LARGE_BLOCK_SIZE <= HEAP_INITIAL_GROW_SIZE ); #define HEAP_VALIDATE_PARAMS 0x40000000 #define HEAP_CHECKING_ENABLED 0x80000000 +BOOL delay_heap_free = FALSE; +BOOL heap_zero_hack = FALSE; + static struct heap *process_heap; /* main process heap */ static NTSTATUS heap_free_block_lfh( struct heap *heap, ULONG flags, struct block *block ); @@ -1478,8 +1481,8 @@ static void heap_set_debug_flags( HANDLE handle ) } } - if ((heap->flags & HEAP_GROWABLE) && !heap->pending_free && - ((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND)) + if (delay_heap_free || ((heap->flags & HEAP_GROWABLE) && !heap->pending_free && + ((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND))) { heap->pending_free = RtlAllocateHeap( handle, HEAP_ZERO_MEMORY, MAX_FREE_PENDING * sizeof(*heap->pending_free) ); @@ -1517,6 +1520,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, void *addr, SIZE_T total_size, SIZE_T TRACE( "flags %#lx, addr %p, total_size %#Ix, commit_size %#Ix, unknown %p, definition %p\n", flags, addr, total_size, commit_size, unknown, definition ); + if (heap_zero_hack) + flags |= HEAP_ZERO_MEMORY; + flags &= ~(HEAP_TAIL_CHECKING_ENABLED|HEAP_FREE_CHECKING_ENABLED); if (process_heap) flags |= HEAP_PRIVATE; if (!process_heap || !total_size || (flags & HEAP_SHARED)) flags |= HEAP_GROWABLE; @@ -2612,7 +2618,7 @@ NTSTATUS WINAPI RtlSetHeapInformation( HANDLE handle, HEAP_INFORMATION_CLASS inf FIXME( "HeapCompatibilityInformation %lu not implemented!\n", compat_info ); return STATUS_UNSUCCESSFUL; } - if (InterlockedCompareExchange( &heap->compat_info, compat_info, HEAP_STD ) != HEAP_STD) + if (!delay_heap_free && InterlockedCompareExchange( &heap->compat_info, compat_info, HEAP_STD ) != HEAP_STD) return STATUS_UNSUCCESSFUL; return STATUS_SUCCESS; } diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 59624bc70f8..8dfe4e21e10 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -34,6 +34,7 @@ #include "wine/exception.h" #include "wine/debug.h" #include "wine/list.h" +#include "wine/rbtree.h" #include "ntdll_misc.h" #include "ddk/wdm.h" @@ -89,7 +90,7 @@ const WCHAR windows_dir[] = L"C:\\windows"; const WCHAR system_dir[] = L"C:\\windows\\system32\\"; /* system search path */ -static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows"; +static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows;C:\\Program Files (x86)\\Steam"; static BOOL is_prefix_bootstrap; /* are we bootstrapping the prefix? */ static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */ @@ -189,6 +190,13 @@ static WINE_MODREF *last_failed_modref; static LDR_DDAG_NODE *node_ntdll, *node_kernel32; +struct known_dll +{ + struct rb_entry entry; + WCHAR name[1]; +}; +static struct rb_tree known_dlls; + static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD flags, WINE_MODREF** pwm, BOOL system ); static NTSTATUS process_attach( LDR_DDAG_NODE *node, LPVOID lpReserved ); static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, @@ -208,6 +216,21 @@ static inline BOOL contains_path( LPCWSTR name ) return ((*name && (name[1] == ':')) || wcschr(name, '/') || wcschr(name, '\\')); } +static BOOL get_env( const WCHAR *var, WCHAR *val, unsigned int len ) +{ + UNICODE_STRING name, value; + + name.Length = wcslen( var ) * sizeof(WCHAR); + name.MaximumLength = name.Length + sizeof(WCHAR); + name.Buffer = (WCHAR *)var; + + value.Length = 0; + value.MaximumLength = len; + value.Buffer = val; + + return !RtlQueryEnvironmentVariable_U( NULL, &name, &value ); +} + #define RTL_UNLOAD_EVENT_TRACE_NUMBER 64 typedef struct _RTL_UNLOAD_EVENT_TRACE @@ -1860,10 +1883,10 @@ NTSTATUS WINAPI LdrFindEntryForAddress( const void *addr, PLDR_DATA_TABLE_ENTRY PLIST_ENTRY mark, entry; PLDR_DATA_TABLE_ENTRY mod; - mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - for (entry = mark->Flink; entry != mark; entry = entry->Flink) + mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; + for (entry = mark->Blink; entry != mark; entry = entry->Blink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); if (mod->DllBase <= addr && (const char *)addr < (char*)mod->DllBase + mod->SizeOfImage) { @@ -2173,6 +2196,18 @@ static NTSTATUS perform_relocations( void *module, IMAGE_NT_HEADERS *nt, SIZE_T return STATUS_SUCCESS; } +static int use_lsteamclient(void) +{ + WCHAR env[32]; + static int use = -1; + + if (use != -1) return use; + + use = !get_env( L"PROTON_DISABLE_LSTEAMCLIENT", env, sizeof(env) ) || *env == '0'; + if (!use) + ERR("lsteamclient disabled.\n"); + return use; +} /************************************************************************* * build_module @@ -2184,12 +2219,16 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, DWORD flags, BOOL system, WINE_MODREF **pwm ) { static const char builtin_signature[] = "Wine builtin DLL"; + static HMODULE lsteamclient = NULL; char *signature = (char *)((IMAGE_DOS_HEADER *)*module + 1); + UNICODE_STRING lsteamclient_us; BOOL is_builtin; IMAGE_NT_HEADERS *nt; WINE_MODREF *wm; NTSTATUS status; SIZE_T map_size; + WCHAR *basename, *tmp; + ULONG basename_len; if (!(nt = RtlImageNtHeader( *module ))) return STATUS_INVALID_IMAGE_FORMAT; @@ -2210,6 +2249,25 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, update_load_config( *module ); + basename = nt_name->Buffer; + if ((tmp = wcsrchr(basename, '\\'))) basename = tmp + 1; + if ((tmp = wcsrchr(basename, '/'))) basename = tmp + 1; + basename_len = wcslen(basename); + if (basename_len >= 4 && !wcscmp(basename + basename_len - 4, L".dll")) basename_len -= 4; + + if (use_lsteamclient() && (!RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"steamclient64", 13, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer", 19, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer64", 21, TRUE)) && + RtlCreateUnicodeStringFromAsciiz(&lsteamclient_us, "lsteamclient.dll") && + (lsteamclient || LdrLoadDll(load_path, 0, &lsteamclient_us, &lsteamclient) == STATUS_SUCCESS)) + { + struct steamclient_setup_trampolines_params params = {.src_mod = *module, .tgt_mod = lsteamclient}; + WINE_UNIX_CALL( unix_steamclient_setup_trampolines, ¶ms ); + wm->ldr.Flags |= LDR_DONT_RESOLVE_REFS; + flags |= DONT_RESOLVE_DLL_REFERENCES; + } + /* fixup imports */ if (!(flags & DONT_RESOLVE_DLL_REFERENCES) && @@ -2966,6 +3024,33 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) } +/****************************************************************************** + * prepend_system_dir + */ +static NTSTATUS prepend_system_dir( const WCHAR *name, ULONG name_length, WCHAR **fullname ) +{ + static const WCHAR ucrtbase[] = L"ucrtbase.dll"; + ULONG len; + + if (name_length == sizeof(ucrtbase) / sizeof(*ucrtbase) - 1 && !_wcsnicmp( name, ucrtbase, name_length )) + { + if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (name_length + 1) * sizeof(WCHAR) ))) + return STATUS_NO_MEMORY; + memcpy( *fullname, name, name_length * sizeof(WCHAR) ); + (*fullname)[name_length] = 0; + return STATUS_SUCCESS; + } + + len = wcslen( system_dir ) + name_length; + if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) + return STATUS_NO_MEMORY; + wcscpy( *fullname, system_dir ); + memcpy( *fullname + wcslen( system_dir ), name, name_length * sizeof(WCHAR) ); + (*fullname)[len] = 0; + + return STATUS_SUCCESS; +} + /****************************************************************************** * find_apiset_dll @@ -2975,18 +3060,11 @@ static NTSTATUS find_apiset_dll( const WCHAR *name, WCHAR **fullname ) const API_SET_NAMESPACE *map = NtCurrentTeb()->Peb->ApiSetMap; const API_SET_NAMESPACE_ENTRY *entry; UNICODE_STRING str; - ULONG len; if (get_apiset_entry( map, name, wcslen(name), &entry )) return STATUS_APISET_NOT_PRESENT; if (get_apiset_target( map, entry, NULL, &str )) return STATUS_DLL_NOT_FOUND; - len = wcslen( system_dir ) + str.Length / sizeof(WCHAR); - if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) - return STATUS_NO_MEMORY; - wcscpy( *fullname, system_dir ); - memcpy( *fullname + wcslen( system_dir ), str.Buffer, str.Length ); - (*fullname)[len] = 0; - return STATUS_SUCCESS; + return prepend_system_dir( str.Buffer, str.Length / sizeof(WCHAR), fullname ); } @@ -3153,6 +3231,19 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * return status; } + +static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) +{ + while (*str) + { + const WCHAR *p1 = str, *p2 = sub; + while (*p1 && *p2 && tolower(*p1) == tolower(*p2)) { p1++; p2++; } + if (!*p2) return (WCHAR *)str; + str++; + } + return NULL; +} + /*********************************************************************** * find_dll_file * @@ -3162,6 +3253,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI WINE_MODREF **pwm, HANDLE *mapping, SECTION_IMAGE_INFORMATION *image_info, struct file_id *id ) { + const WCHAR *known_dll_name = NULL; WCHAR *fullname = NULL; NTSTATUS status; ULONG wow64_old_value = 0; @@ -3194,6 +3286,12 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI goto done; } } + if (!fullname && rb_get( &known_dlls, libname )) + { + prepend_system_dir( libname, wcslen(libname), &fullname ); + known_dll_name = libname; + libname = fullname; + } } if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) @@ -3203,16 +3301,55 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI status = find_builtin_without_file( libname, nt_name, pwm, mapping, image_info, id ); } else if (!(status = RtlDosPathNameToNtPathName_U_WithStatus( libname, nt_name, NULL, NULL ))) + { status = open_dll_file( nt_name, pwm, mapping, image_info, id ); + if (status == STATUS_DLL_NOT_FOUND && known_dll_name) + status = find_builtin_without_file( known_dll_name, nt_name, pwm, mapping, image_info, id ); + } if (status == STATUS_NOT_SUPPORTED) status = STATUS_INVALID_IMAGE_FORMAT; done: RtlFreeHeap( GetProcessHeap(), 0, fullname ); if (wow64_old_value) RtlWow64EnableFsRedirectionEx( 1, &wow64_old_value ); + + if (status != STATUS_SUCCESS) + { + /* HACK for Proton issue #17 + * + * Some games try to load mfc42.dll, but then proceed to not use it. + * Just return a handle to kernel32 in that case. + */ + WCHAR sgi[32]; + + if (get_env( L"SteamGameId", sgi, sizeof(sgi) )) + { + if (!wcscmp( sgi, L"105450") && + strstriW( libname, L"mfc42" )) + { + WARN_(loaddll)( "Using a fake mfc42 handle\n" ); + status = find_dll_file( load_path, L"kernel32.dll", nt_name, pwm, mapping, image_info, id ); + } + } + } return status; } +static void substitute_dll( const WCHAR **libname ) +{ + static int substitute = -1; + + if (substitute == -1) + { + WCHAR env_str[32]; + + if ((substitute = (get_env( L"SteamGameId", env_str, sizeof(env_str)) && !wcsicmp( env_str, L"582660" )))) + FIXME( "HACK: substituting dll name.\n" ); + } + if (!substitute) return; + if (*libname && !wcsicmp( *libname, L"d3dcompiler_46.dll" )) + *libname = L"d3dcompiler_43.dll"; +} /*********************************************************************** * load_dll (internal) @@ -3231,6 +3368,8 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) ); + substitute_dll( &libname ); + if (system && system_dll_path.Buffer) nts = search_dll_file( system_dll_path.Buffer, libname, &nt_name, pwm, &mapping, &image_info, &id ); @@ -4099,17 +4238,31 @@ static void process_breakpoint(void) __ENDTRY } +/************************************************************************* + * compare_known_dlls + */ +static int compare_known_dlls( const void *name, const struct wine_rb_entry *entry ) +{ + struct known_dll *known_dll = WINE_RB_ENTRY_VALUE( entry, struct known_dll, entry ); + + return wcsicmp( name, known_dll->name ); +} /*********************************************************************** * load_global_options */ static void load_global_options(void) { + char buffer[256]; + KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; OBJECT_ATTRIBUTES attr; UNICODE_STRING bootstrap_mode_str = RTL_CONSTANT_STRING( L"WINEBOOTSTRAPMODE" ); UNICODE_STRING session_manager_str = RTL_CONSTANT_STRING( L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager" ); - UNICODE_STRING val_str; + UNICODE_STRING val_str, name_str; + struct known_dll *known_dll; + ULONG idx = 0, size; + NTSTATUS status; HANDLE hkey; val_str.MaximumLength = 0; @@ -4129,6 +4282,25 @@ static void load_global_options(void) query_dword_option( hkey, L"SafeDllSearchMode", &dll_safe_mode ); NtClose( hkey ); } + + rb_init( &known_dlls, compare_known_dlls ); + + RtlInitUnicodeString( &name_str, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\KnownDLLs" ); + if (NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr )) return; + while (1) + { + status = NtEnumerateValueKey( hkey, idx++, KeyValuePartialInformation, buffer, sizeof(buffer), &size ); + if (status == STATUS_BUFFER_OVERFLOW) continue; + if (status) break; + if (info->Type != REG_SZ) continue; + + known_dll = RtlAllocateHeap( GetProcessHeap(), 0, offsetof(struct known_dll, name[0]) + info->DataLength ); + if (!known_dll) break; + memcpy( known_dll->name, info->Data, info->DataLength ); + rb_put( &known_dlls, known_dll->name, &known_dll->entry ); + } + NtClose( hkey ); } @@ -4283,6 +4455,8 @@ void loader_init( CONTEXT *context, void **entry ) ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; + WCHAR env_str[16]; + ULONG heap_flags = HEAP_GROWABLE; NtQueryVirtualMemory( GetCurrentProcess(), LdrInitializeThunk, MemoryBasicInformation, &meminfo, sizeof(meminfo), NULL ); @@ -4292,7 +4466,22 @@ void loader_init( CONTEXT *context, void **entry ) peb->TlsBitmap = &tls_bitmap; peb->TlsExpansionBitmap = &tls_expansion_bitmap; peb->LoaderLock = &loader_section; - peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL ); + + if (get_env( L"WINE_HEAP_DELAY_FREE", env_str, sizeof(env_str)) ) + { + if (env_str[0] == L'1') + { + ERR( "Enabling heap free delay hack.\n" ); + delay_heap_free = TRUE; + } + } + if (get_env( L"WINE_HEAP_ZERO_MEMORY", env_str, sizeof(env_str)) && env_str[0] == L'1') + { + ERR( "Enabling heap zero hack.\n" ); + heap_zero_hack = TRUE; + } + + peb->ProcessHeap = RtlCreateHeap( heap_flags, NULL, 0, 0, NULL, NULL ); RtlInitializeBitMap( &tls_bitmap, peb->TlsBitmapBits, sizeof(peb->TlsBitmapBits) * 8 ); RtlInitializeBitMap( &tls_expansion_bitmap, peb->TlsExpansionBitmapBits, @@ -4489,6 +4678,15 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) RtlEnterCriticalSection( &loader_section ); if (!LdrFindEntryForAddress( pc, &module )) ret = module->DllBase; RtlLeaveCriticalSection( &loader_section ); + + if (!ret && WINE_UNIX_CALL( unix_is_pc_in_native_so, pc )) + { + LDR_DATA_TABLE_ENTRY *mod; + + mod = CONTAINING_RECORD( node_ntdll->Modules.Flink, LDR_DATA_TABLE_ENTRY, NodeModuleLink ); + ret = mod->DllBase; + } + *address = ret; return ret; } diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 1908a089d44..e33e85d5ca6 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1716,6 +1716,7 @@ @ extern -private __wine_syscall_dispatcher @ extern -private __wine_unix_call_dispatcher @ extern -private __wine_unixlib_handle +@ stdcall -syscall __wine_set_unix_env(ptr ptr) # Debugging @ stdcall -norelay __wine_dbg_write(ptr long) @@ -1723,6 +1724,7 @@ @ cdecl -norelay __wine_dbg_header(long long str) @ cdecl -norelay __wine_dbg_output(str) @ cdecl -norelay __wine_dbg_strdup(str) +@ stdcall -syscall -norelay __wine_dbg_ftrace(ptr long long) # Version @ cdecl wine_get_version() @@ -1732,3 +1734,4 @@ # Filesystem @ stdcall -syscall wine_nt_to_unix_file_name(ptr ptr ptr long) @ stdcall -syscall wine_unix_to_nt_file_name(str ptr ptr) +@ stdcall -syscall __wine_needs_override_large_address_aware() diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index a7967a6c242..af4d8b57348 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -47,6 +47,9 @@ static const UINT_PTR page_size = 0x1000; extern UINT_PTR page_size; #endif +extern BOOL delay_heap_free; +extern BOOL heap_zero_hack; + /* exceptions */ extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ); diff --git a/dlls/ntdll/ntsyscalls.h b/dlls/ntdll/ntsyscalls.h deleted file mode 100644 index 7ae20b31159..00000000000 --- a/dlls/ntdll/ntsyscalls.h +++ /dev/null @@ -1,478 +0,0 @@ -/* Automatically generated by tools/make_specfiles */ - -#define ALL_SYSCALLS32 \ - SYSCALL_ENTRY( 0x0000, NtAcceptConnectPort, 24 ) \ - SYSCALL_ENTRY( 0x0001, NtAccessCheck, 32 ) \ - SYSCALL_ENTRY( 0x0002, NtAccessCheckAndAuditAlarm, 44 ) \ - SYSCALL_ENTRY( 0x0003, NtAddAtom, 12 ) \ - SYSCALL_ENTRY( 0x0004, NtAdjustGroupsToken, 24 ) \ - SYSCALL_ENTRY( 0x0005, NtAdjustPrivilegesToken, 24 ) \ - SYSCALL_ENTRY( 0x0006, NtAlertResumeThread, 8 ) \ - SYSCALL_ENTRY( 0x0007, NtAlertThread, 4 ) \ - SYSCALL_ENTRY( 0x0008, NtAlertThreadByThreadId, 4 ) \ - SYSCALL_ENTRY( 0x0009, NtAllocateLocallyUniqueId, 4 ) \ - SYSCALL_ENTRY( 0x000a, NtAllocateUuids, 16 ) \ - SYSCALL_ENTRY( 0x000b, NtAllocateVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x000c, NtAllocateVirtualMemoryEx, 28 ) \ - SYSCALL_ENTRY( 0x000d, NtAreMappedFilesTheSame, 8 ) \ - SYSCALL_ENTRY( 0x000e, NtAssignProcessToJobObject, 8 ) \ - SYSCALL_ENTRY( 0x000f, NtCallbackReturn, 12 ) \ - SYSCALL_ENTRY( 0x0010, NtCancelIoFile, 8 ) \ - SYSCALL_ENTRY( 0x0011, NtCancelIoFileEx, 12 ) \ - SYSCALL_ENTRY( 0x0012, NtCancelSynchronousIoFile, 12 ) \ - SYSCALL_ENTRY( 0x0013, NtCancelTimer, 8 ) \ - SYSCALL_ENTRY( 0x0014, NtClearEvent, 4 ) \ - SYSCALL_ENTRY( 0x0015, NtClose, 4 ) \ - SYSCALL_ENTRY( 0x0016, NtCommitTransaction, 8 ) \ - SYSCALL_ENTRY( 0x0017, NtCompareObjects, 8 ) \ - SYSCALL_ENTRY( 0x0018, NtCompleteConnectPort, 4 ) \ - SYSCALL_ENTRY( 0x0019, NtConnectPort, 32 ) \ - SYSCALL_ENTRY( 0x001a, NtContinue, 8 ) \ - SYSCALL_ENTRY( 0x001b, NtCreateDebugObject, 16 ) \ - SYSCALL_ENTRY( 0x001c, NtCreateDirectoryObject, 12 ) \ - SYSCALL_ENTRY( 0x001d, NtCreateEvent, 20 ) \ - SYSCALL_ENTRY( 0x001e, NtCreateFile, 44 ) \ - SYSCALL_ENTRY( 0x001f, NtCreateIoCompletion, 16 ) \ - SYSCALL_ENTRY( 0x0020, NtCreateJobObject, 12 ) \ - SYSCALL_ENTRY( 0x0021, NtCreateKey, 28 ) \ - SYSCALL_ENTRY( 0x0022, NtCreateKeyTransacted, 32 ) \ - SYSCALL_ENTRY( 0x0023, NtCreateKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x0024, NtCreateLowBoxToken, 36 ) \ - SYSCALL_ENTRY( 0x0025, NtCreateMailslotFile, 32 ) \ - SYSCALL_ENTRY( 0x0026, NtCreateMutant, 16 ) \ - SYSCALL_ENTRY( 0x0027, NtCreateNamedPipeFile, 56 ) \ - SYSCALL_ENTRY( 0x0028, NtCreatePagingFile, 16 ) \ - SYSCALL_ENTRY( 0x0029, NtCreatePort, 20 ) \ - SYSCALL_ENTRY( 0x002a, NtCreateSection, 28 ) \ - SYSCALL_ENTRY( 0x002b, NtCreateSemaphore, 20 ) \ - SYSCALL_ENTRY( 0x002c, NtCreateSymbolicLinkObject, 16 ) \ - SYSCALL_ENTRY( 0x002d, NtCreateThread, 32 ) \ - SYSCALL_ENTRY( 0x002e, NtCreateThreadEx, 44 ) \ - SYSCALL_ENTRY( 0x002f, NtCreateTimer, 16 ) \ - SYSCALL_ENTRY( 0x0030, NtCreateToken, 52 ) \ - SYSCALL_ENTRY( 0x0031, NtCreateTransaction, 40 ) \ - SYSCALL_ENTRY( 0x0032, NtCreateUserProcess, 44 ) \ - SYSCALL_ENTRY( 0x0033, NtDebugActiveProcess, 8 ) \ - SYSCALL_ENTRY( 0x0034, NtDebugContinue, 12 ) \ - SYSCALL_ENTRY( 0x0035, NtDelayExecution, 8 ) \ - SYSCALL_ENTRY( 0x0036, NtDeleteAtom, 4 ) \ - SYSCALL_ENTRY( 0x0037, NtDeleteFile, 4 ) \ - SYSCALL_ENTRY( 0x0038, NtDeleteKey, 4 ) \ - SYSCALL_ENTRY( 0x0039, NtDeleteValueKey, 8 ) \ - SYSCALL_ENTRY( 0x003a, NtDeviceIoControlFile, 40 ) \ - SYSCALL_ENTRY( 0x003b, NtDisplayString, 4 ) \ - SYSCALL_ENTRY( 0x003c, NtDuplicateObject, 28 ) \ - SYSCALL_ENTRY( 0x003d, NtDuplicateToken, 24 ) \ - SYSCALL_ENTRY( 0x003e, NtEnumerateKey, 24 ) \ - SYSCALL_ENTRY( 0x003f, NtEnumerateValueKey, 24 ) \ - SYSCALL_ENTRY( 0x0040, NtFilterToken, 24 ) \ - SYSCALL_ENTRY( 0x0041, NtFindAtom, 12 ) \ - SYSCALL_ENTRY( 0x0042, NtFlushBuffersFile, 8 ) \ - SYSCALL_ENTRY( 0x0043, NtFlushInstructionCache, 12 ) \ - SYSCALL_ENTRY( 0x0044, NtFlushKey, 4 ) \ - SYSCALL_ENTRY( 0x0045, NtFlushProcessWriteBuffers, 0 ) \ - SYSCALL_ENTRY( 0x0046, NtFlushVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x0047, NtFreeVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x0048, NtFsControlFile, 40 ) \ - SYSCALL_ENTRY( 0x0049, NtGetContextThread, 8 ) \ - SYSCALL_ENTRY( 0x004a, NtGetCurrentProcessorNumber, 0 ) \ - SYSCALL_ENTRY( 0x004b, NtGetNextThread, 24 ) \ - SYSCALL_ENTRY( 0x004c, NtGetNlsSectionPtr, 20 ) \ - SYSCALL_ENTRY( 0x004d, NtGetWriteWatch, 28 ) \ - SYSCALL_ENTRY( 0x004e, NtImpersonateAnonymousToken, 4 ) \ - SYSCALL_ENTRY( 0x004f, NtInitializeNlsFiles, 12 ) \ - SYSCALL_ENTRY( 0x0050, NtInitiatePowerAction, 16 ) \ - SYSCALL_ENTRY( 0x0051, NtIsProcessInJob, 8 ) \ - SYSCALL_ENTRY( 0x0052, NtListenPort, 8 ) \ - SYSCALL_ENTRY( 0x0053, NtLoadDriver, 4 ) \ - SYSCALL_ENTRY( 0x0054, NtLoadKey, 8 ) \ - SYSCALL_ENTRY( 0x0055, NtLoadKey2, 12 ) \ - SYSCALL_ENTRY( 0x0056, NtLoadKeyEx, 32 ) \ - SYSCALL_ENTRY( 0x0057, NtLockFile, 40 ) \ - SYSCALL_ENTRY( 0x0058, NtLockVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x0059, NtMakeTemporaryObject, 4 ) \ - SYSCALL_ENTRY( 0x005a, NtMapViewOfSection, 40 ) \ - SYSCALL_ENTRY( 0x005b, NtMapViewOfSectionEx, 36 ) \ - SYSCALL_ENTRY( 0x005c, NtNotifyChangeDirectoryFile, 36 ) \ - SYSCALL_ENTRY( 0x005d, NtNotifyChangeKey, 40 ) \ - SYSCALL_ENTRY( 0x005e, NtNotifyChangeMultipleKeys, 48 ) \ - SYSCALL_ENTRY( 0x005f, NtOpenDirectoryObject, 12 ) \ - SYSCALL_ENTRY( 0x0060, NtOpenEvent, 12 ) \ - SYSCALL_ENTRY( 0x0061, NtOpenFile, 24 ) \ - SYSCALL_ENTRY( 0x0062, NtOpenIoCompletion, 12 ) \ - SYSCALL_ENTRY( 0x0063, NtOpenJobObject, 12 ) \ - SYSCALL_ENTRY( 0x0064, NtOpenKey, 12 ) \ - SYSCALL_ENTRY( 0x0065, NtOpenKeyEx, 16 ) \ - SYSCALL_ENTRY( 0x0066, NtOpenKeyTransacted, 16 ) \ - SYSCALL_ENTRY( 0x0067, NtOpenKeyTransactedEx, 20 ) \ - SYSCALL_ENTRY( 0x0068, NtOpenKeyedEvent, 12 ) \ - SYSCALL_ENTRY( 0x0069, NtOpenMutant, 12 ) \ - SYSCALL_ENTRY( 0x006a, NtOpenProcess, 16 ) \ - SYSCALL_ENTRY( 0x006b, NtOpenProcessToken, 12 ) \ - SYSCALL_ENTRY( 0x006c, NtOpenProcessTokenEx, 16 ) \ - SYSCALL_ENTRY( 0x006d, NtOpenSection, 12 ) \ - SYSCALL_ENTRY( 0x006e, NtOpenSemaphore, 12 ) \ - SYSCALL_ENTRY( 0x006f, NtOpenSymbolicLinkObject, 12 ) \ - SYSCALL_ENTRY( 0x0070, NtOpenThread, 16 ) \ - SYSCALL_ENTRY( 0x0071, NtOpenThreadToken, 16 ) \ - SYSCALL_ENTRY( 0x0072, NtOpenThreadTokenEx, 20 ) \ - SYSCALL_ENTRY( 0x0073, NtOpenTimer, 12 ) \ - SYSCALL_ENTRY( 0x0074, NtPowerInformation, 20 ) \ - SYSCALL_ENTRY( 0x0075, NtPrivilegeCheck, 12 ) \ - SYSCALL_ENTRY( 0x0076, NtProtectVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x0077, NtPulseEvent, 8 ) \ - SYSCALL_ENTRY( 0x0078, NtQueryAttributesFile, 8 ) \ - SYSCALL_ENTRY( 0x0079, NtQueryDefaultLocale, 8 ) \ - SYSCALL_ENTRY( 0x007a, NtQueryDefaultUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x007b, NtQueryDirectoryFile, 44 ) \ - SYSCALL_ENTRY( 0x007c, NtQueryDirectoryObject, 28 ) \ - SYSCALL_ENTRY( 0x007d, NtQueryEaFile, 36 ) \ - SYSCALL_ENTRY( 0x007e, NtQueryEvent, 20 ) \ - SYSCALL_ENTRY( 0x007f, NtQueryFullAttributesFile, 8 ) \ - SYSCALL_ENTRY( 0x0080, NtQueryInformationAtom, 20 ) \ - SYSCALL_ENTRY( 0x0081, NtQueryInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x0082, NtQueryInformationJobObject, 20 ) \ - SYSCALL_ENTRY( 0x0083, NtQueryInformationProcess, 20 ) \ - SYSCALL_ENTRY( 0x0084, NtQueryInformationThread, 20 ) \ - SYSCALL_ENTRY( 0x0085, NtQueryInformationToken, 20 ) \ - SYSCALL_ENTRY( 0x0086, NtQueryInstallUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x0087, NtQueryIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x0088, NtQueryKey, 20 ) \ - SYSCALL_ENTRY( 0x0089, NtQueryLicenseValue, 20 ) \ - SYSCALL_ENTRY( 0x008a, NtQueryMultipleValueKey, 24 ) \ - SYSCALL_ENTRY( 0x008b, NtQueryMutant, 20 ) \ - SYSCALL_ENTRY( 0x008c, NtQueryObject, 20 ) \ - SYSCALL_ENTRY( 0x008d, NtQueryPerformanceCounter, 8 ) \ - SYSCALL_ENTRY( 0x008e, NtQuerySection, 20 ) \ - SYSCALL_ENTRY( 0x008f, NtQuerySecurityObject, 20 ) \ - SYSCALL_ENTRY( 0x0090, NtQuerySemaphore, 20 ) \ - SYSCALL_ENTRY( 0x0091, NtQuerySymbolicLinkObject, 12 ) \ - SYSCALL_ENTRY( 0x0092, NtQuerySystemEnvironmentValue, 16 ) \ - SYSCALL_ENTRY( 0x0093, NtQuerySystemEnvironmentValueEx, 20 ) \ - SYSCALL_ENTRY( 0x0094, NtQuerySystemInformation, 16 ) \ - SYSCALL_ENTRY( 0x0095, NtQuerySystemInformationEx, 24 ) \ - SYSCALL_ENTRY( 0x0096, NtQuerySystemTime, 4 ) \ - SYSCALL_ENTRY( 0x0097, NtQueryTimer, 20 ) \ - SYSCALL_ENTRY( 0x0098, NtQueryTimerResolution, 12 ) \ - SYSCALL_ENTRY( 0x0099, NtQueryValueKey, 24 ) \ - SYSCALL_ENTRY( 0x009a, NtQueryVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x009b, NtQueryVolumeInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x009c, NtQueueApcThread, 20 ) \ - SYSCALL_ENTRY( 0x009d, NtRaiseException, 12 ) \ - SYSCALL_ENTRY( 0x009e, NtRaiseHardError, 24 ) \ - SYSCALL_ENTRY( 0x009f, NtReadFile, 36 ) \ - SYSCALL_ENTRY( 0x00a0, NtReadFileScatter, 36 ) \ - SYSCALL_ENTRY( 0x00a1, NtReadVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x00a2, NtRegisterThreadTerminatePort, 4 ) \ - SYSCALL_ENTRY( 0x00a3, NtReleaseKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x00a4, NtReleaseMutant, 8 ) \ - SYSCALL_ENTRY( 0x00a5, NtReleaseSemaphore, 12 ) \ - SYSCALL_ENTRY( 0x00a6, NtRemoveIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x00a7, NtRemoveIoCompletionEx, 24 ) \ - SYSCALL_ENTRY( 0x00a8, NtRemoveProcessDebug, 8 ) \ - SYSCALL_ENTRY( 0x00a9, NtRenameKey, 8 ) \ - SYSCALL_ENTRY( 0x00aa, NtReplaceKey, 12 ) \ - SYSCALL_ENTRY( 0x00ab, NtReplyWaitReceivePort, 16 ) \ - SYSCALL_ENTRY( 0x00ac, NtRequestWaitReplyPort, 12 ) \ - SYSCALL_ENTRY( 0x00ad, NtResetEvent, 8 ) \ - SYSCALL_ENTRY( 0x00ae, NtResetWriteWatch, 12 ) \ - SYSCALL_ENTRY( 0x00af, NtRestoreKey, 12 ) \ - SYSCALL_ENTRY( 0x00b0, NtResumeProcess, 4 ) \ - SYSCALL_ENTRY( 0x00b1, NtResumeThread, 8 ) \ - SYSCALL_ENTRY( 0x00b2, NtRollbackTransaction, 8 ) \ - SYSCALL_ENTRY( 0x00b3, NtSaveKey, 8 ) \ - SYSCALL_ENTRY( 0x00b4, NtSecureConnectPort, 36 ) \ - SYSCALL_ENTRY( 0x00b5, NtSetContextThread, 8 ) \ - SYSCALL_ENTRY( 0x00b6, NtSetDebugFilterState, 12 ) \ - SYSCALL_ENTRY( 0x00b7, NtSetDefaultLocale, 8 ) \ - SYSCALL_ENTRY( 0x00b8, NtSetDefaultUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x00b9, NtSetEaFile, 16 ) \ - SYSCALL_ENTRY( 0x00ba, NtSetEvent, 8 ) \ - SYSCALL_ENTRY( 0x00bb, NtSetInformationDebugObject, 20 ) \ - SYSCALL_ENTRY( 0x00bc, NtSetInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x00bd, NtSetInformationJobObject, 16 ) \ - SYSCALL_ENTRY( 0x00be, NtSetInformationKey, 16 ) \ - SYSCALL_ENTRY( 0x00bf, NtSetInformationObject, 16 ) \ - SYSCALL_ENTRY( 0x00c0, NtSetInformationProcess, 16 ) \ - SYSCALL_ENTRY( 0x00c1, NtSetInformationThread, 16 ) \ - SYSCALL_ENTRY( 0x00c2, NtSetInformationToken, 16 ) \ - SYSCALL_ENTRY( 0x00c3, NtSetInformationVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x00c4, NtSetIntervalProfile, 8 ) \ - SYSCALL_ENTRY( 0x00c5, NtSetIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x00c6, NtSetLdtEntries, 24 ) \ - SYSCALL_ENTRY( 0x00c7, NtSetSecurityObject, 12 ) \ - SYSCALL_ENTRY( 0x00c8, NtSetSystemInformation, 12 ) \ - SYSCALL_ENTRY( 0x00c9, NtSetSystemTime, 8 ) \ - SYSCALL_ENTRY( 0x00ca, NtSetThreadExecutionState, 8 ) \ - SYSCALL_ENTRY( 0x00cb, NtSetTimer, 28 ) \ - SYSCALL_ENTRY( 0x00cc, NtSetTimerResolution, 12 ) \ - SYSCALL_ENTRY( 0x00cd, NtSetValueKey, 24 ) \ - SYSCALL_ENTRY( 0x00ce, NtSetVolumeInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x00cf, NtShutdownSystem, 4 ) \ - SYSCALL_ENTRY( 0x00d0, NtSignalAndWaitForSingleObject, 16 ) \ - SYSCALL_ENTRY( 0x00d1, NtSuspendProcess, 4 ) \ - SYSCALL_ENTRY( 0x00d2, NtSuspendThread, 8 ) \ - SYSCALL_ENTRY( 0x00d3, NtSystemDebugControl, 24 ) \ - SYSCALL_ENTRY( 0x00d4, NtTerminateJobObject, 8 ) \ - SYSCALL_ENTRY( 0x00d5, NtTerminateProcess, 8 ) \ - SYSCALL_ENTRY( 0x00d6, NtTerminateThread, 8 ) \ - SYSCALL_ENTRY( 0x00d7, NtTestAlert, 0 ) \ - SYSCALL_ENTRY( 0x00d8, NtTraceControl, 24 ) \ - SYSCALL_ENTRY( 0x00d9, NtUnloadDriver, 4 ) \ - SYSCALL_ENTRY( 0x00da, NtUnloadKey, 4 ) \ - SYSCALL_ENTRY( 0x00db, NtUnlockFile, 20 ) \ - SYSCALL_ENTRY( 0x00dc, NtUnlockVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x00dd, NtUnmapViewOfSection, 8 ) \ - SYSCALL_ENTRY( 0x00de, NtUnmapViewOfSectionEx, 12 ) \ - SYSCALL_ENTRY( 0x00df, NtWaitForAlertByThreadId, 8 ) \ - SYSCALL_ENTRY( 0x00e0, NtWaitForDebugEvent, 16 ) \ - SYSCALL_ENTRY( 0x00e1, NtWaitForKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x00e2, NtWaitForMultipleObjects, 20 ) \ - SYSCALL_ENTRY( 0x00e3, NtWaitForSingleObject, 12 ) \ - SYSCALL_ENTRY( 0x00e4, NtWow64AllocateVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00e5, NtWow64GetNativeSystemInformation, 16 ) \ - SYSCALL_ENTRY( 0x00e6, NtWow64IsProcessorFeaturePresent, 4 ) \ - SYSCALL_ENTRY( 0x00e7, NtWow64ReadVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00e8, NtWow64WriteVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00e9, NtWriteFile, 36 ) \ - SYSCALL_ENTRY( 0x00ea, NtWriteFileGather, 36 ) \ - SYSCALL_ENTRY( 0x00eb, NtWriteVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x00ec, NtYieldExecution, 0 ) \ - SYSCALL_ENTRY( 0x00ed, wine_nt_to_unix_file_name, 16 ) \ - SYSCALL_ENTRY( 0x00ee, wine_unix_to_nt_file_name, 12 ) - -#define ALL_SYSCALLS64 \ - SYSCALL_ENTRY( 0x0000, NtAcceptConnectPort, 48 ) \ - SYSCALL_ENTRY( 0x0001, NtAccessCheck, 64 ) \ - SYSCALL_ENTRY( 0x0002, NtAccessCheckAndAuditAlarm, 88 ) \ - SYSCALL_ENTRY( 0x0003, NtAddAtom, 24 ) \ - SYSCALL_ENTRY( 0x0004, NtAdjustGroupsToken, 48 ) \ - SYSCALL_ENTRY( 0x0005, NtAdjustPrivilegesToken, 48 ) \ - SYSCALL_ENTRY( 0x0006, NtAlertResumeThread, 16 ) \ - SYSCALL_ENTRY( 0x0007, NtAlertThread, 8 ) \ - SYSCALL_ENTRY( 0x0008, NtAlertThreadByThreadId, 8 ) \ - SYSCALL_ENTRY( 0x0009, NtAllocateLocallyUniqueId, 8 ) \ - SYSCALL_ENTRY( 0x000a, NtAllocateUuids, 32 ) \ - SYSCALL_ENTRY( 0x000b, NtAllocateVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x000c, NtAllocateVirtualMemoryEx, 56 ) \ - SYSCALL_ENTRY( 0x000d, NtAreMappedFilesTheSame, 16 ) \ - SYSCALL_ENTRY( 0x000e, NtAssignProcessToJobObject, 16 ) \ - SYSCALL_ENTRY( 0x000f, NtCallbackReturn, 24 ) \ - SYSCALL_ENTRY( 0x0010, NtCancelIoFile, 16 ) \ - SYSCALL_ENTRY( 0x0011, NtCancelIoFileEx, 24 ) \ - SYSCALL_ENTRY( 0x0012, NtCancelSynchronousIoFile, 24 ) \ - SYSCALL_ENTRY( 0x0013, NtCancelTimer, 16 ) \ - SYSCALL_ENTRY( 0x0014, NtClearEvent, 8 ) \ - SYSCALL_ENTRY( 0x0015, NtClose, 8 ) \ - SYSCALL_ENTRY( 0x0016, NtCommitTransaction, 16 ) \ - SYSCALL_ENTRY( 0x0017, NtCompareObjects, 16 ) \ - SYSCALL_ENTRY( 0x0018, NtCompleteConnectPort, 8 ) \ - SYSCALL_ENTRY( 0x0019, NtConnectPort, 64 ) \ - SYSCALL_ENTRY( 0x001a, NtContinue, 16 ) \ - SYSCALL_ENTRY( 0x001b, NtCreateDebugObject, 32 ) \ - SYSCALL_ENTRY( 0x001c, NtCreateDirectoryObject, 24 ) \ - SYSCALL_ENTRY( 0x001d, NtCreateEvent, 40 ) \ - SYSCALL_ENTRY( 0x001e, NtCreateFile, 88 ) \ - SYSCALL_ENTRY( 0x001f, NtCreateIoCompletion, 32 ) \ - SYSCALL_ENTRY( 0x0020, NtCreateJobObject, 24 ) \ - SYSCALL_ENTRY( 0x0021, NtCreateKey, 56 ) \ - SYSCALL_ENTRY( 0x0022, NtCreateKeyTransacted, 64 ) \ - SYSCALL_ENTRY( 0x0023, NtCreateKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x0024, NtCreateLowBoxToken, 72 ) \ - SYSCALL_ENTRY( 0x0025, NtCreateMailslotFile, 64 ) \ - SYSCALL_ENTRY( 0x0026, NtCreateMutant, 32 ) \ - SYSCALL_ENTRY( 0x0027, NtCreateNamedPipeFile, 112 ) \ - SYSCALL_ENTRY( 0x0028, NtCreatePagingFile, 32 ) \ - SYSCALL_ENTRY( 0x0029, NtCreatePort, 40 ) \ - SYSCALL_ENTRY( 0x002a, NtCreateSection, 56 ) \ - SYSCALL_ENTRY( 0x002b, NtCreateSemaphore, 40 ) \ - SYSCALL_ENTRY( 0x002c, NtCreateSymbolicLinkObject, 32 ) \ - SYSCALL_ENTRY( 0x002d, NtCreateThread, 64 ) \ - SYSCALL_ENTRY( 0x002e, NtCreateThreadEx, 88 ) \ - SYSCALL_ENTRY( 0x002f, NtCreateTimer, 32 ) \ - SYSCALL_ENTRY( 0x0030, NtCreateToken, 104 ) \ - SYSCALL_ENTRY( 0x0031, NtCreateTransaction, 80 ) \ - SYSCALL_ENTRY( 0x0032, NtCreateUserProcess, 88 ) \ - SYSCALL_ENTRY( 0x0033, NtDebugActiveProcess, 16 ) \ - SYSCALL_ENTRY( 0x0034, NtDebugContinue, 24 ) \ - SYSCALL_ENTRY( 0x0035, NtDelayExecution, 16 ) \ - SYSCALL_ENTRY( 0x0036, NtDeleteAtom, 8 ) \ - SYSCALL_ENTRY( 0x0037, NtDeleteFile, 8 ) \ - SYSCALL_ENTRY( 0x0038, NtDeleteKey, 8 ) \ - SYSCALL_ENTRY( 0x0039, NtDeleteValueKey, 16 ) \ - SYSCALL_ENTRY( 0x003a, NtDeviceIoControlFile, 80 ) \ - SYSCALL_ENTRY( 0x003b, NtDisplayString, 8 ) \ - SYSCALL_ENTRY( 0x003c, NtDuplicateObject, 56 ) \ - SYSCALL_ENTRY( 0x003d, NtDuplicateToken, 48 ) \ - SYSCALL_ENTRY( 0x003e, NtEnumerateKey, 48 ) \ - SYSCALL_ENTRY( 0x003f, NtEnumerateValueKey, 48 ) \ - SYSCALL_ENTRY( 0x0040, NtFilterToken, 48 ) \ - SYSCALL_ENTRY( 0x0041, NtFindAtom, 24 ) \ - SYSCALL_ENTRY( 0x0042, NtFlushBuffersFile, 16 ) \ - SYSCALL_ENTRY( 0x0043, NtFlushInstructionCache, 24 ) \ - SYSCALL_ENTRY( 0x0044, NtFlushKey, 8 ) \ - SYSCALL_ENTRY( 0x0045, NtFlushProcessWriteBuffers, 0 ) \ - SYSCALL_ENTRY( 0x0046, NtFlushVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x0047, NtFreeVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x0048, NtFsControlFile, 80 ) \ - SYSCALL_ENTRY( 0x0049, NtGetContextThread, 16 ) \ - SYSCALL_ENTRY( 0x004a, NtGetCurrentProcessorNumber, 0 ) \ - SYSCALL_ENTRY( 0x004b, NtGetNextThread, 48 ) \ - SYSCALL_ENTRY( 0x004c, NtGetNlsSectionPtr, 40 ) \ - SYSCALL_ENTRY( 0x004d, NtGetWriteWatch, 56 ) \ - SYSCALL_ENTRY( 0x004e, NtImpersonateAnonymousToken, 8 ) \ - SYSCALL_ENTRY( 0x004f, NtInitializeNlsFiles, 24 ) \ - SYSCALL_ENTRY( 0x0050, NtInitiatePowerAction, 32 ) \ - SYSCALL_ENTRY( 0x0051, NtIsProcessInJob, 16 ) \ - SYSCALL_ENTRY( 0x0052, NtListenPort, 16 ) \ - SYSCALL_ENTRY( 0x0053, NtLoadDriver, 8 ) \ - SYSCALL_ENTRY( 0x0054, NtLoadKey, 16 ) \ - SYSCALL_ENTRY( 0x0055, NtLoadKey2, 24 ) \ - SYSCALL_ENTRY( 0x0056, NtLoadKeyEx, 64 ) \ - SYSCALL_ENTRY( 0x0057, NtLockFile, 80 ) \ - SYSCALL_ENTRY( 0x0058, NtLockVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x0059, NtMakeTemporaryObject, 8 ) \ - SYSCALL_ENTRY( 0x005a, NtMapViewOfSection, 80 ) \ - SYSCALL_ENTRY( 0x005b, NtMapViewOfSectionEx, 72 ) \ - SYSCALL_ENTRY( 0x005c, NtNotifyChangeDirectoryFile, 72 ) \ - SYSCALL_ENTRY( 0x005d, NtNotifyChangeKey, 80 ) \ - SYSCALL_ENTRY( 0x005e, NtNotifyChangeMultipleKeys, 96 ) \ - SYSCALL_ENTRY( 0x005f, NtOpenDirectoryObject, 24 ) \ - SYSCALL_ENTRY( 0x0060, NtOpenEvent, 24 ) \ - SYSCALL_ENTRY( 0x0061, NtOpenFile, 48 ) \ - SYSCALL_ENTRY( 0x0062, NtOpenIoCompletion, 24 ) \ - SYSCALL_ENTRY( 0x0063, NtOpenJobObject, 24 ) \ - SYSCALL_ENTRY( 0x0064, NtOpenKey, 24 ) \ - SYSCALL_ENTRY( 0x0065, NtOpenKeyEx, 32 ) \ - SYSCALL_ENTRY( 0x0066, NtOpenKeyTransacted, 32 ) \ - SYSCALL_ENTRY( 0x0067, NtOpenKeyTransactedEx, 40 ) \ - SYSCALL_ENTRY( 0x0068, NtOpenKeyedEvent, 24 ) \ - SYSCALL_ENTRY( 0x0069, NtOpenMutant, 24 ) \ - SYSCALL_ENTRY( 0x006a, NtOpenProcess, 32 ) \ - SYSCALL_ENTRY( 0x006b, NtOpenProcessToken, 24 ) \ - SYSCALL_ENTRY( 0x006c, NtOpenProcessTokenEx, 32 ) \ - SYSCALL_ENTRY( 0x006d, NtOpenSection, 24 ) \ - SYSCALL_ENTRY( 0x006e, NtOpenSemaphore, 24 ) \ - SYSCALL_ENTRY( 0x006f, NtOpenSymbolicLinkObject, 24 ) \ - SYSCALL_ENTRY( 0x0070, NtOpenThread, 32 ) \ - SYSCALL_ENTRY( 0x0071, NtOpenThreadToken, 32 ) \ - SYSCALL_ENTRY( 0x0072, NtOpenThreadTokenEx, 40 ) \ - SYSCALL_ENTRY( 0x0073, NtOpenTimer, 24 ) \ - SYSCALL_ENTRY( 0x0074, NtPowerInformation, 40 ) \ - SYSCALL_ENTRY( 0x0075, NtPrivilegeCheck, 24 ) \ - SYSCALL_ENTRY( 0x0076, NtProtectVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x0077, NtPulseEvent, 16 ) \ - SYSCALL_ENTRY( 0x0078, NtQueryAttributesFile, 16 ) \ - SYSCALL_ENTRY( 0x0079, NtQueryDefaultLocale, 16 ) \ - SYSCALL_ENTRY( 0x007a, NtQueryDefaultUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x007b, NtQueryDirectoryFile, 88 ) \ - SYSCALL_ENTRY( 0x007c, NtQueryDirectoryObject, 56 ) \ - SYSCALL_ENTRY( 0x007d, NtQueryEaFile, 72 ) \ - SYSCALL_ENTRY( 0x007e, NtQueryEvent, 40 ) \ - SYSCALL_ENTRY( 0x007f, NtQueryFullAttributesFile, 16 ) \ - SYSCALL_ENTRY( 0x0080, NtQueryInformationAtom, 40 ) \ - SYSCALL_ENTRY( 0x0081, NtQueryInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x0082, NtQueryInformationJobObject, 40 ) \ - SYSCALL_ENTRY( 0x0083, NtQueryInformationProcess, 40 ) \ - SYSCALL_ENTRY( 0x0084, NtQueryInformationThread, 40 ) \ - SYSCALL_ENTRY( 0x0085, NtQueryInformationToken, 40 ) \ - SYSCALL_ENTRY( 0x0086, NtQueryInstallUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x0087, NtQueryIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x0088, NtQueryKey, 40 ) \ - SYSCALL_ENTRY( 0x0089, NtQueryLicenseValue, 40 ) \ - SYSCALL_ENTRY( 0x008a, NtQueryMultipleValueKey, 48 ) \ - SYSCALL_ENTRY( 0x008b, NtQueryMutant, 40 ) \ - SYSCALL_ENTRY( 0x008c, NtQueryObject, 40 ) \ - SYSCALL_ENTRY( 0x008d, NtQueryPerformanceCounter, 16 ) \ - SYSCALL_ENTRY( 0x008e, NtQuerySection, 40 ) \ - SYSCALL_ENTRY( 0x008f, NtQuerySecurityObject, 40 ) \ - SYSCALL_ENTRY( 0x0090, NtQuerySemaphore, 40 ) \ - SYSCALL_ENTRY( 0x0091, NtQuerySymbolicLinkObject, 24 ) \ - SYSCALL_ENTRY( 0x0092, NtQuerySystemEnvironmentValue, 32 ) \ - SYSCALL_ENTRY( 0x0093, NtQuerySystemEnvironmentValueEx, 40 ) \ - SYSCALL_ENTRY( 0x0094, NtQuerySystemInformation, 32 ) \ - SYSCALL_ENTRY( 0x0095, NtQuerySystemInformationEx, 48 ) \ - SYSCALL_ENTRY( 0x0096, NtQuerySystemTime, 8 ) \ - SYSCALL_ENTRY( 0x0097, NtQueryTimer, 40 ) \ - SYSCALL_ENTRY( 0x0098, NtQueryTimerResolution, 24 ) \ - SYSCALL_ENTRY( 0x0099, NtQueryValueKey, 48 ) \ - SYSCALL_ENTRY( 0x009a, NtQueryVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x009b, NtQueryVolumeInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x009c, NtQueueApcThread, 40 ) \ - SYSCALL_ENTRY( 0x009d, NtRaiseException, 24 ) \ - SYSCALL_ENTRY( 0x009e, NtRaiseHardError, 48 ) \ - SYSCALL_ENTRY( 0x009f, NtReadFile, 72 ) \ - SYSCALL_ENTRY( 0x00a0, NtReadFileScatter, 72 ) \ - SYSCALL_ENTRY( 0x00a1, NtReadVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x00a2, NtRegisterThreadTerminatePort, 8 ) \ - SYSCALL_ENTRY( 0x00a3, NtReleaseKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x00a4, NtReleaseMutant, 16 ) \ - SYSCALL_ENTRY( 0x00a5, NtReleaseSemaphore, 24 ) \ - SYSCALL_ENTRY( 0x00a6, NtRemoveIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x00a7, NtRemoveIoCompletionEx, 48 ) \ - SYSCALL_ENTRY( 0x00a8, NtRemoveProcessDebug, 16 ) \ - SYSCALL_ENTRY( 0x00a9, NtRenameKey, 16 ) \ - SYSCALL_ENTRY( 0x00aa, NtReplaceKey, 24 ) \ - SYSCALL_ENTRY( 0x00ab, NtReplyWaitReceivePort, 32 ) \ - SYSCALL_ENTRY( 0x00ac, NtRequestWaitReplyPort, 24 ) \ - SYSCALL_ENTRY( 0x00ad, NtResetEvent, 16 ) \ - SYSCALL_ENTRY( 0x00ae, NtResetWriteWatch, 24 ) \ - SYSCALL_ENTRY( 0x00af, NtRestoreKey, 24 ) \ - SYSCALL_ENTRY( 0x00b0, NtResumeProcess, 8 ) \ - SYSCALL_ENTRY( 0x00b1, NtResumeThread, 16 ) \ - SYSCALL_ENTRY( 0x00b2, NtRollbackTransaction, 16 ) \ - SYSCALL_ENTRY( 0x00b3, NtSaveKey, 16 ) \ - SYSCALL_ENTRY( 0x00b4, NtSecureConnectPort, 72 ) \ - SYSCALL_ENTRY( 0x00b5, NtSetContextThread, 16 ) \ - SYSCALL_ENTRY( 0x00b6, NtSetDebugFilterState, 24 ) \ - SYSCALL_ENTRY( 0x00b7, NtSetDefaultLocale, 16 ) \ - SYSCALL_ENTRY( 0x00b8, NtSetDefaultUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x00b9, NtSetEaFile, 32 ) \ - SYSCALL_ENTRY( 0x00ba, NtSetEvent, 16 ) \ - SYSCALL_ENTRY( 0x00bb, NtSetInformationDebugObject, 40 ) \ - SYSCALL_ENTRY( 0x00bc, NtSetInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x00bd, NtSetInformationJobObject, 32 ) \ - SYSCALL_ENTRY( 0x00be, NtSetInformationKey, 32 ) \ - SYSCALL_ENTRY( 0x00bf, NtSetInformationObject, 32 ) \ - SYSCALL_ENTRY( 0x00c0, NtSetInformationProcess, 32 ) \ - SYSCALL_ENTRY( 0x00c1, NtSetInformationThread, 32 ) \ - SYSCALL_ENTRY( 0x00c2, NtSetInformationToken, 32 ) \ - SYSCALL_ENTRY( 0x00c3, NtSetInformationVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x00c4, NtSetIntervalProfile, 16 ) \ - SYSCALL_ENTRY( 0x00c5, NtSetIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x00c6, NtSetLdtEntries, 32 ) \ - SYSCALL_ENTRY( 0x00c7, NtSetSecurityObject, 24 ) \ - SYSCALL_ENTRY( 0x00c8, NtSetSystemInformation, 24 ) \ - SYSCALL_ENTRY( 0x00c9, NtSetSystemTime, 16 ) \ - SYSCALL_ENTRY( 0x00ca, NtSetThreadExecutionState, 16 ) \ - SYSCALL_ENTRY( 0x00cb, NtSetTimer, 56 ) \ - SYSCALL_ENTRY( 0x00cc, NtSetTimerResolution, 24 ) \ - SYSCALL_ENTRY( 0x00cd, NtSetValueKey, 48 ) \ - SYSCALL_ENTRY( 0x00ce, NtSetVolumeInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x00cf, NtShutdownSystem, 8 ) \ - SYSCALL_ENTRY( 0x00d0, NtSignalAndWaitForSingleObject, 32 ) \ - SYSCALL_ENTRY( 0x00d1, NtSuspendProcess, 8 ) \ - SYSCALL_ENTRY( 0x00d2, NtSuspendThread, 16 ) \ - SYSCALL_ENTRY( 0x00d3, NtSystemDebugControl, 48 ) \ - SYSCALL_ENTRY( 0x00d4, NtTerminateJobObject, 16 ) \ - SYSCALL_ENTRY( 0x00d5, NtTerminateProcess, 16 ) \ - SYSCALL_ENTRY( 0x00d6, NtTerminateThread, 16 ) \ - SYSCALL_ENTRY( 0x00d7, NtTestAlert, 0 ) \ - SYSCALL_ENTRY( 0x00d8, NtTraceControl, 48 ) \ - SYSCALL_ENTRY( 0x00d9, NtUnloadDriver, 8 ) \ - SYSCALL_ENTRY( 0x00da, NtUnloadKey, 8 ) \ - SYSCALL_ENTRY( 0x00db, NtUnlockFile, 40 ) \ - SYSCALL_ENTRY( 0x00dc, NtUnlockVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x00dd, NtUnmapViewOfSection, 16 ) \ - SYSCALL_ENTRY( 0x00de, NtUnmapViewOfSectionEx, 24 ) \ - SYSCALL_ENTRY( 0x00df, NtWaitForAlertByThreadId, 16 ) \ - SYSCALL_ENTRY( 0x00e0, NtWaitForDebugEvent, 32 ) \ - SYSCALL_ENTRY( 0x00e1, NtWaitForKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x00e2, NtWaitForMultipleObjects, 40 ) \ - SYSCALL_ENTRY( 0x00e3, NtWaitForSingleObject, 24 ) \ - SYSCALL_ENTRY( 0x00e4, NtWriteFile, 72 ) \ - SYSCALL_ENTRY( 0x00e5, NtWriteFileGather, 72 ) \ - SYSCALL_ENTRY( 0x00e6, NtWriteVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x00e7, NtYieldExecution, 0 ) \ - SYSCALL_ENTRY( 0x00e8, wine_nt_to_unix_file_name, 32 ) \ - SYSCALL_ENTRY( 0x00e9, wine_unix_to_nt_file_name, 24 ) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 8956ff07f6c..dda6ba4ee53 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -528,7 +528,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size) RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ cd = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else cd = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.DosPath; @@ -883,7 +883,7 @@ ULONG WINAPI RtlGetCurrentDirectory_U(ULONG buflen, LPWSTR buf) RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ us = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else us = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.DosPath; @@ -914,20 +914,20 @@ ULONG WINAPI RtlGetCurrentDirectory_U(ULONG buflen, LPWSTR buf) NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) { FILE_FS_DEVICE_INFORMATION device_info; + ULONG size, compare_size; OBJECT_ATTRIBUTES attr; UNICODE_STRING newdir; IO_STATUS_BLOCK io; CURDIR *curdir; HANDLE handle; NTSTATUS nts; - ULONG size; PWSTR ptr; newdir.Buffer = NULL; RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ curdir = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir; else curdir = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory; @@ -938,6 +938,22 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) goto out; } + size = newdir.Length / sizeof(WCHAR); + ptr = newdir.Buffer; + ptr += 4; /* skip \??\ prefix */ + size -= 4; + + if (size && ptr[size - 1] == '\\') compare_size = size - 1; + else compare_size = size; + + if (curdir->DosPath.Length == (compare_size + 1) * sizeof(WCHAR) + && !memcmp( curdir->DosPath.Buffer, ptr, compare_size * sizeof(WCHAR) )) + { + TRACE( "dir %s is the same as current.\n", debugstr_us(dir) ); + nts = STATUS_SUCCESS; + goto out; + } + attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.Attributes = OBJ_CASE_INSENSITIVE; @@ -962,10 +978,6 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) curdir->Handle = handle; /* append trailing \ if missing */ - size = newdir.Length / sizeof(WCHAR); - ptr = newdir.Buffer; - ptr += 4; /* skip \??\ prefix */ - size -= 4; if (size && ptr[size - 1] != '\\') ptr[size++] = '\\'; /* convert \??\UNC\ path to \\ prefix */ diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 37360929ba6..5165023c1b0 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -215,6 +215,18 @@ NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) for (c = 0; c < rec->NumberParameters; c++) TRACE( " info[%ld]=%08Ix\n", c, rec->ExceptionInformation[c] ); + if (WINE_BACKTRACE_LOG_ON()) + { + struct debugstr_pc_args params; + char buffer[256]; + + params.pc = rec->ExceptionAddress; + params.buffer = buffer; + params.size = sizeof(buffer); + if (!WINE_UNIX_CALL( unix_debugstr_pc, ¶ms )) + WINE_BACKTRACE_LOG( "--- Exception %#lx at %s.\n", rec->ExceptionCode, buffer ); + } + if (rec->ExceptionCode == EXCEPTION_WINE_STUB) { if (rec->ExceptionInformation[1] >> 16) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 379d011bf88..4d14febd8d3 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -262,13 +262,21 @@ static void dump_scope_table( ULONG64 base, const SCOPE_TABLE *table ) } +static BOOL need_backtrace( DWORD exc_code ) +{ + if (!WINE_BACKTRACE_LOG_ON()) return FALSE; + return exc_code != EXCEPTION_WINE_NAME_THREAD && exc_code != DBG_PRINTEXCEPTION_WIDE_C + && exc_code != DBG_PRINTEXCEPTION_C && exc_code != EXCEPTION_WINE_CXX_EXCEPTION + && exc_code != 0x6ba; +} + /*********************************************************************** * virtual_unwind */ -static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context, BOOL dump_backtrace ) { LDR_DATA_TABLE_ENTRY *module; - NTSTATUS status; + NTSTATUS status = STATUS_SUCCESS; dispatch->ImageBase = 0; dispatch->ScopeIndex = 0; @@ -278,6 +286,14 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX if ((dispatch->FunctionEntry = lookup_function_info( context->Rip, &dispatch->ImageBase, &module ))) { + if (dump_backtrace) + { + if (module) + WINE_BACKTRACE_LOG( "%p: %s + %p.\n", (void *)context->Rip, debugstr_w(module->BaseDllName.Buffer), + (void *)((char *)context->Rip - (char *)dispatch->ImageBase) ); + else + WINE_BACKTRACE_LOG( "%p: unknown module.\n", (void *)context->Rip ); + } dispatch->LanguageHandler = RtlVirtualUnwind( type, dispatch->ImageBase, context->Rip, dispatch->FunctionEntry, context, &dispatch->HandlerData, &dispatch->EstablisherFrame, @@ -299,7 +315,11 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX } if (status != STATUS_UNSUCCESSFUL) return status; } - else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + else + { + WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + status = STATUS_UNSUCCESSFUL; + } /* no exception information, treat as a leaf function */ @@ -307,7 +327,7 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX dispatch->LanguageHandler = NULL; context->Rip = *(ULONG64 *)context->Rsp; context->Rsp = context->Rsp + sizeof(ULONG64); - return STATUS_SUCCESS; + return status ? STATUS_NOT_FOUND : STATUS_SUCCESS; } @@ -458,8 +478,8 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex dispatch.HistoryTable = &table; for (;;) { - status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context ); - if (status != STATUS_SUCCESS) return status; + status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context, need_backtrace( rec->ExceptionCode )); + if (status != STATUS_SUCCESS && status != STATUS_NOT_FOUND) return status; unwind_done: if (!dispatch.EstablisherFrame) break; @@ -546,6 +566,9 @@ NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) NTSTATUS status; DWORD c; + if (need_backtrace( rec->ExceptionCode )) + WINE_BACKTRACE_LOG( "--- Exception %#x.\n", (int)rec->ExceptionCode ); + TRACE_(seh)( "code=%lx flags=%lx addr=%p ip=%Ix\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, context->Rip ); for (c = 0; c < min( EXCEPTION_MAXIMUM_PARAMETERS, rec->NumberParameters ); c++) @@ -1393,8 +1416,8 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec for (;;) { - status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context ); - if (status != STATUS_SUCCESS) raise_status( status, rec ); + status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context, FALSE ); + if (status != STATUS_SUCCESS && status != STATUS_NOT_FOUND) raise_status( status, rec ); unwind_done: if (!dispatch.EstablisherFrame) break; @@ -1586,6 +1609,8 @@ __ASM_GLOBAL_FUNC( RtlRaiseException, "movq 0x4f8(%rsp),%rax\n\t" /* return address */ "movq %rax,0xf8(%rdx)\n\t" /* context->Rip */ "movq %rax,0x10(%rcx)\n\t" /* rec->ExceptionAddress */ + "xor %rax,%rax\n\t" + "movq %rax,0x70(%rdx)\n\t" /* Context->Dr7 */ "movl $1,%r8d\n\t" "movq %gs:(0x30),%rax\n\t" /* Teb */ "movq 0x60(%rax),%rax\n\t" /* Peb */ @@ -1639,7 +1664,7 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer, if (hash) *hash = 0; for (i = 0; i < skip + count; i++) { - status = virtual_unwind( UNW_FLAG_NHANDLER, &dispatch, &context ); + status = virtual_unwind( UNW_FLAG_NHANDLER, &dispatch, &context, FALSE ); if (status != STATUS_SUCCESS) return i; if (!dispatch.EstablisherFrame) break; diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index bb5dcbb66e6..54a8a122dc0 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -205,7 +205,7 @@ static inline NTSTATUS wait_semaphore( RTL_CRITICAL_SECTION *crit, int timeout ) */ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit ) { - return RtlInitializeCriticalSectionEx( crit, 0, 0 ); + return RtlInitializeCriticalSectionEx( crit, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO ); } @@ -214,7 +214,7 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit ) */ NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, ULONG spincount ) { - return RtlInitializeCriticalSectionEx( crit, spincount, 0 ); + return RtlInitializeCriticalSectionEx( crit, spincount, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO ); } @@ -232,7 +232,7 @@ NTSTATUS WINAPI RtlInitializeCriticalSectionEx( RTL_CRITICAL_SECTION *crit, ULON * is done, then debug info should be managed through Rtlp[Allocate|Free]DebugInfo * so (e.g.) MakeCriticalSectionGlobal() doesn't free it using HeapFree(). */ - if (flags & RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO) + if (!(flags & RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO)) crit->DebugInfo = no_debug_info_marker; else { @@ -288,7 +288,11 @@ NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit ) crit->DebugInfo = NULL; } } - else NtClose( crit->LockSemaphore ); + else + { + NtClose( crit->LockSemaphore ); + crit->DebugInfo = NULL; + } crit->LockSemaphore = 0; return STATUS_SUCCESS; } @@ -911,11 +915,14 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size ret = NtWaitForAlertByThreadId( NULL, timeout ); - spin_lock( &queue->lock ); - /* We may have already been removed by a call to RtlWakeAddressSingle(). */ + /* We may have already been removed by a call to RtlWakeAddressSingle() or RtlWakeAddressAll(). */ if (entry.addr) - list_remove( &entry.entry ); - spin_unlock( &queue->lock ); + { + spin_lock( &queue->lock ); + if (entry.addr) + list_remove( &entry.entry ); + spin_unlock( &queue->lock ); + } TRACE("returning %#lx\n", ret); @@ -929,8 +936,8 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size void WINAPI RtlWakeAddressAll( const void *addr ) { struct futex_queue *queue = get_futex_queue( addr ); + struct futex_entry *entry, *next; unsigned int count = 0, i; - struct futex_entry *entry; DWORD tids[256]; TRACE("%p\n", addr); @@ -942,10 +949,12 @@ void WINAPI RtlWakeAddressAll( const void *addr ) if (!queue->queue.next) list_init(&queue->queue); - LIST_FOR_EACH_ENTRY( entry, &queue->queue, struct futex_entry, entry ) + LIST_FOR_EACH_ENTRY_SAFE( entry, next, &queue->queue, struct futex_entry, entry ) { if (entry->addr == addr) { + entry->addr = NULL; + list_remove( &entry->entry ); /* Try to buffer wakes, so that we don't make a system call while * holding a spinlock. */ if (count < ARRAY_SIZE(tids)) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 76190aef75a..1d1c9697713 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -18,20 +18,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include "ntdll_test.h" + #include -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winnt.h" -#include "winreg.h" #include "winuser.h" -#include "winternl.h" #include "ddk/wdm.h" #include "excpt.h" -#include "wine/test.h" #include "intrin.h" static void *code_mem; @@ -284,6 +277,19 @@ static void test_debugger_xstate(HANDLE thread, CONTEXT *ctx, enum debugger_stag status = pNtSetContextThread(thread, xctx); ok(!status, "NtSetContextThread failed with 0x%lx\n", status); } + +#define check_context_exception_request( a, b ) check_context_exception_request_( a, b, __LINE__ ) +static void check_context_exception_request_( DWORD flags, BOOL hardware_exception, unsigned int line ) +{ + static const DWORD exception_reporting_flags = CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING + | CONTEXT_EXCEPTION_ACTIVE | CONTEXT_SERVICE_ACTIVE; + DWORD expected_flags = CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING; + + if (!(flags & CONTEXT_EXCEPTION_REPORTING)) return; + expected_flags |= hardware_exception ? CONTEXT_EXCEPTION_ACTIVE : CONTEXT_SERVICE_ACTIVE; + ok_(__FILE__, line)( (flags & exception_reporting_flags) == expected_flags, "got %#lx, expected %#lx.\n", + flags, expected_flags ); +} #endif #ifdef __i386__ @@ -1154,13 +1160,16 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) sizeof(stage), &size_read); ok(!status,"NtReadVirtualMemory failed with 0x%lx\n", status); - ctx.ContextFlags = CONTEXT_FULL | CONTEXT_EXTENDED_REGISTERS; + ctx.ContextFlags = CONTEXT_FULL | CONTEXT_EXTENDED_REGISTERS | CONTEXT_EXCEPTION_REQUEST; status = pNtGetContextThread(pi.hThread, &ctx); ok(!status, "NtGetContextThread failed with 0x%lx\n", status); + ok(ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING + || broken( !(ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING) ) /* Win7 WoW64 */, + "got %#lx.\n", ctx.ContextFlags); - trace("exception 0x%lx at %p firstchance=%ld Eip=0x%lx, Eax=0x%lx\n", + trace("exception 0x%lx at %p firstchance=%ld Eip=0x%lx, Eax=0x%lx ctx.ContextFlags %#lx\n", de.u.Exception.ExceptionRecord.ExceptionCode, - de.u.Exception.ExceptionRecord.ExceptionAddress, de.u.Exception.dwFirstChance, ctx.Eip, ctx.Eax); + de.u.Exception.ExceptionRecord.ExceptionAddress, de.u.Exception.dwFirstChance, ctx.Eip, ctx.Eax, ctx.ContextFlags); if (counter > 100) { @@ -1177,6 +1186,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) (char *)ctx.Eip < (char *)ntdll + nt->OptionalHeader.SizeOfImage, "wrong eip %p ntdll %p-%p\n", (void *)ctx.Eip, ntdll, (char *)ntdll + nt->OptionalHeader.SizeOfImage ); + check_context_exception_request( ctx.ContextFlags, TRUE ); } else { @@ -1190,6 +1200,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ctx.Eax = 0xf00f00f1; /* let the debuggee handle the exception */ continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, !is_wow64 ); } else if (stage == STAGE_RTLRAISE_HANDLE_LAST_CHANCE) { @@ -1226,6 +1237,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ctx.Eip, (char *)code_mem_address + 0xb); /* here we handle exception */ } + check_context_exception_request( ctx.ContextFlags, !is_wow64 ); } else if (stage == STAGE_SERVICE_CONTINUE || stage == STAGE_SERVICE_NOT_HANDLED) { @@ -1235,6 +1247,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) "expected Eip = %p, got 0x%lx\n", (char *)code_mem_address + 0x1d, ctx.Eip); if (stage == STAGE_SERVICE_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, TRUE ); } else if (stage == STAGE_BREAKPOINT_CONTINUE || stage == STAGE_BREAKPOINT_NOT_HANDLED) { @@ -1244,6 +1257,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) "expected Eip = %p, got 0x%lx\n", (char *)code_mem_address + 2, ctx.Eip); if (stage == STAGE_BREAKPOINT_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, TRUE ); } else if (stage == STAGE_EXCEPTION_INVHANDLE_CONTINUE || stage == STAGE_EXCEPTION_INVHANDLE_NOT_HANDLED) { @@ -1254,14 +1268,17 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) "unexpected number of parameters %ld, expected 0\n", de.u.Exception.ExceptionRecord.NumberParameters); if (stage == STAGE_EXCEPTION_INVHANDLE_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, !is_wow64 ); } else if (stage == STAGE_NO_EXCEPTION_INVHANDLE_NOT_HANDLED) { ok(FALSE || broken(TRUE) /* < Win10 */, "should not throw exception\n"); continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, !is_wow64 ); } else if (stage == STAGE_XSTATE || stage == STAGE_XSTATE_LEGACY_SSE) { + check_context_exception_request( ctx.ContextFlags, TRUE ); test_debugger_xstate(pi.hThread, &ctx, stage); } else if (stage == STAGE_SEGMENTS) @@ -1282,6 +1299,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ok( !ctx.SegEs, "wrong es %04lx / %04lx\n", ctx.SegEs, ctx.SegSs ); ok( !ctx.SegGs, "wrong gs %04lx / %04lx\n", ctx.SegGs, ctx.SegSs ); } + check_context_exception_request( ctx.ContextFlags, TRUE ); } else ok(FALSE, "unexpected stage %u\n", stage); @@ -4052,9 +4070,10 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) sizeof(stage), &size_read); ok(!status,"NtReadVirtualMemory failed with 0x%lx\n", status); - ctx.ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS; + ctx.ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS | CONTEXT_EXCEPTION_REQUEST; status = pNtGetContextThread(pi.hThread, &ctx); ok(!status, "NtGetContextThread failed with 0x%lx\n", status); + ok(ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING, "got %#lx.\n", ctx.ContextFlags); trace("exception 0x%lx at %p firstchance=%ld Rip=%p, Rax=%p\n", de.u.Exception.ExceptionRecord.ExceptionCode, @@ -4076,6 +4095,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) (char *)ctx.Rip < (char *)ntdll + nt->OptionalHeader.SizeOfImage, "wrong rip %p ntdll %p-%p\n", (void *)ctx.Rip, ntdll, (char *)ntdll + nt->OptionalHeader.SizeOfImage ); + check_context_exception_request( ctx.ContextFlags, TRUE ); } else { @@ -4089,6 +4109,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ctx.Rax = 0xf00f00f1; /* let the debuggee handle the exception */ continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, FALSE ); } else if (stage == STAGE_RTLRAISE_HANDLE_LAST_CHANCE) { @@ -4117,6 +4138,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ctx.Rip, (char *)code_mem_address + 0x10); /* here we handle exception */ } + check_context_exception_request( ctx.ContextFlags, FALSE ); } else if (stage == STAGE_SERVICE_CONTINUE || stage == STAGE_SERVICE_NOT_HANDLED) { @@ -4125,6 +4147,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ok((char *)ctx.Rip == (char *)code_mem_address + 0x30, "expected Rip = %p, got %p\n", (char *)code_mem_address + 0x30, (char *)ctx.Rip); if (stage == STAGE_SERVICE_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, TRUE ); } else if (stage == STAGE_BREAKPOINT_CONTINUE || stage == STAGE_BREAKPOINT_NOT_HANDLED) { @@ -4133,6 +4156,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ok((char *)ctx.Rip == (char *)code_mem_address + 2, "expected Rip = %p, got %p\n", (char *)code_mem_address + 2, (char *)ctx.Rip); if (stage == STAGE_BREAKPOINT_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, TRUE ); } else if (stage == STAGE_EXCEPTION_INVHANDLE_CONTINUE || stage == STAGE_EXCEPTION_INVHANDLE_NOT_HANDLED) { @@ -4143,14 +4167,17 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) "unexpected number of parameters %ld, expected 0\n", de.u.Exception.ExceptionRecord.NumberParameters); if (stage == STAGE_EXCEPTION_INVHANDLE_NOT_HANDLED) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, FALSE ); } else if (stage == STAGE_NO_EXCEPTION_INVHANDLE_NOT_HANDLED) { ok(FALSE || broken(TRUE) /* < Win10 */, "should not throw exception\n"); continuestatus = DBG_EXCEPTION_NOT_HANDLED; + check_context_exception_request( ctx.ContextFlags, FALSE ); } else if (stage == STAGE_XSTATE || stage == STAGE_XSTATE_LEGACY_SSE) { + check_context_exception_request( ctx.ContextFlags, TRUE ); test_debugger_xstate(pi.hThread, &ctx, stage); } else if (stage == STAGE_SEGMENTS) @@ -4175,6 +4202,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); todo_wine ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); + check_context_exception_request( ctx.ContextFlags, TRUE ); } else ok(FALSE, "unexpected stage %u\n", stage); @@ -4596,9 +4624,21 @@ static void test_wow64_context(void) ret = pRtlWow64GetThreadContext( pi.hThread, &ctx ); ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); ok( ctx.ContextFlags == WOW64_CONTEXT_ALL, "got context flags %#lx\n", ctx.ContextFlags ); + + ctx.ContextFlags = WOW64_CONTEXT_ALL | CONTEXT_EXCEPTION_REQUEST; + ret = pRtlWow64GetThreadContext( pi.hThread, &ctx ); + ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); + ok( (ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING) || broken( ctx.ContextFlags == WOW64_CONTEXT_ALL ) /*Win 7*/, + "got context flags %#lx\n", ctx.ContextFlags ); + if (context.SegCs == cs32) { trace( "in 32-bit mode %04x\n", context.SegCs ); + if (ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING) + ok( ctx.ContextFlags == (WOW64_CONTEXT_ALL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING) + || ctx.ContextFlags == (WOW64_CONTEXT_ALL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING + | CONTEXT_EXCEPTION_ACTIVE), + "got %#lx.\n", ctx.ContextFlags ); ok( ctx.Eip == context.Rip, "cs32: eip %08lx / %p\n", ctx.Eip, (void *)context.Rip ); ok( ctx.Ebp == context.Rbp, "cs32: ebp %08lx / %p\n", ctx.Ebp, (void *)context.Rbp ); ok( ctx.Esp == context.Rsp, "cs32: esp %08lx / %p\n", ctx.Esp, (void *)context.Rsp ); @@ -4673,6 +4713,12 @@ static void test_wow64_context(void) else { trace( "in 64-bit mode %04x\n", context.SegCs ); + if (ctx.ContextFlags & CONTEXT_EXCEPTION_REPORTING) + ok( ctx.ContextFlags == (WOW64_CONTEXT_ALL | CONTEXT_EXCEPTION_REQUEST + | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE) + || ctx.ContextFlags == (WOW64_CONTEXT_ALL | CONTEXT_EXCEPTION_REQUEST + | CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE), + "got %#lx.\n", ctx.ContextFlags ); ok( ctx.Eip != context.Rip, "cs64: eip %08lx / %p\n", ctx.Eip, (void *)context.Rip); ok( ctx.SegCs == cs32, "cs64: wrong cs %04lx / %04x\n", ctx.SegCs, cs32 ); ok( ctx.SegDs == context.SegDs, "cs64: wrong ds %04lx / %04x\n", ctx.SegDs, context.SegDs ); @@ -10546,11 +10592,12 @@ static const unsigned test_extended_context_spoil_data2[8] = {0x15, 0x25, 0x35, static BOOL test_extended_context_modified_state; static BOOL xsaveopt_enabled, compaction_enabled; +static ULONG64 xstate_supported_features; static DWORD test_extended_context_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher) { - static const ULONG64 expected_compaction_mask = 0x8000000000000004; + const ULONG64 expected_compaction_mask = (0x8000000000000000 | xstate_supported_features) & ~(ULONG64)3; CONTEXT_EX *xctx = (CONTEXT_EX *)(context + 1); unsigned int *context_ymm_data; DWORD expected_min_offset; @@ -10588,7 +10635,7 @@ static DWORD test_extended_context_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGI if (compaction_enabled) ok((xs->CompactionMask & (expected_compaction_mask | 3)) == expected_compaction_mask, - "Got compaction mask %#I64x.\n", xs->CompactionMask); + "Got compaction mask %#I64x, expected %#I64x.\n", xs->CompactionMask, expected_compaction_mask); else ok(!xs->CompactionMask, "Got compaction mask %#I64x.\n", xs->CompactionMask); @@ -10600,7 +10647,7 @@ static DWORD test_extended_context_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGI } else { - ok(xs->Mask == (xsaveopt_enabled ? 0 : 4), "Got unexpected Mask %#I64x.\n", xs->Mask); + ok((xs->Mask & 7) == (xsaveopt_enabled ? 0 : 4), "Got unexpected Mask %#I64x.\n", xs->Mask); /* The save area has garbage if xsaveopt is available, so we can't test * its contents. */ @@ -10883,7 +10930,8 @@ static void test_extended_context(void) }; const struct context_parameters *context_arch; - const ULONG64 supported_features = 7, supported_compaction_mask = supported_features | ((ULONG64)1 << 63); + const ULONG64 supported_features = 0xff; + const ULONG64 supported_compaction_mask = supported_features | ((ULONG64)1 << 63); ULONG expected_length, expected_length_xstate, context_flags, expected_offset, max_xstate_length; ULONG64 enabled_features, expected_compaction; DECLSPEC_ALIGN(64) BYTE context_buffer2[4096]; @@ -10895,6 +10943,7 @@ static void test_extended_context(void) CONTEXT_EX *context_ex; CONTEXT *context; unsigned data[8]; + NTSTATUS status; HANDLE thread; ULONG64 mask; XSTATE *xs; @@ -10921,6 +10970,7 @@ static void test_extended_context(void) xsaveopt_enabled = regs[0] & 1; compaction_enabled = regs[0] & 2; } + xstate_supported_features = enabled_features & supported_features; /* Test context manipulation functions. */ length = 0xdeadbeef; @@ -11391,7 +11441,7 @@ static void test_extended_context(void) xs->Mask = 0xdeadbeef; xs->CompactionMask = 0xdeadbeef; - bret = pSetXStateFeaturesMask(context, 7); + bret = pSetXStateFeaturesMask(context, xstate_supported_features); ok(bret == !!(flags & CONTEXT_NATIVE), "Got unexpected bret %#x.\n", bret); context_flags = *(DWORD *)(context_buffer + context_arch[test].flags_offset); ok(context_flags == (bret ? flags_fpx : flags), @@ -11405,8 +11455,8 @@ static void test_extended_context(void) mask = 0xdeadbeef; bret = pGetXStateFeaturesMask(context, &mask); if (flags & CONTEXT_NATIVE) - ok(bret && mask == (enabled_features & supported_features), - "Got unexpected bret %#x, mask %s, flags %#lx.\n", bret, wine_dbgstr_longlong(mask), flags); + ok(bret && mask == xstate_supported_features, + "Got unexpected bret %#x, mask %s, flags %#lx (enabled_features & supported_features %#I64x).\n", bret, wine_dbgstr_longlong(mask), flags, xstate_supported_features); else ok(!bret && mask == 0xdeadbeef, "Got unexpected bret %#x, mask %s, flags %#lx.\n", bret, wine_dbgstr_longlong(mask), flags); @@ -11631,6 +11681,14 @@ static void test_extended_context(void) &context, &length); memset(&xs->YmmContext, 0xcc, sizeof(xs->YmmContext)); ok(bret, "Got unexpected bret %#x.\n", bret); + + /* clear potentially leftover xstate */ + pSetXStateFeaturesMask(context, 0); + context->ContextFlags = CONTEXT_XSTATE; + SetThreadContext(GetCurrentThread(), context); + + context->ContextFlags = CONTEXT_FULL | CONTEXT_XSTATE | CONTEXT_FLOATING_POINT; + pSetXStateFeaturesMask(context, ~(ULONG64)0); *(void **)(call_func_code_reset_ymm_state + call_func_offsets.func_addr) = GetThreadContext; *(void **)(call_func_code_reset_ymm_state + call_func_offsets.func_param1) = (void *)GetCurrentThread(); @@ -11648,12 +11706,12 @@ static void test_extended_context(void) ok(context->ContextFlags == expected_flags, "Got unexpected ContextFlags %#lx.\n", context->ContextFlags); - expected_compaction = compaction_enabled ? ((ULONG64)1 << 63) | 4 : 0; + expected_compaction = compaction_enabled ? ((ULONG64)1 << 63) | (xstate_supported_features & ~(UINT64)3) : 0; xs = (XSTATE *)((BYTE *)context_ex + context_ex->XState.Offset); ok((xs->Mask & supported_features) == (xsaveopt_enabled ? 0 : 4), "Got unexpected Mask %#I64x.\n", xs->Mask); ok((xs->CompactionMask & (supported_features | ((ULONG64)1 << 63))) == expected_compaction, - "Got unexpected CompactionMask %s.\n", wine_dbgstr_longlong(xs->CompactionMask)); + "Got unexpected CompactionMask %s (expected %#I64x).\n", wine_dbgstr_longlong(xs->CompactionMask), expected_compaction); for (i = 4; i < 8; ++i) ok(!data[i], "Got unexpected data %#x, i %u.\n", data[i], i); @@ -11663,6 +11721,36 @@ static void test_extended_context(void) || broken(((ULONG *)&xs->YmmContext)[i] == test_extended_context_data[i + 4]), "Got unexpected data %#lx, i %u.\n", ((ULONG *)&xs->YmmContext)[i], i); + /* Test setting context which has only part of xstate in CompactionMask. */ + if (compaction_enabled && enabled_features & ((ULONG64)1 << XSTATE_AVX512_KMASK)) + { + *(void **)(call_func_code_set_ymm0 + call_func_offsets.func_addr) = SetThreadContext; + *(void **)(call_func_code_set_ymm0 + call_func_offsets.func_param1) = (void *)GetCurrentThread(); + *(void **)(call_func_code_set_ymm0 + call_func_offsets.func_param2) = context; + *(void **)(call_func_code_set_ymm0 + call_func_offsets.ymm0_save) = data; + memcpy(code_mem, call_func_code_set_ymm0, sizeof(call_func_code_set_ymm0)); + context->ContextFlags = CONTEXT_XSTATE; + xs->CompactionMask = 0x8000000000000000 | ((ULONG64)1 << XSTATE_AVX512_KMASK); + xs->Mask = 0; + memcpy(data, test_extended_context_data, sizeof(data)); + bret = func(); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); + /* Setting a context with only part of xstate in CompactionMask doesn't change missing parts. */ + for (i = 4; i < 8; ++i) + ok(data[i] == test_extended_context_data[i], "Got unexpected data %#x, i %u.\n", data[i], i); + + memcpy(data, test_extended_context_data, sizeof(data)); + xs->CompactionMask |= XSTATE_MASK_GSSE; + bret = func(); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); + for (i = 4; i < 8; ++i) + ok(!data[i], "Got unexpected data %#x, i %u.\n", data[i], i); + } + else + { + skip("avx512 is not available, skipping test.\n"); + } + /* Test fault exception context. */ memset(data, 0xff, sizeof(data)); xs->Mask = 0; @@ -11688,6 +11776,19 @@ static void test_extended_context(void) thread = CreateThread(NULL, 0, test_extended_context_thread, 0, CREATE_SUSPENDED, NULL); ok(!!thread, "Failed to create thread.\n"); + /* Unaligned xstate. */ + length = sizeof(context_buffer); + memset(context_buffer, 0xcc, sizeof(context_buffer)); + bret = pInitializeContext(context_buffer, CONTEXT_FULL | CONTEXT_XSTATE | CONTEXT_FLOATING_POINT, + &context, &length); + ok(bret, "Got unexpected bret %#x.\n", bret); + context_ex = (CONTEXT_EX *)(context + 1); + context_ex->XState.Offset += 0x10; + status = pNtGetContextThread(thread, context); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#lx.\n", status); + status = pNtGetContextThread(GetCurrentThread(), context); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#lx.\n", status); + bret = pInitializeContext(context_buffer, CONTEXT_FULL | CONTEXT_XSTATE | CONTEXT_FLOATING_POINT, &context, &length); ok(bret, "Got unexpected bret %#x.\n", bret); @@ -11699,9 +11800,10 @@ static void test_extended_context(void) bret = GetThreadContext(thread, context); ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); todo_wine_if (!xsaveopt_enabled) - ok((xs->Mask & supported_features) == (xsaveopt_enabled ? 0 : 4), "Got unexpected Mask %#I64x.\n", xs->Mask); + ok((xs->Mask & supported_features) == (xsaveopt_enabled ? 0 : 4), "Got unexpected Mask %#I64x.\n", xs->Mask); ok((xs->CompactionMask & supported_compaction_mask) == expected_compaction, - "Got unexpected CompactionMask %s.\n", wine_dbgstr_longlong(xs->CompactionMask)); + "Got unexpected CompactionMask %I64x, expected %I64x.\n", xs->CompactionMask, + expected_compaction); for (i = 0; i < 16 * 4; ++i) ok(((ULONG *)&xs->YmmContext)[i] == ((xs->Mask & 4) ? 0 : 0xcccccccc), @@ -11782,6 +11884,44 @@ static void test_extended_context(void) "Got unexpected value %#lx, i %u.\n", ((ULONG *)&xs->YmmContext)[i], i); } + if (compaction_enabled && enabled_features & ((ULONG64)1 << XSTATE_AVX512_KMASK)) + { + ULONG64 saved_mask; + ULONG *d; + + saved_mask = xs->CompactionMask; + xs->Mask = XSTATE_MASK_GSSE; + xs->CompactionMask = 0x8000000000000000 | xs->Mask; + *(ULONG *)&xs->YmmContext = 0x11111111; + bret = SetThreadContext(thread, context); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); + + xs->Mask = (ULONG64)1 << XSTATE_AVX512_KMASK; + xs->CompactionMask = 0x8000000000000000 | xs->Mask; + *(ULONG *)&xs->YmmContext = 0x22222222; + bret = SetThreadContext(thread, context); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); + + xs->CompactionMask = saved_mask; + bret = GetThreadContext(thread, context); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); + + todo_wine_if(xs->Mask == XSTATE_MASK_GSSE) + ok((xs->Mask & (XSTATE_MASK_GSSE | ((ULONG64)1 << XSTATE_AVX512_KMASK))) + == (XSTATE_MASK_GSSE | ((ULONG64)1 << XSTATE_AVX512_KMASK)), "got Mask %#I64x.\n", xs->Mask); + d = pLocateXStateFeature(context, XSTATE_AVX, NULL); + ok(!!d, "Got NULL.\n"); + ok(*d == 0x11111111, "got %#lx.\n", *d); + + d = pLocateXStateFeature(context, XSTATE_AVX512_KMASK, NULL); + ok(!!d, "Got NULL.\n"); + todo_wine ok(*d == 0x22222222, "got %#lx.\n", *d); + } + else + { + skip("avx512 is not available, skipping test.\n"); + } + bret = ResumeThread(thread); ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); @@ -12247,6 +12387,254 @@ static void test_set_live_context(void) } #endif +struct context_exception_request_thread_param +{ + LONG volatile sync; + HANDLE event; +}; +static volatile int *p_context_exception_request_value; +struct context_exception_request_thread_param *context_exception_request_param; + +static LONG CALLBACK test_context_exception_request_handler( EXCEPTION_POINTERS *info ) +{ + PEXCEPTION_RECORD rec = info->ExceptionRecord; + CONTEXT *c = info->ContextRecord; + DWORD old_prot; + + ok( !(c->ContextFlags & (CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE + | CONTEXT_EXCEPTION_ACTIVE)), "got %#lx.\n", c->ContextFlags ); + + ok( rec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION, "got %#lx.\n", rec->ExceptionCode ); + VirtualProtect( (void *)p_context_exception_request_value, sizeof(*p_context_exception_request_value), + PAGE_READWRITE, &old_prot ); + + WriteRelease( &context_exception_request_param->sync, 5 ); + while (ReadAcquire( &context_exception_request_param->sync ) != 6) + ; + + return EXCEPTION_CONTINUE_EXECUTION; +} + +static DWORD WINAPI test_context_exception_request_thread( void *arg ) +{ +#ifndef _WIN64 + static BYTE wait_sync_x64_code[] = + { + 0x89, 0x11, /* mov %edx,(%rcx) */ + 0x83, 0xc2, 0x01, /* add $0x1,%edx */ + 0x0f, 0x1f, 0x00, /* 1: nopl (%rax) */ + 0x8b, 0x01, /* mov (%rcx),%eax */ + 0x39, 0xd0, /* cmp %edx,%eax */ + 0x75, 0xfa, /* jne 1b */ + 0xc3, /* ret */ + }; + ULONG64 args[2]; +#endif + struct context_exception_request_thread_param *p = arg; + void *vectored_handler; + + context_exception_request_param = p; + vectored_handler = pRtlAddVectoredExceptionHandler( TRUE, test_context_exception_request_handler ); + ok( !!vectored_handler, "failed.\n" ); + + WriteRelease( &p->sync, 1 ); + while (ReadAcquire( &p->sync ) != 2) + ; + + WaitForSingleObject( p->event, INFINITE ); + +#ifndef _WIN64 + memcpy( (char *)code_mem + 1024, wait_sync_x64_code, sizeof(wait_sync_x64_code) ); + args[0] = (ULONG_PTR)&p->sync; + args[1] = 3; + if (is_wow64 && !old_wow64) call_func64( (ULONG64)(ULONG_PTR)code_mem + 1024, ARRAY_SIZE(args), args, code_mem ); +#endif + + p_context_exception_request_value = VirtualAlloc( NULL, sizeof(*p_context_exception_request_value), + MEM_RESERVE | MEM_COMMIT, PAGE_READONLY ); + ok( !!p_context_exception_request_value, "got NULL.\n" ); + *p_context_exception_request_value = 1; + ok( *p_context_exception_request_value == 1, "got %d.\n", *p_context_exception_request_value ); + VirtualFree( (void *)p_context_exception_request_value, 0, MEM_RELEASE ); + pRtlRemoveVectoredExceptionHandler( vectored_handler ); + +#ifndef _WIN64 + args[1] = 7; + if (is_wow64 && !old_wow64) call_func64( (ULONG64)(ULONG_PTR)code_mem + 1024, ARRAY_SIZE(args), args, code_mem ); +#endif + + return 0; +} + +static void test_context_exception_request(void) +{ + struct context_exception_request_thread_param p; + DWORD expected_flags; + HANDLE thread; + CONTEXT c; + BOOL ret; + + if (!pRtlAddVectoredExceptionHandler || !pRtlRemoveVectoredExceptionHandler) + { + skip( "RtlAddVectoredExceptionHandler or RtlRemoveVectoredExceptionHandler not found.\n" ); + return; + } + + c.ContextFlags = CONTEXT_CONTROL; + ret = GetThreadContext( GetCurrentThread(), &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == CONTEXT_CONTROL, "got %#lx.\n", c.ContextFlags ); + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( GetCurrentThread(), &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags || broken( c.ContextFlags == 0x10001 ) /* Win7 WoW64 */, + "got %#lx.\n", c.ContextFlags ); + if (c.ContextFlags == 0x10001) + { + win_skip( "Old WoW64 behaviour, skipping tests.\n" ); + return; + } + + ret = DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &thread, 0, TRUE, DUPLICATE_SAME_ACCESS ); + ok( ret, "got error %lu.\n", GetLastError() ); + c.ContextFlags = expected_flags | CONTEXT_EXCEPTION_REQUEST; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + CloseHandle( thread ); + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE + | CONTEXT_EXCEPTION_ACTIVE; + ret = GetThreadContext( GetCurrentThread(), &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + p.event = CreateEventW( NULL, FALSE, FALSE, NULL ); + thread = CreateThread( NULL, 0, test_context_exception_request_thread, &p, CREATE_SUSPENDED, NULL ); + ok( !!thread, "got error %lu.\n", GetLastError() ); + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags || broken( c.ContextFlags == (CONTEXT_CONTROL + | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING)) /* Win7 64 */, "got %#lx.\n", c.ContextFlags ); + + p.sync = 0; + ResumeThread(thread); + + while (ReadAcquire( &p.sync ) != 1) + SwitchToThread(); + /* thread is in user code. */ + SuspendThread( thread ); + + c.ContextFlags = CONTEXT_CONTROL; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == CONTEXT_CONTROL, "got %#lx.\n", c.ContextFlags ); + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE; + ret = SetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE + | CONTEXT_EXCEPTION_ACTIVE; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + ResumeThread(thread); + WriteRelease( &p.sync, 2 ); + /* Try to make sure the thread entered WaitForSingleObject(). */ + Sleep(30); + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + c.ContextFlags = CONTEXT_CONTROL; + ret = SetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE + | CONTEXT_EXCEPTION_ACTIVE; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + SetEvent( p.event ); + + if (is_wow64 && !old_wow64) + { + while (ReadAcquire( &p.sync ) != 3) + SwitchToThread(); + /* thread is in x64 code. */ + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags ); + + WriteRelease( &p.sync, 4 ); + } + + while (ReadAcquire( &p.sync ) != 5) + SwitchToThread(); + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE + | CONTEXT_EXCEPTION_ACTIVE; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags ); + + WriteRelease( &p.sync, 6 ); + + if (is_wow64 && !old_wow64) + { + while (ReadAcquire( &p.sync ) != 7) + SwitchToThread(); + /* thread is in x64 code. */ + + expected_flags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + + c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST; + ret = GetThreadContext( thread, &c ); + ok( ret, "got error %lu.\n", GetLastError() ); + ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags ); + + WriteRelease( &p.sync, 8 ); + } + + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); + CloseHandle( p.event ); +} + START_TEST(exception) { HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); @@ -12523,5 +12911,6 @@ START_TEST(exception) test_suspend_thread(); test_suspend_process(); test_unload_trace(); + test_context_exception_request(); VirtualFree(code_mem, 0, MEM_RELEASE); } diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index da3611f74f2..c8e598b9288 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -136,25 +136,49 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved ) static void create_file_test(void) { + static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0}; static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t', '\\','f','a','i','l','i','n','g',0}; + static const WCHAR systemrootExplorerW[] = {'\\','S','y','s','t','e','m','R','o','o','t', + '\\','e','x','p','l','o','r','e','r','.','e','x','e',0}; static const WCHAR questionmarkInvalidNameW[] = {'a','f','i','l','e','?',0}; static const WCHAR pipeInvalidNameW[] = {'a','|','b',0}; static const WCHAR pathInvalidNtW[] = {'\\','\\','?','\\',0}; static const WCHAR pathInvalidNt2W[] = {'\\','?','?','\\',0}; static const WCHAR pathInvalidDosW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; static const char testdata[] = "Hello World"; + static const WCHAR sepW[] = {'\\',0}; FILE_NETWORK_OPEN_INFORMATION info; + UNICODE_STRING nameW, null_string; NTSTATUS status; HANDLE dir, file; - WCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH], temp[MAX_PATH]; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; - UNICODE_STRING nameW; LARGE_INTEGER offset; char buf[32]; DWORD ret; + attr.Length = sizeof(attr); + attr.RootDirectory = NULL; + attr.ObjectName = &null_string; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + null_string.Buffer = NULL; + null_string.Length = 256; + + /* try various open modes and options on directories */ + status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_ACCESS_VIOLATION, "Got unexpected status %#x.\n", status ); + + null_string.Length = 0; + status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "Got unexpected status %#x.\n", status ); + GetCurrentDirectoryW( MAX_PATH, path ); pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); attr.Length = sizeof(attr); @@ -327,6 +351,25 @@ static void create_file_test(void) status = pNtQueryFullAttributesFile( &attr, &info ); ok( status == STATUS_OBJECT_NAME_INVALID, "query %s failed %lx\n", wine_dbgstr_w(nameW.Buffer), status ); + + GetWindowsDirectoryW( path, MAX_PATH ); + path[2] = 0; + ok( QueryDosDeviceW( path, temp, MAX_PATH ), + "QueryDosDeviceW failed with error %u\n", GetLastError() ); + lstrcatW( temp, sepW ); + lstrcatW( temp, path+3 ); + lstrcatW( temp, sepW ); + lstrcatW( temp, notepadW ); + + pRtlInitUnicodeString( &nameW, temp ); + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_SUCCESS, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + pRtlInitUnicodeString( &nameW, systemrootExplorerW ); + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_SUCCESS, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); } static void open_file_test(void) @@ -4735,6 +4778,83 @@ static void test_NtCreateFile(void) RemoveDirectoryW( path ); } +static void test_readonly(void) +{ + static const WCHAR fooW[] = {'f','o','o',0}; + NTSTATUS status; + HANDLE handle; + WCHAR path[MAX_PATH]; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK io; + UNICODE_STRING nameW; + + GetTempPathW(MAX_PATH, path); + GetTempFileNameW(path, fooW, 0, path); + DeleteFileW(path); + pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL); + + attr.Length = sizeof(attr); + attr.RootDirectory = NULL; + attr.ObjectName = &nameW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = pNtCreateFile(&handle, GENERIC_READ, &attr, &io, NULL, FILE_ATTRIBUTE_READONLY, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_CREATE, 0, NULL, 0); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, GENERIC_WRITE, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_ACCESS_DENIED, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, GENERIC_READ, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, FILE_READ_ATTRIBUTES, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, FILE_WRITE_ATTRIBUTES, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, DELETE, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, READ_CONTROL, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, WRITE_DAC, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, WRITE_OWNER, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle(handle); + + status = pNtOpenFile(&handle, SYNCHRONIZE, &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); + ok(status == STATUS_SUCCESS, "got %#x\n", status); + CloseHandle( handle ); + + pRtlFreeUnicodeString(&nameW); + SetFileAttributesW(path, FILE_ATTRIBUTE_ARCHIVE); + DeleteFileW(path); +} + static void test_read_write(void) { static const char contents[14] = "1234567890abcd"; @@ -5875,6 +5995,7 @@ START_TEST(file) test_read_write(); test_NtCreateFile(); + test_readonly(); create_file_test(); open_file_test(); delete_file_test(); diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 68a9f165bfd..c574285abe8 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -21,6 +21,7 @@ #include "ntdll_test.h" #include #include +#include static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG); @@ -46,6 +47,7 @@ static NTSTATUS (WINAPI * pNtSetInformationDebugObject)(HANDLE,DEBUGOBJECTINFOCL static NTSTATUS (WINAPI * pDbgUiConvertStateChangeStructure)(DBGUI_WAIT_STATE_CHANGE*,DEBUG_EVENT*); static HANDLE (WINAPI * pDbgUiGetThreadDebugObject)(void); static void (WINAPI * pDbgUiSetThreadDebugObject)(HANDLE); +static NTSTATUS (WINAPI * pNtSystemDebugControl)(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG); static BOOL is_wow64; static BOOL old_wow64; @@ -101,6 +103,7 @@ static void InitFunctionPtrs(void) NTDLL_GET_PROC(DbgUiConvertStateChangeStructure); NTDLL_GET_PROC(DbgUiGetThreadDebugObject); NTDLL_GET_PROC(DbgUiSetThreadDebugObject); + NTDLL_GET_PROC(NtSystemDebugControl); if (!IsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; @@ -3735,6 +3738,154 @@ static void test_ThreadIsTerminated(void) ok( status == STATUS_INVALID_HANDLE, "got %#lx.\n", status ); } +static void test_system_debug_control(void) +{ + NTSTATUS status; + int class; + + for (class = 0; class <= SysDbgSetKdBlockEnable; ++class) + { + status = pNtSystemDebugControl( class, NULL, 0, NULL, 0, NULL ); + if (is_wow64) + { + /* Most of the calls return STATUS_NOT_IMPLEMENTED on wow64. */ + ok( status == STATUS_DEBUGGER_INACTIVE || status == STATUS_NOT_IMPLEMENTED || status == STATUS_INFO_LENGTH_MISMATCH, + "class %d, got %#lx.\n", class, status ); + } + else + { + ok( status == STATUS_DEBUGGER_INACTIVE || status == STATUS_ACCESS_DENIED, "class %d, got %#lx.\n", class, status ); + } + } +} + +static void test_process_id(void) +{ + char image_name_buffer[1024 * sizeof(WCHAR)]; + UNICODE_STRING *image_name = (UNICODE_STRING *)image_name_buffer; + SYSTEM_PROCESS_ID_INFORMATION info; + unsigned int i, length; + DWORD pids[2048]; + WCHAR name[2048]; + NTSTATUS status; + HANDLE process; + ULONG len; + BOOL bret; + + status = NtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileName, image_name, + sizeof(image_name_buffer), NULL ); + ok( !status, "got %#lx.\n", status ); + length = image_name->Length; + image_name->Buffer[length] = 0; + + len = 0xdeadbeef; + status = pNtQuerySystemInformation( SystemProcessIdInformation, NULL, 0, &len ); + ok( status == STATUS_INFO_LENGTH_MISMATCH || (is_wow64 && status == STATUS_ACCESS_VIOLATION), "got %#lx.\n", status ); + ok( len == sizeof(info) || (is_wow64 && len == 0xdeadbeef), "got %#lx.\n", len ); + + info.ProcessId = (void *)0xdeadbeef; + info.ImageName.Length = info.ImageName.MaximumLength = 0; + info.ImageName.Buffer = NULL; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_INVALID_CID, "got %#lx.\n", status ); + ok( !info.ImageName.Length, "got %#x.\n", info.ImageName.Length ); + ok( !info.ImageName.MaximumLength, "got %#x.\n", info.ImageName.MaximumLength ); + + info.ProcessId = (void *)(ULONG_PTR)GetCurrentProcessId(); + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "got %#lx.\n", status ); + ok( len == sizeof(info), "got %#lx.\n", len ); + ok( !info.ImageName.Length, "got %#x.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == length + 2 || (is_wow64 && !info.ImageName.MaximumLength), + "got %#x.\n", info.ImageName.MaximumLength ); + + info.ImageName.MaximumLength = sizeof(name); + len = 0xdeadbeef; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_ACCESS_VIOLATION, "got %#lx.\n", status ); + ok( len == sizeof(info), "got %#lx.\n", len ); + ok( info.ImageName.Length == length || (is_wow64 && !info.ImageName.Length), + "got %u.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == length + 2 || (is_wow64 && !info.ImageName.Length), + "got %#x.\n", info.ImageName.MaximumLength ); + + info.ProcessId = (void *)0xdeadbeef; + info.ImageName.MaximumLength = sizeof(name); + info.ImageName.Buffer = name; + info.ImageName.Length = 0; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_INVALID_CID, "got %#lx.\n", status ); + ok( !info.ImageName.Length, "got %#x.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == sizeof(name), "got %#x.\n", info.ImageName.MaximumLength ); + ok( info.ImageName.Buffer == name, "got %p, %p.\n", info.ImageName.Buffer, name ); + + info.ProcessId = NULL; + info.ImageName.MaximumLength = sizeof(name); + info.ImageName.Buffer = name; + info.ImageName.Length = 0; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_INVALID_CID, "got %#lx.\n", status ); + ok( !info.ImageName.Length, "got %#x.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == sizeof(name), "got %#x.\n", info.ImageName.MaximumLength ); + ok( info.ImageName.Buffer == name, "got non NULL.\n" ); + + info.ProcessId = NULL; + info.ImageName.MaximumLength = sizeof(name); + info.ImageName.Buffer = name; + info.ImageName.Length = 4; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( status == STATUS_INVALID_PARAMETER, "got %#lx.\n", status ); + ok( info.ImageName.Length == 4, "got %#x.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == sizeof(name), "got %#x.\n", info.ImageName.MaximumLength ); + ok( info.ImageName.Buffer == name, "got non NULL.\n" ); + + info.ProcessId = (void *)(ULONG_PTR)GetCurrentProcessId(); + info.ImageName.MaximumLength = sizeof(name); + info.ImageName.Buffer = name; + info.ImageName.Length = 4; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), NULL ); + ok( status == STATUS_INVALID_PARAMETER, "got %#lx.\n", status ); + ok( info.ImageName.Length == 4, "got %#x.\n", info.ImageName.Length ); + ok( info.ImageName.MaximumLength == sizeof(name), "got %#x.\n", info.ImageName.MaximumLength ); + + info.ImageName.Length = 0; + memset( name, 0xcc, sizeof(name) ); + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( !status, "got %#lx.\n", status ); + ok( info.ImageName.Length == length, "got %#x.\n", info.ImageName.Length ); + ok( len == sizeof(info), "got %#lx.\n", len ); + ok( info.ImageName.MaximumLength == info.ImageName.Length + 2, "got %#x.\n", info.ImageName.MaximumLength ); + ok( !name[info.ImageName.Length / 2], "got %#x.\n", name[info.ImageName.Length / 2] ); + + ok( info.ImageName.Length == image_name->Length, "got %#x, %#x.\n", info.ImageName.Length, image_name->Length ); + ok( !wcscmp( name, image_name->Buffer ), "got %s, %s.\n", debugstr_w(name), debugstr_w(image_name->Buffer) ); + + bret = EnumProcesses( pids, sizeof(pids), &len ); + ok( bret, "got error %lu.\n", GetLastError() ); + for (i = 0; i < len / sizeof(*pids); ++i) + { + process = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pids[i] ); + if (pids[i] && !process && GetLastError() != ERROR_ACCESS_DENIED) + { + /* process is gone already. */ + continue; + } + info.ProcessId = (void *)(ULONG_PTR)pids[i]; + info.ImageName.Length = 0; + info.ImageName.MaximumLength = sizeof(name); + info.ImageName.Buffer = name; + status = pNtQuerySystemInformation( SystemProcessIdInformation, &info, sizeof(info), &len ); + ok( info.ImageName.Buffer == name || (!info.ImageName.MaximumLength && !info.ImageName.Length), + "got %p, %p, pid %lu, lengh %u / %u.\n", info.ImageName.Buffer, name, pids[i], + info.ImageName.Length, info.ImageName.MaximumLength ); + if (pids[i]) + ok( !status, "got %#lx, pid %lu.\n", status, pids[i] ); + else + ok( status == STATUS_INVALID_CID, "got %#lx, pid %lu.\n", status, pids[i] ); + if (process) CloseHandle( process ); + } +} + START_TEST(info) { char **argv; @@ -3810,4 +3961,6 @@ START_TEST(info) test_ThreadEnableAlignmentFaultFixup(); test_process_instrumentation_callback(); + test_system_debug_control(); + test_process_id(); } diff --git a/dlls/ntdll/tests/ntdll_test.h b/dlls/ntdll/tests/ntdll_test.h index 67278358b29..ed824583870 100644 --- a/dlls/ntdll/tests/ntdll_test.h +++ b/dlls/ntdll/tests/ntdll_test.h @@ -30,3 +30,5 @@ #include "wine/test.h" #include "wine/heap.h" + +extern NTSTATUS call_func64( ULONG64 func64, int nb_args, ULONG64 *args, void *code_mem ); diff --git a/dlls/ntdll/tests/sync.c b/dlls/ntdll/tests/sync.c index f356d3ec38f..95229f2513d 100644 --- a/dlls/ntdll/tests/sync.c +++ b/dlls/ntdll/tests/sync.c @@ -837,6 +837,70 @@ static void test_tid_alert( char **argv ) CloseHandle( pi.hThread ); } +static HANDLE test_close_io_completion_port_ready, test_close_io_completion_test_ready; +static HANDLE test_close_io_completion_port; + +static DWORD WINAPI test_close_io_completion_thread(void *param) +{ + FILE_IO_COMPLETION_INFORMATION info; + IO_STATUS_BLOCK iosb; + ULONG_PTR key, value; + NTSTATUS status; + ULONG count; + DWORD ret; + + ret = WaitForSingleObject( test_close_io_completion_port_ready, INFINITE ); + ok( ret == WAIT_OBJECT_0, "Got unexpected ret %#x.\n", ret ); + SetEvent( test_close_io_completion_test_ready ); + status = NtRemoveIoCompletion( test_close_io_completion_port, &key, &value, &iosb, NULL ); + if (status == STATUS_INVALID_HANDLE) + skip( "Handle closed before wait started.\n" ); + else + ok( status == STATUS_ABANDONED_WAIT_0, "Got unexpected status %#x.\n", status ); + + ret = WaitForSingleObject( test_close_io_completion_port_ready, INFINITE ); + ok( ret == WAIT_OBJECT_0, "Got unexpected ret %#x.\n", ret ); + SetEvent( test_close_io_completion_test_ready ); + count = 0xdeadbeef; + status = NtRemoveIoCompletionEx( test_close_io_completion_port, &info, 1, &count, NULL, FALSE ); + ok( count == 1, "Got unexpected count %u.\n", count ); + if (status == STATUS_INVALID_HANDLE) + skip( "Handle closed before wait started.\n" ); + else + ok( status == STATUS_ABANDONED_WAIT_0, "Got unexpected status %#x.\n", status ); + + return 0; +} + +static void test_close_io_completion(void) +{ + NTSTATUS status; + unsigned int i; + HANDLE thread; + DWORD ret; + + test_close_io_completion_port_ready = CreateEventA(NULL, FALSE, FALSE, NULL); + test_close_io_completion_test_ready = CreateEventA(NULL, FALSE, FALSE, NULL); + + thread = CreateThread( NULL, 0, test_close_io_completion_thread, NULL, 0, NULL ); + ok( !!thread, "Failed to create thread, error %u.\n", GetLastError() ); + + for (i = 0; i < 2; ++i) + { + status = NtCreateIoCompletion( &test_close_io_completion_port, IO_COMPLETION_ALL_ACCESS, NULL, 0 ); + ok( !status, "Got unexpected status %#x.\n", status ); + ret = SignalObjectAndWait( test_close_io_completion_port_ready, test_close_io_completion_test_ready, + INFINITE, FALSE ); + ok( ret == WAIT_OBJECT_0, "Got unexpected ret %#x.\n", ret ); + Sleep(10); + status = pNtClose( test_close_io_completion_port ); + ok( !status, "Got unexpected status %#x.\n", status ); + } + + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); +} + START_TEST(sync) { HMODULE module = GetModuleHandleA("ntdll.dll"); @@ -884,4 +948,5 @@ START_TEST(sync) test_keyed_events(); test_resource(); test_tid_alert( argv ); + test_close_io_completion(); } diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 01cd0cad035..1d48918165e 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -1440,7 +1440,7 @@ static const BYTE call_func64_code[] = 0xcb, /* lret */ }; -static NTSTATUS call_func64( ULONG64 func64, int nb_args, ULONG64 *args ) +NTSTATUS call_func64( ULONG64 func64, int nb_args, ULONG64 *args, void *code_mem ) { NTSTATUS (WINAPI *func)( ULONG64 func64, int nb_args, ULONG64 *args ) = code_mem; @@ -1940,7 +1940,7 @@ static void test_iosb(void) iosb64.Information = 0xdeadbeef; args[0] = (LONG_PTR)server; - status = call_func64( func, ARRAY_SIZE(args), args ); + status = call_func64( func, ARRAY_SIZE(args), args, code_mem ); ok( status == STATUS_PENDING, "NtFsControlFile returned %lx\n", status ); ok( iosb32.Status == 0x55555555, "status changed to %lx\n", iosb32.Status ); ok( iosb64.Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", iosb64.Status ); @@ -1965,7 +1965,7 @@ static void test_iosb(void) args[8] = (ULONG_PTR)&id; args[9] = sizeof(id); - status = call_func64( func, ARRAY_SIZE(args), args ); + status = call_func64( func, ARRAY_SIZE(args), args, code_mem ); ok( status == STATUS_PENDING || status == STATUS_SUCCESS, "NtFsControlFile returned %lx\n", status ); todo_wine { @@ -1995,7 +1995,7 @@ static void test_iosb(void) id = 0xdeadbeef; args[0] = (LONG_PTR)server; - status = call_func64( func, ARRAY_SIZE(args), args ); + status = call_func64( func, ARRAY_SIZE(args), args, code_mem ); ok( status == STATUS_SUCCESS, "NtFsControlFile returned %lx\n", status ); ok( iosb32.Status == 0x55555555, "status changed to %lx\n", iosb32.Status ); ok( iosb32.Information == 0x55555555, "info changed to %Ix\n", iosb32.Information ); @@ -2018,7 +2018,7 @@ static NTSTATUS invoke_syscall( const char *name, ULONG args32[] ) else win_skip( "syscall thunk %s not recognized\n", name ); - return call_func64( func, ARRAY_SIZE(args64), args64 ); + return call_func64( func, ARRAY_SIZE(args64), args64, code_mem ); } static void test_syscalls(void) @@ -2124,14 +2124,14 @@ static void test_cpu_area(void) ULONG64 context, context_ex; ULONG64 args[] = { (ULONG_PTR)&machine, (ULONG_PTR)&context, (ULONG_PTR)&context_ex }; - status = call_func64( ptr, ARRAY_SIZE(args), args ); + status = call_func64( ptr, ARRAY_SIZE(args), args, code_mem ); ok( !status, "RtlWow64GetCpuAreaInfo failed %lx\n", status ); ok( machine == IMAGE_FILE_MACHINE_I386, "wrong machine %x\n", machine ); ok( context == teb64->TlsSlots[WOW64_TLS_CPURESERVED] + 4, "wrong context %s / %s\n", wine_dbgstr_longlong(context), wine_dbgstr_longlong(teb64->TlsSlots[WOW64_TLS_CPURESERVED]) ); ok( !context_ex, "got context_ex %s\n", wine_dbgstr_longlong(context_ex) ); args[0] = args[1] = args[2] = 0; - status = call_func64( ptr, ARRAY_SIZE(args), args ); + status = call_func64( ptr, ARRAY_SIZE(args), args, code_mem ); ok( !status, "RtlWow64GetCpuAreaInfo failed %lx\n", status ); } else win_skip( "RtlWow64GetCpuAreaInfo not supported\n" ); diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 1206d5b24b8..d98c94ff85f 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(thread); WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000; @@ -142,7 +143,14 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_ /* only print header if we are at the beginning of the line */ if (info->out_pos) return 0; - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + LARGE_INTEGER counter, frequency, microsecs; + NtQueryPerformanceCounter(&counter, &frequency); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { ULONG ticks = NtGetTickCount(); pos += sprintf( pos, "%3lu.%03lu:", ticks / 1000, ticks % 1000 ); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 4f22114a55e..2887e84b12c 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -160,6 +160,7 @@ struct threadpool_object LONG num_pending_callbacks; LONG num_running_callbacks; LONG num_associated_callbacks; + LONG update_serial; /* arguments for callback */ union { @@ -1243,6 +1244,7 @@ static void tp_timerqueue_unlock( struct threadpool_object *timer ) static void CALLBACK waitqueue_thread_proc( void *param ) { struct threadpool_object *objects[MAXIMUM_WAITQUEUE_OBJECTS]; + LONG update_serials[MAXIMUM_WAITQUEUE_OBJECTS]; HANDLE handles[MAXIMUM_WAITQUEUE_OBJECTS + 1]; struct waitqueue_bucket *bucket = param; struct threadpool_object *wait, *next; @@ -1265,6 +1267,7 @@ static void CALLBACK waitqueue_thread_proc( void *param ) u.wait.wait_entry ) { assert( wait->type == TP_OBJECT_TYPE_WAIT ); + assert( wait->u.wait.wait_pending ); if (wait->u.wait.timeout <= now.QuadPart) { /* Wait object timed out. */ @@ -1272,6 +1275,7 @@ static void CALLBACK waitqueue_thread_proc( void *param ) { list_remove( &wait->u.wait.wait_entry ); list_add_tail( &bucket->reserved, &wait->u.wait.wait_entry ); + wait->u.wait.wait_pending = FALSE; } if ((wait->u.wait.flags & (WT_EXECUTEINWAITTHREAD | WT_EXECUTEINIOTHREAD))) { @@ -1293,6 +1297,7 @@ static void CALLBACK waitqueue_thread_proc( void *param ) InterlockedIncrement( &wait->refcount ); objects[num_handles] = wait; handles[num_handles] = wait->u.wait.handle; + update_serials[num_handles] = wait->update_serial; num_handles++; } } @@ -1321,7 +1326,7 @@ static void CALLBACK waitqueue_thread_proc( void *param ) { wait = objects[status - STATUS_WAIT_0]; assert( wait->type == TP_OBJECT_TYPE_WAIT ); - if (wait->u.wait.bucket) + if (wait->u.wait.bucket && wait->update_serial == update_serials[status - STATUS_WAIT_0]) { /* Wait object signaled. */ assert( wait->u.wait.bucket == bucket ); @@ -1329,6 +1334,7 @@ static void CALLBACK waitqueue_thread_proc( void *param ) { list_remove( &wait->u.wait.wait_entry ); list_add_tail( &bucket->reserved, &wait->u.wait.wait_entry ); + wait->u.wait.wait_pending = FALSE; } if ((wait->u.wait.flags & (WT_EXECUTEINWAITTHREAD | WT_EXECUTEINIOTHREAD))) { @@ -1341,7 +1347,10 @@ static void CALLBACK waitqueue_thread_proc( void *param ) else tp_object_submit( wait, TRUE ); } else - WARN("wait object %p triggered while object was destroyed\n", wait); + { + WARN("wait object %p triggered while object was %s.\n", + wait, wait->u.wait.bucket ? "updated" : "destroyed"); + } } /* Release temporary references to wait objects. */ @@ -1914,6 +1923,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa object->num_pending_callbacks = 0; object->num_running_callbacks = 0; object->num_associated_callbacks = 0; + object->update_serial = 0; if (environment) { @@ -3048,12 +3058,15 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout ) { struct threadpool_object *this = impl_from_TP_WAIT( wait ); ULONGLONG timestamp = MAXLONGLONG; + BOOL same_handle; TRACE( "%p %p %p\n", wait, handle, timeout ); RtlEnterCriticalSection( &waitqueue.cs ); assert( this->u.wait.bucket ); + + same_handle = this->u.wait.handle == handle; this->u.wait.handle = handle; if (handle || this->u.wait.wait_pending) @@ -3087,6 +3100,8 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout ) } /* Wake up the wait queue thread. */ + if (!same_handle) + ++this->update_serial; NtSetEvent( bucket->update_event, NULL ); } diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index e73ee05fc03..73c2084d025 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -44,6 +45,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); WINE_DEFAULT_DEBUG_CHANNEL(ntdll); struct debug_info @@ -274,6 +276,59 @@ NTSTATUS unixcall_wine_dbg_write( void *args ) return write( 2, params->str, params->len ); } +unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ) +{ + static unsigned int curr_ctx; + static int ftrace_fd = -1; + unsigned int str_len; + char ctx_str[64]; + int ctx_len; + + if (ftrace_fd == -1) + { + int expected = -1; + const char *fn; + int fd; + + if (!(fn = getenv( "WINE_FTRACE_FILE" ))) + { + MESSAGE( "wine: WINE_FTRACE_FILE is not set.\n" ); + ftrace_fd = -2; + return 0; + } + if ((fd = open( fn, O_WRONLY )) == -1) + { + MESSAGE( "wine: error opening ftrace file: %s.\n", strerror(errno) ); + ftrace_fd = -2; + return 0; + } + if (!__atomic_compare_exchange_n( &ftrace_fd, &expected, fd, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST )) + close( fd ); + else + MESSAGE( "wine: ftrace initialized.\n" ); + } + if (ftrace_fd == -2) return ~0u; + + if (ctx == ~0u) ctx_len = 0; + else if (ctx) ctx_len = sprintf( ctx_str, " (end_ctx=%u)", ctx ); + else + { + ctx = __atomic_add_fetch( &curr_ctx, 1, __ATOMIC_SEQ_CST ); + ctx_len = sprintf( ctx_str, " (begin_ctx=%u)", ctx ); + } + + str_len = strlen(str); + if (ctx_len > 0) + { + if (str_size < ctx_len) return ~0u; + if (str_len + ctx_len > str_size) str_len = str_size - ctx_len; + memcpy( &str[str_len], ctx_str, ctx_len ); + str_len += ctx_len; + } + write( ftrace_fd, str, str_len ); + return ctx; +} + #ifdef _WIN64 /*********************************************************************** * wow64_wine_dbg_write @@ -327,7 +382,14 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_ if (init_done) { - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + LARGE_INTEGER counter, frequency, microsecs; + NtQueryPerformanceCounter(&counter, &frequency); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { UINT ticks = NtGetTickCount(); pos += snprintf( pos, sizeof(info->output) - (pos - info->output), "%3u.%03u:", ticks / 1000, ticks % 1000 ); diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ad9ab0dc220..c2c46dd0a12 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -59,6 +59,7 @@ #include "error.h" WINE_DEFAULT_DEBUG_CHANNEL(environ); +WINE_DECLARE_DEBUG_CHANNEL(nls); PEB *peb = NULL; WOW_PEB *wow_peb = NULL; @@ -275,13 +276,14 @@ static const struct { const char *name; UINT cp; } charset_names[] = static void init_unix_codepage(void) { + const char *name, *ctype; char charset_name[16]; - const char *name; size_t i, j; int min = 0, max = ARRAY_SIZE(charset_names) - 1; - setlocale( LC_CTYPE, "" ); - if (!(name = nl_langinfo( CODESET ))) return; + if (!(ctype = setlocale( LC_CTYPE, "" ))) name = "UTF-8"; + else if (!(name = nl_langinfo( CODESET ))) return; + TRACE_(nls)( "Unix LC_CTYPE %s, using %s codeset\n", debugstr_a(ctype), debugstr_a(name) ); /* remove punctuation characters from charset name */ for (i = j = 0; name[i] && j < sizeof(charset_name)-1; i++) @@ -341,6 +343,7 @@ static BOOL is_special_env_var( const char *var ) STARTS_WITH( var, "TEMP=" ) || STARTS_WITH( var, "TMP=" ) || STARTS_WITH( var, "QT_" ) || + STARTS_WITH( var, "SDL_AUDIODRIVER=" ) || STARTS_WITH( var, "VK_" )); } @@ -396,7 +399,7 @@ DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen ) */ int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict ) { - unsigned int i, reslen; + unsigned int i, reslen = 0; if (unix_cp.CodePage != CP_UTF8) { @@ -797,13 +800,22 @@ static const NLS_LOCALE_DATA *get_win_locale( const NLS_LOCALE_HEADER *header, c static void init_locale(void) { struct locale_nls_header *header; + const char *all, *ctype, *messages; const NLS_LOCALE_HEADER *locale_table; const NLS_LOCALE_DATA *locale; char *p; - setlocale( LC_ALL, "" ); - if (!unix_to_win_locale( setlocale( LC_CTYPE, NULL ), system_locale )) system_locale[0] = 0; - if (!unix_to_win_locale( setlocale( LC_MESSAGES, NULL ), user_locale )) user_locale[0] = 0; + if (!(all = setlocale( LC_ALL, "" )) && (all = getenv( "LC_ALL" ))) + FIXME_(nls)( "Failed to set LC_ALL to %s, is the locale supported?\n", debugstr_a(all) ); + if (!(ctype = setlocale( LC_CTYPE, "" )) && (ctype = getenv( "LC_CTYPE" ))) + FIXME_(nls)( "Failed to set LC_CTYPE to %s, is the locale supported?\n", debugstr_a(ctype) ); + if (!(messages = setlocale( LC_MESSAGES, "" )) && (messages = getenv( "LC_MESSAGES" ))) + FIXME_(nls)( "Failed to set LC_MESSAGES to %s, is the locale supported?\n", debugstr_a(messages) ); + + if (!unix_to_win_locale( ctype, system_locale )) system_locale[0] = 0; + TRACE_(nls)( "Unix LC_CTYPE is %s, setting system locale to %s\n", debugstr_a(ctype), debugstr_a(user_locale) ); + if (!unix_to_win_locale( messages, user_locale )) user_locale[0] = 0; + TRACE_(nls)( "Unix LC_MESSAGES is %s, user system locale to %s\n", debugstr_a(messages), debugstr_a(user_locale) ); #ifdef __APPLE__ if (!system_locale[0]) @@ -1382,6 +1394,27 @@ static void add_registry_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) } } +static void get_std_handle( int fd, unsigned int access, unsigned int attributes, HANDLE *handle ) +{ + IO_STATUS_BLOCK io; + FILE_POSITION_INFORMATION pos_info; + FILE_NAME_INFORMATION name_info; + NTSTATUS status; + + wine_server_fd_to_handle( fd, access, attributes, handle ); + if (!*handle) return; + + /* Python checks if a file is seekable and if so expects the file name to be gettable from handle. */ + if (NtQueryInformationFile( *handle, &io, &pos_info, sizeof(pos_info), FilePositionInformation )) + return; + + TRACE("handle for fd %d is seekable.\n", fd); + if (!(status = NtQueryInformationFile( *handle, &io, &name_info, sizeof(name_info), FileNameInformation )) + || status == STATUS_BUFFER_OVERFLOW) return; + TRACE("closing handle for fd %d.\n", fd); + NtClose( *handle ); + *handle = NULL; +} /************************************************************************* * get_initial_console @@ -1392,9 +1425,9 @@ static void get_initial_console( RTL_USER_PROCESS_PARAMETERS *params ) { int output_fd = -1; - wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput ); - wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput ); - wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); + get_std_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput ); + get_std_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput ); + get_std_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); if (main_image_info.SubSystemType != IMAGE_SUBSYSTEM_WINDOWS_CUI) return; @@ -2467,3 +2500,14 @@ void WINAPI RtlSetLastWin32Error( DWORD err ) #endif teb->LastErrorValue = err; } + + +/********************************************************************** + * __wine_set_unix_env (ntdll.so) + */ +NTSTATUS WINAPI __wine_set_unix_env( const char *var, const char *val ) +{ + if (!val) unsetenv(var); + else setenv(var, val, 1); + return 0; +} diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c new file mode 100644 index 00000000000..3074f7c72ea --- /dev/null +++ b/dlls/ntdll/unix/esync.c @@ -0,0 +1,1354 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#include +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" +#include "wine/server.h" +#include "wine/debug.h" + +#include "unix_private.h" +#include "esync.h" +#include "fsync.h" + +WINE_DEFAULT_DEBUG_CHANNEL(esync); + +int do_esync(void) +{ +#ifdef HAVE_SYS_EVENTFD_H + static int do_esync_cached = -1; + + if (do_esync_cached == -1) + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")) && !do_fsync(); + + return do_esync_cached; +#else + static int once; + if (!once++) + FIXME("eventfd not supported on this platform.\n"); + return 0; +#endif +} + +struct esync +{ + enum esync_type type; + int fd; + void *shm; +}; + +struct semaphore +{ + int max; + int count; +}; +C_ASSERT(sizeof(struct semaphore) == 8); + +struct mutex +{ + DWORD tid; + int count; /* recursion count */ +}; +C_ASSERT(sizeof(struct mutex) == 8); + +struct event +{ + int signaled; + int locked; +}; +C_ASSERT(sizeof(struct event) == 8); + +static char shm_name[29]; +static int shm_fd; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + void *ret; + + pthread_mutex_lock( &shm_addrs_mutex ); + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + ERR("Failed to grow shm_addrs array to size %d.\n", shm_addrs_size); + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + ERR("Failed to map page %d (offset %#lx).\n", entry, entry * pagesize); + + TRACE("Mapping page %d at %p.\n", entry, addr); + + if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + ret = (void *)((unsigned long)shm_addrs[entry] + offset); + + pthread_mutex_unlock( &shm_addrs_mutex ); + + return ret; +} + +/* We'd like lookup to be fast. To that end, we use a static list indexed by handle. + * This is copied and adapted from the fd cache code. */ + +#define ESYNC_LIST_BLOCK_SIZE (65536 / sizeof(struct esync)) +#define ESYNC_LIST_ENTRIES 256 + +static struct esync *esync_list[ESYNC_LIST_ENTRIES]; +static struct esync esync_list_initial_block[ESYNC_LIST_BLOCK_SIZE]; + +static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) +{ + UINT_PTR idx = (((UINT_PTR)handle) >> 2) - 1; + *entry = idx / ESYNC_LIST_BLOCK_SIZE; + return idx % ESYNC_LIST_BLOCK_SIZE; +} + +static struct esync *add_to_list( HANDLE handle, enum esync_type type, int fd, void *shm ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= ESYNC_LIST_ENTRIES) + { + FIXME( "too many allocated handles, not caching %p\n", handle ); + return FALSE; + } + + if (!esync_list[entry]) /* do we need to allocate a new block of entries? */ + { + if (!entry) esync_list[0] = esync_list_initial_block; + else + { + void *ptr = anon_mmap_alloc( ESYNC_LIST_BLOCK_SIZE * sizeof(struct esync), + PROT_READ | PROT_WRITE ); + if (ptr == MAP_FAILED) return FALSE; + esync_list[entry] = ptr; + } + } + + if (!InterlockedCompareExchange( (LONG *)&esync_list[entry][idx].type, type, 0 )) + { + esync_list[entry][idx].fd = fd; + esync_list[entry][idx].shm = shm; + } + return &esync_list[entry][idx]; +} + +static struct esync *get_cached_object( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= ESYNC_LIST_ENTRIES || !esync_list[entry]) return NULL; + if (!esync_list[entry][idx].type) return NULL; + + return &esync_list[entry][idx]; +} + +/* Gets an object. This is either a proper esync object (i.e. an event, + * semaphore, etc. created using create_esync) or a generic synchronizable + * server-side object which the server will signal (e.g. a process, thread, + * message queue, etc.) */ +static NTSTATUS get_object( HANDLE handle, struct esync **obj ) +{ + NTSTATUS ret = STATUS_SUCCESS; + enum esync_type type = 0; + unsigned int shm_idx = 0; + obj_handle_t fd_handle; + sigset_t sigset; + int fd = -1; + + if ((*obj = get_cached_object( handle ))) return STATUS_SUCCESS; + + if ((INT_PTR)handle < 0) + { + /* We can deal with pseudo-handles, but it's just easier this way */ + return STATUS_NOT_IMPLEMENTED; + } + + if (!handle) + { + /* Shadow of the Tomb Raider really likes passing in NULL handles to + * various functions. Concerning, but let's avoid a server call. */ + return STATUS_INVALID_HANDLE; + } + + /* We need to try grabbing it from the server. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + if (!(*obj = get_cached_object( handle ))) + { + SERVER_START_REQ( get_esync_fd ) + { + req->handle = wine_server_obj_handle( handle ); + if (!(ret = wine_server_call( req ))) + { + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == handle ); + } + } + SERVER_END_REQ; + } + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (*obj) + { + /* We managed to grab it while in the CS; return it. */ + return STATUS_SUCCESS; + } + + if (ret) + { + WARN("Failed to retrieve fd for handle %p, status %#x.\n", handle, (unsigned int)ret); + *obj = NULL; + return ret; + } + + TRACE("Got fd %d for handle %p.\n", fd, handle); + + *obj = add_to_list( handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + return ret; +} + +NTSTATUS esync_close( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + TRACE("%p.\n", handle); + + if (entry < ESYNC_LIST_ENTRIES && esync_list[entry]) + { + if (InterlockedExchange((LONG *)&esync_list[entry][idx].type, 0)) + { + close( esync_list[entry][idx].fd ); + return STATUS_SUCCESS; + } + } + + return STATUS_INVALID_HANDLE; +} + +static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, int initval, int max ) +{ + NTSTATUS ret; + data_size_t len; + struct object_attributes *objattr; + obj_handle_t fd_handle; + unsigned int shm_idx; + sigset_t sigset; + int fd; + + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + + /* We have to synchronize on the fd cache CS so that our calls to + * receive_fd don't race with theirs. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( create_esync ) + { + req->access = access; + req->initval = initval; + req->type = type; + req->max = max; + wine_server_add_data( req, objattr, len ); + ret = wine_server_call( req ); + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == *handle ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + add_to_list( *handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + TRACE("-> handle %p, fd %d.\n", *handle, fd); + } + + free( objattr ); + return ret; +} + +static NTSTATUS open_esync( enum esync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +{ + NTSTATUS ret; + obj_handle_t fd_handle; + unsigned int shm_idx; + sigset_t sigset; + int fd; + + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( open_esync ) + { + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + req->type = type; + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + if (!(ret = wine_server_call( req ))) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == *handle ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (!ret) + { + add_to_list( *handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + + TRACE("-> handle %p, fd %d.\n", *handle, fd); + } + return ret; +} + +extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max) +{ + TRACE("name %s, initial %d, max %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", (int)initial, (int)max); + + return create_esync( ESYNC_SEMAPHORE, handle, access, attr, initial, max ); +} + +NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_SEMAPHORE, handle, access, attr ); +} + +NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +{ + struct esync *obj; + struct semaphore *semaphore; + uint64_t count64 = count; + ULONG current; + NTSTATUS ret; + + TRACE("%p, %d, %p.\n", handle, (int)count, prev); + + if ((ret = get_object( handle, &obj))) return ret; + semaphore = obj->shm; + + do + { + current = semaphore->count; + + if (count + current > semaphore->max) + return STATUS_SEMAPHORE_LIMIT_EXCEEDED; + } while (InterlockedCompareExchange( (LONG *)&semaphore->count, count + current, current ) != current); + + if (prev) *prev = current; + + /* We don't have to worry about a race between increasing the count and + * write(). The fact that we were able to increase the count means that we + * have permission to actually write that many releases to the semaphore. */ + + if (write( obj->fd, &count64, sizeof(count64) ) == -1) + return errno_to_status( errno ); + + return STATUS_SUCCESS; +} + +NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + struct semaphore *semaphore; + SEMAPHORE_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + semaphore = obj->shm; + + out->CurrentCount = semaphore->count; + out->MaximumCount = semaphore->max; + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + +NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) +{ + enum esync_type type = (event_type == SynchronizationEvent ? ESYNC_AUTO_EVENT : ESYNC_MANUAL_EVENT); + + TRACE("name %s, %s-reset, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", + event_type == NotificationEvent ? "manual" : "auto", initial); + + return create_esync( type, handle, access, attr, initial, 0 ); +} + +NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_AUTO_EVENT, handle, access, attr ); /* doesn't matter which */ +} + +static inline void small_pause(void) +{ +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + +/* Manual-reset events are actually racier than other objects in terms of shm + * state. With other objects, races don't matter, because we only treat the shm + * state as a hint that lets us skip poll()—we still have to read(). But with + * manual-reset events we don't, which means that the shm state can be out of + * sync with the actual state. + * + * In general we shouldn't have to worry about races between modifying the + * event and waiting on it. If the state changes while we're waiting, it's + * equally plausible that we caught it before or after the state changed. + * However, we can have races between SetEvent() and ResetEvent(), so that the + * event has inconsistent internal state. + * + * To solve this we have to use the other field to lock the event. Currently + * this is implemented as a spinlock, but I'm not sure if a futex might be + * better. I'm also not sure if it's possible to obviate locking by arranging + * writes and reads in a certain way. + * + * Note that we don't have to worry about locking in esync_wait_objects(). + * There's only two general patterns: + * + * WaitFor() SetEvent() + * ------------------------- + * read() + * signaled = 0 + * signaled = 1 + * write() + * ------------------------- + * read() + * signaled = 1 + * signaled = 0 + * + * ------------------------- + * + * That is, if SetEvent() tries to signal the event before WaitFor() resets its + * signaled state, it won't bother trying to write(), and then the signaled + * state will be reset, so the result is a consistent non-signaled event. + * There's several variations to this pattern but all of them are protected in + * the same way. Note however this is why we have to use interlocked_xchg() + * event inside of the lock. + */ + +/* Removing this spinlock is harder than it looks. esync_wait_objects() can + * deal with inconsistent state well enough, and a race between SetEvent() and + * ResetEvent() gives us license to yield either result as long as we act + * consistently, but that's not enough. Notably, esync_wait_objects() should + * probably act like a fence, so that the second half of esync_set_event() does + * not seep past a subsequent reset. That's one problem, but no guarantee there + * aren't others. */ + +NTSTATUS esync_set_event( HANDLE handle ) +{ + static const uint64_t value = 1; + struct esync *obj; + struct event *event; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; + + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (InterlockedCompareExchange( (LONG *)&event->locked, 1, 0 )) + small_pause(); + } + + /* For manual-reset events, as long as we're in a lock, we can take the + * optimization of only calling write() if the event wasn't already + * signaled. + * + * For auto-reset events, esync_wait_objects() must grab the kernel object. + * Thus if we got into a race so that the shm state is signaled but the + * eventfd is unsignaled (i.e. reset shm, set shm, set fd, reset fd), we + * *must* signal the fd now, or any waiting threads will never wake up. */ + + if (!InterlockedExchange( (LONG *)&event->signaled, 1 ) || obj->type == ESYNC_AUTO_EVENT) + { + if (write( obj->fd, &value, sizeof(value) ) == -1) + ERR("write: %s\n", strerror(errno)); + } + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } + + return STATUS_SUCCESS; +} + +NTSTATUS esync_reset_event( HANDLE handle ) +{ + uint64_t value; + struct esync *obj; + struct event *event; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; + + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (InterlockedCompareExchange( (LONG *)&event->locked, 1, 0 )) + small_pause(); + } + + /* For manual-reset events, as long as we're in a lock, we can take the + * optimization of only calling read() if the event was already signaled. + * + * For auto-reset events, we have no guarantee that the previous "signaled" + * state is actually correct. We need to leave both states unsignaled after + * leaving this function, so we always have to read(). */ + if (InterlockedExchange( (LONG *)&event->signaled, 0 ) || obj->type == ESYNC_AUTO_EVENT) + { + if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) + { + ERR("read: %s\n", strerror(errno)); + } + } + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } + + return STATUS_SUCCESS; +} + +NTSTATUS esync_pulse_event( HANDLE handle ) +{ + uint64_t value = 1; + struct esync *obj; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + + /* This isn't really correct; an application could miss the write. + * Unfortunately we can't really do much better. Fortunately this is rarely + * used (and publicly deprecated). */ + if (write( obj->fd, &value, sizeof(value) ) == -1) + return errno_to_status( errno ); + + /* Try to give other threads a chance to wake up. Hopefully erring on this + * side is the better thing to do... */ + usleep(0); + + read( obj->fd, &value, sizeof(value) ); + + return STATUS_SUCCESS; +} + +NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + EVENT_BASIC_INFORMATION *out = info; + struct pollfd fd; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + + fd.fd = obj->fd; + fd.events = POLLIN; + out->EventState = poll( &fd, 1, 0 ); + out->EventType = (obj->type == ESYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + +NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) +{ + TRACE("name %s, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", initial); + + return create_esync( ESYNC_MUTEX, handle, access, attr, initial ? 0 : 1, 0 ); +} + +NTSTATUS esync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_MUTEX, handle, access, attr ); +} + +NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ) +{ + struct esync *obj; + struct mutex *mutex; + static const uint64_t value = 1; + NTSTATUS ret; + + TRACE("%p, %p.\n", handle, prev); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj->shm; + + /* This is thread-safe, because the only thread that can change the tid to + * or from our tid is ours. */ + if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; + + if (prev) *prev = mutex->count; + + mutex->count--; + + if (!mutex->count) + { + /* This is also thread-safe, as long as signaling the file is the last + * thing we do. Other threads don't care about the tid if it isn't + * theirs. */ + mutex->tid = 0; + + if (write( obj->fd, &value, sizeof(value) ) == -1) + return errno_to_status( errno ); + } + + return STATUS_SUCCESS; +} + +NTSTATUS esync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + struct mutex *mutex; + MUTANT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj->shm; + + out->CurrentCount = 1 - mutex->count; + out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); + out->AbandonedState = (mutex->tid == ~0); + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + +#define TICKSPERSEC 10000000 +#define TICKSPERMSEC 10000 + +static LONGLONG update_timeout( ULONGLONG end ) +{ + LARGE_INTEGER now; + LONGLONG timeleft; + + NtQuerySystemTime( &now ); + timeleft = end - now.QuadPart; + if (timeleft < 0) timeleft = 0; + return timeleft; +} + +static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end ) +{ + int ret; + + do + { + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + +#ifdef HAVE_PPOLL + /* We use ppoll() if available since the time granularity is better. */ + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = ppoll( fds, nfds, &tmo_p, NULL ); +#else + ret = poll( fds, nfds, timeleft / TICKSPERMSEC ); +#endif + } + else + ret = poll( fds, nfds, -1 ); + + /* If we receive EINTR we were probably suspended (SIGUSR1), possibly for a + * system APC. The right thing to do is just try again. */ + } while (ret < 0 && errno == EINTR); + + return ret; +} + +/* Return TRUE if abandoned. */ +static BOOL update_grabbed_object( struct esync *obj ) +{ + BOOL ret = FALSE; + + if (obj->type == ESYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + /* We don't have to worry about a race between this and read(); the + * fact that we grabbed it means the count is now zero, so nobody else + * can (and the only thread that can release it is us). */ + if (mutex->tid == ~0) + ret = TRUE; + mutex->tid = GetCurrentThreadId(); + mutex->count++; + } + else if (obj->type == ESYNC_SEMAPHORE) + { + struct semaphore *semaphore = obj->shm; + /* We don't have to worry about a race between this and read(); the + * fact that we were able to grab it at all means the count is nonzero, + * and if someone else grabbed it then the count must have been >= 2, + * etc. */ + InterlockedExchangeAdd( (LONG *)&semaphore->count, -1 ); + } + else if (obj->type == ESYNC_AUTO_EVENT) + { + struct event *event = obj->shm; + /* We don't have to worry about a race between this and read(), since + * this is just a hint, and the real state is in the kernel object. + * This might already be 0, but that's okay! */ + event->signaled = 0; + } + + return ret; +} + +/* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we + * need to delegate to server_select(). */ +static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + static const LARGE_INTEGER zero; + + struct esync *objs[MAXIMUM_WAIT_OBJECTS]; + struct pollfd fds[MAXIMUM_WAIT_OBJECTS + 1]; + int has_esync = 0, has_server = 0; + BOOL msgwait = FALSE; + LONGLONG timeleft; + LARGE_INTEGER now; + DWORD pollcount; + ULONGLONG end; + int64_t value; + ssize_t size; + int i, j, ret; + + /* Grab the APC fd if we don't already have it. */ + if (alertable && ntdll_get_thread_data()->esync_apc_fd == -1) + { + obj_handle_t fd_handle; + sigset_t sigset; + int fd = -1; + + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( get_esync_apc_fd ) + { + if (!(ret = wine_server_call( req ))) + { + fd = receive_fd( &fd_handle ); + assert( fd_handle == GetCurrentThreadId() ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + ntdll_get_thread_data()->esync_apc_fd = fd; + } + + NtQuerySystemTime( &now ); + if (timeout) + { + if (timeout->QuadPart == TIMEOUT_INFINITE) + timeout = NULL; + else if (timeout->QuadPart >= 0) + end = timeout->QuadPart; + else + end = now.QuadPart - timeout->QuadPart; + } + + for (i = 0; i < count; i++) + { + ret = get_object( handles[i], &objs[i] ); + if (ret == STATUS_SUCCESS) + has_esync = 1; + else if (ret == STATUS_NOT_IMPLEMENTED) + has_server = 1; + else + return ret; + } + + if (count && objs[count - 1] && objs[count - 1]->type == ESYNC_QUEUE) + msgwait = TRUE; + + if (has_esync && has_server) + FIXME("Can't wait on esync and server objects at the same time!\n"); + else if (has_server) + return STATUS_NOT_IMPLEMENTED; + + if (TRACE_ON(esync)) + { + TRACE("Waiting for %s of %d handles:", wait_any ? "any" : "all", (int)count); + for (i = 0; i < count; i++) + TRACE(" %p", handles[i]); + + if (msgwait) + TRACE(" or driver events"); + if (alertable) + TRACE(", alertable"); + + if (!timeout) + TRACE(", timeout = INFINITE.\n"); + else + { + timeleft = update_timeout( end ); + TRACE(", timeout = %ld.%07ld sec.\n", + (long) timeleft / TICKSPERSEC, (long) timeleft % TICKSPERSEC); + } + } + + if (wait_any || count <= 1) + { + /* Try to check objects now, so we can obviate poll() at least. */ + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + if (obj) + { + switch (obj->type) + { + case ESYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count++; + return i; + } + else if (!mutex->count) + { + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + if (mutex->tid == ~0) + { + TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); + i += STATUS_ABANDONED_WAIT_0; + } + else + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->tid = GetCurrentThreadId(); + mutex->count++; + return i; + } + } + break; + } + case ESYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + + if (semaphore->count) + { + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + InterlockedDecrement( (LONG *)&semaphore->count ); + return i; + } + } + break; + } + case ESYNC_AUTO_EVENT: + { + struct event *event = obj->shm; + + if (event->signaled) + { + if (ac_odyssey && alertable) + usleep( 0 ); + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + event->signaled = 0; + return i; + } + } + break; + } + case ESYNC_MANUAL_EVENT: + { + struct event *event = obj->shm; + + if (event->signaled) + { + if (ac_odyssey && alertable) + { + usleep( 0 ); + if (!event->signaled) + break; + } + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + break; + } + case ESYNC_AUTO_SERVER: + case ESYNC_MANUAL_SERVER: + case ESYNC_QUEUE: + /* We can't wait on any of these. Fortunately I don't think + * they'll ever be uncontended anyway (at least, they won't be + * performance-critical). */ + break; + } + } + + fds[i].fd = obj ? obj->fd : -1; + fds[i].events = POLLIN; + } + if (alertable) + { + fds[i].fd = ntdll_get_thread_data()->esync_apc_fd; + fds[i].events = POLLIN; + i++; + } + pollcount = i; + + while (1) + { + if (ac_odyssey && alertable) + usleep( 0 ); + + ret = do_poll( fds, pollcount, timeout ? &end : NULL ); + if (ret > 0) + { + /* We must check this first! The server may set an event that + * we're waiting on, but we need to return STATUS_USER_APC. */ + if (alertable) + { + if (fds[pollcount - 1].revents & POLLIN) + goto userapc; + } + + /* Find out which object triggered the wait. */ + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + if (fds[i].revents & (POLLERR | POLLHUP | POLLNVAL)) + { + ERR("Polling on fd %d returned %#x.\n", fds[i].fd, fds[i].revents); + return STATUS_INVALID_HANDLE; + } + + if (obj) + { + if (obj->type == ESYNC_MANUAL_EVENT + || obj->type == ESYNC_MANUAL_SERVER + || obj->type == ESYNC_QUEUE) + { + /* Don't grab the object, just check if it's signaled. */ + if (fds[i].revents & POLLIN) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + } + else + { + if ((size = read( fds[i].fd, &value, sizeof(value) )) == sizeof(value)) + { + /* We found our object. */ + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (update_grabbed_object( obj )) + return STATUS_ABANDONED_WAIT_0 + i; + return i; + } + } + } + } + + /* If we got here, someone else stole (or reset, etc.) whatever + * we were waiting for. So keep waiting. */ + NtQuerySystemTime( &now ); + } + else + goto err; + } + } + else + { + /* Wait-all is a little trickier to implement correctly. Fortunately, + * it's not as common. + * + * The idea is basically just to wait in sequence on every object in the + * set. Then when we're done, try to grab them all in a tight loop. If + * that fails, release any resources we've grabbed (and yes, we can + * reliably do this—it's just mutexes and semaphores that we have to + * put back, and in both cases we just put back 1), and if any of that + * fails we start over. + * + * What makes this inherently bad is that we might temporarily grab a + * resource incorrectly. Hopefully it'll be quick (and hey, it won't + * block on wineserver) so nobody will notice. Besides, consider: if + * object A becomes signaled but someone grabs it before we can grab it + * and everything else, then they could just as well have grabbed it + * before it became signaled. Similarly if object A was signaled and we + * were blocking on object B, then B becomes available and someone grabs + * A before we can, then they might have grabbed A before B became + * signaled. In either case anyone who tries to wait on A or B will be + * waiting for an instant while we put things back. */ + + while (1) + { +tryagain: + /* First step: try to poll on each object in sequence. */ + fds[0].events = POLLIN; + pollcount = 1; + if (alertable) + { + /* We also need to wait on APCs. */ + fds[1].fd = ntdll_get_thread_data()->esync_apc_fd; + fds[1].events = POLLIN; + pollcount++; + } + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + fds[0].fd = obj ? obj->fd : -1; + + if (obj && obj->type == ESYNC_MUTEX) + { + /* It might be ours. */ + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; + } + + ret = do_poll( fds, pollcount, timeout ? &end : NULL ); + if (ret <= 0) + goto err; + else if (alertable && (fds[1].revents & POLLIN)) + goto userapc; + + if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL)) + { + ERR("Polling on fd %d returned %#x.\n", fds[0].fd, fds[0].revents); + return STATUS_INVALID_HANDLE; + } + } + + /* If we got here and we haven't timed out, that means all of the + * handles were signaled. Check to make sure they still are. */ + for (i = 0; i < count; i++) + { + fds[i].fd = objs[i] ? objs[i]->fd : -1; + fds[i].events = POLLIN; + } + /* There's no reason to check for APCs here. */ + pollcount = i; + + /* Poll everything to see if they're still signaled. */ + ret = poll( fds, pollcount, 0 ); + if (ret == pollcount) + { + BOOL abandoned = FALSE; + + /* Quick, grab everything. */ + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + switch (obj->type) + { + case ESYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + if (mutex->tid == GetCurrentThreadId()) + break; + /* otherwise fall through */ + } + case ESYNC_SEMAPHORE: + case ESYNC_AUTO_EVENT: + if ((size = read( fds[i].fd, &value, sizeof(value) )) != sizeof(value)) + { + /* We were too slow. Put everything back. */ + value = 1; + for (j = i - 1; j >= 0; j--) + { + struct esync *obj = objs[j]; + + if (obj->type == ESYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; + } + if (write( fds[j].fd, &value, sizeof(value) ) == -1) + { + ERR("write failed.\n"); + return errno_to_status( errno ); + } + } + + goto tryagain; /* break out of two loops and a switch */ + } + break; + default: + /* If a manual-reset event changed between there and + * here, it's shouldn't be a problem. */ + break; + } + } + + /* If we got here, we successfully waited on every object. */ + /* Make sure to let ourselves know that we grabbed the mutexes + * and semaphores. */ + for (i = 0; i < count; i++) + abandoned |= update_grabbed_object( objs[i] ); + + if (abandoned) + { + TRACE("Wait successful, but some object(s) were abandoned.\n"); + return STATUS_ABANDONED; + } + TRACE("Wait successful.\n"); + return STATUS_SUCCESS; + } + + /* If we got here, ppoll() returned less than all of our objects. + * So loop back to the beginning and try again. */ + } /* while(1) */ + } /* else (wait-all) */ + +err: + /* We should only get here if poll() failed. */ + + if (ret == 0) + { + TRACE("Wait timed out.\n"); + return STATUS_TIMEOUT; + } + else + { + ERR("ppoll failed: %s\n", strerror(errno)); + return errno_to_status( errno ); + } + +userapc: + TRACE("Woken up by user APC.\n"); + + /* We have to make a server call anyway to get the APC to execute, so just + * delegate down to server_select(). */ + ret = server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero ); + + /* This can happen if we received a system APC, and the APC fd was woken up + * before we got SIGUSR1. poll() doesn't return EINTR in that case. The + * right thing to do seems to be to return STATUS_USER_APC anyway. */ + if (ret == STATUS_TIMEOUT) ret = STATUS_USER_APC; + return ret; +} + +/* We need to let the server know when we are doing a message wait, and when we + * are done with one, so that all of the code surrounding hung queues works. + * We also need this for WaitForInputIdle(). */ +static void server_set_msgwait( int in_msgwait ) +{ + SERVER_START_REQ( esync_msgwait ) + { + req->in_msgwait = in_msgwait; + wine_server_call( req ); + } + SERVER_END_REQ; +} + +/* This is a very thin wrapper around the proper implementation above. The + * purpose is to make sure the server knows when we are doing a message wait. + * This is separated into a wrapper function since there are at least a dozen + * exit paths from esync_wait_objects(). */ +NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + BOOL msgwait = FALSE; + struct esync *obj; + NTSTATUS ret; + + if (count && !get_object( handles[count - 1], &obj ) && obj->type == ESYNC_QUEUE) + { + msgwait = TRUE; + server_set_msgwait( 1 ); + } + + ret = __esync_wait_objects( count, handles, wait_any, alertable, timeout ); + + if (msgwait) + server_set_msgwait( 0 ); + + return ret; +} + +NTSTATUS esync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) +{ + struct esync *obj; + NTSTATUS ret; + + if ((ret = get_object( signal, &obj ))) return ret; + + switch (obj->type) + { + case ESYNC_SEMAPHORE: + ret = esync_release_semaphore( signal, 1, NULL ); + break; + case ESYNC_AUTO_EVENT: + case ESYNC_MANUAL_EVENT: + ret = esync_set_event( signal ); + break; + case ESYNC_MUTEX: + ret = esync_release_mutex( signal, NULL ); + break; + default: + return STATUS_OBJECT_TYPE_MISMATCH; + } + if (ret) return ret; + + return esync_wait_objects( 1, &wait, TRUE, alertable, timeout ); +} + +void esync_init(void) +{ + struct stat st; + + if (!do_esync()) + { + /* make sure the server isn't running with WINEESYNC */ + HANDLE handle; + NTSTATUS ret; + + ret = create_esync( 0, &handle, 0, NULL, 0, 0 ); + if (ret != STATUS_NOT_IMPLEMENTED) + { + ERR("Server is running with WINEESYNC but this process is not, please enable WINEESYNC or restart wineserver.\n"); + exit(1); + } + + return; + } + + if (stat( config_dir, &st ) == -1) + ERR("Cannot stat %s\n", config_dir); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-esync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-esync", (unsigned long)st.st_ino ); + + if ((shm_fd = shm_open( shm_name, O_RDWR, 0644 )) == -1) + { + /* probably the server isn't running with WINEESYNC, tell the user and bail */ + if (errno == ENOENT) + ERR("Failed to open esync shared memory file; make sure no stale wineserver instances are running without WINEESYNC.\n"); + else + ERR("Failed to initialize shared memory: %s\n", strerror( errno )); + exit(1); + } + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; +} diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h new file mode 100644 index 00000000000..59f8809fc1a --- /dev/null +++ b/dlls/ntdll/unix/esync.h @@ -0,0 +1,61 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_esync(void); +extern void esync_init(void); +extern NTSTATUS esync_close( HANDLE handle ); + +extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); +extern NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ); +extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); + +extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_pulse_event( HANDLE handle ); +extern NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ); +extern NTSTATUS esync_reset_event( HANDLE handle ); +extern NTSTATUS esync_set_event( HANDLE handle ); + +extern NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS esync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ); +extern NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ); + +extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); +extern NTSTATUS esync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ); + + +/* We have to synchronize on the fd cache mutex so that our calls to receive_fd + * don't race with theirs. It looks weird, I know. + * + * If we weren't trying to avoid touching the code I'd rename the mutex to + * "server_fd_mutex" or something similar. */ +extern pthread_mutex_t fd_cache_mutex; + +extern int receive_fd( obj_handle_t *handle ); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index ee68e4dee9b..e5ea71fae80 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1619,9 +1619,24 @@ static int fd_set_dos_attrib( int fd, UINT attr, BOOL force_set ) else return xattr_fremove( fd, SAMBA_XATTR_DOS_ATTRIB ); } +static unsigned int server_get_unix_name( HANDLE handle, char **unix_name ); + +/* return TRUE if this is a file owned by Wine which applications should not try to mess with. */ +static BOOL is_wine_file( HANDLE handle ) +{ + char *unix_name; + BOOL ret; + + if (server_get_unix_name( handle, &unix_name )) + return FALSE; + ret = strstr(unix_name, "/lib/wine/" ) || strstr( unix_name, "/lib64/wine/" ) ||strstr( unix_name, "/share/wine/" ); + free(unix_name); + return ret; +} + /* set the stat info and file attributes for a file (by file descriptor) */ -static NTSTATUS fd_set_file_info( int fd, UINT attr, BOOL force_set_xattr ) +static NTSTATUS fd_set_file_info( int fd, HANDLE handle, UINT attr, BOOL force_set_xattr ) { struct stat st; @@ -1635,8 +1650,16 @@ static NTSTATUS fd_set_file_info( int fd, UINT attr, BOOL force_set_xattr ) } else { - /* add write permission only where we already have read permission */ - st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask); + if (is_wine_file( handle )) + { + TRACE("HACK: Not giving write permission to wine file!\n"); + return STATUS_ACCESS_DENIED; + } + else + { + /* add write permission only where we already have read permission */ + st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask); + } } if (fchmod( fd, st.st_mode ) == -1) return errno_to_status( errno ); @@ -2821,6 +2844,67 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i return STATUS_OBJECT_NAME_NOT_FOUND; } +/* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ +static BOOL replace_steam_input_path( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) +{ + static const WCHAR pipe_prefixW[] = + { + '\\','?','?','\\','p','i','p','e','\\','H','I','D','#','V','I','D','_','0','4','5','E', + '&','P','I','D','_','0','2','8','E','&','I','G','_','0','0', + }; + static const WCHAR hid_prefixW[] = + { + '\\','?','?','\\','h','i','d','#','v','i','d','_','2','8','d','e', + '&','p','i','d','_','1','1','f','f','&','i','g','_','0' + }; + static const WCHAR hid_midW[] = + { + '#','0', + }; + static const WCHAR hid_tailW[] = + { + '&','0','&','0','&','1','#','{','4','d','1','e','5','5','b','2','-','f','1','6','f','-', + '1','1','c','f','-','8','8','c','b','-','0','0','1','1','1','1','0','0','0','0','3','0','}' + }; + UNICODE_STRING *path = attr->ObjectName; + const WCHAR *slot = NULL, *slot_end = NULL, *serial, *serial_end = NULL; + UINT len = 0; + + if (!path || !path->Buffer || path->Length <= sizeof(pipe_prefixW)) return FALSE; + if (wcsnicmp( path->Buffer, pipe_prefixW, ARRAY_SIZE(pipe_prefixW) )) return FALSE; + + serial = path->Buffer + path->Length / sizeof(WCHAR); + while (serial > path->Buffer && *serial != '&') + { + if (*serial == '#') + { + slot_end = serial_end; + serial_end = serial; + slot = serial_end + 1; + } + serial--; + } + if (serial == path->Buffer || *serial != '&' || !slot_end || !serial_end) return FALSE; + + redir->Length = sizeof(hid_prefixW) + sizeof(hid_midW) + sizeof(hid_tailW); + redir->Length += (serial_end - serial + slot_end - slot) * sizeof(WCHAR); + redir->MaximumLength = redir->Length + sizeof(WCHAR); + if (!(redir->Buffer = malloc( redir->MaximumLength ))) return FALSE; + + memcpy( redir->Buffer, hid_prefixW, sizeof(hid_prefixW) ); + len += ARRAY_SIZE(hid_prefixW); + memcpy( redir->Buffer + len, slot, (slot_end - slot) * sizeof(WCHAR) ); + len += slot_end - slot; + memcpy( redir->Buffer + len, hid_midW, sizeof(hid_midW) ); + len += ARRAY_SIZE(hid_midW); + memcpy( redir->Buffer + len, serial, (serial_end - serial) * sizeof(WCHAR) ); + len += serial_end - serial; + memcpy( redir->Buffer + len, hid_tailW, sizeof(hid_tailW) ); + + TRACE( "HACK: %s -> %s\n", debugstr_us(attr->ObjectName), debugstr_us(redir) ); + attr->ObjectName = redir; + return TRUE; +} #ifndef _WIN64 @@ -2922,6 +3006,10 @@ BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) unsigned int i, prefix_len = 0, len = attr->ObjectName->Length / sizeof(WCHAR); redir->Buffer = NULL; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (replace_steam_input_path( attr, redir )) return TRUE; + if (!NtCurrentTeb64()) return FALSE; if (!len) return FALSE; @@ -2981,7 +3069,8 @@ BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) { redir->Buffer = NULL; - return FALSE; + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + return replace_steam_input_path( attr, redir ); } #endif @@ -3087,16 +3176,31 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name ) { static const WCHAR nt_prefixW[] = {'\\','?','?','\\'}; static const WCHAR dosdev_prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\'}; + static const WCHAR globalrootW[] = {'\\','?','?','\\','G','l','o','b','a','l','R','o','o','t'}; + int prefix_len = 0; + WCHAR *prefix; + USHORT length; - if (name->Length >= sizeof(nt_prefixW) && - !memcmp( name->Buffer, nt_prefixW, sizeof(nt_prefixW) )) - return ARRAY_SIZE( nt_prefixW ); + prefix = name->Buffer; + length = name->Length; - if (name->Length >= sizeof(dosdev_prefixW) && - !wcsnicmp( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) - return ARRAY_SIZE( dosdev_prefixW ); + if (length >= ARRAY_SIZE( globalrootW ) && + !wcsnicmp( prefix, globalrootW, ARRAY_SIZE( globalrootW ))) + { + WARN("Stripping off GlobalRoot prefix.\n"); + prefix += ARRAY_SIZE( globalrootW ); + prefix_len += ARRAY_SIZE( globalrootW ); + length -= ARRAY_SIZE( globalrootW ); + } - return 0; + if (length >= sizeof(nt_prefixW) && + !memcmp( prefix, nt_prefixW, sizeof(nt_prefixW) )) + prefix_len += ARRAY_SIZE( nt_prefixW ); + else if (length >= sizeof(dosdev_prefixW) && + !wcsnicmp( prefix, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) + prefix_len += ARRAY_SIZE( dosdev_prefixW ); + + return prefix_len; } @@ -3476,7 +3580,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char name = nameW->Buffer; name_len = nameW->Length / sizeof(WCHAR); - if (!name_len || name[0] != '\\') return STATUS_OBJECT_PATH_SYNTAX_BAD; + if (!name || !name_len || name[0] != '\\') return STATUS_OBJECT_PATH_SYNTAX_BAD; if (!(pos = get_dos_prefix_len( nameW ))) return STATUS_BAD_DEVICE_TYPE; /* no DOS prefix, assume NT native name */ @@ -3570,7 +3674,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char /****************************************************************************** - * nt_to_unix_file_name + * nt_to_unix_file_name_internal * * Convert a file name from NT namespace to Unix namespace. * @@ -3578,7 +3682,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char * element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is * returned, but the unix name is still filled in properly. */ -NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) +NTSTATUS nt_to_unix_file_name_internal( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) { enum server_fd_type type; int old_cwd, root_fd, needs_close; @@ -3587,6 +3691,9 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U int name_len, unix_len; NTSTATUS status; + if (!attr->ObjectName->Buffer && attr->ObjectName->Length) + return STATUS_ACCESS_VIOLATION; + if (!attr->RootDirectory) /* without root dir fall back to normal lookup */ return nt_to_unix_file_name_no_root( attr->ObjectName, name_ret, disposition ); @@ -3636,6 +3743,136 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U } +/* read the contents of an NT symlink object */ +static NTSTATUS read_nt_symlink( HANDLE root, UNICODE_STRING *name, WCHAR *target, size_t length ) +{ + OBJECT_ATTRIBUTES attr; + UNICODE_STRING targetW; + NTSTATUS status; + HANDLE handle; + + attr.Length = sizeof(attr); + attr.RootDirectory = root; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) + { + targetW.Buffer = target; + targetW.MaximumLength = (length - 1) * sizeof(WCHAR); + status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); + NtClose( handle ); + } + + return status; +} + +/* try to find dos device based on nt device name */ +static NTSTATUS nt_to_dos_device( WCHAR *name, size_t length, WCHAR *device_ret ) +{ + static const WCHAR dosdevicesW[] = {'\\','D','o','s','D','e','v','i','c','e','s',0}; + UNICODE_STRING dosdevW = { sizeof(dosdevicesW) - sizeof(WCHAR), sizeof(dosdevicesW), (WCHAR *)dosdevicesW }; + WCHAR symlinkW[MAX_DIR_ENTRY_LEN]; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + char data[1024]; + HANDLE handle; + ULONG ctx = 0; + + DIRECTORY_BASIC_INFORMATION *info = (DIRECTORY_BASIC_INFORMATION *)data; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &dosdevW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = NtOpenDirectoryObject( &handle, FILE_LIST_DIRECTORY, &attr ); + if (status) return STATUS_BAD_DEVICE_TYPE; + + while (!NtQueryDirectoryObject( handle, info, sizeof(data), TRUE, FALSE, &ctx, NULL )) + { + if (read_nt_symlink( handle, &info->ObjectName, symlinkW, MAX_DIR_ENTRY_LEN )) continue; + if (wcsnicmp( symlinkW, name, length )) continue; + if (info->ObjectName.Length != 2 * sizeof(WCHAR) || info->ObjectName.Buffer[1] != ':') continue; + + *device_ret = info->ObjectName.Buffer[0]; + NtClose( handle ); + return STATUS_SUCCESS; + } + + NtClose( handle ); + return STATUS_BAD_DEVICE_TYPE; +} + +/****************************************************************************** + * nt_to_unix_file_name + * + * Convert a file name from NT namespace to Unix namespace. + * + * If disposition is not FILE_OPEN or FILE_OVERWRITE, the last path + * element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is + * returned, but the unix name is still filled in properly. + */ +NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) +{ + static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t','\\',0}; + static const WCHAR dosprefixW[] = {'\\','?','?','\\'}; + static const WCHAR deviceW[] = {'\\','D','e','v','i','c','e','\\',0}; + WCHAR *name, *ptr, *prefix, buffer[3] = {'c',':',0}; + UNICODE_STRING dospathW, *nameW; + OBJECT_ATTRIBUTES attr_copy; + size_t offset, name_len; + NTSTATUS status; + + if (attr->RootDirectory) return nt_to_unix_file_name_internal( attr, name_ret, disposition ); + + nameW = attr->ObjectName; + + if (nameW->Length >= sizeof(deviceW) - sizeof(WCHAR) + && !wcsnicmp( nameW->Buffer, deviceW, ARRAY_SIZE(deviceW) - 1 )) + { + offset = sizeof(deviceW) / sizeof(WCHAR); + while (offset * sizeof(WCHAR) < nameW->Length && nameW->Buffer[ offset ] != '\\') offset++; + if ((status = nt_to_dos_device( nameW->Buffer, offset, buffer ))) return status; + prefix = buffer; + } + else if (nameW->Length >= sizeof(systemrootW) - sizeof(WCHAR) && + !wcsnicmp( nameW->Buffer, systemrootW, ARRAY_SIZE(systemrootW) - 1 )) + { + offset = (sizeof(systemrootW) - 1) / sizeof(WCHAR); + prefix = user_shared_data->NtSystemRoot; + } + else + return nt_to_unix_file_name_internal( attr, name_ret, disposition ); + + name_len = sizeof(dosprefixW) + wcslen(prefix) * sizeof(WCHAR) + + sizeof(WCHAR) /* '\\' */ + nameW->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); + if (!(name = malloc( name_len ))) + return STATUS_NO_MEMORY; + + ptr = name; + memcpy( ptr, dosprefixW, sizeof(dosprefixW) ); + ptr += sizeof(dosprefixW) / sizeof(WCHAR); + wcscpy( ptr, prefix ); + ptr += wcslen(ptr); + *ptr++ = '\\'; + memcpy( ptr, nameW->Buffer + offset, nameW->Length - offset * sizeof(WCHAR) ); + ptr[ nameW->Length / sizeof(WCHAR) - offset ] = 0; + + dospathW.Buffer = name; + dospathW.Length = wcslen( name ) * sizeof(WCHAR); + attr_copy = *attr; + attr_copy.ObjectName = &dospathW; + status = nt_to_unix_file_name_internal( &attr_copy, name_ret, disposition ); + + free( name ); + return status; +} + /****************************************************************************** * wine_nt_to_unix_file_name * @@ -4592,8 +4829,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, status = set_file_times( fd, &mtime, &atime ); if (status == STATUS_SUCCESS) - status = fd_set_file_info( fd, info->FileAttributes, - unix_name && is_hidden_file( unix_name )); + status = fd_set_file_info( fd, handle, info->FileAttributes, + unix_name && is_hidden_file( unix_name ) ); if (needs_close) close( fd ); free( unix_name ); @@ -4633,6 +4870,15 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, else status = STATUS_INVALID_PARAMETER_3; break; + case FileAllocationInformation: + { + const FILE_ALLOCATION_INFORMATION *info = ptr; + + FIXME("FileAllocationInformation AllocationSize %p stub.\n", (void *)(ULONG_PTR)info->AllocationSize.QuadPart); + io->Status = STATUS_SUCCESS; + break; + } + case FilePipeInformation: if (len >= sizeof(FILE_PIPE_INFORMATION)) { @@ -5385,6 +5631,243 @@ static unsigned int set_pending_write( HANDLE device ) return status; } +static pthread_mutex_t async_file_read_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t async_file_read_cond = PTHREAD_COND_INITIALIZER; + +struct async_file_read_job +{ + HANDLE handle; + int unix_handle; + int needs_close; + HANDLE event; + IO_STATUS_BLOCK *io; + void *buffer; + ULONG length; + LARGE_INTEGER offset; + DWORD thread_id; + LONG cancelled; + struct list queue_entry; + struct async_file_read_job *next; + ULONG64 queue_time_mcs; +}; + + +static struct list async_file_read_queue = LIST_INIT( async_file_read_queue ); +static struct async_file_read_job *async_file_read_running, *async_file_read_free; + +static void async_file_complete_io( struct async_file_read_job *job, NTSTATUS status, ULONG total ) +{ + job->io->Status = status; + job->io->Information = total; + + if (job->event) NtSetEvent( job->event, NULL ); +} + +static void *async_file_read_thread(void *dummy) +{ + struct async_file_read_job *job, *ptr; + ULONG buffer_length = 0; + void *buffer = NULL; + struct list *entry; + struct timespec ts; + NTSTATUS status; + ULONG64 delay; + ULONG total; + int result; + + pthread_mutex_lock( &async_file_read_mutex ); + while (1) + { + while (!(entry = list_head( &async_file_read_queue ))) + { + pthread_cond_wait( &async_file_read_cond, &async_file_read_mutex ); + continue; + } + + job = LIST_ENTRY( entry, struct async_file_read_job, queue_entry ); + list_remove( entry ); + + total = 0; + + if ( job->cancelled ) + { + pthread_mutex_unlock( &async_file_read_mutex ); + status = STATUS_CANCELLED; + goto done; + } + + job->next = async_file_read_running; + async_file_read_running = job; + pthread_mutex_unlock( &async_file_read_mutex ); + + if (!buffer_length) + { + buffer = malloc(job->length); + buffer_length = job->length; + } + else if (buffer_length < job->length) + { + buffer = realloc(buffer, job->length); + buffer_length = job->length; + } + + while ((result = pread( job->unix_handle, buffer, job->length, job->offset.QuadPart )) == -1) + { + if (errno != EINTR) + { + status = errno_to_status( errno ); + goto done; + } + if (job->cancelled) + break; + } + + clock_gettime( CLOCK_MONOTONIC, &ts ); + delay = ts.tv_sec * (ULONG64)1000000 + ts.tv_nsec / 1000 - job->queue_time_mcs; + if (delay < 1000) + usleep( 1000 - delay ); + else + usleep( 50 ); + + total = result; + status = (total || !job->length) ? STATUS_SUCCESS : STATUS_END_OF_FILE; +done: + if (job->needs_close) close( job->unix_handle ); + + if (!InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + if (status == STATUS_SUCCESS) + memcpy( job->buffer, buffer, total ); + + async_file_complete_io( job, status, total ); + } + + pthread_mutex_lock( &async_file_read_mutex ); + + if (status != STATUS_CANCELLED) + { + ptr = async_file_read_running; + if (job == ptr) + { + async_file_read_running = job->next; + } + else + { + while (ptr && ptr->next != job) + ptr = ptr->next; + + assert( ptr ); + ptr->next = job->next; + } + } + + job->next = async_file_read_free; + async_file_read_free = job; + } + + return NULL; +} + +static pthread_once_t async_file_read_once = PTHREAD_ONCE_INIT; + +static void async_file_read_init(void) +{ + pthread_t async_file_read_thread_id; + pthread_attr_t pthread_attr; + + ERR("HACK: AC Odyssey async read workaround.\n"); + + pthread_attr_init( &pthread_attr ); + pthread_attr_setscope( &pthread_attr, PTHREAD_SCOPE_SYSTEM ); + pthread_attr_setdetachstate( &pthread_attr, PTHREAD_CREATE_DETACHED ); + + pthread_create( &async_file_read_thread_id, &pthread_attr, (void * (*)(void *))async_file_read_thread, NULL); + pthread_attr_destroy( &pthread_attr ); +} + +static NTSTATUS queue_async_file_read( HANDLE handle, int unix_handle, int needs_close, HANDLE event, + IO_STATUS_BLOCK *io, void *buffer, ULONG length, LARGE_INTEGER *offset ) +{ + struct async_file_read_job *job; + struct timespec ts; + + pthread_once( &async_file_read_once, async_file_read_init ); + + NtResetEvent( event, NULL ); + + pthread_mutex_lock( &async_file_read_mutex ); + + if (async_file_read_free) + { + job = async_file_read_free; + async_file_read_free = async_file_read_free->next; + } + else + { + if (!(job = malloc( sizeof(*job) ))) + { + pthread_mutex_unlock( &async_file_read_mutex ); + return STATUS_NO_MEMORY; + } + } + + job->handle = handle; + job->unix_handle = unix_handle; + job->needs_close = needs_close; + job->event = event; + job->io = io; + job->buffer = buffer; + job->length = length; + job->offset = *offset; + job->thread_id = GetCurrentThreadId(); + job->cancelled = 0; + clock_gettime( CLOCK_MONOTONIC, &ts ); + job->queue_time_mcs = ts.tv_sec * (ULONG64)1000000 + ts.tv_nsec / 1000; + + list_add_tail( &async_file_read_queue, &job->queue_entry ); + + pthread_cond_signal( &async_file_read_cond ); + pthread_mutex_unlock( &async_file_read_mutex ); + + return STATUS_PENDING; +} + +static NTSTATUS cancel_async_file_read( HANDLE handle, IO_STATUS_BLOCK *io ) +{ + DWORD thread_id = GetCurrentThreadId(); + struct async_file_read_job *job; + unsigned int count = 0; + + TRACE( "handle %p, io %p.\n", handle, io ); + + pthread_mutex_lock( &async_file_read_mutex ); + job = async_file_read_running; + while (job) + { + if (((io && job->io == io) + || (!io && job->handle == handle && job->thread_id == thread_id)) + && !InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + async_file_complete_io( job, STATUS_CANCELLED, 0 ); + ++count; + } + job = job->next; + } + + LIST_FOR_EACH_ENTRY( job, &async_file_read_queue, struct async_file_read_job, queue_entry ) + { + if (((io && job->io == io) + || (!io && job->handle == handle && job->thread_id == thread_id)) + && !InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + async_file_complete_io( job, STATUS_CANCELLED, 0 ); + ++count; + } + } + + pthread_mutex_unlock( &async_file_read_mutex ); + return count ? STATUS_SUCCESS : STATUS_NOT_FOUND; +} /****************************************************************************** * NtReadFile (NTDLL.@) @@ -5426,6 +5909,13 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo goto done; } + if (ac_odyssey && async_read && length && event && !apc) + { + status = queue_async_file_read( handle, unix_handle, needs_close, event, io, buffer, length, offset ); + needs_close = 0; + goto err; + } + if (offset && offset->QuadPart != FILE_USE_FILE_POINTER_POSITION) { /* async I/O doesn't make sense on regular files */ @@ -6235,6 +6725,9 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE handle, IO_STATUS_BLOCK *io_status ) TRACE( "%p %p\n", handle, io_status ); + if (ac_odyssey && !cancel_async_file_read( handle, NULL )) + return (io_status->Status = STATUS_SUCCESS); + SERVER_START_REQ( cancel_async ) { req->handle = wine_server_obj_handle( handle ); @@ -6260,6 +6753,9 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE handle, IO_STATUS_BLOCK *io, IO_STATUS_ TRACE( "%p %p %p\n", handle, io, io_status ); + if (ac_odyssey && !cancel_async_file_read( handle, io )) + return (io_status->Status = STATUS_SUCCESS); + SERVER_START_REQ( cancel_async ) { req->handle = wine_server_obj_handle( handle ); @@ -6609,7 +7105,7 @@ NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) } else if (S_ISFIFO( st.st_mode ) || S_ISSOCK( st.st_mode )) { - info->DeviceType = FILE_DEVICE_NAMED_PIPE; + info->DeviceType = FILE_DEVICE_UNKNOWN; } else if (is_device_placeholder( fd )) { @@ -6718,10 +7214,11 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io void *buffer, ULONG length, FS_INFORMATION_CLASS info_class ) { + enum server_fd_type fd_type; int fd, needs_close; unsigned int status; - status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ); + status = server_get_unix_fd( handle, 0, &fd, &needs_close, &fd_type, NULL ); if (status == STATUS_BAD_DEVICE_TYPE) { struct async_irp *async; @@ -6788,7 +7285,15 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io { FILE_FS_DEVICE_INFORMATION *info = buffer; - if ((status = get_device_info( fd, info )) == STATUS_SUCCESS) + if (fd_type == FD_TYPE_SOCKET || fd_type == FD_TYPE_PIPE) + { + info->Characteristics = 0; + info->DeviceType = FILE_DEVICE_NAMED_PIPE; + status = STATUS_SUCCESS; + } + else status = get_device_info( fd, info ); + + if (!status) io->Information = sizeof(*info); } break; diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c new file mode 100644 index 00000000000..c3da44e4f26 --- /dev/null +++ b/dlls/ntdll/unix/fsync.c @@ -0,0 +1,1478 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif +#ifdef HAVE_LINUX_FUTEX_H +# include +#endif +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" +#include "wine/debug.h" +#include "wine/server.h" + +#include "unix_private.h" +#include "fsync.h" + +WINE_DEFAULT_DEBUG_CHANNEL(fsync); + +#include "pshpack4.h" +#include "poppack.h" + +static int current_pid; + +/* futex_waitv interface */ + +#ifndef __NR_futex_waitv + +# define __NR_futex_waitv 449 +# define FUTEX_32 2 +struct futex_waitv { + uint64_t val; + uint64_t uaddr; + uint32_t flags; + uint32_t __reserved; +}; + +#endif + +#define u64_to_ptr(x) (void *)(uintptr_t)(x) + +struct timespec64 +{ + long long tv_sec; + long long tv_nsec; +}; + +static LONGLONG nt_time_from_ts( struct timespec *ts ) +{ + return ticks_from_time_t( ts->tv_sec ) + (ts->tv_nsec + 50) / 100; +} + +static void get_wait_end_time( const LARGE_INTEGER **timeout, struct timespec64 *end, clockid_t *clock_id ) +{ + ULONGLONG nt_end; + + if (!*timeout) return; + if ((*timeout)->QuadPart == TIMEOUT_INFINITE) + { + *timeout = NULL; + return; + } + + if ((*timeout)->QuadPart > 0) + { + nt_end = (*timeout)->QuadPart; + *clock_id = CLOCK_REALTIME; + } + else + { + struct timespec ts; + + clock_gettime( CLOCK_MONOTONIC, &ts ); + nt_end = nt_time_from_ts( &ts ) - (*timeout)->QuadPart; + *clock_id = CLOCK_MONOTONIC; + } + + nt_end -= SECS_1601_TO_1970 * TICKSPERSEC; + end->tv_sec = nt_end / (ULONGLONG)TICKSPERSEC; + end->tv_nsec = (nt_end % TICKSPERSEC) * 100; +} + +static LONGLONG update_timeout( const struct timespec64 *end, clockid_t clock_id ) +{ + struct timespec end_ts, ts; + LONGLONG timeleft; + + clock_gettime( clock_id, &ts ); + end_ts.tv_sec = end->tv_sec; + end_ts.tv_nsec = end->tv_nsec; + timeleft = nt_time_from_ts( &end_ts ) - nt_time_from_ts( &ts ); + if (timeleft < 0) timeleft = 0; + return timeleft; +} + +static inline void futex_vector_set( struct futex_waitv *waitv, int *addr, int val ) +{ + waitv->uaddr = (uintptr_t) addr; + waitv->val = val; + waitv->flags = FUTEX_32; + waitv->__reserved = 0; +} + +static void simulate_sched_quantum(void) +{ + if (!fsync_simulate_sched_quantum) return; + /* futex wait is often very quick to resume a waiting thread when woken. + * That reveals synchonization bugs in some games which happen to work on + * Windows due to the waiting threads having some minimal delay to wake up. */ + usleep(0); +} + +static inline int futex_wait_multiple( const struct futex_waitv *futexes, + int count, const struct timespec64 *end, clockid_t clock_id ) +{ + if (end) + return syscall( __NR_futex_waitv, futexes, count, 0, end, clock_id ); + else + return syscall( __NR_futex_waitv, futexes, count, 0, NULL, 0 ); +} + +static inline int futex_wake( int *addr, int val ) +{ + return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); +} + +int do_fsync(void) +{ +#ifdef __linux__ + static int do_fsync_cached = -1; + + if (do_fsync_cached == -1) + { + syscall( __NR_futex_waitv, NULL, 0, 0, NULL, 0 ); + do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; + } + + return do_fsync_cached; +#else + static int once; + if (!once++) + FIXME("futexes not supported on this platform.\n"); + return 0; +#endif +} + +struct fsync +{ + enum fsync_type type; + void *shm; /* pointer to shm section */ +}; + +struct semaphore +{ + int count; + int max; + int ref; + int last_pid; +}; +C_ASSERT(sizeof(struct semaphore) == 16); + +struct event +{ + int signaled; + int unused; + int ref; + int last_pid; +}; +C_ASSERT(sizeof(struct event) == 16); + +struct mutex +{ + int tid; + int count; /* recursion count */ + int ref; + int last_pid; +}; +C_ASSERT(sizeof(struct mutex) == 16); + +static char shm_name[29]; +static int shm_fd; +static volatile void *shm_addrs[8192]; + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 16) / FSYNC_SHM_PAGE_SIZE; + int offset = (idx * 16) % FSYNC_SHM_PAGE_SIZE; + + if (entry >= ARRAY_SIZE(shm_addrs)) + { + ERR( "idx %u exceeds maximum of %u.\n", idx, + (unsigned int)ARRAY_SIZE(shm_addrs) * (FSYNC_SHM_PAGE_SIZE / 16) ); + return NULL; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, FSYNC_SHM_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, + (off_t)entry * FSYNC_SHM_PAGE_SIZE ); + if (addr == (void *)-1) + ERR("Failed to map page %d (offset %s).\n", entry, + wine_dbgstr_longlong((off_t)entry * FSYNC_SHM_PAGE_SIZE)); + + TRACE("Mapping page %d at %p.\n", entry, addr); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, FSYNC_SHM_PAGE_SIZE ); /* someone beat us to it */ + } + + return (char *)shm_addrs[entry] + offset; +} + +/* We'd like lookup to be fast. To that end, we use a static list indexed by handle. + * This is copied and adapted from the fd cache code. */ + +#define FSYNC_LIST_BLOCK_SIZE (65536 / sizeof(struct fsync)) +#define FSYNC_LIST_ENTRIES 256 + +struct fsync_cache +{ + enum fsync_type type; + unsigned int shm_idx; +}; + +C_ASSERT(sizeof(struct fsync_cache) == sizeof(uint64_t)); + +static struct fsync_cache *fsync_list[FSYNC_LIST_ENTRIES]; +static struct fsync_cache fsync_list_initial_block[FSYNC_LIST_BLOCK_SIZE]; + +static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) +{ + UINT_PTR idx = (((UINT_PTR)handle) >> 2) - 1; + *entry = idx / FSYNC_LIST_BLOCK_SIZE; + return idx % FSYNC_LIST_BLOCK_SIZE; +} + +static void add_to_list( HANDLE handle, enum fsync_type type, unsigned int shm_idx ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + struct fsync_cache cache; + + if (entry >= FSYNC_LIST_ENTRIES) + { + FIXME( "too many allocated handles, not caching %p\n", handle ); + return; + } + + if (!fsync_list[entry]) /* do we need to allocate a new block of entries? */ + { + if (!entry) fsync_list[0] = fsync_list_initial_block; + else + { + void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(*fsync_list[entry]), + PROT_READ | PROT_WRITE ); + if (ptr == MAP_FAILED) return; + if (__sync_val_compare_and_swap( &fsync_list[entry], NULL, ptr )) + munmap( ptr, FSYNC_LIST_BLOCK_SIZE * sizeof(*fsync_list[entry]) ); + } + } + + cache.type = type; + cache.shm_idx = shm_idx; + __atomic_store_n( (uint64_t *)&fsync_list[entry][idx], *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); +} + +static void grab_object( struct fsync *obj ) +{ + int *shm = obj->shm; + + __atomic_add_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); +} + +static unsigned int shm_index_from_shm( char *shm ) +{ + unsigned int i, idx_offset; + + for (i = 0; i < ARRAY_SIZE(shm_addrs); ++i) + { + if (shm >= (char *)shm_addrs[i] && shm < (char *)shm_addrs[i] + FSYNC_SHM_PAGE_SIZE) + { + idx_offset = (shm - (char *)shm_addrs[i]) / 16; + return i * (FSYNC_SHM_PAGE_SIZE / 16) + idx_offset; + } + } + + ERR( "Index for shm %p not found.\n", shm ); + return ~0u; +} + +static void put_object( struct fsync *obj ) +{ + int *shm = obj->shm; + + if (__atomic_load_n( &shm[2], __ATOMIC_SEQ_CST ) == 1) + { + /* We are holding the last reference, it should be released on server so shm idx get freed. */ + SERVER_START_REQ( fsync_free_shm_idx ) + { + req->shm_idx = shm_index_from_shm( obj->shm ); + wine_server_call( req ); + } + SERVER_END_REQ; + } + else + { + __atomic_sub_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); + } +} + +static void put_object_from_wait( struct fsync *obj ) +{ + int *shm = obj->shm; + + __sync_val_compare_and_swap( &shm[3], current_pid, 0 ); + put_object( obj ); +} + +static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + struct fsync_cache cache; + + if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return FALSE; + +again: + *(uint64_t *)&cache = __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST ); + + if (!cache.type || !cache.shm_idx) return FALSE; + + obj->type = cache.type; + obj->shm = get_shm( cache.shm_idx ); + grab_object( obj ); + if (((int *)obj->shm)[2] < 2 || + *(uint64_t *)&cache != __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) + { + /* This check does not strictly guarantee that we avoid the potential race but is supposed to greatly + * reduce the probability of that. */ + FIXME( "Cache changed while getting object, handle %p, shm_idx %d, refcount %d.\n", + handle, cache.shm_idx, ((int *)obj->shm)[2] ); + put_object( obj ); + goto again; + } + return TRUE; +} + +/* Gets an object. This is either a proper fsync object (i.e. an event, + * semaphore, etc. created using create_fsync) or a generic synchronizable + * server-side object which the server will signal (e.g. a process, thread, + * message queue, etc.) */ +static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) +{ + NTSTATUS ret = STATUS_SUCCESS; + unsigned int shm_idx = 0; + enum fsync_type type; + sigset_t sigset; + + if (get_cached_object( handle, obj )) return STATUS_SUCCESS; + + if ((INT_PTR)handle < 0) + { + /* We can deal with pseudo-handles, but it's just easier this way */ + return STATUS_NOT_IMPLEMENTED; + } + + if (!handle) return STATUS_INVALID_HANDLE; + + /* We need to try grabbing it from the server. Uninterrupted section + * is needed to avoid race with NtClose() which first calls fsync_close() + * and then closes handle on server. Without the section we might cache + * already closed handle back. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + if (get_cached_object( handle, obj )) + { + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + return STATUS_SUCCESS; + } + SERVER_START_REQ( get_fsync_idx ) + { + req->handle = wine_server_obj_handle( handle ); + if (!(ret = wine_server_call( req ))) + { + shm_idx = reply->shm_idx; + type = reply->type; + } + } + SERVER_END_REQ; + if (!ret) add_to_list( handle, type, shm_idx ); + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (ret) + { + WARN("Failed to retrieve shm index for handle %p, status %#x.\n", handle, (unsigned int)ret); + return ret; + } + + TRACE("Got shm index %d for handle %p.\n", shm_idx, handle); + + obj->type = type; + obj->shm = get_shm( shm_idx ); + /* get_fsync_idx server request increments shared mem refcount, so not grabbing object here. */ + return ret; +} + +static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj, int *prev_pid ) +{ + NTSTATUS ret; + int *shm; + + if ((ret = get_object( handle, obj ))) return ret; + + shm = obj->shm; + /* Give wineserver a chance to cleanup shm index if the process + * is killed while we are waiting on the object. */ + if (fsync_yield_to_waiters) + *prev_pid = __atomic_exchange_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); + else + __atomic_store_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_close( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + TRACE("%p.\n", handle); + + if (entry < FSYNC_LIST_ENTRIES && fsync_list[entry]) + { + struct fsync_cache cache; + + cache.type = 0; + cache.shm_idx = 0; + *(uint64_t *)&cache = __atomic_exchange_n( (uint64_t *)&fsync_list[entry][idx], + *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); + if (cache.type) return STATUS_SUCCESS; + } + + return STATUS_INVALID_HANDLE; +} + +static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int low, int high ) +{ + NTSTATUS ret; + data_size_t len; + struct object_attributes *objattr; + unsigned int shm_idx; + + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + + SERVER_START_REQ( create_fsync ) + { + req->access = access; + req->low = low; + req->high = high; + req->type = type; + wine_server_add_data( req, objattr, len ); + ret = wine_server_call( req ); + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + *handle = wine_server_ptr_handle( reply->handle ); + shm_idx = reply->shm_idx; + type = reply->type; + } + } + SERVER_END_REQ; + + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + add_to_list( *handle, type, shm_idx ); + TRACE("-> handle %p, shm index %d.\n", *handle, shm_idx); + } + + free( objattr ); + return ret; +} + +static NTSTATUS open_fsync( enum fsync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +{ + NTSTATUS ret; + unsigned int shm_idx; + + SERVER_START_REQ( open_fsync ) + { + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + req->type = type; + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + if (!(ret = wine_server_call( req ))) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + } + } + SERVER_END_REQ; + + if (!ret) + { + add_to_list( *handle, type, shm_idx ); + + TRACE("-> handle %p, shm index %u.\n", *handle, shm_idx); + } + return ret; +} + +void fsync_init(void) +{ + struct stat st; + + if (!do_fsync()) + { + /* make sure the server isn't running with WINEFSYNC */ + HANDLE handle; + NTSTATUS ret; + + ret = create_fsync( 0, &handle, 0, NULL, 0, 0 ); + if (ret != STATUS_NOT_IMPLEMENTED) + { + ERR("Server is running with WINEFSYNC but this process is not, please enable WINEFSYNC or restart wineserver.\n"); + exit(1); + } + + return; + } + + if (stat( config_dir, &st ) == -1) + ERR("Cannot stat %s\n", config_dir); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-fsync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-fsync", (unsigned long)st.st_ino ); + + if ((shm_fd = shm_open( shm_name, O_RDWR, 0644 )) == -1) + { + /* probably the server isn't running with WINEFSYNC, tell the user and bail */ + if (errno == ENOENT) + ERR("Failed to open fsync shared memory file; make sure no stale wineserver instances are running without WINEFSYNC.\n"); + else + ERR("Failed to initialize shared memory: %s\n", strerror( errno )); + exit(1); + } + + current_pid = GetCurrentProcessId(); + assert(current_pid); +} + +NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max ) +{ + TRACE("name %s, initial %d, max %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", (int)initial, (int)max); + + return create_fsync( FSYNC_SEMAPHORE, handle, access, attr, initial, max ); +} + +NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_SEMAPHORE, handle, access, attr ); +} + +NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +{ + struct fsync obj; + struct semaphore *semaphore; + ULONG current; + NTSTATUS ret; + + TRACE("%p, %d, %p.\n", handle, (int)count, prev); + + if ((ret = get_object( handle, &obj ))) return ret; + semaphore = obj.shm; + + do + { + current = semaphore->count; + if (count + current > semaphore->max) + { + put_object( &obj ); + return STATUS_SEMAPHORE_LIMIT_EXCEEDED; + } + } while (__sync_val_compare_and_swap( &semaphore->count, current, count + current ) != current); + + if (prev) *prev = current; + + futex_wake( &semaphore->count, INT_MAX ); + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct fsync obj; + struct semaphore *semaphore; + SEMAPHORE_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + semaphore = obj.shm; + + out->CurrentCount = semaphore->count; + out->MaximumCount = semaphore->max; + if (ret_len) *ret_len = sizeof(*out); + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) +{ + enum fsync_type type = (event_type == SynchronizationEvent ? FSYNC_AUTO_EVENT : FSYNC_MANUAL_EVENT); + + TRACE("name %s, %s-reset, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", + event_type == NotificationEvent ? "manual" : "auto", initial); + + return create_fsync( type, handle, access, attr, initial, 0xdeadbeef ); +} + +NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_AUTO_EVENT, handle, access, attr ); +} + +NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync obj; + LONG current; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj.shm; + + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); + return STATUS_OBJECT_TYPE_MISMATCH; + } + + if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) + futex_wake( &event->signaled, INT_MAX ); + + if (prev) *prev = current; + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync obj; + LONG current; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj.shm; + + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); + return STATUS_OBJECT_TYPE_MISMATCH; + } + + current = __atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); + + if (prev) *prev = current; + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync obj; + LONG current; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj.shm; + + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); + return STATUS_OBJECT_TYPE_MISMATCH; + } + + /* This isn't really correct; an application could miss the write. + * Unfortunately we can't really do much better. Fortunately this is rarely + * used (and publicly deprecated). */ + if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) + futex_wake( &event->signaled, INT_MAX ); + + /* Try to give other threads a chance to wake up. Hopefully erring on this + * side is the better thing to do... */ + usleep(0); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); + + if (prev) *prev = current; + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct event *event; + struct fsync obj; + EVENT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj.shm; + + out->EventState = event->signaled; + out->EventType = (obj.type == FSYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); + if (ret_len) *ret_len = sizeof(*out); + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) +{ + TRACE("name %s, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", initial); + + return create_fsync( FSYNC_MUTEX, handle, access, attr, + initial ? GetCurrentThreadId() : 0, initial ? 1 : 0 ); +} + +NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_MUTEX, handle, access, attr ); +} + +NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) +{ + struct mutex *mutex; + struct fsync obj; + NTSTATUS ret; + + TRACE("%p, %p.\n", handle, prev); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj.shm; + + if (mutex->tid != GetCurrentThreadId()) + { + put_object( &obj ); + return STATUS_MUTANT_NOT_OWNED; + } + + if (prev) *prev = mutex->count; + + if (!--mutex->count) + { + __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); + futex_wake( &mutex->tid, INT_MAX ); + } + + put_object( &obj ); + return STATUS_SUCCESS; +} + +NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct fsync obj; + struct mutex *mutex; + MUTANT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj.shm; + + out->CurrentCount = 1 - mutex->count; + out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); + out->AbandonedState = (mutex->tid == ~0); + if (ret_len) *ret_len = sizeof(*out); + + put_object( &obj ); + return STATUS_SUCCESS; +} + +static inline void try_yield_to_waiters( int prev_pid ) +{ + if (!fsync_yield_to_waiters) return; + + /* On Windows singaling an object will wake the threads waiting on the object. With fsync + * it may happen that signaling thread (or other thread) grabs the object before the already waiting + * thread gets a chance. Try to workaround that for the affected apps. Non-zero 'prev_pid' indicates + * that the object is grabbed in __fsync_wait_objects() by some other thread. It is the same for + * a non-current pid, but we may currently have a stale PID on an object from a terminated process + * and it is probably safer to skip this workaround. This won't work great if the object is used in 'wait all' + * and the waiter is blocked on the other object. + * This check is also not entirely reliable as if multiple waiters from the same process enter + * __fsync_wait_objects() the first one leaving will clear 'last_pid' in the object. */ + + if (prev_pid == current_pid) + usleep(0); +} + +static NTSTATUS do_single_wait( int *addr, int val, const struct timespec64 *end, clockid_t clock_id, + BOOLEAN alertable ) +{ + struct futex_waitv futexes[2]; + int ret; + + futex_vector_set( &futexes[0], addr, val ); + + if (alertable) + { + int *apc_futex = ntdll_get_thread_data()->fsync_apc_futex; + + if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) + return STATUS_USER_APC; + + futex_vector_set( &futexes[1], apc_futex, 0 ); + + ret = futex_wait_multiple( futexes, 2, end, clock_id ); + + if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) + return STATUS_USER_APC; + } + else + { + ret = futex_wait_multiple( futexes, 1, end, clock_id ); + } + + if (!ret) + return 0; + else if (ret < 0 && errno == ETIMEDOUT) + return STATUS_TIMEOUT; + else + return STATUS_PENDING; +} + +static void put_objects( struct fsync *objs, unsigned int count ) +{ + unsigned int i; + + for (i = 0; i < count; ++i) + if (objs[i].type) put_object_from_wait( &objs[i] ); +} + +static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, + BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + static const LARGE_INTEGER zero = {0}; + + int current_tid = 0; +#define CURRENT_TID (current_tid ? current_tid : (current_tid = GetCurrentThreadId())) + + struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; + struct fsync objs[MAXIMUM_WAIT_OBJECTS]; + BOOL msgwait = FALSE, waited = FALSE; + int prev_pids[MAXIMUM_WAIT_OBJECTS]; + int has_fsync = 0, has_server = 0; + clockid_t clock_id = 0; + struct timespec64 end; + int dummy_futex = 0; + LONGLONG timeleft; + DWORD waitcount; + int i, ret; + + /* Grab the APC futex if we don't already have it. */ + if (alertable && !ntdll_get_thread_data()->fsync_apc_futex) + { + unsigned int idx = 0; + SERVER_START_REQ( get_fsync_apc_idx ) + { + if (!(ret = wine_server_call( req ))) + idx = reply->shm_idx; + } + SERVER_END_REQ; + + if (idx) + { + struct event *apc_event = get_shm( idx ); + ntdll_get_thread_data()->fsync_apc_futex = &apc_event->signaled; + } + } + + get_wait_end_time( &timeout, &end, &clock_id ); + + for (i = 0; i < count; i++) + { + ret = get_object_for_wait( handles[i], &objs[i], &prev_pids[i] ); + if (ret == STATUS_SUCCESS) + { + assert( objs[i].type ); + has_fsync = 1; + } + else if (ret == STATUS_NOT_IMPLEMENTED) + { + objs[i].type = 0; + objs[i].shm = NULL; + has_server = 1; + } + else + { + put_objects( objs, i ); + return ret; + } + } + + if (count && objs[count - 1].type == FSYNC_QUEUE) + msgwait = TRUE; + + if (has_fsync && has_server) + FIXME("Can't wait on fsync and server objects at the same time!\n"); + else if (has_server) + { + put_objects( objs, count ); + return STATUS_NOT_IMPLEMENTED; + } + + if (TRACE_ON(fsync)) + { + TRACE("Waiting for %s of %d handles:", wait_any ? "any" : "all", (int)count); + for (i = 0; i < count; i++) + TRACE(" %p", handles[i]); + + if (msgwait) + TRACE(" or driver events"); + if (alertable) + TRACE(", alertable"); + + if (!timeout) + TRACE(", timeout = INFINITE.\n"); + else + { + timeleft = update_timeout( &end, clock_id ); + TRACE(", timeout = %ld.%07ld sec.\n", + (long) (timeleft / TICKSPERSEC), (long) (timeleft % TICKSPERSEC)); + } + } + + if (wait_any || count <= 1) + { + while (1) + { + /* Try to grab anything. */ + + if (alertable) + { + /* We must check this first! The server may set an event that + * we're waiting on, but we need to return STATUS_USER_APC. */ + if (__atomic_load_n( ntdll_get_thread_data()->fsync_apc_futex, __ATOMIC_SEQ_CST )) + goto userapc; + } + + for (i = 0; i < count; i++) + { + struct fsync *obj = &objs[i]; + + if (obj->type) + { + switch (obj->type) + { + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + int current, new; + + new = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST ); + if (!waited && new) + try_yield_to_waiters(prev_pids[i]); + + while ((current = new)) + { + if ((new = __sync_val_compare_and_swap( &semaphore->count, current, current - 1 )) == current) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } + } + futex_vector_set( &futexes[i], &semaphore->count, 0 ); + break; + } + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + int tid; + + if (mutex->tid == CURRENT_TID) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count++; + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } + + if (!waited && !mutex->tid) + try_yield_to_waiters(prev_pids[i]); + + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, CURRENT_TID ))) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count = 1; + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } + else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, CURRENT_TID )) == ~0) + { + TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); + mutex->count = 1; + put_objects( objs, count ); + return STATUS_ABANDONED_WAIT_0 + i; + } + + futex_vector_set( &futexes[i], &mutex->tid, tid ); + break; + } + case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: + { + struct event *event = obj->shm; + + if (!waited && event->signaled) + try_yield_to_waiters(prev_pids[i]); + + if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + { + if (ac_odyssey && alertable) + usleep( 0 ); + + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } + futex_vector_set( &futexes[i], &event->signaled, 0 ); + break; + } + case FSYNC_MANUAL_EVENT: + case FSYNC_MANUAL_SERVER: + case FSYNC_QUEUE: + { + struct event *event = obj->shm; + + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + { + if (ac_odyssey && alertable) + usleep( 0 ); + + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } + futex_vector_set( &futexes[i], &event->signaled, 0 ); + break; + } + default: + ERR("Invalid type %#x for handle %p.\n", obj->type, handles[i]); + assert(0); + } + } + else + { + /* Avoid breaking things entirely. */ + futex_vector_set( &futexes[i], &dummy_futex, dummy_futex ); + } + } + + if (alertable) + { + /* We already checked if it was signaled; don't bother doing it again. */ + futex_vector_set( &futexes[i++], ntdll_get_thread_data()->fsync_apc_futex, 0 ); + } + waitcount = i; + + /* Looks like everything is contended, so wait. */ + + if (ac_odyssey && alertable) + usleep( 0 ); + + if (timeout && !timeout->QuadPart) + { + /* Unlike esync, we already know that we've timed out, so we + * can avoid a syscall. */ + TRACE("Wait timed out.\n"); + put_objects( objs, count ); + return STATUS_TIMEOUT; + } + + ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL, clock_id ); + + /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, + * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to + * try again, bad address is already handled by the fact that we + * tried to read from it, so only break out on a timeout. */ + if (ret == -1 && errno == ETIMEDOUT) + { + TRACE("Wait timed out.\n"); + put_objects( objs, count ); + return STATUS_TIMEOUT; + } + else waited = TRUE; + } /* while (1) */ + } + else + { + /* Wait-all is a little trickier to implement correctly. Fortunately, + * it's not as common. + * + * The idea is basically just to wait in sequence on every object in the + * set. Then when we're done, try to grab them all in a tight loop. If + * that fails, release any resources we've grabbed (and yes, we can + * reliably do this—it's just mutexes and semaphores that we have to + * put back, and in both cases we just put back 1), and if any of that + * fails we start over. + * + * What makes this inherently bad is that we might temporarily grab a + * resource incorrectly. Hopefully it'll be quick (and hey, it won't + * block on wineserver) so nobody will notice. Besides, consider: if + * object A becomes signaled but someone grabs it before we can grab it + * and everything else, then they could just as well have grabbed it + * before it became signaled. Similarly if object A was signaled and we + * were blocking on object B, then B becomes available and someone grabs + * A before we can, then they might have grabbed A before B became + * signaled. In either case anyone who tries to wait on A or B will be + * waiting for an instant while we put things back. */ + + NTSTATUS status = STATUS_SUCCESS; + int current; + + while (1) + { + BOOL abandoned; + +tryagain: + abandoned = FALSE; + + /* First step: try to wait on each object in sequence. */ + + for (i = 0; i < count; i++) + { + struct fsync *obj = &objs[i]; + + if (obj->type == FSYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == CURRENT_TID) + continue; + + while ((current = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ))) + { + status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL, clock_id, alertable ); + if (status != STATUS_PENDING) + break; + } + } + else if (obj->type) + { + /* this works for semaphores too */ + struct event *event = obj->shm; + + while (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + { + status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL, clock_id, alertable ); + if (status != STATUS_PENDING) + break; + } + } + + if (status == STATUS_TIMEOUT) + { + TRACE("Wait timed out.\n"); + put_objects( objs, count ); + return status; + } + else if (status == STATUS_USER_APC) + goto userapc; + } + + /* If we got here and we haven't timed out, that means all of the + * handles were signaled. Check to make sure they still are. */ + for (i = 0; i < count; i++) + { + struct fsync *obj = &objs[i]; + + if (obj->type == FSYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); + + if (tid && tid != ~0 && tid != CURRENT_TID) + goto tryagain; + } + else if (obj->type) + { + struct event *event = obj->shm; + + if (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + goto tryagain; + } + } + + /* Yep, still signaled. Now quick, grab everything. */ + for (i = 0; i < count; i++) + { + struct fsync *obj = &objs[i]; + if (!obj->type) continue; + switch (obj->type) + { + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); + if (tid == CURRENT_TID) + break; + if (tid && tid != ~0) + goto tooslow; + if (__sync_val_compare_and_swap( &mutex->tid, tid, CURRENT_TID ) != tid) + goto tooslow; + if (tid == ~0) + abandoned = TRUE; + break; + } + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + int current, new; + + new = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST ); + while ((current = new)) + { + if ((new = __sync_val_compare_and_swap( &semaphore->count, current, current - 1 )) == current) + break; + } + if (!current) + goto tooslow; + break; + } + case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: + { + struct event *event = obj->shm; + if (!__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + goto tooslow; + break; + } + default: + /* If a manual-reset event changed between there and + * here, it's shouldn't be a problem. */ + break; + } + } + + /* If we got here, we successfully waited on every object. + * Make sure to let ourselves know that we grabbed the mutexes. */ + for (i = 0; i < count; i++) + { + if (objs[i].type == FSYNC_MUTEX) + { + struct mutex *mutex = objs[i].shm; + mutex->count++; + } + } + + if (abandoned) + { + TRACE("Wait successful, but some object(s) were abandoned.\n"); + put_objects( objs, count ); + return STATUS_ABANDONED; + } + TRACE("Wait successful.\n"); + put_objects( objs, count ); + return STATUS_SUCCESS; + +tooslow: + for (--i; i >= 0; i--) + { + struct fsync *obj = &objs[i]; + if (!obj->type) continue; + switch (obj->type) + { + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + /* HACK: This won't do the right thing with abandoned + * mutexes, but fixing it is probably more trouble than + * it's worth. */ + __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); + break; + } + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + __sync_fetch_and_add( &semaphore->count, 1 ); + break; + } + case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: + { + struct event *event = obj->shm; + __atomic_store_n( &event->signaled, 1, __ATOMIC_SEQ_CST ); + break; + } + default: + /* doesn't need to be put back */ + break; + } + } + } /* while (1) */ + } /* else (wait-all) */ + + assert(0); /* shouldn't reach here... */ + +userapc: + TRACE("Woken up by user APC.\n"); + + put_objects( objs, count ); + + /* We have to make a server call anyway to get the APC to execute, so just + * delegate down to server_wait(). */ + ret = server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero ); + + /* This can happen if we received a system APC, and the APC fd was woken up + * before we got SIGUSR1. poll() doesn't return EINTR in that case. The + * right thing to do seems to be to return STATUS_USER_APC anyway. */ + if (ret == STATUS_TIMEOUT) ret = STATUS_USER_APC; + return ret; +#undef CURRENT_TID +} + +/* Like esync, we need to let the server know when we are doing a message wait, + * and when we are done with one, so that all of the code surrounding hung + * queues works, and we also need this for WaitForInputIdle(). + * + * Unlike esync, we can't wait on the queue fd itself locally. Instead we let + * the server do that for us, the way it normally does. This could actually + * work for esync too, and that might be better. */ +static void server_set_msgwait( int in_msgwait ) +{ + SERVER_START_REQ( fsync_msgwait ) + { + req->in_msgwait = in_msgwait; + wine_server_call( req ); + } + SERVER_END_REQ; +} + +/* This is a very thin wrapper around the proper implementation above. The + * purpose is to make sure the server knows when we are doing a message wait. + * This is separated into a wrapper function since there are at least a dozen + * exit paths from fsync_wait_objects(). */ +NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + BOOL msgwait = FALSE; + struct fsync obj; + NTSTATUS ret; + + if (count && !get_object( handles[count - 1], &obj )) + { + if (obj.type == FSYNC_QUEUE) + { + msgwait = TRUE; + server_set_msgwait( 1 ); + } + put_object( &obj ); + } + + ret = __fsync_wait_objects( count, handles, wait_any, alertable, timeout ); + + if (msgwait) + server_set_msgwait( 0 ); + + return ret; +} + +NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) +{ + struct fsync obj; + NTSTATUS ret; + + if ((ret = get_object( signal, &obj ))) return ret; + + switch (obj.type) + { + case FSYNC_SEMAPHORE: + ret = fsync_release_semaphore( signal, 1, NULL ); + break; + case FSYNC_AUTO_EVENT: + case FSYNC_MANUAL_EVENT: + ret = fsync_set_event( signal, NULL ); + break; + case FSYNC_MUTEX: + ret = fsync_release_mutex( signal, NULL ); + break; + default: + ret = STATUS_OBJECT_TYPE_MISMATCH; + break; + } + put_object( &obj ); + if (ret) return ret; + + return fsync_wait_objects( 1, &wait, TRUE, alertable, timeout ); +} diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h new file mode 100644 index 00000000000..6005c0fa322 --- /dev/null +++ b/dlls/ntdll/unix/fsync.h @@ -0,0 +1,54 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_fsync(void); +extern void fsync_init(void); +extern NTSTATUS fsync_close( HANDLE handle ); + +extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); +extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); +extern NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ); +extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ); +extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ); + +extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); +extern NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); + +/* We have to synchronize on the fd cache mutex so that fsync_close(), close_handle() sequence + * called from NtClose() doesn't race with get_fsync_idx(), add_to_list() sequence called + * from get_object(). */ +extern pthread_mutex_t fd_cache_mutex; diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 803d8079213..4f8a84c6080 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -88,6 +88,8 @@ extern char **environ; #include "winioctl.h" #include "winternl.h" #include "unix_private.h" +#include "esync.h" +#include "fsync.h" #include "wine/list.h" #include "ntsyscalls.h" #include "wine/debug.h" @@ -338,11 +340,17 @@ static const char *get_pe_dir( WORD machine ) static void set_dll_path(void) { - char *p, *path = getenv( "WINEDLLPATH" ); + char *p, *path = getenv( "WINEDLLPATH" ), *be_runtime = getenv( "PROTON_BATTLEYE_RUNTIME" ), *eac_runtime = getenv( "PROTON_EAC_RUNTIME" ); int i, count = 0; if (path) for (p = path, count = 1; *p; p++) if (*p == ':') count++; + if (be_runtime) + count += 2; + + if (eac_runtime) + count += 2; + dll_paths = malloc( (count + 2) * sizeof(*dll_paths) ); count = 0; @@ -355,6 +363,42 @@ static void set_dll_path(void) free( path ); } + if (be_runtime) + { + const char lib32[] = "/v1/lib/wine/"; + const char lib64[] = "/v1/lib64/wine/"; + + p = malloc( strlen(be_runtime) + strlen(lib32) + 1 ); + strcpy(p, be_runtime); + strcat(p, lib32); + + dll_paths[count++] = p; + + p = malloc( strlen(be_runtime) + strlen(lib64) + 1 ); + strcpy(p, be_runtime); + strcat(p, lib64); + + dll_paths[count++] = p; + } + + if (eac_runtime) + { + const char lib32[] = "/v2/lib32/"; + const char lib64[] = "/v2/lib64/"; + + p = malloc( strlen(eac_runtime) + strlen(lib32) + 1 ); + strcpy(p, eac_runtime); + strcat(p, lib32); + + dll_paths[count++] = p; + + p = malloc( strlen(eac_runtime) + strlen(lib64) + 1 ); + strcpy(p, eac_runtime); + strcat(p, lib64); + + dll_paths[count++] = p; + } + for (i = 0; i < count; i++) dll_path_maxlen = max( dll_path_maxlen, strlen(dll_paths[i]) ); dll_paths[count] = NULL; } @@ -548,11 +592,47 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i WORD machine = pe_info->machine; ULONGLONG res_start = pe_info->base; ULONGLONG res_end = pe_info->base + pe_info->map_size; + const char *ld_preload = getenv( "LD_PRELOAD" ); char preloader_reserve[64], socket_env[64]; if (pe_info->wine_fakedll) res_start = res_end = 0; if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine; + unsetenv( "WINE_LD_PRELOAD" ); + + /* HACK: Unset LD_PRELOAD before executing explorer.exe to disable buggy gameoverlayrenderer.so */ + if (ld_preload && argv[2] && !strcmp( argv[2], "C:\\windows\\system32\\explorer.exe" ) && + argv[3] && !strcmp( argv[3], "/desktop" )) + { + static char const gorso[] = "gameoverlayrenderer.so"; + static int gorso_len = sizeof(gorso) - 1; + int len = strlen( ld_preload ); + char *next, *tmp, *env = malloc( sizeof("LD_PRELOAD=") + len ); + + if (!env) return STATUS_NO_MEMORY; + strcpy( env, "LD_PRELOAD=" ); + strcat( env, ld_preload ); + + tmp = env + 11; + do + { + if (!(next = strchr( tmp, ':' ))) next = tmp + strlen( tmp ); + if (next - tmp >= gorso_len && strncmp( next - gorso_len, gorso, gorso_len ) == 0) + { + if (*next) memmove( tmp, next + 1, strlen(next) ); + else *tmp = 0; + next = tmp; + } + else tmp = next + 1; + } + while (*next); + + putenv( env ); + ld_preload = NULL; + } + + if (ld_preload) setenv( "WINE_LD_PRELOAD", ld_preload, 1 ); + signal( SIGPIPE, SIG_DFL ); snprintf( socket_env, sizeof(socket_env), "WINESERVERSOCKET=%u", socketfd ); @@ -972,6 +1052,146 @@ static NTSTATUS load_so_dll( void *args ) return status; } +static void *steamclient_srcs[128]; +static void *steamclient_tgts[128]; +static int steamclient_count; + +void *steamclient_handle_fault( LPCVOID addr, DWORD err ) +{ + int i; + + if (!(err & EXCEPTION_EXECUTE_FAULT)) return NULL; + + for (i = 0; i < steamclient_count; ++i) + { + if (addr == steamclient_srcs[i]) + return steamclient_tgts[i]; + } + + return NULL; +} + +static void steamclient_write_jump(void *src_addr, void *tgt_addr) +{ +#ifdef _WIN64 + static const char mov[] = {0x48, 0xb8}; +#else + static const char mov[] = {0xb8}; +#endif + static const char jmp[] = {0xff, 0xe0}; + memcpy(src_addr, mov, sizeof(mov)); + memcpy((char *)src_addr + sizeof(mov), &tgt_addr, sizeof(tgt_addr)); + memcpy((char *)src_addr + sizeof(mov) + sizeof(tgt_addr), jmp, sizeof(jmp)); +} + +static NTSTATUS steamclient_setup_trampolines( void *args ) +{ + static int noexec_cached = -1; + struct steamclient_setup_trampolines_params *params = args; + HMODULE src_mod = params->src_mod, tgt_mod = params->tgt_mod; + SYSTEM_BASIC_INFORMATION info; + IMAGE_NT_HEADERS *src_nt = (IMAGE_NT_HEADERS *)((UINT_PTR)src_mod + ((IMAGE_DOS_HEADER *)src_mod)->e_lfanew); + IMAGE_NT_HEADERS *tgt_nt = (IMAGE_NT_HEADERS *)((UINT_PTR)tgt_mod + ((IMAGE_DOS_HEADER *)tgt_mod)->e_lfanew); + IMAGE_SECTION_HEADER *src_sec = (IMAGE_SECTION_HEADER *)(src_nt + 1); + const IMAGE_EXPORT_DIRECTORY *src_exp, *tgt_exp; + const DWORD *names; + SIZE_T size; + void *addr, *src_addr, *tgt_addr; + char *name, *wsne; + UINT_PTR page_mask; + int i; + + if (noexec_cached == -1) + noexec_cached = (wsne = getenv("WINESTEAMNOEXEC")) && atoi(wsne); + + virtual_get_system_info( &info, !!NtCurrentTeb()->WowTebOffset ); + page_mask = info.PageSize - 1; + + for (i = 0; i < src_nt->FileHeader.NumberOfSections; ++i) + { + if (memcmp(src_sec[i].Name, ".text", 5)) continue; + addr = (void *)(((UINT_PTR)src_mod + src_sec[i].VirtualAddress) & ~page_mask); + size = (src_sec[i].Misc.VirtualSize + page_mask) & ~page_mask; + if (noexec_cached) mprotect(addr, size, PROT_READ); + else mprotect(addr, size, PROT_READ|PROT_WRITE|PROT_EXEC); + } + + src_exp = get_module_data_dir( src_mod, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + tgt_exp = get_module_data_dir( tgt_mod, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + names = (const DWORD *)((UINT_PTR)src_mod + src_exp->AddressOfNames); + for (i = 0; i < src_exp->NumberOfNames; ++i) + { + if (!names[i] || !(name = (char *)((UINT_PTR)src_mod + names[i]))) continue; + if (!(src_addr = (void *)find_named_export(src_mod, src_exp, name))) continue; + if (!(tgt_addr = (void *)find_named_export(tgt_mod, tgt_exp, name))) continue; + assert(steamclient_count < ARRAY_SIZE(steamclient_srcs)); + steamclient_srcs[steamclient_count] = src_addr; + steamclient_tgts[steamclient_count] = tgt_addr; + if (!noexec_cached) steamclient_write_jump(src_addr, tgt_addr); + else steamclient_count++; + } + + src_addr = (void *)((UINT_PTR)src_mod + src_nt->OptionalHeader.AddressOfEntryPoint); + tgt_addr = (void *)((UINT_PTR)tgt_mod + tgt_nt->OptionalHeader.AddressOfEntryPoint); + assert(steamclient_count < ARRAY_SIZE(steamclient_srcs)); + steamclient_srcs[steamclient_count] = src_addr; + steamclient_tgts[steamclient_count] = tgt_addr; + if (!noexec_cached) steamclient_write_jump(src_addr, tgt_addr); + else steamclient_count++; + + return STATUS_SUCCESS; +} + +static BOOL debugstr_pc_impl( void *pc, char *buffer, unsigned int size ) +{ + unsigned int len; + char *s = buffer; + Dl_info info; + + snprintf( s, size, "%p:", pc ); + if (!dladdr( pc, &info )) return FALSE; + + s += (len = strlen( s )); + size -= len; + snprintf( s, size, " %s + %#zx", info.dli_fname, (char *)pc - (char *)info.dli_fbase ); + if (info.dli_sname) + { + s += (len = strlen( s )); + size -= len; + snprintf( s, size, " (%s + %#zx)", info.dli_sname, (char *)pc - (char *)info.dli_saddr ); + } + return TRUE; +} + +static NTSTATUS debugstr_pc( void *args ) +{ + struct debugstr_pc_args *params = args; + + return debugstr_pc_impl( params->pc, params->buffer, params->size ) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +} + +const char * wine_debuginfostr_pc( void *pc ) +{ + char buffer[256]; + + debugstr_pc_impl( pc, buffer, sizeof(buffer) ); + return __wine_dbg_strdup( buffer ); +} + +static BOOL report_native_pc_as_ntdll; + +static NTSTATUS is_pc_in_native_so(void *pc) +{ + Dl_info info; + + if (!report_native_pc_as_ntdll || !dladdr( pc, &info )) return FALSE; + + TRACE( "pc %p, module %s.\n", pc, debugstr_a(info.dli_fname) ); + + if (strstr( info.dli_fname, ".dll.so")) return FALSE; + + return TRUE; +} static const unixlib_entry_t unix_call_funcs[] = { @@ -983,6 +1203,9 @@ static const unixlib_entry_t unix_call_funcs[] = unixcall_wine_server_handle_to_fd, unixcall_wine_spawnvp, system_time_precise, + steamclient_setup_trampolines, + is_pc_in_native_so, + debugstr_pc, }; @@ -1797,6 +2020,148 @@ static ULONG_PTR get_image_address(void) return 0; } +BOOL ac_odyssey; +BOOL fsync_simulate_sched_quantum; +BOOL alert_simulate_sched_quantum; +BOOL fsync_yield_to_waiters; +BOOL no_priv_elevation; +BOOL localsystem_sid; +BOOL simulate_writecopy; +BOOL wine_allocs_2g_limit; +SIZE_T kernel_stack_size = 0x100000; +long long ram_reporting_bias; + +static void hacks_init(void) +{ + const char *sgi = getenv( "SteamGameId" ); + const char *env_str; + if ((env_str = getenv("WINE_RAM_REPORTING_BIAS"))) + { + ram_reporting_bias = atoll(env_str) * 1024 * 1024; + ERR( "HACK: ram_reporting_bias %lldMB.\n", ram_reporting_bias / (1024 * 1024) ); + } + + env_str = getenv("WINE_SIMULATE_ASYNC_READ"); + if (env_str) + ac_odyssey = !!atoi(env_str); + else if (main_argc > 1 && (strstr(main_argv[1], "ACOdyssey.exe") || strstr(main_argv[1], "ImmortalsFenyxRising.exe"))) + ac_odyssey = TRUE; + + if (ac_odyssey) + ERR("HACK: AC Odyssey sync tweak on.\n"); + + env_str = getenv("WINE_FSYNC_SIMULATE_SCHED_QUANTUM"); + if (env_str) + fsync_simulate_sched_quantum = !!atoi(env_str); + else if (main_argc > 1) + { + fsync_simulate_sched_quantum = !!strstr(main_argv[1], "Ubisoft Game Launcher\\upc.exe"); + fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "PlanetZoo.exe"); + fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "GTA5.exe"); + } + if (fsync_simulate_sched_quantum) + ERR("HACK: Simulating sched quantum in fsync.\n"); + + env_str = getenv("WINE_ALERT_SIMULATE_SCHED_QUANTUM"); + if (env_str) + alert_simulate_sched_quantum = !!atoi(env_str); + else if (main_argc > 1) + { + alert_simulate_sched_quantum = !!strstr(main_argv[1], "GTA5.exe"); + } + if (alert_simulate_sched_quantum) + ERR("HACK: Simulating sched quantum in NtWaitForAlertByThreadId.\n"); + + env_str = getenv("WINE_FSYNC_YIELD_TO_WAITERS"); + if (env_str) + fsync_yield_to_waiters = !!atoi(env_str); + else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120") || !strcmp(sgi, "345350") || !strcmp(sgi, "292140"); + if (fsync_yield_to_waiters) + ERR("HACK: fsync: yield to waiters.\n"); + + switch (sgi ? atoi( sgi ) : -1) + { + case 25700: /* Madballs in Babo: Invasion */ + case 50130: /* Mafia II */ + case 202990: /* CoD Black Ops II Multiplayer */ + case 212910: /* CoD Black Ops II Zombies */ + setenv( "WINESTEAMNOEXEC", "1", 0 ); + break; + } + + env_str = getenv("WINE_NO_PRIV_ELEVATION"); + if (env_str) no_priv_elevation = atoi(env_str); + else if (main_argc > 1 && strstr(main_argv[1], "playway-launcher-installer.exe")) no_priv_elevation = TRUE; + else if (sgi) no_priv_elevation = !strcmp(sgi, "1584660"); + if (no_priv_elevation) + ERR("HACK: no_priv_elevation"); + + env_str = getenv("WINE_UNIX_PC_AS_NTDLL"); + if (env_str) report_native_pc_as_ntdll = atoi(env_str); + else if (sgi) report_native_pc_as_ntdll = !strcmp(sgi, "700330"); + + env_str = getenv("WINE_SIMULATE_WRITECOPY"); + if (env_str) simulate_writecopy = atoi(env_str); + else if (main_argc > 1 && + (strstr(main_argv[1], "UplayWebCore.exe") + || (strstr(main_argv[1], "Battle.net.exe")))) + simulate_writecopy = TRUE; + else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") /* Dawn of Corruption */ + || !strcmp(sgi, "1680700") /* Purgo box */ + || !strcmp(sgi, "2095300") /* Breakout 13 */ + || !strcmp(sgi, "2053940") /* Idol Hands 2 */ + || !strcmp(sgi, "391150") /* Red Tie Runner */ + || !strcmp(sgi, "2152990") /* Dinogen Online */ + || !strcmp(sgi, "2176450") /* Mr. Hopp's Playhouse 3 */ + || !strcmp(sgi, "2361360"); /* Hentai Maid Memories */ + + if (sgi) wine_allocs_2g_limit = !strcmp(sgi, "359870"); + if (wine_allocs_2g_limit) ERR("Allocation 2g limit enabled.\n"); + + if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) + { + ERR("HACK: reporting LocalSystem account SID.\n"); + localsystem_sid = TRUE; + return; + } + + if ((env_str = getenv( "WINE_KERNEL_STACK_SIZE" ))) + kernel_stack_size = atoll( env_str ) * 1024; + else if (sgi && !strcmp( sgi, "702700" )) + kernel_stack_size = 200 * 1024; + if (kernel_stack_size != 0x100000) + ERR( "HACK: setting kernel_stack_size to %luKB.\n", (long)(kernel_stack_size / 1024) ); + + if (sgi && (0 + || !strcmp(sgi, "1364780") || !strcmp(sgi, "1952120") || !strcmp(sgi, "2154900") /* Street Fighter 6 */ + || !strcmp(sgi, "1740720") /* Have a Nice Death */ + )) + { + ERR("HACK: setting WINE_ENABLE_GST_LIVE_LATENCY.\n"); + setenv("WINE_ENABLE_GST_LIVE_LATENCY", "1", 0); + } + if (sgi && !strcmp(sgi, "292030")) + { + ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); + setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); + } + + if (main_argc > 1 && (strstr(main_argv[1], "\\EADesktop.exe") || strstr(main_argv[1], "\\Link2EA.exe") + || strstr(main_argv[1], "EA Desktop\\ErrorReporter.exe") || strstr(main_argv[1], "\\EAConnect_microsoft.exe") + || strstr(main_argv[1], "\\EALaunchHelper.exe") || strstr(main_argv[1], "\\EACrashReporter.exe"))) + { + ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); + setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); + } + + if (sgi && !strcmp(sgi, "2379390")) + { + ERR("HACK: setting vk_x11_override_min_image_count, vk_x11_strict_image_count.\n"); + setenv("vk_x11_override_min_image_count", "2", 0); + setenv("vk_x11_strict_image_count", "true", 0); + } +} + /*********************************************************************** * start_main_thread */ @@ -1808,9 +2173,15 @@ static void start_main_thread(void) signal_alloc_thread( teb ); dbg_init(); startup_info_size = server_init_process(); + hacks_init(); + fsync_init(); + esync_init(); virtual_map_user_shared_data(); init_cpu_info(); init_files(); + + set_thread_teb( teb ); + init_startup_info(); *(ULONG_PTR *)&peb->CloudFileFlags = get_image_address(); set_load_order_app_name( main_wargv[0] ); @@ -2151,6 +2522,9 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] ) #ifdef RLIMIT_AS set_max_limit( RLIMIT_AS ); #endif +#ifdef RLIMIT_NICE + set_max_limit( RLIMIT_NICE ); +#endif virtual_init(); init_environment(); diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c index aa987a80186..bbe50928880 100644 --- a/dlls/ntdll/unix/loadorder.c +++ b/dlls/ntdll/unix/loadorder.c @@ -59,6 +59,7 @@ static HANDLE std_key; static HANDLE app_key; static BOOL init_done; static BOOL main_exe_loaded; +static BOOL eac_launcher_process; /*************************************************************************** @@ -362,11 +363,24 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, WCHA */ void set_load_order_app_name( const WCHAR *app_name ) { + static const WCHAR eac_launcherW[] = {'P','R','O','T','O','N','_','E','A','C','_','L','A','U','N','C','H','E','R','_','P','R','O','C','E','S','S',0}; const WCHAR *p; if ((p = wcsrchr( app_name, '\\' ))) app_name = p + 1; app_key = open_app_key( app_name ); main_exe_loaded = TRUE; + + p = NtCurrentTeb()->Peb->ProcessParameters->Environment; + while(*p) + { + if (!wcsncmp( p, eac_launcherW, ARRAY_SIZE(eac_launcherW) - 1 )) + { + eac_launcher_process = TRUE; + break; + } + + p += wcslen(p) + 1; + } } @@ -378,6 +392,11 @@ void set_load_order_app_name( const WCHAR *app_name ) */ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) { + static const WCHAR easyanticheat_x86W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','8','6','.','d','l','l',0}; + static const WCHAR easyanticheat_x64W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','6','4','.','d','l','l',0}; + static const WCHAR easyanticheatW[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','.','d','l','l',0}; + static const WCHAR soW[] = {'s','o',0}; + static const WCHAR prefixW[] = {'\\','?','?','\\'}; enum loadorder ret = LO_INVALID; const WCHAR *path = nt_name->Buffer; @@ -391,6 +410,50 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) TRACE("looking for %s\n", debugstr_w(path)); + /* HACK: special logic for easyanticheat bridge: only load the bridge (builtin) if there exists a native version of the library next to the windows version */ + basename = get_basename((WCHAR *)path); + if (!wcsicmp(basename, easyanticheat_x86W) || !wcsicmp(basename, easyanticheat_x64W) || !wcsicmp(basename, easyanticheatW)) + { + UNICODE_STRING eac_unix_name; + OBJECT_ATTRIBUTES attr; + char *unix_path = NULL; + NTSTATUS status; + + if (eac_launcher_process) + { + ret = LO_NATIVE; + TRACE("got hardcoded %s for %s, as this is the EAC launcher process\n", debugstr_loadorder(ret), debugstr_w(path) ); + return ret; + } + + len = wcslen(nt_name->Buffer); + eac_unix_name.Buffer = malloc( (len + 5) * sizeof(WCHAR) ); + wcscpy(eac_unix_name.Buffer, nt_name->Buffer); + + basename = get_basename(eac_unix_name.Buffer); + if (!wcsicmp(basename, easyanticheatW)) + wcscpy(basename, easyanticheat_x64W); + wcscpy(&basename[18], soW); + eac_unix_name.Length = eac_unix_name.MaximumLength = wcslen(eac_unix_name.Buffer) * sizeof(WCHAR); + InitializeObjectAttributes(&attr, &eac_unix_name, 0, NULL, NULL); + + if (!(status = nt_to_unix_file_name(&attr, &unix_path, FILE_OPEN))) + { + free(unix_path); + free(eac_unix_name.Buffer); + ret = LO_BUILTIN; + TRACE( "got hardcoded %s for %s, as the eac unix library is present\n", debugstr_loadorder(ret), debugstr_w(path) ); + return ret; + } + else + { + ret = LO_NATIVE; + TRACE( "got hardcoded %s for %s, as the eac unix library (%s) is not present. status %x\n", debugstr_loadorder(ret), debugstr_w(path), debugstr_w(eac_unix_name.Buffer), (int)status ); + free(eac_unix_name.Buffer); + return ret; + } + } + /* Strip path information if the module resides in the system directory */ if (!wcsnicmp( system_dir + 4, path, wcslen(system_dir) - 4 )) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 71eab55920d..3f05fe9be2e 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -983,6 +983,8 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ return status; } +BOOL terminate_process_running; +LONG terminate_process_exit_code; /****************************************************************************** * NtTerminateProcess (NTDLL.@) @@ -992,6 +994,14 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) unsigned int ret; BOOL self; + TRACE("handle %p, exit_code %d, process_exiting %d.\n", handle, (int)exit_code, process_exiting); + + if (handle == GetCurrentProcess()) + { + terminate_process_running = TRUE; + terminate_process_exit_code = exit_code; + } + SERVER_START_REQ( terminate_process ) { req->handle = wine_server_obj_handle( handle ); @@ -1000,6 +1010,8 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) self = reply->self; } SERVER_END_REQ; + + TRACE("handle %p, self %d, process_exiting %d.\n", handle, self, process_exiting); if (self) { if (!handle) process_exiting = TRUE; diff --git a/dlls/ntdll/unix/registry.c b/dlls/ntdll/unix/registry.c index e19414bfa86..492dd00d67a 100644 --- a/dlls/ntdll/unix/registry.c +++ b/dlls/ntdll/unix/registry.c @@ -27,6 +27,10 @@ #include #include +#include +#include +#include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -68,6 +72,249 @@ NTSTATUS open_hkcu_key( const char *path, HANDLE *key ) return NtCreateKey( key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ); } +/* dump a Unicode string with proper escaping */ +int dump_strW( const WCHAR *str, data_size_t len, FILE *f, const char escape[2] ) +{ + static const char escapes[32] = ".......abtnvfr.............e...."; + char buffer[256]; + char *pos = buffer; + int count = 0; + + for (len /= sizeof(WCHAR); len; str++, len--) + { + if (pos > buffer + sizeof(buffer) - 8) + { + fwrite( buffer, pos - buffer, 1, f ); + count += pos - buffer; + pos = buffer; + } + if (*str > 127) /* hex escape */ + { + if (len > 1 && str[1] < 128 && isxdigit( (char)str[1] )) + pos += sprintf( pos, "\\x%04x", *str ); + else + pos += sprintf( pos, "\\x%x", *str ); + continue; + } + if (*str < 32) /* octal or C escape */ + { + if (!*str && len == 1) continue; /* do not output terminating NULL */ + if (escapes[*str] != '.') + pos += sprintf( pos, "\\%c", escapes[*str] ); + else if (len > 1 && str[1] >= '0' && str[1] <= '7') + pos += sprintf( pos, "\\%03o", *str ); + else + pos += sprintf( pos, "\\%o", *str ); + continue; + } + if (*str == '\\' || *str == escape[0] || *str == escape[1]) *pos++ = '\\'; + *pos++ = *str; + } + fwrite( buffer, pos - buffer, 1, f ); + count += pos - buffer; + return count; +} + +struct saved_key +{ + data_size_t namelen; + WCHAR *name; + data_size_t classlen; + WCHAR *class; + int value_count; + int subkey_count; + unsigned int is_symlink; + timeout_t modif; + struct saved_key *parent; +}; + +/* read serialized key data */ +static char *fill_saved_key( struct saved_key *key, struct saved_key *parent, char *data ) +{ + key->parent = parent; + key->namelen = *(data_size_t *)data; + data += sizeof(data_size_t); + key->name = (WCHAR *)data; + data += key->namelen; + key->classlen = *(data_size_t *)data; + data += sizeof(data_size_t); + key->class = (WCHAR *)data; + data += key->classlen; + key->value_count = *(int *)data; + data += sizeof(int); + key->subkey_count = *(int *)data; + data += sizeof(int); + key->is_symlink = *(unsigned int *)data; + data += sizeof(unsigned int); + key->modif = *(timeout_t *)data; + data += sizeof(timeout_t); + + return data; +} + +/* dump serialized key full path */ +static char *dump_parents( char *data, FILE *f, int count ) +{ + data_size_t len; + WCHAR *name; + + len = *(data_size_t *)data; + data += sizeof(data_size_t); + name = (WCHAR *)data; + data += len; + + if (count > 1) + { + data = dump_parents( data, f, count - 1); + fprintf( f, "\\\\" ); + } + dump_strW( name, len, f, "[]" ); + return data; +} + +/* dump the full path of a key */ +static void dump_path( const struct saved_key *key, const struct saved_key *base, FILE *f ) +{ + if (key->parent && key->parent != base) + { + dump_path( key->parent, base, f ); + fprintf( f, "\\\\" ); + } + dump_strW( key->name, key->namelen, f, "[]" ); +} + +/* dump a value to a text file */ +static char *dump_value( char *data, FILE *f ) +{ + unsigned int i, dw; + int count; + data_size_t namelen, valuelen; + char *valuedata; + WCHAR *name; + unsigned int type; + + namelen = *(data_size_t *)data; + data += sizeof(data_size_t); + name = (WCHAR *)data; + data += namelen; + type = *(unsigned int *)data; + data += sizeof(unsigned int); + valuelen = *(data_size_t *)data; + data += sizeof(data_size_t); + valuedata = data; + data += valuelen; + + if (namelen) + { + fputc( '\"', f ); + count = 1 + dump_strW( name, namelen, f, "\"\"" ); + count += fprintf( f, "\"=" ); + } + else count = fprintf( f, "@=" ); + + switch(type) + { + case REG_SZ: + case REG_EXPAND_SZ: + case REG_MULTI_SZ: + /* only output properly terminated strings in string format */ + if (valuelen < sizeof(WCHAR)) break; + if (valuelen % sizeof(WCHAR)) break; + if (((WCHAR *)valuedata)[valuelen / sizeof(WCHAR) - 1]) break; + if (type != REG_SZ) fprintf( f, "str(%x):", type ); + fputc( '\"', f ); + dump_strW( (WCHAR *)valuedata, valuelen, f, "\"\"" ); + fprintf( f, "\"\n" ); + return data; + + case REG_DWORD: + if (valuelen != sizeof(dw)) break; + memcpy( &dw, valuedata, sizeof(dw) ); + fprintf( f, "dword:%08x\n", dw ); + return data; + } + + if (type == REG_BINARY) count += fprintf( f, "hex:" ); + else count += fprintf( f, "hex(%x):", type ); + for (i = 0; i < valuelen; i++) + { + count += fprintf( f, "%02x", *((unsigned char *)valuedata + i) ); + if (i < valuelen-1) + { + fputc( ',', f ); + if (++count > 76) + { + fprintf( f, "\\\n " ); + count = 2; + } + } + } + fputc( '\n', f ); + return data; +} + +/* save a registry key and all its subkeys to a text file */ +static char *save_subkeys( char *data, struct saved_key *parent, struct saved_key *base, FILE *f ) +{ + struct saved_key key; + int i; + + if (!base) base = &key; + data = fill_saved_key( &key, parent, data ); + + /* save key if it has either some values or no subkeys, or needs special options */ + /* keys with no values but subkeys are saved implicitly by saving the subkeys */ + if ((key.value_count > 0) || !key.subkey_count || key.classlen || key.is_symlink) + { + fprintf( f, "\n[" ); + if (parent) dump_path( &key, base, f ); + fprintf( f, "] %u\n", (unsigned int)((key.modif - SECS_1601_TO_1970 * TICKSPERSEC) / TICKSPERSEC) ); + fprintf( f, "#time=%x%08x\n", (unsigned int)(key.modif >> 32), (unsigned int)key.modif ); + if (key.classlen) + { + fprintf( f, "#class=\"" ); + dump_strW( key.class, key.classlen, f, "\"\"" ); + fprintf( f, "\"\n" ); + } + if (key.is_symlink) fputs( "#link\n", f ); + for (i = 0; i < key.value_count; i++) data = dump_value( data, f ); + } + for (i = 0; i < key.subkey_count; i++) data = save_subkeys( data, &key, base, f ); + return data; +} + +/* save a registry branch to a file */ +static char *save_all_subkeys( char *data, FILE *f ) +{ + /* Output registry format should match server/registry.c:save_all_subkeys(). */ + enum prefix_type prefix_type; + int parent_count; + + prefix_type = *(int *)data; + data += sizeof(int); + + parent_count = *(int *)data; + data += sizeof(int); + + fprintf( f, "WINE REGISTRY Version 2\n" ); + fprintf( f, ";; All keys relative to " ); + data = dump_parents( data, f, parent_count ); + fprintf( f, "\n" ); + + switch (prefix_type) + { + case PREFIX_32BIT: + fprintf( f, "\n#arch=win32\n" ); + break; + case PREFIX_64BIT: + fprintf( f, "\n#arch=win64\n" ); + break; + default: + break; + } + return save_subkeys( data, NULL, NULL, f ); +} + /****************************************************************************** * NtCreateKey (NTDLL.@) @@ -672,22 +919,162 @@ NTSTATUS WINAPI NtNotifyChangeKey( HANDLE key, HANDLE event, PIO_APC_ROUTINE apc io, filter, subtree, buffer, length, async ); } +/* acquire mutex for registry flush operation */ +static HANDLE get_key_flush_mutex(void) +{ + WCHAR bufferW[256]; + UNICODE_STRING name = {.Buffer = bufferW}; + OBJECT_ATTRIBUTES attr; + char buffer[256]; + HANDLE mutex; + + snprintf( buffer, ARRAY_SIZE(buffer), "\\Sessions\\%u\\BaseNamedObjects\\__wine_regkey_flush", + (int)NtCurrentTeb()->Peb->SessionId ); + name.Length = name.MaximumLength = (strlen(buffer) + 1) * sizeof(WCHAR); + ascii_to_unicode( bufferW, buffer, name.Length / sizeof(WCHAR) ); + + InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); + if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return NULL; + NtWaitForSingleObject( mutex, FALSE, NULL ); + return mutex; +} + +/* release registry flush mutex */ +static void release_key_flush_mutex( HANDLE mutex ) +{ + NtReleaseMutant( mutex, NULL ); + NtClose( mutex ); +} + +/* save registry branch to Wine regsitry storage file */ +static NTSTATUS save_registry_branch( char **data ) +{ + static const char temp_fn[] = "savereg.tmp"; + char *file_name, *path = NULL, *tmp = NULL; + int file_name_len, path_len, fd; + struct stat st; + NTSTATUS ret; + FILE *f; + + file_name_len = *(int *)*data; + *data += sizeof(int); + file_name = *data; + *data += file_name_len; + + path_len = strlen( config_dir ) + 1 + file_name_len + 1; + if (!(path = malloc( path_len ))) return STATUS_NO_MEMORY; + sprintf( path, "%s/%s", config_dir, file_name ); + + if ((fd = open( path, O_WRONLY )) != -1) + { + /* if file is not a regular file or has multiple links or is accessed + * via symbolic links, write directly into it; otherwise use a temp file */ + if (!lstat( path, &st ) && (!S_ISREG(st.st_mode) || st.st_nlink > 1)) + { + ftruncate( fd, 0 ); + goto save; + } + close( fd ); + } + + /* create a temp file in the same directory */ + if (!(tmp = malloc( strlen( config_dir ) + 1 + strlen( temp_fn ) + 1 ))) + { + ret = STATUS_NO_MEMORY; + goto done; + } + sprintf( tmp, "%s/%s", config_dir, temp_fn ); + + if ((fd = open( tmp, O_CREAT | O_EXCL | O_WRONLY, 0666 )) == -1) + { + ret = errno_to_status( errno ); + goto done; + } + +save: + if (!(f = fdopen( fd, "w" ))) + { + ret = errno_to_status( errno ); + if (tmp) unlink( tmp ); + close( fd ); + goto done; + } + + *data = save_all_subkeys( *data, f ); + + ret = fclose( f ) ? errno_to_status( errno ) : STATUS_SUCCESS; + if (tmp) + { + if (!ret && rename( tmp, path )) ret = errno_to_status( errno ); + if (ret) unlink( tmp ); + } + +done: + free( tmp ); + free( path ); + return ret; +} /****************************************************************************** * NtFlushKey (NTDLL.@) */ NTSTATUS WINAPI NtFlushKey( HANDLE key ) { + abstime_t timestamp_counter; + data_size_t size = 0; unsigned int ret; + char *data = NULL, *curr_data; + HANDLE mutex; + int i, branch_count, branch; TRACE( "key=%p\n", key ); - SERVER_START_REQ( flush_key ) + mutex = get_key_flush_mutex(); + + while (1) { - req->hkey = wine_server_obj_handle( key ); - ret = wine_server_call( req ); + SERVER_START_REQ( flush_key ) + { + req->hkey = wine_server_obj_handle( key ); + if (size) wine_server_set_reply( req, data, size ); + ret = wine_server_call( req ); + size = reply->total; + branch_count = reply->branch_count; + timestamp_counter = reply->timestamp_counter; + } + SERVER_END_REQ; + + if (ret != STATUS_BUFFER_TOO_SMALL) break; + free( data ); + if (!(data = malloc( size ))) + { + ERR( "No memory.\n" ); + ret = STATUS_NO_MEMORY; + goto done; + } } - SERVER_END_REQ; + if (ret) goto done; + + curr_data = data; + for (i = 0; i < branch_count; ++i) + { + branch = *(int *)curr_data; + curr_data += sizeof(int); + if ((ret = save_registry_branch( &curr_data ))) goto done; + + SERVER_START_REQ( flush_key_done ) + { + req->branch = branch; + req->timestamp_counter = timestamp_counter; + ret = wine_server_call( req ); + } + SERVER_END_REQ; + if (ret) break; + } + +done: + release_key_flush_mutex( mutex ); + free( data ); return ret; } @@ -791,17 +1178,53 @@ NTSTATUS WINAPI NtUnloadKey( OBJECT_ATTRIBUTES *attr ) */ NTSTATUS WINAPI NtSaveKey( HANDLE key, HANDLE file ) { + data_size_t size = 0; unsigned int ret; + char *data = NULL; + int fd, fd2, needs_close = 0; + FILE *f; TRACE( "(%p,%p)\n", key, file ); - SERVER_START_REQ( save_registry ) + while (1) { - req->hkey = wine_server_obj_handle( key ); - req->file = wine_server_obj_handle( file ); - ret = wine_server_call( req ); + SERVER_START_REQ( save_registry ) + { + req->hkey = wine_server_obj_handle( key ); + if (size) wine_server_set_reply( req, data, size ); + ret = wine_server_call( req ); + size = reply->total; + } + SERVER_END_REQ; + + if (!ret) break; + free( data ); + if (ret != STATUS_BUFFER_TOO_SMALL) return ret; + if (!(data = malloc( size ))) + { + ERR( "No memory.\n" ); + return STATUS_NO_MEMORY; + } } - SERVER_END_REQ; + + if ((ret = server_get_unix_fd( file, FILE_WRITE_DATA, &fd, &needs_close, NULL, NULL ))) goto done; + if ((fd2 = dup( fd )) == -1) + { + ret = errno_to_status( errno ); + goto done; + } + if (!(f = fdopen( fd2, "w" ))) + { + close( fd2 ); + ret = errno_to_status( errno ); + goto done; + } + save_all_subkeys( data, f ); + if (fclose(f)) ret = errno_to_status( errno ); + +done: + if (needs_close) close( fd ); + free( data ); return ret; } diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c index 3f66d959373..4933bf389b5 100644 --- a/dlls/ntdll/unix/security.c +++ b/dlls/ntdll/unix/security.c @@ -323,6 +323,28 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c switch (class) { case TokenUser: + if (localsystem_sid) + { + static const struct sid local_system_sid = { SID_REVISION, 1, SECURITY_NT_AUTHORITY, { SECURITY_LOCAL_SYSTEM_RID } }; + DWORD sid_len = offsetof( struct sid, sub_auth[local_system_sid.sub_count] ); + TOKEN_USER *tuser; + PSID sid; + + if (retlen) *retlen = sid_len + sizeof(TOKEN_USER); + if (sid_len + sizeof(TOKEN_USER) > length) + { + status = STATUS_BUFFER_TOO_SMALL; + } + else + { + tuser = info; + sid = tuser + 1; + tuser->User.Sid = sid; + tuser->User.Attributes = 0; + memcpy( sid, &local_system_sid, sid_len ); + } + break; + } SERVER_START_REQ( get_token_sid ) { TOKEN_USER *tuser = info; @@ -519,6 +541,8 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c if (!status) *type = reply->elevation; } SERVER_END_REQ; + if (!status && no_priv_elevation) + *(TOKEN_ELEVATION_TYPE *)info = TokenElevationTypeLimited; break; case TokenElevation: @@ -529,6 +553,7 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c req->handle = wine_server_obj_handle( token ); status = wine_server_call( req ); if (!status) elevation->TokenIsElevated = (reply->elevation == TokenElevationTypeFull); + if (!status && no_priv_elevation) elevation->TokenIsElevated = 0; } SERVER_END_REQ; break; diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 53fcc61ccf3..992e5cfdc3d 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -79,9 +79,13 @@ #include "wine/server.h" #include "wine/debug.h" #include "unix_private.h" +#include "esync.h" +#include "fsync.h" #include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(server); +WINE_DECLARE_DEBUG_CHANNEL(client); +WINE_DECLARE_DEBUG_CHANNEL(ftrace); #ifndef MSG_CMSG_CLOEXEC #define MSG_CMSG_CLOEXEC 0 @@ -103,7 +107,7 @@ sigset_t server_block_set; /* signals to block during server calls */ static int fd_socket = -1; /* socket to exchange file descriptors with the server */ static int initial_cwd = -1; static pid_t server_pid; -static pthread_mutex_t fd_cache_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t fd_cache_mutex = PTHREAD_MUTEX_INITIALIZER; /* atomically exchange a 64-bit value */ static inline LONG64 interlocked_xchg64( LONG64 *dest, LONG64 val ) @@ -261,8 +265,13 @@ unsigned int server_call_unlocked( void *req_ptr ) struct __server_request_info * const req = req_ptr; unsigned int ret; - if ((ret = send_request( req ))) return ret; - return wait_reply( req ); + FTRACE_BLOCK_START("req %s", req->name) + TRACE_(client)("%s start\n", req->name); \ + if (!(ret = send_request( req ))) + ret = wait_reply( req ); + TRACE_(client)("%s end\n", req->name); + FTRACE_BLOCK_END() + return ret; } @@ -745,13 +754,19 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT pthread_sigmask( SIG_SETMASK, &old_set, NULL ); if (signaled) break; + FTRACE_BLOCK_START("select_reply") ret = wait_select_reply( &cookie ); + FTRACE_BLOCK_END() } while (ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC); if (ret == STATUS_USER_APC) *user_apc = reply_data.call.user; if (reply_size > sizeof(reply_data.call)) + { memcpy( context, reply_data.context, reply_size - sizeof(reply_data.call) ); + context[0].flags &= ~SERVER_CTX_EXEC_SPACE; + context[1].flags &= ~SERVER_CTX_EXEC_SPACE; + } return ret; } @@ -918,7 +933,7 @@ void wine_server_send_fd( int fd ) * * Receive a file descriptor passed from the server. */ -static int receive_fd( obj_handle_t *handle ) +int receive_fd( obj_handle_t *handle ) { struct iovec vec; struct msghdr msghdr; @@ -1604,7 +1619,7 @@ size_t server_init_process(void) (version > SERVER_PROTOCOL_VERSION) ? "wine" : "wineserver" ); #if defined(__linux__) && defined(HAVE_PRCTL) /* work around Ubuntu's ptrace breakage */ - if (server_pid != -1) prctl( 0x59616d61 /* PR_SET_PTRACER */, server_pid ); + if (server_pid != -1) prctl( 0x59616d61 /* PR_SET_PTRACER */, PR_SET_PTRACER_ANY ); #endif /* ignore SIGPIPE so that we get an EPIPE error instead */ @@ -1673,6 +1688,7 @@ size_t server_init_process(void) */ void server_init_process_done(void) { + struct cpu_topology_override *cpu_override = get_cpu_topology_override(); void *entry, *teb; unsigned int status; int suspend; @@ -1697,6 +1713,8 @@ void server_init_process_done(void) /* Signal the parent process to continue */ SERVER_START_REQ( init_process_done ) { + if (cpu_override) + wine_server_add_data( req, cpu_override, sizeof(*cpu_override) ); req->teb = wine_server_client_ptr( teb ); req->peb = NtCurrentTeb64() ? NtCurrentTeb64()->Peb : wine_server_client_ptr( peb ); #ifdef __i386__ @@ -1841,6 +1859,12 @@ NTSTATUS WINAPI NtClose( HANDLE handle ) * retrieve it again */ fd = remove_fd_from_cache( handle ); + if (do_fsync()) + fsync_close( handle ); + + if (do_esync()) + esync_close( handle ); + SERVER_START_REQ( close_handle ) { req->handle = wine_server_obj_handle( handle ); diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 5115fa7ec3a..dbad562c6d3 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -1033,6 +1033,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) memcpy( context->D, frame->d, sizeof(frame->d) ); context->ContextFlags |= CONTEXT_FLOATING_POINT; } + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); return STATUS_SUCCESS; } @@ -1070,7 +1071,7 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) rec->ExceptionAddress = (void *)PC_sig(sigcontext); save_context( &context, sigcontext ); - status = send_debug_event( rec, &context, TRUE ); + status = send_debug_event( rec, &context, TRUE, TRUE ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) { restore_context( &context, sigcontext ); @@ -1304,6 +1305,10 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD)IP_sig(context), (DWORD)SP_sig(context), (DWORD)LR_sig(context), (DWORD)PC_sig(context), (DWORD)CPSR_sig(context) ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); @@ -1520,7 +1525,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) if (is_inside_syscall( sigcontext )) { - context.ContextFlags = CONTEXT_FULL; + context.ContextFlags = CONTEXT_FULL | CONTEXT_EXCEPTION_REQUEST; NtGetContextThread( GetCurrentThread(), &context ); wait_suspend( &context ); NtSetContextThread( GetCurrentThread(), &context ); @@ -1528,6 +1533,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) else { save_context( &context, sigcontext ); + context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING; wait_suspend( &context ); restore_context( &context, sigcontext ); } @@ -1634,7 +1640,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB if (context.Pc & 1) context.Cpsr |= 0x20; /* thumb mode */ if ((ctx = get_cpu_area( IMAGE_FILE_MACHINE_ARMNT ))) *ctx = context; - if (suspend) wait_suspend( &context ); + if (suspend) + { + context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + wait_suspend( &context ); + } ctx = (CONTEXT *)((ULONG_PTR)context.Sp & ~15) - 1; *ctx = context; diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index f96ec330796..a4bae5563a8 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -710,6 +710,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->ContextFlags |= CONTEXT_FLOATING_POINT; } if (needed_flags & CONTEXT_DEBUG_REGISTERS) FIXME( "debug registers not supported\n" ); + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); return STATUS_SUCCESS; } @@ -917,6 +918,7 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) context->Dr7 = wow_frame->Dr7; } /* FIXME: CONTEXT_I386_XSTATE */ + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); break; } @@ -956,6 +958,7 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) memcpy( context->D, wow_frame->D, sizeof(wow_frame->D) ); context->ContextFlags |= CONTEXT_FLOATING_POINT; } + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); break; } @@ -979,7 +982,7 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) rec->ExceptionAddress = (void *)PC_sig(sigcontext); save_context( &context, sigcontext ); - status = send_debug_event( rec, &context, TRUE ); + status = send_debug_event( rec, &context, TRUE, TRUE ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) { restore_context( &context, sigcontext ); @@ -1271,6 +1274,10 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD64)REGn_sig(28, context), (DWORD64)FP_sig(context), (DWORD64)LR_sig(context), (DWORD64)SP_sig(context) ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); @@ -1487,7 +1494,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) if (is_inside_syscall( sigcontext )) { - context.ContextFlags = CONTEXT_FULL; + context.ContextFlags = CONTEXT_FULL | CONTEXT_EXCEPTION_REQUEST; NtGetContextThread( GetCurrentThread(), &context ); wait_suspend( &context ); NtSetContextThread( GetCurrentThread(), &context ); @@ -1495,6 +1502,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) else { save_context( &context, sigcontext ); + context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING; wait_suspend( &context ); restore_context( &context, sigcontext ); } @@ -1680,7 +1688,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB if (arm_context->Pc & 1) arm_context->Cpsr |= 0x20; /* thumb mode */ } - if (suspend) wait_suspend( &context ); + if (suspend) + { + context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + wait_suspend( &context ); + } ctx = (CONTEXT *)((ULONG_PTR)context.Sp & ~15) - 1; *ctx = context; diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 751b0081534..faf09c05371 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -151,7 +151,7 @@ typedef struct ucontext #define FPU_sig(context) ((FLOATING_SAVE_AREA*)((context)->uc_mcontext.fpregs)) #define FPUX_sig(context) (FPU_sig(context) && !((context)->uc_mcontext.fpregs->status >> 16) ? (XSAVE_FORMAT *)(FPU_sig(context) + 1) : NULL) -#define XState_sig(fpu) (((unsigned int *)fpu->Reserved4)[12] == FP_XSTATE_MAGIC1 ? (XSTATE *)(fpu + 1) : NULL) +#define XState_sig(fpu) (((unsigned int *)fpu->Reserved4)[12] == FP_XSTATE_MAGIC1 ? (XSAVE_AREA_HEADER *)(fpu + 1) : NULL) #ifdef __ANDROID__ /* custom signal restorer since we may have unmapped the one in vdso, and bionic doesn't check for that */ @@ -443,12 +443,10 @@ struct exc_stack_layout EXCEPTION_RECORD rec; /* 008 */ CONTEXT context; /* 058 */ CONTEXT_EX context_ex; /* 324 */ - BYTE xstate[sizeof(XSTATE)+64]; /* 33c extra space to allow for 64-byte alignment */ - DWORD align; /* 4bc */ + DWORD align; /* 33c */ }; C_ASSERT( offsetof(struct exc_stack_layout, context) == 0x58 ); -C_ASSERT( offsetof(struct exc_stack_layout, xstate) == 0x33c ); -C_ASSERT( sizeof(struct exc_stack_layout) == 0x4c0 ); +C_ASSERT( sizeof(struct exc_stack_layout) == 0x340 ); /* stack layout when calling KiUserApcDispatcher */ struct apc_stack_layout @@ -508,10 +506,10 @@ struct syscall_frame /* Leave space for the whole set of YMM registers. They're not used in * 32-bit mode, but some processors fault if they're not in writable memory. */ - DECLSPEC_ALIGN(64) XSTATE xstate; /* 240 */ + DECLSPEC_ALIGN(64) XSAVE_AREA_HEADER xstate; /* 240 */ }; -C_ASSERT( sizeof(struct syscall_frame) == 0x380 ); +C_ASSERT( sizeof(struct syscall_frame) == 0x280 ); struct x86_thread_data { @@ -525,12 +523,15 @@ struct x86_thread_data UINT dr7; /* 1f0 */ SYSTEM_SERVICE_TABLE *syscall_table; /* 1f4 syscall table */ struct syscall_frame *syscall_frame; /* 1f8 frame pointer on syscall entry */ + UINT64 xstate_features_mask; /* 1fc */ + UINT xstate_features_size; /* 204 */ }; C_ASSERT( sizeof(struct x86_thread_data) <= sizeof(((struct ntdll_thread_data *)0)->cpu_data) ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, gs ) == 0x1d8 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_table ) == 0x1f4 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_frame ) == 0x1f8 ); +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, xstate_features_size ) == 0x204 ); /* flags to control the behavior of the syscall dispatcher */ #define SYSCALL_HAVE_XSAVE 1 @@ -606,17 +607,14 @@ struct xcontext { CONTEXT c; CONTEXT_EX c_ex; - ULONG64 host_compaction_mask; }; -extern BOOL xstate_compaction_enabled; - -static inline XSTATE *xstate_from_context( const CONTEXT *context ) +static inline XSAVE_AREA_HEADER *xstate_from_context( const CONTEXT *context ) { CONTEXT_EX *xctx = (CONTEXT_EX *)(context + 1); if ((context->ContextFlags & CONTEXT_XSTATE) != CONTEXT_XSTATE) return NULL; - return (XSTATE *)((char *)xctx + xctx->XState.Offset); + return (XSAVE_AREA_HEADER *)((char *)xctx + xctx->XState.Offset); } static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer ) @@ -629,7 +627,7 @@ static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer ) if (xstate_buffer) { - xctx->XState.Length = sizeof(XSTATE); + xctx->XState.Length = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; xctx->XState.Offset = (BYTE *)xstate_buffer - (BYTE *)xctx; context->ContextFlags |= CONTEXT_XSTATE; @@ -827,16 +825,12 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si } if (fpux) { - XSTATE *xs; + XSAVE_AREA_HEADER *xs; context->ContextFlags |= CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS; memcpy( context->ExtendedRegisters, fpux, sizeof(*fpux) ); if (!fpu) fpux_to_fpu( &context->FloatSave, fpux ); - if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(fpux))) - { - context_init_xstate( context, xs ); - xcontext->host_compaction_mask = xs->CompactionMask; - } + if (xstate_extended_features() && (xs = XState_sig(fpux))) context_init_xstate( context, xs ); } if (!fpu && !fpux) save_fpu( context ); } @@ -877,19 +871,7 @@ static inline void restore_context( const struct xcontext *xcontext, ucontext_t SS_sig(sigcontext) = context->SegSs; if (fpu) *fpu = context->FloatSave; - if (fpux) - { - XSTATE *src_xs, *dst_xs; - - memcpy( fpux, context->ExtendedRegisters, sizeof(*fpux) ); - - if ((dst_xs = XState_sig(fpux)) && (src_xs = xstate_from_context( context ))) - { - memcpy( &dst_xs->YmmContext, &src_xs->YmmContext, sizeof(dst_xs->YmmContext) ); - dst_xs->Mask |= src_xs->Mask; - dst_xs->CompactionMask = xcontext->host_compaction_mask; - } - } + if (fpux) memcpy( fpux, context->ExtendedRegisters, sizeof(*fpux) ); if (!fpu && !fpux) restore_fpu( context ); } @@ -936,15 +918,16 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) DWORD flags = context->ContextFlags & ~CONTEXT_i386; BOOL self = (handle == GetCurrentThread()); - if ((flags & CONTEXT_XSTATE) && (cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX)) + if ((flags & CONTEXT_XSTATE) && xstate_extended_features()) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xs = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); + XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); - if (context_ex->XState.Length < offsetof(XSTATE, YmmContext) || - context_ex->XState.Length > sizeof(XSTATE)) + if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || + context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) return STATUS_INVALID_PARAMETER; - if ((xs->Mask & XSTATE_MASK_GSSE) && (context_ex->XState.Length < sizeof(XSTATE))) + if ((xs->Mask & xstate_extended_features()) + && (context_ex->XState.Length < xstate_get_size( xs->CompactionMask, xs->Mask ))) return STATUS_BUFFER_OVERFLOW; } else flags &= ~CONTEXT_XSTATE; @@ -1020,14 +1003,12 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) if (flags & CONTEXT_XSTATE) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xs = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); + XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); + UINT64 mask = frame->xstate.Mask; - if (xs->Mask & XSTATE_MASK_GSSE) - { - frame->xstate.Mask |= XSTATE_MASK_GSSE; - frame->xstate.YmmContext = xs->YmmContext; - } - else frame->xstate.Mask &= ~XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + copy_xstate( &frame->xstate, xs, xs->Mask ); + if (xs->CompactionMask) frame->xstate.Mask |= mask & ~xs->CompactionMask; } frame->restore_flags |= flags & ~CONTEXT_INTEGER; @@ -1047,10 +1028,17 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) struct syscall_frame *frame = x86_thread_data()->syscall_frame; DWORD needed_flags = context->ContextFlags & ~CONTEXT_i386; BOOL self = (handle == GetCurrentThread()); + BOOL use_cached_debug_regs = FALSE; NTSTATUS ret; - /* debug registers require a server call */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) self = FALSE; + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; + + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) + { + /* debug registers require a server call if hw breakpoints are enabled */ + if (x86_thread_data()->dr7 & 0xff) self = FALSE; + else use_cached_debug_regs = TRUE; + } if (!self) { @@ -1138,36 +1126,49 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->ContextFlags |= CONTEXT_EXTENDED_REGISTERS; } - if ((needed_flags & CONTEXT_XSTATE) && (cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX)) + if ((needed_flags & CONTEXT_XSTATE) && xstate_extended_features()) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xstate = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); - unsigned int mask; - - if (context_ex->XState.Length < offsetof(XSTATE, YmmContext) - || context_ex->XState.Length > sizeof(XSTATE)) - return STATUS_INVALID_PARAMETER; + XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); + UINT64 mask; - mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); xstate->Mask = frame->xstate.Mask & mask; xstate->CompactionMask = xstate_compaction_enabled ? (0x8000000000000000 | mask) : 0; - memset( xstate->Reserved, 0, sizeof(xstate->Reserved) ); + memset( xstate->Reserved2, 0, sizeof(xstate->Reserved2) ); if (xstate->Mask) { - if (context_ex->XState.Length < sizeof(XSTATE)) return STATUS_BUFFER_OVERFLOW; - xstate->YmmContext = frame->xstate.YmmContext; + if (context_ex->XState.Length < xstate_get_size( xstate->CompactionMask, xstate->Mask )) + return STATUS_BUFFER_OVERFLOW; + copy_xstate( xstate, &frame->xstate, xstate->Mask ); + /* copy_xstate may use avx in memcpy, restore xstate not to break the tests. */ + frame->restore_flags |= CONTEXT_XSTATE; } } - /* update the cached version of the debug registers */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) + if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386)) { - x86_thread_data()->dr0 = context->Dr0; - x86_thread_data()->dr1 = context->Dr1; - x86_thread_data()->dr2 = context->Dr2; - x86_thread_data()->dr3 = context->Dr3; - x86_thread_data()->dr6 = context->Dr6; - x86_thread_data()->dr7 = context->Dr7; + if (use_cached_debug_regs) + { + context->Dr0 = x86_thread_data()->dr0; + context->Dr1 = x86_thread_data()->dr1; + context->Dr2 = x86_thread_data()->dr2; + context->Dr3 = x86_thread_data()->dr3; + context->Dr6 = x86_thread_data()->dr6; + context->Dr7 = x86_thread_data()->dr7; + } + else + { + /* update the cached version of the debug registers */ + x86_thread_data()->dr0 = context->Dr0; + x86_thread_data()->dr1 = context->Dr1; + x86_thread_data()->dr2 = context->Dr2; + x86_thread_data()->dr3 = context->Dr3; + x86_thread_data()->dr6 = context->Dr6; + x86_thread_data()->dr7 = context->Dr7; + } } + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); } if (context->ContextFlags & (CONTEXT_INTEGER & ~CONTEXT_i386)) @@ -1460,9 +1461,11 @@ static void setup_raise_exception( ucontext_t *sigcontext, void *stack_ptr, EXCEPTION_RECORD *rec, struct xcontext *xcontext ) { CONTEXT *context = &xcontext->c; - XSTATE *src_xs; + XSAVE_AREA_HEADER *src_xs; struct exc_stack_layout *stack; - NTSTATUS status = send_debug_event( rec, context, TRUE ); + size_t stack_size; + unsigned int xstate_size; + NTSTATUS status = send_debug_event( rec, context, TRUE, TRUE ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) { @@ -1473,7 +1476,9 @@ static void setup_raise_exception( ucontext_t *sigcontext, void *stack_ptr, /* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */ if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Eip--; - stack = virtual_setup_exception( stack_ptr, sizeof(*stack), rec ); + xstate_size = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; + stack_size = (ULONG_PTR)stack_ptr - (((ULONG_PTR)stack_ptr - sizeof(*stack) - xstate_size) & ~(ULONG_PTR)63); + stack = virtual_setup_exception( stack_ptr, stack_size, rec ); stack->rec_ptr = &stack->rec; stack->context_ptr = &stack->context; stack->rec = *rec; @@ -1481,16 +1486,13 @@ static void setup_raise_exception( ucontext_t *sigcontext, void *stack_ptr, if ((src_xs = xstate_from_context( context ))) { - XSTATE *dst_xs = (XSTATE *)(((ULONG_PTR)stack->xstate + 63) & ~63); + XSAVE_AREA_HEADER *dst_xs = (XSAVE_AREA_HEADER *)(stack + 1); + assert( !((ULONG_PTR)dst_xs & 63) ); context_init_xstate( &stack->context, dst_xs ); - memset( dst_xs, 0, offsetof(XSTATE, YmmContext) ); - dst_xs->CompactionMask = xstate_compaction_enabled ? 0x8000000000000004 : 0; - if (src_xs->Mask & 4) - { - dst_xs->Mask = 4; - memcpy( &dst_xs->YmmContext, &src_xs->YmmContext, sizeof(dst_xs->YmmContext) ); - } + memset( dst_xs, 0, sizeof(*dst_xs) ); + dst_xs->CompactionMask = xstate_compaction_enabled ? 0x8000000000000000 | xstate_extended_features() : 0; + copy_xstate( dst_xs, src_xs, src_xs->Mask ); } else { @@ -1571,11 +1573,14 @@ NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context { struct syscall_frame *frame = x86_thread_data()->syscall_frame; ULONG esp = (frame->esp - sizeof(struct exc_stack_layout)) & ~3; - struct exc_stack_layout *stack = (struct exc_stack_layout *)esp; - XSTATE *src_xs; + struct exc_stack_layout *stack; + XSAVE_AREA_HEADER *src_xs; + unsigned int xstate_size; if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Eip--; + xstate_size = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; + stack = (struct exc_stack_layout *)((esp - sizeof(*stack) - xstate_size) & ~(ULONG_PTR)63); stack->rec_ptr = &stack->rec; stack->context_ptr = &stack->context; stack->rec = *rec; @@ -1583,16 +1588,13 @@ NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context if ((src_xs = xstate_from_context( context ))) { - XSTATE *dst_xs = (XSTATE *)(((ULONG_PTR)stack->xstate + 63) & ~63); + XSAVE_AREA_HEADER *dst_xs = (XSAVE_AREA_HEADER *)(stack + 1); context_init_xstate( &stack->context, dst_xs ); - memset( dst_xs, 0, offsetof(XSTATE, YmmContext) ); - dst_xs->CompactionMask = xstate_compaction_enabled ? 0x8000000000000004 : 0; - if (src_xs->Mask & 4) - { - dst_xs->Mask = 4; - memcpy( &dst_xs->YmmContext, &src_xs->YmmContext, sizeof(dst_xs->YmmContext) ); - } + assert( !((ULONG_PTR)dst_xs & 63) ); + memset( dst_xs, 0, sizeof(*dst_xs) ); + dst_xs->CompactionMask = xstate_compaction_enabled ? 0x8000000000000000 | xstate_extended_features() : 0; + copy_xstate( dst_xs, src_xs, src_xs->Mask ); } else { @@ -1624,7 +1626,8 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback, __ASM_CFI(".cfi_rel_offset %edi,-12\n\t") "movl 0x18(%ebp),%edx\n\t" /* teb */ "pushl 0(%edx)\n\t" /* teb->Tib.ExceptionList */ - "subl $0x380,%esp\n\t" /* sizeof(struct syscall_frame) */ + "subl $0x280,%esp\n\t" /* sizeof(struct syscall_frame) */ + "subl 0x204(%edx),%esp\n\t" /* x86_thread_data()->xstate_features_size */ "andl $~63,%esp\n\t" "leal 8(%ebp),%eax\n\t" "movl %eax,0x38(%esp)\n\t" /* frame->syscall_cfa */ @@ -1831,6 +1834,10 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, context->Ebp, context->Esp, context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs, context->EFlags ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); @@ -1845,6 +1852,9 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, } else { + WINE_BACKTRACE_LOG( "--- Exception %#lx at %s.\n", rec->ExceptionCode, + wine_debuginfostr_pc( rec->ExceptionAddress )); + TRACE( "returning to user mode ip=%08x ret=%08lx\n", frame->eip, rec->ExceptionCode ); stack = (UINT *)frame; *(--stack) = rec->ExceptionCode; @@ -1906,6 +1916,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) struct xcontext xcontext; ucontext_t *ucontext = sigcontext; void *stack = setup_exception_record( sigcontext, &rec, &xcontext ); + void *steamclient_addr = NULL; switch (TRAP_sig(ucontext)) { @@ -1940,6 +1951,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) } break; case TRAP_x86_PAGEFLT: /* Page fault */ + if ((steamclient_addr = steamclient_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09 ))) + { + EIP_sig(ucontext) = (intptr_t)steamclient_addr; + return; + } + rec.NumberParameters = 2; rec.ExceptionInformation[0] = (ERROR_sig(ucontext) >> 1) & 0x09; rec.ExceptionInformation[1] = (ULONG_PTR)siginfo->si_addr; @@ -2126,24 +2143,48 @@ static void quit_handler( int signal, siginfo_t *siginfo, void *sigcontext ) */ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) { - struct xcontext xcontext; + ucontext_t *ucontext = sigcontext; init_handler( sigcontext ); - if (is_inside_syscall( sigcontext )) + + if (is_inside_syscall( ucontext )) { - DECLSPEC_ALIGN(64) XSTATE xs; - xcontext.c.ContextFlags = CONTEXT_FULL; - context_init_xstate( &xcontext.c, &xs ); + struct syscall_frame *frame = x86_thread_data()->syscall_frame; + ULONG64 saved_compaction = 0; + struct xcontext *context; - NtGetContextThread( GetCurrentThread(), &xcontext.c ); - wait_suspend( &xcontext.c ); - NtSetContextThread( GetCurrentThread(), &xcontext.c ); + context = (struct xcontext *)(((ULONG_PTR)ESP_sig(ucontext) - sizeof(*context)) & ~15); + if ((char *)context < (char *)ntdll_get_thread_data()->kernel_stack) + { + ERR_(seh)( "kernel stack overflow.\n" ); + return; + } + context->c.ContextFlags = CONTEXT_FULL | CONTEXT_EXCEPTION_REQUEST; + NtGetContextThread( GetCurrentThread(), &context->c ); + if (xstate_extended_features()) + { + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + context_init_xstate( &context->c, &frame->xstate ); + saved_compaction = frame->xstate.CompactionMask; + } + wait_suspend( &context->c ); + if (xstate_extended_features()) frame->xstate.CompactionMask = saved_compaction; + if (context->c.ContextFlags & 0x40) + { + /* xstate is updated directly in frame's xstate */ + context->c.ContextFlags &= ~0x40; + frame->restore_flags |= 0x40; + } + NtSetContextThread( GetCurrentThread(), &context->c ); } else { - save_context( &xcontext, sigcontext ); - wait_suspend( &xcontext.c ); - restore_context( &xcontext, sigcontext ); + struct xcontext context; + + save_context( &context, ucontext ); + context.c.ContextFlags |= CONTEXT_EXCEPTION_REPORTING; + wait_suspend( &context.c ); + restore_context( &context, ucontext ); } } @@ -2364,6 +2405,12 @@ void signal_init_threading(void) #endif } +void set_thread_teb( TEB *teb ) +{ + struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch; + + ldt_set_fs( thread_data->fs, teb ); +} /********************************************************************** * signal_alloc_thread @@ -2404,6 +2451,7 @@ NTSTATUS signal_alloc_thread( TEB *teb ) else thread_data->fs = gdt_fs_sel; teb->WOW32Reserved = __wine_syscall_dispatcher; + thread_data->xstate_features_size = xstate_features_size; return STATUS_SUCCESS; } @@ -2432,7 +2480,9 @@ void signal_init_process(void) struct sigaction sig_act; void *kernel_stack = (char *)ntdll_get_thread_data()->kernel_stack + kernel_stack_size; - x86_thread_data()->syscall_frame = (struct syscall_frame *)kernel_stack - 1; + x86_thread_data()->syscall_frame = (struct syscall_frame *)((ULONG_PTR)((char *)kernel_stack + - sizeof(struct syscall_frame) - xstate_features_size) & ~(ULONG_PTR)63); + x86_thread_data()->xstate_features_size = xstate_features_size; if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR) syscall_flags |= SYSCALL_HAVE_FXSAVE; if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE) syscall_flags |= SYSCALL_HAVE_XSAVE; @@ -2481,6 +2531,8 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB ldt_set_fs( thread_data->fs, teb ); thread_data->gs = get_gs(); thread_data->syscall_table = KeServiceDescriptorTable; + thread_data->xstate_features_mask = xstate_supported_features_mask; + assert( thread_data->xstate_features_size == xstate_features_size ); context.SegCs = get_cs(); context.SegDs = get_ds(); @@ -2498,12 +2550,27 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB ((XSAVE_FORMAT *)context.ExtendedRegisters)->MxCsr = 0x1f80; if ((ctx = get_cpu_area( IMAGE_FILE_MACHINE_I386 ))) *ctx = context; - if (suspend) wait_suspend( &context ); + if (suspend) + { + context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; + wait_suspend( &context ); + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386) + { + x86_thread_data()->dr0 = context.Dr0; + x86_thread_data()->dr1 = context.Dr1; + x86_thread_data()->dr2 = context.Dr2; + x86_thread_data()->dr3 = context.Dr3; + x86_thread_data()->dr6 = context.Dr6; + x86_thread_data()->dr7 = context.Dr7; + } + } ctx = (CONTEXT *)((ULONG_PTR)context.Esp & ~3) - 1; *ctx = context; ctx->ContextFlags = CONTEXT_FULL | CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS; memset( frame, 0, sizeof(*frame) ); + if (xstate_compaction_enabled) + frame->xstate.CompactionMask = 0x8000000000000000 | xstate_supported_features_mask; NtSetContextThread( GetCurrentThread(), ctx ); stack = (DWORD *)ctx; @@ -2545,7 +2612,8 @@ __ASM_GLOBAL_FUNC( signal_start_thread, "movl 0x1f8(%ecx),%eax\n\t" /* x86_thread_data()->syscall_frame */ "orl %eax,%eax\n\t" "jnz 1f\n\t" - "leal -0x380(%esp),%eax\n\t" /* sizeof(struct syscall_frame) */ + "leal -0x280(%esp),%eax\n\t" /* sizeof(struct syscall_frame) */ + "subl 0x204(%ecx),%eax\n\t" /* x86_thread_data()->xstate_features_size */ "andl $~63,%eax\n\t" "movl %eax,0x1f8(%ecx)\n" /* x86_thread_data()->syscall_frame */ /* switch to kernel stack */ @@ -2605,26 +2673,28 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "addl %fs:0x1f4,%ebx\n\t" /* x86_thread_data()->syscall_table */ "testl $3,(%ecx)\n\t" /* frame->syscall_flags & (SYSCALL_HAVE_XSAVE | SYSCALL_HAVE_XSAVEC) */ "jz 2f\n\t" - "movl $7,%eax\n\t" + "movl %fs:0x1fc,%eax\n\t" /* x86_thread_data()->xstate_features_mask */ "xorl %edx,%edx\n\t" - "movl %edx,0x240(%ecx)\n\t" - "movl %edx,0x244(%ecx)\n\t" - "movl %edx,0x248(%ecx)\n\t" - "movl %edx,0x24c(%ecx)\n\t" - "movl %edx,0x250(%ecx)\n\t" - "movl %edx,0x254(%ecx)\n\t" + "andl $7,%eax\n\t" + "xorl %edi,%edi\n\t" + "movl %edi,0x240(%ecx)\n\t" + "movl %edi,0x244(%ecx)\n\t" + "movl %edi,0x248(%ecx)\n\t" + "movl %edi,0x24c(%ecx)\n\t" + "movl %edi,0x250(%ecx)\n\t" + "movl %edi,0x254(%ecx)\n\t" "testl $2,(%ecx)\n\t" /* frame->syscall_flags & SYSCALL_HAVE_XSAVEC */ "jz 1f\n\t" - "movl %edx,0x258(%ecx)\n\t" - "movl %edx,0x25c(%ecx)\n\t" - "movl %edx,0x260(%ecx)\n\t" - "movl %edx,0x264(%ecx)\n\t" - "movl %edx,0x268(%ecx)\n\t" - "movl %edx,0x26c(%ecx)\n\t" - "movl %edx,0x270(%ecx)\n\t" - "movl %edx,0x274(%ecx)\n\t" - "movl %edx,0x278(%ecx)\n\t" - "movl %edx,0x27c(%ecx)\n\t" + "movl %edi,0x258(%ecx)\n\t" + "movl %edi,0x25c(%ecx)\n\t" + "movl %edi,0x260(%ecx)\n\t" + "movl %edi,0x264(%ecx)\n\t" + "movl %edi,0x268(%ecx)\n\t" + "movl %edi,0x26c(%ecx)\n\t" + "movl %edi,0x270(%ecx)\n\t" + "movl %edi,0x274(%ecx)\n\t" + "movl %edi,0x278(%ecx)\n\t" + "movl %edi,0x27c(%ecx)\n\t" /* The xsavec instruction is not supported by * binutils < 2.25. */ ".byte 0x0f, 0xc7, 0x61, 0x40\n\t" /* xsavec 0x40(%ecx) */ @@ -2669,8 +2739,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "testl $3,%ecx\n\t" /* SYSCALL_HAVE_XSAVE | SYSCALL_HAVE_XSAVEC */ "jz 1f\n\t" "movl %eax,%esi\n\t" - "movl $7,%eax\n\t" - "xorl %edx,%edx\n\t" + "movl %fs:0x1fc,%eax\n\t" /* x86_thread_data()->xstate_features_mask */ + "movl %fs:0x200,%edx\n\t" /* x86_thread_data()->xstate_features_mask high dword */ "xrstor 0x40(%esp)\n\t" "movl %esi,%eax\n\t" "jmp 3f\n" diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index ab544908883..be9af2c23d1 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -27,6 +27,7 @@ #include "config.h" #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include #include +#include +#include #include #ifdef HAVE_MACHINE_SYSARCH_H # include @@ -65,6 +68,14 @@ # include #endif +#if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_LINUX_SECCOMP_H) && defined(HAVE_SYS_PRCTL_H) +#define HAVE_SECCOMP 1 +# include +# include +# include +# include +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -140,7 +151,7 @@ __ASM_GLOBAL_FUNC( alloc_fs_sel, #define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) #define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) #define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.fpregs)) -#define XState_sig(fpu) (((unsigned int *)fpu->Reserved4)[12] == FP_XSTATE_MAGIC1 ? (XSTATE *)(fpu + 1) : NULL) +#define XState_sig(fpu) (((unsigned int *)fpu->Reserved4)[12] == FP_XSTATE_MAGIC1 ? (XSAVE_AREA_HEADER *)(fpu + 1) : NULL) #elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__) @@ -359,11 +370,10 @@ struct exc_stack_layout ULONG64 align; /* 588 */ struct machine_frame machine_frame; /* 590 */ ULONG64 align2; /* 5b8 */ - XSTATE xstate; /* 5c0 */ }; C_ASSERT( offsetof(struct exc_stack_layout, rec) == 0x4f0 ); C_ASSERT( offsetof(struct exc_stack_layout, machine_frame) == 0x590 ); -C_ASSERT( sizeof(struct exc_stack_layout) == 0x700 ); +C_ASSERT( sizeof(struct exc_stack_layout) == 0x5c0 ); /* stack layout when calling KiUserApcDispatcher */ struct apc_stack_layout @@ -424,10 +434,12 @@ struct syscall_frame DWORD restore_flags; /* 00b4 */ DWORD align[2]; /* 00b8 */ XMM_SAVE_AREA32 xsave; /* 00c0 */ - DECLSPEC_ALIGN(64) XSTATE xstate; /* 02c0 */ + DECLSPEC_ALIGN(64) XSAVE_AREA_HEADER xstate; /* 02c0 */ }; -C_ASSERT( sizeof( struct syscall_frame ) == 0x400); +C_ASSERT( offsetof( struct syscall_frame, xsave ) == 0xc0 ); +C_ASSERT( offsetof( struct syscall_frame, xstate ) == 0x2c0 ); +C_ASSERT( sizeof( struct syscall_frame ) == 0x300); struct amd64_thread_data { @@ -441,6 +453,8 @@ struct amd64_thread_data struct syscall_frame *syscall_frame; /* 0328 syscall frame pointer */ SYSTEM_SERVICE_TABLE *syscall_table; /* 0330 syscall table */ DWORD fs; /* 0338 WOW TEB selector */ + DWORD xstate_features_size; /* 033c */ + UINT64 xstate_features_mask; /* 0340 */ }; C_ASSERT( sizeof(struct amd64_thread_data) <= sizeof(((struct ntdll_thread_data *)0)->cpu_data) ); @@ -448,6 +462,8 @@ C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, pth C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, syscall_frame ) == 0x328 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, syscall_table ) == 0x330 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, fs ) == 0x338 ); +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, xstate_features_size ) == 0x33c ); +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct amd64_thread_data, xstate_features_mask ) == 0x340 ); static inline struct amd64_thread_data *amd64_thread_data(void) { @@ -474,17 +490,14 @@ struct xcontext { CONTEXT c; CONTEXT_EX c_ex; - ULONG64 host_compaction_mask; }; -extern BOOL xstate_compaction_enabled; - -static inline XSTATE *xstate_from_context( const CONTEXT *context ) +static inline XSAVE_AREA_HEADER *xstate_from_context( const CONTEXT *context ) { CONTEXT_EX *xctx = (CONTEXT_EX *)(context + 1); if ((context->ContextFlags & CONTEXT_XSTATE) != CONTEXT_XSTATE) return NULL; - return (XSTATE *)((char *)xctx + xctx->XState.Offset); + return (XSAVE_AREA_HEADER *)((char *)xctx + xctx->XState.Offset); } static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer ) @@ -497,7 +510,7 @@ static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer ) if (xstate_buffer) { - xctx->XState.Length = sizeof(XSTATE); + xctx->XState.Length = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; xctx->XState.Offset = (BYTE *)xstate_buffer - (BYTE *)xctx; context->ContextFlags |= CONTEXT_XSTATE; @@ -564,6 +577,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex TRACE( "function %lx base %p cie %p len %x id %x version %x aug '%s' code_align %lu data_align %ld retaddr %s\n", ip, bases->func, cie, cie->length, cie->id, cie->version, cie->augmentation, info.code_align, info.data_align, dwarf_reg_names[info.retaddr_reg] ); + WINE_BACKTRACE_LOG( "%s.\n", wine_debuginfostr_pc((void *)context->Rip) ); end = NULL; for (augmentation = cie->augmentation; *augmentation; augmentation++) @@ -893,18 +907,17 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex context->Dr7 = amd64_thread_data()->dr7; if (FPU_sig(sigcontext)) { - XSTATE *xs; + XSAVE_AREA_HEADER *xs; context->ContextFlags |= CONTEXT_FLOATING_POINT; context->FltSave = *FPU_sig(sigcontext); context->MxCsr = context->FltSave.MxCsr; - if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext)))) + if (xstate_extended_features() && (xs = XState_sig(FPU_sig(sigcontext)))) { /* xcontext and sigcontext are both on the signal stack, so we can * just reference sigcontext without overflowing 32 bit XState.Offset */ context_init_xstate( context, xs ); assert( xcontext->c_ex.XState.Offset == (BYTE *)xs - (BYTE *)&xcontext->c_ex ); - xcontext->host_compaction_mask = xs->CompactionMask; } } } @@ -918,7 +931,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcontext ) { const CONTEXT *context = &xcontext->c; - XSTATE *xs; amd64_thread_data()->dr0 = context->Dr0; amd64_thread_data()->dr1 = context->Dr1; @@ -928,8 +940,6 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon amd64_thread_data()->dr7 = context->Dr7; set_sigcontext( context, sigcontext ); if (FPU_sig(sigcontext)) *FPU_sig(sigcontext) = context->FltSave; - if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext)))) - xs->CompactionMask = xcontext->host_compaction_mask; leave_handler( sigcontext ); } @@ -977,15 +987,16 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) BOOL self = (handle == GetCurrentThread()); struct syscall_frame *frame = amd64_thread_data()->syscall_frame; - if ((flags & CONTEXT_XSTATE) && (cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX)) + if ((flags & CONTEXT_XSTATE) && xstate_extended_features()) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xs = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); + XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); - if (context_ex->XState.Length < offsetof(XSTATE, YmmContext) || - context_ex->XState.Length > sizeof(XSTATE)) + if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || + context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) return STATUS_INVALID_PARAMETER; - if ((xs->Mask & XSTATE_MASK_GSSE) && (context_ex->XState.Length < sizeof(XSTATE))) + if ((xs->Mask & xstate_extended_features()) + && (context_ex->XState.Length < xstate_get_size( xs->CompactionMask, xs->Mask ))) return STATUS_BUFFER_OVERFLOW; } else flags &= ~CONTEXT_XSTATE; @@ -1050,14 +1061,12 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) if (flags & CONTEXT_XSTATE) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xs = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); + XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); + UINT64 mask = frame->xstate.Mask; - if (xs->Mask & XSTATE_MASK_GSSE) - { - frame->xstate.Mask |= XSTATE_MASK_GSSE; - memcpy( &frame->xstate.YmmContext, &xs->YmmContext, sizeof(xs->YmmContext) ); - } - else frame->xstate.Mask &= ~XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + copy_xstate( &frame->xstate, xs, xs->Mask ); + if (xs->CompactionMask) frame->xstate.Mask |= mask & ~xs->CompactionMask; } frame->restore_flags |= flags & ~CONTEXT_INTEGER; @@ -1073,10 +1082,17 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) { struct syscall_frame *frame = amd64_thread_data()->syscall_frame; DWORD needed_flags = context->ContextFlags & ~CONTEXT_AMD64; + BOOL use_cached_debug_regs = FALSE; BOOL self = (handle == GetCurrentThread()); - /* debug registers require a server call */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) self = FALSE; + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; + + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) + { + /* debug registers require a server call if hw breakpoints are enabled */ + if (amd64_thread_data()->dr7 & 0xff) self = FALSE; + else use_cached_debug_regs = TRUE; + } if (!self) { @@ -1155,36 +1171,49 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->MxCsr = context->FltSave.MxCsr; context->ContextFlags |= CONTEXT_FLOATING_POINT; } - if ((needed_flags & CONTEXT_XSTATE) && (cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX)) + if ((needed_flags & CONTEXT_XSTATE) && xstate_extended_features()) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xstate = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); - unsigned int mask; + XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); + UINT64 mask; - if (context_ex->XState.Length < offsetof(XSTATE, YmmContext) - || context_ex->XState.Length > sizeof(XSTATE)) - return STATUS_INVALID_PARAMETER; - - mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); xstate->Mask = frame->xstate.Mask & mask; xstate->CompactionMask = xstate_compaction_enabled ? (0x8000000000000000 | mask) : 0; - memset( xstate->Reserved, 0, sizeof(xstate->Reserved) ); + memset( xstate->Reserved2, 0, sizeof(xstate->Reserved2) ); if (xstate->Mask) { - if (context_ex->XState.Length < sizeof(XSTATE)) return STATUS_BUFFER_OVERFLOW; - memcpy( &xstate->YmmContext, &frame->xstate.YmmContext, sizeof(xstate->YmmContext) ); + if (context_ex->XState.Length < xstate_get_size( xstate->CompactionMask, xstate->Mask )) + return STATUS_BUFFER_OVERFLOW; + copy_xstate( xstate, &frame->xstate, xstate->Mask ); + /* copy_xstate may use avx in memcpy, restore xstate not to break the tests. */ + frame->restore_flags |= CONTEXT_XSTATE; } } - /* update the cached version of the debug registers */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) + if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) { - amd64_thread_data()->dr0 = context->Dr0; - amd64_thread_data()->dr1 = context->Dr1; - amd64_thread_data()->dr2 = context->Dr2; - amd64_thread_data()->dr3 = context->Dr3; - amd64_thread_data()->dr6 = context->Dr6; - amd64_thread_data()->dr7 = context->Dr7; + if (use_cached_debug_regs) + { + context->Dr0 = amd64_thread_data()->dr0; + context->Dr1 = amd64_thread_data()->dr1; + context->Dr2 = amd64_thread_data()->dr2; + context->Dr3 = amd64_thread_data()->dr3; + context->Dr6 = amd64_thread_data()->dr6; + context->Dr7 = amd64_thread_data()->dr7; + } + else + { + /* update the cached version of the debug registers */ + amd64_thread_data()->dr0 = context->Dr0; + amd64_thread_data()->dr1 = context->Dr1; + amd64_thread_data()->dr2 = context->Dr2; + amd64_thread_data()->dr3 = context->Dr3; + amd64_thread_data()->dr6 = context->Dr6; + amd64_thread_data()->dr7 = context->Dr7; + } } + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); return STATUS_SUCCESS; } @@ -1279,14 +1308,10 @@ NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) if (flags & CONTEXT_I386_XSTATE) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xs = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); + XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); - if (xs->Mask & XSTATE_MASK_GSSE) - { - frame->xstate.Mask |= XSTATE_MASK_GSSE; - memcpy( &frame->xstate.YmmContext, &xs->YmmContext, sizeof(xs->YmmContext) ); - } - else frame->xstate.Mask &= ~XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + copy_xstate( &frame->xstate, xs, xs->Mask ); frame->restore_flags |= CONTEXT_XSTATE; } return STATUS_SUCCESS; @@ -1367,26 +1392,31 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) fpux_to_fpu( &context->FloatSave, &frame->xsave ); context->ContextFlags |= CONTEXT_I386_FLOATING_POINT; } - if ((needed_flags & CONTEXT_I386_XSTATE) && (cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX)) + if ((needed_flags & CONTEXT_I386_XSTATE) && xstate_extended_features()) { CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); - XSTATE *xstate = (XSTATE *)((char *)context_ex + context_ex->XState.Offset); - unsigned int mask; + XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); + UINT64 mask; - if (context_ex->XState.Length < offsetof(XSTATE, YmmContext) || - context_ex->XState.Length > sizeof(XSTATE)) + if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || + context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) return STATUS_INVALID_PARAMETER; - mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & XSTATE_MASK_GSSE; + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); xstate->Mask = frame->xstate.Mask & mask; xstate->CompactionMask = xstate_compaction_enabled ? (0x8000000000000000 | mask) : 0; - memset( xstate->Reserved, 0, sizeof(xstate->Reserved) ); + memset( xstate->Reserved2, 0, sizeof(xstate->Reserved2) ); if (xstate->Mask) { - if (context_ex->XState.Length < sizeof(XSTATE)) return STATUS_BUFFER_OVERFLOW; - memcpy( &xstate->YmmContext, &frame->xstate.YmmContext, sizeof(xstate->YmmContext) ); + if (context_ex->XState.Length < xstate_get_size( xstate->CompactionMask, xstate->Mask )) + return STATUS_BUFFER_OVERFLOW; + copy_xstate( xstate, &frame->xstate, xstate->Mask ); + /* copy_xstate may use avx in memcpy, restore xstate not to break the tests. */ + frame->restore_flags |= CONTEXT_XSTATE; } } + set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); return STATUS_SUCCESS; } @@ -1401,7 +1431,8 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec struct exc_stack_layout *stack; size_t stack_size; NTSTATUS status; - XSTATE *src_xs; + XSAVE_AREA_HEADER *src_xs; + unsigned int xstate_size; if (rec->ExceptionCode == EXCEPTION_SINGLE_STEP) { @@ -1420,7 +1451,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec context->EFlags &= ~0x100; /* clear single-step flag */ } - status = send_debug_event( rec, context, TRUE ); + status = send_debug_event( rec, context, TRUE, TRUE ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) { restore_context( xcontext, sigcontext ); @@ -1430,7 +1461,8 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec /* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */ if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Rip--; - stack_size = (ULONG_PTR)stack_ptr - (((ULONG_PTR)stack_ptr - sizeof(*stack)) & ~(ULONG_PTR)63); + xstate_size = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; + stack_size = (ULONG_PTR)stack_ptr - (((ULONG_PTR)stack_ptr - sizeof(*stack) - xstate_size) & ~(ULONG_PTR)63); stack = virtual_setup_exception( stack_ptr, stack_size, rec ); stack->rec = *rec; stack->context = *context; @@ -1439,15 +1471,12 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec if ((src_xs = xstate_from_context( context ))) { - assert( !((ULONG_PTR)&stack->xstate & 63) ); - context_init_xstate( &stack->context, &stack->xstate ); - memset( &stack->xstate, 0, offsetof(XSTATE, YmmContext) ); - stack->xstate.CompactionMask = xstate_compaction_enabled ? 0x8000000000000004 : 0; - if (src_xs->Mask & 4) - { - stack->xstate.Mask = 4; - memcpy( &stack->xstate.YmmContext, &src_xs->YmmContext, sizeof(stack->xstate.YmmContext) ); - } + XSAVE_AREA_HEADER *dst_xs = (XSAVE_AREA_HEADER *)(stack + 1); + assert( !((ULONG_PTR)dst_xs & 63) ); + context_init_xstate( &stack->context, dst_xs ); + memset( dst_xs, 0, sizeof(*dst_xs) ); + dst_xs->CompactionMask = xstate_compaction_enabled ? 0x8000000000000000 | xstate_extended_features() : 0; + copy_xstate( dst_xs, src_xs, src_xs->Mask ); } else { @@ -1534,16 +1563,19 @@ NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context struct syscall_frame *frame = amd64_thread_data()->syscall_frame; struct exc_stack_layout *stack; NTSTATUS status = NtSetContextThread( GetCurrentThread(), context ); + unsigned int xstate_size; if (status) return status; - stack = (struct exc_stack_layout *)((context->Rsp - sizeof(*stack)) & ~(ULONG_PTR)63); + xstate_size = sizeof(XSAVE_AREA_HEADER) + xstate_features_size; + stack = (struct exc_stack_layout *)((context->Rsp - sizeof(*stack) - xstate_size) & ~(ULONG_PTR)63); memmove( &stack->context, context, sizeof(*context) ); if ((context->ContextFlags & CONTEXT_XSTATE) == CONTEXT_XSTATE) { - assert( !((ULONG_PTR)&stack->xstate & 63) ); - context_init_xstate( &stack->context, &stack->xstate ); - memcpy( &stack->xstate, &frame->xstate, sizeof(frame->xstate) ); + XSAVE_AREA_HEADER *dst_xs = (XSAVE_AREA_HEADER *)(stack + 1); + assert( !((ULONG_PTR)dst_xs & 63) ); + context_init_xstate( &stack->context, dst_xs ); + memcpy( dst_xs, &frame->xstate, sizeof(XSAVE_AREA_HEADER) + xstate_features_size ); } else context_init_xstate( &stack->context, NULL ); @@ -1585,13 +1617,15 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback, "fnstcw -0x2c(%rbp)\n\t" "movq %rsi,-0x38(%rbp)\n\t" /* ret_ptr */ "movq %rdx,-0x40(%rbp)\n\t" /* ret_len */ - "subq $0x408,%rsp\n\t" /* sizeof(struct syscall_frame) + exception */ + "subq $0x308,%rsp\n\t" /* sizeof(struct syscall_frame) + exception */ + "movl 0x33c(%r8),%esi\n\t" /* amd64_thread_data()->xstate_features_size */ + "subq %rsi,%rsp\n\t" "andq $~63,%rsp\n\t" "leaq 0x10(%rbp),%rax\n\t" "movq %rax,0xa8(%rsp)\n\t" /* frame->syscall_cfa */ "movq 0x328(%r8),%r10\n\t" /* amd64_thread_data()->syscall_frame */ "movq (%r8),%rax\n\t" /* NtCurrentTeb()->Tib.ExceptionList */ - "movq %rax,0x408(%rsp)\n\t" + "movq %rax,0x300(%rsp,%rsi)\n\t" "movl 0xb0(%r10),%r14d\n\t" /* prev_frame->syscall_flags */ "movl %r14d,0xb0(%rsp)\n\t" /* frame->syscall_flags */ "movq %r10,0xa0(%rsp)\n\t" /* frame->prev_frame */ @@ -1624,7 +1658,8 @@ __ASM_GLOBAL_FUNC( user_mode_callback_return, __ASM_CFI(".cfi_rel_offset %r13,-0x18\n\t") __ASM_CFI(".cfi_rel_offset %r14,-0x20\n\t") __ASM_CFI(".cfi_rel_offset %r15,-0x28\n\t") - "movq 0x408(%r10),%rax\n\t" /* exception list */ + "movl 0x33c(%rcx),%eax\n\t" /* amd64_thread_data()->xstate_features_size */ + "movq 0x300(%r10,%rax),%rax\n\t" /* exception list */ "movq %rax,0(%rcx)\n\t" /* teb->Tib.ExceptionList */ "movq -0x38(%rbp),%r10\n\t" /* ret_ptr */ "movq -0x40(%rbp),%r11\n\t" /* ret_len */ @@ -1783,6 +1818,248 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) return 0; } +#ifdef HAVE_SECCOMP +static void sigsys_handler( int signal, siginfo_t *siginfo, void *sigcontext ) +{ + extern const void *__wine_syscall_dispatcher_prolog_end_ptr; + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + ucontext_t *ctx = sigcontext; + + TRACE_(seh)("SIGSYS, rax %#llx, rip %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX], + ctx->uc_mcontext.gregs[REG_RIP]); + + if (ctx->uc_mcontext.gregs[REG_RAX] == 0xffff) + { + /* Test syscall from the Unix side (install_bpf). */ + ctx->uc_mcontext.gregs[REG_RAX] = STATUS_INVALID_PARAMETER; + return; + } + + frame->rip = ctx->uc_mcontext.gregs[REG_RIP] + 0xb; + frame->rcx = ctx->uc_mcontext.gregs[REG_RIP]; + frame->eflags = ctx->uc_mcontext.gregs[REG_EFL]; + frame->restore_flags = 0; + ctx->uc_mcontext.gregs[REG_RCX] = (ULONG_PTR)frame; + ctx->uc_mcontext.gregs[REG_R11] = frame->eflags; + ctx->uc_mcontext.gregs[REG_EFL] &= ~0x100; /* clear single-step flag */ + ctx->uc_mcontext.gregs[REG_RIP] = (ULONG64)__wine_syscall_dispatcher_prolog_end_ptr; +} + +/* syscall numbers are for Windows 10 2009 (build 19043) */ +static struct +{ + unsigned int win_syscall_nr; + unsigned int wine_syscall_nr; + void *function; +} +syscall_nr_translation[] = +{ + {0x19, ~0u, NtQueryInformationProcess}, + {0x36, ~0u, NtQuerySystemInformation}, + {0xf2, ~0u, NtGetContextThread}, + {0x55, ~0u, NtCreateFile}, + {0x08, ~0u, NtWriteFile}, + {0x06, ~0u, NtReadFile}, + {0x0f, ~0u, NtClose}, + {0x23, ~0u, NtQueryVirtualMemory}, +}; + +static void sigsys_handler_rdr2( int signal, siginfo_t *siginfo, void *sigcontext ) +{ + ucontext_t *ctx = sigcontext; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(syscall_nr_translation); ++i) + { + if (ctx->uc_mcontext.gregs[REG_RAX] == syscall_nr_translation[i].win_syscall_nr) + { + ctx->uc_mcontext.gregs[REG_RAX] = syscall_nr_translation[i].wine_syscall_nr; + sigsys_handler( signal, siginfo, sigcontext ); + return; + } + } + + if (ctx->uc_mcontext.gregs[REG_RAX] == 0xffff) + sigsys_handler( signal, siginfo, sigcontext ); + else + FIXME_(seh)("Unhandled syscall %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX]); +} +#endif + +#ifdef HAVE_SECCOMP +static int sc_seccomp(unsigned int operation, unsigned int flags, void *args) +{ +#ifndef __NR_seccomp +# define __NR_seccomp 317 +#endif + return syscall(__NR_seccomp, operation, flags, args); +} +#endif + +static void check_bpf_jit_enable(void) +{ + char enabled; + int fd; + + fd = open("/proc/sys/net/core/bpf_jit_enable", O_RDONLY); + if (fd == -1) + { + WARN_(seh)("Could not open /proc/sys/net/core/bpf_jit_enable.\n"); + return; + } + + if (read(fd, &enabled, sizeof(enabled)) == sizeof(enabled)) + { + TRACE_(seh)("enabled %#x.\n", enabled); + + if (enabled != '1') + ERR_(seh)("BPF JIT is not enabled in the kernel, enable it to reduce syscall emulation overhead.\n"); + } + else + { + WARN_(seh)("Could not read /proc/sys/net/core/bpf_jit_enable.\n"); + } + close(fd); +} + +static void install_bpf(struct sigaction *sig_act) +{ +#ifdef HAVE_SECCOMP +# ifndef SECCOMP_FILTER_FLAG_SPEC_ALLOW +# define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2) +# endif + +# ifndef SECCOMP_SET_MODE_FILTER +# define SECCOMP_SET_MODE_FILTER 1 +# endif + static const BYTE syscall_trap_test[] = + { + 0x48, 0x89, 0xf8, /* mov %rdi, %rax */ + 0x0f, 0x05, /* syscall */ + 0xc3, /* retq */ + }; + static const unsigned int flags = SECCOMP_FILTER_FLAG_SPEC_ALLOW; + +#define NATIVE_SYSCALL_ADDRESS_START 0x700000000000 + + static struct sock_filter filter[] = + { + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, instruction_pointer) + 4), + /* Native libs are loaded at high addresses. */ + BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, NATIVE_SYSCALL_ADDRESS_START >> 32, 0, 1), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + /* Allow i386. */ + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, arch)), + BPF_JUMP (BPF_JMP | BPF_JEQ | BPF_K, AUDIT_ARCH_X86_64, 1, 0), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + /* Allow wine64-preloader */ + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, instruction_pointer)), + BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0x7d400000, 1, 0), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP), + BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0x7d402000, 0, 1), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + }; + long (*test_syscall)(long sc_number); + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + struct sock_fprog prog; + unsigned int i, j; + NTSTATUS status; + + if ((ULONG_PTR)sc_seccomp < NATIVE_SYSCALL_ADDRESS_START + || (ULONG_PTR)syscall < NATIVE_SYSCALL_ADDRESS_START) + { + ERR_(seh)("Native libs are being loaded in low addresses, sc_seccomp %p, syscall %p, not installing seccomp.\n", + sc_seccomp, syscall); + ERR_(seh)("The known reasons are /proc/sys/vm/legacy_va_layout set to 1 or 'ulimit -s' being 'unlimited'.\n"); + return; + } + + sig_act->sa_sigaction = sigsys_handler; + memset(&prog, 0, sizeof(prog)); + + { + const char *sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "1174180") || !strcmp(sgi, "1404210") || !strcmp(sgi, "1418100"))) + { + /* Use specific signal handler. */ + sig_act->sa_sigaction = sigsys_handler_rdr2; + + for (i = 0; i < KeServiceDescriptorTable->ServiceLimit; ++i) + { + for (j = 0; j < ARRAY_SIZE(syscall_nr_translation); ++j) + if ((void *)KeServiceDescriptorTable->ServiceTable[i] == syscall_nr_translation[j].function) + { + syscall_nr_translation[j].wine_syscall_nr = i; + break; + } + } + + for (j = 0; j < ARRAY_SIZE(syscall_nr_translation); ++j) + assert( syscall_nr_translation[j].wine_syscall_nr != ~0u ); + } + } + + sigaction(SIGSYS, sig_act, NULL); + + frame->syscall_flags = syscall_flags; + + test_syscall = mmap((void *)0x600000000000, 0x1000, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANON, -1, 0); + if (test_syscall != (void *)0x600000000000) + { + int ret; + + ERR("Could not allocate test syscall, falling back to seccomp presence check, test_syscall %p, errno %d.\n", + test_syscall, errno); + if (test_syscall != MAP_FAILED) munmap(test_syscall, 0x1000); + + if ((ret = prctl(PR_GET_SECCOMP, 0, NULL, 0, 0))) + { + if (ret == 2) + TRACE_(seh)("Seccomp filters already installed.\n"); + else + ERR_(seh)("Seccomp filters cannot be installed, ret %d, error %s.\n", ret, strerror(errno)); + return; + } + } + else + { + memcpy(test_syscall, syscall_trap_test, sizeof(syscall_trap_test)); + status = test_syscall(0xffff); + munmap(test_syscall, 0x1000); + if (status == STATUS_INVALID_PARAMETER) + { + TRACE_(seh)("Seccomp filters already installed.\n"); + return; + } + if (status != -ENOSYS && (status != -1 || errno != ENOSYS)) + { + ERR_(seh)("Unexpected status %#x, errno %d.\n", status, errno); + return; + } + } + + TRACE_(seh)("Installing seccomp filters.\n"); + + prog.len = ARRAY_SIZE(filter); + prog.filter = filter; + + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + { + ERR_(seh)("prctl(PR_SET_NO_NEW_PRIVS, ...): %s.\n", strerror(errno)); + return; + } + if (sc_seccomp(SECCOMP_SET_MODE_FILTER, flags, &prog)) + { + ERR_(seh)("prctl(PR_SET_SECCOMP, ...): %s.\n", strerror(errno)); + return; + } + check_bpf_jit_enable(); +#else + WARN_(seh)("Built without seccomp.\n"); +#endif +} /*********************************************************************** * handle_interrupt @@ -1833,6 +2110,47 @@ static inline BOOL handle_interrupt( ucontext_t *sigcontext, EXCEPTION_RECORD *r return TRUE; } +static void dump_syscall_fault( CONTEXT *context, DWORD exc_code ) +{ + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + struct unwind_builtin_dll_params params; + + __TRY + { + DISPATCHER_CONTEXT dispatch; + + context->ContextFlags &= ~0x40; + + dispatch.EstablisherFrame = context->Rsp; + dispatch.TargetIp = 0; + dispatch.ContextRecord = context; + dispatch.HistoryTable = NULL; + + params.type = UNW_FLAG_UHANDLER; + params.dispatch = &dispatch; + params.context = context; + + while (1) + { + if (context->Rip >= (ULONG_PTR)__wine_syscall_dispatcher + && context->Rip <= (ULONG_PTR)__wine_syscall_dispatcher_return) + { + WINE_BACKTRACE_LOG( "__wine_syscall_dispatcher.\n" ); + break; + } + if (unwind_builtin_dll( ¶ms )) + break; + } + } + __EXCEPT + { + WINE_BACKTRACE_LOG( "Fault during unwind.\n" ); + } + __ENDTRY + + WINE_BACKTRACE_LOG( "returning to user mode ip=%016lx ret=%08x\n", frame->rip, exc_code ); + __wine_syscall_dispatcher_return( frame, exc_code ); +} /*********************************************************************** * handle_syscall_fault @@ -1860,6 +2178,16 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, TRACE_(seh)( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", context->R12, context->R13, context->R14, context->R15 ); + if (terminate_process_running) + { + FIXME_(seh)( "Process is terminating, aborting.\n" ); + abort_process( terminate_process_exit_code ); + } + + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE_(seh)( "returning to handler\n" ); @@ -1870,6 +2198,25 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, } else { + const char *kernel_stack = ntdll_get_thread_data()->kernel_stack; + char *stack = (char *)RSP_sig(sigcontext); + + WINE_BACKTRACE_LOG( "--- Exception %#x at %s.\n", rec->ExceptionCode, + wine_debuginfostr_pc( rec->ExceptionAddress )); + + if (!process_exiting && WINE_BACKTRACE_LOG_ON() && stack > kernel_stack + kernel_stack_guard_size + 4096) + { + stack = (char *)((ULONG_PTR)stack & ~(ULONG_PTR)15); + stack -= sizeof(*context); + RDI_sig(sigcontext) = (ULONG_PTR)stack; + RSI_sig(sigcontext) = rec->ExceptionCode; + memcpy( stack, context, sizeof(*context) ); + stack -= 0x28; + RIP_sig(sigcontext) = (ULONG_PTR)dump_syscall_fault; + RSP_sig(sigcontext) = (ULONG_PTR)stack; + return TRUE; + } + TRACE_(seh)( "returning to user mode ip=%016lx ret=%08x\n", frame->rip, rec->ExceptionCode ); RDI_sig(sigcontext) = (ULONG_PTR)frame; RSI_sig(sigcontext) = rec->ExceptionCode; @@ -1929,6 +2276,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) EXCEPTION_RECORD rec = { 0 }; struct xcontext context; ucontext_t *ucontext = init_handler( sigcontext ); + void *steamclient_addr = NULL; rec.ExceptionAddress = (void *)RIP_sig(ucontext); save_context( &context, ucontext ); @@ -1960,6 +2308,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) } break; case TRAP_x86_PAGEFLT: /* Page fault */ + if ((steamclient_addr = steamclient_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09 ))) + { + RIP_sig(ucontext) = (intptr_t)steamclient_addr; + return; + } + rec.NumberParameters = 2; rec.ExceptionInformation[0] = (ERROR_sig(ucontext) >> 1) & 0x09; rec.ExceptionInformation[1] = (ULONG_PTR)siginfo->si_addr; @@ -2149,21 +2503,44 @@ static void quit_handler( int signal, siginfo_t *siginfo, void *sigcontext ) static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) { ucontext_t *ucontext = init_handler( sigcontext ); - struct xcontext context; if (is_inside_syscall( ucontext )) { - DECLSPEC_ALIGN(64) XSTATE xs; - context.c.ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS; - context_init_xstate( &context.c, &xs ); + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + ULONG64 saved_compaction = 0; + struct xcontext *context; - NtGetContextThread( GetCurrentThread(), &context.c ); - wait_suspend( &context.c ); - NtSetContextThread( GetCurrentThread(), &context.c ); + context = (struct xcontext *)(((ULONG_PTR)RSP_sig(ucontext) - 128 /* red zone */ - sizeof(*context)) & ~15); + if ((char *)context < (char *)ntdll_get_thread_data()->kernel_stack) + { + ERR_(seh)( "kernel stack overflow.\n" ); + return; + } + context->c.ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS | CONTEXT_EXCEPTION_REQUEST; + NtGetContextThread( GetCurrentThread(), &context->c ); + if (xstate_extended_features()) + { + if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); + context_init_xstate( &context->c, &frame->xstate ); + saved_compaction = frame->xstate.CompactionMask; + } + wait_suspend( &context->c ); + if (xstate_extended_features()) frame->xstate.CompactionMask = saved_compaction; + if (context->c.ContextFlags & 0x40) + { + /* xstate is updated directly in frame's xstate */ + context->c.ContextFlags &= ~0x40; + frame->restore_flags |= 0x40; + } + NtSetContextThread( GetCurrentThread(), &context->c ); } else { + struct xcontext context; + save_context( &context, ucontext ); + context.c.ContextFlags |= CONTEXT_EXCEPTION_REPORTING; + if (is_wow64() && context.c.SegCs == cs64_sel) context.c.ContextFlags |= CONTEXT_EXCEPTION_ACTIVE; wait_suspend( &context.c ); restore_context( &context, ucontext ); } @@ -2302,6 +2679,7 @@ NTSTATUS signal_alloc_thread( TEB *teb ) } else thread_data->fs = fs32_sel; } + thread_data->xstate_features_size = xstate_features_size; return STATUS_SUCCESS; } @@ -2388,7 +2766,9 @@ void signal_init_process(void) WOW_TEB *wow_teb = get_wow_teb( NtCurrentTeb() ); void *ptr, *kernel_stack = (char *)ntdll_get_thread_data()->kernel_stack + kernel_stack_size; - amd64_thread_data()->syscall_frame = (struct syscall_frame *)kernel_stack - 1; + amd64_thread_data()->syscall_frame = (struct syscall_frame *)((ULONG_PTR)((char *)kernel_stack + - sizeof(struct syscall_frame) - xstate_features_size) & ~(ULONG_PTR)63); + amd64_thread_data()->xstate_features_size = xstate_features_size; /* sneak in a syscall dispatcher pointer at a fixed address (7ffe1000) */ ptr = (char *)user_shared_data + page_size; @@ -2460,6 +2840,7 @@ void signal_init_process(void) if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error; if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error; if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error; + install_bpf(&sig_act); return; error: @@ -2467,6 +2848,10 @@ void signal_init_process(void) exit(1); } +void set_thread_teb( TEB *teb ) +{ + arch_prctl( ARCH_SET_GS, teb ); +} /*********************************************************************** * call_init_thunk @@ -2479,6 +2864,8 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB I386_CONTEXT *wow_context; thread_data->syscall_table = KeServiceDescriptorTable; + thread_data->xstate_features_mask = xstate_supported_features_mask; + assert( thread_data->xstate_features_size == xstate_features_size ); #if defined __linux__ arch_prctl( ARCH_SET_GS, teb ); @@ -2500,7 +2887,7 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB # error Please define setting %gs for your architecture #endif - context.ContextFlags = CONTEXT_ALL; + context.ContextFlags = CONTEXT_ALL | CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; context.Rcx = (ULONG_PTR)entry; context.Rdx = (ULONG_PTR)arg; context.Rsp = (ULONG_PTR)teb->Tib.StackBase - 0x28; @@ -2533,12 +2920,26 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB *(XSAVE_FORMAT *)wow_context->ExtendedRegisters = context.FltSave; } - if (suspend) wait_suspend( &context ); + if (suspend) + { + wait_suspend( &context ); + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64) + { + amd64_thread_data()->dr0 = context.Dr0; + amd64_thread_data()->dr1 = context.Dr1; + amd64_thread_data()->dr2 = context.Dr2; + amd64_thread_data()->dr3 = context.Dr3; + amd64_thread_data()->dr6 = context.Dr6; + amd64_thread_data()->dr7 = context.Dr7; + } + } ctx = (CONTEXT *)((ULONG_PTR)context.Rsp & ~15) - 1; *ctx = context; ctx->ContextFlags = CONTEXT_FULL; memset( frame, 0, sizeof(*frame) ); + if (xstate_compaction_enabled) + frame->xstate.CompactionMask = 0x8000000000000000 | xstate_supported_features_mask; NtSetContextThread( GetCurrentThread(), ctx ); frame->cs = cs64_sel; @@ -2581,7 +2982,9 @@ __ASM_GLOBAL_FUNC( signal_start_thread, "movq 0x328(%rcx),%r8\n\t" /* amd64_thread_data()->syscall_frame */ "orq %r8,%r8\n\t" "jnz 1f\n\t" - "leaq -0x400(%rsp),%r8\n\t" /* sizeof(struct syscall_frame) */ + "leaq -0x300(%rsp),%r8\n\t" /* sizeof(struct syscall_frame) */ + "movl 0x33c(%rcx),%eax\n\t" /* amd64_thread_data()->xstate_features_size */ + "subq %rax,%r8\n\t" "andq $~63,%r8\n\t" "movq %r8,0x328(%rcx)\n" /* amd64_thread_data()->syscall_frame */ /* switch to kernel stack */ @@ -2636,18 +3039,25 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */ "testl $3,%r14d\n\t" /* SYSCALL_HAVE_XSAVE | SYSCALL_HAVE_XSAVEC */ "jz 2f\n\t" - "movl $7,%eax\n\t" +#ifdef __APPLE__ + "movq %gs:0x30,%rdx\n\t" + "movl 0x340(%rdx),%eax\n\t" +#else + "movl %gs:0x340,%eax\n\t" /* amd64_thread_data()->xstate_features_mask */ +#endif "xorl %edx,%edx\n\t" - "movq %rdx,0x2c0(%rcx)\n\t" - "movq %rdx,0x2c8(%rcx)\n\t" - "movq %rdx,0x2d0(%rcx)\n\t" + "andl $7,%eax\n\t" + "xorq %rbp,%rbp\n\t" + "movq %rbp,0x2c0(%rcx)\n\t" + "movq %rbp,0x2c8(%rcx)\n\t" + "movq %rbp,0x2d0(%rcx)\n\t" "testl $2,%r14d\n\t" /* SYSCALL_HAVE_XSAVEC */ "jz 1f\n\t" - "movq %rdx,0x2d8(%rcx)\n\t" - "movq %rdx,0x2e0(%rcx)\n\t" - "movq %rdx,0x2e8(%rcx)\n\t" - "movq %rdx,0x2f0(%rcx)\n\t" - "movq %rdx,0x2f8(%rcx)\n\t" + "movq %rbp,0x2d8(%rcx)\n\t" + "movq %rbp,0x2e0(%rcx)\n\t" + "movq %rbp,0x2e8(%rcx)\n\t" + "movq %rbp,0x2f0(%rcx)\n\t" + "movq %rbp,0x2f8(%rcx)\n\t" /* The xsavec instruction is not supported by * binutils < 2.25. */ ".byte 0x48, 0x0f, 0xc7, 0xa1, 0xc0, 0x00, 0x00, 0x00\n\t" /* xsavec64 0xc0(%rcx) */ @@ -2749,8 +3159,14 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "2:\ttestl $3,%r14d\n\t" /* SYSCALL_HAVE_XSAVE | SYSCALL_HAVE_XSAVEC */ "jz 3f\n\t" "movq %rax,%r11\n\t" - "movl $7,%eax\n\t" - "xorl %edx,%edx\n\t" +#ifdef __APPLE__ + "movq %gs:0x30,%rdx\n\t" + "movl 0x340(%rdx),%eax\n\t" + "movl 0x344(%rdx),%edx\n\t" +#else + "movl %gs:0x340,%eax\n\t" /* amd64_thread_data()->xstate_features_mask */ + "movl %gs:0x344,%edx\n\t" /* amd64_thread_data()->xstate_features_mask high dword */ +#endif "xrstor64 0xc0(%rcx)\n\t" "movq %r11,%rax\n\t" "movl 0xb4(%rcx),%edx\n\t" /* frame->restore_flags */ diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 4e6781df607..28f1b6d83b2 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -153,6 +153,8 @@ struct async_transmit_ioctl LARGE_INTEGER offset; }; +static int get_sock_type( HANDLE handle ); + static NTSTATUS sock_errno_to_status( int err ) { switch (err) @@ -1062,6 +1064,21 @@ static NTSTATUS try_send( int fd, struct async_send_ioctl *async ) return STATUS_SUCCESS; } +static void hack_update_status( HANDLE handle, unsigned int *status ) +{ + /* HACK: VRChat relies on send() reporting STATUS_SUCCESS for dropped UDP sockets when the + * network is actually lost but network adapters are still up on Windows. Fix VRChat internal + * error bug when resuming from sleep */ + const char *appid; + + if (*status == STATUS_NETWORK_UNREACHABLE && get_sock_type( handle ) == SOCK_DGRAM + && (appid = getenv( "SteamAppId" )) && !strcmp( appid, "438100" )) + { + WARN( "Replacing STATUS_NETWORK_UNREACHABLE with STATUS_SUCCESS for VRChat.\n" ); + *status = STATUS_SUCCESS; + } +} + static BOOL async_send_proc( void *user, ULONG_PTR *info, unsigned int *status ) { struct async_send_ioctl *async = user; @@ -1076,6 +1093,7 @@ static BOOL async_send_proc( void *user, ULONG_PTR *info, unsigned int *status ) *status = try_send( fd, async ); TRACE( "got status %#x\n", *status ); + hack_update_status( async->io.handle, status ); if (needs_close) close( fd ); @@ -1142,6 +1160,8 @@ static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi ULONG_PTR information; status = try_send( fd, async ); + hack_update_status( handle, &status ); + if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking)) status = STATUS_PENDING; @@ -1212,7 +1232,6 @@ static NTSTATUS sock_ioctl_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap return sock_send( handle, event, apc, apc_user, io, fd, async, force_async ); } - NTSTATUS sock_write( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, const void *buffer, ULONG length ) { diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index bfbcaf4a851..23f17e72e08 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -43,6 +43,9 @@ #ifdef HAVE_SCHED_H # include #endif +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif #include #include #include @@ -63,6 +66,8 @@ #include "wine/server.h" #include "wine/debug.h" #include "unix_private.h" +#include "esync.h" +#include "fsync.h" WINE_DEFAULT_DEBUG_CHANNEL(sync); @@ -270,6 +275,13 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ *handle = 0; if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER; + + if (do_fsync()) + return fsync_create_semaphore( handle, access, attr, initial, max ); + + if (do_esync()) + return esync_create_semaphore( handle, access, attr, initial, max ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_semaphore ) @@ -296,6 +308,13 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC unsigned int ret; *handle = 0; + + if (do_fsync()) + return fsync_open_semaphore( handle, access, attr ); + + if (do_esync()) + return esync_open_semaphore( handle, access, attr ); + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_semaphore ) @@ -332,6 +351,12 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla if (len != sizeof(SEMAPHORE_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_semaphore( handle, info, ret_len ); + + if (do_esync()) + return esync_query_semaphore( handle, info, ret_len ); + SERVER_START_REQ( query_semaphore ) { req->handle = wine_server_obj_handle( handle ); @@ -354,6 +379,12 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous { unsigned int ret; + if (do_fsync()) + return fsync_release_semaphore( handle, count, previous ); + + if (do_esync()) + return esync_release_semaphore( handle, count, previous ); + SERVER_START_REQ( release_semaphore ) { req->handle = wine_server_obj_handle( handle ); @@ -380,6 +411,13 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ *handle = 0; if (type != NotificationEvent && type != SynchronizationEvent) return STATUS_INVALID_PARAMETER; + + if (do_fsync()) + return fsync_create_event( handle, access, attr, type, state ); + + if (do_esync()) + return esync_create_event( handle, access, attr, type, state ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_event ) @@ -408,6 +446,12 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_fsync()) + return fsync_open_event( handle, access, attr ); + + if (do_esync()) + return esync_open_event( handle, access, attr ); + SERVER_START_REQ( open_event ) { req->access = access; @@ -428,8 +472,15 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT */ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_fsync()) + return fsync_set_event( handle, prev_state ); + + if (do_esync()) + return esync_set_event( handle ); + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); @@ -447,8 +498,16 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) */ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_fsync()) + return fsync_reset_event( handle, prev_state ); + + if (do_esync()) + return esync_reset_event( handle ); + + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); @@ -478,6 +537,12 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) { unsigned int ret; + if (do_fsync()) + return fsync_pulse_event( handle, prev_state ); + + if (do_esync()) + return esync_pulse_event( handle ); + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); @@ -509,6 +574,12 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, if (len != sizeof(EVENT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_event( handle, info, ret_len ); + + if (do_esync()) + return esync_query_event( handle, info, ret_len ); + SERVER_START_REQ( query_event ) { req->handle = wine_server_obj_handle( handle ); @@ -535,6 +606,13 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT struct object_attributes *objattr; *handle = 0; + + if (do_fsync()) + return fsync_create_mutex( handle, access, attr, owned ); + + if (do_esync()) + return esync_create_mutex( handle, access, attr, owned ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_mutex ) @@ -562,6 +640,12 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_fsync()) + return fsync_open_mutex( handle, access, attr ); + + if (do_esync()) + return esync_open_mutex( handle, access, attr ); + SERVER_START_REQ( open_mutex ) { req->access = access; @@ -584,6 +668,12 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count ) { unsigned int ret; + if (do_fsync()) + return fsync_release_mutex( handle, prev_count ); + + if (do_esync()) + return esync_release_mutex( handle, prev_count ); + SERVER_START_REQ( release_mutex ) { req->handle = wine_server_obj_handle( handle ); @@ -614,6 +704,12 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class, if (len != sizeof(MUTANT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_mutex( handle, info, ret_len ); + + if (do_esync()) + return esync_query_mutex( handle, info, ret_len ); + SERVER_START_REQ( query_mutex ) { req->handle = wine_server_obj_handle( handle ); @@ -1472,6 +1568,20 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1; + if (do_fsync()) + { + NTSTATUS ret = fsync_wait_objects( count, handles, wait_any, alertable, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + + if (do_esync()) + { + NTSTATUS ret = esync_wait_objects( count, handles, wait_any, alertable, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + if (alertable) flags |= SELECT_ALERTABLE; select_op.wait.op = wait_any ? SELECT_WAIT : SELECT_WAIT_ALL; for (i = 0; i < count; i++) select_op.wait.handles[i] = wine_server_obj_handle( handles[i] ); @@ -1497,6 +1607,12 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait, select_op_t select_op; UINT flags = SELECT_INTERRUPTIBLE; + if (do_fsync()) + return fsync_signal_and_wait( signal, wait, alertable, timeout ); + + if (do_esync()) + return esync_signal_and_wait( signal, wait, alertable, timeout ); + if (!signal) return STATUS_INVALID_HANDLE; if (alertable) flags |= SELECT_ALERTABLE; @@ -1513,7 +1629,17 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait, NTSTATUS WINAPI NtYieldExecution(void) { #ifdef HAVE_SCHED_YIELD +#ifdef RUSAGE_THREAD + struct rusage u1, u2; + int ret; + + ret = getrusage( RUSAGE_THREAD, &u1 ); +#endif sched_yield(); +#ifdef RUSAGE_THREAD + if (!ret) ret = getrusage( RUSAGE_THREAD, &u2 ); + if (!ret && u1.ru_nvcsw == u2.ru_nvcsw && u1.ru_nivcsw == u2.ru_nivcsw) return STATUS_NO_YIELD_PERFORMED; +#endif return STATUS_SUCCESS; #else return STATUS_NO_YIELD_PERFORMED; @@ -1527,7 +1653,24 @@ NTSTATUS WINAPI NtYieldExecution(void) NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeout ) { /* if alertable, we need to query the server */ - if (alertable) return server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, timeout ); + if (alertable) + { + if (do_fsync()) + { + NTSTATUS ret = fsync_wait_objects( 0, NULL, TRUE, TRUE, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + + if (do_esync()) + { + NTSTATUS ret = esync_wait_objects( 0, NULL, TRUE, TRUE, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + + return server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, timeout ); + } if (!timeout || timeout->QuadPart == TIMEOUT_INFINITE) /* sleep forever */ { @@ -1885,6 +2028,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * IO_STATUS_BLOCK *io, LARGE_INTEGER *timeout ) { unsigned int status; + int waited = 0; TRACE( "(%p, %p, %p, %p, %p)\n", handle, key, value, io, timeout ); @@ -1893,6 +2037,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * SERVER_START_REQ( remove_completion ) { req->handle = wine_server_obj_handle( handle ); + req->waited = waited; if (!(status = wine_server_call( req ))) { *key = reply->ckey; @@ -1905,6 +2050,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * if (status != STATUS_PENDING) return status; status = NtWaitForSingleObject( handle, FALSE, timeout ); if (status != WAIT_OBJECT_0) return status; + waited = 1; } } @@ -1916,6 +2062,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM ULONG *written, LARGE_INTEGER *timeout, BOOLEAN alertable ) { unsigned int status; + int waited = 0; ULONG i = 0; TRACE( "%p %p %u %p %p %u\n", handle, info, (int)count, written, timeout, alertable ); @@ -1927,6 +2074,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM SERVER_START_REQ( remove_completion ) { req->handle = wine_server_obj_handle( handle ); + req->waited = waited; if (!(status = wine_server_call( req ))) { info[i].CompletionKey = reply->ckey; @@ -1946,6 +2094,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM } status = NtWaitForSingleObject( handle, alertable, timeout ); if (status != WAIT_OBJECT_0) break; + waited = 1; } *written = i ? i : 1; return status; @@ -2571,6 +2720,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEGER *timeout ) { union tid_alert_entry *entry = get_tid_alert_entry( NtCurrentTeb()->ClientId.UniqueThread ); + BOOL waited = FALSE; NTSTATUS status; TRACE( "%p %s\n", address, debugstr_timeout( timeout ) ); @@ -2606,8 +2756,15 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG else ret = futex_wait( futex, 0, NULL ); + if (!timeout || timeout->QuadPart) + waited = TRUE; + if (ret == -1 && errno == ETIMEDOUT) return STATUS_TIMEOUT; } + + if (alert_simulate_sched_quantum && waited) + usleep(0); + return STATUS_ALERTED; } #endif diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 879a5893758..0e77e7d7b14 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -238,6 +239,13 @@ static unsigned int logical_proc_info_ex_size, logical_proc_info_ex_alloc_size; static pthread_mutex_t timezone_mutex = PTHREAD_MUTEX_INITIALIZER; +static struct +{ + struct cpu_topology_override mapping; + ULONG_PTR siblings_mask[MAXIMUM_PROCESSORS]; +} +cpu_override; + /******************************************************************************* * Architecture specific feature detection for CPUs * @@ -247,6 +255,64 @@ static pthread_mutex_t timezone_mutex = PTHREAD_MUTEX_INITIALIZER; #if defined(__i386__) || defined(__x86_64__) BOOL xstate_compaction_enabled = FALSE; +UINT64 xstate_supported_features_mask; +UINT64 xstate_features_size; + +static int xstate_feature_offset[64]; +static int xstate_feature_size[64]; +static UINT64 xstate_aligned_features; + +static int next_xstate_offset( int off, UINT64 compaction_mask, int feature_idx ) +{ + const UINT64 feature_mask = (UINT64)1 << feature_idx; + + if (!compaction_mask) return xstate_feature_offset[feature_idx + 1] - sizeof(XSAVE_FORMAT); + + if (compaction_mask & feature_mask) off += xstate_feature_size[feature_idx]; + if (xstate_aligned_features & (feature_mask << 1)) + off = (off + 63) & ~63; + return off; +} + +unsigned int xstate_get_size( UINT64 compaction_mask, UINT64 mask ) +{ + unsigned int i; + int off; + + mask >>= 2; + off = sizeof(XSAVE_AREA_HEADER); + i = 2; + while (mask) + { + if (mask == 1) return off + xstate_feature_size[i]; + off = next_xstate_offset( off, compaction_mask, i ); + mask >>= 1; + ++i; + } + return off; +} + +void copy_xstate( XSAVE_AREA_HEADER *dst, XSAVE_AREA_HEADER *src, UINT64 mask ) +{ + unsigned int i; + int src_off, dst_off; + + mask &= xstate_extended_features() & src->Mask; + if (src->CompactionMask) mask &= src->CompactionMask; + if (dst->CompactionMask) mask &= dst->CompactionMask; + dst->Mask = (dst->Mask & ~xstate_extended_features()) | mask; + mask >>= 2; + src_off = dst_off = sizeof(XSAVE_AREA_HEADER); + i = 2; + while (1) + { + if (mask & 1) memcpy( (char *)dst + dst_off, (char *)src + src_off, xstate_feature_size[i] ); + if (!(mask >>= 1)) break; + src_off = next_xstate_offset( src_off, src->CompactionMask, i ); + dst_off = next_xstate_offset( dst_off, dst->CompactionMask, i ); + ++i; + } +} #define AUTH 0x68747541 /* "Auth" */ #define ENTI 0x69746e65 /* "enti" */ @@ -287,6 +353,21 @@ __ASM_GLOBAL_FUNC( do_cpuid, "ret" ) #endif +extern UINT64 do_xgetbv( unsigned int cx); +#ifdef __i386__ +__ASM_GLOBAL_FUNC( do_xgetbv, + "movl 4(%esp),%ecx\n\t" + "xgetbv\n\t" + "ret" ) +#else +__ASM_GLOBAL_FUNC( do_xgetbv, + "movl %edi,%ecx\n\t" + "xgetbv\n\t" + "shlq $32,%rdx\n\t" + "orq %rdx,%rax\n\t" + "ret" ) +#endif + #ifdef __i386__ extern int have_cpuid(void); __ASM_GLOBAL_FUNC( have_cpuid, @@ -345,8 +426,11 @@ static void get_cpuid_name( char *buffer ) static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) { + static const ULONG64 wine_xstate_supported_features = 0xff; /* XSTATE_AVX, XSTATE_MPX_BNDREGS, XSTATE_MPX_BNDCSR, + * XSTATE_AVX512_KMASK, XSTATE_AVX512_ZMM_H, XSTATE_AVX512_ZMM */ unsigned int regs[4], regs2[4], regs3[4]; ULONGLONG features; + unsigned int i; #if defined(__i386__) info->ProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL; @@ -396,6 +480,25 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) { do_cpuid( 0x0000000d, 1, regs3 ); /* get XSAVE details */ if (regs3[0] & 2) xstate_compaction_enabled = TRUE; + + do_cpuid( 0x0000000d, 0, regs3 ); /* get user xstate features */ + xstate_supported_features_mask = ((ULONG64)regs3[3] << 32) | regs3[0]; + xstate_supported_features_mask &= do_xgetbv( 0 ) & wine_xstate_supported_features; + TRACE("xstate_supported_features_mask %#llx.\n", (long long)xstate_supported_features_mask); + for (i = 2; i < 64; ++i) + { + if (!(xstate_supported_features_mask & ((ULONG64)1 << i))) continue; + do_cpuid( 0x0000000d, i, regs3 ); /* get user xstate features */ + xstate_feature_offset[i] = regs3[1]; + xstate_feature_size[i] = regs3[0]; + if (regs3[2] & 2) xstate_aligned_features |= (ULONG64)1 << i; + TRACE("xstate[%d] offset %d, size %d, aligned %d.\n", i, xstate_feature_offset[i], xstate_feature_size[i], !!(regs3[2] & 2)); + } + xstate_features_size = xstate_get_size( xstate_compaction_enabled ? 0x8000000000000000 + | xstate_supported_features_mask : 0, xstate_supported_features_mask ) + - sizeof(XSAVE_AREA_HEADER); + xstate_features_size = (xstate_features_size + 15) & ~15; + TRACE("xstate_features_size %lld.\n", (long long)xstate_features_size); } if (regs[1] == AUTH && regs[3] == ENTI && regs[2] == CAMD) @@ -566,6 +669,150 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) #endif /* End architecture specific feature detection for CPUs */ +static void fill_performance_core_info(void); +static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask); + +static void fill_cpu_override(unsigned int host_cpu_count) +{ + const char *env_override = getenv("WINE_CPU_TOPOLOGY"); + BOOL smt = FALSE; + unsigned int i; + char *s; + + if (!env_override) + return; + + cpu_override.mapping.cpu_count = strtol(env_override, &s, 10); + if (s == env_override) + goto error; + + if (!cpu_override.mapping.cpu_count || cpu_override.mapping.cpu_count > MAXIMUM_PROCESSORS) + { + ERR("Invalid logical CPU count %u, limit %u.\n", cpu_override.mapping.cpu_count, MAXIMUM_PROCESSORS); + goto error; + } + + if (!*s) + { + /* Auto assign given number of logical CPUs. */ + static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; + char name[MAX_PATH]; + unsigned int attempt, count, j; + ULONG_PTR masks[MAXIMUM_PROCESSORS]; + + if (cpu_override.mapping.cpu_count >= host_cpu_count) + { + TRACE( "Override cpu count %u >= host cpu count %u.\n", cpu_override.mapping.cpu_count, host_cpu_count ); + cpu_override.mapping.cpu_count = 0; + return; + } + + fill_performance_core_info(); + + for (i = 0; i < host_cpu_count; ++i) + { + snprintf(name, sizeof(name), core_info, i, "thread_siblings"); + masks[i] = 0; + sysfs_parse_bitmap(name, &masks[i]); + } + for (attempt = 0; attempt < 3; ++attempt) + { + count = 0; + for (i = 0; i < host_cpu_count && count < cpu_override.mapping.cpu_count; ++i) + { + if (attempt < 2 && performance_cores_capacity) + { + if (i / 32 >= performance_cores_capacity) break; + if (!(performance_cores[i / 32] & (1 << (i % 32)))) goto skip_cpu; + } + cpu_override.mapping.host_cpu_id[count] = i; + cpu_override.siblings_mask[count] = (ULONG_PTR)1 << count; + for (j = 0; j < count; ++j) + { + if (!(masks[cpu_override.mapping.host_cpu_id[j]] & masks[i])) continue; + if (attempt < 1) goto skip_cpu; + cpu_override.siblings_mask[j] |= (ULONG_PTR)1 << count; + cpu_override.siblings_mask[count] |= (ULONG_PTR)1 << j; + } + ++count; +skip_cpu: + ; + } + if (count == cpu_override.mapping.cpu_count) break; + } + assert( count == cpu_override.mapping.cpu_count ); + goto done; + } + + if (tolower(*s) == 's') + { + cpu_override.mapping.cpu_count *= 2; + if (cpu_override.mapping.cpu_count > MAXIMUM_PROCESSORS) + { + ERR("Logical CPU count exceeds limit %u.\n", MAXIMUM_PROCESSORS); + goto error; + } + smt = TRUE; + ++s; + } + if (*s != ':') + goto error; + ++s; + for (i = 0; i < cpu_override.mapping.cpu_count; ++i) + { + char *next; + + if (i) + { + if (*s != ',') + { + if (!*s) + ERR("Incomplete host CPU mapping string, %u CPUs mapping required.\n", + cpu_override.mapping.cpu_count); + goto error; + } + ++s; + } + + cpu_override.mapping.host_cpu_id[i] = strtol(s, &next, 10); + if (smt) cpu_override.siblings_mask[i] = (ULONG_PTR)3 << (i & ~1); + else cpu_override.siblings_mask[i] = (ULONG_PTR)1 << i; + if (next == s) + goto error; + if (cpu_override.mapping.host_cpu_id[i] >= host_cpu_count) + { + ERR("Invalid host CPU index %u (host_cpu_count %u).\n", + cpu_override.mapping.host_cpu_id[i], host_cpu_count); + goto error; + } + s = next; + } + if (*s) + goto error; + +done: + if (ERR_ON(ntdll)) + { + MESSAGE("wine: overriding CPU configuration, %u logical CPUs, host CPUs ", cpu_override.mapping.cpu_count); + for (i = 0; i < cpu_override.mapping.cpu_count; ++i) + { + if (i) + MESSAGE(","); + MESSAGE("%u", cpu_override.mapping.host_cpu_id[i]); + } + MESSAGE(".\n"); + } + return; +error: + cpu_override.mapping.cpu_count = 0; + ERR("Invalid WINE_CPU_TOPOLOGY string %s (%s).\n", debugstr_a(env_override), debugstr_a(s)); +} + +struct cpu_topology_override *get_cpu_topology_override(void) +{ + return cpu_override.mapping.cpu_count ? &cpu_override.mapping : NULL; +} + static BOOL grow_logical_proc_buf(void) { SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; @@ -617,6 +864,7 @@ static DWORD count_bits( ULONG_PTR mask ) static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWORD id, ULONG_PTR mask ) { SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *dataex; + unsigned int phys_cpu_id; unsigned int ofs = 0; while (ofs < logical_proc_info_ex_size) @@ -646,8 +894,10 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, dataex->Processor.Flags = count_bits( mask ) > 1 ? LTP_PC_SMT : 0; else dataex->Processor.Flags = 0; - if (rel == RelationProcessorCore && id / 32 < performance_cores_capacity) - dataex->Processor.EfficiencyClass = (performance_cores[id / 32] >> (id % 32)) & 1; + + phys_cpu_id = cpu_override.mapping.cpu_count ? cpu_override.mapping.host_cpu_id[id] : id; + if (rel == RelationProcessorCore && phys_cpu_id / 32 < performance_cores_capacity) + dataex->Processor.EfficiencyClass = (performance_cores[phys_cpu_id / 32] >> (phys_cpu_id % 32)) & 1; else dataex->Processor.EfficiencyClass = 0; dataex->Processor.GroupCount = 1; @@ -859,6 +1109,8 @@ static void fill_performance_core_info(void) char op = ','; ULONG *p; + if (performance_cores_capacity) return; + fpcore_list = fopen("/sys/devices/cpu_core/cpus", "r"); if (!fpcore_list) return; @@ -895,11 +1147,13 @@ static NTSTATUS create_logical_proc_info(void) static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap"; - + const char *env_fake_logical_cores = getenv("WINE_LOGICAL_CPUS_AS_CORES"); + BOOL fake_logical_cpus_as_cores = env_fake_logical_cores && atoi(env_fake_logical_cores); FILE *fcpu_list, *fnuma_list, *f; unsigned int beg, end, i, j, r, num_cpus = 0, max_cpus = 0; char op, name[MAX_PATH]; ULONG_PTR all_cpus_mask = 0; + unsigned int cpu_id; /* On systems with a large number of CPU cores (32 or 64 depending on 32-bit or 64-bit), * we have issues parsing processor information: @@ -926,6 +1180,12 @@ static NTSTATUS create_logical_proc_info(void) if (op == '-') fscanf(fcpu_list, "%u%c ", &end, &op); else end = beg; + if (cpu_override.mapping.cpu_count) + { + beg = 0; + end = cpu_override.mapping.cpu_count - 1; + } + for(i = beg; i <= end; i++) { unsigned int phys_core = 0; @@ -937,7 +1197,7 @@ static NTSTATUS create_logical_proc_info(void) continue; } - snprintf(name, sizeof(name), core_info, i, "physical_package_id"); + snprintf(name, sizeof(name), core_info, cpu_override.mapping.cpu_count ? cpu_override.mapping.host_cpu_id[i] : i, "physical_package_id"); f = fopen(name, "r"); if (f) { @@ -964,19 +1224,34 @@ static NTSTATUS create_logical_proc_info(void) /* Mask of logical threads sharing same physical core in kernel core numbering. */ snprintf(name, sizeof(name), core_info, i, "thread_siblings"); - if(!sysfs_parse_bitmap(name, &thread_mask)) thread_mask = 1<NumberOfProcessors = num; + + fill_cpu_override(num); + + peb->NumberOfProcessors = cpu_override.mapping.cpu_count + ? cpu_override.mapping.cpu_count : num; get_cpuinfo( &cpu_info ); TRACE( "<- CPU arch %d, level %d, rev %d, features 0x%x\n", (int)cpu_info.ProcessorArchitecture, (int)cpu_info.ProcessorLevel, @@ -1977,7 +2274,15 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info ) mem_available = value * 1024; } fclose(fp); + totalram -= min( totalram, ram_reporting_bias ); if (mem_available) freeram = mem_available; + if ((long long)freeram >= ram_reporting_bias) freeram -= ram_reporting_bias; + else + { + long long bias = ram_reporting_bias - freeram; + freeswap -= min( bias, freeswap ); + freeram = 0; + } } } #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || \ @@ -3194,6 +3499,43 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, break; } + case SystemProcessIdInformation: /* 88 */ + { + SYSTEM_PROCESS_ID_INFORMATION *id = info; + UNICODE_STRING *str = &id->ImageName; + BOOL valid_buffer; + + len = sizeof(*id); + if (len > size) ret = STATUS_INFO_LENGTH_MISMATCH; + else if (id->ImageName.Length) ret = STATUS_INVALID_PARAMETER; + else if (!id->ProcessId) ret = STATUS_INVALID_CID; + + if (ret) break; + + valid_buffer = virtual_check_buffer_for_write( str->Buffer, str->MaximumLength ); + SERVER_START_REQ( get_process_image_name ) + { + req->pid = HandleToULong( id->ProcessId ); + if (valid_buffer) wine_server_set_reply( req, str->Buffer, str->MaximumLength ); + ret = wine_server_call( req ); + if (ret == STATUS_BUFFER_TOO_SMALL) ret = STATUS_INFO_LENGTH_MISMATCH; + if (ret == STATUS_SUCCESS && reply->len + 2 > str->MaximumLength) ret = STATUS_INFO_LENGTH_MISMATCH; + if (ret == STATUS_SUCCESS || ret == STATUS_INFO_LENGTH_MISMATCH) str->MaximumLength = reply->len + 2; + if (!ret && valid_buffer) + { + str->Length = reply->len; + str->Buffer[reply->len / 2] = 0; + } + else if (!valid_buffer && (!ret || ret == STATUS_INFO_LENGTH_MISMATCH)) + { + str->Length = reply->len; + ret = STATUS_ACCESS_VIOLATION; + } + } + SERVER_END_REQ; + break; + } + case SystemDynamicTimeZoneInformation: /* 102 */ { RTL_DYNAMIC_TIME_ZONE_INFORMATION tz; @@ -3461,7 +3803,10 @@ NTSTATUS WINAPI NtSystemDebugControl( SYSDBG_COMMAND command, void *in_buff, ULO { FIXME( "(%d, %p, %d, %p, %d, %p), stub\n", command, in_buff, (int)in_len, out_buff, (int)out_len, retlen ); - return STATUS_NOT_IMPLEMENTED; + + if (is_wow64()) return STATUS_NOT_IMPLEMENTED; + + return STATUS_DEBUGGER_INACTIVE; } diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 9e84ec3cc96..c3ab1317295 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -158,12 +158,33 @@ void fpu_to_fpux( XMM_SAVE_AREA32 *fpux, const I386_FLOATING_SAVE_AREA *fpu ) } +/*********************************************************************** + * validate_context_xstate + */ +BOOL validate_context_xstate( CONTEXT *context ) +{ + CONTEXT_EX *context_ex; + + if (!((context->ContextFlags & 0x40) && xstate_extended_features())) return TRUE; + + context_ex = (CONTEXT_EX *)(context + 1); + + if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || + context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) + return FALSE; + + if (((ULONG_PTR)context_ex + context_ex->XState.Offset) & 63) return FALSE; + + return TRUE; +} + + /*********************************************************************** * get_server_context_flags */ static unsigned int get_server_context_flags( const void *context, USHORT machine ) { - unsigned int flags, ret = 0; + unsigned int flags = 0, ret = 0; switch (machine) { @@ -201,6 +222,7 @@ static unsigned int get_server_context_flags( const void *context, USHORT machin if (flags & CONTEXT_ARM64_DEBUG_REGISTERS) ret |= SERVER_CTX_DEBUG_REGISTERS; break; } + if (flags & CONTEXT_EXCEPTION_REQUEST) ret |= SERVER_CTX_EXEC_SPACE; return ret; } @@ -215,15 +237,45 @@ static unsigned int get_native_context_flags( USHORT native_machine, USHORT wow_ switch (MAKELONG( native_machine, wow_machine )) { case MAKELONG( IMAGE_FILE_MACHINE_AMD64, IMAGE_FILE_MACHINE_I386 ): - return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT | SERVER_CTX_YMM_REGISTERS; + return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT | SERVER_CTX_YMM_REGISTERS | SERVER_CTX_EXEC_SPACE; case MAKELONG( IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_ARMNT ): - return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT; + return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT | SERVER_CTX_EXEC_SPACE; default: - return 0; + return SERVER_CTX_EXEC_SPACE; } } +/*********************************************************************** + * xstate_to_server + * + * Copy xstate to the server format. + */ +static void xstate_to_server( context_t *to, const CONTEXT_EX *xctx ) +{ + const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); + + if (xs->CompactionMask && !(xs->CompactionMask & 4)) return; + to->flags |= SERVER_CTX_YMM_REGISTERS; + if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); +} + + +/*********************************************************************** + * exception_request_flags_to_server + * + * Copy exception reporting flags to the server format. + */ +static void exception_request_flags_to_server( context_t *to, DWORD context_flags ) +{ + if (!(context_flags & CONTEXT_EXCEPTION_REPORTING)) return; + to->flags |= SERVER_CTX_EXEC_SPACE; + if (context_flags & CONTEXT_SERVICE_ACTIVE) to->exec_space.space.space = EXEC_SPACE_SYSCALL; + else if (context_flags & CONTEXT_EXCEPTION_ACTIVE) to->exec_space.space.space = EXEC_SPACE_EXCEPTION; + else to->exec_space.space.space = EXEC_SPACE_USERMODE; +} + + /*********************************************************************** * context_to_server * @@ -300,13 +352,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void memcpy( to->ext.i386_regs, from->ExtendedRegisters, sizeof(to->ext.i386_regs) ); } if (flags & CONTEXT_I386_XSTATE) - { - const CONTEXT_EX *xctx = (const CONTEXT_EX *)(from + 1); - const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); - - to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); - } + xstate_to_server( to, (const CONTEXT_EX *)(from + 1) ); + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -364,13 +411,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void fpu_to_fpux( (XMM_SAVE_AREA32 *)to->fp.x86_64_regs.fpregs, &from->FloatSave ); } if (flags & CONTEXT_I386_XSTATE) - { - const CONTEXT_EX *xctx = (const CONTEXT_EX *)(from + 1); - const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); - - to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); - } + xstate_to_server( to, (const CONTEXT_EX *)(from + 1) ); + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -431,13 +473,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void to->debug.x86_64_regs.dr7 = from->Dr7; } if (flags & CONTEXT_AMD64_XSTATE) - { - const CONTEXT_EX *xctx = (const CONTEXT_EX *)(from + 1); - const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); - - to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); - } + xstate_to_server( to, (const CONTEXT_EX *)(from + 1) ); + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -502,13 +539,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void to->debug.i386_regs.dr7 = from->Dr7; } if (flags & CONTEXT_AMD64_XSTATE) - { - const CONTEXT_EX *xctx = (const CONTEXT_EX *)(from + 1); - const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); - - to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); - } + xstate_to_server( to, (const CONTEXT_EX *)(from + 1) ); + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -556,6 +588,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void for (i = 0; i < ARM_MAX_WATCHPOINTS; i++) to->debug.arm_regs.wvr[i] = from->Wvr[i]; for (i = 0; i < ARM_MAX_WATCHPOINTS; i++) to->debug.arm_regs.wcr[i] = from->Wcr[i]; } + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -597,6 +630,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void for (i = 0; i < ARM64_MAX_WATCHPOINTS; i++) to->debug.arm64_regs.wcr[i] = from->Wcr[i]; for (i = 0; i < ARM64_MAX_WATCHPOINTS; i++) to->debug.arm64_regs.wvr[i] = from->Wvr[i]; } + exception_request_flags_to_server( to, flags ); return STATUS_SUCCESS; } @@ -610,6 +644,48 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void } +/*********************************************************************** + * xstate_from_server + * + * Copy xstate from the server format. + */ +static void xstate_from_server( CONTEXT_EX *xctx, const context_t *from ) +{ + XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset); + unsigned int i; + + xs->Mask &= ~(ULONG64)4; + + if (xs->CompactionMask) + { + xs->CompactionMask &= ~(UINT64)3; + if (!(xs->CompactionMask & 4)) return; + } + + for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) + { + if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; + memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); + xs->Mask |= 4; + break; + } +} + + +/*********************************************************************** + * exception_request_flags_from_server + * + * Copy exception reporting flags from the server format. + */ +static void exception_request_flags_from_server( DWORD *context_flags, const context_t *from ) +{ + if (!(*context_flags & CONTEXT_EXCEPTION_REQUEST) || !(from->flags & SERVER_CTX_EXEC_SPACE)) return; + *context_flags = (*context_flags & ~(CONTEXT_SERVICE_ACTIVE | CONTEXT_EXCEPTION_ACTIVE)) | CONTEXT_EXCEPTION_REPORTING; + if (from->exec_space.space.space == EXEC_SPACE_SYSCALL) *context_flags |= CONTEXT_SERVICE_ACTIVE; + else if (from->exec_space.space.space == EXEC_SPACE_EXCEPTION) *context_flags |= CONTEXT_EXCEPTION_ACTIVE; +} + + /*********************************************************************** * context_from_server * @@ -683,20 +759,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma memcpy( to->ExtendedRegisters, from->ext.i386_regs, sizeof(to->ExtendedRegisters) ); } if ((from->flags & SERVER_CTX_YMM_REGISTERS) && (to_flags & CONTEXT_I386_XSTATE)) - { - CONTEXT_EX *xctx = (CONTEXT_EX *)(to + 1); - XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset); - - xs->Mask &= ~4; - if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) - { - if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; - memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); - xs->Mask |= 4; - break; - } - } + xstate_from_server( (CONTEXT_EX *)(to + 1), from ); + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -757,20 +821,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma to->Dr7 = from->debug.x86_64_regs.dr7; } if ((from->flags & SERVER_CTX_YMM_REGISTERS) && (to_flags & CONTEXT_I386_XSTATE)) - { - CONTEXT_EX *xctx = (CONTEXT_EX *)(to + 1); - XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset); - - xs->Mask &= ~4; - if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) - { - if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; - memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); - xs->Mask |= 4; - break; - } - } + xstate_from_server( (CONTEXT_EX *)(to + 1), from ); + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -832,20 +884,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma to->Dr7 = from->debug.x86_64_regs.dr7; } if ((from->flags & SERVER_CTX_YMM_REGISTERS) && (to_flags & CONTEXT_AMD64_XSTATE)) - { - CONTEXT_EX *xctx = (CONTEXT_EX *)(to + 1); - XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset); - - xs->Mask &= ~4; - if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) - { - if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; - memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); - xs->Mask |= 4; - break; - } - } + xstate_from_server( (CONTEXT_EX *)(to + 1), from ); + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -914,20 +954,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma to->Dr7 = from->debug.i386_regs.dr7; } if ((from->flags & SERVER_CTX_YMM_REGISTERS) && (to_flags & CONTEXT_AMD64_XSTATE)) - { - CONTEXT_EX *xctx = (CONTEXT_EX *)(to + 1); - XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset); - - xs->Mask &= ~4; - if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) - { - if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; - memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); - xs->Mask |= 4; - break; - } - } + xstate_from_server( (CONTEXT_EX *)(to + 1), from ); + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -975,6 +1003,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma for (i = 0; i < ARM_MAX_WATCHPOINTS; i++) to->Wvr[i] = from->debug.arm_regs.wvr[i]; for (i = 0; i < ARM_MAX_WATCHPOINTS; i++) to->Wcr[i] = from->debug.arm_regs.wcr[i]; } + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -1016,6 +1045,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma for (i = 0; i < ARM64_MAX_WATCHPOINTS; i++) to->Wcr[i] = from->debug.arm64_regs.wcr[i]; for (i = 0; i < ARM64_MAX_WATCHPOINTS; i++) to->Wvr[i] = from->debug.arm64_regs.wvr[i]; } + exception_request_flags_from_server( &to->ContextFlags, from ); return STATUS_SUCCESS; } @@ -1476,7 +1506,7 @@ void wait_suspend( CONTEXT *context ) * * Send an EXCEPTION_DEBUG_EVENT event to the debugger. */ -NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) +NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance, BOOL exception ) { unsigned int ret; DWORD i; @@ -1513,6 +1543,8 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c select_op.wait.handles[0] = handle; contexts_to_server( server_contexts, context ); + server_contexts[0].flags |= SERVER_CTX_EXEC_SPACE; + server_contexts[0].exec_space.space.space = exception ? EXEC_SPACE_EXCEPTION : EXEC_SPACE_SYSCALL; server_select( &select_op, offsetof( select_op_t, wait.handles[1] ), SELECT_INTERRUPTIBLE, TIMEOUT_INFINITE, server_contexts, NULL ); @@ -1535,7 +1567,7 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c */ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) { - NTSTATUS status = send_debug_event( rec, context, first_chance ); + NTSTATUS status = send_debug_event( rec, context, first_chance, !(is_win64 || is_wow64() || is_old_wow64()) ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) return NtContinue( context, FALSE ); @@ -1590,19 +1622,40 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access, /****************************************************************************** * NtSuspendThread (NTDLL.@) */ -NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *count ) +NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *ret_count ) { - unsigned int ret; + BOOL self = FALSE; + unsigned int ret, count = 0; + HANDLE wait_handle = NULL; SERVER_START_REQ( suspend_thread ) { req->handle = wine_server_obj_handle( handle ); - if (!(ret = wine_server_call( req ))) + if (!(ret = wine_server_call( req )) || ret == STATUS_PENDING) { - if (count) *count = reply->count; + self = reply->count & 0x80000000; + count = reply->count & 0x7fffffff;; + wait_handle = wine_server_ptr_handle( reply->wait_handle ); } } SERVER_END_REQ; + + if (self) usleep( 0 ); + + if (ret == STATUS_PENDING && wait_handle) + { + NtWaitForSingleObject( wait_handle, FALSE, NULL ); + + SERVER_START_REQ( suspend_thread ) + { + req->handle = wine_server_obj_handle( handle ); + req->waited_handle = wine_server_obj_handle( wait_handle ); + ret = wine_server_call( req ); + } + SERVER_END_REQ; + } + + if (!ret && ret_count) *ret_count = count; return ret; } @@ -1879,7 +1932,7 @@ static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name ) #ifdef linux unsigned int status; char path[64], nameA[64]; - int unix_pid, unix_tid, len, fd; + int unix_pid = -1, unix_tid = -1, len, fd; SERVER_START_REQ( get_thread_times ) { @@ -2471,7 +2524,20 @@ ULONG WINAPI NtGetCurrentProcessorNumber(void) #if defined(__linux__) && defined(__NR_getcpu) int res = syscall(__NR_getcpu, &processor, NULL, NULL); - if (res != -1) return processor; + if (res != -1) + { + struct cpu_topology_override *override = get_cpu_topology_override(); + unsigned int i; + + if (!override) + return processor; + + for (i = 0; i < override->cpu_count; ++i) + if (override->host_cpu_id[i] == processor) + return i; + + WARN("Thread is running on processor which is not in the defined override.\n"); + } #endif if (peb->NumberOfProcessors > 1) diff --git a/dlls/ntdll/unix/uffd_tmp_defs.h b/dlls/ntdll/unix/uffd_tmp_defs.h new file mode 100644 index 00000000000..f79c34c6145 --- /dev/null +++ b/dlls/ntdll/unix/uffd_tmp_defs.h @@ -0,0 +1,75 @@ +#ifndef __UFFD_TMP_DEFS__ +#define __UFFD_TMP_DEFS__ + +#ifdef __x86_64__ +#define __NR_userfaultfd 323 +#else +#define __NR_userfaultfd 374 +#endif + +#ifndef UFFD_FEATURE_WP_ASYNC +#define UFFD_FEATURE_WP_UNPOPULATED (1<<13) +#define UFFD_FEATURE_WP_ASYNC (1<<15) +#endif + +#ifndef PAGEMAP_SCAN +/* Pagemap ioctl */ +#define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg) + +/* Bits are set in flags of the page_region and masks in pm_scan_args */ +#define PAGE_IS_WPALLOWED (1 << 0) +#define PAGE_IS_WRITTEN (1 << 1) +#define PAGE_IS_FILE (1 << 2) +#define PAGE_IS_PRESENT (1 << 3) +#define PAGE_IS_SWAPPED (1 << 4) +#define PAGE_IS_PFNZERO (1 << 5) +#define PAGE_IS_HUGE (1 << 6) +/* + * struct page_region - Page region with flags + * @start: Start of the region + * @end: End of the region (exclusive) + * @categories: PAGE_IS_* category bitmask for the region + */ +struct page_region { + __u64 start; + __u64 end; + __u64 categories; +}; + +/* Flags for PAGEMAP_SCAN ioctl */ +#define PM_SCAN_WP_MATCHING (1 << 0) /* Write protect the pages matched. */ +#define PM_SCAN_CHECK_WPASYNC (1 << 1) /* Abort the scan when a non-WP-enabled page is found. */ + +/* + * struct pm_scan_arg - Pagemap ioctl argument + * @size: Size of the structure + * @flags: Flags for the IOCTL + * @start: Starting address of the region + * @end: Ending address of the region + * @walk_end Address where the scan stopped (written by kernel). + * walk_end == end informs that the scan completed on entire range. + * @vec: Address of page_region struct array for output + * @vec_len: Length of the page_region struct array + * @max_pages: Optional limit for number of returned pages (0 = disabled) + * @category_inverted: PAGE_IS_* categories which values match if 0 instead of 1 + * @category_mask: Skip pages for which any category doesn't match + * @category_anyof_mask: Skip pages for which no category matches + * @return_mask: PAGE_IS_* categories that are to be reported in `page_region`s returned + */ +struct pm_scan_arg { + __u64 size; + __u64 flags; + __u64 start; + __u64 end; + __u64 walk_end; + __u64 vec; + __u64 vec_len; + __u64 max_pages; + __u64 category_inverted; + __u64 category_mask; + __u64 category_anyof_mask; + __u64 return_mask; +}; +#endif + +#endif diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 07f2724eac7..2b62d5c7754 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -93,6 +93,8 @@ struct ntdll_thread_data { void *cpu_data[16]; /* reserved for CPU-specific data */ void *kernel_stack; /* stack for thread startup and kernel syscalls */ + int esync_apc_fd; /* fd to wait on for user APCs */ + int *fsync_apc_futex; int request_fd; /* fd for sending server requests */ int reply_fd; /* fd for receiving server replies */ int wait_fd[2]; /* fd for sleeping server requests */ @@ -124,8 +126,9 @@ static const SIZE_T page_size = 0x1000; static const SIZE_T teb_size = 0x3800; /* TEB64 + TEB32 + debug info */ static const SIZE_T signal_stack_mask = 0xffff; static const SIZE_T signal_stack_size = 0x10000 - 0x3800; -static const SIZE_T kernel_stack_size = 0x100000; -static const SIZE_T min_kernel_stack = 0x2000; +extern SIZE_T kernel_stack_size; +static const SIZE_T kernel_stack_guard_size = 0x1000; +static const SIZE_T min_kernel_stack = 0x3000; static const LONG teb_offset = 0x2000; #define FILE_WRITE_TO_END_OF_FILE ((LONGLONG)-1) @@ -167,6 +170,8 @@ extern const WCHAR system_dir[]; extern unsigned int supported_machines_count; extern USHORT supported_machines[8]; extern BOOL process_exiting; +extern BOOL terminate_process_running; +extern LONG terminate_process_exit_code; extern HANDLE keyed_event; extern timeout_t server_start_time; extern sigset_t server_block_set; @@ -176,6 +181,16 @@ extern SYSTEM_CPU_INFORMATION cpu_info; extern struct ldt_copy __wine_ldt_copy; #endif +extern BOOL ac_odyssey; +extern BOOL fsync_simulate_sched_quantum; +extern BOOL alert_simulate_sched_quantum; +extern BOOL fsync_yield_to_waiters; +extern BOOL no_priv_elevation; +extern BOOL localsystem_sid; +extern BOOL simulate_writecopy; +extern long long ram_reporting_bias; +extern BOOL wine_allocs_2g_limit; + extern void init_environment(void); extern void init_startup_info(void); extern void *create_startup_info( const UNICODE_STRING *nt_image, ULONG process_flags, @@ -212,6 +227,29 @@ extern int server_pipe( int fd[2] ); extern void fpux_to_fpu( I386_FLOATING_SAVE_AREA *fpu, const XSAVE_FORMAT *fpux ); extern void fpu_to_fpux( XSAVE_FORMAT *fpux, const I386_FLOATING_SAVE_AREA *fpu ); + +static inline void set_context_exception_reporting_flags( DWORD *context_flags, DWORD reporting_flag ) +{ + if (!(*context_flags & CONTEXT_EXCEPTION_REQUEST)) + { + *context_flags &= ~(CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE | CONTEXT_EXCEPTION_ACTIVE); + return; + } + *context_flags = (*context_flags & ~(CONTEXT_SERVICE_ACTIVE | CONTEXT_EXCEPTION_ACTIVE)) + | CONTEXT_EXCEPTION_REPORTING | reporting_flag; +} + +extern BOOL xstate_compaction_enabled; +extern UINT64 xstate_supported_features_mask; +extern UINT64 xstate_features_size; +extern unsigned int xstate_get_size( UINT64 compaction_mask, UINT64 mask ); +extern void copy_xstate( XSAVE_AREA_HEADER *dst, XSAVE_AREA_HEADER *src, UINT64 mask ); + +static inline UINT64 xstate_extended_features(void) +{ + return xstate_supported_features_mask & ~(UINT64)3; +} + extern void *get_cpu_area( USHORT machine ); extern void set_thread_id( TEB *teb, DWORD pid, DWORD tid ); extern NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE_T commit_size ); @@ -219,13 +257,15 @@ extern void DECLSPEC_NORETURN abort_thread( int status ); extern void DECLSPEC_NORETURN abort_process( int status ); extern void DECLSPEC_NORETURN exit_process( int status ); extern void wait_suspend( CONTEXT *context ); -extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ); +extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance, BOOL exception ); +extern BOOL validate_context_xstate( CONTEXT *context ); extern NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *self, USHORT machine ); extern NTSTATUS get_thread_context( HANDLE handle, void *context, BOOL *self, USHORT machine ); extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, data_size_t *ret_len ); extern NTSTATUS system_time_precise( void *args ); +extern void *steamclient_handle_fault( LPCVOID addr, DWORD err ); extern void *anon_mmap_fixed( void *start, size_t size, int prot, int flags ); extern void *anon_mmap_alloc( size_t size, int prot ); extern void virtual_init(void); @@ -273,6 +313,7 @@ extern BOOL get_thread_times( int unix_pid, int unix_tid, LARGE_INTEGER *kernel_ LARGE_INTEGER *user_time ); extern void signal_init_threading(void); extern NTSTATUS signal_alloc_thread( TEB *teb ); +extern void set_thread_teb( TEB *teb ); extern void signal_free_thread( TEB *teb ); extern void signal_init_process(void); extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg, @@ -319,6 +360,7 @@ extern void init_files(void); extern void init_cpu_info(void); extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULONG info, BOOL async ); extern void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ); +extern struct cpu_topology_override *get_cpu_topology_override(void); extern NTSTATUS unixcall_wine_dbg_write( void *args ); extern NTSTATUS unixcall_wine_server_call( void *args ); @@ -342,6 +384,8 @@ extern void call_raise_user_exception_dispatcher(void); #define IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE 0x0010 /* Wine extension */ +extern const char * wine_debuginfostr_pc(void *pc); + #define TICKSPERSEC 10000000 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)86400) @@ -376,6 +420,13 @@ static inline BOOL is_inside_signal_stack( void *ptr ) (char *)ptr < (char *)get_signal_stack() + signal_stack_size); } +static inline BOOL is_inside_syscall_stack_guard( const char *stack_ptr ) +{ + const char *kernel_stack = ntdll_get_thread_data()->kernel_stack; + + return (stack_ptr >= kernel_stack && stack_ptr < kernel_stack + kernel_stack_guard_size); +} + static inline void mutex_lock( pthread_mutex_t *mutex ) { if (!process_exiting) pthread_mutex_lock( mutex ); @@ -528,4 +579,6 @@ static inline NTSTATUS map_section( HANDLE mapping, void **ptr, SIZE_T *size, UL 0, NULL, size, ViewShare, 0, protect ); } +BOOL WINAPI __wine_needs_override_large_address_aware(void); + #endif /* __NTDLL_UNIX_PRIVATE_H */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index abe1b4dc4ec..6c1dc3a8b88 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -51,6 +51,12 @@ #ifdef HAVE_SYS_USER_H # include #endif +#ifdef HAVE_LINK_H +# include +#endif +#ifdef HAVE_SYS_LINK_H +# include +#endif #ifdef HAVE_LIBPROCSTAT_H # include #endif @@ -64,6 +70,12 @@ # include #endif +#include +#include +#include "uffd_tmp_defs.h" + +#include + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -78,6 +90,122 @@ WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DECLARE_DEBUG_CHANNEL(module); WINE_DECLARE_DEBUG_CHANNEL(virtual_ranges); +WINE_DECLARE_DEBUG_CHANNEL(virtstat); + +/* Gdb integration, in loader/main.c */ +static struct r_debug *wine_r_debug; + +#if defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) + +struct link_map_entry +{ + struct link_map map; + const void *module; +}; +static struct link_map link_map = {.l_name = (char *)""}; + +static void r_debug_set_state( int state ) +{ + wine_r_debug->r_map = &link_map; + wine_r_debug->r_state = state; + ((void (*)(void))wine_r_debug->r_brk)(); +} + +static char *get_path_from_fd( int fd, int sz ) +{ +#ifdef linux + char *ret = malloc( 32 + sz ); + + if (ret) sprintf( ret, "/proc/self/fd/%u", fd ); + return ret; +#elif defined(F_GETPATH) + char *ret = malloc( PATH_MAX + sz ); + + if (!ret) return NULL; + if (!fcntl( fd, F_GETPATH, ret )) return ret; + free( ret ); + return NULL; +#else + return NULL; +#endif +} + +static char *r_debug_path_from_fd( int fd ) +{ + char *real, *path; + if (!(path = get_path_from_fd( fd, 0 ))) return NULL; + if (!(real = realpath( path, NULL ))) return path; + if (!strncmp( real, "/run/host", 9 )) memmove( real, real + 9, strlen( real ) - 8 ); + free( path ); + return real; +} + +static void r_debug_add_module( void *module, int fd, INT_PTR offset ) +{ + struct link_map *ptr = link_map.l_next, *next; + struct link_map_entry *entry; + + if (!wine_r_debug) return; + + while (ptr) + { + entry = LIST_ENTRY(ptr, struct link_map_entry, map); + if (entry->module == module) break; + ptr = ptr->l_next; + } + + r_debug_set_state( RT_ADD ); + + if (ptr) entry->map.l_addr = offset; + else if ((entry = calloc( 1, sizeof(*entry) ))) + { + entry->module = module; + entry->map.l_addr = offset; + entry->map.l_name = r_debug_path_from_fd( fd ); + + entry->map.l_next = link_map.l_next; + if ((next = entry->map.l_next)) next->l_prev = &entry->map; + entry->map.l_prev = &link_map; + link_map.l_next = &entry->map; + } + + r_debug_set_state( RT_CONSISTENT ); +} + +static void r_debug_remove_module( void *module ) +{ + struct link_map *ptr = link_map.l_next, *next; + struct link_map_entry *entry; + + if (!wine_r_debug) return; + + while (ptr) + { + entry = LIST_ENTRY(ptr, struct link_map_entry, map); + if (entry->module == module) break; + ptr = ptr->l_next; + } + if (!ptr) return; + + r_debug_set_state( RT_DELETE ); + + entry->map.l_prev->l_next = entry->map.l_next; + if ((next = entry->map.l_next)) next->l_prev = entry->map.l_prev; + + r_debug_set_state( RT_CONSISTENT ); + + free( entry->map.l_name ); + free( entry ); +} + +#else /* defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) */ + +#define RT_CONSISTENT 0 +static void r_debug_set_state( int state ) {} +static void r_debug_add_module( void *module, int fd, INT_PTR offset ) {} +static void r_debug_remove_module( void *module ) {} + +#endif /* defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) */ struct preload_info { @@ -122,11 +250,13 @@ struct file_view #define VPROT_GUARD 0x10 #define VPROT_COMMITTED 0x20 #define VPROT_WRITEWATCH 0x40 +#define VPROT_COPIED 0x80 /* per-mapping protection flags */ #define VPROT_ARM64EC 0x0100 /* view may contain ARM64EC code */ #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */ #define VPROT_PLACEHOLDER 0x0400 #define VPROT_FREE_PLACEHOLDER 0x0800 +#define VPROT_NATIVE 0x1000 /* Conversion from VPROT_* to Win32 flags */ static const BYTE VIRTUAL_Win32Flags[16] = @@ -175,6 +305,8 @@ static void *working_set_limit = (void *)0x7fff0000; static void *host_addr_space_limit; /* top of the host virtual address space */ static struct file_view *arm64ec_view; +static const ptrdiff_t max_try_map_step = 0x40000000; +static BOOL increase_try_map_step = TRUE; ULONG_PTR user_space_wow_limit = 0; struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000; @@ -204,8 +336,18 @@ static BYTE **pages_vprot; static BYTE *pages_vprot; #endif +static int use_kernel_writewatch; +static int uffd_fd, pagemap_fd; +static int pagemap_reset_fd, clear_refs_fd; +#define PAGE_FLAGS_BUFFER_LENGTH 1024 +#define PM_SOFT_DIRTY_PAGE (1ull << 57) + static struct file_view *view_block_start, *view_block_end, *next_free_view; +#ifdef _WIN64 +static const size_t view_block_size = 0x200000; +#else static const size_t view_block_size = 0x100000; +#endif static void *preload_reserve_start; static void *preload_reserve_end; static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ @@ -237,6 +379,243 @@ void *anon_mmap_alloc( size_t size, int prot ) return mmap( NULL, size, prot, MAP_PRIVATE | MAP_ANON, -1, 0 ); } +static void kernel_writewatch_softdirty_init(void) +{ + if ((pagemap_reset_fd = open( "/proc/self/pagemap_reset", O_RDONLY | O_CLOEXEC )) == -1) return; + + if ((pagemap_fd = open( "/proc/self/pagemap", O_RDONLY | O_CLOEXEC )) == -1) + { + ERR( "Could not open pagemap file, error %s.\n", strerror( errno )); + exit(-1); + } + if ((clear_refs_fd = open( "/proc/self/clear_refs", O_WRONLY | O_CLOEXEC )) == -1) + { + ERR( "Could not open clear_refs file, error %s.\n", strerror( errno )); + exit(-1); + } + use_kernel_writewatch = 2; +} + +static void kernel_writewatch_init(void) +{ + struct uffdio_api uffdio_api; + + uffd_fd = syscall( __NR_userfaultfd, O_CLOEXEC | O_NONBLOCK ); + if (uffd_fd == -1) + { + kernel_writewatch_softdirty_init(); + return; + } + + uffdio_api.api = UFFD_API; + uffdio_api.features = UFFD_FEATURE_WP_ASYNC | UFFD_FEATURE_WP_UNPOPULATED; + if (ioctl( uffd_fd, UFFDIO_API, &uffdio_api ) || uffdio_api.api != UFFD_API) + { + close( uffd_fd ); + kernel_writewatch_softdirty_init(); + return; + } + pagemap_fd = open( "/proc/self/pagemap", O_CLOEXEC | O_RDONLY ); + if (pagemap_fd == -1) + { + ERR("Error opening /proc/self/pagemap.\n"); + close( uffd_fd ); + return; + } + use_kernel_writewatch = 1; +} + +static void kernel_writewatch_reset( void *start, SIZE_T len ) +{ + struct pm_scan_arg arg = { 0 }; + + if (use_kernel_writewatch == 2) + { + char buffer[17]; + ssize_t ret; + + memset(buffer, 0, sizeof(buffer)); + buffer[0] = '6'; + *(ULONG64 *)&buffer[1] = (ULONG_PTR)start; + *(ULONG64 *)&buffer[1 + 8] = (ULONG_PTR)start + len; + + if ((ret = write(clear_refs_fd, buffer, sizeof(buffer))) != sizeof(buffer)) + ERR("Could not clear soft dirty bits, ret %zd, error %s.\n", ret, strerror(errno)); + return; + } + + arg.size = sizeof(arg); + arg.start = (UINT_PTR)start; + arg.end = arg.start + len; + arg.flags = PM_SCAN_WP_MATCHING; + arg.category_mask = PAGE_IS_WRITTEN; + arg.return_mask = PAGE_IS_WRITTEN; + if (ioctl( pagemap_fd, PAGEMAP_SCAN, &arg ) < 0) + ERR( "ioctl(PAGEMAP_SCAN) failed, err %s.\n", strerror(errno) ); +} + +static void kernel_writewatch_register_range( struct file_view *view, void *base, size_t size ) +{ + struct uffdio_register uffdio_register; + struct uffdio_writeprotect wp; + + if (!(view->protect & VPROT_WRITEWATCH) || !use_kernel_writewatch) return; + + madvise( base, size, MADV_NOHUGEPAGE ); + if (use_kernel_writewatch == 2) + { + kernel_writewatch_reset( base, size ); + return; + } + + uffdio_register.range.start = (UINT_PTR)base; + uffdio_register.range.len = size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_WP; + if (ioctl( uffd_fd, UFFDIO_REGISTER, &uffdio_register ) == -1) + { + ERR( "ioctl( UFFDIO_REGISTER ) failed, %s.\n", strerror(errno) ); + return; + } + + if (!(uffdio_register.ioctls & UFFDIO_WRITEPROTECT)) + { + ERR( "uffdio_register.ioctls %s.\n", wine_dbgstr_longlong(uffdio_register.ioctls) ); + return; + } + wp.range.start = (UINT_PTR)base; + wp.range.len = size; + wp.mode = UFFDIO_WRITEPROTECT_MODE_WP; + + if (ioctl(uffd_fd, UFFDIO_WRITEPROTECT, &wp) == -1) + { + perror("ioctl(UFFDIO_WRITEPROTECT)"); + exit(-1); + } +} + +static NTSTATUS kernel_soft_dirty_get_write_watches( void *base, SIZE_T size, void **addresses, ULONG_PTR *count, BOOL reset ) +{ + static UINT64 buffer[PAGE_FLAGS_BUFFER_LENGTH]; + char *addr = base; + char *end = addr + size; + unsigned int i, length; + ssize_t read_length; + ULONG_PTR pos = 0; + + if (reset) + { + if (is_win64) + { + addresses[0] = end; + if ((read_length = pread(pagemap_reset_fd, addresses, *count * sizeof(*addresses), + ((ULONG_PTR)addr >> page_shift) * sizeof(*addresses))) == -1) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + *count = read_length / sizeof(*addresses); + return STATUS_SUCCESS; + } + + while (pos < *count && addr < end) + { + length = min(PAGE_FLAGS_BUFFER_LENGTH, *count - pos); + + buffer[0] = (ULONG_PTR)end; + if ((read_length = pread(pagemap_reset_fd, buffer, length * sizeof(*buffer), + ((ULONG_PTR)addr >> page_shift) * sizeof(*buffer))) == -1) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + read_length /= sizeof(*buffer); + for (i = 0; i < read_length; ++i) + { + assert(pos < *count); + addresses[pos++] = (void *)(ULONG_PTR)buffer[i]; + } + if (read_length < length) + break; + addr = (char *)(ULONG_PTR)buffer[read_length - 1] + page_size; + } + *count = pos; + return STATUS_SUCCESS; + } + + while (pos < *count && addr < end) + { + length = min(PAGE_FLAGS_BUFFER_LENGTH, (end - addr) >> page_shift); + + if ((read_length = pread(pagemap_fd, buffer, length * sizeof(*buffer), + ((ULONG_PTR)addr >> page_shift) * sizeof(*buffer))) != length * sizeof(*buffer)) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + for (i = 0; i < length && pos < *count; ++i) + { + if (buffer[i] & PM_SOFT_DIRTY_PAGE) + addresses[pos++] = addr; + + addr += page_size; + } + } + *count = pos; + return STATUS_SUCCESS; +} + +static NTSTATUS kernel_get_write_watches( void *base, SIZE_T size, void **buffer, ULONG_PTR *count, BOOL reset ) +{ + SIZE_T buffer_len = count ? *count : 0; + struct pm_scan_arg arg = { 0 }; + char *addr = base, *next_addr; + struct page_region rgns[256]; + int rgn_count, i; + size_t c_addr; + + assert( !(size & page_mask) ); + + if (use_kernel_writewatch == 2) return kernel_soft_dirty_get_write_watches( base, size, buffer, count, reset ); + + arg.size = sizeof(arg); + arg.vec = (UINT_PTR)rgns; + arg.vec_len = ARRAY_SIZE(rgns); + if (reset) + arg.flags |= PM_SCAN_WP_MATCHING; + arg.category_mask = PAGE_IS_WRITTEN; + arg.return_mask = PAGE_IS_WRITTEN; + + *count = 0; + while (1) + { + arg.start = (UINT_PTR)addr; + arg.end = arg.start + size; + arg.max_pages = buffer_len; + + if ((rgn_count = ioctl( pagemap_fd, PAGEMAP_SCAN, &arg )) < 0) + { + ERR( "ioctl( PAGEMAP_SCAN ) failed, error %s.\n", strerror(errno) ); + return STATUS_INTERNAL_ERROR; + } + if (!rgn_count) break; + + assert( rgn_count <= ARRAY_SIZE(rgns) ); + for (i = 0; i < rgn_count; ++i) + { + assert( rgns[i].categories == PAGE_IS_WRITTEN ); + assert( !buffer || buffer_len >= ((rgns[i].end - rgns[i].start) >> page_shift) ); + for (c_addr = rgns[i].start; buffer_len && c_addr != rgns[i].end; c_addr += page_size, --buffer_len) + buffer[(*count)++] = (void *)c_addr; + } + if (!buffer_len || rgn_count < arg.vec_len) break; + next_addr = (void *)(UINT_PTR)arg.walk_end; + assert( size >= next_addr - addr ); + if (!(size -= next_addr - addr)) break; + addr = next_addr; + } + return STATUS_SUCCESS; +} + static void mmap_add_reserved_area( void *addr, SIZE_T size ) { @@ -631,6 +1010,30 @@ void *get_builtin_so_handle( void *module ) return ret; } +static void load_steam_overlay(const char *unix_lib_path) +{ + const char *preload, *p; + char path[PATH_MAX]; + unsigned int len; + void *handle; + + if (!strstr(unix_lib_path, "winex11.so")) return; + if (getenv("LD_PRELOAD") || !(preload = getenv("WINE_LD_PRELOAD"))) return; + + p = preload; + while (*(preload = p)) + { + p = strchrnul( preload, ':' ); + len = p - preload; + if (*p) ++p; + if (len + 1 > sizeof(path)) continue; + memcpy( path, preload, len ); + path[len] = 0; + if (!strstr( path, "gameoverlayrenderer.so" )) continue; + handle = dlopen( path, RTLD_NOW | RTLD_GLOBAL ); + FIXME( "HACK: tried to load %s, handle %p.\n", debugstr_a(path), handle ); + } +} /*********************************************************************** * get_builtin_unix_funcs @@ -647,7 +1050,10 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **fun { if (builtin->module != module) continue; if (builtin->unix_path && !builtin->unix_handle) + { + load_steam_overlay(builtin->unix_path); builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); + } if (builtin->unix_handle) { *funcs = dlsym( builtin->unix_handle, ptr_name ); @@ -675,6 +1081,11 @@ NTSTATUS load_builtin_unixlib( void *module, const char *name ) if (builtin->module != module) continue; if (!builtin->unix_path) builtin->unix_path = strdup( name ); else status = STATUS_IMAGE_ALREADY_LOADED; + if (!builtin->unix_handle) + { + load_steam_overlay(builtin->unix_path); + builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); + } break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); @@ -1087,7 +1498,8 @@ static const char *get_prot_str( BYTE prot ) buffer[0] = (prot & VPROT_COMMITTED) ? 'c' : '-'; buffer[1] = (prot & VPROT_GUARD) ? 'g' : ((prot & VPROT_WRITEWATCH) ? 'H' : '-'); buffer[2] = (prot & VPROT_READ) ? 'r' : '-'; - buffer[3] = (prot & VPROT_WRITECOPY) ? 'W' : ((prot & VPROT_WRITE) ? 'w' : '-'); + buffer[3] = (prot & VPROT_WRITECOPY) ? (prot & VPROT_COPIED ? 'w' : 'W') + : ((prot & VPROT_WRITE) ? 'w' : '-'); buffer[4] = (prot & VPROT_EXEC) ? 'x' : '-'; buffer[5] = 0; return buffer; @@ -1108,7 +1520,7 @@ static int get_unix_prot( BYTE vprot ) if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ; if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ; if (vprot & VPROT_EXEC) prot |= PROT_EXEC | PROT_READ; - if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE; + if (vprot & VPROT_WRITEWATCH && !use_kernel_writewatch) prot &= ~PROT_WRITE; } if (!prot) prot = PROT_NONE; return prot; @@ -1125,7 +1537,9 @@ static void dump_view( struct file_view *view ) BYTE prot = get_page_vprot( addr ); TRACE( "View: %p - %p", addr, addr + view->size - 1 ); - if (view->protect & VPROT_SYSTEM) + if (view->protect & VPROT_NATIVE) + TRACE(" (native)\n"); + else if (view->protect & VPROT_SYSTEM) TRACE( " (builtin image)\n" ); else if (view->protect & VPROT_FREE_PLACEHOLDER) TRACE( " (placeholder)\n" ); @@ -1174,6 +1588,53 @@ static void VIRTUAL_Dump(void) #endif +static void dump_memory_statistics(void) +{ + struct file_view *view; + SIZE_T anon_reserved = 0, anon_committed = 0, mapped = 0, mapped_committed = 0, marked_native = 0; + SIZE_T size, c_size; + char *base; + BYTE vprot; + + if (!TRACE_ON(virtstat)) return; + + WINE_RB_FOR_EACH_ENTRY( view, &views_tree, struct file_view, entry ) + { + if (view->protect & VPROT_NATIVE) + { + marked_native += view->size; + continue; + } + base = view->base; + c_size = 0; + while (base != (char *)view->base + view->size) + { + size = get_vprot_range_size( base, (char *)view->base + view->size - base, VPROT_COMMITTED, &vprot ); + if (vprot & VPROT_COMMITTED) c_size += size; + base += size; + } + if (is_view_valloc( view )) + { + anon_reserved += view->size; + anon_committed += c_size; + } + else + { + mapped += view->size; + mapped_committed += c_size; + } + } + + anon_reserved /= 1024 * 1024; + anon_committed /= 1024 * 1024; + mapped /= 1024 * 1024; + mapped_committed /= 1024 * 1024; + marked_native /= 1024 * 1024; + TRACE_(virtstat)( "Total: res %lu, comm %lu; Anon: res %lu, comm %lu, marked Unix %lu.\n", + anon_reserved + mapped, anon_committed + mapped_committed, anon_reserved, anon_committed, + marked_native ); +} + /*********************************************************************** * find_view * @@ -1237,43 +1698,17 @@ static struct file_view *find_view_range( const void *addr, size_t size ) } -/*********************************************************************** - * find_view_inside_range - * - * Find first (resp. last, if top_down) view inside a range. - * virtual_mutex must be held by caller. - */ -static struct wine_rb_entry *find_view_inside_range( void **base_ptr, void **end_ptr, int top_down ) -{ - struct wine_rb_entry *first = NULL, *ptr = views_tree.root; - void *base = *base_ptr, *end = *end_ptr; - - /* find the first (resp. last) view inside the range */ - while (ptr) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( ptr, struct file_view, entry ); - if ((char *)view->base + view->size >= (char *)end) - { - end = min( end, view->base ); - ptr = ptr->left; - } - else if (view->base <= base) - { - base = max( (char *)base, (char *)view->base + view->size ); - ptr = ptr->right; - } - else - { - first = ptr; - ptr = top_down ? ptr->right : ptr->left; - } - } - - *base_ptr = base; - *end_ptr = end; - return first; -} +struct alloc_area +{ + size_t size; + ptrdiff_t step; + int unix_prot; + BOOL top_down; + UINT_PTR align_mask; + char *native_mapped; + size_t native_mapped_size; +}; /*********************************************************************** * try_map_free_area @@ -1281,9 +1716,12 @@ static struct wine_rb_entry *find_view_inside_range( void **base_ptr, void **end * Try mmaping some expected free memory region, eventually stepping and * retrying inside it, and return where it actually succeeded, or NULL. */ -static void* try_map_free_area( void *base, void *end, ptrdiff_t step, - void *start, size_t size, int unix_prot ) +static void* try_map_free_area( struct alloc_area *area, void *base, void *end, void *start ) { + ptrdiff_t step = area->step; + size_t abs_step = step > 0 ? step : -step; + size_t size = area->size; + int unix_prot = area->unix_prot; void *ptr; while (start && base <= start && (char*)start + size <= (char*)end) @@ -1296,123 +1734,25 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, strerror(errno), start, (char *)start + size, unix_prot ); return NULL; } + if (!area->native_mapped && step && abs_step < (granularity_mask + 1) * 2) + { + area->native_mapped = start; + area->native_mapped_size = abs_step; + area->native_mapped_size = min(area->native_mapped_size, (char *)end - (char *)start); + } if ((step > 0 && (char *)end - (char *)start < step) || (step < 0 && (char *)start - (char *)base < -step) || step == 0) break; start = (char *)start + step; + if (increase_try_map_step && llabs(step) < max_try_map_step) + step *= 2; } return NULL; } -/*********************************************************************** - * map_free_area - * - * Find a free area between views inside the specified range and map it. - * virtual_mutex must be held by caller. - */ -static void *map_free_area( void *base, void *end, size_t size, int top_down, int unix_prot, size_t align_mask ) -{ - struct wine_rb_entry *first = find_view_inside_range( &base, &end, top_down ); - ptrdiff_t step = top_down ? -(align_mask + 1) : (align_mask + 1); - void *start; - - if (top_down) - { - start = ROUND_ADDR( (char *)end - size, align_mask ); - if (start >= end || start < base) return NULL; - - while (first) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( first, struct file_view, entry ); - if ((start = try_map_free_area( (char *)view->base + view->size, (char *)start + size, step, - start, size, unix_prot ))) break; - start = ROUND_ADDR( (char *)view->base - size, align_mask ); - /* stop if remaining space is not large enough */ - if (!start || start >= end || start < base) return NULL; - first = rb_prev( first ); - } - } - else - { - start = ROUND_ADDR( (char *)base + align_mask, align_mask ); - if (!start || start >= end || (char *)end - (char *)start < size) return NULL; - - while (first) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( first, struct file_view, entry ); - if ((start = try_map_free_area( start, view->base, step, - start, size, unix_prot ))) break; - start = ROUND_ADDR( (char *)view->base + view->size + align_mask, align_mask ); - /* stop if remaining space is not large enough */ - if (!start || start >= end || (char *)end - (char *)start < size) return NULL; - first = rb_next( first ); - } - } - - if (!first) - start = try_map_free_area( base, end, step, start, size, unix_prot ); - - if (!start) - ERR( "couldn't map free area in range %p-%p, size %p\n", base, end, (void *)size ); - - return start; -} - - -/*********************************************************************** - * find_reserved_free_area - * - * Find a free area between views inside the specified range. - * virtual_mutex must be held by caller. - * The range must be inside a reserved area. - */ -static void *find_reserved_free_area( void *base, void *end, size_t size, int top_down, size_t align_mask ) -{ - struct range_entry *range; - void *start; - - base = ROUND_ADDR( (char *)base + align_mask, align_mask ); - end = (char *)ROUND_ADDR( (char *)end - size, align_mask ) + size; - - if (top_down) - { - start = (char *)end - size; - range = free_ranges_lower_bound( start ); - assert(range != free_ranges_end && range->end >= start); - - if ((char *)range->end - (char *)start < size) start = ROUND_ADDR( (char *)range->end - size, align_mask ); - do - { - if (start >= end || start < base || (char *)end - (char *)start < size) return NULL; - if (start < range->end && start >= range->base && (char *)range->end - (char *)start >= size) break; - if (--range < free_ranges) return NULL; - start = ROUND_ADDR( (char *)range->end - size, align_mask ); - } - while (1); - } - else - { - start = base; - range = free_ranges_lower_bound( start ); - assert(range != free_ranges_end && range->end >= start); - - if (start < range->base) start = ROUND_ADDR( (char *)range->base + align_mask, align_mask ); - do - { - if (start >= end || start < base || (char *)end - (char *)start < size) return NULL; - if (start < range->end && start >= range->base && (char *)range->end - (char *)start >= size) break; - if (++range == free_ranges_end) return NULL; - start = ROUND_ADDR( (char *)range->base + align_mask, align_mask ); - } - while (1); - } - return start; -} - - /*********************************************************************** * remove_reserved_area * @@ -1522,8 +1862,7 @@ static void free_view( struct file_view *view ) */ static void unregister_view( struct file_view *view ) { - if (mmap_is_in_reserved_area( view->base, view->size )) - free_ranges_remove_view( view ); + free_ranges_remove_view( view ); wine_rb_remove( &views_tree, &view->entry ); } @@ -1551,8 +1890,7 @@ static void delete_view( struct file_view *view ) /* [in] View */ static void register_view( struct file_view *view ) { wine_rb_put( &views_tree, view->base, &view->entry ); - if (mmap_is_in_reserved_area( view->base, view->size )) - free_ranges_insert_view( view ); + free_ranges_insert_view( view ); } @@ -1605,6 +1943,8 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz TRACE( "forcing exec permission on %p-%p\n", base, (char *)base + size - 1 ); mprotect( base, size, unix_prot | PROT_EXEC ); } + + kernel_writewatch_register_range( view, view->base, view->size ); return STATUS_SUCCESS; } @@ -1616,7 +1956,11 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz */ static DWORD get_win32_prot( BYTE vprot, unsigned int map_prot ) { - DWORD ret = VIRTUAL_Win32Flags[vprot & 0x0f]; + DWORD ret; + + if ((vprot & (VPROT_COPIED | VPROT_WRITECOPY)) == (VPROT_COPIED | VPROT_WRITECOPY)) + vprot = (vprot & ~VPROT_WRITECOPY) | VPROT_WRITE; + ret = VIRTUAL_Win32Flags[vprot & 0x0f]; if (vprot & VPROT_GUARD) ret |= PAGE_GUARD; if (map_prot & SEC_NOCACHE) ret |= PAGE_NOCACHE; return ret; @@ -1724,7 +2068,7 @@ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vpr { int unix_prot = get_unix_prot(vprot); - if (view->protect & VPROT_WRITEWATCH) + if (!use_kernel_writewatch && view->protect & VPROT_WRITEWATCH) { /* each page may need different protections depending on write watch flag */ set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~VPROT_WRITEWATCH ); @@ -1801,8 +2145,12 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size */ static void reset_write_watches( void *base, SIZE_T size ) { - set_page_vprot_bits( base, size, VPROT_WRITEWATCH, 0 ); - mprotect_range( base, size, 0, 0 ); + if (use_kernel_writewatch) kernel_writewatch_reset( base, size ); + else + { + set_page_vprot_bits( base, size, VPROT_WRITEWATCH, 0 ); + mprotect_range( base, size, 0, 0 ); + } } @@ -1825,89 +2173,221 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want return ptr; } - -/*********************************************************************** - * find_reserved_free_area_outside_preloader - * - * Find a free area inside a reserved area, skipping the preloader reserved range. - * virtual_mutex must be held by caller. - */ -static void *find_reserved_free_area_outside_preloader( void *start, void *end, size_t size, - int top_down, size_t align_mask ) +static void *try_map_free_area_range( struct alloc_area *area, char *start, char *end ) { - void *ret; + char *alloc_start; - if (preload_reserve_end >= end) - { - if (preload_reserve_start <= start) return NULL; /* no space in that area */ - if (preload_reserve_start < end) end = preload_reserve_start; - } - else if (preload_reserve_start <= start) + if (area->top_down) { - if (preload_reserve_end > start) start = preload_reserve_end; + if (end - start < area->size) return NULL; + alloc_start = ROUND_ADDR( end - area->size, area->align_mask ); + return try_map_free_area( area, start, alloc_start + area->size, alloc_start ); } - else /* range is split in two by the preloader reservation, try both parts */ + + alloc_start = ROUND_ADDR( start + area->align_mask, area->align_mask ); + return try_map_free_area( area, start, end, alloc_start ); +} + +static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char *end ) +{ + UINT_PTR align_mask = area->align_mask; + char *intersect_start, *intersect_end, *result, *alloc_start; + struct reserved_area *res_area; + + TRACE("range %p-%p.\n", base, end); + + if (base >= end) + return NULL; + + if (area->top_down) { - if (top_down) + if ((ULONG_PTR)end < area->size) return NULL; + alloc_start = ROUND_ADDR( end - area->size, align_mask ); + if (alloc_start >= end || alloc_start < base) return NULL; + + LIST_FOR_EACH_ENTRY_REV( res_area, &reserved_areas, struct reserved_area, entry ) { - ret = find_reserved_free_area( preload_reserve_end, end, size, top_down, align_mask ); - if (ret) return ret; - end = preload_reserve_start; + char *res_start = res_area->base; + char *res_end = res_start + res_area->size; + + if (res_start >= end) continue; + if (res_end <= base) break; + + intersect_start = max( res_start, base ); + intersect_end = min( res_end, end ); + assert( intersect_start <= intersect_end ); + if ((result = try_map_free_area_range( area, intersect_end, end))) return result; + + if (intersect_end - intersect_start >= area->size) + { + alloc_start = ROUND_ADDR( intersect_end - area->size, align_mask ); + if (alloc_start >= intersect_start) + { + if ((result = anon_mmap_fixed( alloc_start, area->size, area->unix_prot, 0 )) != alloc_start) + ERR("Could not map in reserved area, alloc_start %p, size %p.\n", + alloc_start, (void *)area->size); + return result; + } + } + + end = intersect_start; + if (end - base < area->size) return NULL; } - else + return try_map_free_area_range( area, base, end ); + } + + if (base + align_mask < base) return NULL; + alloc_start = ROUND_ADDR( base + align_mask, align_mask ); + if (alloc_start >= end || end - alloc_start < area->size) + return NULL; + + LIST_FOR_EACH_ENTRY( res_area, &reserved_areas, struct reserved_area, entry ) + { + char *res_start = res_area->base; + char *res_end = res_start + res_area->size; + + if (res_end <= base) continue; + if (res_start >= end) break; + + intersect_start = max( res_start, base ); + intersect_end = min( res_end, end ); + assert( intersect_start <= intersect_end ); + if ((result = try_map_free_area_range( area, base, intersect_start ))) return result; + + if (intersect_end - intersect_start >= area->size) { - ret = find_reserved_free_area( start, preload_reserve_start, size, top_down, align_mask ); - if (ret) return ret; - start = preload_reserve_end; + alloc_start = ROUND_ADDR( intersect_start + align_mask, align_mask ); + if (alloc_start + area->size <= intersect_end) + { + if ((result = anon_mmap_fixed( alloc_start, area->size, area->unix_prot, 0 )) != alloc_start) + ERR("Could not map in reserved area, alloc_start %p, size %p.\n", alloc_start, (void *)area->size); + return result; + } } + base = intersect_end; + if (end - base < area->size) return NULL; } - return find_reserved_free_area( start, end, size, top_down, align_mask ); + return try_map_free_area_range( area, base, end ); } -/*********************************************************************** - * map_reserved_area - * - * Try to map some space inside a reserved area. - * virtual_mutex must be held by caller. - */ -static void *map_reserved_area( void *limit_low, void *limit_high, size_t size, int top_down, - int unix_prot, size_t align_mask ) +static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BOOL top_down, int unix_prot, UINT_PTR align_mask ) { - void *ptr = NULL; - struct reserved_area *area = LIST_ENTRY( ptr, struct reserved_area, entry ); + struct range_entry *range, *ranges_start, *ranges_end; + char *reserve_start, *reserve_end; + struct alloc_area area; + char *result = NULL; + char *base, *end; + int ranges_inc; + UINT status; + + TRACE("limit %p-%p, size %p, top_down %#x.\n", limit_low, limit_high, (void *)size, top_down); if (top_down) { - LIST_FOR_EACH_ENTRY_REV( area, &reserved_areas, struct reserved_area, entry ) + ranges_start = free_ranges_end - 1; + ranges_end = free_ranges - 1; + ranges_inc = -1; + } + else + { + ranges_start = free_ranges; + ranges_end = free_ranges_end; + ranges_inc = 1; + } + + memset( &area, 0, sizeof(area) ); + area.step = top_down ? -(align_mask + 1) : (align_mask + 1); + area.size = size; + area.top_down = top_down; + area.unix_prot = unix_prot; + area.align_mask = align_mask; + + reserve_start = preload_reserve_start; + reserve_end = preload_reserve_end; + + for (range = ranges_start; range != ranges_end; range += ranges_inc) + { + base = range->base; + end = range->end; + + TRACE("range %p-%p.\n", base, end); + + if (base < limit_low) base = limit_low; + if (end > limit_high) end = limit_high; + if (base > end || end - base < size) continue; + + if (reserve_end >= base) { - void *start = area->base; - void *end = (char *)start + area->size; - - if (start >= limit_high) continue; - if (end <= limit_low) return NULL; - if (start < limit_low) start = limit_low; - if (end > limit_high) end = limit_high; - ptr = find_reserved_free_area_outside_preloader( start, end, size, top_down, align_mask ); - if (ptr) break; + if (reserve_end >= end) + { + if (reserve_start <= base) + continue; /* no space in that area */ + + if (reserve_start < end) + end = reserve_start; + } + else if (reserve_start <= base) + { + base = reserve_end; + } + else + { + /* range is split in two by the preloader reservation, try first part. */ + if ((result = alloc_free_area_in_range( &area, base, reserve_start ))) + break; + /* then fall through to try second part. */ + base = reserve_end; + } } + + if ((result = alloc_free_area_in_range( &area, base, end ))) + break; } - else + + if (area.native_mapped) { - LIST_FOR_EACH_ENTRY( area, &reserved_areas, struct reserved_area, entry ) + char *native_mapped_start, *native_mapped_end; + + TRACE("Excluding %p - %p from free list.\n", + area.native_mapped, (char *)area.native_mapped + area.native_mapped_size ); + + native_mapped_start = ROUND_ADDR(area.native_mapped, granularity_mask); + native_mapped_end = ROUND_ADDR(area.native_mapped + area.native_mapped_size + granularity_mask, + granularity_mask); + + if (result >= native_mapped_end || result + size < native_mapped_start) + /* In case of top down allocation try_map_free_area() result area can overlap the + * area previously marked as native if the latter was unmapped behind our back. */ { - void *start = area->base; - void *end = (char *)start + area->size; - - if (start >= limit_high) return NULL; - if (end <= limit_low) continue; - if (start < limit_low) start = limit_low; - if (end > limit_high) end = limit_high; - ptr = find_reserved_free_area_outside_preloader( start, end, size, top_down, align_mask ); - if (ptr) break; + struct file_view *prev, *next; + + prev = find_view_range( native_mapped_start - 1, native_mapped_end - native_mapped_start + 2 ); + if (prev && (char *)prev->base >= native_mapped_end) + { + next = prev; + prev = WINE_RB_ENTRY_VALUE( rb_prev( &next->entry ), struct file_view, entry ); + } + else if (prev) next = WINE_RB_ENTRY_VALUE( rb_next( &prev->entry ), struct file_view, entry ); + else next = NULL; + + if (prev && prev->protect & VPROT_NATIVE && (char *)prev->base + prev->size >= native_mapped_start) + { + assert( (char *)prev->base + prev->size == native_mapped_start ); + native_mapped_start = prev->base; + delete_view( prev ); + } + if (next && next->protect & VPROT_NATIVE && native_mapped_end >= (char *)next->base) + { + assert( native_mapped_end == (char *)next->base ); + native_mapped_end = (char *)next->base + next->size; + delete_view( next ); + } + if ((status = create_view( &next, native_mapped_start, native_mapped_end - native_mapped_start, + VPROT_SYSTEM | VPROT_NATIVE ))) + ERR("Could not create view for natively mapped area, status %#x.\n", status); } } - if (ptr && anon_mmap_fixed( ptr, size, unix_prot, 0 ) != ptr) ptr = NULL; - return ptr; + return result; } /*********************************************************************** @@ -1966,6 +2446,17 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot ) return status; } +static void clear_native_views(void) +{ + struct file_view *view, *next_view; + + WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR( view, next_view, &views_tree, struct file_view, entry ) + { + if (view->protect & VPROT_NATIVE) + delete_view( view ); + } +} + /*********************************************************************** * map_view * @@ -1979,6 +2470,7 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, int top_down = alloc_type & MEM_TOP_DOWN; void *ptr; NTSTATUS status; + const void *effective_user_space_limit = !is_win64 && wine_allocs_2g_limit ? (void *)0x7fff0000 : user_space_limit; if (alloc_type & MEM_REPLACE_PLACEHOLDER) { @@ -1992,7 +2484,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, view->protect = vprot | VPROT_PLACEHOLDER; set_vprot( view, base, size, vprot ); - if (vprot & VPROT_WRITEWATCH) reset_write_watches( base, size ); + if (vprot & VPROT_WRITEWATCH) + { + kernel_writewatch_register_range( view, base, size ); + reset_write_watches( base, size ); + } *view_ret = view; return STATUS_SUCCESS; } @@ -2011,48 +2507,21 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, } else { - void *start = address_space_start; - void *end = min( user_space_limit, host_addr_space_limit ); - size_t view_size, unmap_size; - + limit_high = limit_high ? min( limit_high + 1, (UINT_PTR)effective_user_space_limit) : (UINT_PTR)effective_user_space_limit; + if (limit_low < (ULONG_PTR)address_space_start) limit_low = (ULONG_PTR)address_space_start; if (!align_mask) align_mask = granularity_mask; - view_size = size + align_mask + 1; - - if (limit_low && (void *)limit_low > start) start = (void *)limit_low; - if (limit_high && (void *)limit_high < end) end = (char *)limit_high + 1; - if ((ptr = map_reserved_area( start, end, size, top_down, get_unix_prot(vprot), align_mask ))) + if (!(ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask ))) { - TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size ); - goto done; - } + WARN("Allocation failed, clearing native views.\n"); - if (start > address_space_start || end < host_addr_space_limit || top_down) - { - if (!(ptr = map_free_area( start, end, size, top_down, get_unix_prot(vprot), align_mask ))) - return STATUS_NO_MEMORY; - TRACE( "got mem with map_free_area %p-%p\n", ptr, (char *)ptr + size ); - goto done; - } - - for (;;) - { - if ((ptr = anon_mmap_alloc( view_size, get_unix_prot(vprot) )) == MAP_FAILED) - { - status = (errno == ENOMEM) ? STATUS_NO_MEMORY : STATUS_INVALID_PARAMETER; - ERR( "anon mmap error %s, size %p, unix_prot %#x\n", - strerror(errno), (void *)view_size, get_unix_prot( vprot ) ); - return status; - } - TRACE( "got mem with anon mmap %p-%p\n", ptr, (char *)ptr + size ); - /* if we got something beyond the user limit, unmap it and retry */ - if (!is_beyond_limit( ptr, view_size, user_space_limit )) break; - unmap_size = unmap_area_above_user_limit( ptr, view_size ); - if (unmap_size) munmap( ptr, unmap_size ); + clear_native_views(); + if (!is_win64) increase_try_map_step = FALSE; + ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask ); + if (!is_win64) increase_try_map_step = TRUE; + if (!ptr) return STATUS_NO_MEMORY; } - ptr = unmap_extra_space( ptr, view_size, size, align_mask ); } -done: status = create_view( view_ret, ptr, size, vprot ); if (status != STATUS_SUCCESS) unmap_area( ptr, size ); return status; @@ -2189,6 +2658,7 @@ static NTSTATUS decommit_pages( struct file_view *view, size_t start, size_t siz if (anon_mmap_fixed( (char *)view->base + start, size, PROT_NONE, 0 ) != MAP_FAILED) { set_page_vprot_bits( (char *)view->base + start, size, 0, VPROT_COMMITTED ); + kernel_writewatch_register_range( view, (char *)view->base + start, size ); return STATUS_SUCCESS; } return STATUS_NO_MEMORY; @@ -2923,6 +3393,7 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena #ifdef VALGRIND_LOAD_PDB_DEBUGINFO VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, ptr - (char *)wine_server_get_ptr( image_info->base )); #endif + r_debug_add_module( ptr, fd, ptr - (char *)wine_server_get_ptr( image_info->base ) ); return STATUS_SUCCESS; } @@ -3231,6 +3702,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P done: server_leave_uninterrupted_section( &virtual_mutex, &sigset ); if (needs_close) close( unix_handle ); + TRACE("status %#x.\n", res); return res; } @@ -3275,10 +3747,14 @@ static void *alloc_virtual_heap( SIZE_T size ) void virtual_init(void) { const struct preload_info **preload_info = dlsym( RTLD_DEFAULT, "wine_main_preload_info" ); + struct r_debug **r_debug = dlsym( RTLD_DEFAULT, "wine_r_debug" ); const char *preload = getenv( "WINEPRELOADRESERVE" ); size_t size; int i; pthread_mutexattr_t attr; + const char *env_var; + + if (r_debug && (wine_r_debug = *r_debug)) r_debug_set_state( RT_CONSISTENT ); pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); @@ -3292,6 +3768,12 @@ void virtual_init(void) host_addr_space_limit = address_space_limit; #endif + if (!((env_var = getenv( "WINE_DISABLE_KERNEL_WRITEWATCH" )) && atoi( env_var ))) + kernel_writewatch_init(); + + if (use_kernel_writewatch) + MESSAGE( "wine: using kernel write watches, use_kernel_writewatch %d.\n", use_kernel_writewatch ); + if (preload_info && *preload_info) for (i = 0; (*preload_info)[i].size; i++) mmap_add_reserved_area( (*preload_info)[i].addr, (*preload_info)[i].size ); @@ -3358,6 +3840,7 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info, BOOL wow64 ) if (!sysinfo(&sinfo)) { ULONG64 total = (ULONG64)sinfo.totalram * sinfo.mem_unit; + total -= min(total, ram_reporting_bias); info->MmHighestPhysicalPage = max(1, total / page_size); } #elif defined(__APPLE__) @@ -3641,6 +4124,8 @@ static TEB *init_teb( void *ptr, BOOL is_wow ) teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer; teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->esync_apc_fd = -1; + thread_data->fsync_apc_futex = NULL; thread_data->request_fd = -1; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; @@ -3859,6 +4344,12 @@ NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, ULONG_PTR limit_low, UL VPROT_READ | VPROT_WRITE | VPROT_COMMITTED | VPROT_GUARD ); mprotect_range( view->base, 2 * page_size , 0, 0 ); } + else + { + /* setup kernel stack no access guard page */ + set_page_vprot( view->base, kernel_stack_guard_size, VPROT_COMMITTED | VPROT_READ ); + mprotect_range( view->base, kernel_stack_guard_size, 0, 0 ); + } VIRTUAL_DEBUG_DUMP_VIEW( view ); /* note: limit is lower than base since the stack grows down */ @@ -3967,6 +4458,16 @@ static NTSTATUS grow_thread_stack( char *page, struct thread_stack_info *stack_i } +/*********************************************************************** + * is_system_range + */ +static inline BOOL is_system_range( const void *addr, size_t size ) +{ + struct file_view *view = find_view( addr, size ); + return view && (view->protect & VPROT_SYSTEM); +} + + /*********************************************************************** * virtual_handle_fault */ @@ -3999,7 +4500,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) } else ret = grow_thread_stack( page, &stack_info ); } - else if (err & EXCEPTION_WRITE_FAULT) + else if (!use_kernel_writewatch && err & EXCEPTION_WRITE_FAULT) { if (vprot & VPROT_WRITEWATCH) { @@ -4013,6 +4514,21 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) ret = STATUS_SUCCESS; } } + else if (!err && (get_unix_prot( vprot ) & PROT_READ) && is_system_range( page, page_size )) + { + int unix_prot = get_unix_prot( vprot ); + unsigned char vec; + + TRACE("yolo\n"); + + mprotect_range( page, page_size, 0, 0 ); + if (!mincore( page, page_size, &vec ) && (vec & 1)) + ret = STATUS_SUCCESS; + else if (anon_mmap_fixed( page, page_size, unix_prot, 0 ) == page) + ret = STATUS_SUCCESS; + else + set_page_vprot_bits( page, page_size, 0, VPROT_READ | VPROT_EXEC ); + } mutex_unlock( &virtual_mutex ); return ret; } @@ -4083,11 +4599,11 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat for (i = 0; i < size; i += page_size) { BYTE vprot = get_page_vprot( addr + i ); - if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; + if (!use_kernel_writewatch && vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; if (!(get_unix_prot( vprot & ~VPROT_WRITEWATCH ) & PROT_WRITE)) return STATUS_INVALID_USER_BUFFER; } - if (*has_write_watch) + if (!use_kernel_writewatch && *has_write_watch) mprotect_range( addr, size, 0, VPROT_WRITEWATCH ); /* temporarily enable write access */ return STATUS_SUCCESS; } @@ -4129,7 +4645,7 @@ ssize_t virtual_locked_read( int fd, void *addr, size_t size ) int err = EFAULT; ssize_t ret = read( fd, addr, size ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); if (!check_write_access( addr, size, &has_write_watch )) @@ -4154,7 +4670,7 @@ ssize_t virtual_locked_pread( int fd, void *addr, size_t size, off_t offset ) int err = EFAULT; ssize_t ret = pread( fd, addr, size, offset ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); if (!check_write_access( addr, size, &has_write_watch )) @@ -4180,7 +4696,7 @@ ssize_t virtual_locked_recvmsg( int fd, struct msghdr *hdr, int flags ) int err = EFAULT; ssize_t ret = recvmsg( fd, hdr, flags ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); for (i = 0; i < hdr->msg_iovlen; i++) @@ -4364,7 +4880,12 @@ void virtual_set_force_exec( BOOL enable ) WINE_RB_FOR_EACH_ENTRY( view, &views_tree, struct file_view, entry ) { /* file mappings are always accessible */ - BYTE commit = is_view_valloc( view ) ? 0 : VPROT_COMMITTED; + BYTE commit; + + if (view->protect & VPROT_NATIVE) + continue; + + commit = is_view_valloc( view ) ? 0 : VPROT_COMMITTED; mprotect_range( view->base, view->size, commit, 0 ); } @@ -4415,6 +4936,24 @@ static void virtual_release_address_space(void) #endif /* _WIN64 */ +BOOL WINAPI __wine_needs_override_large_address_aware(void) +{ + static int needs_override = -1; + + if (needs_override == -1) + { + const char *str = getenv( "WINE_LARGE_ADDRESS_AWARE" ); + + needs_override = !str || atoi(str) == 1; + } + return needs_override; +} + +static BOOL is_large_address_aware(void) +{ + return (main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) + || __wine_needs_override_large_address_aware(); +} /*********************************************************************** * virtual_set_large_address_space @@ -4426,7 +4965,7 @@ void virtual_set_large_address_space(void) if (is_win64) { if (is_wow64()) - user_space_wow_limit = ((main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) ? limit_4g : limit_2g) - 1; + user_space_wow_limit = (is_large_address_aware() ? limit_4g : limit_2g) - 1; #ifndef __APPLE__ /* don't free the zerofill section on macOS */ else if ((main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA) && (main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE)) @@ -4435,7 +4974,7 @@ void virtual_set_large_address_space(void) } else { - if (!(main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE)) return; + if (!is_large_address_aware()) return; free_reserved_memory( (char *)0x80000000, address_space_limit ); } user_space_limit = working_set_limit = address_space_limit; @@ -4549,7 +5088,11 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ set_arm64ec_range( base, size ); } - if (!status) VIRTUAL_DEBUG_DUMP_VIEW( view ); + if (!status) + { + VIRTUAL_DEBUG_DUMP_VIEW( view ); + dump_memory_statistics(); + } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); @@ -4850,6 +5393,8 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si *addr_ptr = base; *size_ptr = size; } + + dump_memory_statistics(); server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; } @@ -4913,6 +5458,33 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T { old = get_win32_prot( vprot, view->protect ); status = set_protection( view, base, size, new_prot ); + + if (simulate_writecopy && status == STATUS_SUCCESS + && ((old == PAGE_WRITECOPY || old == PAGE_EXECUTE_WRITECOPY))) + { + TRACE("Setting VPROT_COPIED.\n"); + + set_page_vprot_bits(base, size, VPROT_COPIED, 0); + vprot |= VPROT_COPIED; + old = get_win32_prot( vprot, view->protect ); + } + else if (status == STATUS_SUCCESS && (view->protect & SEC_IMAGE) && + base == (void*)NtCurrentTeb()->Peb->ImageBaseAddress) + { + /* GTA5 HACK: Mark first page as copied. */ + const WCHAR gta5W[] = { 'g','t','a','5','.','e','x','e',0 }; + WCHAR *name, *p; + + name = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer; + p = wcsrchr(name, '\\'); + p = p ? p+1 : name; + + if(!wcsicmp(p, gta5W)) + { + FIXME("HACK: changing GTA5.exe vprot\n"); + set_page_vprot_bits(base, page_size, VPROT_COPIED, 0); + } + } } else status = STATUS_NOT_COMMITTED; } @@ -5233,6 +5805,86 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, return STATUS_SUCCESS; } +static NTSTATUS read_nt_symlink( UNICODE_STRING *name, WCHAR *target, DWORD size ) +{ + NTSTATUS status; + OBJECT_ATTRIBUTES attr; + HANDLE handle; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) + { + UNICODE_STRING targetW; + targetW.Buffer = target; + targetW.MaximumLength = (size - 1) * sizeof(WCHAR); + status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); + if (!status) target[targetW.Length / sizeof(WCHAR)] = 0; + NtClose( handle ); + } + return status; +} + +static NTSTATUS resolve_drive_symlink( UNICODE_STRING *name, SIZE_T max_name_len, SIZE_T *ret_len, NTSTATUS status ) +{ + static int enabled = -1; + + static const WCHAR dosprefixW[] = {'\\','?','?','\\'}; + UNICODE_STRING device_name; + SIZE_T required_length, symlink_len; + WCHAR symlink[256]; + size_t offset = 0; + + if (enabled == -1) + { + const char *sgi = getenv("SteamGameId"); + + enabled = sgi && !strcmp(sgi, "284160"); + } + if (!enabled) return status; + if (status == STATUS_INFO_LENGTH_MISMATCH) + { + /* FIXME */ + *ret_len += 64; + return status; + } + if (status) return status; + + if (name->Length < sizeof(dosprefixW) || + memcmp( name->Buffer, dosprefixW, sizeof(dosprefixW) )) + return STATUS_SUCCESS; + + offset = ARRAY_SIZE(dosprefixW); + while (offset * sizeof(WCHAR) < name->Length && name->Buffer[ offset ] != '\\') offset++; + + device_name = *name; + device_name.Length = offset * sizeof(WCHAR); + if ((status = read_nt_symlink( &device_name, symlink, ARRAY_SIZE( symlink )))) + { + ERR("read_nt_symlink failed, status %#x.\n", (int)status); + return status; + } + symlink_len = wcslen( symlink ); + required_length = symlink_len * sizeof(WCHAR) + + name->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); + if (ret_len) + *ret_len = sizeof(MEMORY_SECTION_NAME) + required_length; + if (required_length > max_name_len) + return STATUS_INFO_LENGTH_MISMATCH; + + memmove( name->Buffer + symlink_len, name->Buffer + offset, name->Length - offset * sizeof(WCHAR) ); + memcpy( name->Buffer, symlink, symlink_len * sizeof(WCHAR) ); + name->MaximumLength = required_length; + name->Length = required_length - sizeof(WCHAR); + name->Buffer[name->Length / sizeof(WCHAR)] = 0; + return STATUS_SUCCESS; +} + static unsigned int get_memory_section_name( HANDLE process, LPCVOID addr, MEMORY_SECTION_NAME *info, SIZE_T len, SIZE_T *ret_len ) { @@ -5261,7 +5913,8 @@ static unsigned int get_memory_section_name( HANDLE process, LPCVOID addr, } } SERVER_END_REQ; - return status; + + return resolve_drive_symlink( &info->SectionFileName, len - sizeof(*info), ret_len, status ); } static unsigned int get_memory_image_info( HANDLE process, LPCVOID addr, MEMORY_IMAGE_INFORMATION *info, @@ -5630,7 +6283,11 @@ static NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr, ULONG flags ) SERVER_END_REQ; if (!status) { - if (view->protect & SEC_IMAGE) release_builtin_module( view->base ); + if (view->protect & SEC_IMAGE) + { + r_debug_remove_module( view->base ); + release_builtin_module( view->base ); + } if (flags & MEM_PRESERVE_PLACEHOLDER) free_pages_preserve_placeholder( view, view->base, view->size ); else delete_view( view ); } @@ -5833,6 +6490,13 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T char *addr = base; char *end = addr + size; + if (use_kernel_writewatch) + { + if (!(status = kernel_get_write_watches( base, size, addresses, count, flags & WRITE_WATCH_FLAG_RESET ))) + *granularity = page_size; + goto done; + } + while (pos < *count && addr < end) { if (!(get_page_vprot( addr ) & VPROT_WRITEWATCH)) addresses[pos++] = addr; @@ -5844,6 +6508,7 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T } else status = STATUS_INVALID_PARAMETER; +done: server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; } @@ -5885,7 +6550,58 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf SIZE_T size, SIZE_T *bytes_read ) { unsigned int status; +#ifdef linux + struct iovec local, remote; + int unix_pid; + ssize_t ret; + if (process == NtCurrentProcess()) + { + unix_pid = getpid(); + status = STATUS_SUCCESS; + } + else + { + SERVER_START_REQ( read_process_memory ) + { + req->handle = wine_server_obj_handle( process ); + status = wine_server_call( req ); + unix_pid = reply->unix_pid; + } + SERVER_END_REQ; + } + + if (status) + { + WARN( "Could not get unix_pid for process %p, status %#x.\n", process, status ); + size = 0; + goto done; + } + + local.iov_base = buffer; + local.iov_len = size; + + remote.iov_base = (void *)addr; + remote.iov_len = size; + + if ((ret = process_vm_readv( unix_pid, &local, 1, &remote, 1, 0 )) != size) + { + WARN( "Error reading memory from process %p, addr %p, size %p, buffer %p, ret %p, errno %d.\n", + process, addr, (void *)size, buffer, (void *)ret, errno ); + + if (ret == -1) + { + status = errno == ESRCH ? STATUS_PARTIAL_COPY : errno_to_status( errno ); + size = 0; + } + else + { + status = STATUS_PARTIAL_COPY; + size = ret; + } + } +done: +#else if (virtual_check_buffer_for_write( buffer, size )) { SERVER_START_REQ( read_process_memory ) @@ -5902,6 +6618,7 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf status = STATUS_ACCESS_VIOLATION; size = 0; } +#endif if (bytes_read) *bytes_read = size; return status; } @@ -6137,6 +6854,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL *ret = (ULONG_PTR)base; *size_ptr = size; } + TRACE("status %#x.\n", status); return status; } diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 9cb444342fe..e0870584a68 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -66,6 +66,19 @@ struct unwind_builtin_dll_params CONTEXT *context; }; +struct steamclient_setup_trampolines_params +{ + HMODULE src_mod; + HMODULE tgt_mod; +}; + +struct debugstr_pc_args +{ + void *pc; + char *buffer; + unsigned int size; +}; + enum ntdll_unix_funcs { unix_load_so_dll, @@ -76,8 +89,17 @@ enum ntdll_unix_funcs unix_wine_server_handle_to_fd, unix_wine_spawnvp, unix_system_time_precise, + unix_steamclient_setup_trampolines, + unix_is_pc_in_native_so, + unix_debugstr_pc, }; extern unixlib_handle_t __wine_unixlib_handle; +#define WINE_BACKTRACE_LOG_ON() WARN_ON(seh) + +#define WINE_BACKTRACE_LOG(args...) do { \ + WARN_(seh)("backtrace: " args); \ + } while (0) + #endif /* __NTDLL_UNIXLIB_H */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 45b8e1ab1c1..4668b58ef16 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -258,6 +258,15 @@ POBJECT_TYPE WINAPI ObGetObjectType( void *object ) return header->type; } +static const WCHAR section_type_name[] = {'S','e','c','t','i','o','n',0}; + +static struct _OBJECT_TYPE section_type = +{ + section_type_name +}; + +static POBJECT_TYPE p_section_type = §ion_type; + static const POBJECT_TYPE *known_types[] = { &ExEventObjectType, @@ -267,7 +276,8 @@ static const POBJECT_TYPE *known_types[] = &IoFileObjectType, &PsProcessType, &PsThreadType, - &SeTokenObjectType + &SeTokenObjectType, + &p_section_type, }; DECLARE_CRITICAL_SECTION(handle_map_cs); diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h index 472dc46fde3..ad53ee181a5 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl_private.h +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -22,7 +22,6 @@ #define __WINE_NTOSKRNL_PRIVATE_H #include -#include #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index 7444b81823c..3fd42c07613 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -36,12 +36,6 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); WINE_DEFAULT_DEBUG_CHANNEL(plugplay); -DECLARE_CRITICAL_SECTION(invalidated_devices_cs); -static CONDITION_VARIABLE invalidated_devices_cv = CONDITION_VARIABLE_INIT; - -static DEVICE_OBJECT **invalidated_devices; -static size_t invalidated_devices_count; - static inline const char *debugstr_propkey( const DEVPROPKEY *id ) { if (!id) return "(null)"; @@ -489,14 +483,8 @@ void WINAPI IoInvalidateDeviceRelations( DEVICE_OBJECT *device_object, DEVICE_RE switch (type) { case BusRelations: - EnterCriticalSection( &invalidated_devices_cs ); - invalidated_devices = realloc( invalidated_devices, - (invalidated_devices_count + 1) * sizeof(*invalidated_devices) ); - invalidated_devices[invalidated_devices_count++] = device_object; - LeaveCriticalSection( &invalidated_devices_cs ); - WakeConditionVariable( &invalidated_devices_cv ); + handle_bus_relations( device_object ); break; - default: FIXME("Unhandled relation %#x.\n", type); break; @@ -1113,30 +1101,6 @@ static NTSTATUS WINAPI pnp_manager_driver_entry( DRIVER_OBJECT *driver, UNICODE_ return STATUS_SUCCESS; } -static DWORD CALLBACK device_enum_thread_proc(void *arg) -{ - for (;;) - { - DEVICE_OBJECT *device; - - EnterCriticalSection( &invalidated_devices_cs ); - - while (!invalidated_devices_count) - SleepConditionVariableCS( &invalidated_devices_cv, &invalidated_devices_cs, INFINITE ); - - device = invalidated_devices[--invalidated_devices_count]; - - /* Don't hold the CS while enumerating the device. Tests show that - * calling IoInvalidateDeviceRelations() from another thread shouldn't - * block, even if this thread is blocked in an IRP handler. */ - LeaveCriticalSection( &invalidated_devices_cs ); - - handle_bus_relations( device ); - } - - return 0; -} - void pnp_manager_start(void) { WCHAR endpoint[] = L"\\pipe\\wine_plugplay"; @@ -1158,8 +1122,6 @@ void pnp_manager_start(void) RpcStringFreeW( &binding_str ); if (err) ERR("RpcBindingFromStringBinding() failed, error %#lx\n", err); - - CreateThread( NULL, 0, device_enum_thread_proc, NULL, 0, NULL ); } void pnp_manager_stop_driver( struct wine_driver *driver ) diff --git a/dlls/ntoskrnl.exe/tests/driver_pnp.c b/dlls/ntoskrnl.exe/tests/driver_pnp.c index f66d56de8c7..8d489074f90 100644 --- a/dlls/ntoskrnl.exe/tests/driver_pnp.c +++ b/dlls/ntoskrnl.exe/tests/driver_pnp.c @@ -299,11 +299,11 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp) device->power_state = PowerDeviceD0; status = ZwWaitForSingleObject(device->plug_event, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); status = ZwSetEvent(device->plug_event2, NULL); ok(!status, "Failed to set event, status %#lx.\n", status); status = ZwWaitForSingleObject(device->plug_event, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); ret = STATUS_SUCCESS; break; @@ -719,16 +719,15 @@ static NTSTATUS fdo_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG code) * for the other. */ status = ZwSetEvent(plug_event, NULL); - ok(!status, "Failed to set event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to set event, status %#lx.\n", status); status = ZwWaitForSingleObject(plug_event2, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); ok(surprise_removal_count == 1, "Got %u surprise removal events.\n", surprise_removal_count); /* We shouldn't get IRP_MN_REMOVE_DEVICE until all user-space * handles to the device are closed (and the user-space thread is * currently blocked in this ioctl and won't close its handle * yet.) */ - todo_wine_if (remove_device_count) - ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); + todo_wine ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); return STATUS_SUCCESS; } diff --git a/dlls/nvcuda/Makefile.in b/dlls/nvcuda/Makefile.in new file mode 100644 index 00000000000..6890c798d63 --- /dev/null +++ b/dlls/nvcuda/Makefile.in @@ -0,0 +1 @@ +MODULE = nvcuda.dll diff --git a/dlls/nvcuda/nvcuda.spec b/dlls/nvcuda/nvcuda.spec new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index ec6c7cbe4df..e3727b63923 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -172,6 +172,8 @@ my %manual_win_thunks = "glMapNamedBufferEXT" => 1, "glMapNamedBufferRange" => 1, "glMapNamedBufferRangeEXT" => 1, + "glShaderSource" => 1, + "glShaderSourceARB" => 1, "glUnmapBuffer" => 1, "glUnmapBufferARB" => 1, "glUnmapNamedBuffer" => 1, diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index e3ca82a9b03..74aff6b4bbd 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -2006,6 +2006,55 @@ static void test_copy_context(HDC hdc) ok(ret, "wglMakeCurrent failed, last error %#lx.\n", GetLastError()); } +static void test_child_window(HWND hwnd, PIXELFORMATDESCRIPTOR *pfd) +{ + int pixel_format; + DWORD t1, t; + HGLRC hglrc; + HWND child; + HDC hdc; + int res; + + child = CreateWindowA("static", "Title", WS_CHILDWINDOW | WS_VISIBLE, 50, 50, 100, 100, hwnd, NULL, NULL, NULL); + ok(!!child, "got error %lu.\n", GetLastError()); + + hdc = GetDC(child); + pixel_format = ChoosePixelFormat(hdc, pfd); + res = SetPixelFormat(hdc, pixel_format, pfd); + ok(res, "got error %lu.\n", GetLastError()); + + hglrc = wglCreateContext(hdc); + ok(!!hglrc, "got error %lu.\n", GetLastError()); + + /* Test SwapBuffers with NULL context. */ + + glDrawBuffer(GL_BACK); + + /* Currently blit happening for child window in winex11 may not be updated with the latest GL frame + * even on glXWaitForSbcOML() path. So simulate continuous present for the test purpose. */ + trace("Child window rectangle should turn from red to green now.\n"); + t1 = GetTickCount(); + while ((t = GetTickCount()) - t1 < 3000) + { + res = wglMakeCurrent(hdc, hglrc); + ok(res, "got error %lu.\n", GetLastError()); + if (t - t1 > 1500) + glClearColor(0.0f, 1.0f, 0.0f, 1.0f); + else + glClearColor(1.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + res = wglMakeCurrent(NULL, NULL); + ok(res, "got error %lu.\n", GetLastError()); + SwapBuffers(hdc); + } + + res = wglDeleteContext(hglrc); + ok(res, "got error %lu.\n", GetLastError()); + + ReleaseDC(child, hdc); + DestroyWindow(child); +} + START_TEST(opengl) { HWND hwnd; @@ -2138,6 +2187,9 @@ START_TEST(opengl) else skip("WGL_EXT_swap_control not supported, skipping test\n"); + if (winetest_interactive) + test_child_window(hwnd, &pfd); + cleanup: ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index c20abdf5488..b0cc3dd83b7 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -17979,22 +17979,6 @@ static void WINAPI glShaderOp3EXT( GLenum op, GLuint res, GLuint arg1, GLuint ar if ((status = UNIX_CALL( glShaderOp3EXT, &args ))) WARN( "glShaderOp3EXT returned %#lx\n", status ); } -static void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ) -{ - struct glShaderSource_params args = { .teb = NtCurrentTeb(), .shader = shader, .count = count, .string = string, .length = length }; - NTSTATUS status; - TRACE( "shader %d, count %d, string %p, length %p\n", shader, count, string, length ); - if ((status = UNIX_CALL( glShaderSource, &args ))) WARN( "glShaderSource returned %#lx\n", status ); -} - -static void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ) -{ - struct glShaderSourceARB_params args = { .teb = NtCurrentTeb(), .shaderObj = shaderObj, .count = count, .string = string, .length = length }; - NTSTATUS status; - TRACE( "shaderObj %d, count %d, string %p, length %p\n", shaderObj, count, string, length ); - if ((status = UNIX_CALL( glShaderSourceARB, &args ))) WARN( "glShaderSourceARB returned %#lx\n", status ); -} - static void WINAPI glShaderStorageBlockBinding( GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding ) { struct glShaderStorageBlockBinding_params args = { .teb = NtCurrentTeb(), .program = program, .storageBlockIndex = storageBlockIndex, .storageBlockBinding = storageBlockBinding }; @@ -24342,6 +24326,8 @@ extern void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ); extern void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ); extern void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); extern void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); +extern void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ); +extern void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ); extern GLboolean WINAPI glUnmapBuffer( GLenum target ); extern GLboolean WINAPI glUnmapBufferARB( GLenum target ); extern GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ); diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index b3cffa00a3e..2a308152735 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1292,6 +1292,149 @@ static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_mess return TRUE; } +static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLint *length ) +{ + static int needs_fixup = -1; + static unsigned int once; + + static const struct + { + const char *gameid; + const char *add_ext; + const char *search_str; + const char *prepend_str; + } + replace[] = + { + { + "333420", + + /* add_ext */ + "#version 120\r\n" + "#extension GL_ARB_explicit_uniform_location : enable\r\n" + "#extension GL_ARB_explicit_attrib_location : enable\r\n", + /* search_str */ + "uniform mat4 boneMatrices[NBONES];", + /* replace_str */ + "layout(location = 2) ", + }, + { + "242110", + /* add_ext */ + "#version 120\r\n", + }, + { + "229890", + /* add_ext */ + "#version 120\r\n", + }, + }; + static const char *add_ext; + static const char *search_str; + static const char *prepend_str; + static unsigned int add_ext_len, search_len, prepend_len; + unsigned int new_len; + const char *p, *next; + BOOL found = FALSE; + char *new, *out; + + if (needs_fixup == -1) + { + const char *sgi = getenv("SteamGameId"); + unsigned int i; + + if (!sgi) return NULL; + + for (i = 0; i < ARRAY_SIZE(replace); ++i) + if (!strcmp( sgi, replace[i].gameid )) break; + + needs_fixup = i < ARRAY_SIZE(replace); + if (needs_fixup) + { + add_ext = replace[i].add_ext; + add_ext_len = add_ext ? strlen(add_ext) : 0; + search_str = replace[i].search_str; + search_len = search_str ? strlen(search_str) : 0; + prepend_str = replace[i].prepend_str; + prepend_len = prepend_str ? strlen(prepend_str) : 0; + } + } + + if (!needs_fixup) return NULL; + + if (length || count != 1) return NULL; + + if (!once++) + FIXME( "HACK: Fixing up shader.\n" ); + + TRACE( "Appending extension string.\n" ); + new_len = strlen( *string ) + prepend_len + add_ext_len + 1; + new = out = malloc( new_len ); + memcpy( out, add_ext, add_ext_len ); + out += add_ext_len; + + if (!search_str) goto skip_search; + + next = *string; + while (*(p = next)) + { + while (*next && *next != '\r' && *next != '\n') ++next; + + if (next - p == search_len && !memcmp( p, search_str, search_len )) + { + TRACE( "Adding explicit location.\n" ); + memcpy( out, *string, p - *string ); + out += p - *string; + memcpy( out, prepend_str, prepend_len ); + out += prepend_len; + strcpy( out, p ); + found = TRUE; + break; + } + + while (*next == '\n' || *next == '\r') ++next; + } + +skip_search: + if (!found) + strcpy( out, *string ); + + return new; +} + +void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ) +{ + struct glShaderSource_params args = { .teb = NtCurrentTeb(), .shader = shader, .count = count, .string = string, .length = length }; + NTSTATUS status; + char *new; + TRACE( "shader %d, count %d, string %p, length %p\n", shader, count, string, length ); + if ((new = fixup_shader( count, string, length ))) + { + args.string = (const GLchar **)&new; + args.count = 1; + args.length = NULL; + } + if ((status = UNIX_CALL( glShaderSource, &args ))) WARN( "glShaderSource returned %#lx\n", status ); + free( new ); +} + +void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ) +{ + struct glShaderSourceARB_params args = { .teb = NtCurrentTeb(), .shaderObj = shaderObj, .count = count, .string = string, .length = length }; + NTSTATUS status; + char *new; + TRACE( "shaderObj %d, count %d, string %p, length %p\n", shaderObj, count, string, length ); + if ((new = fixup_shader( count, string, length ))) + { + args.string = (const GLcharARB **)&new; + args.count = 1; + args.length = NULL; + } + if ((status = UNIX_CALL( glShaderSourceARB, &args ))) WARN( "glShaderSourceARB returned %#lx\n", status ); + free( new ); +} + + /*********************************************************************** * OpenGL initialisation routine */ diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index e7e5e5f04e6..17df780ba0c 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -581,6 +581,7 @@ static void test_EnumProcessModulesEx(void) static void test_GetModuleInformation(void) { HMODULE hMod = GetModuleHandleA(NULL); + DWORD *tmp, counter = 0; MODULEINFO info; DWORD ret; @@ -600,10 +601,21 @@ static void test_GetModuleInformation(void) GetModuleInformation(hpQV, hMod, &info, sizeof(info)-1); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected error=ERROR_INSUFFICIENT_BUFFER but got %ld\n", GetLastError()); - SetLastError(0xdeadbeef); ret = GetModuleInformation(hpQV, hMod, &info, sizeof(info)); ok(ret == 1, "failed with %ld\n", GetLastError()); ok(info.lpBaseOfDll == hMod, "lpBaseOfDll=%p hMod=%p\n", info.lpBaseOfDll, hMod); + + hMod = LoadLibraryA("shell32.dll"); + ok(hMod != NULL, "Failed to load shell32.dll, error: %u\n", GetLastError()); + + ret = GetModuleInformation(hpQV, hMod, &info, sizeof(info)); + ok(ret == 1, "failed with %d\n", GetLastError()); + info.SizeOfImage /= sizeof(DWORD); + for (tmp = (DWORD *)hMod; info.SizeOfImage; info.SizeOfImage--) + counter ^= *tmp++; + trace("xor of shell32: %08x\n", counter); + + FreeLibrary(hMod); } static BOOL check_with_margin(SIZE_T perf, SIZE_T sysperf, int margin) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 4cf077e9dd3..a0f9ef0c2ff 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -438,13 +438,14 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) struct asf_reader *filter = impl_from_strmbase_filter(iface); WMT_STREAM_SELECTION selections[ARRAY_SIZE(filter->streams)]; WORD stream_numbers[ARRAY_SIZE(filter->streams)]; - IWMReaderAdvanced *reader_advanced; + IWMReaderAdvanced2 *reader_advanced; HRESULT hr = S_OK; + BOOL value; int i; TRACE("iface %p\n", iface); - if (FAILED(hr = IWMReader_QueryInterface(filter->reader, &IID_IWMReaderAdvanced, (void **)&reader_advanced))) + if (FAILED(hr = IWMReader_QueryInterface(filter->reader, &IID_IWMReaderAdvanced2, (void **)&reader_advanced))) return hr; for (i = 0; i < filter->stream_count; ++i) @@ -464,7 +465,7 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) break; } - if (FAILED(hr = IWMReaderAdvanced_SetAllocateForOutput(reader_advanced, i, TRUE))) + if (FAILED(hr = IWMReaderAdvanced2_SetAllocateForOutput(reader_advanced, i, TRUE))) { WARN("Failed to enable allocation for stream %u, hr %#lx\n", i, hr); break; @@ -486,20 +487,36 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) break; } - if (FAILED(hr = IPin_NewSegment(stream->source.pin.peer, 0, 0, 1))) + if (FAILED(hr = IPin_NewSegment(stream->source.pin.peer, stream->seek.llCurrent, stream->seek.llStop, stream->seek.dRate))) { WARN("Failed to start stream %u new segment, hr %#lx\n", i, hr); break; } + value = IMemInputPin_ReceiveCanBlock(stream->source.pMemInputPin) == S_OK; + if (FAILED(hr = IWMReaderAdvanced2_SetOutputSetting(reader_advanced, i, L"DedicatedDeliveryThread", + WMT_TYPE_BOOL, (BYTE *)&value, sizeof(value)))) + { + WARN("Failed to set DedicatedDeliveryThread for stream %u, hr %#lx\n", i, hr); + break; + } + selections[i] = WMT_ON; } - if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced_SetStreamsSelected(reader_advanced, + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetStreamsSelected(reader_advanced, filter->stream_count, stream_numbers, selections))) WARN("Failed to set reader %p stream selection, hr %#lx\n", filter->reader, hr); - IWMReaderAdvanced_Release(reader_advanced); + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetUserProvidedClock(reader_advanced, !filter->filter.clock))) + WARN("Failed to set user provided clock, hr %#lx\n", hr); + else if (!filter->filter.clock) + { + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_DeliverTime(reader_advanced, -1))) + WARN("Failed to set user time, hr %#lx\n", hr); + } + + IWMReaderAdvanced2_Release(reader_advanced); if (FAILED(hr)) return hr; @@ -589,7 +606,11 @@ static HRESULT WINAPI asf_reader_DecideBufferSize(struct strmbase_source *iface, buffer_size = format->nAvgBytesPerSec; } - req_props->cBuffers = max(req_props->cBuffers, 1); + if (IsEqualGUID(&stream->source.pin.mt.majortype, &MEDIATYPE_Audio)) + req_props->cBuffers = max(req_props->cBuffers, 50); + else + req_props->cBuffers = max(req_props->cBuffers, 10); + req_props->cbBuffer = max(req_props->cbBuffer, buffer_size); req_props->cbAlign = max(req_props->cbAlign, 1); return IMemAllocator_SetProperties(allocator, req_props, &ret_props); diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index 95e12e860ae..8b484d9b25a 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -206,7 +206,6 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) { DMO_OUTPUT_DATA_BUFFER *buffers = filter->buffers; DWORD status, i; - BOOL more_data; HRESULT hr; for (i = 0; i < filter->source_count; ++i) @@ -228,8 +227,6 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) do { - more_data = FALSE; - hr = IMediaObject_ProcessOutput(dmo, DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER, filter->source_count, buffers, &status); if (hr != S_OK) @@ -242,9 +239,6 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) if (!buffers[i].pBuffer) continue; - if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE) - more_data = TRUE; - if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIME) { if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH) @@ -270,7 +264,7 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) } } - } while (more_data); + } while (1); out: for (i = 0; i < filter->source_count; ++i) diff --git a/dlls/qasf/qasf.rgs b/dlls/qasf/qasf.rgs new file mode 100644 index 00000000000..de0d3e425ed --- /dev/null +++ b/dlls/qasf/qasf.rgs @@ -0,0 +1,15 @@ +HKCR +{ + NoRemove 'Media Type' + { + '{e436eb83-524f-11ce-9f53-0020af0ba770}' + { + '{6b6d0801-9ada-11d0-a520-00a0d10129c0}' + { + val '0' = s '0,4,,3026b275' + val '1' = s '0,4,,d129e2d6' + val 'Source Filter' = s '{187463a0-5bb7-11d3-acbe-0080c75e246e}' + } + } + } +} diff --git a/dlls/qasf/version.rc b/dlls/qasf/version.rc index dab46194395..70ec03ad6b1 100644 --- a/dlls/qasf/version.rc +++ b/dlls/qasf/version.rc @@ -24,3 +24,6 @@ #define WINE_PRODUCTVERSION_STR "9.0.0.4503" #include "wine/wine_common_ver.rc" + +/* @makedep: qasf.rgs */ +1 WINE_REGISTRY qasf.rgs diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 775d942f8f8..793348a6925 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -756,12 +756,20 @@ static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *bag, IE VARIANT var; HRESULT hr; + char sgi[64]; + TRACE("filter %p, bag %p, error_log %p.\n", filter, bag, error_log); V_VT(&var) = VT_I4; if (FAILED(hr = IPropertyBag_Read(bag, L"WaveInID", &var, error_log))) return hr; + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "470220")) + { + FIXME("HACK: returning error.\n"); + return E_FAIL; + } + EnterCriticalSection(&filter->filter.filter_cs); filter->id = V_I4(&var); LeaveCriticalSection(&filter->filter.filter_cs); diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 10eed43422e..93bbb264a1e 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -27,6 +27,7 @@ #include "dshow.h" #include "evcode.h" #include "strmif.h" +#include "initguid.h" #include "dsound.h" #include "amaudio.h" @@ -34,11 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -/* NOTE: buffer can still be filled completely, - * but we start waiting until only this amount is buffered - */ -static const REFERENCE_TIME DSoundRenderer_Max_Fill = 150 * 10000; - struct dsound_render { struct strmbase_filter filter; @@ -56,13 +52,15 @@ struct dsound_render /* Signaled when a flush or state change occurs, i.e. anything that needs * to immediately unblock the streaming thread. */ HANDLE flush_event; + HANDLE empty_event; REFERENCE_TIME stream_start; BOOL eos; IDirectSound8 *dsound; - LPDIRECTSOUNDBUFFER dsbuffer; - DWORD buf_size; - DWORD last_playpos, writepos; + IDirectSoundBuffer *dsbuffer; + + DWORD buffer_size; + DWORD write_pos; LONG volume; LONG pan; @@ -88,209 +86,130 @@ static struct dsound_render *impl_from_IAMDirectSound(IAMDirectSound *iface) return CONTAINING_RECORD(iface, struct dsound_render, IAMDirectSound_iface); } -static REFERENCE_TIME time_from_pos(struct dsound_render *This, DWORD pos) +static HRESULT dsound_render_write_data(struct dsound_render *filter, const void *data, DWORD size) { - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->sink.pin.mt.pbFormat; - REFERENCE_TIME ret = 10000000; - ret = ret * pos / wfx->nAvgBytesPerSec; - return ret; -} + WAVEFORMATEX *wfx = (WAVEFORMATEX *)filter->sink.pin.mt.pbFormat; + unsigned char silence = wfx->wBitsPerSample == 8 ? 128 : 0; + DWORD write_end, size1, size2; + void *data1, *data2; + HRESULT hr; -static DWORD pos_from_time(struct dsound_render *This, REFERENCE_TIME time) -{ - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->sink.pin.mt.pbFormat; - REFERENCE_TIME ret = time; - ret *= wfx->nAvgBytesPerSec; - ret /= 10000000; - ret -= ret % wfx->nBlockAlign; - return ret; -} + TRACE("filter %p, data %p, size %#lx\n", filter, data, size); -static void DSoundRender_UpdatePositions(struct dsound_render *This, DWORD *seqwritepos, DWORD *minwritepos) -{ - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->sink.pin.mt.pbFormat; - BYTE *buf1, *buf2; - DWORD size1, size2, playpos, writepos, old_writepos, old_playpos, adv; - BOOL writepos_set = This->writepos < This->buf_size; - - /* Update position and zero */ - old_writepos = This->writepos; - old_playpos = This->last_playpos; - if (old_writepos <= old_playpos) - old_writepos += This->buf_size; - - IDirectSoundBuffer_GetCurrentPosition(This->dsbuffer, &playpos, &writepos); - if (old_playpos > playpos) - adv = This->buf_size + playpos - old_playpos; + if (!size) + size = filter->buffer_size / 2; else - adv = playpos - old_playpos; - This->last_playpos = playpos; - if (adv) { - TRACE("Moving from %lu to %lu: clearing %lu bytes.\n", old_playpos, playpos, adv); - IDirectSoundBuffer_Lock(This->dsbuffer, old_playpos, adv, (void**)&buf1, &size1, (void**)&buf2, &size2, 0); - memset(buf1, wfx->wBitsPerSample == 8 ? 128 : 0, size1); - memset(buf2, wfx->wBitsPerSample == 8 ? 128 : 0, size2); - IDirectSoundBuffer_Unlock(This->dsbuffer, buf1, size1, buf2, size2); - } - *minwritepos = writepos; - if (!writepos_set || old_writepos < writepos) { - if (writepos_set) { - This->writepos = This->buf_size; - FIXME("Underrun of data occurred!\n"); + size = min(size, filter->buffer_size / 2); + + if (filter->write_pos == -1) + filter->write_pos = 0; + else + { + DWORD play_pos, write_pos; + + if (FAILED(hr = IDirectSoundBuffer_GetCurrentPosition(filter->dsbuffer, + &play_pos, &write_pos))) + return hr; + + if (filter->write_pos - play_pos <= write_pos - play_pos) + { + WARN("Buffer underrun detected, filter %p, dsound play pos %#lx, write pos %#lx, filter write pos %#lx!\n", + filter, play_pos, write_pos, filter->write_pos); + filter->write_pos = write_pos; } - *seqwritepos = writepos; - } else - *seqwritepos = This->writepos; -} -static HRESULT DSoundRender_GetWritePos(struct dsound_render *This, - DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip) -{ - DWORD writepos, min_writepos, playpos; - REFERENCE_TIME max_lag = 50 * 10000; - REFERENCE_TIME cur, writepos_t, delta_t; + write_end = (filter->write_pos + size) % filter->buffer_size; + if (write_end - filter->write_pos >= play_pos - filter->write_pos) + return S_FALSE; + } - DSoundRender_UpdatePositions(This, &writepos, &min_writepos); - playpos = This->last_playpos; - if (This->filter.clock) + if (FAILED(hr = IDirectSoundBuffer_Lock(filter->dsbuffer, filter->write_pos, + size, &data1, &size1, &data2, &size2, 0))) { - IReferenceClock_GetTime(This->filter.clock, &cur); - cur -= This->stream_start; - } else - write_at = -1; - - if (writepos == min_writepos) - max_lag = 0; - - *skip = 0; - if (write_at < 0) { - *ret_writepos = writepos; - goto end; + ERR("Failed to lock buffer %p, hr %#lx\n", filter->dsbuffer, hr); + return hr; } - if (writepos >= playpos) - writepos_t = cur + time_from_pos(This, writepos - playpos); - else - writepos_t = cur + time_from_pos(This, This->buf_size + writepos - playpos); - - /* write_at: Starting time of sample */ - /* cur: current time of play position */ - /* writepos_t: current time of our pointer play position */ - delta_t = write_at - writepos_t; - if (delta_t >= -max_lag && delta_t <= max_lag) { - TRACE("Continuing from old position\n"); - *ret_writepos = writepos; - } else if (delta_t < 0) { - REFERENCE_TIME past, min_writepos_t; - WARN("Delta too big %s/%s, overwriting old data or even skipping\n", debugstr_time(delta_t), debugstr_time(max_lag)); - if (min_writepos >= playpos) - min_writepos_t = cur + time_from_pos(This, min_writepos - playpos); - else - min_writepos_t = cur + time_from_pos(This, This->buf_size - playpos + min_writepos); - past = min_writepos_t - write_at; - if (past >= 0) { - DWORD skipbytes = pos_from_time(This, past); - WARN("Skipping %lu bytes.\n", skipbytes); - *skip = skipbytes; - *ret_writepos = min_writepos; - } else { - DWORD aheadbytes = pos_from_time(This, -past); - WARN("Advancing %lu bytes.\n", aheadbytes); - *ret_writepos = (min_writepos + aheadbytes) % This->buf_size; - } - } else /* delta_t > 0 */ { - DWORD aheadbytes; - WARN("Delta too big %s/%s, too far ahead\n", debugstr_time(delta_t), debugstr_time(max_lag)); - aheadbytes = pos_from_time(This, delta_t); - WARN("Advancing %lu bytes.\n", aheadbytes); - if (delta_t >= DSoundRenderer_Max_Fill) - return S_FALSE; - *ret_writepos = (min_writepos + aheadbytes) % This->buf_size; + TRACE("Locked data1 %p, size1 %#lx, data2 %p, size2 %#lx\n", data1, size1, data2, size2); + + if (!data) + { + memset(data1, silence, size1); + memset(data2, silence, size2); } -end: - if (playpos >= *ret_writepos) - *pfree = playpos - *ret_writepos; else - *pfree = This->buf_size + playpos - *ret_writepos; - if (time_from_pos(This, This->buf_size - *pfree) >= DSoundRenderer_Max_Fill) { - TRACE("Blocked: too full %s / %s\n", debugstr_time(time_from_pos(This, This->buf_size - *pfree)), - debugstr_time(DSoundRenderer_Max_Fill)); - return S_FALSE; + { + memcpy(data1, data, size1); + data = (char *)data + size1; + memcpy(data2, data, size2); } - return S_OK; -} -static HRESULT DSoundRender_HandleEndOfStream(struct dsound_render *This) -{ - while (This->filter.state == State_Running) + if (FAILED(hr = IDirectSoundBuffer_Unlock(filter->dsbuffer, data1, size1, data2, size2))) { - DWORD pos1, pos2; - DSoundRender_UpdatePositions(This, &pos1, &pos2); - if (pos1 == pos2) - break; - - WaitForSingleObject(This->flush_event, 10); + ERR("Failed to unlock buffer %p, hr %#lx\n", filter->dsbuffer, hr); + return hr; } + TRACE("Unlocked data1 %p, size1 %#lx, data2 %p, size2 %#lx\n", data1, size1, data2, size2); + + filter->write_pos += size; + filter->write_pos %= filter->buffer_size; + + TRACE("Written size %#lx, write_pos %#lx\n", size, filter->write_pos); + return S_OK; } -static HRESULT DSoundRender_SendSampleData(struct dsound_render *This, - REFERENCE_TIME tStart, REFERENCE_TIME tStop, const BYTE *data, DWORD size) +static HRESULT dsound_render_wait_play_end(struct dsound_render *filter) { + DWORD start_pos, play_pos, written, played = 0; HRESULT hr; - while (size && This->filter.state != State_Stopped) { - DWORD writepos, skip = 0, free, size1, size2, ret; - BYTE *buf1, *buf2; + if (FAILED(hr = IDirectSoundBuffer_GetCurrentPosition(filter->dsbuffer, + &start_pos, NULL))) + { + ERR("Failed to get buffer positions, hr %#lx\n", hr); + return hr; + } - if (This->filter.state == State_Running) - hr = DSoundRender_GetWritePos(This, &writepos, tStart, &free, &skip); - else - hr = S_FALSE; - - if (hr != S_OK) { - ret = WaitForSingleObject(This->flush_event, 10); - if (This->sink.flushing || This->filter.state == State_Stopped) - return This->filter.state == State_Paused ? S_OK : VFW_E_WRONG_STATE; - if (ret != WAIT_TIMEOUT) - ERR("WaitForSingleObject() returned %ld.\n", ret); - continue; - } - tStart = -1; + written = filter->write_pos - start_pos + (filter->write_pos < start_pos ? filter->buffer_size : 0); - if (skip) - FIXME("Sample dropped %lu of %lu bytes.\n", skip, size); - if (skip >= size) - return S_OK; - data += skip; - size -= skip; + if (FAILED(hr = dsound_render_write_data(filter, NULL, 0))) + return hr; - hr = IDirectSoundBuffer_Lock(This->dsbuffer, writepos, min(free, size), (void**)&buf1, &size1, (void**)&buf2, &size2, 0); - if (hr != DS_OK) { - ERR("Failed to lock sound buffer, hr %#lx.\n", hr); - break; + while (filter->filter.state == State_Running) + { + HANDLE handles[] = {filter->empty_event, filter->flush_event}; + + if (FAILED(hr = IDirectSoundBuffer_GetCurrentPosition(filter->dsbuffer, + &play_pos, NULL))) + { + ERR("Failed to get buffer positions, hr %#lx\n", hr); + return hr; } - memcpy(buf1, data, size1); - if (size2) - memcpy(buf2, data+size1, size2); - IDirectSoundBuffer_Unlock(This->dsbuffer, buf1, size1, buf2, size2); - This->writepos = (writepos + size1 + size2) % This->buf_size; - TRACE("Wrote %lu bytes at %lu, next at %lu - (%lu/%lu)\n", size1+size2, writepos, This->writepos, free, size); - data += size1 + size2; - size -= size1 + size2; + + played += play_pos - start_pos + (play_pos < start_pos ? filter->buffer_size : 0); + if (played >= written) + break; + + WARN("Waiting for EOS, start_pos %#lx, play_pos %#lx, written %#lx, played %#lx\n", + start_pos, play_pos, written, played); + + WaitForMultipleObjects(2, handles, FALSE, INFINITE); + start_pos = play_pos; } + return S_OK; } -static HRESULT DSoundRender_PrepareReceive(struct dsound_render *This, IMediaSample *pSample) +static HRESULT dsound_render_configure_buffer(struct dsound_render *filter, IMediaSample *sample) { HRESULT hr; AM_MEDIA_TYPE *amt; - if (IMediaSample_GetMediaType(pSample, &amt) == S_OK) + if (IMediaSample_GetMediaType(sample, &amt) == S_OK) { - AM_MEDIA_TYPE *orig = &This->sink.pin.mt; + AM_MEDIA_TYPE *orig = &filter->sink.pin.mt; WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat; WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat; @@ -305,56 +224,32 @@ static HRESULT DSoundRender_PrepareReceive(struct dsound_render *This, IMediaSam { if (origfmt->nSamplesPerSec != newfmt->nSamplesPerSec) { - hr = IDirectSoundBuffer_SetFrequency(This->dsbuffer, + hr = IDirectSoundBuffer_SetFrequency(filter->dsbuffer, newfmt->nSamplesPerSec); if (FAILED(hr)) return VFW_E_TYPE_NOT_ACCEPTED; FreeMediaType(orig); CopyMediaType(orig, amt); - IMediaSample_SetMediaType(pSample, NULL); + IMediaSample_SetMediaType(sample, NULL); } } else return VFW_E_TYPE_NOT_ACCEPTED; } - return S_OK; -} - -static HRESULT DSoundRender_DoRenderSample(struct dsound_render *This, IMediaSample *pSample) -{ - LPBYTE pbSrcStream = NULL; - LONG cbSrcStream = 0; - REFERENCE_TIME tStart, tStop; - HRESULT hr; - - hr = IMediaSample_GetPointer(pSample, &pbSrcStream); - if (FAILED(hr)) - { - ERR("Failed to get buffer pointer, hr %#lx.\n", hr); - return hr; - } - - hr = IMediaSample_GetTime(pSample, &tStart, &tStop); - if (FAILED(hr)) { - ERR("Failed to get sample time, hr %#lx.\n", hr); - tStart = tStop = -1; - } - if (IMediaSample_IsPreroll(pSample) == S_OK) - { - TRACE("Preroll!\n"); - return S_OK; - } - - cbSrcStream = IMediaSample_GetActualDataLength(pSample); - return DSoundRender_SendSampleData(This, tStart, tStop, pbSrcStream, cbSrcStream); + return S_OK; } static HRESULT WINAPI dsound_render_sink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin); - REFERENCE_TIME start, stop; + WAVEFORMATEX *wfx = (WAVEFORMATEX *)filter->sink.pin.mt.pbFormat; + REFERENCE_TIME current = 0, start = 0, stop; HRESULT hr; + BYTE *data; + LONG size; + + TRACE("filter %p, sample %p.\n", filter, sample); if (filter->eos || filter->sink.flushing) return S_FALSE; @@ -362,16 +257,62 @@ static HRESULT WINAPI dsound_render_sink_Receive(struct strmbase_sink *iface, IM if (filter->filter.state == State_Stopped) return VFW_E_WRONG_STATE; - if (FAILED(hr = DSoundRender_PrepareReceive(filter, sample))) + if (FAILED(hr = dsound_render_configure_buffer(filter, sample))) return hr; - if (filter->filter.clock && SUCCEEDED(IMediaSample_GetTime(sample, &start, &stop))) - strmbase_passthrough_update_time(&filter->passthrough, start); + if (filter->filter.clock) + { + if (SUCCEEDED(IMediaSample_GetTime(sample, &start, &stop))) + strmbase_passthrough_update_time(&filter->passthrough, start); + + if (filter->stream_start != -1 && SUCCEEDED(IReferenceClock_GetTime(filter->filter.clock, ¤t))) + current -= filter->stream_start; + } if (filter->filter.state == State_Paused) SetEvent(filter->state_event); - return DSoundRender_DoRenderSample(filter, sample); + if (FAILED(hr = IMediaSample_GetPointer(sample, &data))) + { + ERR("Failed to get buffer pointer, hr %#lx.\n", hr); + return hr; + } + + size = IMediaSample_GetActualDataLength(sample); + + if (filter->write_pos == -1 && (start + 300000) > current) + { + /* prepend at least 30ms of silence before the first sample */ + DWORD length = (start + 300000 - current) * wfx->nAvgBytesPerSec / 10000000; + length -= length % wfx->nBlockAlign; + + if (length != 0 && FAILED(hr = dsound_render_write_data(filter, NULL, length))) + return hr; + } + else if (filter->write_pos == -1 && start < current) + { + /* or skip some data instead if the first sample is late */ + DWORD offset = (current - start) * wfx->nAvgBytesPerSec / 10000000; + offset -= offset % wfx->nBlockAlign; + + data += min(size, offset); + size -= min(size, offset); + } + + while (size && (hr = dsound_render_write_data(filter, data, size)) == S_FALSE) + { + HANDLE handles[] = {filter->empty_event, filter->flush_event}; + + WARN("Could not write %#lx bytes, waiting for buffer to empty.\n", size); + + if (WaitForMultipleObjects(2, handles, FALSE, INFINITE) == WAIT_OBJECT_0 + 1) + { + TRACE("Flush event notified, dropping sample.\n"); + return S_OK; + } + } + + return hr; } static HRESULT dsound_render_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) @@ -397,42 +338,65 @@ static HRESULT dsound_render_sink_query_accept(struct strmbase_pin *iface, const static HRESULT dsound_render_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) { - struct dsound_render *This = impl_from_strmbase_pin(&iface->pin); + struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin); const WAVEFORMATEX *format = (WAVEFORMATEX *)mt->pbFormat; - HRESULT hr = S_OK; + IDirectSoundNotify *notify; DSBUFFERDESC buf_desc; - - This->buf_size = format->nAvgBytesPerSec; + HRESULT hr = S_OK; memset(&buf_desc,0,sizeof(DSBUFFERDESC)); buf_desc.dwSize = sizeof(DSBUFFERDESC); buf_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLPAN | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GLOBALFOCUS | - DSBCAPS_GETCURRENTPOSITION2; - buf_desc.dwBufferBytes = This->buf_size; + DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLPOSITIONNOTIFY; + buf_desc.dwBufferBytes = format->nAvgBytesPerSec; buf_desc.lpwfxFormat = (WAVEFORMATEX *)format; - hr = IDirectSound8_CreateSoundBuffer(This->dsound, &buf_desc, &This->dsbuffer, NULL); - This->writepos = This->buf_size; - if (FAILED(hr)) + + filter->buffer_size = format->nAvgBytesPerSec; + filter->write_pos = -1; + + if (FAILED(hr = IDirectSound8_CreateSoundBuffer(filter->dsound, &buf_desc, &filter->dsbuffer, NULL))) ERR("Failed to create sound buffer, hr %#lx.\n", hr); + else if (FAILED(hr = IDirectSoundBuffer_QueryInterface(filter->dsbuffer, &IID_IDirectSoundNotify, + (void **)¬ify))) + ERR("Failed to query IDirectSoundNotify iface, hr %#lx.\n", hr); + else + { + DSBPOSITIONNOTIFY positions[10] = {{.dwOffset = 0, .hEventNotify = filter->empty_event}}; + int i; + + TRACE("Created buffer %p with size %#lx\n", filter->dsbuffer, filter->buffer_size); + + for (i = 1; i < ARRAY_SIZE(positions); ++i) + { + positions[i] = positions[i - 1]; + positions[i].dwOffset += filter->buffer_size / ARRAY_SIZE(positions); + } + + if (FAILED(hr = IDirectSoundNotify_SetNotificationPositions(notify, + ARRAY_SIZE(positions), positions))) + ERR("Failed to set notification positions, hr %#lx\n", hr); + + IDirectSoundNotify_Release(notify); + } if (SUCCEEDED(hr)) { - hr = IDirectSoundBuffer_SetVolume(This->dsbuffer, This->volume); + hr = IDirectSoundBuffer_SetVolume(filter->dsbuffer, filter->volume); if (FAILED(hr)) - ERR("Failed to set volume to %ld, hr %#lx.\n", This->volume, hr); + ERR("Failed to set volume to %ld, hr %#lx.\n", filter->volume, hr); - hr = IDirectSoundBuffer_SetPan(This->dsbuffer, This->pan); + hr = IDirectSoundBuffer_SetPan(filter->dsbuffer, filter->pan); if (FAILED(hr)) - ERR("Failed to set pan to %ld, hr %#lx.\n", This->pan, hr); + ERR("Failed to set pan to %ld, hr %#lx.\n", filter->pan, hr); hr = S_OK; } if (FAILED(hr) && hr != VFW_E_ALREADY_CONNECTED) { - if (This->dsbuffer) - IDirectSoundBuffer_Release(This->dsbuffer); - This->dsbuffer = NULL; + if (filter->dsbuffer) + IDirectSoundBuffer_Release(filter->dsbuffer); + filter->dsbuffer = NULL; } return hr; @@ -440,13 +404,13 @@ static HRESULT dsound_render_sink_connect(struct strmbase_sink *iface, IPin *pee static void dsound_render_sink_disconnect(struct strmbase_sink *iface) { - struct dsound_render *This = impl_from_strmbase_pin(&iface->pin); + struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin); - TRACE("(%p)->()\n", iface); + TRACE("filter %p\n", filter); - if (This->dsbuffer) - IDirectSoundBuffer_Release(This->dsbuffer); - This->dsbuffer = NULL; + if (filter->dsbuffer) + IDirectSoundBuffer_Release(filter->dsbuffer); + filter->dsbuffer = NULL; } static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) @@ -454,8 +418,6 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin); IFilterGraph *graph = filter->filter.graph; IMediaEventSink *event_sink; - void *buffer; - DWORD size; filter->eos = TRUE; @@ -470,11 +432,8 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) strmbase_passthrough_eos(&filter->passthrough); SetEvent(filter->state_event); - DSoundRender_HandleEndOfStream(filter); - - IDirectSoundBuffer_Lock(filter->dsbuffer, 0, 0, &buffer, &size, NULL, NULL, DSBLOCK_ENTIREBUFFER); - memset(buffer, 0, size); - IDirectSoundBuffer_Unlock(filter->dsbuffer, buffer, size, NULL, 0); + if (filter->dsbuffer && filter->write_pos != -1) + dsound_render_wait_play_end(filter); return S_OK; } @@ -506,7 +465,7 @@ static HRESULT dsound_render_sink_end_flush(struct strmbase_sink *iface) IDirectSoundBuffer_Lock(filter->dsbuffer, 0, 0, &buffer, &size, NULL, NULL, DSBLOCK_ENTIREBUFFER); memset(buffer, 0, size); IDirectSoundBuffer_Unlock(filter->dsbuffer, buffer, size, NULL, 0); - filter->writepos = filter->buf_size; + filter->write_pos = -1; } LeaveCriticalSection(&filter->filter.stream_cs); @@ -545,6 +504,7 @@ static void dsound_render_destroy(struct strmbase_filter *iface) CloseHandle(filter->state_event); CloseHandle(filter->flush_event); + CloseHandle(filter->empty_event); strmbase_passthrough_cleanup(&filter->passthrough); strmbase_filter_cleanup(&filter->filter); @@ -625,10 +585,10 @@ static HRESULT dsound_render_stop_stream(struct strmbase_filter *iface) struct dsound_render *filter = impl_from_strmbase_filter(iface); if (filter->sink.pin.peer) - { IDirectSoundBuffer_Stop(filter->dsbuffer); - filter->writepos = filter->buf_size; - } + + filter->stream_start = -1; + return S_OK; } @@ -664,61 +624,61 @@ static const struct strmbase_filter_ops filter_ops = .filter_wait_state = dsound_render_wait_state, }; -/*** IUnknown methods ***/ -static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface, - REFIID riid, - LPVOID*ppvObj) { - struct dsound_render *This = impl_from_IBasicAudio(iface); - - TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj); - - return IUnknown_QueryInterface(This->filter.outer_unk, riid, ppvObj); +static HRESULT WINAPI basic_audio_QueryInterface(IBasicAudio *iface, REFIID riid, void **out) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, riid, out); } -static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) { - struct dsound_render *This = impl_from_IBasicAudio(iface); - - TRACE("(%p/%p)->()\n", This, iface); - - return IUnknown_AddRef(This->filter.outer_unk); +static ULONG WINAPI basic_audio_AddRef(IBasicAudio *iface) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); + return IUnknown_AddRef(filter->filter.outer_unk); } -static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) { - struct dsound_render *This = impl_from_IBasicAudio(iface); - - TRACE("(%p/%p)->()\n", This, iface); - - return IUnknown_Release(This->filter.outer_unk); +static ULONG WINAPI basic_audio_Release(IBasicAudio *iface) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); + return IUnknown_Release(filter->filter.outer_unk); } -HRESULT WINAPI basic_audio_GetTypeInfoCount(IBasicAudio *iface, UINT *count) +static HRESULT WINAPI basic_audio_GetTypeInfoCount(IBasicAudio *iface, UINT *count) { - TRACE("iface %p, count %p.\n", iface, count); + struct dsound_render *filter = impl_from_IBasicAudio(iface); + + TRACE("filter %p, count %p.\n", filter, count); + *count = 1; + return S_OK; } -HRESULT WINAPI basic_audio_GetTypeInfo(IBasicAudio *iface, UINT index, +static HRESULT WINAPI basic_audio_GetTypeInfo(IBasicAudio *iface, UINT index, LCID lcid, ITypeInfo **typeinfo) { - TRACE("iface %p, index %u, lcid %#lx, typeinfo %p.\n", iface, index, lcid, typeinfo); + struct dsound_render *filter = impl_from_IBasicAudio(iface); + + TRACE("filter %p, index %u, lcid %lu, typeinfo %p.\n", filter, index, lcid, typeinfo); + return strmbase_get_typeinfo(IBasicAudio_tid, typeinfo); } -HRESULT WINAPI basic_audio_GetIDsOfNames(IBasicAudio *iface, REFIID iid, +static HRESULT WINAPI basic_audio_GetIDsOfNames(IBasicAudio *iface, REFIID iid, LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { + struct dsound_render *filter = impl_from_IBasicAudio(iface); ITypeInfo *typeinfo; HRESULT hr; - TRACE("iface %p, iid %s, names %p, count %u, lcid %#lx, ids %p.\n", - iface, debugstr_guid(iid), names, count, lcid, ids); + TRACE("filter %p, iid %s, names %p, count %u, lcid %lu, ids %p.\n", + filter, debugstr_guid(iid), names, count, lcid, ids); if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) { hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); ITypeInfo_Release(typeinfo); } + return hr; } @@ -728,210 +688,178 @@ static HRESULT WINAPI basic_audio_Invoke(IBasicAudio *iface, DISPID id, REFIID i ITypeInfo *typeinfo; HRESULT hr; - TRACE("iface %p, id %ld, iid %s, lcid %#lx, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", - iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + TRACE("filter %p, id %ld, iid %s, lcid %lu, flags %u, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) { hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); ITypeInfo_Release(typeinfo); } + return hr; } -static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface, - LONG lVolume) { - struct dsound_render *This = impl_from_IBasicAudio(iface); +static HRESULT WINAPI basic_audio_put_Volume(IBasicAudio *iface, LONG volume) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); - TRACE("filter %p, volume %ld.\n", This, lVolume); + TRACE("filter %p, volume %ld.\n", filter, volume); - if (lVolume > DSBVOLUME_MAX || lVolume < DSBVOLUME_MIN) + if (volume > DSBVOLUME_MAX || volume < DSBVOLUME_MIN) return E_INVALIDARG; - if (This->dsbuffer) { - if (FAILED(IDirectSoundBuffer_SetVolume(This->dsbuffer, lVolume))) - return E_FAIL; - } + if (filter->dsbuffer && FAILED(IDirectSoundBuffer_SetVolume(filter->dsbuffer, volume))) + return E_FAIL; - This->volume = lVolume; + filter->volume = volume; return S_OK; } -static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface, - LONG *plVolume) { - struct dsound_render *This = impl_from_IBasicAudio(iface); +static HRESULT WINAPI basic_audio_get_Volume(IBasicAudio *iface, LONG *volume) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); - TRACE("(%p/%p)->(%p)\n", This, iface, plVolume); + TRACE("filter %p, volume %p.\n", filter, volume); - if (!plVolume) + if (!volume) return E_POINTER; - *plVolume = This->volume; + *volume = filter->volume; return S_OK; } -static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface, - LONG lBalance) { - struct dsound_render *This = impl_from_IBasicAudio(iface); +static HRESULT WINAPI basic_audio_put_Balance(IBasicAudio *iface, LONG balance) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); - TRACE("filter %p, balance %ld.\n", This, lBalance); + TRACE("filter %p, balance %ld.\n", filter, balance); - if (lBalance < DSBPAN_LEFT || lBalance > DSBPAN_RIGHT) + if (balance < DSBPAN_LEFT || balance > DSBPAN_RIGHT) return E_INVALIDARG; - if (This->dsbuffer) { - if (FAILED(IDirectSoundBuffer_SetPan(This->dsbuffer, lBalance))) - return E_FAIL; - } + if (filter->dsbuffer && FAILED(IDirectSoundBuffer_SetPan(filter->dsbuffer, balance))) + return E_FAIL; - This->pan = lBalance; + filter->pan = balance; return S_OK; } -static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface, - LONG *plBalance) { - struct dsound_render *This = impl_from_IBasicAudio(iface); +static HRESULT WINAPI basic_audio_get_Balance(IBasicAudio *iface, LONG *balance) +{ + struct dsound_render *filter = impl_from_IBasicAudio(iface); - TRACE("(%p/%p)->(%p)\n", This, iface, plBalance); + TRACE("filter %p, balance %p.\n", filter, balance); - if (!plBalance) + if (!balance) return E_POINTER; - *plBalance = This->pan; + *balance = filter->pan; return S_OK; } -static const IBasicAudioVtbl IBasicAudio_Vtbl = +static const IBasicAudioVtbl basic_audio_vtbl = { - Basicaudio_QueryInterface, - Basicaudio_AddRef, - Basicaudio_Release, + basic_audio_QueryInterface, + basic_audio_AddRef, + basic_audio_Release, basic_audio_GetTypeInfoCount, basic_audio_GetTypeInfo, basic_audio_GetIDsOfNames, basic_audio_Invoke, - Basicaudio_put_Volume, - Basicaudio_get_Volume, - Basicaudio_put_Balance, - Basicaudio_get_Balance + basic_audio_put_Volume, + basic_audio_get_Volume, + basic_audio_put_Balance, + basic_audio_get_Balance, }; -/*** IUnknown methods ***/ -static HRESULT WINAPI AMDirectSound_QueryInterface(IAMDirectSound *iface, - REFIID riid, - LPVOID*ppvObj) +static HRESULT WINAPI am_direct_sound_QueryInterface(IAMDirectSound *iface, REFIID riid, void **out) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj); - - return IUnknown_QueryInterface(This->filter.outer_unk, riid, ppvObj); + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, riid, out); } -static ULONG WINAPI AMDirectSound_AddRef(IAMDirectSound *iface) +static ULONG WINAPI am_direct_sound_AddRef(IAMDirectSound *iface) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - TRACE("(%p/%p)->()\n", This, iface); - - return IUnknown_AddRef(This->filter.outer_unk); + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + return IUnknown_AddRef(filter->filter.outer_unk); } -static ULONG WINAPI AMDirectSound_Release(IAMDirectSound *iface) +static ULONG WINAPI am_direct_sound_Release(IAMDirectSound *iface) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - TRACE("(%p/%p)->()\n", This, iface); - - return IUnknown_Release(This->filter.outer_unk); + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + return IUnknown_Release(filter->filter.outer_unk); } -/*** IAMDirectSound methods ***/ -static HRESULT WINAPI AMDirectSound_GetDirectSoundInterface(IAMDirectSound *iface, IDirectSound **ds) +static HRESULT WINAPI am_direct_sound_GetDirectSoundInterface(IAMDirectSound *iface, IDirectSound **ds) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, ds); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, ds %p stub!\n", filter, ds); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_GetPrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf) +static HRESULT WINAPI am_direct_sound_GetPrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, buf); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, buf %p stub!\n", filter, buf); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_GetSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf) +static HRESULT WINAPI am_direct_sound_GetSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, buf); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, buf %p stub!\n", filter, buf); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_ReleaseDirectSoundInterface(IAMDirectSound *iface, IDirectSound *ds) +static HRESULT WINAPI am_direct_sound_ReleaseDirectSoundInterface(IAMDirectSound *iface, IDirectSound *ds) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, ds); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, ds %p stub!\n", filter, ds); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_ReleasePrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf) +static HRESULT WINAPI am_direct_sound_ReleasePrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, buf); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, buf %p stub!\n", filter, buf); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_ReleaseSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf) +static HRESULT WINAPI am_direct_sound_ReleaseSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p): stub\n", This, iface, buf); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, buf %p stub!\n", filter, buf); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_SetFocusWindow(IAMDirectSound *iface, HWND hwnd, BOOL bgaudible) +static HRESULT WINAPI am_direct_sound_SetFocusWindow(IAMDirectSound *iface, HWND hwnd, BOOL bgaudible) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p,%d): stub\n", This, iface, hwnd, bgaudible); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, hwnd %p, bgaudible %d stub!\n", filter, hwnd, bgaudible); return E_NOTIMPL; } -static HRESULT WINAPI AMDirectSound_GetFocusWindow(IAMDirectSound *iface, HWND *hwnd, BOOL *bgaudible) +static HRESULT WINAPI am_direct_sound_GetFocusWindow(IAMDirectSound *iface, HWND *hwnd, BOOL *bgaudible) { - struct dsound_render *This = impl_from_IAMDirectSound(iface); - - FIXME("(%p/%p)->(%p,%p): stub\n", This, iface, hwnd, bgaudible); - + struct dsound_render *filter = impl_from_IAMDirectSound(iface); + FIXME("filter %p, hwnd %p, bgaudible %p stub!\n", filter, hwnd, bgaudible); return E_NOTIMPL; } -static const IAMDirectSoundVtbl IAMDirectSound_Vtbl = +static const IAMDirectSoundVtbl am_direct_sound_vtbl = { - AMDirectSound_QueryInterface, - AMDirectSound_AddRef, - AMDirectSound_Release, - AMDirectSound_GetDirectSoundInterface, - AMDirectSound_GetPrimaryBufferInterface, - AMDirectSound_GetSecondaryBufferInterface, - AMDirectSound_ReleaseDirectSoundInterface, - AMDirectSound_ReleasePrimaryBufferInterface, - AMDirectSound_ReleaseSecondaryBufferInterface, - AMDirectSound_SetFocusWindow, - AMDirectSound_GetFocusWindow + am_direct_sound_QueryInterface, + am_direct_sound_AddRef, + am_direct_sound_Release, + am_direct_sound_GetDirectSoundInterface, + am_direct_sound_GetPrimaryBufferInterface, + am_direct_sound_GetSecondaryBufferInterface, + am_direct_sound_ReleaseDirectSoundInterface, + am_direct_sound_ReleasePrimaryBufferInterface, + am_direct_sound_ReleaseSecondaryBufferInterface, + am_direct_sound_SetFocusWindow, + am_direct_sound_GetFocusWindow, }; static struct dsound_render *impl_from_IQualityControl(IQualityControl *iface) @@ -939,52 +867,48 @@ static struct dsound_render *impl_from_IQualityControl(IQualityControl *iface) return CONTAINING_RECORD(iface, struct dsound_render, IQualityControl_iface); } -static HRESULT WINAPI dsound_render_qc_QueryInterface(IQualityControl *iface, +static HRESULT WINAPI quality_control_QueryInterface(IQualityControl *iface, REFIID iid, void **out) { struct dsound_render *filter = impl_from_IQualityControl(iface); return IUnknown_QueryInterface(filter->filter.outer_unk, iid, out); } -static ULONG WINAPI dsound_render_qc_AddRef(IQualityControl *iface) +static ULONG WINAPI quality_control_AddRef(IQualityControl *iface) { struct dsound_render *filter = impl_from_IQualityControl(iface); return IUnknown_AddRef(filter->filter.outer_unk); } -static ULONG WINAPI dsound_render_qc_Release(IQualityControl *iface) +static ULONG WINAPI quality_control_Release(IQualityControl *iface) { struct dsound_render *filter = impl_from_IQualityControl(iface); return IUnknown_Release(filter->filter.outer_unk); } -static HRESULT WINAPI dsound_render_qc_Notify(IQualityControl *iface, +static HRESULT WINAPI quality_control_Notify(IQualityControl *iface, IBaseFilter *sender, Quality q) { struct dsound_render *filter = impl_from_IQualityControl(iface); - FIXME("filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s, stub!\n", filter, sender, q.Type, q.Proportion, debugstr_time(q.Late), debugstr_time(q.TimeStamp)); - return E_NOTIMPL; } -static HRESULT WINAPI dsound_render_qc_SetSink(IQualityControl *iface, IQualityControl *sink) +static HRESULT WINAPI quality_control_SetSink(IQualityControl *iface, IQualityControl *sink) { struct dsound_render *filter = impl_from_IQualityControl(iface); - - FIXME("filter %p, sink %p, stub!\n", filter, sink); - + FIXME("filter %p, sink %p stub!\n", filter, sink); return E_NOTIMPL; } -static const IQualityControlVtbl dsound_render_qc_vtbl = +static const IQualityControlVtbl quality_control_vtbl = { - dsound_render_qc_QueryInterface, - dsound_render_qc_AddRef, - dsound_render_qc_Release, - dsound_render_qc_Notify, - dsound_render_qc_SetSink, + quality_control_QueryInterface, + quality_control_AddRef, + quality_control_Release, + quality_control_Notify, + quality_control_SetSink, }; HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) @@ -998,6 +922,8 @@ HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) IDirectSoundBuffer *buffer; HRESULT hr; + TRACE("outer %p, out %p.\n", outer, out); + if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; @@ -1039,13 +965,15 @@ HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) ISeekingPassThru_Init(&object->passthrough.ISeekingPassThru_iface, TRUE, &object->sink.pin.IPin_iface); strmbase_sink_init(&object->sink, &object->filter, L"Audio Input pin (rendered)", &sink_ops, NULL); + object->stream_start = -1; object->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); object->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); + object->empty_event = CreateEventW(NULL, FALSE, FALSE, NULL); - object->IBasicAudio_iface.lpVtbl = &IBasicAudio_Vtbl; - object->IAMDirectSound_iface.lpVtbl = &IAMDirectSound_Vtbl; - object->IQualityControl_iface.lpVtbl = &dsound_render_qc_vtbl; + object->IBasicAudio_iface.lpVtbl = &basic_audio_vtbl; + object->IAMDirectSound_iface.lpVtbl = &am_direct_sound_vtbl; + object->IQualityControl_iface.lpVtbl = &quality_control_vtbl; TRACE("Created DirectSound renderer %p.\n", object); *out = &object->filter.IUnknown_inner; diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 4100e71be3a..efa77e09d0d 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -74,6 +74,7 @@ struct filter struct list entry; IBaseFilter *filter; IMediaSeeking *seeking; + IMediaPosition *position; WCHAR *name; BOOL sorting; }; @@ -522,6 +523,13 @@ static IBaseFilter *find_filter_by_name(struct filter_graph *graph, const WCHAR { struct filter *filter; + /* King of Fighters XIII requests the WMV decoder filter by name to + * connect it to a Sample Grabber filter, return our custom decoder + * filter instance instead. + */ + if (!wcscmp(name, L"WMVideo Decoder DMO")) + name = L"GStreamer splitter filter"; + LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) { if (!wcscmp(filter->name, name)) @@ -557,6 +565,7 @@ static BOOL has_output_pins(IBaseFilter *filter) static void update_seeking(struct filter *filter) { + IMediaPosition *position; IMediaSeeking *seeking; if (!filter->seeking) @@ -575,11 +584,19 @@ static void update_seeking(struct filter *filter) IMediaSeeking_Release(seeking); } } + + if (!filter->position) + { + /* Tokyo Xanadu eX+, same as above, same developer, destroys its filter when + * its IMediaPosition interface is released, so cache the interface instead + * of querying for it every time. */ + if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaPosition, (void **)&position))) + filter->position = position; + } } static BOOL is_renderer(struct filter *filter) { - IMediaPosition *media_position; IAMFilterMiscFlags *flags; BOOL ret = FALSE; @@ -589,16 +606,11 @@ static BOOL is_renderer(struct filter *filter) ret = TRUE; IAMFilterMiscFlags_Release(flags); } - else if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaPosition, (void **)&media_position))) - { - if (!has_output_pins(filter->filter)) - ret = TRUE; - IMediaPosition_Release(media_position); - } else { update_seeking(filter); - if (filter->seeking && !has_output_pins(filter->filter)) + if ((filter->seeking || filter->position) && + !has_output_pins(filter->filter)) ret = TRUE; } return ret; @@ -671,6 +683,7 @@ static HRESULT WINAPI FilterGraph2_AddFilter(IFilterGraph2 *iface, list_add_head(&graph->filters, &entry->entry); entry->sorting = FALSE; entry->seeking = NULL; + entry->position = NULL; ++graph->version; return duplicate_name ? VFW_S_DUPLICATE_NAME : hr; @@ -738,6 +751,8 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte { IBaseFilter_SetSyncSource(pFilter, NULL); IBaseFilter_Release(pFilter); + if (entry->position) + IMediaPosition_Release(entry->position); if (entry->seeking) IMediaSeeking_Release(entry->seeking); list_remove(&entry->entry); diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index 87869b4d6b2..7a171769574 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -162,6 +162,7 @@ static ULONG WINAPI BaseMemAllocator_Release(IMemAllocator * iface) static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLOCATOR_PROPERTIES *pRequest, ALLOCATOR_PROPERTIES *pActual) { BaseMemAllocator *This = impl_from_IMemAllocator(iface); + const char *sgi; HRESULT hr; TRACE("(%p)->(%p, %p)\n", This, pRequest, pActual); @@ -169,6 +170,10 @@ static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLO TRACE("Requested %ld buffers, size %ld, alignment %ld, prefix %ld.\n", pRequest->cBuffers, pRequest->cbBuffer, pRequest->cbAlign, pRequest->cbPrefix); + sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "1113000"))) + pRequest->cBuffers = min(8, pRequest->cBuffers); + EnterCriticalSection(This->pCritSect); { if (!list_empty(&This->used_list)) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index ff05ba60333..945f9f48505 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3590,6 +3590,20 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, CHARFORMAT2W fmt; HDC hDC; BOOL bRepaint = LOWORD(lParam); + const char *sgi = getenv("STEAM_COMPAT_APP_ID"); + + /* Grand Theft Auto V installer tries to set font for license + * richedit to Arial, which breaks CJK languages. Given that the + * RTF already has reasonable fonts set, we can just ignore the + * message. This can be removed once our richedit is able to do + * font substitution properly. CW bug #19917. + * + * It's important that STEAM_COMPAT_APP_ID environment variable is + * used instead of the usual SteamGameId, because the latter is + * not available during the configuration stage, when the + * installer is run. */ + if (sgi && strcmp(sgi, "271590") == 0) + return 0; if (!wParam) wParam = (WPARAM)GetStockObject(SYSTEM_FONT); diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 41431ebca02..77b5d83b3c0 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -701,10 +701,6 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) } LeaveCriticalSection(&cps->cs); - EnterCriticalSection(&listen_cs); - CloseHandle(cps->server_thread); - cps->server_thread = NULL; - LeaveCriticalSection(&listen_cs); TRACE("done\n"); return 0; } @@ -1570,7 +1566,10 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) LIST_FOR_EACH_ENTRY(protseq, &protseqs, RpcServerProtseq, entry) { if ((wait_thread = protseq->server_thread)) + { + protseq->server_thread = NULL; break; + } } LeaveCriticalSection(&server_cs); if (!wait_thread) @@ -1579,6 +1578,7 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) TRACE("waiting for thread %lu\n", GetThreadId(wait_thread)); LeaveCriticalSection(&listen_cs); WaitForSingleObject(wait_thread, INFINITE); + CloseHandle(wait_thread); EnterCriticalSection(&listen_cs); } if (listen_done_event == event) diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 3a2d7126ca4..3e4646a9517 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -1211,9 +1211,20 @@ static void store_key_permissions(HCRYPTKEY hCryptKey, HKEY hKey, DWORD dwKeySpe */ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY *phKey) { + static DWORD key_options = ~0ul; CHAR szRSABase[sizeof(RSAENH_REGKEY) + MAX_PATH]; HKEY hRootKey; + if (key_options == ~0ul) + { + const char *sgi; + + if ((sgi = getenv("SteamGameId")) && !strcmp(sgi, "1364780")) + key_options = REG_OPTION_VOLATILE; + else + key_options = REG_OPTION_NON_VOLATILE; + } + sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName); if (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET) @@ -1224,7 +1235,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY * /* @@ Wine registry key: HKLM\Software\Wine\Crypto\RSA */ /* @@ Wine registry key: HKCU\Software\Wine\Crypto\RSA */ return RegCreateKeyExA(hRootKey, szRSABase, 0, NULL, - REG_OPTION_NON_VOLATILE, sam, NULL, phKey, NULL) + key_options, sam, NULL, phKey, NULL) == ERROR_SUCCESS; } diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 15b8da47639..620145f64ba 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -732,14 +732,16 @@ static HRESULT invoke_async_callback(IRtwqAsyncResult *result) static void queue_release_pending_item(struct work_item *item) { - EnterCriticalSection(&item->queue->cs); + struct queue *queue = item->queue; + EnterCriticalSection(&queue->cs); if (item->key) { list_remove(&item->entry); item->key = 0; IUnknown_Release(&item->IUnknown_iface); } - LeaveCriticalSection(&item->queue->cs); + LeaveCriticalSection(&queue->cs); + } static void CALLBACK waiting_item_callback(TP_CALLBACK_INSTANCE *instance, void *context, TP_WAIT *wait, @@ -876,32 +878,87 @@ static HRESULT queue_submit_timer(struct queue *queue, IRtwqAsyncResult *result, return S_OK; } -static HRESULT queue_cancel_item(struct queue *queue, RTWQWORKITEM_KEY key) +static HRESULT queue_cancel_item(struct queue *queue, const RTWQWORKITEM_KEY key) { HRESULT hr = RTWQ_E_NOT_FOUND; + union { TP_WAIT *wait_object; TP_TIMER *timer_object; } work_object; + enum work_item_type work_object_type; struct work_item *item; + const UINT64 mask = key >> 32; + + EnterCriticalSection(&queue->cs); + LIST_FOR_EACH_ENTRY(item, &queue->pending_items, struct work_item, entry) + { + if (item->key == key) + { + hr = S_OK; + if ((mask & WAIT_ITEM_KEY_MASK) == WAIT_ITEM_KEY_MASK) + { + if (item->type != WORK_ITEM_WAIT) + WARN("Item %p is not a wait item, but its key has wait item mask.\n", item); + + work_object_type = WORK_ITEM_WAIT; + work_object.wait_object = item->u.wait_object; + item->u.wait_object = NULL; + } + else if ((mask & SCHEDULED_ITEM_KEY_MASK) == SCHEDULED_ITEM_KEY_MASK) + { + if (item->type != WORK_ITEM_TIMER) + WARN("Item %p is not a timer item, but its key has timer item mask.\n", item); + + work_object_type = WORK_ITEM_TIMER; + work_object.timer_object = item->u.timer_object; + item->u.timer_object = NULL; + } + else + { + WARN("Unknown item key mask %#I64x.\n", mask); + queue_release_pending_item(item); + goto out; + } + break; + } + } + + if (FAILED(hr)) + goto out; + + LeaveCriticalSection(&queue->cs); + // Safely either stop the thread pool object, or if the callback is already running, wait for it to finish. + // This way, we can safely release the reference to the work item. + if (work_object_type == WORK_ITEM_WAIT) + { + SetThreadpoolWait(work_object.wait_object, NULL, NULL); + WaitForThreadpoolWaitCallbacks(work_object.wait_object, TRUE); + CloseThreadpoolWait(work_object.wait_object); + } + else if (work_object_type == WORK_ITEM_TIMER) + { + SetThreadpoolTimer(work_object.timer_object, NULL, 0, 0); + WaitForThreadpoolTimerCallbacks(work_object.timer_object, TRUE); + CloseThreadpoolTimer(work_object.timer_object); + } + + // If the work item is still in pending items, its callback hasn't been invoked yet; + // we remove it. Otherwise its callback would have already released it. EnterCriticalSection(&queue->cs); LIST_FOR_EACH_ENTRY(item, &queue->pending_items, struct work_item, entry) { if (item->key == key) { - key >>= 32; - if ((key & WAIT_ITEM_KEY_MASK) == WAIT_ITEM_KEY_MASK) + if (work_object_type == WORK_ITEM_WAIT) { IRtwqAsyncResult_SetStatus(item->result, RTWQ_E_OPERATION_CANCELLED); invoke_async_callback(item->result); - CloseThreadpoolWait(item->u.wait_object); } - else if ((key & SCHEDULED_ITEM_KEY_MASK) == SCHEDULED_ITEM_KEY_MASK) - CloseThreadpoolTimer(item->u.timer_object); - else - WARN("Unknown item key mask %#I64x.\n", key); queue_release_pending_item(item); - hr = S_OK; + IUnknown_Release(&item->IUnknown_iface); break; } } + +out: LeaveCriticalSection(&queue->cs); return hr; diff --git a/dlls/sapi/Makefile.in b/dlls/sapi/Makefile.in index 008d0f74545..a6c4d86037e 100644 --- a/dlls/sapi/Makefile.in +++ b/dlls/sapi/Makefile.in @@ -1,10 +1,11 @@ MODULE = sapi.dll -IMPORTS = uuid ole32 user32 advapi32 +IMPORTS = uuid ole32 oleaut32 user32 advapi32 DELAYIMPORTS = winmm SOURCES = \ async.c \ automation.c \ + dispatch.c \ main.c \ mmaudio.c \ resource.c \ diff --git a/dlls/sapi/dispatch.c b/dlls/sapi/dispatch.c new file mode 100644 index 00000000000..c1f0e842788 --- /dev/null +++ b/dlls/sapi/dispatch.c @@ -0,0 +1,87 @@ +/* + * ITypeInfo cache for IDispatch + * + * Copyright 2019 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/debug.h" + +#define COBJMACROS + +#include "objbase.h" +#include "sapiddk.h" + +#include "sapi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sapi); + +static ITypeLib *typelib; +static ITypeInfo *typeinfos[last_tid]; + +static REFIID tid_id[] = +{ + &IID_ISpeechObjectToken, + &IID_ISpeechObjectTokens, + &IID_ISpeechVoice, +}; + +HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret) +{ + HRESULT hr; + + if (!typelib) + { + ITypeLib *tl; + + hr = LoadRegTypeLib(&LIBID_SpeechLib, 5, 4, LOCALE_SYSTEM_DEFAULT, &tl); + if (FAILED(hr)) + { + ERR("Failed to load typelib, hr %#lx.\n", hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)&typelib, tl, NULL)) + ITypeLib_Release(tl); + } + if (!typeinfos[tid]) + { + ITypeInfo *typeinfo; + + hr = ITypeLib_GetTypeInfoOfGuid(typelib, tid_id[tid], &typeinfo); + if (FAILED(hr)) + { + ERR("Failed to get type info for %s, hr %#lx.\n", debugstr_guid(tid_id[tid]), hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)(typeinfos + tid), typeinfo, NULL)) + ITypeInfo_Release(typeinfo); + } + ITypeInfo_AddRef(*ret = typeinfos[tid]); + return S_OK; +} + +void release_typelib(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(typeinfos); ++i) + { + if (typeinfos[i]) + ITypeInfo_Release(typeinfos[i]); + } + if (typelib) + ITypeLib_Release(typelib); +} diff --git a/dlls/sapi/main.c b/dlls/sapi/main.c index 108db7d13d8..8adcc7449fb 100644 --- a/dlls/sapi/main.c +++ b/dlls/sapi/main.c @@ -145,3 +145,21 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj ) return IClassFactory_QueryInterface( cf, iid, obj ); } + +/****************************************************************** + * DllMain + */ +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved ) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinst ); + break; + case DLL_PROCESS_DETACH: + if (reserved) break; + release_typelib(); + break; + } + return TRUE; +} diff --git a/dlls/sapi/sapi_private.h b/dlls/sapi/sapi_private.h index f6a5e966461..219436f88c1 100644 --- a/dlls/sapi/sapi_private.h +++ b/dlls/sapi/sapi_private.h @@ -52,3 +52,14 @@ HRESULT mmaudio_out_create( IUnknown *outer, REFIID iid, void **obj ); HRESULT token_category_create( IUnknown *outer, REFIID iid, void **obj ); HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj ); HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ); + +enum type_id +{ + ISpeechObjectToken_tid, + ISpeechObjectTokens_tid, + ISpeechVoice_tid, + last_tid +}; + +HRESULT get_typeinfo( enum type_id tid, ITypeInfo **typeinfo ); +void release_typelib( void ); diff --git a/dlls/sapi/tests/Makefile.in b/dlls/sapi/tests/Makefile.in index 4c107d5e994..4e792f2daae 100644 --- a/dlls/sapi/tests/Makefile.in +++ b/dlls/sapi/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = sapi.dll -IMPORTS = ole32 user32 advapi32 winmm +IMPORTS = ole32 oleaut32 user32 advapi32 winmm SOURCES = \ automation.c \ diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index a7d164389d9..c7067718c45 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -26,6 +26,8 @@ #include "wine/test.h" +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); + static void test_data_key(void) { ISpRegDataKey *data_key; @@ -203,6 +205,16 @@ static void test_token_category(void) IEnumSpObjectTokens_Release( enum_tokens ); + hr = ISpObjectTokenCategory_EnumTokens( cat, L"", NULL, &enum_tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + + count = 0xdeadbeef; + hr = IEnumSpObjectTokens_GetCount( enum_tokens, &count ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( count == 5, "got %lu\n", count ); + + IEnumSpObjectTokens_Release( enum_tokens ); + hr = ISpObjectTokenCategory_EnumTokens( cat, L"Language=409", NULL, &enum_tokens ); ok( hr == S_OK, "got %08lx\n", hr ); @@ -246,12 +258,46 @@ static void test_token_enum(void) { ISpObjectTokenEnumBuilder *token_enum; HRESULT hr; + IDispatch *disp; + ISpeechObjectTokens *speech_tokens; + IUnknown *unk; + IEnumVARIANT *enumvar; ISpObjectToken *tokens[5]; ISpObjectToken *out_tokens[5]; WCHAR token_id[MAX_PATH]; ULONG count; + VARIANT vars[3], ret; + DISPPARAMS params; int i; + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpObjectTokenEnumBuilder, (void **)&token_enum ); + ok( hr == S_OK, "got %08lx\n", hr ); + + hr = ISpObjectTokenEnumBuilder_QueryInterface( token_enum, + &IID_IDispatch, (void **)&disp ); + ok( hr == S_OK, "got %08lx\n", hr ); + IDispatch_Release( disp ); + + hr = ISpObjectTokenEnumBuilder_QueryInterface( token_enum, + &IID_ISpeechObjectTokens, + (void **)&speech_tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpeechObjectTokens_Release( speech_tokens ); + + ISpObjectTokenEnumBuilder_Release( token_enum ); + + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_IDispatch, (void **)&disp ); + ok( hr == S_OK, "got %08lx\n", hr ); + IDispatch_Release( disp ); + + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpeechObjectTokens, (void **)&speech_tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpeechObjectTokens_Release( speech_tokens ); + + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, &IID_ISpObjectTokenEnumBuilder, (void **)&token_enum ); ok( hr == S_OK, "got %08lx\n", hr ); @@ -318,6 +364,70 @@ static void test_token_enum(void) &IID_ISpObjectTokenEnumBuilder, (void **)&token_enum ); ok( hr == S_OK, "got %08lx\n", hr ); + hr = ISpObjectTokenEnumBuilder_QueryInterface( token_enum, + &IID_ISpeechObjectTokens, + (void **)&speech_tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + + hr = ISpObjectTokenEnumBuilder_SetAttribs( token_enum, NULL, NULL ); + ok( hr == S_OK, "got %08lx\n", hr ); + hr = ISpObjectTokenEnumBuilder_AddTokens( token_enum, 3, tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + + count = 0xdeadbeef; + hr = ISpeechObjectTokens_get_Count( speech_tokens, (LONG *)&count ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( count == 3, "got %lu\n", count ); + + hr = ISpeechObjectTokens_get__NewEnum( speech_tokens, &unk ); + ok( hr == S_OK, "got %08lx\n", hr ); + hr = IUnknown_QueryInterface( unk, &IID_IEnumVARIANT, (void **)&enumvar ); + ok( hr == S_OK, "got %08lx\n", hr ); + IUnknown_Release( unk ); + + V_VT( &vars[0] ) = VT_ILLEGAL; + V_DISPATCH( &vars[0] ) = (IDispatch *)0xdeadbeef; + hr = IEnumVARIANT_Next( enumvar, 1, vars, NULL ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( V_VT( &vars[0] ) == VT_DISPATCH, "got %#x\n", V_VT( &vars[0] ) ); + ok( V_DISPATCH( &vars[0] ) != (IDispatch *)0xdeadbeef && V_DISPATCH( &vars[0] ) != NULL, + "got %p\n", V_DISPATCH( &vars[0] ) ); + VariantClear( &vars[0] ); + + for ( i = 0; i < 3; i++ ) { + V_VT( &vars[i] ) = VT_ILLEGAL; + V_DISPATCH( &vars[i] ) = (IDispatch *)0xdeadbeef; + } + count = 0xdeadbeef; + + hr = IEnumVARIANT_Next( enumvar, 3, vars, &count ); + ok( hr == S_FALSE, "got %08lx\n", hr ); + ok( count == 2, "got %lu\n", count ); + for ( i = 0; i < 2; i++ ) { + ok( V_VT( &vars[i] ) == VT_DISPATCH, "got %#x\n", V_VT( &vars[i] ) ); + ok( V_DISPATCH( &vars[i] ) != (IDispatch *)0xdeadbeef && V_DISPATCH( &vars[i] ) != NULL, + "got %p\n", V_DISPATCH( &vars[i] ) ); + VariantClear( &vars[i] ); + } + ok( V_VT( &vars[2] ) == VT_ILLEGAL, "got %#x\n", V_VT( &vars[2] ) ); + + IEnumVARIANT_Release( enumvar ); + + memset( ¶ms, 0, sizeof(params) ); + VariantInit( &ret ); + hr = ISpeechObjectTokens_Invoke( speech_tokens, DISPID_SOTsCount, &IID_NULL, 0, + DISPATCH_PROPERTYGET, ¶ms, &ret, NULL, NULL ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( V_VT( &ret ) == VT_I4, "got %#x\n", V_VT( &ret ) ); + ok( V_I4( &ret ) == 3, "got %ld\n", V_I4( &ret ) ); + + ISpeechObjectTokens_Release( speech_tokens ); + ISpObjectTokenEnumBuilder_Release( token_enum ); + + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpObjectTokenEnumBuilder, (void **)&token_enum ); + ok( hr == S_OK, "got %08lx\n", hr ); + /* Vendor attribute must exist */ hr = ISpObjectTokenEnumBuilder_SetAttribs( token_enum, L"Vendor", NULL ); ok( hr == S_OK, "got %08lx\n", hr ); @@ -601,15 +711,47 @@ static IClassFactory test_class_cf = { &ClassFactoryVtbl }; static void test_object_token(void) { - static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\\Software\\Wine\\Winetest\\sapi\\TestToken"; + static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\\Software\\Winetest\\sapi\\TestToken"; + static const WCHAR *get_description = L"GetDescription"; ISpObjectToken *token; + IDispatch *disp; + ISpeechObjectToken *speech_token; ISpDataKey *sub_key; HRESULT hr; LPWSTR tempW, token_id; + BSTR tempB; ISpObjectTokenCategory *cat; DWORD regid; IUnknown *obj; + DISPID dispid; + DISPPARAMS params; + VARIANT arg, ret; + + hr = CoCreateInstance( &CLSID_SpObjectToken, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpObjectToken, (void **)&token ); + ok( hr == S_OK, "got %08lx\n", hr ); + + hr = ISpObjectToken_QueryInterface( token, &IID_IDispatch, (void **)&disp ); + ok( hr == S_OK, "got %08lx\n", hr ); + IDispatch_Release( disp ); + + hr = ISpObjectToken_QueryInterface( token, &IID_ISpeechObjectToken, (void **)&speech_token ); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpeechObjectToken_Release( speech_token ); + + ISpObjectToken_Release( token ); + + hr = CoCreateInstance( &CLSID_SpObjectToken, NULL, CLSCTX_INPROC_SERVER, + &IID_IDispatch, (void **)&disp ); + ok( hr == S_OK, "got %08lx\n", hr ); + IDispatch_Release( disp ); + + hr = CoCreateInstance( &CLSID_SpObjectToken, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpeechObjectToken, (void **)&speech_token ); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpeechObjectToken_Release( speech_token ); + hr = CoCreateInstance( &CLSID_SpObjectToken, NULL, CLSCTX_INPROC_SERVER, &IID_ISpObjectToken, (void **)&token ); @@ -780,11 +922,85 @@ static void test_object_token(void) CoTaskMemFree( tempW ); } + hr = ISpObjectToken_SetStringValue( token, L"409", L"409 - TestToken" ); + ok( hr == S_OK, "got %08lx\n", hr ); + hr = ISpObjectToken_SetStringValue( token, L"407", L"407 - TestToken" ); + ok( hr == S_OK, "got %08lx\n", hr ); + hr = ISpObjectToken_SetStringValue( token, L"E40C", L"E40C - TestToken" ); + ok( hr == S_OK, "got %08lx\n", hr ); + + hr = ISpObjectToken_QueryInterface( token, &IID_ISpeechObjectToken, (void **)&speech_token ); + ok( hr == S_OK, "got %08lx\n", hr ); + + hr = ISpeechObjectToken_GetDescription( speech_token, 0x409, NULL ); + ok( hr == E_POINTER, "got %08lx\n", hr ); + + tempB = NULL; + hr = ISpeechObjectToken_GetDescription( speech_token, 0x409, &tempB ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( tempB && !wcscmp( tempB, L"409 - TestToken" ), "got %s\n", wine_dbgstr_w( tempB ) ); + SysFreeString( tempB ); + + tempB = NULL; + hr = ISpeechObjectToken_GetDescription( speech_token, 0x10407, &tempB ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( tempB && !wcscmp( tempB, L"407 - TestToken" ), "got %s\n", wine_dbgstr_w( tempB ) ); + SysFreeString( tempB ); + + tempB = NULL; + hr = ISpeechObjectToken_GetDescription( speech_token, 0xE40C, &tempB ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( tempB && !wcscmp( tempB, L"E40C - TestToken" ), "got %s\n", wine_dbgstr_w( tempB ) ); + SysFreeString( tempB ); + + tempB = (BSTR)0xdeadbeef; + hr = ISpeechObjectToken_GetDescription( speech_token, 0x406, &tempB ); + ok( hr == SPERR_NOT_FOUND, "got %08lx\n", hr ); + ok( tempB == (BSTR)0xdeadbeef || broken(tempB == NULL) /* < win7 */, "got %p\n", tempB ); + + hr = ISpObjectToken_SetStringValue( token, NULL, L"TestToken" ); + ok( hr == S_OK, "got %08lx\n", hr ); + + tempB = NULL; + hr = ISpeechObjectToken_GetDescription( speech_token, 0x406, &tempB ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( tempB && !wcscmp( tempB, L"TestToken" ), "got %s\n", wine_dbgstr_w( tempB ) ); + SysFreeString( tempB ); + + tempB = NULL; + hr = ISpeechObjectToken_GetDescription( speech_token, 0x0, &tempB ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( tempB && !wcscmp( tempB, L"TestToken" ), "got %s\n", wine_dbgstr_w( tempB ) ); + SysFreeString( tempB ); + + dispid = 0xdeadbeef; + hr = ISpeechObjectToken_GetIDsOfNames( speech_token, &IID_NULL, (WCHAR **)&get_description, 1, 0x409, &dispid ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( dispid == DISPID_SOTGetDescription, "got %08lx\n", dispid ); + + memset( ¶ms, 0, sizeof(params) ); + params.cArgs = 1; + params.cNamedArgs = 0; + params.rgvarg = &arg; + VariantInit( &arg ); + V_VT( &arg ) = VT_I4; + V_I4( &arg ) = 0x409; + VariantInit( &ret ); + hr = ISpeechObjectToken_Invoke( speech_token, DISPID_SOTGetDescription, &IID_NULL, + 0, DISPATCH_METHOD, ¶ms, &ret, NULL, NULL ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( V_VT( &ret ) == VT_BSTR, "got %#x\n", V_VT( &ret ) ); + ok( V_BSTR( &ret ) && !wcscmp( V_BSTR( &ret ), L"409 - TestToken" ), + "got %s\n", wine_dbgstr_w( V_BSTR( &ret ) ) ); + VariantClear( &ret ); + + ISpeechObjectToken_Release( speech_token ); + ISpObjectToken_Release( test_class_token ); IUnknown_Release( obj ); ISpObjectToken_Release( token ); - RegDeleteTreeA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Winetest\\sapi" ); + RegDeleteTreeA( HKEY_LOCAL_MACHINE, "Software\\Winetest\\sapi" ); } START_TEST(token) diff --git a/dlls/sapi/tests/tts.c b/dlls/sapi/tests/tts.c index 38ec1d31bfc..38c69e6144a 100644 --- a/dlls/sapi/tests/tts.c +++ b/dlls/sapi/tests/tts.c @@ -416,14 +416,15 @@ static IClassFactory test_engine_cf = { &ClassFactoryVtbl }; static void test_spvoice(void) { - static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\\Software\\Wine\\Winetest\\sapi\\tts\\TestEngine"; + static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Speech\\Voices\\Tokens\\WinetestVoice"; static const WCHAR test_text[] = L"Hello! This is a test sentence."; + static const WCHAR *get_voices = L"GetVoices"; ISpVoice *voice; IUnknown *dummy; ISpMMSysAudio *audio_out; ISpObjectTokenCategory *token_cat; - ISpObjectToken *token; + ISpObjectToken *token, *token2; WCHAR *token_id = NULL, *default_token_id = NULL; ISpDataKey *attrs_key; LONG rate; @@ -431,6 +432,17 @@ static void test_spvoice(void) ULONG stream_num; DWORD regid; DWORD start, duration; + ISpeechVoice *speech_voice; + ISpeechObjectTokens *speech_tokens; + LONG count, volume_long; + ISpeechObjectToken *speech_token; + BSTR req = NULL, opt = NULL; + UINT info_count; + ITypeInfo *typeinfo; + TYPEATTR *typeattr; + DISPID dispid; + DISPPARAMS params; + VARIANT args[2], ret; HRESULT hr; if (waveOutGetNumDevs() == 0) { @@ -438,6 +450,8 @@ static void test_spvoice(void) return; } + RegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Speech\\Voices\\WinetestVoice"); + check_apttype(); ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); @@ -587,6 +601,7 @@ static void test_spvoice(void) hr = ISpObjectToken_CreateKey(token, L"Attributes", &attrs_key); ok(hr == S_OK, "got %#lx.\n", hr); ISpDataKey_SetStringValue(attrs_key, L"Language", L"409"); + ISpDataKey_SetStringValue(attrs_key, L"Vendor", L"Winetest"); ISpDataKey_Release(attrs_key); hr = ISpVoice_SetVoice(voice, token); @@ -681,13 +696,112 @@ static void test_spvoice(void) ok(hr == S_OK, "got %#lx.\n", hr); ok(duration < 300, "took %lu ms.\n", duration); + hr = ISpVoice_QueryInterface(voice, &IID_ISpeechVoice, (void **)&speech_voice); + ok(hr == S_OK, "got %#lx.\n", hr); + + count = -1; + hr = ISpeechVoice_GetVoices(speech_voice, NULL, NULL, &speech_tokens); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ISpeechObjectTokens_get_Count(speech_tokens, &count); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(count > 0, "got %ld.\n", count); + ISpeechObjectTokens_Release(speech_tokens); + + req = SysAllocString(L"Vendor=Winetest"); + opt = SysAllocString(L"Language=409;Gender=Male"); + + count = 0xdeadbeef; + hr = ISpeechVoice_GetVoices(speech_voice, req, opt, &speech_tokens); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ISpeechObjectTokens_get_Count(speech_tokens, &count); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(count == 1, "got %ld.\n", count); + ISpeechObjectTokens_Release(speech_tokens); + + volume_long = 0xdeadbeef; + hr = ISpeechVoice_put_Volume(speech_voice, 80); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ISpeechVoice_get_Volume(speech_voice, &volume_long); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(volume_long == 80, "got %ld.\n", volume_long); + + hr = ISpObjectToken_QueryInterface(token, &IID_ISpeechObjectToken, (void **)&speech_token); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ISpeechVoice_putref_Voice(speech_voice, speech_token); + ok(hr == S_OK, "got %#lx.\n", hr); + ISpeechObjectToken_Release(speech_token); + + speech_token = (ISpeechObjectToken *)0xdeadbeef; + hr = ISpeechVoice_get_Voice(speech_voice, &speech_token); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(speech_token && speech_token != (ISpeechObjectToken *)0xdeadbeef, "got %p.\n", speech_token); + hr = ISpeechObjectToken_QueryInterface(speech_token, &IID_ISpObjectToken, (void **)&token2); + ok(hr == S_OK, "got %#lx.\n", hr); + token_id = NULL; + hr = ISpObjectToken_GetId(token2, &token_id); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(!wcscmp(token_id, test_token_id), "got %s.\n", wine_dbgstr_w(token_id)); + CoTaskMemFree(token_id); + ISpObjectToken_Release(token2); + + hr = ISpeechVoice_Speak(speech_voice, NULL, SVSFPurgeBeforeSpeak, NULL); + ok(hr == S_OK, "got %#lx.\n", hr); + + info_count = 0xdeadbeef; + hr = ISpeechVoice_GetTypeInfoCount(speech_voice, &info_count); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(info_count == 1, "got %u.\n", info_count); + + typeinfo = NULL; + typeattr = NULL; + hr = ISpeechVoice_GetTypeInfo(speech_voice, 0, 0, &typeinfo); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ITypeInfo_GetTypeAttr(typeinfo, &typeattr); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(typeattr->typekind == TKIND_DISPATCH, "got %u.\n", typeattr->typekind); + ok(IsEqualGUID(&typeattr->guid, &IID_ISpeechVoice), "got %s.\n", wine_dbgstr_guid(&typeattr->guid)); + ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr); + ITypeInfo_Release(typeinfo); + + dispid = 0xdeadbeef; + hr = ISpeechVoice_GetIDsOfNames(speech_voice, &IID_NULL, (WCHAR **)&get_voices, 1, 0x409, &dispid); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(dispid == DISPID_SVGetVoices, "got %#lx.\n", dispid); + + memset(¶ms, 0, sizeof(params)); + params.cArgs = 2; + params.cNamedArgs = 0; + params.rgvarg = args; + VariantInit(&args[0]); + VariantInit(&args[1]); + V_VT(&args[0]) = VT_BSTR; + V_VT(&args[1]) = VT_BSTR; + V_BSTR(&args[0]) = opt; + V_BSTR(&args[1]) = req; + VariantInit(&ret); + hr = ISpeechVoice_Invoke(speech_voice, dispid, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, NULL); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(V_VT(&ret) == VT_DISPATCH, "got %#x.\n", V_VT(&ret)); + hr = IDispatch_QueryInterface(V_DISPATCH(&ret), &IID_ISpeechObjectTokens, (void **)&speech_tokens); + ok(hr == S_OK, "got %#lx.\n", hr); + count = -1; + hr = ISpeechObjectTokens_get_Count(speech_tokens, &count); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(count == 1, "got %ld.\n", count); + ISpeechObjectTokens_Release(speech_tokens); + VariantClear(&ret); + + ISpeechVoice_Release(speech_voice); + done: reset_engine_params(&test_engine); ISpVoice_Release(voice); ISpObjectToken_Release(token); ISpMMSysAudio_Release(audio_out); + SysFreeString(req); + SysFreeString(opt); - RegDeleteTreeA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Winetest\\sapi" ); + RegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Speech\\Voices\\WinetestVoice"); } START_TEST(tts) diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index f599bdb6b14..65d35dc96ff 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -51,6 +51,7 @@ static struct data_key *impl_from_ISpRegDataKey( ISpRegDataKey *iface ) struct object_token { ISpObjectToken ISpObjectToken_iface; + ISpeechObjectToken ISpeechObjectToken_iface; LONG ref; ISpRegDataKey *data_key; @@ -62,6 +63,11 @@ static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface ) return CONTAINING_RECORD( iface, struct object_token, ISpObjectToken_iface ); } +static struct object_token *impl_from_ISpeechObjectToken( ISpeechObjectToken *iface ) +{ + return CONTAINING_RECORD( iface, struct object_token, ISpeechObjectToken_iface ); +} + static HRESULT WINAPI data_key_QueryInterface( ISpRegDataKey *iface, REFIID iid, void **obj ) { struct data_key *This = impl_from_ISpRegDataKey( iface ); @@ -573,6 +579,7 @@ struct token_with_score struct token_enum { ISpObjectTokenEnumBuilder ISpObjectTokenEnumBuilder_iface; + ISpeechObjectTokens ISpeechObjectTokens_iface; LONG ref; BOOL init; @@ -587,6 +594,25 @@ static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnu return CONTAINING_RECORD( iface, struct token_enum, ISpObjectTokenEnumBuilder_iface ); } +static struct token_enum *impl_from_ISpeechObjectTokens( ISpeechObjectTokens *iface ) +{ + return CONTAINING_RECORD( iface, struct token_enum, ISpeechObjectTokens_iface ); +} + +struct enum_var +{ + IEnumVARIANT IEnumVARIANT_iface; + LONG ref; + + ISpObjectTokenEnumBuilder *token_enum; + ULONG index; +}; + +static struct enum_var *impl_from_IEnumVARIANT( IEnumVARIANT *iface ) +{ + return CONTAINING_RECORD( iface, struct enum_var, IEnumVARIANT_iface ); +} + static HRESULT WINAPI token_category_EnumTokens( ISpObjectTokenCategory *iface, LPCWSTR req, LPCWSTR opt, IEnumSpObjectTokens **enum_tokens ) @@ -759,15 +785,19 @@ static HRESULT WINAPI token_enum_QueryInterface( ISpObjectTokenEnumBuilder *ifac if (IsEqualIID( iid, &IID_IUnknown ) || IsEqualIID( iid, &IID_IEnumSpObjectTokens ) || IsEqualIID( iid, &IID_ISpObjectTokenEnumBuilder )) + *obj = &This->ISpObjectTokenEnumBuilder_iface; + else if (IsEqualIID( iid, &IID_IDispatch ) || + IsEqualIID( iid, &IID_ISpeechObjectTokens )) + *obj = &This->ISpeechObjectTokens_iface; + else { - ISpObjectTokenEnumBuilder_AddRef( iface ); - *obj = iface; - return S_OK; + *obj = NULL; + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + return E_NOINTERFACE; } - FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); - *obj = NULL; - return E_NOINTERFACE; + IUnknown_AddRef( (IUnknown *)*obj ); + return S_OK; } static ULONG WINAPI token_enum_AddRef( ISpObjectTokenEnumBuilder *iface ) @@ -917,7 +947,7 @@ static HRESULT score_attributes( ISpObjectToken *token, const WCHAR *attrs, unsigned int i, j; HRESULT hr; - if (!attrs) + if (!attrs || !*attrs) { *score = 1; return S_OK; @@ -1129,6 +1159,257 @@ const struct ISpObjectTokenEnumBuilderVtbl token_enum_vtbl = token_enum_Sort }; +static HRESULT WINAPI enum_var_QueryInterface( IEnumVARIANT *iface, + REFIID iid, void **obj ) +{ + struct enum_var *This = impl_from_IEnumVARIANT( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IEnumVARIANT )) + { + IEnumVARIANT_AddRef( iface ); + *obj = iface; + return S_OK; + } + + *obj = NULL; + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + return E_NOINTERFACE; +} + +static ULONG WINAPI enum_var_AddRef( IEnumVARIANT *iface ) +{ + struct enum_var *This = impl_from_IEnumVARIANT( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %lu\n", This, ref ); + return ref; +} + +static ULONG WINAPI enum_var_Release( IEnumVARIANT *iface ) +{ + struct enum_var *This = impl_from_IEnumVARIANT( iface ); + ULONG ref = InterlockedDecrement( &This->ref ); + + TRACE( "(%p) ref = %lu\n", This, ref ); + + if (!ref) + { + ISpObjectTokenEnumBuilder_Release( This->token_enum ); + free( This ); + } + return ref; +} + +static HRESULT WINAPI enum_var_Next( IEnumVARIANT *iface, ULONG count, + VARIANT *vars, ULONG *fetched ) +{ + struct enum_var *This = impl_from_IEnumVARIANT( iface ); + ULONG i, total; + HRESULT hr; + + TRACE( "(%p)->(%lu %p %p)\n", This, count, vars, fetched ); + + if (fetched) *fetched = 0; + + if (FAILED(hr = ISpObjectTokenEnumBuilder_GetCount( This->token_enum, &total ))) + return hr; + + for ( i = 0; i < count && This->index < total; i++, This->index++ ) + { + ISpObjectToken *token; + IDispatch *disp; + + if (FAILED(hr = ISpObjectTokenEnumBuilder_Item( This->token_enum, This->index, &token ))) + goto fail; + + hr = ISpObjectToken_QueryInterface( token, &IID_IDispatch, (void **)&disp ); + ISpObjectToken_Release( token ); + if (FAILED(hr)) goto fail; + + VariantInit( &vars[i] ); + V_VT( &vars[i] ) = VT_DISPATCH; + V_DISPATCH( &vars[i] ) = disp; + } + + if (fetched) *fetched = i; + return i == count ? S_OK : S_FALSE; + +fail: + while (i--) + VariantClear( &vars[i] ); + return hr; +} + +static HRESULT WINAPI enum_var_Skip( IEnumVARIANT *iface, ULONG count ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI enum_var_Reset( IEnumVARIANT *iface ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI enum_var_Clone( IEnumVARIANT *iface, IEnumVARIANT **new_enum ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static const IEnumVARIANTVtbl enum_var_vtbl = +{ + enum_var_QueryInterface, + enum_var_AddRef, + enum_var_Release, + enum_var_Next, + enum_var_Skip, + enum_var_Reset, + enum_var_Clone +}; + +static HRESULT WINAPI speech_tokens_QueryInterface( ISpeechObjectTokens *iface, + REFIID iid, void **obj ) +{ + struct token_enum *This = impl_from_ISpeechObjectTokens( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + return ISpObjectTokenEnumBuilder_QueryInterface( + &This->ISpObjectTokenEnumBuilder_iface, iid, obj ); +} + +static ULONG WINAPI speech_tokens_AddRef( ISpeechObjectTokens *iface ) +{ + struct token_enum *This = impl_from_ISpeechObjectTokens( iface ); + + TRACE( "(%p)\n", This ); + + return ISpObjectTokenEnumBuilder_AddRef( &This->ISpObjectTokenEnumBuilder_iface ); +} + +static ULONG WINAPI speech_tokens_Release( ISpeechObjectTokens *iface ) +{ + struct token_enum *This = impl_from_ISpeechObjectTokens( iface ); + + TRACE( "(%p)\n", This ); + + return ISpObjectTokenEnumBuilder_Release( &This->ISpObjectTokenEnumBuilder_iface ); +} + +static HRESULT WINAPI speech_tokens_GetTypeInfoCount( ISpeechObjectTokens *iface, + UINT *count ) +{ + + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_tokens_GetTypeInfo( ISpeechObjectTokens *iface, + UINT index, + LCID lcid, + ITypeInfo **type_info ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_tokens_GetIDsOfNames( ISpeechObjectTokens *iface, + REFIID iid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispids ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_tokens_Invoke( ISpeechObjectTokens *iface, + DISPID dispid, + REFIID iid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excepinfo, + UINT *argerr ) +{ + ITypeInfo *ti; + HRESULT hr; + + TRACE( "(%p)->(%ld %s %#lx %#x %p %p %p %p)\n", iface, dispid, + debugstr_guid( iid ), lcid, flags, params, result, excepinfo, argerr ); + + if (FAILED(hr = get_typeinfo( ISpeechObjectTokens_tid, &ti ))) + return hr; + hr = ITypeInfo_Invoke( ti, iface, dispid, flags, params, result, excepinfo, argerr ); + ITypeInfo_Release( ti ); + + return hr; +} + +static HRESULT WINAPI speech_tokens_get_Count( ISpeechObjectTokens *iface, + LONG *count ) +{ + struct token_enum *This = impl_from_ISpeechObjectTokens( iface ); + + TRACE( "(%p)->(%p)\n", This, count ); + + return ISpObjectTokenEnumBuilder_GetCount( &This->ISpObjectTokenEnumBuilder_iface, (ULONG *)count ); +} + +static HRESULT WINAPI speech_tokens_Item( ISpeechObjectTokens *iface, + LONG index, ISpeechObjectToken **token ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_tokens_get__NewEnum( ISpeechObjectTokens *iface, + IUnknown **new_enum ) +{ + struct enum_var *enum_var; + HRESULT hr; + + TRACE( "(%p)->(%p)\n", iface, new_enum ); + + if (!new_enum) return E_POINTER; + if (!(enum_var = malloc( sizeof(*enum_var) ))) return E_OUTOFMEMORY; + + enum_var->IEnumVARIANT_iface.lpVtbl = &enum_var_vtbl; + enum_var->ref = 1; + enum_var->index = 0; + if (FAILED(hr = ISpeechObjectTokens_QueryInterface( iface, &IID_ISpObjectTokenEnumBuilder, + (void **)&enum_var->token_enum ))) + { + free( enum_var ); + return hr; + } + + *new_enum = (IUnknown *)&enum_var->IEnumVARIANT_iface; + + return S_OK; +} + +static const ISpeechObjectTokensVtbl speech_tokens_vtbl = +{ + speech_tokens_QueryInterface, + speech_tokens_AddRef, + speech_tokens_Release, + speech_tokens_GetTypeInfoCount, + speech_tokens_GetTypeInfo, + speech_tokens_GetIDsOfNames, + speech_tokens_Invoke, + speech_tokens_get_Count, + speech_tokens_Item, + speech_tokens_get__NewEnum +}; + HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj ) { struct token_enum *This = malloc( sizeof(*This) ); @@ -1136,6 +1417,7 @@ HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj ) if (!This) return E_OUTOFMEMORY; This->ISpObjectTokenEnumBuilder_iface.lpVtbl = &token_enum_vtbl; + This->ISpeechObjectTokens_iface.lpVtbl = &speech_tokens_vtbl; This->ref = 1; This->req = NULL; This->opt = NULL; @@ -1160,15 +1442,19 @@ static HRESULT WINAPI token_QueryInterface( ISpObjectToken *iface, if (IsEqualIID( iid, &IID_IUnknown ) || IsEqualIID( iid, &IID_ISpDataKey ) || IsEqualIID( iid, &IID_ISpObjectToken )) + *obj = &This->ISpObjectToken_iface; + else if (IsEqualIID( iid, &IID_IDispatch ) || + IsEqualIID( iid, &IID_ISpeechObjectToken )) + *obj = &This->ISpeechObjectToken_iface; + else { - ISpObjectToken_AddRef( iface ); - *obj = iface; - return S_OK; + *obj = NULL; + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + return E_NOINTERFACE; } - FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); - *obj = NULL; - return E_NOINTERFACE; + IUnknown_AddRef( (IUnknown *)*obj ); + return S_OK; } static ULONG WINAPI token_AddRef( ISpObjectToken *iface ) @@ -1495,6 +1781,247 @@ const struct ISpObjectTokenVtbl token_vtbl = token_MatchesAttributes }; +static HRESULT WINAPI speech_token_QueryInterface( ISpeechObjectToken *iface, + REFIID iid, void **obj ) +{ + struct object_token *This = impl_from_ISpeechObjectToken( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + return ISpObjectToken_QueryInterface( &This->ISpObjectToken_iface, iid, obj ); +} + +static ULONG WINAPI speech_token_AddRef( ISpeechObjectToken *iface ) +{ + struct object_token *This = impl_from_ISpeechObjectToken( iface ); + + TRACE( "(%p)\n", This ); + + return ISpObjectToken_AddRef( &This->ISpObjectToken_iface ); +} + +static ULONG WINAPI speech_token_Release( ISpeechObjectToken *iface ) +{ + struct object_token *This = impl_from_ISpeechObjectToken( iface ); + + TRACE( "(%p)\n", This ); + + return ISpObjectToken_Release( &This->ISpObjectToken_iface ); +} + +static HRESULT WINAPI speech_token_GetTypeInfoCount( ISpeechObjectToken *iface, + UINT *count ) +{ + + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_GetTypeInfo( ISpeechObjectToken *iface, + UINT index, + LCID lcid, + ITypeInfo **type_info ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_GetIDsOfNames( ISpeechObjectToken *iface, + REFIID iid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispids ) +{ + ITypeInfo *ti; + HRESULT hr; + + TRACE( "(%p)->(%s %p %u %#lx %p)\n", + iface, debugstr_guid( iid ), names, count, lcid, dispids ); + + if (FAILED(hr = get_typeinfo( ISpeechObjectToken_tid, &ti ))) + return hr; + hr = ITypeInfo_GetIDsOfNames( ti, names, count, dispids ); + ITypeInfo_Release( ti ); + + return hr; +} + +static HRESULT WINAPI speech_token_Invoke( ISpeechObjectToken *iface, + DISPID dispid, + REFIID iid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excepinfo, + UINT *argerr ) +{ + ITypeInfo *ti; + HRESULT hr; + + TRACE( "(%p)->(%ld %s %#lx %#x %p %p %p %p)\n", iface, dispid, + debugstr_guid( iid ), lcid, flags, params, result, excepinfo, argerr ); + + if (FAILED(hr = get_typeinfo( ISpeechObjectToken_tid, &ti ))) + return hr; + hr = ITypeInfo_Invoke( ti, iface, dispid, flags, params, result, excepinfo, argerr ); + ITypeInfo_Release( ti ); + + return hr; +} + +static HRESULT WINAPI speech_token_get_Id( ISpeechObjectToken *iface, + BSTR *id ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_get_DataKey( ISpeechObjectToken *iface, + ISpeechDataKey **key ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_get_Category( ISpeechObjectToken *iface, + ISpeechObjectTokenCategory **cat ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_GetDescription( ISpeechObjectToken *iface, + LONG locale, BSTR *desc ) +{ + struct object_token *This = impl_from_ISpeechObjectToken( iface ); + WCHAR langid[5]; + WCHAR *desc_wstr = NULL; + HRESULT hr; + + TRACE( "(%p)->(%#lx %p)\n", This, locale, desc ); + + if (!desc) return E_POINTER; + + swprintf( langid, ARRAY_SIZE( langid ), L"%X", LANGIDFROMLCID( locale ) ); + + hr = ISpObjectToken_GetStringValue( &This->ISpObjectToken_iface, langid, &desc_wstr ); + if (hr == SPERR_NOT_FOUND) + hr = ISpObjectToken_GetStringValue( &This->ISpObjectToken_iface, NULL, &desc_wstr ); + if (FAILED(hr)) + return hr; + + *desc = SysAllocString( desc_wstr ); + + CoTaskMemFree( desc_wstr ); + return *desc ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI speech_token_SetId( ISpeechObjectToken *iface, + BSTR id, BSTR category_id, + VARIANT_BOOL create ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_GetAttribute( ISpeechObjectToken *iface, + BSTR name, BSTR *value ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_CreateInstance( ISpeechObjectToken *iface, + IUnknown *outer, + SpeechTokenContext clsctx, + IUnknown **object ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_Remove( ISpeechObjectToken *iface, + BSTR clsid ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_GetStorageFileName( ISpeechObjectToken *iface, + BSTR clsid, + BSTR key, + BSTR name, + SpeechTokenShellFolder folder, + BSTR *path ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_RemoveStorageFileName( ISpeechObjectToken *iface, + BSTR clsid, + BSTR key, + VARIANT_BOOL remove ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_IsUISupported( ISpeechObjectToken *iface, + const BSTR type, + const VARIANT *data, + IUnknown *object, + VARIANT_BOOL *supported ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_DisplayUI( ISpeechObjectToken *iface, + LONG hwnd, + BSTR title, + const BSTR type, + const VARIANT *data, + IUnknown *object ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI speech_token_MatchesAttributes( ISpeechObjectToken *iface, + const BSTR attributes, + VARIANT_BOOL *matches ) +{ + FIXME( "stub\n" ); + return E_NOTIMPL; +} + +const struct ISpeechObjectTokenVtbl speech_token_vtbl = +{ + speech_token_QueryInterface, + speech_token_AddRef, + speech_token_Release, + speech_token_GetTypeInfoCount, + speech_token_GetTypeInfo, + speech_token_GetIDsOfNames, + speech_token_Invoke, + speech_token_get_Id, + speech_token_get_DataKey, + speech_token_get_Category, + speech_token_GetDescription, + speech_token_SetId, + speech_token_GetAttribute, + speech_token_CreateInstance, + speech_token_Remove, + speech_token_GetStorageFileName, + speech_token_RemoveStorageFileName, + speech_token_IsUISupported, + speech_token_DisplayUI, + speech_token_MatchesAttributes +}; + HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ) { struct object_token *This = malloc( sizeof(*This) ); @@ -1502,6 +2029,7 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ) if (!This) return E_OUTOFMEMORY; This->ISpObjectToken_iface.lpVtbl = &token_vtbl; + This->ISpeechObjectToken_iface.lpVtbl = &speech_token_vtbl; This->ref = 1; This->data_key = NULL; diff --git a/dlls/sapi/tts.c b/dlls/sapi/tts.c index 410a57b4bfc..c474a118981 100644 --- a/dlls/sapi/tts.c +++ b/dlls/sapi/tts.c @@ -43,6 +43,7 @@ struct speech_voice LONG ref; ISpStreamFormat *output; + ISpObjectToken *engine_token; ISpTTSEngine *engine; LONG cur_stream_num; DWORD actions; @@ -81,6 +82,15 @@ static inline struct tts_engine_site *impl_from_ISpTTSEngineSite(ISpTTSEngineSit return CONTAINING_RECORD(iface, struct tts_engine_site, ISpTTSEngineSite_iface); } +static HRESULT create_token_category(const WCHAR *cat_id, ISpObjectTokenCategory **cat) +{ + HRESULT hr; + if (FAILED(hr = CoCreateInstance(&CLSID_SpObjectTokenCategory, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpObjectTokenCategory, (void **)cat))) + return hr; + return ISpObjectTokenCategory_SetId(*cat, cat_id, FALSE); +} + static HRESULT create_default_token(const WCHAR *cat_id, ISpObjectToken **token) { ISpObjectTokenCategory *cat; @@ -89,17 +99,13 @@ static HRESULT create_default_token(const WCHAR *cat_id, ISpObjectToken **token) TRACE("(%s, %p).\n", debugstr_w(cat_id), token); - if (FAILED(hr = CoCreateInstance(&CLSID_SpObjectTokenCategory, NULL, CLSCTX_INPROC_SERVER, - &IID_ISpObjectTokenCategory, (void **)&cat))) + if (FAILED(hr = create_token_category(cat_id, &cat))) return hr; - if (FAILED(hr = ISpObjectTokenCategory_SetId(cat, cat_id, FALSE)) || - FAILED(hr = ISpObjectTokenCategory_GetDefaultTokenId(cat, &default_token_id))) - { - ISpObjectTokenCategory_Release(cat); - return hr; - } + hr = ISpObjectTokenCategory_GetDefaultTokenId(cat, &default_token_id); ISpObjectTokenCategory_Release(cat); + if (FAILED(hr)) + return hr; if (FAILED(hr = CoCreateInstance(&CLSID_SpObjectToken, NULL, CLSCTX_INPROC_SERVER, &IID_ISpObjectToken, (void **)token))) @@ -163,6 +169,7 @@ static ULONG WINAPI speech_voice_Release(ISpeechVoice *iface) { async_cancel_queue(&This->queue); if (This->output) ISpStreamFormat_Release(This->output); + if (This->engine_token) ISpObjectToken_Release(This->engine_token); if (This->engine) ISpTTSEngine_Release(This->engine); DeleteCriticalSection(&This->cs); @@ -172,37 +179,51 @@ static ULONG WINAPI speech_voice_Release(ISpeechVoice *iface) return ref; } -static HRESULT WINAPI speech_voice_GetTypeInfoCount(ISpeechVoice *iface, UINT *info) +static HRESULT WINAPI speech_voice_GetTypeInfoCount(ISpeechVoice *iface, UINT *count) { - FIXME("(%p, %p): stub.\n", iface, info); - - return E_NOTIMPL; + TRACE("(%p, %p).\n", iface, count); + *count = 1; + return S_OK; } -static HRESULT WINAPI speech_voice_GetTypeInfo(ISpeechVoice *iface, UINT info, LCID lcid, +static HRESULT WINAPI speech_voice_GetTypeInfo(ISpeechVoice *iface, UINT index, LCID lcid, ITypeInfo **type_info) { - FIXME("(%p, %u, %lu, %p): stub.\n", iface, info, lcid, type_info); - - return E_NOTIMPL; + TRACE("(%p, %u, %#lx, %p).\n", iface, index, lcid, type_info); + if (index != 0) return DISP_E_BADINDEX; + return get_typeinfo(ISpeechVoice_tid, type_info); } static HRESULT WINAPI speech_voice_GetIDsOfNames(ISpeechVoice *iface, REFIID riid, LPOLESTR *names, - UINT count, LCID lcid, DISPID *dispid) + UINT count, LCID lcid, DISPID *dispids) { - FIXME("(%p, %s, %p, %u, %lu, %p): stub.\n", iface, debugstr_guid(riid), names, count, lcid, dispid); + ITypeInfo *typeinfo; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p, %s, %p, %u, %#lx, %p).\n", iface, debugstr_guid(riid), names, count, lcid, dispids); + + if (FAILED(hr = get_typeinfo(ISpeechVoice_tid, &typeinfo))) + return hr; + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, dispids); + ITypeInfo_Release(typeinfo); + return hr; } static HRESULT WINAPI speech_voice_Invoke(ISpeechVoice *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) { - FIXME("(%p, %ld, %s, %#lx, %#x, %p, %p, %p, %p): stub.\n", iface, dispid, debugstr_guid(riid), + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("(%p, %ld, %s, %#lx, %#x, %p, %p, %p, %p).\n", iface, dispid, debugstr_guid(riid), lcid, flags, params, result, excepinfo, argerr); - return E_NOTIMPL; + if (FAILED(hr = get_typeinfo(ISpeechVoice_tid, &typeinfo))) + return hr; + hr = ITypeInfo_Invoke(typeinfo, iface, dispid, flags, params, result, excepinfo, argerr); + ITypeInfo_Release(typeinfo); + return hr; } static HRESULT WINAPI speech_voice_get_Status(ISpeechVoice *iface, ISpeechVoiceStatus **status) @@ -214,16 +235,34 @@ static HRESULT WINAPI speech_voice_get_Status(ISpeechVoice *iface, ISpeechVoiceS static HRESULT WINAPI speech_voice_get_Voice(ISpeechVoice *iface, ISpeechObjectToken **voice) { - FIXME("(%p, %p): stub.\n", iface, voice); + struct speech_voice *This = impl_from_ISpeechVoice(iface); + ISpObjectToken *token; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p, %p).\n", iface, voice); + + if (!voice) return E_POINTER; + if (FAILED(hr = ISpVoice_GetVoice(&This->ISpVoice_iface, &token))) + return hr; + hr = ISpObjectToken_QueryInterface(token, &IID_ISpeechObjectToken, (void **)voice); + ISpObjectToken_Release(token); + return hr; } static HRESULT WINAPI speech_voice_putref_Voice(ISpeechVoice *iface, ISpeechObjectToken *voice) { - FIXME("(%p, %p): stub.\n", iface, voice); + struct speech_voice *This = impl_from_ISpeechVoice(iface); + ISpObjectToken *token; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p, %p).\n", iface, voice); + + if (!voice) return E_INVALIDARG; + if (FAILED(hr = ISpeechObjectToken_QueryInterface(voice, &IID_ISpObjectToken, (void **)&token))) + return hr; + hr = ISpVoice_SetVoice(&This->ISpVoice_iface, token); + ISpObjectToken_Release(token); + return hr; } static HRESULT WINAPI speech_voice_get_AudioOutput(ISpeechVoice *iface, ISpeechObjectToken **output) @@ -270,16 +309,25 @@ static HRESULT WINAPI speech_voice_put_Rate(ISpeechVoice *iface, LONG rate) static HRESULT WINAPI speech_voice_get_Volume(ISpeechVoice *iface, LONG *volume) { - FIXME("(%p, %p): stub.\n", iface, volume); + struct speech_voice *This = impl_from_ISpeechVoice(iface); + USHORT res = 0; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p, %p).\n", iface, volume); + + if (!volume) return E_POINTER; + hr = ISpVoice_GetVolume(&This->ISpVoice_iface, &res); + *volume = res; + return hr; } static HRESULT WINAPI speech_voice_put_Volume(ISpeechVoice *iface, LONG volume) { - FIXME("(%p, %ld): stub.\n", iface, volume); + struct speech_voice *This = impl_from_ISpeechVoice(iface); - return E_NOTIMPL; + TRACE("(%p, %ld).\n", iface, volume); + + return ISpVoice_SetVolume(&This->ISpVoice_iface, (USHORT)volume); } static HRESULT WINAPI speech_voice_put_AllowAudioOutputFormatChangesOnNextSet(ISpeechVoice *iface, @@ -355,9 +403,11 @@ static HRESULT WINAPI speech_voice_get_SynchronousSpeakTimeout(ISpeechVoice *ifa static HRESULT WINAPI speech_voice_Speak(ISpeechVoice *iface, BSTR text, SpeechVoiceSpeakFlags flags, LONG *number) { - FIXME("(%p, %s, %#x, %p): stub.\n", iface, debugstr_w(text), flags, number); + struct speech_voice *This = impl_from_ISpeechVoice(iface); - return E_NOTIMPL; + TRACE("(%p, %s, %#x, %p).\n", iface, debugstr_w(text), flags, number); + + return ISpVoice_Speak(&This->ISpVoice_iface, text, flags, (ULONG *)number); } static HRESULT WINAPI speech_voice_SpeakStream(ISpeechVoice *iface, ISpeechBaseStream *stream, @@ -392,9 +442,26 @@ static HRESULT WINAPI speech_voice_Skip(ISpeechVoice *iface, const BSTR type, LO static HRESULT WINAPI speech_voice_GetVoices(ISpeechVoice *iface, BSTR required, BSTR optional, ISpeechObjectTokens **tokens) { - FIXME("(%p, %s, %s, %p): stub.\n", iface, debugstr_w(required), debugstr_w(optional), tokens); - return E_NOTIMPL; + ISpObjectTokenCategory *cat; + IEnumSpObjectTokens *token_enum; + HRESULT hr; + + TRACE("(%p, %s, %s, %p).\n", iface, debugstr_w(required), debugstr_w(optional), tokens); + + if (!tokens) return E_POINTER; + + if (FAILED(hr = create_token_category(SPCAT_VOICES, &cat))) + return hr; + + if (SUCCEEDED(hr = ISpObjectTokenCategory_EnumTokens(cat, required, optional, &token_enum))) + { + hr = IEnumSpObjectTokens_QueryInterface(token_enum, &IID_ISpeechObjectTokens, (void **)tokens); + IEnumSpObjectTokens_Release(token_enum); + } + + ISpObjectTokenCategory_Release(cat); + return hr; } static HRESULT WINAPI speech_voice_GetAudioOutputs(ISpeechVoice *iface, BSTR required, BSTR optional, @@ -660,7 +727,7 @@ static HRESULT WINAPI spvoice_Resume(ISpVoice *iface) static HRESULT WINAPI spvoice_SetVoice(ISpVoice *iface, ISpObjectToken *token) { struct speech_voice *This = impl_from_ISpVoice(iface); - ISpTTSEngine *engine; + WCHAR *id = NULL, *old_id = NULL; HRESULT hr; TRACE("(%p, %p).\n", iface, token); @@ -673,27 +740,37 @@ static HRESULT WINAPI spvoice_SetVoice(ISpVoice *iface, ISpObjectToken *token) else ISpObjectToken_AddRef(token); - hr = ISpObjectToken_CreateInstance(token, NULL, CLSCTX_ALL, &IID_ISpTTSEngine, (void **)&engine); - ISpObjectToken_Release(token); - if (FAILED(hr)) - return hr; - EnterCriticalSection(&This->cs); + if (This->engine_token && + SUCCEEDED(ISpObjectToken_GetId(token, &id)) && + SUCCEEDED(ISpObjectToken_GetId(This->engine_token, &old_id)) && + !wcscmp(id, old_id)) + { + ISpObjectToken_Release(token); + goto done; + } + + if (This->engine_token) + ISpObjectToken_Release(This->engine_token); + This->engine_token = token; + if (This->engine) + { ISpTTSEngine_Release(This->engine); - This->engine = engine; + This->engine = NULL; + } +done: LeaveCriticalSection(&This->cs); - + CoTaskMemFree(id); + CoTaskMemFree(old_id); return S_OK; } static HRESULT WINAPI spvoice_GetVoice(ISpVoice *iface, ISpObjectToken **token) { struct speech_voice *This = impl_from_ISpVoice(iface); - ISpObjectWithToken *engine_token_iface; - HRESULT hr; TRACE("(%p, %p).\n", iface, token); @@ -702,21 +779,18 @@ static HRESULT WINAPI spvoice_GetVoice(ISpVoice *iface, ISpObjectToken **token) EnterCriticalSection(&This->cs); - if (!This->engine) + if (!This->engine_token) { LeaveCriticalSection(&This->cs); return create_default_token(SPCAT_VOICES, token); } - if (SUCCEEDED(hr = ISpTTSEngine_QueryInterface(This->engine, &IID_ISpObjectWithToken, (void **)&engine_token_iface))) - { - hr = ISpObjectWithToken_GetObjectToken(engine_token_iface, token); - ISpObjectWithToken_Release(engine_token_iface); - } + ISpObjectToken_AddRef(This->engine_token); + *token = This->engine_token; LeaveCriticalSection(&This->cs); - return hr; + return S_OK; } struct async_result @@ -731,6 +805,7 @@ struct speak_task struct async_result *result; struct speech_voice *voice; + ISpTTSEngine *engine; SPVTEXTFRAG *frag_list; ISpTTSEngineSite *site; DWORD flags; @@ -773,7 +848,6 @@ static void speak_proc(struct async_task *task) struct speech_voice *This = speak_task->voice; GUID fmtid; WAVEFORMATEX *wfx = NULL; - ISpTTSEngine *engine = NULL; ISpAudio *audio = NULL; HRESULT hr; @@ -794,8 +868,6 @@ static void speak_proc(struct async_task *task) ERR("failed setting output format: %#lx.\n", hr); goto done; } - engine = This->engine; - ISpTTSEngine_AddRef(engine); if (SUCCEEDED(ISpStreamFormat_QueryInterface(This->output, &IID_ISpAudio, (void **)&audio))) ISpAudio_SetState(audio, SPAS_RUN, 0); @@ -804,7 +876,7 @@ static void speak_proc(struct async_task *task) LeaveCriticalSection(&This->cs); - hr = ISpTTSEngine_Speak(engine, speak_task->flags, &fmtid, wfx, speak_task->frag_list, speak_task->site); + hr = ISpTTSEngine_Speak(speak_task->engine, speak_task->flags, &fmtid, wfx, speak_task->frag_list, speak_task->site); if (SUCCEEDED(hr)) { ISpStreamFormat_Commit(This->output, STGC_DEFAULT); @@ -821,7 +893,7 @@ static void speak_proc(struct async_task *task) ISpAudio_Release(audio); } CoTaskMemFree(wfx); - if (engine) ISpTTSEngine_Release(engine); + ISpTTSEngine_Release(speak_task->engine); free(speak_task->frag_list); ISpTTSEngineSite_Release(speak_task->site); @@ -838,6 +910,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR { struct speech_voice *This = impl_from_ISpVoice(iface); ISpTTSEngineSite *site = NULL; + ISpTTSEngine *engine = NULL; SPVTEXTFRAG *frag; struct speak_task *speak_task = NULL; struct async_result *result = NULL; @@ -891,12 +964,28 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR return hr; } - if (!This->engine) + EnterCriticalSection(&This->cs); + + if (!This->engine_token) { - /* Create a new engine with the default voice. */ + /* Set the engine token to default. */ if (FAILED(hr = ISpVoice_SetVoice(iface, NULL))) + { + LeaveCriticalSection(&This->cs); return hr; + } } + if (!This->engine && + FAILED(hr = ISpObjectToken_CreateInstance(This->engine_token, NULL, CLSCTX_ALL, &IID_ISpTTSEngine, (void **)&This->engine))) + { + LeaveCriticalSection(&This->cs); + ERR("Failed to create engine: %#lx.\n", hr); + return hr; + } + engine = This->engine; + ISpTTSEngine_AddRef(engine); + + LeaveCriticalSection(&This->cs); if (!(frag = malloc(sizeof(*frag) + contents_size))) return E_OUTOFMEMORY; @@ -920,6 +1009,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR speak_task->task.proc = speak_proc; speak_task->result = NULL; speak_task->voice = This; + speak_task->engine = engine; speak_task->frag_list = frag; speak_task->site = site; speak_task->flags = flags & SPF_NLP_SPEAK_PUNC; @@ -958,6 +1048,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR fail: if (site) ISpTTSEngineSite_Release(site); + if (engine) ISpTTSEngine_Release(engine); free(frag); free(speak_task); if (result) @@ -1397,6 +1488,7 @@ HRESULT speech_voice_create(IUnknown *outer, REFIID iid, void **obj) This->ref = 1; This->output = NULL; + This->engine_token = NULL; This->engine = NULL; This->cur_stream_num = 0; This->actions = SPVES_CONTINUE; diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c index 90e227b2948..e2906fa1c02 100644 --- a/dlls/sechost/security.c +++ b/dlls/sechost/security.c @@ -580,9 +580,39 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertSecurityDescriptorToStringSecurityDescripto return TRUE; } +static BOOL WINAPI init_computer_sid( INIT_ONCE *init_once, void *parameter, void **context ) +{ + DWORD *sub_authority = parameter; + unsigned int i, count; + DWORD len, index; + BOOL found = FALSE; + UINT values[3]; + char buffer[64]; + LSTATUS status; + + len = ARRAY_SIZE(buffer); + index = 0; + while (!(status = RegEnumKeyExA( HKEY_USERS, index, buffer, &len, NULL, NULL, NULL, NULL ))) + { + count = sscanf(buffer, "S-1-5-21-%u-%u-%u", &values[0], &values[1], &values[2]); + if (count == 3) + { + if (found) + ERR( "Multiple users are not supported.\n" ); + for (i = 0; i < 3; ++i) + sub_authority[i] = values[i]; + found = TRUE; + } + ++index; + len = ARRAY_SIZE(buffer); + } + return found; +} + static BOOL get_computer_sid( PSID sid ) { - static const struct /* same fields as struct SID */ + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + static struct /* same fields as struct SID */ { BYTE Revision; BYTE SubAuthorityCount; @@ -591,6 +621,9 @@ static BOOL get_computer_sid( PSID sid ) } computer_sid = { SID_REVISION, 4, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0 } }; + if (!InitOnceExecuteOnce( &init_once, init_computer_sid, computer_sid.SubAuthority + 1, NULL )) + ERR( "Could not initialize computer sid.\n" ); + memcpy( sid, &computer_sid, sizeof(computer_sid) ); return TRUE; } diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c index 240e048a4a5..c5834f9f618 100644 --- a/dlls/sechost/service.c +++ b/dlls/sechost/service.c @@ -313,6 +313,8 @@ SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceW( SC_HANDLE manager, const WCHAR SC_RPC_HANDLE handle = NULL; DWORD err; + char str[64]; + TRACE( "%p %s %#lx\n", manager, debugstr_w(name), access ); if (!manager) @@ -321,6 +323,14 @@ SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceW( SC_HANDLE manager, const WCHAR return NULL; } + /* HACK for ARK: Survivial Evolved checking the status of BEService to determine whether BE is enabled. */ + if(GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "346110") && + !wcscmp(name, L"BEService")) + { + WARN("HACK: returning fake service handle for BEService.\n"); + return (void *)0xdeadbeef; + } + __TRY { err = svcctl_OpenServiceW( manager, name, access, &handle ); @@ -1105,6 +1115,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatusEx( SC_HANDLE service, SC_STATUS { DWORD err; + char str[64]; + TRACE( "%p %d %p %ld %p\n", service, level, buffer, size, ret_size ); if (level != SC_STATUS_PROCESS_INFO) return set_error( ERROR_INVALID_LEVEL ); @@ -1115,6 +1127,24 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatusEx( SC_HANDLE service, SC_STATUS return set_error( ERROR_INSUFFICIENT_BUFFER ); } + /* HACK for ARK: Survivial Evolved checking the status of BEService to determine whether BE is enabled. */ + if(GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "346110") && + service == (void *)0xdeadbeef) + { + SERVICE_STATUS_PROCESS *status = (SERVICE_STATUS_PROCESS *)buffer; + WARN("HACK: returning fake data for BEService.\n"); + status->dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status->dwCurrentState = SERVICE_RUNNING; + status->dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; + status->dwWin32ExitCode = NO_ERROR; + status->dwServiceSpecificExitCode = 0; + status->dwCheckPoint = 0; + status->dwWaitHint = 0; + status->dwProcessId = 0xdeadbee0; + status->dwServiceFlags = 0; + return TRUE; + } + __TRY { err = svcctl_QueryServiceStatusEx( service, level, buffer, size, ret_size ); diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index d2e4a07fa23..66b5f587644 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -65,6 +65,7 @@ struct schan_context enum control_token control_token; unsigned int alert_type; unsigned int alert_number; + BOOL rehandshake_requested; }; static struct schan_handle *schan_handle_table; @@ -897,7 +898,7 @@ static SECURITY_STATUS establish_context( buffer = &pInput->pBuffers[idx]; ptr = buffer->pvBuffer; - if (buffer->cbBuffer < ctx->header_size) + if (buffer->cbBuffer < ctx->header_size && !ctx->rehandshake_requested) { TRACE("Expected at least %Iu bytes, but buffer only contains %lu bytes.\n", ctx->header_size, buffer->cbBuffer); @@ -914,7 +915,7 @@ static SECURITY_STATUS establish_context( ptr += record_size; } - if (!expected_size) + if (!expected_size && !ctx->rehandshake_requested) { TRACE("Expected at least %Iu bytes, but buffer only contains %lu bytes.\n", max(ctx->header_size, record_size), buffer->cbBuffer); @@ -966,6 +967,7 @@ static SECURITY_STATUS establish_context( params.alert_type = ctx->alert_type; params.alert_number = ctx->alert_number; ctx->control_token = CONTROL_TOKEN_NONE; + ctx->rehandshake_requested = FALSE; ret = GNUTLS_CALL( handshake, ¶ms ); if (output_buffer_idx != -1) @@ -1568,6 +1570,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle buffer->BufferType = SECBUFFER_STREAM_HEADER; buffer->cbBuffer = ctx->header_size; + if (status == SEC_I_RENEGOTIATE) ctx->rehandshake_requested = TRUE; return status; } diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index f757ea6d34f..deae7f1a60d 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -1158,9 +1158,22 @@ BOOLEAN WINAPI GetUserNameExW( return FALSE; } + case NameDisplay: + { + static const WCHAR wineusernameW[] = {'W','I','N','E','U','S','E','R','N','A','M','E',0}; + + DWORD needed = GetEnvironmentVariableW(wineusernameW, NULL, 0); + if (*nSize < needed) { + *nSize = needed; + SetLastError(ERROR_MORE_DATA); + return FALSE; + } + *nSize = GetEnvironmentVariableW(wineusernameW, lpNameBuffer, *nSize); + return TRUE; + } + case NameUnknown: case NameFullyQualifiedDN: - case NameDisplay: case NameUniqueId: case NameCanonical: case NameUserPrincipal: diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 7e2d683daa6..0b827d3ab9b 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -103,6 +103,7 @@ static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; static const WCHAR dotInterfaces[] = {'.','I','n','t','e','r','f','a','c','e','s',0}; static const WCHAR AddInterface[] = {'A','d','d','I','n','t','e','r','f','a','c','e',0}; static const WCHAR backslashW[] = {'\\',0}; +static const WCHAR hashW[] = {'#',0}; static const WCHAR emptyW[] = {0}; #define SERVICE_CONTROL_REENUMERATE_ROOT_DEVICES 128 @@ -318,7 +319,6 @@ static WCHAR *get_iface_key_path(struct device_iface *iface) static WCHAR *get_refstr_key_path(struct device_iface *iface) { - static const WCHAR hashW[] = {'#',0}; static const WCHAR slashW[] = {'\\',0}; WCHAR *path, *ptr; size_t len = lstrlenW(DeviceClasses) + 1 + 38 + 1 + lstrlenW(iface->symlink) + 1 + 1; @@ -2424,6 +2424,80 @@ static void SETUPDI_EnumerateInterfaces(HDEVINFO DeviceInfoSet, } } + +/* iterate over all interfaces supported by this device instance. if any of + * them are "linked", return TRUE */ +static BOOL is_device_instance_linked(HKEY interfacesKey, const WCHAR *deviceInstance) +{ + LONG l; + DWORD class_idx = 0, device_idx, len, type; + HKEY class_key, device_key, link_key; + WCHAR class_keyname[40], device_keyname[MAX_DEVICE_ID_LEN]; + WCHAR interface_devinstance[MAX_DEVICE_ID_LEN]; + + while (1) + { + len = ARRAY_SIZE(class_keyname); + l = RegEnumKeyExW(interfacesKey, class_idx++, class_keyname, &len, NULL, NULL, NULL, NULL); + if (l) + break; + + l = RegOpenKeyExW(interfacesKey, class_keyname, 0, KEY_READ, &class_key); + if (l) + continue; + + device_idx = 0; + while (1) + { + len = ARRAY_SIZE(device_keyname); + l = RegEnumKeyExW(class_key, device_idx++, device_keyname, &len, NULL, NULL, NULL, NULL); + if (l) + break; + + l = RegOpenKeyExW(class_key, device_keyname, 0, KEY_READ, &device_key); + if (l) + continue; + + len = ARRAY_SIZE(interface_devinstance); + l = RegQueryValueExW(device_key, DeviceInstance, NULL, &type, (BYTE *)interface_devinstance, &len); + if (l || type != REG_SZ) + { + RegCloseKey(device_key); + continue; + } + + if (lstrcmpiW(interface_devinstance, deviceInstance)) + { + /* not our device instance */ + RegCloseKey(device_key); + continue; + } + + l = RegOpenKeyExW(device_key, hashW, 0, KEY_READ, &link_key); + if (l) + { + RegCloseKey(device_key); + continue; + } + + if (is_linked(link_key)) + { + RegCloseKey(link_key); + RegCloseKey(device_key); + RegCloseKey(class_key); + return TRUE; + } + + RegCloseKey(link_key); + RegCloseKey(device_key); + } + + RegCloseKey(class_key); + } + + return FALSE; +} + static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, LPCWSTR enumerator, LPCWSTR deviceName, HKEY deviceKey, const GUID *class, DWORD flags) @@ -2432,6 +2506,7 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, DWORD i, len; WCHAR deviceInstance[MAX_PATH]; LONG l = ERROR_SUCCESS; + HKEY interfacesKey = SetupDiOpenClassRegKeyExW(NULL, KEY_READ, DIOCR_INTERFACE, NULL, NULL); TRACE("%s %s\n", debugstr_w(enumerator), debugstr_w(deviceName)); @@ -2468,7 +2543,9 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, {'%','s','\\','%','s','\\','%','s',0}; if (swprintf(id, ARRAY_SIZE(id), fmt, enumerator, - deviceName, deviceInstance) != -1) + deviceName, deviceInstance) != -1 && + (!(flags & DIGCF_PRESENT) || + is_device_instance_linked(interfacesKey, id))) { create_device(set, &deviceClass, id, FALSE); } @@ -2481,6 +2558,8 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, l = ERROR_SUCCESS; } } + + RegCloseKey(interfacesKey); } static void SETUPDI_EnumerateMatchingDevices(HDEVINFO DeviceInfoSet, @@ -4372,7 +4451,7 @@ static LSTATUS get_device_property(struct device *device, const DEVPROPKEY *prop if (!ls) { value_size = prop_buff_size; - ls = RegQueryValueExW(hkey, NULL, NULL, &value_type, prop_buff, &value_size); + ls = RegQueryValueExW(hkey, L"", NULL, &value_type, prop_buff, &value_size); RegCloseKey(hkey); } diff --git a/dlls/setupapi/fakedll.c b/dlls/setupapi/fakedll.c index 25305d8a4f6..a2d06490b86 100644 --- a/dlls/setupapi/fakedll.c +++ b/dlls/setupapi/fakedll.c @@ -428,7 +428,7 @@ static const WCHAR *enum_load_path( unsigned int idx ) } /* try to load a pre-compiled fake dll */ -static void *load_fake_dll( const WCHAR *name, SIZE_T *size ) +static void *load_fake_dll( const WCHAR *name, SIZE_T *size, WCHAR **out_filename ) { const WCHAR *build_dir = _wgetenv( L"WINEBUILDDIR" ); const WCHAR *path; @@ -476,11 +476,94 @@ static void *load_fake_dll( const WCHAR *name, SIZE_T *size ) } done: + if (res == 1) + { + *out_filename = malloc( (wcslen( ptr ) + 1) * sizeof(WCHAR) ); + wcscpy( *out_filename, ptr ); + free( file ); + return data; + } free( file ); - if (res == 1) return data; return NULL; } +/* Check if the 2 files are already the same */ +static BOOL fake_dll_matches( const WCHAR *source, const WCHAR *dest ) +{ + WIN32_FILE_ATTRIBUTE_DATA data1, data2; + HANDLE h; + char *buf; + DWORD size, bytesread; + BOOL result; + + if (!GetFileAttributesExW( source, GetFileExInfoStandard, &data1 )) + return FALSE; + + if (!GetFileAttributesExW( dest, GetFileExInfoStandard, &data2 )) + return FALSE; + + if ((data2.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == FILE_ATTRIBUTE_REPARSE_POINT) + /* If it's a symlink, assume it was put there by the proton script and is therefore correct */ + return TRUE; + + if (data1.nFileSizeHigh != 0 || + data2.nFileSizeHigh != 0 || + data1.nFileSizeLow != data2.nFileSizeLow) + { + return FALSE; + } + + size = data1.nFileSizeLow; + + /* If size and mtime matches, don't bother comparing contents */ + if ((data1.ftLastWriteTime.dwLowDateTime != 0 || data1.ftLastWriteTime.dwHighDateTime != 0) && + data1.ftLastWriteTime.dwLowDateTime == data2.ftLastWriteTime.dwLowDateTime && + data1.ftLastWriteTime.dwHighDateTime == data2.ftLastWriteTime.dwHighDateTime) + return TRUE; + + buf = malloc( size * 2 ); + + if (!buf) + return FALSE; + + h = CreateFileW( source, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL ); + if (h == INVALID_HANDLE_VALUE) + { + free( buf ); + return FALSE; + } + + if (!ReadFile( h, buf, size, &bytesread, NULL ) || bytesread != size) + { + CloseHandle( h ); + free( buf ); + return FALSE; + } + + CloseHandle( h ); + + h = CreateFileW( dest, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL ); + if (h == INVALID_HANDLE_VALUE) + { + free( buf ); + return FALSE; + } + + if (!ReadFile( h, buf + size, size, &bytesread, NULL ) || bytesread != size) + { + CloseHandle( h ); + free( buf ); + return FALSE; + } + + CloseHandle( h ); + + result = !memcmp( buf, buf + size, size ); + + free( buf ); + return result; +} + /* create the fake dll destination file */ static HANDLE create_dest_file( const WCHAR *name, BOOL delete ) { @@ -907,7 +990,11 @@ static int install_fake_dll( WCHAR *dest, WCHAR *file, BOOL delete, struct list destname[len] = 0; if (!add_handled_dll( destname )) ret = -1; - if (ret != -1) + if (ret != -1 && fake_dll_matches( file, dest )) + { + register_fake_dll( dest, data, size, delay_copy ); + } + else if (ret != -1) { HANDLE h = create_dest_file( dest, delete ); @@ -939,6 +1026,13 @@ static void delay_copy_files( struct list *delay_copy ) LIST_FOR_EACH_ENTRY_SAFE( copy, next, delay_copy, struct delay_copy, entry ) { list_remove( ©->entry ); + + if ( fake_dll_matches( copy->src, copy->dest ) ) + { + free( copy ); + continue; + } + ret = read_file( copy->src, &data, &size ); if (ret != 1) { @@ -978,6 +1072,7 @@ static void install_lib_dir( WCHAR *dest, WCHAR *file, const WCHAR *wildcard, if (lstrlenW( data.name ) > max_dll_name_len) continue; if (!wcscmp( data.name, L"." )) continue; if (!wcscmp( data.name, L".." )) continue; + if (!wcscmp( data.name, L"amd_ags_x64.dll" )) continue; lstrcpyW( name, data.name ); if (default_ext) /* inside build dir */ { @@ -1050,6 +1145,7 @@ BOOL create_fake_dll( const WCHAR *name, const WCHAR *source ) BOOL ret; SIZE_T size; const WCHAR *filename; + WCHAR *source_filename; void *buffer; BOOL delete = !wcscmp( source, L"-" ); /* '-' source means delete the file */ @@ -1066,25 +1162,55 @@ BOOL create_fake_dll( const WCHAR *name, const WCHAR *source ) add_handled_dll( filename ); - if (!(h = create_dest_file( name, delete ))) return TRUE; /* not a fake dll */ - if (h == INVALID_HANDLE_VALUE) return FALSE; + if (delete) + { + if (!(h = create_dest_file( name, delete ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + + /* '-' source means delete the file */ + TRACE( "deleting %s\n", debugstr_w(name) ); + ret = FALSE; - if ((buffer = load_fake_dll( source, &size ))) + CloseHandle( h ); + DeleteFileW( name ); + } + else if ((buffer = load_fake_dll( source, &size, &source_filename ))) { - DWORD written; + if (fake_dll_matches( source_filename, name )) + { + free( source_filename ); + + register_fake_dll( name, buffer, size, &delay_copy ); + ret = TRUE; + } + else + { + DWORD written; + + free( source_filename ); - ret = (WriteFile( h, buffer, size, &written, NULL ) && written == size); - if (ret) register_fake_dll( name, buffer, size, &delay_copy ); - else ERR( "failed to write to %s (error=%lu)\n", debugstr_w(name), GetLastError() ); + if (!(h = create_dest_file( name, FALSE ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + + ret = (WriteFile( h, buffer, size, &written, NULL ) && written == size); + if (ret) register_fake_dll( name, buffer, size, &delay_copy ); + else ERR( "failed to write to %s (error=%lu)\n", debugstr_w(name), GetLastError() ); + + CloseHandle( h ); + if (!ret) DeleteFileW( name ); + } } else { + if (!(h = create_dest_file( name, FALSE ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + WARN( "fake dll %s not found for %s\n", debugstr_w(source), debugstr_w(name) ); ret = build_fake_dll( h, name ); - } - CloseHandle( h ); - if (!ret) DeleteFileW( name ); + CloseHandle( h ); + if (!ret) DeleteFileW( name ); + } delay_copy_files( &delay_copy ); return ret; diff --git a/dlls/sharedgpures.sys/Makefile.in b/dlls/sharedgpures.sys/Makefile.in new file mode 100644 index 00000000000..9aca43fb45e --- /dev/null +++ b/dlls/sharedgpures.sys/Makefile.in @@ -0,0 +1,6 @@ +MODULE = sharedgpures.sys +IMPORTS = ntoskrnl +EXTRADLLFLAGS = -Wl,--subsystem,native + +SOURCES = \ + shared_resource.c diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c new file mode 100644 index 00000000000..ad836662af0 --- /dev/null +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -0,0 +1,518 @@ +#include + +#define NONAMELESSUNION +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "winioctl.h" + +#include "ddk/wdm.h" + +#include "wine/debug.h" +#include "wine/list.h" +#include "wine/server.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sharedgpures); + +static DRIVER_OBJECT *sharedgpures_driver; + +struct shared_resource +{ + unsigned int ref_count; + void *unix_resource; + WCHAR *name; + void *metadata; + SIZE_T metadata_size; + void **object_pool; + unsigned int object_pool_count; + UINT64 resource_size; +}; + +static struct shared_resource *resource_pool; +static unsigned int resource_pool_size; + +/* TODO: If/when ntoskrnl gets support for referencing user handles directly, remove this function */ +static void *reference_client_handle(obj_handle_t handle) +{ + HANDLE client_process, kernel_handle; + OBJECT_ATTRIBUTES attr; + void *object = NULL; + CLIENT_ID cid; + + attr.Length = sizeof(OBJECT_ATTRIBUTES); + attr.RootDirectory = 0; + attr.Attributes = OBJ_KERNEL_HANDLE; + attr.ObjectName = NULL; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + cid.UniqueProcess = PsGetCurrentProcessId(); + cid.UniqueThread = 0; + + if (NtOpenProcess(&client_process, PROCESS_ALL_ACCESS, &attr, &cid) != STATUS_SUCCESS) + return NULL; + + if (NtDuplicateObject(client_process, wine_server_ptr_handle(handle), NtCurrentProcess(), &kernel_handle, + 0, OBJ_KERNEL_HANDLE, DUPLICATE_SAME_ACCESS) != STATUS_SUCCESS) + { + NtClose(client_process); + return NULL; + } + + ObReferenceObjectByHandle(kernel_handle, 0, NULL, KernelMode, &object, NULL); + + NtClose(client_process); + NtClose(kernel_handle); + + return object; +} + +#define IOCTL_SHARED_GPU_RESOURCE_CREATE CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_create +{ + UINT64 resource_size; + obj_handle_t unix_handle; + WCHAR name[1]; +}; + +static NTSTATUS shared_resource_create(struct shared_resource **res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_create *input = buff; + void *unix_resource; + unsigned int i; + LPWSTR name; + + if (insize < sizeof(*input)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (input->name[ ((insize - offsetof(struct shared_resource_create, name)) / sizeof(WCHAR)) - 1 ]) + return STATUS_INVALID_PARAMETER; + + if (!(unix_resource = reference_client_handle(input->unix_handle))) + return STATUS_INVALID_HANDLE; + + if (insize == sizeof(*input)) + name = NULL; + else + { + name = ExAllocatePoolWithTag(NonPagedPool, insize - offsetof(struct shared_resource_create, name), 0); + wcscpy(name, &input->name[0]); + } + + for (i = 0; i < resource_pool_size; i++) + if (!resource_pool[i].ref_count) + break; + + if (i == resource_pool_size) + { + struct shared_resource *expanded_pool = + ExAllocatePoolWithTag(NonPagedPool, sizeof(struct shared_resource) * (resource_pool_size + 1024), 0); + + if (resource_pool) + { + memcpy(expanded_pool, resource_pool, resource_pool_size * sizeof(struct shared_resource)); + ExFreePoolWithTag(resource_pool, 0); + } + + memset(&expanded_pool[resource_pool_size], 0, 1024 * sizeof (struct shared_resource)); + + resource_pool = expanded_pool; + resource_pool_size += 1024; + } + + *res = &resource_pool[i]; + (*res)->ref_count = 1; + (*res)->unix_resource = unix_resource; + (*res)->name = name; + (*res)->resource_size = input->resource_size; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_OPEN CTL_CODE(FILE_DEVICE_VIDEO, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_open +{ + obj_handle_t kmt_handle; + WCHAR name[1]; +}; + +struct shared_resource_info +{ + UINT64 resource_size; +}; + +static unsigned int kmt_to_index(obj_handle_t kmt) +{ + if (!(kmt & 0x40000000) || (kmt - 2) % 4) + return -1; + return (((unsigned int) kmt & ~0x40000000) - 2) / 4; +} + +static NTSTATUS shared_resource_open(struct shared_resource **res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_open *input = buff; + unsigned int i; + + if (insize < sizeof(*input)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (input->kmt_handle) + { + if (kmt_to_index(input->kmt_handle) >= resource_pool_size) + return STATUS_INVALID_HANDLE; + + *res = &resource_pool[kmt_to_index(input->kmt_handle)]; + } + else + { + if (input->name[ ((insize - offsetof(struct shared_resource_open, name)) / sizeof(WCHAR)) - 1 ]) + return STATUS_INVALID_PARAMETER; + + /* name lookup */ + for (i = 0; i < resource_pool_size; i++) + { + if (resource_pool[i].name && !wcscmp(resource_pool[i].name, input->name)) + { + *res = &resource_pool[i]; + break; + } + } + if (i == resource_pool_size) + return STATUS_OBJECT_NAME_NOT_FOUND; + } + + (*res)->ref_count++; + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GETKMT CTL_CODE(FILE_DEVICE_VIDEO, 2, METHOD_BUFFERED, FILE_READ_ACCESS) + +static obj_handle_t index_to_kmt(unsigned int idx) +{ + return (idx * 4 + 2) | 0x40000000; +} + +static NTSTATUS shared_resource_getkmt(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (outsize < sizeof(unsigned int)) + return STATUS_INFO_LENGTH_MISMATCH; + + *((unsigned int *)buff) = index_to_kmt(res - resource_pool); + + iosb->Information = sizeof(unsigned int); + return STATUS_SUCCESS; +} + +/* TODO: If/when ntoskrnl gets support for opening user handles directly, remove this function */ +static obj_handle_t open_client_handle(void *object) +{ + HANDLE client_process, kernel_handle, handle = NULL; + OBJECT_ATTRIBUTES attr; + CLIENT_ID cid; + + attr.Length = sizeof(OBJECT_ATTRIBUTES); + attr.RootDirectory = 0; + attr.Attributes = OBJ_KERNEL_HANDLE; + attr.ObjectName = NULL; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + cid.UniqueProcess = PsGetCurrentProcessId(); + cid.UniqueThread = 0; + + if (NtOpenProcess(&client_process, PROCESS_ALL_ACCESS, &attr, &cid) != STATUS_SUCCESS) + return 0; + + if (ObOpenObjectByPointer(object, 0, NULL, GENERIC_ALL, NULL, KernelMode, &kernel_handle) != STATUS_SUCCESS) + { + NtClose(client_process); + return 0; + } + + NtDuplicateObject(NtCurrentProcess(), kernel_handle, client_process, &handle, + 0, 0, DUPLICATE_SAME_ACCESS); + + NtClose(client_process); + NtClose(kernel_handle); + + return wine_server_obj_handle(handle); +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_unix_resource(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (outsize < sizeof(obj_handle_t)) + return STATUS_INFO_LENGTH_MISMATCH; + + *((obj_handle_t *)buff) = open_client_handle(res->unix_resource); + + iosb->Information = sizeof(obj_handle_t); + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_SET_METADATA CTL_CODE(FILE_DEVICE_VIDEO, 4, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +static NTSTATUS shared_resource_set_metadata(struct shared_resource *res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + res->metadata = ExAllocatePoolWithTag(NonPagedPool, insize, 0); + memcpy(res->metadata, buff, insize); + res->metadata_size = insize; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_METADATA CTL_CODE(FILE_DEVICE_VIDEO, 5, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_metadata(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (!res->metadata) + return STATUS_NOT_FOUND; + + if (res->metadata_size > outsize) + return STATUS_BUFFER_TOO_SMALL; + + memcpy(buff, res->metadata, res->metadata_size); + iosb->Information = res->metadata_size; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_set_object +{ + unsigned int index; + obj_handle_t handle; +}; + +static NTSTATUS shared_resource_set_object(struct shared_resource *res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_set_object *params = buff; + void *object; + + if (insize < sizeof(*params)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (!(object = reference_client_handle(params->handle))) + return STATUS_INVALID_HANDLE; + + if (params->index >= res->object_pool_count) + { + void **expanded_pool = ExAllocatePoolWithTag(NonPagedPool, (params->index + 1) * sizeof(void *), 0); + + if (res->object_pool) + { + memcpy(expanded_pool, res->object_pool, res->object_pool_count * sizeof(void *)); + ExFreePoolWithTag(res->object_pool, 0); + } + + memset(&expanded_pool[res->object_pool_count], 0, (params->index + 1 - res->object_pool_count) * sizeof (void *)); + + res->object_pool = expanded_pool; + res->object_pool_count = params->index + 1; + } + + if (res->object_pool[params->index]) + ObDereferenceObject(res->object_pool[params->index]); + + res->object_pool[params->index] = object; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_object(struct shared_resource *res, void *buff, SIZE_T insize, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + unsigned int index; + + if (insize < sizeof(unsigned int) || outsize < sizeof(obj_handle_t)) + return STATUS_INFO_LENGTH_MISMATCH; + + index = *(unsigned int *)buff; + + if (index >= res->object_pool_count || !res->object_pool[index]) + return STATUS_INVALID_PARAMETER; + + *((obj_handle_t *)buff) = open_client_handle(res->object_pool[index]); + + iosb->Information = sizeof(obj_handle_t); + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_INFO CTL_CODE(FILE_DEVICE_VIDEO, 7, METHOD_BUFFERED, FILE_READ_ACCESS) +static NTSTATUS shared_resource_get_info(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_info *info = buff; + + if (sizeof(*info) > outsize) + return STATUS_BUFFER_TOO_SMALL; + + info->resource_size = res->resource_size; + iosb->Information = sizeof(*info); + return STATUS_SUCCESS; +} + + +static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) +{ + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + +static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) +{ + IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); + struct shared_resource *res = &resource_pool[ (UINT_PTR) stack->FileObject->FsContext ]; + + TRACE("Freeing shared resouce %p.\n", res); + + if (res) + { + res->ref_count--; + if (!res->ref_count) + { + if (res->unix_resource) + { + /* TODO: see if its possible to destroy the object here (unlink?) */ + ObDereferenceObject(res->unix_resource); + res->unix_resource = NULL; + } + if (res->metadata) + { + ExFreePoolWithTag(res->metadata, 0); + res->metadata = NULL; + } + if (res->object_pool) + { + unsigned int i; + for (i = 0; i < res->object_pool_count; i++) + { + if (res->object_pool[i]) + ObDereferenceObject(res->object_pool[i]); + } + ExFreePoolWithTag(res->object_pool, 0); + res->object_pool = NULL; + res->object_pool_count = 0; + } + } + } + + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + +static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) +{ + IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); + struct shared_resource *res = &resource_pool[ (UINT_PTR) stack->FileObject->FsContext ]; + NTSTATUS status; + + TRACE( "ioctl %#lx insize %lu outsize %lu\n", + stack->Parameters.DeviceIoControl.IoControlCode, + stack->Parameters.DeviceIoControl.InputBufferLength, + stack->Parameters.DeviceIoControl.OutputBufferLength ); + + switch (stack->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_SHARED_GPU_RESOURCE_CREATE: + status = shared_resource_create( &res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_OPEN: + status = shared_resource_open( &res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GETKMT: + status = shared_resource_getkmt( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE: + status = shared_resource_get_unix_resource( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_SET_METADATA: + status = shared_resource_set_metadata( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_METADATA: + status = shared_resource_get_metadata( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT: + status = shared_resource_set_object( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT: + status = shared_resource_get_object( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_INFO: + status = shared_resource_get_info( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + default: + FIXME( "ioctl %#lx not supported\n", stack->Parameters.DeviceIoControl.IoControlCode ); + status = STATUS_NOT_SUPPORTED; + break; + } + + if (!status) + stack->FileObject->FsContext = (void *)(UINT_PTR)(res - resource_pool); + + irp->IoStatus.u.Status = status; + IoCompleteRequest( irp, IO_NO_INCREMENT ); + return status; +} + +NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) +{ + static const WCHAR device_nameW[] = L"\\Device\\SharedGpuResource"; + static const WCHAR link_nameW[] = L"\\??\\SharedGpuResource"; + UNICODE_STRING device_name, link_name; + DEVICE_OBJECT *device; + NTSTATUS status; + + sharedgpures_driver = driver; + + driver->MajorFunction[IRP_MJ_CREATE] = dispatch_create; + driver->MajorFunction[IRP_MJ_CLOSE] = dispatch_close; + driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = dispatch_ioctl; + + RtlInitUnicodeString(&device_name, device_nameW); + RtlInitUnicodeString(&link_name, link_nameW); + + if ((status = IoCreateDevice(driver, 0, &device_name, 0, 0, FALSE, &device))) + return status; + + return IoCreateSymbolicLink(&link_name, &device_name); +} diff --git a/dlls/sharedgpures.sys/sharedgpures.sys.spec b/dlls/sharedgpures.sys/sharedgpures.sys.spec new file mode 100644 index 00000000000..76421d7e35b --- /dev/null +++ b/dlls/sharedgpures.sys/sharedgpures.sys.spec @@ -0,0 +1 @@ +# nothing to export diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 015d7cdd4e2..c384919fdc2 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2639,180 +2639,6 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) return hr; } -static char *xdg_config; -static DWORD xdg_config_len; - -static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context ) -{ - const WCHAR *var, *fmt = L"\\??\\unix%s/user-dirs.dirs"; - char *p; - WCHAR *name, *ptr; - HANDLE file; - DWORD len; - - if (!(var = _wgetenv( L"XDG_CONFIG_HOME" )) || var[0] != '/') - { - if (!(var = _wgetenv( L"WINEHOMEDIR" ))) return TRUE; - fmt = L"%s/.config/user-dirs.dirs"; - } - len = lstrlenW(var) + lstrlenW(fmt); - name = malloc( len * sizeof(WCHAR) ); - swprintf( name, len, fmt, var ); - name[1] = '\\'; /* change \??\ to \\?\ */ - for (ptr = name; *ptr; ptr++) if (*ptr == '/') *ptr = '\\'; - - file = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - free( name ); - if (file != INVALID_HANDLE_VALUE) - { - len = GetFileSize( file, NULL ); - if (!(xdg_config = malloc( len + 1 ))) return TRUE; - if (!ReadFile( file, xdg_config, len, &xdg_config_len, NULL )) - { - free( xdg_config ); - xdg_config = NULL; - } - else - { - for (p = xdg_config; p < xdg_config + xdg_config_len; p++) if (*p == '\n') *p = 0; - *p = 0; /* append null to simplify string parsing */ - } - CloseHandle( file ); - } - return TRUE; -} - -static char *get_xdg_path( const char *var ) -{ - static INIT_ONCE once; - char *p, *ret = NULL; - int i; - - InitOnceExecuteOnce( &once, init_xdg_dirs, NULL, NULL ); - if (!xdg_config) return NULL; - - for (p = xdg_config; p < xdg_config + xdg_config_len; p += strlen(p) + 1) - { - while (*p == ' ' || *p == '\t') p++; - if (strncmp( p, var, strlen(var) )) continue; - p += strlen(var); - while (*p == ' ' || *p == '\t') p++; - if (*p != '=') continue; - p++; - while (*p == ' ' || *p == '\t') p++; - if (*p != '"') continue; - p++; - if (*p != '/' && strncmp( p, "$HOME/", 6 )) continue; - - if (!(ret = malloc( strlen(p) + 1 ))) break; - for (i = 0; *p && *p != '"'; i++, p++) - { - if (*p == '\\' && p[1]) p++; - ret[i] = *p; - } - ret[i] = 0; - if (*p != '"') - { - free( ret ); - ret = NULL; - } - break; - } - return ret; -} - -static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *link ) -{ - struct mountmgr_shell_folder *ioctl; - DWORD len = sizeof(*ioctl) + path->Length + strlen(link) + 1; - BOOL ret; - - if (!(ioctl = malloc( len ))) return FALSE; - ioctl->create_backup = FALSE; - ioctl->folder_offset = sizeof(*ioctl); - ioctl->folder_size = path->Length; - memcpy( (char *)ioctl + ioctl->folder_offset, path->Buffer, ioctl->folder_size ); - ioctl->symlink_offset = ioctl->folder_offset + ioctl->folder_size; - strcpy( (char *)ioctl + ioctl->symlink_offset, link ); - - ret = DeviceIoControl( mgr, IOCTL_MOUNTMGR_DEFINE_SHELL_FOLDER, ioctl, len, NULL, 0, NULL, NULL ); - free( ioctl ); - return ret; -} - -/****************************************************************************** - * create_link - * - * Sets up a symbolic link for one of the 'My Whatever' shell folders to point - * into the corresponding XDG directory. - */ -static void create_link( const WCHAR *path, const char *xdg_name, const char *default_name ) -{ - UNICODE_STRING nt_name; - char *target = NULL; - HANDLE mgr; - - if ((mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - 0, 0 )) == INVALID_HANDLE_VALUE) - { - FIXME( "failed to connect to mount manager\n" ); - return; - } - - nt_name.Buffer = NULL; - if (!RtlDosPathNameToNtPathName_U( path, &nt_name, NULL, NULL )) goto done; - - if ((target = get_xdg_path( xdg_name ))) - { - if (link_folder( mgr, &nt_name, target )) goto done; - } - link_folder( mgr, &nt_name, default_name ); - -done: - RtlFreeUnicodeString( &nt_name ); - free( target ); - CloseHandle( mgr ); -} - -/****************************************************************************** - * _SHCreateSymbolicLink [Internal] - * - * Sets up a symbolic link for one of the special shell folders to point into - * the users home directory. - * - * PARAMS - * nFolder [I] CSIDL identifying the folder. - */ -static void _SHCreateSymbolicLink(int nFolder, const WCHAR *path) -{ - DWORD folder = nFolder & CSIDL_FOLDER_MASK; - - switch (folder) { - case CSIDL_PERSONAL: - create_link( path, "XDG_DOCUMENTS_DIR", "$HOME/Documents" ); - break; - case CSIDL_DESKTOPDIRECTORY: - create_link( path, "XDG_DESKTOP_DIR", "$HOME/Desktop" ); - break; - case CSIDL_MYPICTURES: - create_link( path, "XDG_PICTURES_DIR", "$HOME/Pictures" ); - break; - case CSIDL_MYVIDEO: - create_link( path, "XDG_VIDEOS_DIR", "$HOME/Movies" ); - break; - case CSIDL_MYMUSIC: - create_link( path, "XDG_MUSIC_DIR", "$HOME/Music" ); - break; - case CSIDL_DOWNLOADS: - create_link( path, "XDG_DOWNLOAD_DIR", "$HOME/Downloads" ); - break; - case CSIDL_TEMPLATES: - create_link( path, "XDG_TEMPLATES_DIR", "$HOME/Templates" ); - break; - } -} - /****************************************************************************** * SHGetFolderPathW [SHELL32.@] * @@ -3001,10 +2827,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( goto end; } - /* create symbolic links rather than directories for specific - * user shell folders */ - _SHCreateSymbolicLink(folder, szBuildPath); - /* create directory/directories */ ret = SHCreateDirectoryExW(hwndOwner, szBuildPath, NULL); if (ret && ret != ERROR_ALREADY_EXISTS) @@ -3059,6 +2881,8 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], UINT foldersLen) { + static const WCHAR WineVistaPathsW[] = {'_','_','W','i','n','e','V','i','s','t','a','P','a','t','h','s',0}; + const WCHAR *szValueName; WCHAR buffer[40]; UINT i; @@ -3067,6 +2891,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, HKEY hUserKey = NULL, hKey = NULL; DWORD dwType, dwPathLen; LONG ret; + DWORD already_vista_paths = 0; TRACE("%p,%p,%s,%p,%u\n", hRootKey, hToken, debugstr_w(szUserShellFolderPath), folders, foldersLen); @@ -3080,6 +2905,12 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, if (ret) hr = HRESULT_FROM_WIN32(ret); } + + /* check if the registry has already been updated to the vista+ style paths */ + dwPathLen = sizeof(already_vista_paths); + RegQueryValueExW(hUserKey, WineVistaPathsW, NULL, &dwType, + (LPBYTE)&already_vista_paths, &dwPathLen); + for (i = 0; SUCCEEDED(hr) && i < foldersLen; i++) { dwPathLen = MAX_PATH * sizeof(WCHAR); @@ -3092,9 +2923,10 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, szValueName = &buffer[0]; } - if (RegQueryValueExW(hUserKey, szValueName, NULL, - &dwType, (LPBYTE)path, &dwPathLen) || (dwType != REG_SZ && - dwType != REG_EXPAND_SZ)) + if (!already_vista_paths || + RegQueryValueExW(hUserKey, szValueName, NULL, &dwType, + (LPBYTE)path, &dwPathLen) || + (dwType != REG_SZ && dwType != REG_EXPAND_SZ)) { *path = '\0'; if (CSIDL_Data[folders[i]].type == CSIDL_Type_User) @@ -3135,6 +2967,11 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, hToken, SHGFP_TYPE_DEFAULT, path); } } + + already_vista_paths = 1; + RegSetValueExW(hUserKey, WineVistaPathsW, 0, REG_DWORD, + (LPBYTE)&already_vista_paths, sizeof(already_vista_paths)); + if (hUserKey) RegCloseKey(hUserKey); if (hKey) @@ -3275,6 +3112,23 @@ static HRESULT create_extra_folders(void) hr = SHGetFolderPathAndSubDirW(0, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, L"Microsoft\\Windows\\Themes", path); } + + + /* Proton HACK: In older Proton versions, duplicate Stuff directories were + * created at both %PROFILE%\Music and %PROFILE\Documents\Music. Due to + * some bugs when downgrading to those older Proton versions, create those + * missing Documents directories here, too. */ + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Downloads", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Music", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Pictures", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Templates", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Videos", path); + return hr; } diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index eb9ca4a06df..2fdbdebe94b 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1124,13 +1124,13 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) if (r != ERROR_SUCCESS ) return hkey; - r = RegQueryValueExW( hkey, NULL, 0, &type, NULL, &sz ); + r = RegQueryValueExW( hkey, L"", 0, &type, NULL, &sz ); if ( r == ERROR_SUCCESS && type == REG_SZ ) { sz += sizeof (WCHAR); cls = malloc( sz ); cls[0] = 0; - RegQueryValueExW( hkey, NULL, 0, &type, (LPBYTE) cls, &sz ); + RegQueryValueExW( hkey, L"", 0, &type, (LPBYTE) cls, &sz ); } RegCloseKey( hkey ); diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 2e5f0e6c6ea..ce4aa0b53ae 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1141,16 +1141,28 @@ static HRESULT msaa_acc_get_focus(struct msaa_provider *prov, struct msaa_provid if (V_VT(&v) == VT_DISPATCH) { + IAccessible2 *ia2 = NULL; + hr = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IAccessible, (void **)&focus_acc); VariantClear(&v); if (FAILED(hr)) return hr; - hr = WindowFromAccessibleObject(focus_acc, &hwnd); - if (FAILED(hr) || !hwnd) + if ((ia2 = msaa_acc_get_ia2(focus_acc))) { - IAccessible_Release(focus_acc); - return hr; + hr = IAccessible2_get_windowHandle(ia2, &hwnd); + if (FAILED(hr)) + WARN("IA2 get_windowHandle failed with hr %#lx\n", hr); + IAccessible2_Release(ia2); + } + if (!hwnd) + { + hr = WindowFromAccessibleObject(focus_acc, &hwnd); + if (FAILED(hr) || !hwnd) + { + IAccessible_Release(focus_acc); + return hr; + } } } @@ -1463,9 +1475,18 @@ HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL ro { HRESULT hr; - hr = WindowFromAccessibleObject(acc, &msaa_prov->hwnd); - if (FAILED(hr)) - WARN("WindowFromAccessibleObject failed with hr %#lx\n", hr); + if (msaa_prov->ia2) + { + hr = IAccessible2_get_windowHandle(msaa_prov->ia2, &msaa_prov->hwnd); + if (FAILED(hr)) + WARN("IA2 get_windowHandle failed with hr %#lx\n", hr); + } + if (!msaa_prov->hwnd) + { + hr = WindowFromAccessibleObject(acc, &msaa_prov->hwnd); + if (FAILED(hr)) + WARN("WindowFromAccessibleObject failed with hr %#lx\n", hr); + } } else msaa_prov->hwnd = hwnd; diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 39f429813d6..f7a427a5aa4 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -5105,6 +5105,12 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B } break; + case WM_GETOBJECT: + if (lParam == (DWORD)OBJID_QUERYCLASSNAMEIDX) + result = 0x10004; + + break; + default: result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode); break; diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 8f3cd8acae7..f91b65a5f56 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -31,6 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); WINE_DECLARE_DEBUG_CHANNEL(keyboard); +WINE_DECLARE_DEBUG_CHANNEL(rawinput); /*********************************************************************** * get_locale_kbd_layout @@ -502,6 +503,7 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout ) static DWORD CALLBACK devnotify_window_callbackW(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header) { + TRACE_(rawinput)("handle %p, flags %#lx, header %p\n", handle, flags, header); SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL); return 0; } @@ -585,7 +587,7 @@ HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWOR struct device_notification_details details; DEV_BROADCAST_HDR *header = filter; - TRACE("handle %p, filter %p, flags %#lx\n", handle, filter, flags); + TRACE_(rawinput)("handle %p, filter %p, flags %#lx\n", handle, filter, flags); if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)) { @@ -695,28 +697,8 @@ LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_siz */ BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle ) { - FIXME( "handle %p stub!\n", handle ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; -} - -/***************************************************************************** - * GetTouchInputInfo (USER32.@) - */ -BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) -{ - FIXME( "handle %p, count %u, ptr %p, size %u stub!\n", handle, count, ptr, size ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; -} - -/********************************************************************** - * IsTouchWindow (USER32.@) - */ -BOOL WINAPI IsTouchWindow( HWND hwnd, ULONG *flags ) -{ - FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags ); - return FALSE; + TRACE( "handle %p.\n", handle ); + return TRUE; } /***************************************************************************** @@ -724,9 +706,8 @@ BOOL WINAPI IsTouchWindow( HWND hwnd, ULONG *flags ) */ BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags ) { - FIXME( "hwnd %p, flags %#lx stub!\n", hwnd, flags ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + TRACE( "hwnd %p, flags %#lx.\n", hwnd, flags ); + return NtUserCallTwoParam( (ULONG_PTR)hwnd, flags, NtUserCallTwoParam_RegisterTouchWindow ); } /***************************************************************************** @@ -734,9 +715,8 @@ BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags ) */ BOOL WINAPI UnregisterTouchWindow( HWND hwnd ) { - FIXME( "hwnd %p stub!\n", hwnd ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + TRACE( "hwnd %p.\n", hwnd ); + return NtUserCallOneParam( (ULONG_PTR)hwnd, NtUserCallOneParam_UnregisterTouchWindow ); } /***************************************************************************** diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index 497d40e9dc6..1087bdbbd21 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -497,7 +497,8 @@ BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type) return FALSE; } - *type = PT_MOUSE; + if (id == 1) *type = PT_MOUSE; + else *type = PT_TOUCH; return TRUE; } diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 00c7368c516..96c859700cd 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -18,9 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include "user_private.h" #include "controls.h" #include "wine/debug.h" +#include "ntuser.h" WINE_DEFAULT_DEBUG_CHANNEL(nonclient); @@ -31,6 +33,16 @@ static void adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD exStyl { int adjust = 0; + if (__wine_get_window_manager() == WINE_WM_X11_STEAMCOMPMGR) + { + /* Disable gamescope undecorated windows hack for following games. They don't expect client + * rect equals to window rect when in windowed mode. */ + const char *sgi = getenv( "SteamGameId" ); + if (!((style & WS_POPUP) && (exStyle & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ + !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + return; + } + if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) adjust = 1; /* for the outer frame always present */ else if ((exStyle & WS_EX_DLGMODALFRAME) || (style & (WS_THICKFRAME|WS_DLGFRAME))) diff --git a/dlls/user32/resources/oic_winlogo.ico b/dlls/user32/resources/oic_winlogo.ico index ea183d07bf6..8cdda91509f 100644 Binary files a/dlls/user32/resources/oic_winlogo.ico and b/dlls/user32/resources/oic_winlogo.ico differ diff --git a/dlls/user32/resources/oic_winlogo.svg b/dlls/user32/resources/oic_winlogo.svg index 1d3b7f88123..28fd6adfcb0 100644 --- a/dlls/user32/resources/oic_winlogo.svg +++ b/dlls/user32/resources/oic_winlogo.svg @@ -1,1237 +1,67 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index b941f126a58..e91737cbcc2 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -999,3 +999,10 @@ LONG WINAPI SetDisplayConfig(UINT32 path_info_count, DISPLAYCONFIG_PATH_INFO *pa return ERROR_SUCCESS; } + +LONG WINAPI GetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, + UINT32 *num_mode_info ) +{ + flags |= 0x40000000; /* HACK: avoid triggering display updates in NtUserGetDisplayConfigBufferSizes(). */ + return NtUserGetDisplayConfigBufferSizes(flags, num_path_info, num_mode_info); +} diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index f92b839f1cb..4a456d35c8f 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -5386,6 +5386,23 @@ static void test_ClipCursor( char **argv ) if (!EqualRect( &rect, &virtual_rect )) ok_ret( 1, ClipCursor( NULL ) ); } +static void test_GetKeyboardLayout(void) +{ + LANGID lang_id; + BOOL is_cjk; + HKL hkl; + + /* Test that the high word of the keyboard layout in CJK locale on Vista+ is the same as the low + * word, even when IME is on */ + lang_id = PRIMARYLANGID(GetUserDefaultLCID()); + is_cjk = (lang_id == LANG_CHINESE || lang_id == LANG_JAPANESE || lang_id == LANG_KOREAN); + if (is_cjk && LOBYTE(LOWORD(GetVersion())) > 5) + { + hkl = GetKeyboardLayout(0); + ok(HIWORD(hkl) == LOWORD(hkl), "Got unexpected hkl %p.\n", hkl); + } +} + START_TEST(input) { char **argv; @@ -5431,6 +5448,7 @@ START_TEST(input) test_RegisterRawInputDevices(); test_rawinput(argv[0]); test_DefRawInputProc(); + test_GetKeyboardLayout(); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx( argv ); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 2fd31be3314..8f5d1c0b973 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1796,7 +1796,7 @@ static void test_shell_window(void) WaitForSingleObject(hthread, INFINITE); - DeleteObject(hthread); + CloseHandle(hthread); CloseDesktop(hdesk); } @@ -13030,6 +13030,111 @@ static void test_WM_NCCALCSIZE(void) DestroyWindow(hwnd); } +#define TRAY_MINIMIZE_ALL 419 +#define TRAY_MINIMIZE_ALL_UNDO 416 + +static void test_shell_tray(void) +{ + HWND hwnd, traywnd; + + if (!(traywnd = FindWindowA( "Shell_TrayWnd", NULL ))) + { + skip( "Shell_TrayWnd not found, skipping tests.\n" ); + return; + } + + hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL ); + ok( !!hwnd, "failed, error %lu.\n", GetLastError() ); + flush_events( TRUE ); + + ok( !IsIconic( hwnd ), "window is minimized.\n" ); + + SendMessageA( traywnd, WM_COMMAND, TRAY_MINIMIZE_ALL, 0xdeadbeef ); + flush_events( TRUE ); + todo_wine ok( IsIconic( hwnd ), "window is not minimized.\n" ); + + SendMessageA( traywnd, WM_COMMAND, TRAY_MINIMIZE_ALL_UNDO, 0xdeadbeef ); + flush_events( TRUE ); + ok( !IsIconic( hwnd ), "window is minimized.\n" ); + + DestroyWindow(hwnd); +} + +static int wm_mousemove_count; +static BOOL do_release_capture; + +static LRESULT WINAPI test_ReleaseCapture_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + if (msg == WM_MOUSEMOVE) + { + wm_mousemove_count++; + if (wm_mousemove_count >= 100) + return 1; + + if (do_release_capture) + ReleaseCapture(); + return 0; + } + return DefWindowProcA(hwnd, msg, wp, lp); +} + +static void test_ReleaseCapture(void) +{ + WNDCLASSA cls = {0}; + ATOM atom; + HWND hwnd; + POINT pt; + BOOL ret; + + cls.lpfnWndProc = test_ReleaseCapture_proc; + cls.hInstance = GetModuleHandleA(0); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(BLACK_BRUSH); + cls.lpszClassName = "test_ReleaseCapture_class"; + atom = RegisterClassA(&cls); + ok(!!atom, "RegisterClassA failed, error %#lx.\n", GetLastError()); + + hwnd = CreateWindowExA(WS_EX_TOPMOST, cls.lpszClassName, "", WS_POPUP | WS_VISIBLE, 100, 100, + 100, 100, NULL, NULL, 0, NULL); + ok(!!hwnd, "CreateWindowA failed, error %#lx.\n", GetLastError()); + ret = SetForegroundWindow(hwnd); + ok(ret, "SetForegroundWindow failed, error %#lx.\n", GetLastError()); + GetCursorPos(&pt); + ret = SetCursorPos(150, 150); + ok(ret, "SetCursorPos failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + + /* Test a Wine bug that WM_MOUSEMOVE is post too many times when calling ReleaseCapture() during + * handling WM_MOUSEMOVE and the cursor is on the window */ + do_release_capture = TRUE; + ret = ReleaseCapture(); + ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + do_release_capture = FALSE; + ok(wm_mousemove_count < 10, "Got too many WM_MOUSEMOVE.\n"); + + /* Test that ReleaseCapture() should send a WM_MOUSEMOVE if a window is captured */ + SetCapture(hwnd); + wm_mousemove_count = 0; + ret = ReleaseCapture(); + ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + ok(wm_mousemove_count == 1, "Got no WM_MOUSEMOVE.\n"); + + /* Test that ReleaseCapture() shouldn't send WM_MOUSEMOVE if no window is captured */ + wm_mousemove_count = 0; + ret = ReleaseCapture(); + ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + ok(wm_mousemove_count == 0, "Got WM_MOUSEMOVE.\n"); + + ret = SetCursorPos(pt.x, pt.y); + ok(ret, "SetCursorPos failed, error %#lx.\n", GetLastError()); + DestroyWindow(hwnd); + UnregisterClassA(cls.lpszClassName, GetModuleHandleA(0)); +} + START_TEST(win) { char **argv; @@ -13212,6 +13317,7 @@ START_TEST(win) test_cancel_mode(); test_DragDetect(); test_WM_NCCALCSIZE(); + test_ReleaseCapture(); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook); @@ -13226,4 +13332,5 @@ START_TEST(win) test_topmost(); test_shell_window(); + test_shell_tray(); } diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 042730845f1..ffe5af2daa0 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -292,7 +292,7 @@ @ stdcall GetDesktopWindow() @ stdcall GetDialogBaseUnits() @ stdcall GetDisplayAutoRotationPreferences(ptr) -@ stdcall GetDisplayConfigBufferSizes(long ptr ptr) NtUserGetDisplayConfigBufferSizes +@ stdcall GetDisplayConfigBufferSizes(long ptr ptr) @ stdcall GetDlgCtrlID(long) @ stdcall GetDlgItem(long long) @ stdcall GetDlgItemInt(long long ptr long) @@ -398,7 +398,7 @@ @ stdcall GetThreadDpiHostingBehavior() @ stdcall GetTitleBarInfo(long ptr) NtUserGetTitleBarInfo @ stdcall GetTopWindow(long) -@ stdcall GetTouchInputInfo(long long ptr long) +@ stdcall GetTouchInputInfo(long long ptr long) NtUserGetTouchInputInfo @ stdcall GetUpdateRect(long ptr long) NtUserGetUpdateRect @ stdcall GetUpdateRgn(long long long) NtUserGetUpdateRgn @ stdcall GetUpdatedClipboardFormats(ptr long ptr) NtUserGetUpdatedClipboardFormats @@ -482,7 +482,7 @@ @ stdcall IsProcessDPIAware() @ stdcall IsRectEmpty(ptr) # @ stub IsServerSideWindow -@ stdcall IsTouchWindow(long ptr) +@ stdcall IsTouchWindow(long ptr) NtUserIsTouchWindow @ stdcall IsValidDpiAwarenessContext(long) @ stdcall IsWinEventHookInstalled(long) @ stdcall IsWindow(long) diff --git a/dlls/vbscript/tests/caller.c b/dlls/vbscript/tests/caller.c index 19eccfe715d..8b99fa7e129 100644 --- a/dlls/vbscript/tests/caller.c +++ b/dlls/vbscript/tests/caller.c @@ -74,6 +74,7 @@ extern const CLSID CLSID_VBScript; expect_ ## func = called_ ## func = FALSE DEFINE_EXPECT(sp_caller_QI_NULL); +DEFINE_EXPECT(site_QI_NULL); DEFINE_EXPECT(testGetCaller); DEFINE_EXPECT(testGetCallerVBS); DEFINE_EXPECT(testGetCallerNested); @@ -303,7 +304,9 @@ static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WO break; } - case DISPID_TEST_TESTGETCALLERVBS: + case DISPID_TEST_TESTGETCALLERVBS: { + IUnknown *unk; + CHECK_EXPECT(testGetCallerVBS); ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags); @@ -318,7 +321,14 @@ static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WO hres = IServiceProvider_QueryService(pspCaller, &SID_GetCaller, &IID_IServiceProvider, (void**)&caller); ok(hres == E_NOINTERFACE, "QueryService(SID_GetCaller) returned: %08lx\n", hres); ok(caller == NULL, "caller != NULL\n"); + + SET_EXPECT(site_QI_NULL); + hres = IServiceProvider_QueryService(pspCaller, &IID_IActiveScriptSite, &IID_NULL, (void**)&unk); + ok(hres == E_NOINTERFACE, "QueryService(IActiveScriptSite->NULL) returned: %08lx\n", hres); + ok(!unk, "unk != NULL\n"); + CHECK_CALLED(site_QI_NULL); break; + } case DISPID_TEST_TESTGETCALLERNESTED: CHECK_EXPECT(testGetCallerNested); @@ -374,6 +384,8 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, }else if(IsEqualGUID(&IID_IActiveScriptSite, riid)) { *ppv = iface; }else { + if(IsEqualGUID(&IID_NULL, riid)) + CHECK_EXPECT(site_QI_NULL); *ppv = NULL; return E_NOINTERFACE; } diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 39a5e3b1648..84a8e0bb97f 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -421,6 +421,14 @@ static HRESULT WINAPI vbcaller_QueryService(IServiceProvider *iface, REFGUID gui { struct vbcaller *This = vbcaller_from_IServiceProvider(iface); + if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) { + TRACE("(%p)->(IID_IActiveScriptSite)\n", This); + if(This->ctx->site) + return IActiveScriptSite_QueryInterface(This->ctx->site, riid, ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + if(IsEqualGUID(guidService, &SID_GetCaller)) { TRACE("(%p)->(SID_GetCaller)\n", This); *ppv = NULL; @@ -1224,6 +1232,7 @@ HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pU return E_OUTOFMEMORY; } + vbcaller->ctx = ctx; ctx->vbcaller = vbcaller; ctx->safeopt = INTERFACE_USES_DISPEX; list_init(&ctx->objects); diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 56e68411f45..6b67c8b1bc5 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -187,6 +187,7 @@ struct vbcaller { LONG ref; + script_ctx_t *ctx; IServiceProvider *caller; }; diff --git a/dlls/vulkan-1/Makefile.in b/dlls/vulkan-1/Makefile.in index 185d03d32aa..5b1b6eea612 100644 --- a/dlls/vulkan-1/Makefile.in +++ b/dlls/vulkan-1/Makefile.in @@ -2,8 +2,6 @@ MODULE = vulkan-1.dll IMPORTS = user32 IMPORTLIB = vulkan-1 -EXTRADLLFLAGS = -Wb,--prefer-native - SOURCES = \ version.rc \ vulkan.c diff --git a/dlls/vulkan-1/tests/vulkan.c b/dlls/vulkan-1/tests/vulkan.c index 74b9ccd4431..c93b06ea385 100644 --- a/dlls/vulkan-1/tests/vulkan.c +++ b/dlls/vulkan-1/tests/vulkan.c @@ -624,8 +624,9 @@ static void import_memory(VkDevice vk_device, VkMemoryAllocateInfo alloc_info, V import_handle_info.name = L"wine_test_buffer_export_name"; vr = vkAllocateMemory(vk_device, &alloc_info, NULL, &memory); - ok(vr == VK_SUCCESS, "vkAllocateMemory failed, VkResult %d.\n", vr); - vkFreeMemory(vk_device, memory, NULL); + todo_wine ok(vr == VK_SUCCESS, "vkAllocateMemory failed, VkResult %d.\n", vr); + if (vr == VK_SUCCESS) + vkFreeMemory(vk_device, memory, NULL); } } diff --git a/dlls/vulkan-1/vulkan-1.spec b/dlls/vulkan-1/vulkan-1.spec deleted file mode 100644 index 48ff2af3126..00000000000 --- a/dlls/vulkan-1/vulkan-1.spec +++ /dev/null @@ -1,253 +0,0 @@ -# Automatically generated from Vulkan vk.xml; DO NOT EDIT! -# -# This file is generated from Vulkan vk.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2015-2023 The Khronos Group Inc. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -@ stdcall vkAcquireNextImage2KHR(ptr ptr ptr) winevulkan.vkAcquireNextImage2KHR -@ stdcall vkAcquireNextImageKHR(ptr int64 int64 int64 int64 ptr) winevulkan.vkAcquireNextImageKHR -@ stdcall vkAllocateCommandBuffers(ptr ptr ptr) winevulkan.vkAllocateCommandBuffers -@ stdcall vkAllocateDescriptorSets(ptr ptr ptr) winevulkan.vkAllocateDescriptorSets -@ stdcall vkAllocateMemory(ptr ptr ptr ptr) winevulkan.vkAllocateMemory -@ stdcall vkBeginCommandBuffer(ptr ptr) winevulkan.vkBeginCommandBuffer -@ stdcall vkBindBufferMemory(ptr int64 int64 int64) winevulkan.vkBindBufferMemory -@ stdcall vkBindBufferMemory2(ptr long ptr) winevulkan.vkBindBufferMemory2 -@ stdcall vkBindImageMemory(ptr int64 int64 int64) winevulkan.vkBindImageMemory -@ stdcall vkBindImageMemory2(ptr long ptr) winevulkan.vkBindImageMemory2 -@ stdcall vkCmdBeginQuery(ptr int64 long long) winevulkan.vkCmdBeginQuery -@ stdcall vkCmdBeginRenderPass(ptr ptr long) winevulkan.vkCmdBeginRenderPass -@ stdcall vkCmdBeginRenderPass2(ptr ptr ptr) winevulkan.vkCmdBeginRenderPass2 -@ stdcall vkCmdBeginRendering(ptr ptr) winevulkan.vkCmdBeginRendering -@ stdcall vkCmdBindDescriptorSets(ptr long int64 long long ptr long ptr) winevulkan.vkCmdBindDescriptorSets -@ stdcall vkCmdBindIndexBuffer(ptr int64 int64 long) winevulkan.vkCmdBindIndexBuffer -@ stdcall vkCmdBindPipeline(ptr long int64) winevulkan.vkCmdBindPipeline -@ stdcall vkCmdBindVertexBuffers(ptr long long ptr ptr) winevulkan.vkCmdBindVertexBuffers -@ stdcall vkCmdBindVertexBuffers2(ptr long long ptr ptr ptr ptr) winevulkan.vkCmdBindVertexBuffers2 -@ stdcall vkCmdBlitImage(ptr int64 long int64 long long ptr long) winevulkan.vkCmdBlitImage -@ stdcall vkCmdBlitImage2(ptr ptr) winevulkan.vkCmdBlitImage2 -@ stdcall vkCmdClearAttachments(ptr long ptr long ptr) winevulkan.vkCmdClearAttachments -@ stdcall vkCmdClearColorImage(ptr int64 long ptr long ptr) winevulkan.vkCmdClearColorImage -@ stdcall vkCmdClearDepthStencilImage(ptr int64 long ptr long ptr) winevulkan.vkCmdClearDepthStencilImage -@ stdcall vkCmdCopyBuffer(ptr int64 int64 long ptr) winevulkan.vkCmdCopyBuffer -@ stdcall vkCmdCopyBuffer2(ptr ptr) winevulkan.vkCmdCopyBuffer2 -@ stdcall vkCmdCopyBufferToImage(ptr int64 int64 long long ptr) winevulkan.vkCmdCopyBufferToImage -@ stdcall vkCmdCopyBufferToImage2(ptr ptr) winevulkan.vkCmdCopyBufferToImage2 -@ stdcall vkCmdCopyImage(ptr int64 long int64 long long ptr) winevulkan.vkCmdCopyImage -@ stdcall vkCmdCopyImage2(ptr ptr) winevulkan.vkCmdCopyImage2 -@ stdcall vkCmdCopyImageToBuffer(ptr int64 long int64 long ptr) winevulkan.vkCmdCopyImageToBuffer -@ stdcall vkCmdCopyImageToBuffer2(ptr ptr) winevulkan.vkCmdCopyImageToBuffer2 -@ stdcall vkCmdCopyQueryPoolResults(ptr int64 long long int64 int64 int64 long) winevulkan.vkCmdCopyQueryPoolResults -@ stdcall vkCmdDispatch(ptr long long long) winevulkan.vkCmdDispatch -@ stdcall vkCmdDispatchBase(ptr long long long long long long) winevulkan.vkCmdDispatchBase -@ stdcall vkCmdDispatchIndirect(ptr int64 int64) winevulkan.vkCmdDispatchIndirect -@ stdcall vkCmdDraw(ptr long long long long) winevulkan.vkCmdDraw -@ stdcall vkCmdDrawIndexed(ptr long long long long long) winevulkan.vkCmdDrawIndexed -@ stdcall vkCmdDrawIndexedIndirect(ptr int64 int64 long long) winevulkan.vkCmdDrawIndexedIndirect -@ stdcall vkCmdDrawIndexedIndirectCount(ptr int64 int64 int64 int64 long long) winevulkan.vkCmdDrawIndexedIndirectCount -@ stdcall vkCmdDrawIndirect(ptr int64 int64 long long) winevulkan.vkCmdDrawIndirect -@ stdcall vkCmdDrawIndirectCount(ptr int64 int64 int64 int64 long long) winevulkan.vkCmdDrawIndirectCount -@ stdcall vkCmdEndQuery(ptr int64 long) winevulkan.vkCmdEndQuery -@ stdcall vkCmdEndRenderPass(ptr) winevulkan.vkCmdEndRenderPass -@ stdcall vkCmdEndRenderPass2(ptr ptr) winevulkan.vkCmdEndRenderPass2 -@ stdcall vkCmdEndRendering(ptr) winevulkan.vkCmdEndRendering -@ stdcall vkCmdExecuteCommands(ptr long ptr) winevulkan.vkCmdExecuteCommands -@ stdcall vkCmdFillBuffer(ptr int64 int64 int64 long) winevulkan.vkCmdFillBuffer -@ stdcall vkCmdNextSubpass(ptr long) winevulkan.vkCmdNextSubpass -@ stdcall vkCmdNextSubpass2(ptr ptr ptr) winevulkan.vkCmdNextSubpass2 -@ stdcall vkCmdPipelineBarrier(ptr long long long long ptr long ptr long ptr) winevulkan.vkCmdPipelineBarrier -@ stdcall vkCmdPipelineBarrier2(ptr ptr) winevulkan.vkCmdPipelineBarrier2 -@ stdcall vkCmdPushConstants(ptr int64 long long long ptr) winevulkan.vkCmdPushConstants -@ stdcall vkCmdResetEvent(ptr int64 long) winevulkan.vkCmdResetEvent -@ stdcall vkCmdResetEvent2(ptr int64 int64) winevulkan.vkCmdResetEvent2 -@ stdcall vkCmdResetQueryPool(ptr int64 long long) winevulkan.vkCmdResetQueryPool -@ stdcall vkCmdResolveImage(ptr int64 long int64 long long ptr) winevulkan.vkCmdResolveImage -@ stdcall vkCmdResolveImage2(ptr ptr) winevulkan.vkCmdResolveImage2 -@ stdcall vkCmdSetBlendConstants(ptr ptr) winevulkan.vkCmdSetBlendConstants -@ stdcall vkCmdSetCullMode(ptr long) winevulkan.vkCmdSetCullMode -@ stdcall vkCmdSetDepthBias(ptr float float float) winevulkan.vkCmdSetDepthBias -@ stdcall vkCmdSetDepthBiasEnable(ptr long) winevulkan.vkCmdSetDepthBiasEnable -@ stdcall vkCmdSetDepthBounds(ptr float float) winevulkan.vkCmdSetDepthBounds -@ stdcall vkCmdSetDepthBoundsTestEnable(ptr long) winevulkan.vkCmdSetDepthBoundsTestEnable -@ stdcall vkCmdSetDepthCompareOp(ptr long) winevulkan.vkCmdSetDepthCompareOp -@ stdcall vkCmdSetDepthTestEnable(ptr long) winevulkan.vkCmdSetDepthTestEnable -@ stdcall vkCmdSetDepthWriteEnable(ptr long) winevulkan.vkCmdSetDepthWriteEnable -@ stdcall vkCmdSetDeviceMask(ptr long) winevulkan.vkCmdSetDeviceMask -@ stdcall vkCmdSetEvent(ptr int64 long) winevulkan.vkCmdSetEvent -@ stdcall vkCmdSetEvent2(ptr int64 ptr) winevulkan.vkCmdSetEvent2 -@ stdcall vkCmdSetFrontFace(ptr long) winevulkan.vkCmdSetFrontFace -@ stdcall vkCmdSetLineWidth(ptr float) winevulkan.vkCmdSetLineWidth -@ stdcall vkCmdSetPrimitiveRestartEnable(ptr long) winevulkan.vkCmdSetPrimitiveRestartEnable -@ stdcall vkCmdSetPrimitiveTopology(ptr long) winevulkan.vkCmdSetPrimitiveTopology -@ stdcall vkCmdSetRasterizerDiscardEnable(ptr long) winevulkan.vkCmdSetRasterizerDiscardEnable -@ stdcall vkCmdSetScissor(ptr long long ptr) winevulkan.vkCmdSetScissor -@ stdcall vkCmdSetScissorWithCount(ptr long ptr) winevulkan.vkCmdSetScissorWithCount -@ stdcall vkCmdSetStencilCompareMask(ptr long long) winevulkan.vkCmdSetStencilCompareMask -@ stdcall vkCmdSetStencilOp(ptr long long long long long) winevulkan.vkCmdSetStencilOp -@ stdcall vkCmdSetStencilReference(ptr long long) winevulkan.vkCmdSetStencilReference -@ stdcall vkCmdSetStencilTestEnable(ptr long) winevulkan.vkCmdSetStencilTestEnable -@ stdcall vkCmdSetStencilWriteMask(ptr long long) winevulkan.vkCmdSetStencilWriteMask -@ stdcall vkCmdSetViewport(ptr long long ptr) winevulkan.vkCmdSetViewport -@ stdcall vkCmdSetViewportWithCount(ptr long ptr) winevulkan.vkCmdSetViewportWithCount -@ stdcall vkCmdUpdateBuffer(ptr int64 int64 int64 ptr) winevulkan.vkCmdUpdateBuffer -@ stdcall vkCmdWaitEvents(ptr long ptr long long long ptr long ptr long ptr) winevulkan.vkCmdWaitEvents -@ stdcall vkCmdWaitEvents2(ptr long ptr ptr) winevulkan.vkCmdWaitEvents2 -@ stdcall vkCmdWriteTimestamp(ptr long int64 long) winevulkan.vkCmdWriteTimestamp -@ stdcall vkCmdWriteTimestamp2(ptr int64 int64 long) winevulkan.vkCmdWriteTimestamp2 -@ stdcall vkCreateBuffer(ptr ptr ptr ptr) winevulkan.vkCreateBuffer -@ stdcall vkCreateBufferView(ptr ptr ptr ptr) winevulkan.vkCreateBufferView -@ stdcall vkCreateCommandPool(ptr ptr ptr ptr) winevulkan.vkCreateCommandPool -@ stdcall vkCreateComputePipelines(ptr int64 long ptr ptr ptr) winevulkan.vkCreateComputePipelines -@ stdcall vkCreateDescriptorPool(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorPool -@ stdcall vkCreateDescriptorSetLayout(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorSetLayout -@ stdcall vkCreateDescriptorUpdateTemplate(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorUpdateTemplate -@ stdcall vkCreateDevice(ptr ptr ptr ptr) winevulkan.vkCreateDevice -@ stub vkCreateDisplayModeKHR -@ stub vkCreateDisplayPlaneSurfaceKHR -@ stdcall vkCreateEvent(ptr ptr ptr ptr) winevulkan.vkCreateEvent -@ stdcall vkCreateFence(ptr ptr ptr ptr) winevulkan.vkCreateFence -@ stdcall vkCreateFramebuffer(ptr ptr ptr ptr) winevulkan.vkCreateFramebuffer -@ stdcall vkCreateGraphicsPipelines(ptr int64 long ptr ptr ptr) winevulkan.vkCreateGraphicsPipelines -@ stdcall vkCreateImage(ptr ptr ptr ptr) winevulkan.vkCreateImage -@ stdcall vkCreateImageView(ptr ptr ptr ptr) winevulkan.vkCreateImageView -@ stdcall vkCreateInstance(ptr ptr ptr) winevulkan.vkCreateInstance -@ stdcall vkCreatePipelineCache(ptr ptr ptr ptr) winevulkan.vkCreatePipelineCache -@ stdcall vkCreatePipelineLayout(ptr ptr ptr ptr) winevulkan.vkCreatePipelineLayout -@ stdcall vkCreatePrivateDataSlot(ptr ptr ptr ptr) winevulkan.vkCreatePrivateDataSlot -@ stdcall vkCreateQueryPool(ptr ptr ptr ptr) winevulkan.vkCreateQueryPool -@ stdcall vkCreateRenderPass(ptr ptr ptr ptr) winevulkan.vkCreateRenderPass -@ stdcall vkCreateRenderPass2(ptr ptr ptr ptr) winevulkan.vkCreateRenderPass2 -@ stdcall vkCreateSampler(ptr ptr ptr ptr) winevulkan.vkCreateSampler -@ stdcall vkCreateSamplerYcbcrConversion(ptr ptr ptr ptr) winevulkan.vkCreateSamplerYcbcrConversion -@ stdcall vkCreateSemaphore(ptr ptr ptr ptr) winevulkan.vkCreateSemaphore -@ stdcall vkCreateShaderModule(ptr ptr ptr ptr) winevulkan.vkCreateShaderModule -@ stub vkCreateSharedSwapchainsKHR -@ stdcall vkCreateSwapchainKHR(ptr ptr ptr ptr) winevulkan.vkCreateSwapchainKHR -@ stdcall vkCreateWin32SurfaceKHR(ptr ptr ptr ptr) winevulkan.vkCreateWin32SurfaceKHR -@ stdcall vkDestroyBuffer(ptr int64 ptr) winevulkan.vkDestroyBuffer -@ stdcall vkDestroyBufferView(ptr int64 ptr) winevulkan.vkDestroyBufferView -@ stdcall vkDestroyCommandPool(ptr int64 ptr) winevulkan.vkDestroyCommandPool -@ stdcall vkDestroyDescriptorPool(ptr int64 ptr) winevulkan.vkDestroyDescriptorPool -@ stdcall vkDestroyDescriptorSetLayout(ptr int64 ptr) winevulkan.vkDestroyDescriptorSetLayout -@ stdcall vkDestroyDescriptorUpdateTemplate(ptr int64 ptr) winevulkan.vkDestroyDescriptorUpdateTemplate -@ stdcall vkDestroyDevice(ptr ptr) winevulkan.vkDestroyDevice -@ stdcall vkDestroyEvent(ptr int64 ptr) winevulkan.vkDestroyEvent -@ stdcall vkDestroyFence(ptr int64 ptr) winevulkan.vkDestroyFence -@ stdcall vkDestroyFramebuffer(ptr int64 ptr) winevulkan.vkDestroyFramebuffer -@ stdcall vkDestroyImage(ptr int64 ptr) winevulkan.vkDestroyImage -@ stdcall vkDestroyImageView(ptr int64 ptr) winevulkan.vkDestroyImageView -@ stdcall vkDestroyInstance(ptr ptr) winevulkan.vkDestroyInstance -@ stdcall vkDestroyPipeline(ptr int64 ptr) winevulkan.vkDestroyPipeline -@ stdcall vkDestroyPipelineCache(ptr int64 ptr) winevulkan.vkDestroyPipelineCache -@ stdcall vkDestroyPipelineLayout(ptr int64 ptr) winevulkan.vkDestroyPipelineLayout -@ stdcall vkDestroyPrivateDataSlot(ptr int64 ptr) winevulkan.vkDestroyPrivateDataSlot -@ stdcall vkDestroyQueryPool(ptr int64 ptr) winevulkan.vkDestroyQueryPool -@ stdcall vkDestroyRenderPass(ptr int64 ptr) winevulkan.vkDestroyRenderPass -@ stdcall vkDestroySampler(ptr int64 ptr) winevulkan.vkDestroySampler -@ stdcall vkDestroySamplerYcbcrConversion(ptr int64 ptr) winevulkan.vkDestroySamplerYcbcrConversion -@ stdcall vkDestroySemaphore(ptr int64 ptr) winevulkan.vkDestroySemaphore -@ stdcall vkDestroyShaderModule(ptr int64 ptr) winevulkan.vkDestroyShaderModule -@ stdcall vkDestroySurfaceKHR(ptr int64 ptr) winevulkan.vkDestroySurfaceKHR -@ stdcall vkDestroySwapchainKHR(ptr int64 ptr) winevulkan.vkDestroySwapchainKHR -@ stdcall vkDeviceWaitIdle(ptr) winevulkan.vkDeviceWaitIdle -@ stdcall vkEndCommandBuffer(ptr) winevulkan.vkEndCommandBuffer -@ stdcall vkEnumerateDeviceExtensionProperties(ptr str ptr ptr) winevulkan.vkEnumerateDeviceExtensionProperties -@ stdcall vkEnumerateDeviceLayerProperties(ptr ptr ptr) winevulkan.vkEnumerateDeviceLayerProperties -@ stdcall vkEnumerateInstanceExtensionProperties(str ptr ptr) winevulkan.vkEnumerateInstanceExtensionProperties -@ stdcall vkEnumerateInstanceLayerProperties(ptr ptr) winevulkan.vkEnumerateInstanceLayerProperties -@ stdcall vkEnumerateInstanceVersion(ptr) winevulkan.vkEnumerateInstanceVersion -@ stdcall vkEnumeratePhysicalDeviceGroups(ptr ptr ptr) winevulkan.vkEnumeratePhysicalDeviceGroups -@ stdcall vkEnumeratePhysicalDevices(ptr ptr ptr) winevulkan.vkEnumeratePhysicalDevices -@ stdcall vkFlushMappedMemoryRanges(ptr long ptr) winevulkan.vkFlushMappedMemoryRanges -@ stdcall vkFreeCommandBuffers(ptr int64 long ptr) winevulkan.vkFreeCommandBuffers -@ stdcall vkFreeDescriptorSets(ptr int64 long ptr) winevulkan.vkFreeDescriptorSets -@ stdcall vkFreeMemory(ptr int64 ptr) winevulkan.vkFreeMemory -@ stdcall vkGetBufferDeviceAddress(ptr ptr) winevulkan.vkGetBufferDeviceAddress -@ stdcall vkGetBufferMemoryRequirements(ptr int64 ptr) winevulkan.vkGetBufferMemoryRequirements -@ stdcall vkGetBufferMemoryRequirements2(ptr ptr ptr) winevulkan.vkGetBufferMemoryRequirements2 -@ stdcall vkGetBufferOpaqueCaptureAddress(ptr ptr) winevulkan.vkGetBufferOpaqueCaptureAddress -@ stub vkGetCommandPoolMemoryConsumption -@ stdcall vkGetDescriptorSetLayoutSupport(ptr ptr ptr) winevulkan.vkGetDescriptorSetLayoutSupport -@ stdcall vkGetDeviceBufferMemoryRequirements(ptr ptr ptr) winevulkan.vkGetDeviceBufferMemoryRequirements -@ stdcall vkGetDeviceGroupPeerMemoryFeatures(ptr long long long ptr) winevulkan.vkGetDeviceGroupPeerMemoryFeatures -@ stdcall vkGetDeviceGroupPresentCapabilitiesKHR(ptr ptr) winevulkan.vkGetDeviceGroupPresentCapabilitiesKHR -@ stdcall vkGetDeviceGroupSurfacePresentModesKHR(ptr int64 ptr) winevulkan.vkGetDeviceGroupSurfacePresentModesKHR -@ stdcall vkGetDeviceImageMemoryRequirements(ptr ptr ptr) winevulkan.vkGetDeviceImageMemoryRequirements -@ stdcall vkGetDeviceImageSparseMemoryRequirements(ptr ptr ptr ptr) winevulkan.vkGetDeviceImageSparseMemoryRequirements -@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.vkGetDeviceMemoryCommitment -@ stdcall vkGetDeviceMemoryOpaqueCaptureAddress(ptr ptr) winevulkan.vkGetDeviceMemoryOpaqueCaptureAddress -@ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.vkGetDeviceProcAddr -@ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.vkGetDeviceQueue -@ stdcall vkGetDeviceQueue2(ptr ptr ptr) winevulkan.vkGetDeviceQueue2 -@ stub vkGetDisplayModePropertiesKHR -@ stub vkGetDisplayPlaneCapabilitiesKHR -@ stub vkGetDisplayPlaneSupportedDisplaysKHR -@ stdcall vkGetEventStatus(ptr int64) winevulkan.vkGetEventStatus -@ stub vkGetFaultData -@ stdcall vkGetFenceStatus(ptr int64) winevulkan.vkGetFenceStatus -@ stdcall vkGetImageMemoryRequirements(ptr int64 ptr) winevulkan.vkGetImageMemoryRequirements -@ stdcall vkGetImageMemoryRequirements2(ptr ptr ptr) winevulkan.vkGetImageMemoryRequirements2 -@ stdcall vkGetImageSparseMemoryRequirements(ptr int64 ptr ptr) winevulkan.vkGetImageSparseMemoryRequirements -@ stdcall vkGetImageSparseMemoryRequirements2(ptr ptr ptr ptr) winevulkan.vkGetImageSparseMemoryRequirements2 -@ stdcall vkGetImageSubresourceLayout(ptr int64 ptr ptr) winevulkan.vkGetImageSubresourceLayout -@ stdcall vkGetInstanceProcAddr(ptr str) winevulkan.vkGetInstanceProcAddr -@ stub vkGetPhysicalDeviceDisplayPlanePropertiesKHR -@ stub vkGetPhysicalDeviceDisplayPropertiesKHR -@ stdcall vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalBufferProperties -@ stdcall vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalFenceProperties -@ stdcall vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalSemaphoreProperties -@ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) winevulkan.vkGetPhysicalDeviceFeatures -@ stdcall vkGetPhysicalDeviceFeatures2(ptr ptr) winevulkan.vkGetPhysicalDeviceFeatures2 -@ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) winevulkan.vkGetPhysicalDeviceFormatProperties -@ stdcall vkGetPhysicalDeviceFormatProperties2(ptr long ptr) winevulkan.vkGetPhysicalDeviceFormatProperties2 -@ stdcall vkGetPhysicalDeviceImageFormatProperties(ptr long long long long long ptr) winevulkan.vkGetPhysicalDeviceImageFormatProperties -@ stdcall vkGetPhysicalDeviceImageFormatProperties2(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceImageFormatProperties2 -@ stdcall vkGetPhysicalDeviceMemoryProperties(ptr ptr) winevulkan.vkGetPhysicalDeviceMemoryProperties -@ stdcall vkGetPhysicalDeviceMemoryProperties2(ptr ptr) winevulkan.vkGetPhysicalDeviceMemoryProperties2 -@ stdcall vkGetPhysicalDevicePresentRectanglesKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDevicePresentRectanglesKHR -@ stdcall vkGetPhysicalDeviceProperties(ptr ptr) winevulkan.vkGetPhysicalDeviceProperties -@ stdcall vkGetPhysicalDeviceProperties2(ptr ptr) winevulkan.vkGetPhysicalDeviceProperties2 -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceQueueFamilyProperties -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties2(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceQueueFamilyProperties2 -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties(ptr long long long long long ptr ptr) winevulkan.vkGetPhysicalDeviceSparseImageFormatProperties -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties2(ptr ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSparseImageFormatProperties2 -@ stdcall vkGetPhysicalDeviceSurfaceCapabilities2KHR(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceCapabilities2KHR -@ stdcall vkGetPhysicalDeviceSurfaceCapabilitiesKHR(ptr int64 ptr) winevulkan.vkGetPhysicalDeviceSurfaceCapabilitiesKHR -@ stdcall vkGetPhysicalDeviceSurfaceFormats2KHR(ptr ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceFormats2KHR -@ stdcall vkGetPhysicalDeviceSurfaceFormatsKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceFormatsKHR -@ stdcall vkGetPhysicalDeviceSurfacePresentModesKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDeviceSurfacePresentModesKHR -@ stdcall vkGetPhysicalDeviceSurfaceSupportKHR(ptr long int64 ptr) winevulkan.vkGetPhysicalDeviceSurfaceSupportKHR -@ stdcall vkGetPhysicalDeviceToolProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceToolProperties -@ stdcall vkGetPhysicalDeviceWin32PresentationSupportKHR(ptr long) winevulkan.vkGetPhysicalDeviceWin32PresentationSupportKHR -@ stdcall vkGetPipelineCacheData(ptr int64 ptr ptr) winevulkan.vkGetPipelineCacheData -@ stdcall vkGetPrivateData(ptr long int64 int64 ptr) winevulkan.vkGetPrivateData -@ stdcall vkGetQueryPoolResults(ptr int64 long long long ptr int64 long) winevulkan.vkGetQueryPoolResults -@ stdcall vkGetRenderAreaGranularity(ptr int64 ptr) winevulkan.vkGetRenderAreaGranularity -@ stdcall vkGetSemaphoreCounterValue(ptr int64 ptr) winevulkan.vkGetSemaphoreCounterValue -@ stdcall vkGetSwapchainImagesKHR(ptr int64 ptr ptr) winevulkan.vkGetSwapchainImagesKHR -@ stdcall vkInvalidateMappedMemoryRanges(ptr long ptr) winevulkan.vkInvalidateMappedMemoryRanges -@ stdcall vkMapMemory(ptr int64 int64 int64 long ptr) winevulkan.vkMapMemory -@ stdcall vkMergePipelineCaches(ptr int64 long ptr) winevulkan.vkMergePipelineCaches -@ stdcall vkQueueBindSparse(ptr long ptr int64) winevulkan.vkQueueBindSparse -@ stdcall vkQueuePresentKHR(ptr ptr) winevulkan.vkQueuePresentKHR -@ stdcall vkQueueSubmit(ptr long ptr int64) winevulkan.vkQueueSubmit -@ stdcall vkQueueSubmit2(ptr long ptr int64) winevulkan.vkQueueSubmit2 -@ stdcall vkQueueWaitIdle(ptr) winevulkan.vkQueueWaitIdle -@ stdcall vkResetCommandBuffer(ptr long) winevulkan.vkResetCommandBuffer -@ stdcall vkResetCommandPool(ptr int64 long) winevulkan.vkResetCommandPool -@ stdcall vkResetDescriptorPool(ptr int64 long) winevulkan.vkResetDescriptorPool -@ stdcall vkResetEvent(ptr int64) winevulkan.vkResetEvent -@ stdcall vkResetFences(ptr long ptr) winevulkan.vkResetFences -@ stdcall vkResetQueryPool(ptr int64 long long) winevulkan.vkResetQueryPool -@ stdcall vkSetEvent(ptr int64) winevulkan.vkSetEvent -@ stdcall vkSetPrivateData(ptr long int64 int64 int64) winevulkan.vkSetPrivateData -@ stdcall vkSignalSemaphore(ptr ptr) winevulkan.vkSignalSemaphore -@ stdcall vkTrimCommandPool(ptr int64 long) winevulkan.vkTrimCommandPool -@ stdcall vkUnmapMemory(ptr int64) winevulkan.vkUnmapMemory -@ stdcall vkUpdateDescriptorSetWithTemplate(ptr int64 int64 ptr) winevulkan.vkUpdateDescriptorSetWithTemplate -@ stdcall vkUpdateDescriptorSets(ptr long ptr long ptr) winevulkan.vkUpdateDescriptorSets -@ stdcall vkWaitForFences(ptr long ptr long int64) winevulkan.vkWaitForFences -@ stdcall vkWaitSemaphores(ptr ptr int64) winevulkan.vkWaitSemaphores diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 31df1f5c920..67b446722fc 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -4195,8 +4195,8 @@ static enum fill_status fill_videocontroller( struct table *table, const struct rec->current_verticalres = vres; rec->description = wcsdup( name ); rec->device_id = L"VideoController1"; - rec->driverdate = L"20230420000000.000000-000"; - rec->driverversion = L"31.0.14051.5006"; + rec->driverdate = L"20230831000000.000000-000"; + rec->driverversion = L"31.0.21902.5"; rec->installeddriver = get_videocontroller_installeddriver( desc.VendorId ); rec->name = wcsdup( name ); rec->pnpdevice_id = get_videocontroller_pnpdeviceid( &desc ); diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 1087e271837..d7990305003 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -93,23 +93,30 @@ void destroy_view( struct view *view ) free( view ); } -static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr ) +static BOOL eval_like( const WCHAR *text, const WCHAR *pattern ) { - const WCHAR *p = lstr, *q = rstr; + if (wcsstr( pattern, L"[" )) FIXME( "character ranges (i.e. [abc], [^a-z]) are not supported\n" ); - while (*p && *q) + while (*text) { - if (q[0] == '\\' && q[1] == '\\') q++; - if (*q == '%') + if (pattern[0] == '\\' && pattern[1] == '\\') pattern++; + + if (*pattern == '%') { - while (*q == '%') q++; - if (!*q) return TRUE; - while (*p && *q && towupper( *p ) == towupper( *q )) { p++; q++; }; - if (!*p && !*q) return TRUE; + while (*pattern == '%') pattern++; + if (!*pattern) return TRUE; + while (!eval_like( text, pattern ) && *text) text++; + + return !!*text; } - if (*q != '%' && towupper( *p++ ) != towupper( *q++ )) return FALSE; + + if (*pattern != '_' && towupper( *text ) != towupper( *pattern )) return FALSE; + text++; pattern++; } - return TRUE; + + while (*pattern == '%') pattern++; + + return *pattern == '\0'; } static HRESULT eval_strcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGLONG *val ) diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 825ad2459f5..f5a3c2a14cd 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -140,6 +140,82 @@ static void test_select( IWbemServices *services ) SysFreeString( query ); } +static void check_explorer_like_query( IWbemServices *services, const WCHAR *str, BOOL expect_success) +{ + HRESULT hr; + IWbemClassObject *obj[2]; + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( str ); + LONG flags = WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY; + ULONG count; + IEnumWbemClassObject *result; + + hr = IWbemServices_ExecQuery( services, wql, query, flags, NULL, &result ); + if (hr == S_OK) + { + VARIANT var; + IEnumWbemClassObject_Next( result, 10000, 2, obj, &count ); + + ok( count == (expect_success ? 1 : 0), "expected to get %d results but got %lu\n", + (expect_success ? 1 : 0), count); + + if (count) + { + BSTR caption; + hr = IWbemClassObject_Get( obj[0], L"Caption", 0, &var, NULL, NULL ); + ok( hr == WBEM_S_NO_ERROR, "IWbemClassObject_Get failed %#lx", hr); + caption = V_BSTR(&var); + ok( !wcscmp( caption, L"explorer.exe" ), "%s is not explorer.exe\n", debugstr_w(caption)); + VariantClear( &var ); + } + + while (count--) + IWbemClassObject_Release( obj[count] ); + } + + SysFreeString( wql ); + SysFreeString( query ); +} + + +static void test_like_query( IWbemServices *services ) +{ + int i; + WCHAR query[250]; + + struct { + BOOL expect_success; + const WCHAR *str; + } queries[] = { + { TRUE, L"explorer%" }, + { FALSE, L"xplorer.exe" }, + { FALSE, L"explorer.ex" }, + { TRUE, L"%explorer%" }, + { TRUE, L"explorer.exe%" }, + { TRUE, L"%explorer.exe%" }, + { TRUE, L"%plorer.exe" }, + { TRUE, L"%plorer.exe%" }, + { TRUE, L"__plorer.exe" }, + { TRUE, L"e_plorer.exe" }, + { FALSE, L"_plorer.exe" }, + { TRUE, L"%%%plorer.e%" }, + { TRUE, L"%plorer.e%" }, + { TRUE, L"%plorer.e_e" }, + { TRUE, L"%plorer.e_e" }, + { TRUE, L"explore%exe" }, + { FALSE, L"fancy_explore.exe" }, + { FALSE, L"fancy%xplore%exe" }, + { FALSE, L"%%%f%xplore%exe" }, + }; + + for (i = 0; i < ARRAYSIZE(queries); i++) + { + wsprintfW( query, L"SELECT * FROM Win32_Process WHERE Caption LIKE '%ls'", queries[i].str ); + trace("%s\n", wine_dbgstr_w(query)); + check_explorer_like_query( services, query, queries[i].expect_success ); + } +} + + static void test_associators( IWbemServices *services ) { static const WCHAR *test[] = @@ -2366,6 +2442,7 @@ START_TEST(query) test_query_async( services ); test_query_semisync( services ); test_select( services ); + test_like_query( services ); /* classes */ test_SoftwareLicensingProduct( services ); diff --git a/dlls/webservices/Makefile.in b/dlls/webservices/Makefile.in index 78b7e06af4b..8a613eb6414 100644 --- a/dlls/webservices/Makefile.in +++ b/dlls/webservices/Makefile.in @@ -2,6 +2,8 @@ MODULE = webservices.dll IMPORTLIB = webservices IMPORTS = winhttp rpcrt4 user32 ws2_32 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ channel.c \ error.c \ diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 5df30550cae..3f1e25ae9e2 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -463,7 +463,6 @@ static void update_visible_region( struct dce *dce ) HRGN vis_rgn = 0; HWND top_win = 0; DWORD flags = dce->flags; - DWORD paint_flags = 0; size_t size = 256; RECT win_rect, top_rect; WND *win; @@ -500,7 +499,6 @@ static void update_visible_region( struct dce *dce ) top_rect.top = reply->top_rect.top; top_rect.right = reply->top_rect.right; top_rect.bottom = reply->top_rect.bottom; - paint_flags = reply->paint_flags; } else size = reply->total_size; } @@ -515,16 +513,12 @@ static void update_visible_region( struct dce *dce ) if (dce->clip_rgn) NtGdiCombineRgn( vis_rgn, vis_rgn, dce->clip_rgn, (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF ); - /* don't use a surface to paint the client area of OpenGL windows */ - if (!(paint_flags & SET_WINPOS_PIXEL_FORMAT) || (flags & DCX_WINDOW)) + win = get_win_ptr( top_win ); + if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) { - win = get_win_ptr( top_win ); - if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) - { - surface = win->surface; - if (surface) window_surface_add_ref( surface ); - release_win_ptr( win ); - } + surface = win->surface; + if (surface) window_surface_add_ref( surface ); + release_win_ptr( win ); } if (!surface) SetRectEmpty( &top_rect ); @@ -1026,6 +1020,9 @@ HDC WINAPI NtUserGetDCEx( HWND hwnd, HRGN clip_rgn, DWORD flags ) */ INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc ) { + if (hwnd && !is_current_process_window( hwnd )) + user_driver->pProcessEvents( 0 ); + return release_dc( hwnd, hdc, FALSE ); } @@ -1214,7 +1211,7 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags ) if (style & WS_VSCROLL) set_standard_scroll_painted( hwnd, SB_VERT, FALSE ); - send_message( hwnd, WM_NCPAINT, (WPARAM)whole_rgn, 0 ); + send_notify_message( hwnd, WM_NCPAINT, (WPARAM)whole_rgn, 0, FALSE ); } if (whole_rgn > (HRGN)1) NtGdiDeleteObjectApp( whole_rgn ); } @@ -1251,7 +1248,10 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, { /* don't erase if the clip box is empty */ if (type != NULLREGION) - need_erase = !send_message( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0 ); + { + need_erase = !send_message_timeout( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0, SMTO_ABORTIFHUNG, 1000, FALSE ); + if (need_erase && RtlGetLastWin32Error() == ERROR_TIMEOUT) ERR( "timeout.\n" ); + } } if (!hdc_ret) release_dc( hwnd, hdc, TRUE ); } diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index cba5f02c02e..d68fd2b7f23 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -24,12 +24,15 @@ #pragma makedep unix #endif +#include #include "ntgdi_private.h" #include "ntuser_private.h" #include "wine/server.h" WINE_DEFAULT_DEBUG_CHANNEL(win); +#define WINE_MOUSE_HANDLE ((HANDLE)1) +#define WINE_KEYBOARD_HANDLE ((HANDLE)2) #define DRAG_FILE 0x454c4946 @@ -480,8 +483,16 @@ static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos ) if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0)) { MINMAXINFO info = get_min_max_info( hwnd ); - winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x ); - winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y ); + + /* HACK: This code changes the window's size to fit the display. However, + * some games (Bayonetta, Dragon's Dogma) will then have the incorrect + * render size. So just let windows be too big to fit the display. */ + if (__wine_get_window_manager() != WINE_WM_X11_STEAMCOMPMGR) + { + winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x ); + winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y ); + } + if (!(style & WS_MINIMIZE)) { winpos->cx = max( winpos->cx, info.ptMinTrackSize.x ); @@ -1855,6 +1866,16 @@ static void handle_nc_calc_size( HWND hwnd, WPARAM wparam, RECT *win_rect ) if (!win_rect) return; + if (__wine_get_window_manager() == WINE_WM_X11_STEAMCOMPMGR) + { + /* Disable gamescope undecorated windows hack for following games. They don't expect client + * rect equals to window rect when in windowed mode. */ + const char *sgi = getenv( "SteamGameId" ); + if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ + !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + return; + } + if (!(style & WS_MINIMIZE)) { AdjustWindowRectEx( &rect, style, FALSE, ex_style & ~WS_EX_CLIENTEDGE ); @@ -2384,6 +2405,14 @@ static LRESULT handle_nc_mouse_leave( HWND hwnd ) return 0; } +static struct touchinput_thread_data *touch_input_thread_data(void) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + struct touchinput_thread_data *data = thread_info->touchinput; + + if (!data) data = thread_info->touchinput = calloc( 1, sizeof(struct touchinput_thread_data) ); + return data; +} LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) { @@ -2942,6 +2971,68 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, 0, NtUserSendMessage, ansi ); } break; + + case WM_POINTERDOWN: + case WM_POINTERUP: + case WM_POINTERUPDATE: + { + TOUCHINPUT *touches, *end, *touch, *match = NULL; + struct touchinput_thread_data *thread_data; + UINT i; + + if (!NtUserIsTouchWindow( hwnd, NULL )) return 0; + if (!(thread_data = touch_input_thread_data())) return 0; + + touches = thread_data->current; + end = touches + ARRAY_SIZE(thread_data->current); + for (touch = touches; touch < end && touch->dwID; touch++) + { + if (touch->dwID == GET_POINTERID_WPARAM( wparam )) match = touch; + touch->dwFlags &= ~TOUCHEVENTF_DOWN; + touch->dwFlags |= TOUCHEVENTF_MOVE; + } + if (match) touch = match; + + if (touch == end || (msg != WM_POINTERDOWN && !touch->dwID)) + { + if (msg != WM_POINTERDOWN) FIXME("Touch point not found!\n"); + else FIXME("Unsupported number of touch points!\n"); + break; + } + + while (end > (touch + 1) && !(end - 1)->dwID) end--; + + touch->x = LOWORD( lparam ) * 100; + touch->y = HIWORD( lparam ) * 100; + touch->hSource = WINE_MOUSE_HANDLE; + touch->dwID = GET_POINTERID_WPARAM( wparam ); + touch->dwFlags = 0; + if (msg == WM_POINTERUP) touch->dwFlags |= TOUCHEVENTF_UP; + if (msg == WM_POINTERDOWN) touch->dwFlags |= TOUCHEVENTF_INRANGE | TOUCHEVENTF_DOWN; + if (msg == WM_POINTERUPDATE) touch->dwFlags |= TOUCHEVENTF_INRANGE | TOUCHEVENTF_MOVE; + if (IS_POINTER_PRIMARY_WPARAM( wparam )) touch->dwFlags |= TOUCHEVENTF_PRIMARY; + touch->dwMask = 0; + touch->dwTime = NtGetTickCount(); + touch->dwExtraInfo = 0; + touch->cxContact = 0; + touch->cyContact = 0; + + i = thread_data->index++ % ARRAY_SIZE(thread_data->history); + memcpy( thread_data->history + i, thread_data->current, sizeof(thread_data->current) ); + + send_message( hwnd, WM_TOUCH, MAKELONG(end - touches, 0), (LPARAM)i ); + + if (msg == WM_POINTERUP) + { + while (++touch < end) *(touch - 1) = *touch; + memset( touch - 1, 0, sizeof(*touch) ); + } + break; + } + + case WM_TOUCH: + /* FIXME: CloseTouchInputHandle( (HTOUCHINPUT)lparam ); */ + return 0; } return result; diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index af1a9b97f67..08060e0a9b7 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -55,6 +55,7 @@ struct font_physdev { struct gdi_physdev dev; struct gdi_font *font; + UINT aa_flags; }; static inline struct font_physdev *get_font_dev( PHYSDEV dev ) @@ -1556,6 +1557,14 @@ static const WCHAR ms_minchoW[] = {'M','S',' ','M','i','n','c','h','o',0}; static const WCHAR ms_p_minchoW[] = {'M','S',' ','P','M','i','n','c','h','o',0}; +static const WCHAR arialW[] = + {'A','r','i','a','l',0}; +static const WCHAR arial_boldW[] = + {'A','r','i','a','l',' ','B','o','l','d',0}; +static const WCHAR courier_newW[] = + {'C','o','u','r','i','e','r',' ','N','e','w',0}; +static const WCHAR courier_new_boldW[] = + {'C','o','u','r','i','e','r',' ','N','e','w',' ','B','o','l','d',0}; static const WCHAR * const font_links_list[] = { @@ -3098,6 +3107,10 @@ static void update_font_system_link_info(void) } set_multi_value_key(hkey, link_reg->font_name, link, len); } + set_multi_value_key(hkey, arialW, link, len); + set_multi_value_key(hkey, arial_boldW, link, len); + set_multi_value_key(hkey, courier_newW, link, len); + set_multi_value_key(hkey, courier_new_boldW, link, len); NtClose( hkey ); } } @@ -3136,7 +3149,13 @@ static void update_codepage( UINT screen_dpi ) if (query_reg_ascii_value( wine_fonts_key, "Codepages", info, sizeof(value_buffer) )) { cp_match = !wcscmp( (const WCHAR *)info->Data, cpbufW ); - if (cp_match && screen_dpi == font_dpi) return; /* already set correctly */ + if (cp_match && screen_dpi == font_dpi) + { + /* already set correctly, but, as a HACK, update font link + info anyway, so that old Proton prefixes are fixed */ + update_font_system_link_info(); + return; + } TRACE( "updating registry, codepages/logpixels changed %s/%u -> %u,%u/%u\n", debugstr_w((const WCHAR *)info->Data), font_dpi, ansi_cp.CodePage, oem_cp.CodePage, screen_dpi ); } @@ -3832,7 +3851,7 @@ static UINT get_glyph_index_linked( struct gdi_font **font, UINT glyph ) static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *gm_ret, ABC *abc_ret, DWORD buflen, void *buf, - const MAT2 *mat ) + const MAT2 *mat, UINT aa_flags ) { GLYPHMETRICS gm; ABC abc; @@ -3866,7 +3885,7 @@ static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, if (format == GGO_METRICS && !mat && get_gdi_font_glyph_metrics( font, index, &gm, &abc )) goto done; - ret = font_funcs->get_glyph_outline( font, index, format, &gm, &abc, buflen, buf, mat, tategaki ); + ret = font_funcs->get_glyph_outline( font, index, format, &gm, &abc, buflen, buf, mat, tategaki, aa_flags ); if (ret == GDI_ERROR) return ret; if (format == GGO_METRICS && !mat) @@ -3915,7 +3934,7 @@ static BOOL font_GetCharABCWidths( PHYSDEV dev, UINT first, UINT count, WCHAR *c for (i = 0; i < count; i++) { c = chars ? chars[i] : first + i; - get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &buffer[i], 0, NULL, NULL ); + get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &buffer[i], 0, NULL, NULL, physdev->aa_flags ); } pthread_mutex_unlock( &font_lock ); return TRUE; @@ -3941,7 +3960,7 @@ static BOOL font_GetCharABCWidthsI( PHYSDEV dev, UINT first, UINT count, WORD *g pthread_mutex_lock( &font_lock ); for (c = 0; c < count; c++, buffer++) get_glyph_outline( physdev->font, gi ? gi[c] : first + c, GGO_METRICS | GGO_GLYPH_INDEX, - NULL, buffer, 0, NULL, NULL ); + NULL, buffer, 0, NULL, NULL, physdev->aa_flags ); pthread_mutex_unlock( &font_lock ); return TRUE; } @@ -3968,7 +3987,7 @@ static BOOL font_GetCharWidth( PHYSDEV dev, UINT first, UINT count, const WCHAR for (i = 0; i < count; i++) { c = chars ? chars[i] : i + first; - if (get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &abc, 0, NULL, NULL ) == GDI_ERROR) + if (get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &abc, 0, NULL, NULL, physdev->aa_flags ) == GDI_ERROR) buffer[i] = 0; else buffer[i] = abc.abcA + abc.abcB + abc.abcC; @@ -4147,7 +4166,7 @@ static DWORD font_GetGlyphOutline( PHYSDEV dev, UINT glyph, UINT format, return dev->funcs->pGetGlyphOutline( dev, glyph, format, gm, buflen, buf, mat ); } pthread_mutex_lock( &font_lock ); - ret = get_glyph_outline( physdev->font, glyph, format, gm, NULL, buflen, buf, mat ); + ret = get_glyph_outline( physdev->font, glyph, format, gm, NULL, buflen, buf, mat, physdev->aa_flags ); pthread_mutex_unlock( &font_lock ); return ret; } @@ -4327,7 +4346,7 @@ static BOOL font_GetTextExtentExPoint( PHYSDEV dev, const WCHAR *str, INT count, pthread_mutex_lock( &font_lock ); for (i = pos = 0; i < count; i++) { - get_glyph_outline( physdev->font, str[i], GGO_METRICS, NULL, &abc, 0, NULL, NULL ); + get_glyph_outline( physdev->font, str[i], GGO_METRICS, NULL, &abc, 0, NULL, NULL, physdev->aa_flags ); pos += abc.abcA + abc.abcB + abc.abcC; dxs[i] = pos; } @@ -4357,7 +4376,7 @@ static BOOL font_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, INT co for (i = pos = 0; i < count; i++) { get_glyph_outline( physdev->font, indices[i], GGO_METRICS | GGO_GLYPH_INDEX, - NULL, &abc, 0, NULL, NULL ); + NULL, &abc, 0, NULL, NULL, physdev->aa_flags ); pos += abc.abcA + abc.abcB + abc.abcC; dxs[i] = pos; } @@ -4671,6 +4690,7 @@ static HFONT font_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) *aa_flags = font_smoothing; } *aa_flags = font_funcs->get_aa_flags( font, *aa_flags, antialias_fakes ); + physdev->aa_flags = *aa_flags; } TRACE( "%p %s %d aa %x\n", hfont, debugstr_w(lf.lfFaceName), (int)lf.lfHeight, *aa_flags ); pthread_mutex_unlock( &font_lock ); diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 701e15c110d..880b1f8603b 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -256,6 +256,8 @@ MAKE_FUNCPTR(FcStrSetMember); #define GET_BE_DWORD(x) RtlUlongByteSwap(x) #endif +#define MS_EBDT_TAG MS_MAKE_TAG('E','B','D','T') + /* 'gasp' flags */ #define GASP_GRIDFIT 0x01 #define GASP_DOGRAY 0x02 @@ -1179,6 +1181,8 @@ static struct unix_face *unix_face_create( const char *unix_name, void *data_ptr struct stat st; DWORD face_count; int fd, length; + FT_Error error; + FT_ULong len; TRACE( "unix_name %s, face_index %u, data_ptr %p, data_size %u, flags %#x\n", unix_name, face_index, data_ptr, data_size, flags ); @@ -1270,7 +1274,20 @@ static struct unix_face *unix_face_create( const char *unix_name, void *data_ptr This->ntm_flags = get_ntm_flags( This->ft_face ); This->font_version = get_font_version( This->ft_face ); - if (!This->scalable) get_bitmap_size( This->ft_face, &This->size ); + if (!This->scalable) + { + error = pFT_Load_Sfnt_Table( This->ft_face, RtlUlongByteSwap(MS_EBDT_TAG), 0, NULL, &len ); + if (error == FT_Err_Table_Missing) + { + WARN( "EBDT table is missing in bitmap only font %s.\n", + debugstr_w(ft_face_get_family_name( This->ft_face, system_lcid ))); + pFT_Done_Face( This->ft_face ); + free( This ); + This = NULL; + goto done; + } + get_bitmap_size( This->ft_face, &This->size ); + } get_fontsig( This->ft_face, &This->fs ); } else @@ -3403,10 +3420,13 @@ static unsigned int get_bezier_glyph_outline(FT_Outline *outline, unsigned int b return needed; } -static FT_Int get_load_flags( UINT format ) +static FT_Int get_load_flags( UINT format, BOOL vertical_metrics, BOOL force_no_bitmap ) { FT_Int load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; + if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT; + if (force_no_bitmap || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; + if (format & GGO_UNHINTED) return load_flags | FT_LOAD_NO_HINTING; @@ -3439,16 +3459,17 @@ static FT_Int get_load_flags( UINT format ) */ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *lpgm, ABC *abc, UINT buflen, void *buf, - const MAT2 *lpmat, BOOL tategaki ) + const MAT2 *lpmat, BOOL tategaki, UINT aa_flags ) { struct gdi_font *base_font = font->base_font ? font->base_font : font; FT_Face ft_face = get_ft_face( font ); FT_Glyph_Metrics metrics; FT_Error err; FT_BBox bbox; - FT_Int load_flags = get_load_flags(format); + FT_Int load_flags; FT_Matrix transform_matrices[3], *matrices = NULL; BOOL vertical_metrics; + UINT effective_format = format; TRACE("%p, %04x, %08x, %p, %08x, %p, %p\n", font, glyph, format, lpgm, buflen, buf, lpmat); @@ -3456,20 +3477,24 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT font->matrix.eM11, font->matrix.eM12, font->matrix.eM21, font->matrix.eM22); - format &= ~GGO_UNHINTED; - matrices = get_transform_matrices( font, tategaki, lpmat, transform_matrices ); + if (aa_flags && (format & ~GGO_GLYPH_INDEX) == GGO_METRICS) + effective_format = aa_flags | (format & GGO_GLYPH_INDEX); vertical_metrics = (tategaki && FT_HAS_VERTICAL(ft_face)); /* there is a freetype bug where vertical metrics are only properly scaled and correct in 2.4.0 or greater */ if (vertical_metrics && FT_SimpleVersion < FT_VERSION_VALUE(2, 4, 0)) vertical_metrics = FALSE; - - if (matrices || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; - if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT; + load_flags = get_load_flags(effective_format, vertical_metrics, !!matrices); err = pFT_Load_Glyph(ft_face, glyph, load_flags); + if (err && format != effective_format) + { + WARN("Failed to load glyph %#x, retrying with GGO_METRICS. Error %#x.\n", glyph, err); + load_flags = get_load_flags(effective_format, vertical_metrics, !!matrices); + err = pFT_Load_Glyph(ft_face, glyph, load_flags); + } if (err && !(load_flags & FT_LOAD_NO_HINTING)) { WARN("Failed to load glyph %#x, retrying without hinting. Error %#x.\n", glyph, err); @@ -3482,6 +3507,8 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT return GDI_ERROR; } + format &= ~GGO_UNHINTED; + metrics = ft_face->glyph->metrics; if(font->fake_bold) { if (!get_bold_glyph_outline(ft_face->glyph, font->ppem, &metrics) && metrics.width) diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 378eda40abb..2dadf485c0f 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -60,12 +60,31 @@ static const char *debugstr_hook_id( unsigned int id ) return hook_names[id - WH_MINHOOK]; } -BOOL is_hooked( INT id ) +/*********************************************************************** + * get_active_hooks + * + */ +static UINT get_active_hooks(void) { struct user_thread_info *thread_info = get_user_thread_info(); - if (!thread_info->active_hooks) return TRUE; - return (thread_info->active_hooks & (1 << (id - WH_MINHOOK))) != 0; + if (!thread_info->active_hooks) + { + SERVER_START_REQ( get_active_hooks ) + { + if (!wine_server_call( req )) thread_info->active_hooks = reply->active_hooks; + } + SERVER_END_REQ; + } + + return thread_info->active_hooks; +} + +BOOL is_hooked( INT id ) +{ + UINT active_hooks = get_active_hooks(); + if (!active_hooks) return TRUE; + return (active_hooks & (1 << (id - WH_MINHOOK))) != 0; } /*********************************************************************** @@ -204,6 +223,7 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz size_t message_size, BOOL ansi ) { DWORD_PTR ret = 0; + LRESULT lres = 0; if (info->tid) { @@ -218,20 +238,26 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz switch(info->id) { case WH_KEYBOARD_LL: - send_internal_message_timeout( info->pid, info->tid, WM_WINE_KEYBOARD_LL_HOOK, - info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, - get_ll_hook_timeout(), &ret ); + lres = send_internal_message_timeout( info->pid, info->tid, WM_WINE_KEYBOARD_LL_HOOK, + info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, + get_ll_hook_timeout(), &ret ); break; case WH_MOUSE_LL: - send_internal_message_timeout( info->pid, info->tid, WM_WINE_MOUSE_LL_HOOK, - info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, - get_ll_hook_timeout(), &ret ); + lres = send_internal_message_timeout( info->pid, info->tid, WM_WINE_MOUSE_LL_HOOK, + info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, + get_ll_hook_timeout(), &ret ); break; default: ERR("Unknown hook id %d\n", info->id); assert(0); break; } + + if (!lres && RtlGetLastWin32Error() == ERROR_TIMEOUT) + { + TRACE( "Hook %p timed out; removing it.\n", info->handle ); + NtUserUnhookWindowsHookEx( info->handle ); + } } else if (info->proc) { @@ -340,8 +366,6 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz if (params != info) free( params ); } - if (info->id == WH_KEYBOARD_LL || info->id == WH_MOUSE_LL) - InterlockedIncrement( &global_key_state_counter ); /* force refreshing the key state cache */ return ret; } @@ -427,7 +451,7 @@ LRESULT call_message_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size if (!is_hooked( id )) { - TRACE( "skipping hook %s mask %x\n", hook_names[id-WH_MINHOOK], thread_info->active_hooks ); + TRACE( "skipping hook %s mask %x\n", hook_names[id-WH_MINHOOK], get_active_hooks() ); return 0; } @@ -566,7 +590,7 @@ void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG c if (!is_hooked( WH_WINEVENT )) { - TRACE( "skipping hook mask %x\n", thread_info->active_hooks ); + TRACE( "skipping hook mask %x\n", get_active_hooks() ); return; } diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 3ee46f0bfcf..9acdeb40388 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -406,7 +406,6 @@ static const KBDTABLES kbdus_tables = static LONG clipping_cursor; /* clipping thread counter */ -LONG global_key_state_counter = 0; BOOL grab_pointer = TRUE; BOOL grab_fullscreen = FALSE; @@ -546,19 +545,24 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const #undef NEXT_ENTRY +BOOL enable_mouse_in_pointer = FALSE; + /******************************************************************* * NtUserGetForegroundWindow (win32u.@) */ HWND WINAPI NtUserGetForegroundWindow(void) { + const input_shm_t *shared = get_foreground_shared_memory(); HWND ret = 0; - SERVER_START_REQ( get_thread_input ) + if (!shared) return 0; + + SHARED_READ_BEGIN( shared, input_shm_t ) { - req->tid = 0; - if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->foreground ); + ret = wine_server_ptr_handle( shared->active ); } - SERVER_END_REQ; + SHARED_READ_END + return ret; } @@ -664,6 +668,7 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size ) { UINT i; NTSTATUS status = STATUS_SUCCESS; + RAWINPUT rawinput; if (size != sizeof(INPUT)) { @@ -693,7 +698,7 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size ) update_mouse_coords( &input ); /* fallthrough */ case INPUT_KEYBOARD: - status = send_hardware_message( 0, &input, NULL, SEND_HWMSG_INJECTED ); + status = send_hardware_message( 0, &input, &rawinput, SEND_HWMSG_INJECTED ); break; case INPUT_HARDWARE: RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); @@ -749,25 +754,23 @@ BOOL WINAPI NtUserSetCursorPos( INT x, INT y ) */ BOOL get_cursor_pos( POINT *pt ) { - BOOL ret; + const desktop_shm_t *shared = get_desktop_shared_memory(); DWORD last_change; + BOOL ret = TRUE; UINT dpi; - if (!pt) return FALSE; + if (!pt || !shared) return FALSE; - SERVER_START_REQ( set_cursor ) + SHARED_READ_BEGIN( shared, desktop_shm_t ) { - if ((ret = !wine_server_call( req ))) - { - pt->x = reply->new_x; - pt->y = reply->new_y; - last_change = reply->last_change; - } + pt->x = shared->cursor.x; + pt->y = shared->cursor.y; + last_change = shared->cursor.last_change; } - SERVER_END_REQ; + SHARED_READ_END /* query new position from graphics driver if we haven't updated recently */ - if (ret && NtGetTickCount() - last_change > 100) ret = user_driver->pGetCursorPos( pt ); + if (NtGetTickCount() - last_change > 100) ret = user_driver->pGetCursorPos( pt ); if (ret && (dpi = get_thread_dpi())) { HMONITOR monitor = monitor_from_point( *pt, MONITOR_DEFAULTTOPRIMARY, 0 ); @@ -781,20 +784,19 @@ BOOL get_cursor_pos( POINT *pt ) */ BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info ) { + const input_shm_t *shared = get_foreground_shared_memory(); BOOL ret; if (!info) return FALSE; - SERVER_START_REQ( get_thread_input ) + if (!shared) ret = FALSE; + else SHARED_READ_BEGIN( shared, input_shm_t ) { - req->tid = 0; - if ((ret = !wine_server_call( req ))) - { - info->hCursor = wine_server_ptr_handle( reply->cursor ); - info->flags = reply->show_count >= 0 ? CURSOR_SHOWING : 0; - } + info->hCursor = wine_server_ptr_handle( shared->cursor ); + info->flags = (shared->cursor_count >= 0) ? CURSOR_SHOWING : 0; + ret = TRUE; } - SERVER_END_REQ; + SHARED_READ_END get_cursor_pos( &info->ptScreenPos ); return ret; } @@ -810,57 +812,20 @@ static void check_for_events( UINT flags ) */ SHORT WINAPI NtUserGetAsyncKeyState( INT key ) { - struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; - INT counter = global_key_state_counter; - BYTE prev_key_state; - SHORT ret; + const desktop_shm_t *shared = get_desktop_shared_memory(); + BYTE state; - if (key < 0 || key >= 256) return 0; + if (key < 0 || key >= 256 || !shared) return 0; check_for_events( QS_INPUT ); - if (key_state_info && !(key_state_info->state[key] & 0xc0) && - key_state_info->counter == counter && NtGetTickCount() - key_state_info->time < 50) + SHARED_READ_BEGIN( shared, desktop_shm_t ) { - /* use cached value */ - return 0; - } - else if (!key_state_info) - { - key_state_info = calloc( 1, sizeof(*key_state_info) ); - get_user_thread_info()->key_state = key_state_info; + state = shared->keystate[key]; } + SHARED_READ_END - ret = 0; - SERVER_START_REQ( get_key_state ) - { - req->async = 1; - req->key = key; - if (key_state_info) - { - prev_key_state = key_state_info->state[key]; - wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) ); - } - if (!wine_server_call( req )) - { - if (reply->state & 0x40) ret |= 0x0001; - if (reply->state & 0x80) ret |= 0x8000; - if (key_state_info) - { - /* force refreshing the key state cache - some multithreaded programs - * (like Adobe Photoshop CS5) expect that changes to the async key state - * are also immediately available in other threads. */ - if (prev_key_state != key_state_info->state[key]) - counter = InterlockedIncrement( &global_key_state_counter ); - - key_state_info->time = NtGetTickCount(); - key_state_info->counter = counter; - } - } - } - SERVER_END_REQ; - - return ret; + return (state & 0x80) << 8; } /*********************************************************************** @@ -927,18 +892,23 @@ static HKL get_locale_kbd_layout(void) */ NtQueryDefaultLocale( TRUE, &layout ); + layout = MAKELONG( layout, layout ); /* * Microsoft Office expects this value to be something specific * for Japanese and Korean Windows with an IME the value is 0xe001 * We should probably check to see if an IME exists and if so then * set this word properly. + * + * On Vista+, the high word is always layout, not 0xe00* even when IME is on. + * Super Robo Wars 30 (SteamID: 898750) depends on it. */ - langid = PRIMARYLANGID( LANGIDFROMLCID( layout ) ); - if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) - layout = MAKELONG( layout, 0xe001 ); /* IME */ - else - layout = MAKELONG( layout, layout ); + if (NtCurrentTeb()->Peb->OSMajorVersion <= 5) + { + langid = PRIMARYLANGID( LANGIDFROMLCID( layout ) ); + if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) + layout = MAKELONG( layout, 0xe001 ); /* IME */ + } return ULongToHandle( layout ); } @@ -970,9 +940,32 @@ HKL WINAPI NtUserGetKeyboardLayout( DWORD thread_id ) */ SHORT WINAPI NtUserGetKeyState( INT vkey ) { + const input_shm_t *shared = get_input_shared_memory(); + const desktop_shm_t *desktop_shared; SHORT retval = 0; + BOOL skip = TRUE; - SERVER_START_REQ( get_key_state ) + if (!shared) skip = FALSE; + else SHARED_READ_BEGIN( shared, input_shm_t ) + { + if (!shared->created) skip = FALSE; /* server needs to create the queue */ + else if (!shared->keystate_lock) + { + desktop_shared = get_desktop_shared_memory(); + if (!desktop_shared) skip = FALSE; + else SHARED_READ_BEGIN( desktop_shared, desktop_shm_t ) + { + if (shared->sync_serial != desktop_shared->update_serial) + skip = FALSE; /* server needs to call sync_input_keystate */ + } + SHARED_READ_END + } + if (skip) + retval = (signed char)(shared->keystate[vkey & 0xff] & 0x81); + } + SHARED_READ_END + + if (!skip) SERVER_START_REQ( get_key_state ) { req->key = vkey; if (!wine_server_call( req )) retval = (signed char)(reply->state & 0x81); @@ -987,11 +980,26 @@ SHORT WINAPI NtUserGetKeyState( INT vkey ) */ BOOL WINAPI NtUserGetKeyboardState( BYTE *state ) { - BOOL ret; + const input_shm_t *shared = get_input_shared_memory(); + BOOL ret, skip = TRUE; UINT i; TRACE("(%p)\n", state); + if (!shared) skip = FALSE; + else SHARED_READ_BEGIN( shared, input_shm_t ) + { + if (!shared->created) skip = FALSE; /* server needs to create the queue */ + else memcpy( state, (const void *)shared->keystate, 256 ); + } + SHARED_READ_END + + if (skip) + { + for (i = 0; i < 256; i++) state[i] &= 0x81; + return TRUE; + } + memset( state, 0, 256 ); SERVER_START_REQ( get_key_state ) { @@ -1795,10 +1803,13 @@ HWND WINAPI NtUserSetCapture( HWND hwnd ) */ BOOL release_capture(void) { - BOOL ret = set_capture_window( 0, 0, NULL ); + HWND previous = NULL; + BOOL ret; + + ret = set_capture_window( 0, 0, &previous ); /* Somebody may have missed some mouse movements */ - if (ret) + if (ret && previous) { INPUT input = { .type = INPUT_MOUSE }; input.mi.dwFlags = MOUSEEVENTF_MOVE; @@ -1813,7 +1824,7 @@ BOOL release_capture(void) * * Change the focus window, sending the WM_SETFOCUS and WM_KILLFOCUS messages */ -static HWND set_focus_window( HWND hwnd ) +static HWND set_focus_window( HWND hwnd, BOOL from_active, BOOL force ) { HWND previous = 0, ime_hwnd; BOOL ret; @@ -1827,9 +1838,13 @@ static HWND set_focus_window( HWND hwnd ) SERVER_END_REQ; if (!ret) return 0; if (previous == hwnd) return previous; + if (!force && hwnd == previous) return previous; if (previous) { + if (!NtUserIsWindow(hwnd) && !from_active) + NtUserNotifyWinEvent( EVENT_OBJECT_FOCUS, previous, OBJID_CLIENT, CHILDID_SELF ); + send_message( previous, WM_KILLFOCUS, (WPARAM)hwnd, 0 ); ime_hwnd = get_default_ime_window( previous ); @@ -1842,6 +1857,8 @@ static HWND set_focus_window( HWND hwnd ) if (is_window(hwnd)) { user_driver->pSetFocus(hwnd); + if (!from_active) + NtUserNotifyWinEvent( EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, CHILDID_SELF ); ime_hwnd = get_default_ime_window( hwnd ); if (ime_hwnd) @@ -1862,7 +1879,7 @@ static HWND set_focus_window( HWND hwnd ) static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) { HWND previous = get_active_window(); - BOOL ret; + BOOL ret = FALSE; DWORD old_thread, new_thread; CBTACTIVATESTRUCT cbt; @@ -1872,6 +1889,9 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) goto done; } + if (prev) *prev = previous; + if (win_set_flags( hwnd, WIN_IS_ACTIVATING, 0 ) & WIN_IS_ACTIVATING) return TRUE; + /* call CBT hook chain */ cbt.fMouse = mouse; cbt.hWndActive = previous; @@ -1887,11 +1907,12 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) SERVER_START_REQ( set_active_window ) { req->handle = wine_server_user_handle( hwnd ); + req->internal_msg = WM_WINE_SETACTIVEWINDOW; if ((ret = !wine_server_call_err( req ))) previous = wine_server_ptr_handle( reply->previous ); } SERVER_END_REQ; - if (!ret) return FALSE; + if (!ret) goto done; if (prev) *prev = previous; if (previous == hwnd) goto done; @@ -1901,7 +1922,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 )) send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0, SMTO_ABORTIFHUNG, 2000, FALSE ); - if (!is_window(hwnd)) return FALSE; + if (!(ret = is_window(hwnd))) goto done; } old_thread = previous ? get_window_thread( previous, NULL ) : 0; @@ -1935,7 +1956,9 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) if (is_window(hwnd)) { - send_message( hwnd, WM_NCACTIVATE, hwnd == NtUserGetForegroundWindow(), (LPARAM)previous ); + send_message( hwnd, WM_NCACTIVATE, + (hwnd == NtUserGetForegroundWindow()) && !(win_get_flags(previous) & WIN_IS_ACTIVATING), + (LPARAM)previous ); send_message( hwnd, WM_ACTIVATE, MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, is_iconic(hwnd) ), (LPARAM)previous ); @@ -1954,13 +1977,14 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) if (hwnd == info.hwndActive) { if (!info.hwndFocus || !hwnd || NtUserGetAncestor( info.hwndFocus, GA_ROOT ) != hwnd) - set_focus_window( hwnd ); + set_focus_window( hwnd, TRUE, FALSE ); } } done: + win_set_flags( hwnd, 0, WIN_IS_ACTIVATING ); if (hwnd) clip_fullscreen_window( hwnd, FALSE ); - return TRUE; + return ret; } /********************************************************************** @@ -2048,7 +2072,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) } /* change focus and send messages */ - return set_focus_window( hwnd ); + return set_focus_window( hwnd, FALSE, hwnd != previous ); } /******************************************************************* @@ -2076,14 +2100,16 @@ BOOL set_foreground_window( HWND hwnd, BOOL mouse ) if (ret && previous != hwnd) { if (send_msg_old) /* old window belongs to other thread */ - NtUserMessageCall( previous, WM_WINE_SETACTIVEWINDOW, 0, 0, - 0, NtUserSendNotifyMessage, FALSE ); + NtUserPostMessage( previous, WM_WINE_SETACTIVEWINDOW, 0, 0 ); else if (send_msg_new) /* old window belongs to us but new one to other thread */ ret = set_active_window( 0, NULL, mouse, TRUE ); + /* already active, set_active_window will do no nothing */ + if (!send_msg_new && hwnd == get_active_window()) + send_message( hwnd, WM_NCACTIVATE, TRUE, (LPARAM)hwnd ); + if (send_msg_new) /* new window belongs to other thread */ - NtUserMessageCall( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0, - 0, NtUserSendNotifyMessage, FALSE ); + NtUserPostMessage( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0 ); else /* new window belongs to us */ ret = set_active_window( hwnd, NULL, mouse, TRUE ); } @@ -2469,9 +2495,9 @@ void toggle_caret( HWND hwnd ) */ BOOL WINAPI NtUserEnableMouseInPointer( BOOL enable ) { - FIXME( "enable %u stub!\n", enable ); - RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + FIXME( "enable %u semi-stub!\n", enable ); + enable_mouse_in_pointer = TRUE; + return TRUE; } /********************************************************************** @@ -2517,7 +2543,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) if (!NtUserGetWindowRect( hwnd, &rect )) return FALSE; if (!NtUserIsWindowRectFullScreen( &rect )) return FALSE; if (is_captured_by_system()) return FALSE; - if (NtGetTickCount() - thread_info->clipping_reset < 1000) return FALSE; + if (!reset && NtGetTickCount() - thread_info->clipping_reset < 1000) return FALSE; if (!reset && clipping_cursor && thread_info->clipping_cursor) return FALSE; /* already clipping */ if (!(monitor = NtUserMonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST ))) return FALSE; @@ -2545,6 +2571,32 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) return ret; } +/********************************************************************** + * NtUserIsTouchWindow (win32u.@) + */ +BOOL WINAPI NtUserIsTouchWindow( HWND hwnd, ULONG *flags ) +{ + DWORD win_flags = win_set_flags( hwnd, 0, 0 ); + TRACE( "hwnd %p, flags %p.\n", hwnd, flags ); + return (win_flags & WIN_IS_TOUCH) != 0; +} + + +BOOL register_touch_window( HWND hwnd, UINT flags ) +{ + DWORD win_flags = win_set_flags( hwnd, WIN_IS_TOUCH, 0 ); + TRACE( "hwnd %p, flags %#x.\n", hwnd, flags ); + return (win_flags & WIN_IS_TOUCH) == 0; +} + + +BOOL unregister_touch_window( HWND hwnd ) +{ + DWORD win_flags = win_set_flags( hwnd, 0, WIN_IS_TOUCH ); + TRACE( "hwnd %p.\n", hwnd ); + return (win_flags & WIN_IS_TOUCH) != 0; +} + /********************************************************************** * NtUserGetPointerInfoList (win32u.@) */ @@ -2589,11 +2641,11 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) { struct user_thread_info *thread_info = get_user_thread_info(); RECT rect, virtual_rect = NtUserGetVirtualScreenRect(); - BOOL was_clipping, empty = !!(flags & SET_CURSOR_NOCLIP); + BOOL empty = !!(flags & SET_CURSOR_NOCLIP); TRACE( "hwnd %p, flags %#x, reset %u\n", hwnd, flags, reset ); - if ((was_clipping = thread_info->clipping_cursor)) InterlockedDecrement( &clipping_cursor ); + if (thread_info->clipping_cursor) InterlockedDecrement( &clipping_cursor ); thread_info->clipping_cursor = FALSE; if (reset) @@ -2611,7 +2663,7 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) if (empty && !(flags & SET_CURSOR_FSCLIP)) { /* if currently clipping, check if we should switch to fullscreen clipping */ - if (was_clipping && clip_fullscreen_window( hwnd, TRUE )) return TRUE; + if (clip_fullscreen_window( hwnd, TRUE )) return TRUE; return user_driver->pClipCursor( NULL, FALSE ); } @@ -2626,12 +2678,20 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) */ BOOL WINAPI NtUserClipCursor( const RECT *rect ) { + static int keep_inside_window = -1; + HWND foreground = NtUserGetForegroundWindow(); UINT dpi; BOOL ret; - RECT new_rect; + RECT new_rect, full_rect; TRACE( "Clipping to %s\n", wine_dbgstr_rect(rect) ); + if (foreground == NtUserGetDesktopWindow()) + { + WARN( "desktop is foreground, ignoring ClipCursor\n" ); + rect = NULL; + } + if (rect) { if (rect->left > rect->right || rect->top > rect->bottom) return FALSE; @@ -2641,6 +2701,22 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect ) new_rect = map_dpi_rect( *rect, dpi, get_monitor_dpi( monitor )); rect = &new_rect; } + + if (keep_inside_window == -1) + { + const char *sgi = getenv( "SteamGameId" ); + keep_inside_window = sgi && !strcmp( sgi, "730830" ); /* Escape from Monkey Island */ + } + + /* keep the mouse clipped inside of a fullscreen foreground window */ + if (keep_inside_window && NtUserGetWindowRect( foreground, &full_rect ) && is_window_rect_full_screen( &full_rect )) + { + full_rect.left = max( full_rect.left, min( full_rect.right - 1, rect->left ) ); + full_rect.right = max( full_rect.left, min( full_rect.right - 1, rect->right ) ); + full_rect.top = max( full_rect.top, min( full_rect.bottom - 1, rect->top ) ); + full_rect.bottom = max( full_rect.top, min( full_rect.bottom - 1, rect->bottom ) ); + rect = &full_rect; + } } SERVER_START_REQ( set_cursor ) @@ -2661,3 +2737,25 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect ) return ret; } + +/***************************************************************************** + * NtUserGetTouchInputInfo (WIN32U.@) + */ +BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + struct touchinput_thread_data *thread_data; + UINT index = (ULONG_PTR)handle; + + TRACE( "handle %p, count %u, ptr %p, size %u.\n", handle, count, ptr, size ); + + if (!thread_info || !(thread_data = thread_info->touchinput) || size != sizeof(TOUCHINPUT) || + index >= ARRAY_SIZE(thread_data->history)) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + memcpy( ptr, thread_data->history + index, min( count, ARRAY_SIZE(thread_data->current) ) * size ); + return TRUE; +} diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 2dc66e5df11..ea3578407a1 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1559,6 +1559,11 @@ BOOL SYSCALL_API NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ) __ASM_SYSCALL_FUNC( __id_NtUserGetTitleBarInfo ); } +BOOL SYSCALL_API NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) +{ + __ASM_SYSCALL_FUNC( __id_NtUserGetTouchInputInfo ); +} + BOOL SYSCALL_API NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase ) { __ASM_SYSCALL_FUNC( __id_NtUserGetUpdateRect ); @@ -1636,6 +1641,11 @@ BOOL SYSCALL_API NtUserIsMouseInPointerEnabled(void) __ASM_SYSCALL_FUNC( __id_NtUserIsMouseInPointerEnabled ); } +BOOL SYSCALL_API NtUserIsTouchWindow( HWND hwnd, ULONG *flags ) +{ + __ASM_SYSCALL_FUNC( __id_NtUserIsTouchWindow ); +} + BOOL SYSCALL_API NtUserKillTimer( HWND hwnd, UINT_PTR id ) { __ASM_SYSCALL_FUNC( __id_NtUserKillTimer ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 91f836a60bd..c0b009d8eb4 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -471,7 +471,7 @@ static inline void push_string( struct packed_message *data, LPCWSTR str ) /* make sure that there is space for 'size' bytes in buffer, growing it if needed */ static inline void *get_buffer_space( void **buffer, size_t size, size_t prev_size ) { - if (prev_size < size) *buffer = malloc( size ); + if (prev_size < size) *buffer = realloc( *buffer, size ); return *buffer; } @@ -522,7 +522,7 @@ BOOL set_keyboard_auto_repeat( BOOL enable ) * Unpack a message received from another process. */ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, - void **buffer, size_t size ) + void **buffer, size_t size, size_t buffer_size ) { size_t minsize = 0; union packed_structs *ps = *buffer; @@ -585,7 +585,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa break; case WM_GETTEXT: case WM_ASKCBFORMATNAME: - if (!get_buffer_space( buffer, (*wparam * sizeof(WCHAR)), size )) return FALSE; + if (!get_buffer_space( buffer, (*wparam * sizeof(WCHAR)), buffer_size )) return FALSE; break; case WM_WININICHANGE: if (!*lparam) return TRUE; @@ -726,17 +726,19 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa minsize = sizeof(SCROLLINFO); break; case SBM_GETSCROLLINFO: - if (!get_buffer_space( buffer, sizeof(SCROLLINFO), size )) return FALSE; + case WM_WINE_GETSCROLLINFO: + if (!get_buffer_space( buffer, sizeof(SCROLLINFO), buffer_size )) return FALSE; break; case SBM_GETSCROLLBARINFO: - if (!get_buffer_space( buffer, sizeof(SCROLLBARINFO), size )) return FALSE; + case WM_WINE_GETSCROLLBARINFO: + if (!get_buffer_space( buffer, sizeof(SCROLLBARINFO), buffer_size )) return FALSE; break; case EM_GETSEL: case SBM_GETRANGE: case CB_GETEDITSEL: if (*wparam || *lparam) { - if (!get_buffer_space( buffer, 2 * sizeof(DWORD), size )) return FALSE; + if (!get_buffer_space( buffer, 2 * sizeof(DWORD), buffer_size )) return FALSE; if (*wparam) *wparam = (WPARAM)*buffer; if (*lparam) *lparam = (LPARAM)((DWORD *)*buffer + 1); } @@ -744,7 +746,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa case EM_GETRECT: case LB_GETITEMRECT: case CB_GETDROPPEDCONTROLRECT: - if (!get_buffer_space( buffer, sizeof(RECT), size )) return FALSE; + if (!get_buffer_space( buffer, sizeof(RECT), buffer_size )) return FALSE; break; case EM_SETRECT: case EM_SETRECTNP: @@ -755,7 +757,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa WORD *len_ptr, len; if (size < sizeof(WORD)) return FALSE; len = *(WORD *)*buffer; - if (!get_buffer_space( buffer, (len + 1) * sizeof(WCHAR), size )) return FALSE; + if (!get_buffer_space( buffer, (len + 1) * sizeof(WCHAR), buffer_size )) return FALSE; len_ptr = *buffer; len_ptr[0] = len_ptr[1] = len; *lparam = (LPARAM)(len_ptr + 1); @@ -780,26 +782,24 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa break; case CB_GETLBTEXT: { - size_t prev_size = size; if (combobox_has_strings( hwnd )) size = (send_message( hwnd, CB_GETLBTEXTLEN, *wparam, 0 ) + 1) * sizeof(WCHAR); else size = sizeof(ULONG_PTR); - if (!get_buffer_space( buffer, size, prev_size )) return FALSE; + if (!get_buffer_space( buffer, size, buffer_size )) return FALSE; break; } case LB_GETTEXT: { - size_t prev_size = size; if (listbox_has_strings( hwnd )) size = (send_message( hwnd, LB_GETTEXTLEN, *wparam, 0 ) + 1) * sizeof(WCHAR); else size = sizeof(ULONG_PTR); - if (!get_buffer_space( buffer, size, prev_size )) return FALSE; + if (!get_buffer_space( buffer, size, buffer_size )) return FALSE; break; } case LB_GETSELITEMS: - if (!get_buffer_space( buffer, *wparam * sizeof(UINT), size )) return FALSE; + if (!get_buffer_space( buffer, *wparam * sizeof(UINT), buffer_size )) return FALSE; break; case WM_NEXTMENU: { @@ -814,7 +814,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa case WM_SIZING: case WM_MOVING: minsize = sizeof(RECT); - if (!get_buffer_space( buffer, sizeof(RECT), size )) return FALSE; + if (!get_buffer_space( buffer, sizeof(RECT), buffer_size )) return FALSE; break; case WM_MDICREATE: { @@ -880,7 +880,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa } case WM_MDIGETACTIVE: if (!*lparam) return TRUE; - if (!get_buffer_space( buffer, sizeof(BOOL), size )) return FALSE; + if (!get_buffer_space( buffer, sizeof(BOOL), buffer_size )) return FALSE; break; case WM_DEVICECHANGE: if (!(*wparam & 0x8000)) return TRUE; @@ -1126,9 +1126,11 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); return 0; case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); return sizeof(SCROLLINFO); case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: { const SCROLLBARINFO *info = (const SCROLLBARINFO *)lparam; size_t size = min( info->cbSize, sizeof(SCROLLBARINFO) ); @@ -1363,8 +1365,13 @@ static void pack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, break; } case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); break; + case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: + push_data( data, (SCROLLBARINFO *)lparam, sizeof(SCROLLBARINFO) ); + break; case EM_GETRECT: case LB_GETITEMRECT: case CB_GETDROPPEDCONTROLRECT: @@ -1503,9 +1510,11 @@ static void unpack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, } break; case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: memcpy( (SCROLLINFO *)lparam, buffer, min( sizeof(SCROLLINFO), size )); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: memcpy( (SCROLLBARINFO *)lparam, buffer, min( sizeof(SCROLLBARINFO), size )); break; case EM_GETRECT: @@ -1707,9 +1716,11 @@ size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, break; case SBM_SETSCROLLINFO: case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: size = sizeof(SCROLLBARINFO); break; case EM_GETSEL: @@ -1949,9 +1960,11 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me break; case SBM_SETSCROLLINFO: case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: copy_size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: copy_size = sizeof(SCROLLBARINFO); break; case EM_GETSEL: @@ -2102,7 +2115,8 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR if (is_desktop_window( hwnd )) return 0; return set_window_style( hwnd, wparam, lparam ); case WM_WINE_SETACTIVEWINDOW: - if (!wparam && NtUserGetForegroundWindow() == hwnd) return 0; + if (!wparam && NtUserGetWindowThread( NtUserGetForegroundWindow(), NULL ) == GetCurrentThreadId()) + return 0; return (LRESULT)NtUserSetActiveWindow( (HWND)wparam ); case WM_WINE_KEYBOARD_LL_HOOK: case WM_WINE_MOUSE_LL_HOOK: @@ -2122,6 +2136,10 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR case WM_WINE_UPDATEWINDOWSTATE: update_window_state( hwnd ); return 0; + case WM_WINE_GETSCROLLBARINFO: + return get_scroll_bar_info( hwnd, (LONG)wparam, (SCROLLBARINFO *)lparam ); + case WM_WINE_GETSCROLLINFO: + return get_scroll_info( hwnd, (int)wparam, (SCROLLINFO *)lparam ); default: if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) return user_driver->pWindowMessage( hwnd, msg, wparam, lparam ); @@ -2135,6 +2153,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR */ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info ) { + const input_shm_t *shared; BOOL ret; if (info->cbSize != sizeof(*info)) @@ -2143,6 +2162,33 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info ) return FALSE; } + if (id == GetCurrentThreadId()) shared = get_input_shared_memory(); + else if (id == 0) shared = get_foreground_shared_memory(); + else shared = NULL; + + if (shared) + { + SHARED_READ_BEGIN( shared, input_shm_t ) + { + info->flags = 0; + info->hwndActive = wine_server_ptr_handle( shared->active ); + info->hwndFocus = wine_server_ptr_handle( shared->focus ); + info->hwndCapture = wine_server_ptr_handle( shared->capture ); + info->hwndMenuOwner = wine_server_ptr_handle( shared->menu_owner ); + info->hwndMoveSize = wine_server_ptr_handle( shared->move_size ); + info->hwndCaret = wine_server_ptr_handle( shared->caret ); + info->rcCaret.left = shared->caret_rect.left; + info->rcCaret.top = shared->caret_rect.top; + info->rcCaret.right = shared->caret_rect.right; + info->rcCaret.bottom = shared->caret_rect.bottom; + if (shared->menu_owner) info->flags |= GUI_INMENUMODE; + if (shared->move_size) info->flags |= GUI_INMOVESIZE; + if (shared->caret) info->flags |= GUI_CARETBLINKING; + } + SHARED_READ_END + return TRUE; + } + SERVER_START_REQ( get_thread_input ) { req->tid = id; @@ -2320,6 +2366,15 @@ static void handle_keyboard_repeat_message( HWND hwnd ) } +static BOOL process_pointer_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) +{ + msg->lParam = MAKELONG( msg_data->rawinput.mouse.x, msg_data->rawinput.mouse.y ); + msg->wParam = msg_data->rawinput.mouse.data; + msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); + return TRUE; +} + + /*********************************************************************** * process_keyboard_message * @@ -2481,6 +2536,51 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); SetThreadDpiAwarenessContext( get_window_dpi_awareness_context( msg->hwnd )); + if ((extra_info & 0xffffff00) != 0xff515700 && enable_mouse_in_pointer) + { + WORD flags = POINTER_MESSAGE_FLAG_PRIMARY; + DWORD message = 0; + + switch (msg->message) + { + case WM_MOUSEMOVE: + message = WM_POINTERUPDATE; + flags |= POINTER_MESSAGE_FLAG_INRANGE; + break; + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_XBUTTONDOWN: + message = WM_POINTERDOWN; + flags |= POINTER_MESSAGE_FLAG_INRANGE|POINTER_MESSAGE_FLAG_INCONTACT; + if (msg->message == WM_LBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_FIRSTBUTTON; + if (msg->message == WM_RBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_SECONDBUTTON; + if (msg->message == WM_MBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_THIRDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_LBUTTON) flags |= POINTER_MESSAGE_FLAG_FIRSTBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_RBUTTON) flags |= POINTER_MESSAGE_FLAG_SECONDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_MBUTTON) flags |= POINTER_MESSAGE_FLAG_THIRDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_XBUTTON1) flags |= POINTER_MESSAGE_FLAG_FOURTHBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_XBUTTON2) flags |= POINTER_MESSAGE_FLAG_FIFTHBUTTON; + break; + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + case WM_XBUTTONUP: + message = WM_POINTERUP; + break; + case WM_MOUSEWHEEL: + message = WM_POINTERWHEEL; + flags = HIWORD( msg->wParam ); + break; + case WM_MOUSEHWHEEL: + message = WM_POINTERHWHEEL; + flags = HIWORD( msg->wParam ); + break; + } + + if (message) send_message( msg->hwnd, message, MAKELONG( 1, flags ), MAKELONG( msg->pt.x, msg->pt.y ) ); + } + /* FIXME: is this really the right place for this hook? */ event.message = msg->message; event.time = msg->time; @@ -2663,6 +2763,9 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar if (msg->message == WM_INPUT || msg->message == WM_INPUT_DEVICE_CHANGE) ret = process_rawinput_message( msg, hw_id, msg_data ); + else if (msg->message == WM_POINTERDOWN || msg->message == WM_POINTERUP || + msg->message == WM_POINTERUPDATE) + ret = process_pointer_message( msg, hw_id, msg_data ); else if (is_keyboard_message( msg->message )) ret = process_keyboard_message( msg, hw_id, hwnd_filter, first, last, remove ); else if (is_mouse_message( msg->message )) @@ -2684,18 +2787,19 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar * available; -1 on error. * All pending sent messages are processed before returning. */ -static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, UINT changed_mask ) +static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, UINT changed_mask, BOOL waited ) { LRESULT result; struct user_thread_info *thread_info = get_user_thread_info(); INPUT_MESSAGE_SOURCE prev_source = thread_info->client_info.msg_source; + const queue_shm_t *shared = get_queue_shared_memory(); struct received_message_info info; + unsigned char buffer_init[1024]; unsigned int hw_id = 0; /* id of previous hardware message */ - void *buffer; + void *buffer = buffer_init; + BOOL skip = FALSE; size_t buffer_size = 1024; - if (!(buffer = malloc( buffer_size ))) return -1; - if (!first && !last) last = ~0; if (hwnd == HWND_BROADCAST) hwnd = HWND_TOPMOST; @@ -2704,10 +2808,42 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, NTSTATUS res; size_t size = 0; const message_data_t *msg_data = buffer; + UINT wake_mask = changed_mask & (QS_SENDMESSAGE | QS_SMRESULT); + DWORD clear_bits = 0, filter = flags >> 16 ? flags >> 16 : QS_ALLINPUT; + if (filter & QS_POSTMESSAGE) + { + clear_bits |= QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER; + if (first == 0 && last == ~0U) clear_bits |= QS_ALLPOSTMESSAGE; + } + if (filter & QS_INPUT) clear_bits |= QS_INPUT; + if (filter & QS_PAINT) clear_bits |= QS_PAINT; + + /* FIXME: if filter includes QS_RAWINPUT we have to translate hardware messages */ + if (filter & QS_RAWINPUT) filter |= QS_KEY | QS_MOUSEMOVE | QS_MOUSEBUTTON; thread_info->client_info.msg_source = prev_source; - SERVER_START_REQ( get_message ) + if (waited || !shared || NtGetTickCount() - thread_info->last_getmsg_time >= 3000) skip = FALSE; + else SHARED_READ_BEGIN( shared, queue_shm_t ) + { + /* not created yet */ + if (!shared->created) skip = FALSE; + /* if the masks need an update */ + else if (shared->wake_mask != wake_mask) skip = FALSE; + else if (shared->changed_mask != changed_mask) skip = FALSE; + /* or if the queue is signaled */ + else if (shared->wake_bits & wake_mask) skip = FALSE; + else if (shared->changed_bits & changed_mask) skip = FALSE; + /* or if the filter matches some bits */ + else if (shared->wake_bits & filter) skip = FALSE; + /* or if we should clear some bits */ + else if (shared->changed_bits & clear_bits) skip = FALSE; + else skip = TRUE; + } + SHARED_READ_END + + if (skip) res = STATUS_PENDING; + else SERVER_START_REQ( get_message ) { req->flags = flags; req->get_win = wine_server_user_handle( hwnd ); @@ -2717,6 +2853,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, req->wake_mask = changed_mask & (QS_SENDMESSAGE | QS_SMRESULT); req->changed_mask = changed_mask; wine_server_set_reply( req, buffer, buffer_size ); + thread_info->last_getmsg_time = NtGetTickCount(); if (!(res = wine_server_call( req ))) { size = wine_server_reply_size( reply ); @@ -2729,27 +2866,33 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, info.msg.pt.x = reply->x; info.msg.pt.y = reply->y; hw_id = 0; - thread_info->active_hooks = reply->active_hooks; } else buffer_size = reply->total; } SERVER_END_REQ; + /* force refreshing hooks */ + thread_info->active_hooks = 0; + if (res) { - free( buffer ); if (res == STATUS_PENDING) { thread_info->wake_mask = changed_mask & (QS_SENDMESSAGE | QS_SMRESULT); thread_info->changed_mask = changed_mask; + if (buffer != buffer_init) free( buffer ); + NtYieldExecution(); return 0; } if (res != STATUS_BUFFER_OVERFLOW) { RtlSetLastWin32Error( RtlNtStatusToDosError(res) ); + if (buffer != buffer_init) free( buffer ); return -1; } - if (!(buffer = malloc( buffer_size ))) return -1; + if (buffer == buffer_init) buffer = malloc( buffer_size ); + else buffer = realloc( buffer, buffer_size ); + if (!buffer) return -1; continue; } @@ -2766,8 +2909,14 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, break; case MSG_NOTIFY: info.flags = ISMEX_NOTIFY; + /* unpack_message may have to reallocate */ + if (buffer == buffer_init) + { + buffer = malloc( buffer_size ); + memcpy( buffer, buffer_init, buffer_size ); + } if (!unpack_message( info.msg.hwnd, info.msg.message, &info.msg.wParam, - &info.msg.lParam, &buffer, size )) + &info.msg.lParam, &buffer, size, buffer_size )) continue; break; case MSG_CALLBACK: @@ -2844,8 +2993,14 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, continue; case MSG_OTHER_PROCESS: info.flags = ISMEX_SEND; + /* unpack_message may have to reallocate */ + if (buffer == buffer_init) + { + buffer = malloc( buffer_size ); + memcpy( buffer, buffer_init, buffer_size ); + } if (!unpack_message( info.msg.hwnd, info.msg.message, &info.msg.wParam, - &info.msg.lParam, &buffer, size )) + &info.msg.lParam, &buffer, size, buffer_size )) { /* ignore it */ reply_message( &info, 0, &info.msg ); @@ -2866,7 +3021,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, thread_info->client_info.message_pos = MAKELONG( info.msg.pt.x, info.msg.pt.y ); thread_info->client_info.message_time = info.msg.time; thread_info->client_info.message_extra = msg_data->hardware.info; - free( buffer ); + if (buffer != buffer_init) free( buffer ); call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg, sizeof(*msg) ); return 1; } @@ -2881,13 +3036,13 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, /* if this is a nested call return right away */ if (first == info.msg.message && last == info.msg.message) { - free( buffer ); + if (buffer != buffer_init) free( buffer ); return 0; } } else peek_message( msg, info.msg.hwnd, info.msg.message, - info.msg.message, flags | PM_REMOVE, changed_mask ); + info.msg.message, flags | PM_REMOVE, changed_mask, TRUE ); continue; } if (info.msg.message >= WM_DDE_FIRST && info.msg.message <= WM_DDE_LAST) @@ -2914,13 +3069,22 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, info.msg.wParam = result.wparam; info.msg.lParam = result.lparam; } + /* CXHACK 19488 */ + if (info.msg.message == WM_PAINT && + flags == (PM_REMOVE | PM_QS_INPUT | PM_QS_POSTMESSAGE | PM_QS_PAINT | PM_QS_SENDMESSAGE) && + (get_window_long( info.msg.hwnd, GWL_EXSTYLE ) & WS_EX_COMPOSITED )) + { + send_message( info.msg.hwnd, info.msg.message, info.msg.wParam, info.msg.lParam ); + flags &= ~PM_QS_PAINT; + continue; + } *msg = info.msg; msg->pt = point_phys_to_win_dpi( info.msg.hwnd, info.msg.pt ); thread_info->client_info.message_pos = MAKELONG( msg->pt.x, msg->pt.y ); thread_info->client_info.message_time = info.msg.time; thread_info->client_info.message_extra = 0; thread_info->client_info.msg_source = msg_source_unavailable; - free( buffer ); + if (buffer != buffer_init) free( buffer ); call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg, sizeof(*msg) ); return 1; } @@ -2950,7 +3114,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, static void process_sent_messages(void) { MSG msg; - peek_message( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE, 0 ); + peek_message( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE, 0, FALSE ); } /*********************************************************************** @@ -2980,7 +3144,8 @@ static HANDLE get_server_queue_handle(void) /* check for driver events if we detect that the app is not properly consuming messages */ static inline void check_for_driver_events( UINT msg ) { - if (get_user_thread_info()->message_count > 200) + struct user_thread_info *thread_info = get_user_thread_info(); + if (thread_info->message_count > 200) { flush_window_surfaces( FALSE ); user_driver->pProcessEvents( QS_ALLINPUT ); @@ -2988,9 +3153,9 @@ static inline void check_for_driver_events( UINT msg ) else if (msg == WM_TIMER || msg == WM_SYSTIMER) { /* driver events should have priority over timers, so make sure we'll check for them soon */ - get_user_thread_info()->message_count += 100; + thread_info->message_count += 100; } - else get_user_thread_info()->message_count++; + else thread_info->message_count++; } /* helper for kernel32->ntdll timeout format conversion */ @@ -3170,24 +3335,29 @@ BOOL WINAPI NtUserWaitMessage(void) */ BOOL WINAPI NtUserPeekMessage( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags ) { + struct user_thread_info *thread_info = get_user_thread_info(); MSG msg; int ret; user_check_not_lock(); - check_for_driver_events( 0 ); + if (thread_info->last_driver_time != NtGetTickCount()) + check_for_driver_events( 0 ); - ret = peek_message( &msg, hwnd, first, last, flags, 0 ); + ret = peek_message( &msg, hwnd, first, last, flags, 0, FALSE ); if (ret < 0) return FALSE; if (!ret) { + if (thread_info->last_driver_time == NtGetTickCount()) return FALSE; + thread_info->last_driver_time = NtGetTickCount(); flush_window_surfaces( TRUE ); ret = wait_message( 0, NULL, 0, QS_ALLINPUT, 0 ); /* if we received driver events, check again for a pending message */ - if (ret == WAIT_TIMEOUT || peek_message( &msg, hwnd, first, last, flags, 0 ) <= 0) return FALSE; + if (ret == WAIT_TIMEOUT || peek_message( &msg, hwnd, first, last, flags, 0, TRUE ) <= 0) return FALSE; } check_for_driver_events( msg.message ); + thread_info->last_driver_time = NtGetTickCount() - 1; /* copy back our internal safe copy of message data to msg_out. * msg_out is a variable from the *program*, so it can't be used @@ -3225,7 +3395,7 @@ BOOL WINAPI NtUserGetMessage( MSG *msg, HWND hwnd, UINT first, UINT last ) } else mask = QS_ALLINPUT; - while (!(ret = peek_message( msg, hwnd, first, last, PM_REMOVE | (mask << 16), mask ))) + while (!(ret = peek_message( msg, hwnd, first, last, PM_REMOVE | (mask << 16), mask, TRUE ))) { wait_objects( 1, &server_queue, INFINITE, mask & (QS_SENDMESSAGE | QS_SMRESULT), mask, 0 ); } @@ -3485,7 +3655,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r int prev_x, prev_y, new_x, new_y; USAGE hid_usage_page, hid_usage; NTSTATUS ret; - BOOL wait, affects_key_state = FALSE; + BOOL wait; info.type = MSG_HARDWARE; info.dest_tid = 0; @@ -3526,10 +3696,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r req->input.mouse.flags = input->mi.dwFlags; req->input.mouse.time = input->mi.time; req->input.mouse.info = input->mi.dwExtraInfo; - affects_key_state = !!(input->mi.dwFlags & (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP | - MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP | - MOUSEEVENTF_MIDDLEDOWN | MOUSEEVENTF_MIDDLEUP | - MOUSEEVENTF_XDOWN | MOUSEEVENTF_XUP)); + if (rawinput) req->flags |= SEND_HWMSG_RAWINPUT; break; case INPUT_KEYBOARD: req->input.kbd.vkey = input->ki.wVk; @@ -3537,7 +3704,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r req->input.kbd.flags = input->ki.dwFlags; req->input.kbd.time = input->ki.time; req->input.kbd.info = input->ki.dwExtraInfo; - affects_key_state = TRUE; + if (rawinput) req->flags |= SEND_HWMSG_RAWINPUT; break; case INPUT_HARDWARE: req->input.hw.msg = input->hi.uMsg; @@ -3546,9 +3713,18 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r { case WM_INPUT: case WM_INPUT_DEVICE_CHANGE: + case WM_POINTERDOWN: + case WM_POINTERUP: + case WM_POINTERUPDATE: req->input.hw.rawinput.type = rawinput->header.dwType; switch (rawinput->header.dwType) { + case RIM_TYPEMOUSE: + req->input.hw.rawinput.mouse.x = rawinput->data.mouse.lLastX; + req->input.hw.rawinput.mouse.y = rawinput->data.mouse.lLastY; + req->input.hw.rawinput.mouse.data = rawinput->data.mouse.ulRawButtons; + req->input.hw.lparam = rawinput->data.mouse.usFlags; + break; case RIM_TYPEHID: req->input.hw.rawinput.hid.device = HandleToUlong( rawinput->header.hDevice ); req->input.hw.rawinput.hid.param = rawinput->header.wParam; @@ -3575,13 +3751,8 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r } SERVER_END_REQ; - if (!ret) - { - if (affects_key_state) - InterlockedIncrement( &global_key_state_counter ); /* force refreshing the key state cache */ - if ((flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) - user_driver->pSetCursorPos( new_x, new_y ); - } + if (!ret && (flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) + user_driver->pSetCursorPos( new_x, new_y ); if (wait) { diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h index 5c4f8279c87..eb82df750ba 100644 --- a/dlls/win32u/ntgdi_private.h +++ b/dlls/win32u/ntgdi_private.h @@ -327,7 +327,7 @@ struct font_backend_funcs UINT (*get_default_glyph)( struct gdi_font *gdi_font ); UINT (*get_glyph_outline)( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *gm, ABC *abc, UINT buflen, void *buf, - const MAT2 *mat, BOOL tategaki ); + const MAT2 *mat, BOOL tategaki, UINT aa_flags ); UINT (*get_unicode_ranges)( struct gdi_font *font, GLYPHSET *gs ); BOOL (*get_char_width_info)( struct gdi_font *font, struct char_width_info *info ); BOOL (*set_outline_text_metrics)( struct gdi_font *font ); diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 11bb7f4baf6..4221c25d65f 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -104,6 +104,8 @@ typedef struct tagWND #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ #define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */ #define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */ +#define WIN_IS_ACTIVATING 0x0100 /* the window is being activated */ +#define WIN_IS_TOUCH 0x0200 /* the window has been registered for touch input */ #define WND_OTHER_PROCESS ((WND *)1) /* returned by get_win_ptr on unknown window handles */ #define WND_DESKTOP ((WND *)2) /* returned by get_win_ptr on the desktop window */ @@ -114,6 +116,13 @@ static inline BOOL is_broadcast( HWND hwnd ) return hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST; } +struct touchinput_thread_data +{ + BYTE index; /* history index */ + TOUCHINPUT current[8]; /* current touch state */ + TOUCHINPUT history[128][8]; /* touches history buffer */ +}; + /* this is the structure stored in TEB->Win32ClientInfo */ /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info @@ -122,21 +131,27 @@ struct user_thread_info HANDLE server_queue; /* Handle to server-side queue */ DWORD wake_mask; /* Current queue wake mask */ DWORD changed_mask; /* Current queue changed mask */ + DWORD last_driver_time; /* Get/PeekMessage driver event time */ + DWORD last_getmsg_time; /* Get/PeekMessage last request time */ WORD message_count; /* Get/PeekMessage loop counter */ WORD hook_call_depth; /* Number of recursively called hook procs */ WORD hook_unicode; /* Is current hook unicode? */ HHOOK hook; /* Current hook */ UINT active_hooks; /* Bitmap of active hooks */ struct received_message_info *receive_info; /* Message being currently received */ - struct user_key_state_info *key_state; /* Cache of global key state */ struct imm_thread_data *imm_thread_data; /* IMM thread data */ MSG key_repeat_msg; /* Last WM_KEYDOWN message to repeat */ HKL kbd_layout; /* Current keyboard layout */ UINT kbd_layout_id; /* Current keyboard layout ID */ struct rawinput_thread_data *rawinput; /* RawInput thread local data / buffer */ + struct touchinput_thread_data *touchinput; /* touch input thread local buffer */ UINT spy_indent; /* Current spy indent */ BOOL clipping_cursor; /* thread is currently clipping */ DWORD clipping_reset; /* time when clipping was last reset */ + const desktop_shm_t *desktop_shm; /* Ptr to server's desktop shared memory */ + const queue_shm_t *queue_shm; /* Ptr to server's thread queue shared memory */ + const input_shm_t *input_shm; /* Ptr to server's thread input shared memory */ + const input_shm_t *foreground_shm; /* Ptr to server's foreground thread input shared memory */ }; C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); @@ -146,13 +161,6 @@ static inline struct user_thread_info *get_user_thread_info(void) return CONTAINING_RECORD( NtUserGetThreadInfo(), struct user_thread_info, client_info ); } -struct user_key_state_info -{ - UINT time; /* Time of last key state refresh */ - INT counter; /* Counter to invalidate the key state */ - BYTE state[256]; /* State for each key */ -}; - struct hook_extra_info { HHOOK handle; @@ -261,6 +269,18 @@ void release_user_handle_ptr( void *ptr ); void *next_process_user_handle_ptr( HANDLE *handle, unsigned int type ); UINT win_set_flags( HWND hwnd, UINT set_mask, UINT clear_mask ); +/* winstation.c */ +struct global_shared_memory +{ + ULONG display_settings_serial; +}; + +extern volatile struct global_shared_memory *get_global_shared_memory( void ); +extern const desktop_shm_t *get_desktop_shared_memory(void); +extern const queue_shm_t *get_queue_shared_memory(void); +extern const input_shm_t *get_input_shared_memory(void); +extern const input_shm_t *get_foreground_shared_memory(void); + static inline UINT win_get_flags( HWND hwnd ) { return win_set_flags( hwnd, 0, 0 ); @@ -270,4 +290,27 @@ WND *get_win_ptr( HWND hwnd ); BOOL is_child( HWND parent, HWND child ); BOOL is_window( HWND hwnd ); +#if defined(__i386__) || defined(__x86_64__) +#define __SHARED_READ_SEQ( x ) (x) +#define __SHARED_READ_FENCE do {} while(0) +#else +#define __SHARED_READ_SEQ( x ) __atomic_load_n( &(x), __ATOMIC_RELAXED ) +#define __SHARED_READ_FENCE __atomic_thread_fence( __ATOMIC_ACQUIRE ) +#endif + +#define SHARED_READ_BEGIN( ptr, type ) \ + do { \ + const type *__shared = (ptr); \ + unsigned int __seq; \ + do { \ + while ((__seq = __SHARED_READ_SEQ( __shared->seq )) & 1) YieldProcessor(); \ + __SHARED_READ_FENCE; \ + do + +#define SHARED_READ_END \ + while (0); \ + __SHARED_READ_FENCE; \ + } while (__SHARED_READ_SEQ( __shared->seq ) != __seq); \ + } while(0); + #endif /* __WINE_NTUSER_PRIVATE_H */ diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index bd2e00a31c4..1e071e30a94 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -96,7 +96,9 @@ static bool rawinput_from_hardware_message( RAWINPUT *rawinput, const struct har rawinput->header.hDevice = WINE_MOUSE_HANDLE; rawinput->header.wParam = 0; - rawinput->data.mouse.usFlags = MOUSE_MOVE_RELATIVE; + rawinput->data.mouse.usFlags = msg_data->flags & MOUSEEVENTF_ABSOLUTE ? MOUSE_MOVE_ABSOLUTE : MOUSE_MOVE_RELATIVE; + if (msg_data->flags & MOUSEEVENTF_VIRTUALDESK) rawinput->data.mouse.usFlags |= MOUSE_VIRTUAL_DESKTOP; + rawinput->data.mouse.usButtonFlags = 0; rawinput->data.mouse.usButtonData = 0; for (i = 1; i < ARRAY_SIZE(button_flags); ++i) @@ -529,6 +531,30 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT * return count; } +static BOOL steam_input_get_vid_pid( UINT slot, UINT16 *vid, UINT16 *pid ) +{ + const char *info = getenv( "SteamVirtualGamepadInfo" ); + char buffer[256]; + UINT current; + FILE *file; + + TRACE( "reading SteamVirtualGamepadInfo %s\n", debugstr_a(info) ); + + if (!info || !(file = fopen( info, "r" ))) return FALSE; + while (fscanf( file, "%255[^\n]\n", buffer ) == 1) + { + if (sscanf( buffer, "[slot %d]", ¤t )) continue; + if (current < slot) continue; + if (current > slot) break; + if (sscanf( buffer, "VID=0x%hx", vid )) continue; + if (sscanf( buffer, "PID=0x%hx", pid )) continue; + } + + fclose( file ); + + return TRUE; +} + /********************************************************************** * NtUserGetRawInputDeviceInfo (win32u.@) */ @@ -566,10 +592,51 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data switch (command) { case RIDI_DEVICENAME: - if ((len = wcslen( device->path ) + 1) <= data_len && data) - memcpy( data, device->path, len * sizeof(WCHAR) ); + { + static const WCHAR steam_input_idW[] = + { + '\\','\\','?','\\','H','I','D','#','V','I','D','_','2','8','D','E','&','P','I','D','_','1','1','F','F','&','I','G','_',0 + }; + const WCHAR *device_path; + WCHAR bufferW[MAX_PATH]; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (wcsnicmp( device->path, steam_input_idW, 29 )) device_path = device->path; + else + { + char buffer[MAX_PATH]; + UINT size = 0, slot; + const WCHAR *tmpW; + UINT16 vid, pid; + + tmpW = device->path + 29; + while (*tmpW && *tmpW != '#' && size < ARRAY_SIZE(buffer)) buffer[size++] = *tmpW++; + buffer[size] = 0; + if (sscanf( buffer, "%02u", &slot ) != 1) slot = 0; + + if (!steam_input_get_vid_pid( slot, &vid, &pid )) + { + vid = 0x045e; + pid = 0x028e; + } + + size = snprintf( buffer, ARRAY_SIZE(buffer), "\\\\.\\pipe\\HID#VID_045E&PID_028E&IG_00#%04X&%04X", vid, pid ); + if ((tmpW = wcschr( device->path + 29, '&' ))) + { + do buffer[size++] = *tmpW++; + while (*tmpW != '&' && size < ARRAY_SIZE(buffer)); + } + size += snprintf( buffer + size, ARRAY_SIZE(buffer) - size, "#%d#%u", slot, (UINT)GetCurrentProcessId() ); + + ntdll_umbstowcs( buffer, size + 1, bufferW, sizeof(bufferW) ); + device_path = bufferW; + } + + if ((len = wcslen( device_path ) + 1) <= data_len && data) + memcpy( data, device_path, len * sizeof(WCHAR) ); *data_size = len; break; + } case RIDI_DEVICEINFO: if ((len = sizeof(info)) <= data_len && data) @@ -609,6 +676,7 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data */ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT header_size ) { + static int cached_clear_qs_rawinput = -1; unsigned int count = 0, remaining, rawinput_size, next_size, overhead; struct rawinput_thread_data *thread_data; struct hardware_msg_data *msg_data; @@ -641,6 +709,7 @@ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT heade { req->rawinput_size = rawinput_size; req->buffer_size = 0; + req->clear_qs_rawinput = 0; if (wine_server_call( req )) return ~0u; *data_size = reply->next_size; } @@ -651,12 +720,20 @@ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT heade if (!(thread_data = get_rawinput_thread_data())) return ~0u; rawinput = thread_data->buffer; + if (cached_clear_qs_rawinput == -1) + { + const char *sgi; + + cached_clear_qs_rawinput = (sgi = getenv( "SteamGameId" )) && !strcmp( sgi, "1172470" ); + } + /* first RAWINPUT block in the buffer is used for WM_INPUT message data */ msg_data = (struct hardware_msg_data *)NEXTRAWINPUTBLOCK(rawinput); SERVER_START_REQ( get_rawinput_buffer ) { req->rawinput_size = rawinput_size; req->buffer_size = *data_size; + req->clear_qs_rawinput = cached_clear_qs_rawinput; wine_server_set_reply( req, msg_data, RAWINPUT_BUFFER_SIZE - rawinput->header.dwSize ); if (wine_server_call( req )) return ~0u; next_size = reply->next_size; @@ -780,7 +857,24 @@ BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_d if (msg->message == WM_INPUT_DEVICE_CHANGE) { pthread_mutex_lock( &rawinput_mutex ); - rawinput_update_device_list(); + if (msg_data->rawinput.type != RIM_TYPEHID || msg_data->rawinput.hid.param != GIDC_REMOVAL) + rawinput_update_device_list(); + else + { + struct device *device; + + LIST_FOR_EACH_ENTRY( device, &devices, struct device, entry ) + { + if (device->handle == UlongToHandle(msg_data->rawinput.hid.device)) + { + list_remove( &device->entry ); + NtClose( device->file ); + free( device->data ); + free( device ); + break; + } + } + } pthread_mutex_unlock( &rawinput_mutex ); } else diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 19a9a1379f4..40a9b1a6605 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -165,6 +165,16 @@ static BOOL show_scroll_bar( HWND hwnd, int bar, BOOL show_horz, BOOL show_vert /* frame has been changed, let the window redraw itself */ NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); + + if ((set_bits & WS_HSCROLL) && !(old_style & WS_HSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_SHOW, hwnd, OBJID_HSCROLL, 0 ); + if ((set_bits & WS_VSCROLL) && !(old_style & WS_VSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_SHOW, hwnd, OBJID_VSCROLL, 0 ); + if ((clear_bits & WS_HSCROLL) && (old_style & WS_HSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_HIDE, hwnd, OBJID_HSCROLL, 0 ); + if ((clear_bits & WS_VSCROLL) && (old_style & WS_VSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_HIDE, hwnd, OBJID_VSCROLL, 0 ); + return TRUE; } return FALSE; /* no frame changes */ @@ -892,7 +902,13 @@ BOOL get_scroll_info( HWND hwnd, int bar, SCROLLINFO *info ) struct scroll_info *scroll; /* handle invalid data structure */ - if (!validate_scroll_info( info ) || !(scroll = get_scroll_info_ptr( hwnd, bar, FALSE ))) + if (!validate_scroll_info( info )) + return FALSE; + + if (bar != SB_CTL && !is_current_thread_window( hwnd )) + return send_message( hwnd, WM_WINE_GETSCROLLINFO, (WPARAM)bar, (LPARAM)info ); + + if (!(scroll = get_scroll_info_ptr( hwnd, bar, FALSE ))) return FALSE; /* fill in the desired scroll info structure */ @@ -1043,12 +1059,25 @@ static int set_scroll_info( HWND hwnd, int bar, const SCROLLINFO *info, BOOL red refresh_scroll_bar( hwnd, bar, TRUE, TRUE ); else if (action & SA_SSI_REPAINT_ARROWS) refresh_scroll_bar( hwnd, bar, TRUE, FALSE ); + + switch (bar) + { + case SB_CTL: + NtUserNotifyWinEvent( EVENT_OBJECT_VALUECHANGE, hwnd, OBJID_CLIENT, 0 ); + break; + case SB_HORZ: + NtUserNotifyWinEvent( EVENT_OBJECT_VALUECHANGE, hwnd, OBJID_HSCROLL, 0 ); + break; + case SB_VERT: + NtUserNotifyWinEvent( EVENT_OBJECT_VALUECHANGE, hwnd, OBJID_VSCROLL, 0 ); + break; + } } return ret; /* Return current position */ } -static BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) +BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) { struct scroll_info *scroll; int bar, dummy; @@ -1067,6 +1096,9 @@ static BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) /* handle invalid data structure */ if (info->cbSize != sizeof(*info)) return FALSE; + if (bar != SB_CTL && !is_current_thread_window( hwnd )) + return send_message( hwnd, WM_WINE_GETSCROLLBARINFO, (WPARAM)id, (LPARAM)info ); + get_scroll_bar_rect( hwnd, bar, &info->rcScrollBar, &dummy, &info->dxyLineButton, &info->xyThumbTop ); /* rcScrollBar needs to be in screen coordinates */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ad6e7dce39b..2e6e0915091 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -958,6 +958,7 @@ static void reg_empty_key( HKEY root, const char *key_name ) static void prepare_devices(void) { + volatile struct global_shared_memory *global_shared = get_global_shared_memory(); char buffer[4096]; KEY_NODE_INFORMATION *key = (void *)buffer; KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; @@ -967,6 +968,8 @@ static void prepare_devices(void) DWORD size; HKEY hkey, subkey, device_key, prop_key; + if (global_shared) InterlockedIncrement( (LONG *)&global_shared->display_settings_serial ); + if (!enum_key) enum_key = reg_create_key( NULL, enum_keyW, sizeof(enum_keyW), 0, NULL ); if (!control_key) control_key = reg_create_key( NULL, control_keyW, sizeof(control_keyW), 0, NULL ); if (!video_key) video_key = reg_create_key( NULL, devicemap_video_keyW, sizeof(devicemap_video_keyW), @@ -1399,11 +1402,11 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param ) break; /* AMD */ case 0x1002: - sprintf( buffer, "31.0.14051.5006" ); + sprintf( buffer, "31.0.21902.5" ); break; /* Nvidia */ case 0x10de: - sprintf( buffer, "31.0.15.3625" ); + sprintf( buffer, "31.0.15.5212" ); break; /* Default value for any other vendor. */ default: @@ -1703,7 +1706,6 @@ static BOOL update_display_cache_from_registry(void) struct monitor *monitor, *monitor2; HANDLE mutex = NULL; NTSTATUS status; - BOOL ret; /* If user driver did initialize the registry, then exit */ if (!video_key && !(video_key = reg_open_key( NULL, devicemap_video_keyW, @@ -1761,11 +1763,15 @@ static BOOL update_display_cache_from_registry(void) } } - if ((ret = !list_empty( &adapters ) && !list_empty( &monitors ))) - last_query_display_time = key.LastWriteTime.QuadPart; + if (list_empty( &adapters )) + { + WARN( "No adapters found.\n" ); + assert( list_empty( &monitors )); + } + else if (!list_empty( &monitors )) last_query_display_time = key.LastWriteTime.QuadPart; pthread_mutex_unlock( &display_lock ); release_display_device_init_mutex( mutex ); - return ret; + return TRUE; } static BOOL is_same_devmode( const DEVMODEW *a, const DEVMODEW *b ) @@ -2031,16 +2037,29 @@ static BOOL desktop_update_display_devices( BOOL force, struct device_manager_ct return TRUE; } -BOOL update_display_cache( BOOL force ) +BOOL update_display_cache( BOOL force, BOOL increment_serial ) { static const WCHAR wine_service_station_name[] = {'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0}; - HWINSTA winstation = NtUserGetProcessWindowStation(); + static ULONG last_update_serial; + + volatile struct global_shared_memory *global_shared = get_global_shared_memory(); + ULONG current_serial, global_serial; + HWINSTA winstation; struct device_manager_ctx ctx = {0}; BOOL was_virtual_desktop, ret; WCHAR name[MAX_PATH]; + __WINE_ATOMIC_LOAD_RELAXED( &last_update_serial, ¤t_serial ); + if (global_shared) + { + __WINE_ATOMIC_LOAD_RELAXED( &global_shared->display_settings_serial, &global_serial ); + if (!force && current_serial && current_serial == global_serial) return TRUE; + } + else global_serial = 0; + /* services do not have any adapters, only a virtual monitor */ + winstation = NtUserGetProcessWindowStation(); if (NtUserGetObjectInformation( winstation, UOI_NAME, name, sizeof(name), NULL ) && !wcscmp( name, wine_service_station_name )) { @@ -2048,6 +2067,7 @@ BOOL update_display_cache( BOOL force ) clear_display_devices(); list_add_tail( &monitors, &virtual_monitor.entry ); pthread_mutex_unlock( &display_lock ); + InterlockedCompareExchange( (LONG *)&last_update_serial, global_serial, current_serial ); return TRUE; } @@ -2064,6 +2084,9 @@ BOOL update_display_cache( BOOL force ) release_display_manager_ctx( &ctx ); if (!ret) WARN( "Failed to update display devices\n" ); + if (increment_serial && global_shared) + global_serial = InterlockedIncrement( (LONG *)&global_shared->display_settings_serial ); + if (!update_display_cache_from_registry()) { if (force) @@ -2078,15 +2101,16 @@ BOOL update_display_cache( BOOL force ) return FALSE; } - return update_display_cache( TRUE ); + return update_display_cache( TRUE, FALSE ); } + InterlockedCompareExchange( (LONG *)&last_update_serial, global_serial, current_serial ); return TRUE; } static BOOL lock_display_devices(void) { - if (!update_display_cache( FALSE )) return FALSE; + if (!update_display_cache( FALSE, FALSE )) return FALSE; pthread_mutex_lock( &display_lock ); return TRUE; } @@ -2329,7 +2353,7 @@ RECT get_virtual_screen_rect( UINT dpi ) return rect; } -static BOOL is_window_rect_full_screen( const RECT *rect ) +BOOL is_window_rect_full_screen( const RECT *rect ) { struct monitor *monitor; BOOL ret = FALSE; @@ -2400,8 +2424,10 @@ RECT get_primary_monitor_rect( UINT dpi ) LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info ) { + volatile struct global_shared_memory *global_shared; struct monitor *monitor; UINT32 count = 0; + BOOL skip_update = FALSE; TRACE( "(0x%x %p %p)\n", flags, num_path_info, num_mode_info ); @@ -2410,6 +2436,12 @@ LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_in *num_path_info = 0; + if (flags & 0x40000000) + { + flags &= ~0x40000000; + skip_update = TRUE; + } + switch (flags) { case QDC_ALL_PATHS: @@ -2424,6 +2456,10 @@ LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_in if (flags != QDC_ONLY_ACTIVE_PATHS) FIXME( "only returning active paths\n" ); + /* NtUserGetDisplayConfigBufferSizes() is called by display drivers to trigger display settings update. */ + if (!skip_update && (global_shared = get_global_shared_memory())) + InterlockedIncrement( (LONG *)&global_shared->display_settings_serial ); + if (lock_display_devices()) { LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) @@ -2935,6 +2971,8 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev struct adapter *adapter; BOOL ret; + if (list_empty( &adapters )) return NULL; + /* allocate an extra mode for easier iteration */ if (!(displays = calloc( list_count( &adapters ) + 1, sizeof(DEVMODEW) ))) return NULL; mode = displays; @@ -3199,7 +3237,7 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod free( displays ); if (ret) return ret; - if (!update_display_cache( TRUE )) + if (!update_display_cache( TRUE, TRUE )) WARN( "Failed to update display cache after mode change.\n" ); if ((adapter = find_adapter( NULL ))) @@ -6198,14 +6236,36 @@ static void thread_detach(void) user_driver->pThreadDetach(); - free( thread_info->key_state ); - thread_info->key_state = 0; free( thread_info->rawinput ); destroy_thread_windows(); cleanup_imm_thread(); NtClose( thread_info->server_queue ); + if (thread_info->desktop_shm) + { + NtUnmapViewOfSection( GetCurrentProcess(), (void *)thread_info->desktop_shm ); + thread_info->desktop_shm = NULL; + } + + if (thread_info->queue_shm) + { + NtUnmapViewOfSection( GetCurrentProcess(), (void *)thread_info->queue_shm ); + thread_info->queue_shm = NULL; + } + + if (thread_info->input_shm) + { + NtUnmapViewOfSection( GetCurrentProcess(), (void *)thread_info->input_shm ); + thread_info->input_shm = NULL; + } + + if (thread_info->foreground_shm) + { + NtUnmapViewOfSection( GetCurrentProcess(), (void *)thread_info->foreground_shm ); + thread_info->foreground_shm = NULL; + } + exiting_thread_id = 0; } @@ -6338,6 +6398,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_SetKeyboardAutoRepeat: return set_keyboard_auto_repeat( arg ); + case NtUserCallOneParam_UnregisterTouchWindow: + return unregister_touch_window( (HWND)arg ); + /* temporary exports */ case NtUserGetDeskPattern: return get_entry( &entry_DESKPATTERN, 256, (WCHAR *)arg ); @@ -6370,6 +6433,9 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code case NtUserCallTwoParam_MonitorFromRect: return HandleToUlong( monitor_from_rect( (const RECT *)arg1, arg2, get_thread_dpi() )); + case NtUserCallTwoParam_RegisterTouchWindow: + return register_touch_window( (HWND)arg1, arg2 ); + case NtUserCallTwoParam_SetCaretPos: return set_caret_pos( arg1, arg2 ); @@ -6563,11 +6629,36 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD return STATUS_NOT_SUPPORTED; } + case DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO: + { + DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO *info = (DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO *)packet; + const char *env; + + FIXME( "DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO semi-stub.\n" ); + + if (packet->size < sizeof(*info)) + return STATUS_INVALID_PARAMETER; + + info->advancedColorSupported = 0; + info->advancedColorEnabled = 0; + info->wideColorEnforced = 0; + info->advancedColorForceDisabled = 0; + info->colorEncoding = DISPLAYCONFIG_COLOR_ENCODING_RGB; + info->bitsPerColorChannel = 8; + if ((env = getenv("DXVK_HDR")) && *env == '1') + { + TRACE( "HDR is enabled.\n" ); + info->advancedColorSupported = 1; + info->advancedColorEnabled = 1; + info->bitsPerColorChannel = 10; + } + + return STATUS_SUCCESS; + } case DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE: case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE: case DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION: case DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION: - case DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO: case DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE: case DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL: default: diff --git a/dlls/win32u/win32syscalls.h b/dlls/win32u/win32syscalls.h deleted file mode 100644 index 543583356d9..00000000000 --- a/dlls/win32u/win32syscalls.h +++ /dev/null @@ -1,807 +0,0 @@ -/* Automatically generated by tools/make_specfiles */ - -#define ALL_SYSCALLS32 \ - SYSCALL_ENTRY( 0x0000, NtGdiAbortDoc, 4 ) \ - SYSCALL_ENTRY( 0x0001, NtGdiAbortPath, 4 ) \ - SYSCALL_ENTRY( 0x0002, NtGdiAddFontMemResourceEx, 20 ) \ - SYSCALL_ENTRY( 0x0003, NtGdiAddFontResourceW, 24 ) \ - SYSCALL_ENTRY( 0x0004, NtGdiAlphaBlend, 48 ) \ - SYSCALL_ENTRY( 0x0005, NtGdiAngleArc, 24 ) \ - SYSCALL_ENTRY( 0x0006, NtGdiArcInternal, 40 ) \ - SYSCALL_ENTRY( 0x0007, NtGdiBeginPath, 4 ) \ - SYSCALL_ENTRY( 0x0008, NtGdiBitBlt, 44 ) \ - SYSCALL_ENTRY( 0x0009, NtGdiCloseFigure, 4 ) \ - SYSCALL_ENTRY( 0x000a, NtGdiCombineRgn, 16 ) \ - SYSCALL_ENTRY( 0x000b, NtGdiComputeXformCoefficients, 4 ) \ - SYSCALL_ENTRY( 0x000c, NtGdiCreateBitmap, 20 ) \ - SYSCALL_ENTRY( 0x000d, NtGdiCreateClientObj, 4 ) \ - SYSCALL_ENTRY( 0x000e, NtGdiCreateCompatibleBitmap, 12 ) \ - SYSCALL_ENTRY( 0x000f, NtGdiCreateCompatibleDC, 4 ) \ - SYSCALL_ENTRY( 0x0010, NtGdiCreateDIBBrush, 24 ) \ - SYSCALL_ENTRY( 0x0011, NtGdiCreateDIBSection, 36 ) \ - SYSCALL_ENTRY( 0x0012, NtGdiCreateDIBitmapInternal, 44 ) \ - SYSCALL_ENTRY( 0x0013, NtGdiCreateEllipticRgn, 16 ) \ - SYSCALL_ENTRY( 0x0014, NtGdiCreateHalftonePalette, 4 ) \ - SYSCALL_ENTRY( 0x0015, NtGdiCreateHatchBrushInternal, 12 ) \ - SYSCALL_ENTRY( 0x0016, NtGdiCreateMetafileDC, 4 ) \ - SYSCALL_ENTRY( 0x0017, NtGdiCreatePaletteInternal, 8 ) \ - SYSCALL_ENTRY( 0x0018, NtGdiCreatePatternBrushInternal, 12 ) \ - SYSCALL_ENTRY( 0x0019, NtGdiCreatePen, 16 ) \ - SYSCALL_ENTRY( 0x001a, NtGdiCreateRectRgn, 16 ) \ - SYSCALL_ENTRY( 0x001b, NtGdiCreateRoundRectRgn, 24 ) \ - SYSCALL_ENTRY( 0x001c, NtGdiCreateSolidBrush, 8 ) \ - SYSCALL_ENTRY( 0x001d, NtGdiDdDDICheckVidPnExclusiveOwnership, 4 ) \ - SYSCALL_ENTRY( 0x001e, NtGdiDdDDICloseAdapter, 4 ) \ - SYSCALL_ENTRY( 0x001f, NtGdiDdDDICreateDCFromMemory, 4 ) \ - SYSCALL_ENTRY( 0x0020, NtGdiDdDDICreateDevice, 4 ) \ - SYSCALL_ENTRY( 0x0021, NtGdiDdDDIDestroyDCFromMemory, 4 ) \ - SYSCALL_ENTRY( 0x0022, NtGdiDdDDIDestroyDevice, 4 ) \ - SYSCALL_ENTRY( 0x0023, NtGdiDdDDIEscape, 4 ) \ - SYSCALL_ENTRY( 0x0024, NtGdiDdDDIOpenAdapterFromDeviceName, 4 ) \ - SYSCALL_ENTRY( 0x0025, NtGdiDdDDIOpenAdapterFromHdc, 4 ) \ - SYSCALL_ENTRY( 0x0026, NtGdiDdDDIOpenAdapterFromLuid, 4 ) \ - SYSCALL_ENTRY( 0x0027, NtGdiDdDDIQueryAdapterInfo, 4 ) \ - SYSCALL_ENTRY( 0x0028, NtGdiDdDDIQueryStatistics, 4 ) \ - SYSCALL_ENTRY( 0x0029, NtGdiDdDDIQueryVideoMemoryInfo, 4 ) \ - SYSCALL_ENTRY( 0x002a, NtGdiDdDDISetQueuedLimit, 4 ) \ - SYSCALL_ENTRY( 0x002b, NtGdiDdDDISetVidPnSourceOwner, 4 ) \ - SYSCALL_ENTRY( 0x002c, NtGdiDeleteClientObj, 4 ) \ - SYSCALL_ENTRY( 0x002d, NtGdiDeleteObjectApp, 4 ) \ - SYSCALL_ENTRY( 0x002e, NtGdiDescribePixelFormat, 16 ) \ - SYSCALL_ENTRY( 0x002f, NtGdiDoPalette, 24 ) \ - SYSCALL_ENTRY( 0x0030, NtGdiDrawStream, 12 ) \ - SYSCALL_ENTRY( 0x0031, NtGdiEllipse, 20 ) \ - SYSCALL_ENTRY( 0x0032, NtGdiEndDoc, 4 ) \ - SYSCALL_ENTRY( 0x0033, NtGdiEndPage, 4 ) \ - SYSCALL_ENTRY( 0x0034, NtGdiEndPath, 4 ) \ - SYSCALL_ENTRY( 0x0035, NtGdiEnumFonts, 32 ) \ - SYSCALL_ENTRY( 0x0036, NtGdiEqualRgn, 8 ) \ - SYSCALL_ENTRY( 0x0037, NtGdiExcludeClipRect, 20 ) \ - SYSCALL_ENTRY( 0x0038, NtGdiExtCreatePen, 44 ) \ - SYSCALL_ENTRY( 0x0039, NtGdiExtCreateRegion, 12 ) \ - SYSCALL_ENTRY( 0x003a, NtGdiExtEscape, 32 ) \ - SYSCALL_ENTRY( 0x003b, NtGdiExtFloodFill, 20 ) \ - SYSCALL_ENTRY( 0x003c, NtGdiExtGetObjectW, 12 ) \ - SYSCALL_ENTRY( 0x003d, NtGdiExtSelectClipRgn, 12 ) \ - SYSCALL_ENTRY( 0x003e, NtGdiExtTextOutW, 36 ) \ - SYSCALL_ENTRY( 0x003f, NtGdiFillPath, 4 ) \ - SYSCALL_ENTRY( 0x0040, NtGdiFillRgn, 12 ) \ - SYSCALL_ENTRY( 0x0041, NtGdiFlattenPath, 4 ) \ - SYSCALL_ENTRY( 0x0042, NtGdiFlush, 0 ) \ - SYSCALL_ENTRY( 0x0043, NtGdiFontIsLinked, 4 ) \ - SYSCALL_ENTRY( 0x0044, NtGdiFrameRgn, 20 ) \ - SYSCALL_ENTRY( 0x0045, NtGdiGetAndSetDCDword, 16 ) \ - SYSCALL_ENTRY( 0x0046, NtGdiGetAppClipBox, 8 ) \ - SYSCALL_ENTRY( 0x0047, NtGdiGetBitmapBits, 12 ) \ - SYSCALL_ENTRY( 0x0048, NtGdiGetBitmapDimension, 8 ) \ - SYSCALL_ENTRY( 0x0049, NtGdiGetBoundsRect, 12 ) \ - SYSCALL_ENTRY( 0x004a, NtGdiGetCharABCWidthsW, 24 ) \ - SYSCALL_ENTRY( 0x004b, NtGdiGetCharWidthInfo, 8 ) \ - SYSCALL_ENTRY( 0x004c, NtGdiGetCharWidthW, 24 ) \ - SYSCALL_ENTRY( 0x004d, NtGdiGetColorAdjustment, 8 ) \ - SYSCALL_ENTRY( 0x004e, NtGdiGetDCDword, 12 ) \ - SYSCALL_ENTRY( 0x004f, NtGdiGetDCObject, 8 ) \ - SYSCALL_ENTRY( 0x0050, NtGdiGetDCPoint, 12 ) \ - SYSCALL_ENTRY( 0x0051, NtGdiGetDIBitsInternal, 36 ) \ - SYSCALL_ENTRY( 0x0052, NtGdiGetDeviceCaps, 8 ) \ - SYSCALL_ENTRY( 0x0053, NtGdiGetDeviceGammaRamp, 8 ) \ - SYSCALL_ENTRY( 0x0054, NtGdiGetFontData, 20 ) \ - SYSCALL_ENTRY( 0x0055, NtGdiGetFontFileData, 20 ) \ - SYSCALL_ENTRY( 0x0056, NtGdiGetFontFileInfo, 20 ) \ - SYSCALL_ENTRY( 0x0057, NtGdiGetFontUnicodeRanges, 8 ) \ - SYSCALL_ENTRY( 0x0058, NtGdiGetGlyphIndicesW, 20 ) \ - SYSCALL_ENTRY( 0x0059, NtGdiGetGlyphOutline, 32 ) \ - SYSCALL_ENTRY( 0x005a, NtGdiGetKerningPairs, 12 ) \ - SYSCALL_ENTRY( 0x005b, NtGdiGetNearestColor, 8 ) \ - SYSCALL_ENTRY( 0x005c, NtGdiGetNearestPaletteIndex, 8 ) \ - SYSCALL_ENTRY( 0x005d, NtGdiGetOutlineTextMetricsInternalW, 16 ) \ - SYSCALL_ENTRY( 0x005e, NtGdiGetPath, 16 ) \ - SYSCALL_ENTRY( 0x005f, NtGdiGetPixel, 12 ) \ - SYSCALL_ENTRY( 0x0060, NtGdiGetRandomRgn, 12 ) \ - SYSCALL_ENTRY( 0x0061, NtGdiGetRasterizerCaps, 8 ) \ - SYSCALL_ENTRY( 0x0062, NtGdiGetRealizationInfo, 8 ) \ - SYSCALL_ENTRY( 0x0063, NtGdiGetRegionData, 12 ) \ - SYSCALL_ENTRY( 0x0064, NtGdiGetRgnBox, 8 ) \ - SYSCALL_ENTRY( 0x0065, NtGdiGetSpoolMessage, 16 ) \ - SYSCALL_ENTRY( 0x0066, NtGdiGetSystemPaletteUse, 4 ) \ - SYSCALL_ENTRY( 0x0067, NtGdiGetTextCharsetInfo, 12 ) \ - SYSCALL_ENTRY( 0x0068, NtGdiGetTextExtentExW, 32 ) \ - SYSCALL_ENTRY( 0x0069, NtGdiGetTextFaceW, 16 ) \ - SYSCALL_ENTRY( 0x006a, NtGdiGetTextMetricsW, 12 ) \ - SYSCALL_ENTRY( 0x006b, NtGdiGetTransform, 12 ) \ - SYSCALL_ENTRY( 0x006c, NtGdiGradientFill, 24 ) \ - SYSCALL_ENTRY( 0x006d, NtGdiHfontCreate, 20 ) \ - SYSCALL_ENTRY( 0x006e, NtGdiIcmBrushInfo, 32 ) \ - SYSCALL_ENTRY( 0x006f, NtGdiInitSpool, 0 ) \ - SYSCALL_ENTRY( 0x0070, NtGdiIntersectClipRect, 20 ) \ - SYSCALL_ENTRY( 0x0071, NtGdiInvertRgn, 8 ) \ - SYSCALL_ENTRY( 0x0072, NtGdiLineTo, 12 ) \ - SYSCALL_ENTRY( 0x0073, NtGdiMaskBlt, 52 ) \ - SYSCALL_ENTRY( 0x0074, NtGdiModifyWorldTransform, 12 ) \ - SYSCALL_ENTRY( 0x0075, NtGdiMoveTo, 16 ) \ - SYSCALL_ENTRY( 0x0076, NtGdiOffsetClipRgn, 12 ) \ - SYSCALL_ENTRY( 0x0077, NtGdiOffsetRgn, 12 ) \ - SYSCALL_ENTRY( 0x0078, NtGdiOpenDCW, 32 ) \ - SYSCALL_ENTRY( 0x0079, NtGdiPatBlt, 24 ) \ - SYSCALL_ENTRY( 0x007a, NtGdiPathToRegion, 4 ) \ - SYSCALL_ENTRY( 0x007b, NtGdiPlgBlt, 44 ) \ - SYSCALL_ENTRY( 0x007c, NtGdiPolyDraw, 16 ) \ - SYSCALL_ENTRY( 0x007d, NtGdiPolyPolyDraw, 20 ) \ - SYSCALL_ENTRY( 0x007e, NtGdiPtInRegion, 12 ) \ - SYSCALL_ENTRY( 0x007f, NtGdiPtVisible, 12 ) \ - SYSCALL_ENTRY( 0x0080, NtGdiRectInRegion, 8 ) \ - SYSCALL_ENTRY( 0x0081, NtGdiRectVisible, 8 ) \ - SYSCALL_ENTRY( 0x0082, NtGdiRectangle, 20 ) \ - SYSCALL_ENTRY( 0x0083, NtGdiRemoveFontMemResourceEx, 4 ) \ - SYSCALL_ENTRY( 0x0084, NtGdiRemoveFontResourceW, 24 ) \ - SYSCALL_ENTRY( 0x0085, NtGdiResetDC, 20 ) \ - SYSCALL_ENTRY( 0x0086, NtGdiResizePalette, 8 ) \ - SYSCALL_ENTRY( 0x0087, NtGdiRestoreDC, 8 ) \ - SYSCALL_ENTRY( 0x0088, NtGdiRoundRect, 28 ) \ - SYSCALL_ENTRY( 0x0089, NtGdiSaveDC, 4 ) \ - SYSCALL_ENTRY( 0x008a, NtGdiScaleViewportExtEx, 24 ) \ - SYSCALL_ENTRY( 0x008b, NtGdiScaleWindowExtEx, 24 ) \ - SYSCALL_ENTRY( 0x008c, NtGdiSelectBitmap, 8 ) \ - SYSCALL_ENTRY( 0x008d, NtGdiSelectBrush, 8 ) \ - SYSCALL_ENTRY( 0x008e, NtGdiSelectClipPath, 8 ) \ - SYSCALL_ENTRY( 0x008f, NtGdiSelectFont, 8 ) \ - SYSCALL_ENTRY( 0x0090, NtGdiSelectPen, 8 ) \ - SYSCALL_ENTRY( 0x0091, NtGdiSetBitmapBits, 12 ) \ - SYSCALL_ENTRY( 0x0092, NtGdiSetBitmapDimension, 16 ) \ - SYSCALL_ENTRY( 0x0093, NtGdiSetBoundsRect, 12 ) \ - SYSCALL_ENTRY( 0x0094, NtGdiSetBrushOrg, 16 ) \ - SYSCALL_ENTRY( 0x0095, NtGdiSetColorAdjustment, 8 ) \ - SYSCALL_ENTRY( 0x0096, NtGdiSetDIBitsToDeviceInternal, 64 ) \ - SYSCALL_ENTRY( 0x0097, NtGdiSetDeviceGammaRamp, 8 ) \ - SYSCALL_ENTRY( 0x0098, NtGdiSetLayout, 12 ) \ - SYSCALL_ENTRY( 0x0099, NtGdiSetMagicColors, 12 ) \ - SYSCALL_ENTRY( 0x009a, NtGdiSetMetaRgn, 4 ) \ - SYSCALL_ENTRY( 0x009b, NtGdiSetPixel, 16 ) \ - SYSCALL_ENTRY( 0x009c, NtGdiSetPixelFormat, 8 ) \ - SYSCALL_ENTRY( 0x009d, NtGdiSetRectRgn, 20 ) \ - SYSCALL_ENTRY( 0x009e, NtGdiSetSystemPaletteUse, 8 ) \ - SYSCALL_ENTRY( 0x009f, NtGdiSetTextJustification, 12 ) \ - SYSCALL_ENTRY( 0x00a0, NtGdiSetVirtualResolution, 20 ) \ - SYSCALL_ENTRY( 0x00a1, NtGdiStartDoc, 16 ) \ - SYSCALL_ENTRY( 0x00a2, NtGdiStartPage, 4 ) \ - SYSCALL_ENTRY( 0x00a3, NtGdiStretchBlt, 48 ) \ - SYSCALL_ENTRY( 0x00a4, NtGdiStretchDIBitsInternal, 64 ) \ - SYSCALL_ENTRY( 0x00a5, NtGdiStrokeAndFillPath, 4 ) \ - SYSCALL_ENTRY( 0x00a6, NtGdiStrokePath, 4 ) \ - SYSCALL_ENTRY( 0x00a7, NtGdiSwapBuffers, 4 ) \ - SYSCALL_ENTRY( 0x00a8, NtGdiTransformPoints, 20 ) \ - SYSCALL_ENTRY( 0x00a9, NtGdiTransparentBlt, 44 ) \ - SYSCALL_ENTRY( 0x00aa, NtGdiUnrealizeObject, 4 ) \ - SYSCALL_ENTRY( 0x00ab, NtGdiUpdateColors, 4 ) \ - SYSCALL_ENTRY( 0x00ac, NtGdiWidenPath, 4 ) \ - SYSCALL_ENTRY( 0x00ad, NtUserActivateKeyboardLayout, 8 ) \ - SYSCALL_ENTRY( 0x00ae, NtUserAddClipboardFormatListener, 4 ) \ - SYSCALL_ENTRY( 0x00af, NtUserAssociateInputContext, 12 ) \ - SYSCALL_ENTRY( 0x00b0, NtUserAttachThreadInput, 12 ) \ - SYSCALL_ENTRY( 0x00b1, NtUserBeginPaint, 8 ) \ - SYSCALL_ENTRY( 0x00b2, NtUserBuildHimcList, 16 ) \ - SYSCALL_ENTRY( 0x00b3, NtUserBuildHwndList, 32 ) \ - SYSCALL_ENTRY( 0x00b4, NtUserCallHwnd, 8 ) \ - SYSCALL_ENTRY( 0x00b5, NtUserCallHwndParam, 12 ) \ - SYSCALL_ENTRY( 0x00b6, NtUserCallMsgFilter, 8 ) \ - SYSCALL_ENTRY( 0x00b7, NtUserCallNextHookEx, 16 ) \ - SYSCALL_ENTRY( 0x00b8, NtUserCallNoParam, 4 ) \ - SYSCALL_ENTRY( 0x00b9, NtUserCallOneParam, 8 ) \ - SYSCALL_ENTRY( 0x00ba, NtUserCallTwoParam, 12 ) \ - SYSCALL_ENTRY( 0x00bb, NtUserChangeClipboardChain, 8 ) \ - SYSCALL_ENTRY( 0x00bc, NtUserChangeDisplaySettings, 20 ) \ - SYSCALL_ENTRY( 0x00bd, NtUserCheckMenuItem, 12 ) \ - SYSCALL_ENTRY( 0x00be, NtUserChildWindowFromPointEx, 16 ) \ - SYSCALL_ENTRY( 0x00bf, NtUserClipCursor, 4 ) \ - SYSCALL_ENTRY( 0x00c0, NtUserCloseClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00c1, NtUserCloseDesktop, 4 ) \ - SYSCALL_ENTRY( 0x00c2, NtUserCloseWindowStation, 4 ) \ - SYSCALL_ENTRY( 0x00c3, NtUserCopyAcceleratorTable, 12 ) \ - SYSCALL_ENTRY( 0x00c4, NtUserCountClipboardFormats, 0 ) \ - SYSCALL_ENTRY( 0x00c5, NtUserCreateAcceleratorTable, 8 ) \ - SYSCALL_ENTRY( 0x00c6, NtUserCreateCaret, 16 ) \ - SYSCALL_ENTRY( 0x00c7, NtUserCreateDesktopEx, 24 ) \ - SYSCALL_ENTRY( 0x00c8, NtUserCreateInputContext, 4 ) \ - SYSCALL_ENTRY( 0x00c9, NtUserCreateWindowEx, 68 ) \ - SYSCALL_ENTRY( 0x00ca, NtUserCreateWindowStation, 28 ) \ - SYSCALL_ENTRY( 0x00cb, NtUserDeferWindowPosAndBand, 40 ) \ - SYSCALL_ENTRY( 0x00cc, NtUserDeleteMenu, 12 ) \ - SYSCALL_ENTRY( 0x00cd, NtUserDestroyAcceleratorTable, 4 ) \ - SYSCALL_ENTRY( 0x00ce, NtUserDestroyCursor, 8 ) \ - SYSCALL_ENTRY( 0x00cf, NtUserDestroyInputContext, 4 ) \ - SYSCALL_ENTRY( 0x00d0, NtUserDestroyMenu, 4 ) \ - SYSCALL_ENTRY( 0x00d1, NtUserDestroyWindow, 4 ) \ - SYSCALL_ENTRY( 0x00d2, NtUserDisableThreadIme, 4 ) \ - SYSCALL_ENTRY( 0x00d3, NtUserDispatchMessage, 4 ) \ - SYSCALL_ENTRY( 0x00d4, NtUserDisplayConfigGetDeviceInfo, 4 ) \ - SYSCALL_ENTRY( 0x00d5, NtUserDragDetect, 12 ) \ - SYSCALL_ENTRY( 0x00d6, NtUserDragObject, 20 ) \ - SYSCALL_ENTRY( 0x00d7, NtUserDrawCaptionTemp, 28 ) \ - SYSCALL_ENTRY( 0x00d8, NtUserDrawIconEx, 36 ) \ - SYSCALL_ENTRY( 0x00d9, NtUserDrawMenuBarTemp, 20 ) \ - SYSCALL_ENTRY( 0x00da, NtUserEmptyClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00db, NtUserEnableMenuItem, 12 ) \ - SYSCALL_ENTRY( 0x00dc, NtUserEnableMouseInPointer, 4 ) \ - SYSCALL_ENTRY( 0x00dd, NtUserEnableScrollBar, 12 ) \ - SYSCALL_ENTRY( 0x00de, NtUserEndDeferWindowPosEx, 8 ) \ - SYSCALL_ENTRY( 0x00df, NtUserEndMenu, 0 ) \ - SYSCALL_ENTRY( 0x00e0, NtUserEndPaint, 8 ) \ - SYSCALL_ENTRY( 0x00e1, NtUserEnumDisplayDevices, 16 ) \ - SYSCALL_ENTRY( 0x00e2, NtUserEnumDisplayMonitors, 16 ) \ - SYSCALL_ENTRY( 0x00e3, NtUserEnumDisplaySettings, 16 ) \ - SYSCALL_ENTRY( 0x00e4, NtUserExcludeUpdateRgn, 8 ) \ - SYSCALL_ENTRY( 0x00e5, NtUserFindExistingCursorIcon, 12 ) \ - SYSCALL_ENTRY( 0x00e6, NtUserFindWindowEx, 20 ) \ - SYSCALL_ENTRY( 0x00e7, NtUserFlashWindowEx, 4 ) \ - SYSCALL_ENTRY( 0x00e8, NtUserGetAncestor, 8 ) \ - SYSCALL_ENTRY( 0x00e9, NtUserGetAsyncKeyState, 4 ) \ - SYSCALL_ENTRY( 0x00ea, NtUserGetAtomName, 8 ) \ - SYSCALL_ENTRY( 0x00eb, NtUserGetCaretBlinkTime, 0 ) \ - SYSCALL_ENTRY( 0x00ec, NtUserGetCaretPos, 4 ) \ - SYSCALL_ENTRY( 0x00ed, NtUserGetClassInfoEx, 20 ) \ - SYSCALL_ENTRY( 0x00ee, NtUserGetClassName, 12 ) \ - SYSCALL_ENTRY( 0x00ef, NtUserGetClipboardData, 8 ) \ - SYSCALL_ENTRY( 0x00f0, NtUserGetClipboardFormatName, 12 ) \ - SYSCALL_ENTRY( 0x00f1, NtUserGetClipboardOwner, 0 ) \ - SYSCALL_ENTRY( 0x00f2, NtUserGetClipboardSequenceNumber, 0 ) \ - SYSCALL_ENTRY( 0x00f3, NtUserGetClipboardViewer, 0 ) \ - SYSCALL_ENTRY( 0x00f4, NtUserGetCursor, 0 ) \ - SYSCALL_ENTRY( 0x00f5, NtUserGetCursorFrameInfo, 16 ) \ - SYSCALL_ENTRY( 0x00f6, NtUserGetCursorInfo, 4 ) \ - SYSCALL_ENTRY( 0x00f7, NtUserGetDC, 4 ) \ - SYSCALL_ENTRY( 0x00f8, NtUserGetDCEx, 12 ) \ - SYSCALL_ENTRY( 0x00f9, NtUserGetDisplayConfigBufferSizes, 12 ) \ - SYSCALL_ENTRY( 0x00fa, NtUserGetDoubleClickTime, 0 ) \ - SYSCALL_ENTRY( 0x00fb, NtUserGetDpiForMonitor, 16 ) \ - SYSCALL_ENTRY( 0x00fc, NtUserGetForegroundWindow, 0 ) \ - SYSCALL_ENTRY( 0x00fd, NtUserGetGUIThreadInfo, 8 ) \ - SYSCALL_ENTRY( 0x00fe, NtUserGetIconInfo, 24 ) \ - SYSCALL_ENTRY( 0x00ff, NtUserGetIconSize, 16 ) \ - SYSCALL_ENTRY( 0x0100, NtUserGetInternalWindowPos, 12 ) \ - SYSCALL_ENTRY( 0x0101, NtUserGetKeyNameText, 12 ) \ - SYSCALL_ENTRY( 0x0102, NtUserGetKeyState, 4 ) \ - SYSCALL_ENTRY( 0x0103, NtUserGetKeyboardLayout, 4 ) \ - SYSCALL_ENTRY( 0x0104, NtUserGetKeyboardLayoutList, 8 ) \ - SYSCALL_ENTRY( 0x0105, NtUserGetKeyboardLayoutName, 4 ) \ - SYSCALL_ENTRY( 0x0106, NtUserGetKeyboardState, 4 ) \ - SYSCALL_ENTRY( 0x0107, NtUserGetLayeredWindowAttributes, 16 ) \ - SYSCALL_ENTRY( 0x0108, NtUserGetMenuBarInfo, 16 ) \ - SYSCALL_ENTRY( 0x0109, NtUserGetMenuItemRect, 16 ) \ - SYSCALL_ENTRY( 0x010a, NtUserGetMessage, 16 ) \ - SYSCALL_ENTRY( 0x010b, NtUserGetMouseMovePointsEx, 20 ) \ - SYSCALL_ENTRY( 0x010c, NtUserGetObjectInformation, 20 ) \ - SYSCALL_ENTRY( 0x010d, NtUserGetOpenClipboardWindow, 0 ) \ - SYSCALL_ENTRY( 0x010e, NtUserGetPointerInfoList, 32 ) \ - SYSCALL_ENTRY( 0x010f, NtUserGetPriorityClipboardFormat, 8 ) \ - SYSCALL_ENTRY( 0x0110, NtUserGetProcessDpiAwarenessContext, 4 ) \ - SYSCALL_ENTRY( 0x0111, NtUserGetProcessWindowStation, 0 ) \ - SYSCALL_ENTRY( 0x0112, NtUserGetProp, 8 ) \ - SYSCALL_ENTRY( 0x0113, NtUserGetQueueStatus, 4 ) \ - SYSCALL_ENTRY( 0x0114, NtUserGetRawInputBuffer, 12 ) \ - SYSCALL_ENTRY( 0x0115, NtUserGetRawInputData, 20 ) \ - SYSCALL_ENTRY( 0x0116, NtUserGetRawInputDeviceInfo, 16 ) \ - SYSCALL_ENTRY( 0x0117, NtUserGetRawInputDeviceList, 12 ) \ - SYSCALL_ENTRY( 0x0118, NtUserGetRegisteredRawInputDevices, 12 ) \ - SYSCALL_ENTRY( 0x0119, NtUserGetScrollBarInfo, 12 ) \ - SYSCALL_ENTRY( 0x011a, NtUserGetSystemDpiForProcess, 4 ) \ - SYSCALL_ENTRY( 0x011b, NtUserGetSystemMenu, 8 ) \ - SYSCALL_ENTRY( 0x011c, NtUserGetThreadDesktop, 4 ) \ - SYSCALL_ENTRY( 0x011d, NtUserGetTitleBarInfo, 8 ) \ - SYSCALL_ENTRY( 0x011e, NtUserGetUpdateRect, 12 ) \ - SYSCALL_ENTRY( 0x011f, NtUserGetUpdateRgn, 12 ) \ - SYSCALL_ENTRY( 0x0120, NtUserGetUpdatedClipboardFormats, 12 ) \ - SYSCALL_ENTRY( 0x0121, NtUserGetWindowDC, 4 ) \ - SYSCALL_ENTRY( 0x0122, NtUserGetWindowPlacement, 8 ) \ - SYSCALL_ENTRY( 0x0123, NtUserGetWindowRgnEx, 12 ) \ - SYSCALL_ENTRY( 0x0124, NtUserHideCaret, 4 ) \ - SYSCALL_ENTRY( 0x0125, NtUserHiliteMenuItem, 16 ) \ - SYSCALL_ENTRY( 0x0126, NtUserInitializeClientPfnArrays, 16 ) \ - SYSCALL_ENTRY( 0x0127, NtUserInternalGetWindowIcon, 8 ) \ - SYSCALL_ENTRY( 0x0128, NtUserInternalGetWindowText, 12 ) \ - SYSCALL_ENTRY( 0x0129, NtUserInvalidateRect, 12 ) \ - SYSCALL_ENTRY( 0x012a, NtUserInvalidateRgn, 12 ) \ - SYSCALL_ENTRY( 0x012b, NtUserIsClipboardFormatAvailable, 4 ) \ - SYSCALL_ENTRY( 0x012c, NtUserIsMouseInPointerEnabled, 0 ) \ - SYSCALL_ENTRY( 0x012d, NtUserKillTimer, 8 ) \ - SYSCALL_ENTRY( 0x012e, NtUserLockWindowUpdate, 4 ) \ - SYSCALL_ENTRY( 0x012f, NtUserLogicalToPerMonitorDPIPhysicalPoint, 8 ) \ - SYSCALL_ENTRY( 0x0130, NtUserMapVirtualKeyEx, 12 ) \ - SYSCALL_ENTRY( 0x0131, NtUserMenuItemFromPoint, 16 ) \ - SYSCALL_ENTRY( 0x0132, NtUserMessageCall, 28 ) \ - SYSCALL_ENTRY( 0x0133, NtUserMoveWindow, 24 ) \ - SYSCALL_ENTRY( 0x0134, NtUserMsgWaitForMultipleObjectsEx, 20 ) \ - SYSCALL_ENTRY( 0x0135, NtUserNotifyIMEStatus, 8 ) \ - SYSCALL_ENTRY( 0x0136, NtUserNotifyWinEvent, 16 ) \ - SYSCALL_ENTRY( 0x0137, NtUserOpenClipboard, 8 ) \ - SYSCALL_ENTRY( 0x0138, NtUserOpenDesktop, 12 ) \ - SYSCALL_ENTRY( 0x0139, NtUserOpenInputDesktop, 12 ) \ - SYSCALL_ENTRY( 0x013a, NtUserOpenWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x013b, NtUserPeekMessage, 20 ) \ - SYSCALL_ENTRY( 0x013c, NtUserPerMonitorDPIPhysicalToLogicalPoint, 8 ) \ - SYSCALL_ENTRY( 0x013d, NtUserPostMessage, 16 ) \ - SYSCALL_ENTRY( 0x013e, NtUserPostThreadMessage, 16 ) \ - SYSCALL_ENTRY( 0x013f, NtUserPrintWindow, 12 ) \ - SYSCALL_ENTRY( 0x0140, NtUserQueryDisplayConfig, 24 ) \ - SYSCALL_ENTRY( 0x0141, NtUserQueryInputContext, 8 ) \ - SYSCALL_ENTRY( 0x0142, NtUserRealChildWindowFromPoint, 12 ) \ - SYSCALL_ENTRY( 0x0143, NtUserRedrawWindow, 16 ) \ - SYSCALL_ENTRY( 0x0144, NtUserRegisterClassExWOW, 28 ) \ - SYSCALL_ENTRY( 0x0145, NtUserRegisterHotKey, 16 ) \ - SYSCALL_ENTRY( 0x0146, NtUserRegisterRawInputDevices, 12 ) \ - SYSCALL_ENTRY( 0x0147, NtUserReleaseDC, 8 ) \ - SYSCALL_ENTRY( 0x0148, NtUserRemoveClipboardFormatListener, 4 ) \ - SYSCALL_ENTRY( 0x0149, NtUserRemoveMenu, 12 ) \ - SYSCALL_ENTRY( 0x014a, NtUserRemoveProp, 8 ) \ - SYSCALL_ENTRY( 0x014b, NtUserScrollDC, 28 ) \ - SYSCALL_ENTRY( 0x014c, NtUserScrollWindowEx, 32 ) \ - SYSCALL_ENTRY( 0x014d, NtUserSelectPalette, 12 ) \ - SYSCALL_ENTRY( 0x014e, NtUserSendInput, 12 ) \ - SYSCALL_ENTRY( 0x014f, NtUserSetActiveWindow, 4 ) \ - SYSCALL_ENTRY( 0x0150, NtUserSetCapture, 4 ) \ - SYSCALL_ENTRY( 0x0151, NtUserSetClassLong, 16 ) \ - SYSCALL_ENTRY( 0x0152, NtUserSetClassLongPtr, 16 ) \ - SYSCALL_ENTRY( 0x0153, NtUserSetClassWord, 12 ) \ - SYSCALL_ENTRY( 0x0154, NtUserSetClipboardData, 12 ) \ - SYSCALL_ENTRY( 0x0155, NtUserSetClipboardViewer, 4 ) \ - SYSCALL_ENTRY( 0x0156, NtUserSetCursor, 4 ) \ - SYSCALL_ENTRY( 0x0157, NtUserSetCursorIconData, 16 ) \ - SYSCALL_ENTRY( 0x0158, NtUserSetCursorPos, 8 ) \ - SYSCALL_ENTRY( 0x0159, NtUserSetFocus, 4 ) \ - SYSCALL_ENTRY( 0x015a, NtUserSetInternalWindowPos, 16 ) \ - SYSCALL_ENTRY( 0x015b, NtUserSetKeyboardState, 4 ) \ - SYSCALL_ENTRY( 0x015c, NtUserSetLayeredWindowAttributes, 16 ) \ - SYSCALL_ENTRY( 0x015d, NtUserSetMenu, 8 ) \ - SYSCALL_ENTRY( 0x015e, NtUserSetMenuContextHelpId, 8 ) \ - SYSCALL_ENTRY( 0x015f, NtUserSetMenuDefaultItem, 12 ) \ - SYSCALL_ENTRY( 0x0160, NtUserSetObjectInformation, 16 ) \ - SYSCALL_ENTRY( 0x0161, NtUserSetParent, 8 ) \ - SYSCALL_ENTRY( 0x0162, NtUserSetProcessDpiAwarenessContext, 8 ) \ - SYSCALL_ENTRY( 0x0163, NtUserSetProcessWindowStation, 4 ) \ - SYSCALL_ENTRY( 0x0164, NtUserSetProp, 12 ) \ - SYSCALL_ENTRY( 0x0165, NtUserSetScrollInfo, 16 ) \ - SYSCALL_ENTRY( 0x0166, NtUserSetShellWindowEx, 8 ) \ - SYSCALL_ENTRY( 0x0167, NtUserSetSysColors, 12 ) \ - SYSCALL_ENTRY( 0x0168, NtUserSetSystemMenu, 8 ) \ - SYSCALL_ENTRY( 0x0169, NtUserSetSystemTimer, 12 ) \ - SYSCALL_ENTRY( 0x016a, NtUserSetThreadDesktop, 4 ) \ - SYSCALL_ENTRY( 0x016b, NtUserSetTimer, 20 ) \ - SYSCALL_ENTRY( 0x016c, NtUserSetWinEventHook, 32 ) \ - SYSCALL_ENTRY( 0x016d, NtUserSetWindowLong, 16 ) \ - SYSCALL_ENTRY( 0x016e, NtUserSetWindowLongPtr, 16 ) \ - SYSCALL_ENTRY( 0x016f, NtUserSetWindowPlacement, 8 ) \ - SYSCALL_ENTRY( 0x0170, NtUserSetWindowPos, 28 ) \ - SYSCALL_ENTRY( 0x0171, NtUserSetWindowRgn, 12 ) \ - SYSCALL_ENTRY( 0x0172, NtUserSetWindowWord, 12 ) \ - SYSCALL_ENTRY( 0x0173, NtUserSetWindowsHookEx, 24 ) \ - SYSCALL_ENTRY( 0x0174, NtUserShowCaret, 4 ) \ - SYSCALL_ENTRY( 0x0175, NtUserShowCursor, 4 ) \ - SYSCALL_ENTRY( 0x0176, NtUserShowScrollBar, 12 ) \ - SYSCALL_ENTRY( 0x0177, NtUserShowWindow, 8 ) \ - SYSCALL_ENTRY( 0x0178, NtUserShowWindowAsync, 8 ) \ - SYSCALL_ENTRY( 0x0179, NtUserSystemParametersInfo, 16 ) \ - SYSCALL_ENTRY( 0x017a, NtUserSystemParametersInfoForDpi, 20 ) \ - SYSCALL_ENTRY( 0x017b, NtUserThunkedMenuInfo, 8 ) \ - SYSCALL_ENTRY( 0x017c, NtUserThunkedMenuItemInfo, 24 ) \ - SYSCALL_ENTRY( 0x017d, NtUserToUnicodeEx, 28 ) \ - SYSCALL_ENTRY( 0x017e, NtUserTrackMouseEvent, 4 ) \ - SYSCALL_ENTRY( 0x017f, NtUserTrackPopupMenuEx, 24 ) \ - SYSCALL_ENTRY( 0x0180, NtUserTranslateAccelerator, 12 ) \ - SYSCALL_ENTRY( 0x0181, NtUserTranslateMessage, 8 ) \ - SYSCALL_ENTRY( 0x0182, NtUserUnhookWinEvent, 4 ) \ - SYSCALL_ENTRY( 0x0183, NtUserUnhookWindowsHookEx, 4 ) \ - SYSCALL_ENTRY( 0x0184, NtUserUnregisterClass, 12 ) \ - SYSCALL_ENTRY( 0x0185, NtUserUnregisterHotKey, 8 ) \ - SYSCALL_ENTRY( 0x0186, NtUserUpdateInputContext, 12 ) \ - SYSCALL_ENTRY( 0x0187, NtUserUpdateLayeredWindow, 40 ) \ - SYSCALL_ENTRY( 0x0188, NtUserValidateRect, 8 ) \ - SYSCALL_ENTRY( 0x0189, NtUserVkKeyScanEx, 8 ) \ - SYSCALL_ENTRY( 0x018a, NtUserWaitForInputIdle, 12 ) \ - SYSCALL_ENTRY( 0x018b, NtUserWaitMessage, 0 ) \ - SYSCALL_ENTRY( 0x018c, NtUserWindowFromDC, 4 ) \ - SYSCALL_ENTRY( 0x018d, NtUserWindowFromPoint, 8 ) \ - SYSCALL_ENTRY( 0x018e, __wine_get_file_outline_text_metric, 16 ) \ - SYSCALL_ENTRY( 0x018f, __wine_get_icm_profile, 16 ) \ - SYSCALL_ENTRY( 0x0190, __wine_send_input, 12 ) - -#define ALL_SYSCALLS64 \ - SYSCALL_ENTRY( 0x0000, NtGdiAbortDoc, 8 ) \ - SYSCALL_ENTRY( 0x0001, NtGdiAbortPath, 8 ) \ - SYSCALL_ENTRY( 0x0002, NtGdiAddFontMemResourceEx, 40 ) \ - SYSCALL_ENTRY( 0x0003, NtGdiAddFontResourceW, 48 ) \ - SYSCALL_ENTRY( 0x0004, NtGdiAlphaBlend, 96 ) \ - SYSCALL_ENTRY( 0x0005, NtGdiAngleArc, 48 ) \ - SYSCALL_ENTRY( 0x0006, NtGdiArcInternal, 80 ) \ - SYSCALL_ENTRY( 0x0007, NtGdiBeginPath, 8 ) \ - SYSCALL_ENTRY( 0x0008, NtGdiBitBlt, 88 ) \ - SYSCALL_ENTRY( 0x0009, NtGdiCloseFigure, 8 ) \ - SYSCALL_ENTRY( 0x000a, NtGdiCombineRgn, 32 ) \ - SYSCALL_ENTRY( 0x000b, NtGdiComputeXformCoefficients, 8 ) \ - SYSCALL_ENTRY( 0x000c, NtGdiCreateBitmap, 40 ) \ - SYSCALL_ENTRY( 0x000d, NtGdiCreateClientObj, 8 ) \ - SYSCALL_ENTRY( 0x000e, NtGdiCreateCompatibleBitmap, 24 ) \ - SYSCALL_ENTRY( 0x000f, NtGdiCreateCompatibleDC, 8 ) \ - SYSCALL_ENTRY( 0x0010, NtGdiCreateDIBBrush, 48 ) \ - SYSCALL_ENTRY( 0x0011, NtGdiCreateDIBSection, 72 ) \ - SYSCALL_ENTRY( 0x0012, NtGdiCreateDIBitmapInternal, 88 ) \ - SYSCALL_ENTRY( 0x0013, NtGdiCreateEllipticRgn, 32 ) \ - SYSCALL_ENTRY( 0x0014, NtGdiCreateHalftonePalette, 8 ) \ - SYSCALL_ENTRY( 0x0015, NtGdiCreateHatchBrushInternal, 24 ) \ - SYSCALL_ENTRY( 0x0016, NtGdiCreateMetafileDC, 8 ) \ - SYSCALL_ENTRY( 0x0017, NtGdiCreatePaletteInternal, 16 ) \ - SYSCALL_ENTRY( 0x0018, NtGdiCreatePatternBrushInternal, 24 ) \ - SYSCALL_ENTRY( 0x0019, NtGdiCreatePen, 32 ) \ - SYSCALL_ENTRY( 0x001a, NtGdiCreateRectRgn, 32 ) \ - SYSCALL_ENTRY( 0x001b, NtGdiCreateRoundRectRgn, 48 ) \ - SYSCALL_ENTRY( 0x001c, NtGdiCreateSolidBrush, 16 ) \ - SYSCALL_ENTRY( 0x001d, NtGdiDdDDICheckVidPnExclusiveOwnership, 8 ) \ - SYSCALL_ENTRY( 0x001e, NtGdiDdDDICloseAdapter, 8 ) \ - SYSCALL_ENTRY( 0x001f, NtGdiDdDDICreateDCFromMemory, 8 ) \ - SYSCALL_ENTRY( 0x0020, NtGdiDdDDICreateDevice, 8 ) \ - SYSCALL_ENTRY( 0x0021, NtGdiDdDDIDestroyDCFromMemory, 8 ) \ - SYSCALL_ENTRY( 0x0022, NtGdiDdDDIDestroyDevice, 8 ) \ - SYSCALL_ENTRY( 0x0023, NtGdiDdDDIEscape, 8 ) \ - SYSCALL_ENTRY( 0x0024, NtGdiDdDDIOpenAdapterFromDeviceName, 8 ) \ - SYSCALL_ENTRY( 0x0025, NtGdiDdDDIOpenAdapterFromHdc, 8 ) \ - SYSCALL_ENTRY( 0x0026, NtGdiDdDDIOpenAdapterFromLuid, 8 ) \ - SYSCALL_ENTRY( 0x0027, NtGdiDdDDIQueryAdapterInfo, 8 ) \ - SYSCALL_ENTRY( 0x0028, NtGdiDdDDIQueryStatistics, 8 ) \ - SYSCALL_ENTRY( 0x0029, NtGdiDdDDIQueryVideoMemoryInfo, 8 ) \ - SYSCALL_ENTRY( 0x002a, NtGdiDdDDISetQueuedLimit, 8 ) \ - SYSCALL_ENTRY( 0x002b, NtGdiDdDDISetVidPnSourceOwner, 8 ) \ - SYSCALL_ENTRY( 0x002c, NtGdiDeleteClientObj, 8 ) \ - SYSCALL_ENTRY( 0x002d, NtGdiDeleteObjectApp, 8 ) \ - SYSCALL_ENTRY( 0x002e, NtGdiDescribePixelFormat, 32 ) \ - SYSCALL_ENTRY( 0x002f, NtGdiDoPalette, 48 ) \ - SYSCALL_ENTRY( 0x0030, NtGdiDrawStream, 24 ) \ - SYSCALL_ENTRY( 0x0031, NtGdiEllipse, 40 ) \ - SYSCALL_ENTRY( 0x0032, NtGdiEndDoc, 8 ) \ - SYSCALL_ENTRY( 0x0033, NtGdiEndPage, 8 ) \ - SYSCALL_ENTRY( 0x0034, NtGdiEndPath, 8 ) \ - SYSCALL_ENTRY( 0x0035, NtGdiEnumFonts, 64 ) \ - SYSCALL_ENTRY( 0x0036, NtGdiEqualRgn, 16 ) \ - SYSCALL_ENTRY( 0x0037, NtGdiExcludeClipRect, 40 ) \ - SYSCALL_ENTRY( 0x0038, NtGdiExtCreatePen, 88 ) \ - SYSCALL_ENTRY( 0x0039, NtGdiExtCreateRegion, 24 ) \ - SYSCALL_ENTRY( 0x003a, NtGdiExtEscape, 64 ) \ - SYSCALL_ENTRY( 0x003b, NtGdiExtFloodFill, 40 ) \ - SYSCALL_ENTRY( 0x003c, NtGdiExtGetObjectW, 24 ) \ - SYSCALL_ENTRY( 0x003d, NtGdiExtSelectClipRgn, 24 ) \ - SYSCALL_ENTRY( 0x003e, NtGdiExtTextOutW, 72 ) \ - SYSCALL_ENTRY( 0x003f, NtGdiFillPath, 8 ) \ - SYSCALL_ENTRY( 0x0040, NtGdiFillRgn, 24 ) \ - SYSCALL_ENTRY( 0x0041, NtGdiFlattenPath, 8 ) \ - SYSCALL_ENTRY( 0x0042, NtGdiFlush, 0 ) \ - SYSCALL_ENTRY( 0x0043, NtGdiFontIsLinked, 8 ) \ - SYSCALL_ENTRY( 0x0044, NtGdiFrameRgn, 40 ) \ - SYSCALL_ENTRY( 0x0045, NtGdiGetAndSetDCDword, 32 ) \ - SYSCALL_ENTRY( 0x0046, NtGdiGetAppClipBox, 16 ) \ - SYSCALL_ENTRY( 0x0047, NtGdiGetBitmapBits, 24 ) \ - SYSCALL_ENTRY( 0x0048, NtGdiGetBitmapDimension, 16 ) \ - SYSCALL_ENTRY( 0x0049, NtGdiGetBoundsRect, 24 ) \ - SYSCALL_ENTRY( 0x004a, NtGdiGetCharABCWidthsW, 48 ) \ - SYSCALL_ENTRY( 0x004b, NtGdiGetCharWidthInfo, 16 ) \ - SYSCALL_ENTRY( 0x004c, NtGdiGetCharWidthW, 48 ) \ - SYSCALL_ENTRY( 0x004d, NtGdiGetColorAdjustment, 16 ) \ - SYSCALL_ENTRY( 0x004e, NtGdiGetDCDword, 24 ) \ - SYSCALL_ENTRY( 0x004f, NtGdiGetDCObject, 16 ) \ - SYSCALL_ENTRY( 0x0050, NtGdiGetDCPoint, 24 ) \ - SYSCALL_ENTRY( 0x0051, NtGdiGetDIBitsInternal, 72 ) \ - SYSCALL_ENTRY( 0x0052, NtGdiGetDeviceCaps, 16 ) \ - SYSCALL_ENTRY( 0x0053, NtGdiGetDeviceGammaRamp, 16 ) \ - SYSCALL_ENTRY( 0x0054, NtGdiGetFontData, 40 ) \ - SYSCALL_ENTRY( 0x0055, NtGdiGetFontFileData, 40 ) \ - SYSCALL_ENTRY( 0x0056, NtGdiGetFontFileInfo, 40 ) \ - SYSCALL_ENTRY( 0x0057, NtGdiGetFontUnicodeRanges, 16 ) \ - SYSCALL_ENTRY( 0x0058, NtGdiGetGlyphIndicesW, 40 ) \ - SYSCALL_ENTRY( 0x0059, NtGdiGetGlyphOutline, 64 ) \ - SYSCALL_ENTRY( 0x005a, NtGdiGetKerningPairs, 24 ) \ - SYSCALL_ENTRY( 0x005b, NtGdiGetNearestColor, 16 ) \ - SYSCALL_ENTRY( 0x005c, NtGdiGetNearestPaletteIndex, 16 ) \ - SYSCALL_ENTRY( 0x005d, NtGdiGetOutlineTextMetricsInternalW, 32 ) \ - SYSCALL_ENTRY( 0x005e, NtGdiGetPath, 32 ) \ - SYSCALL_ENTRY( 0x005f, NtGdiGetPixel, 24 ) \ - SYSCALL_ENTRY( 0x0060, NtGdiGetRandomRgn, 24 ) \ - SYSCALL_ENTRY( 0x0061, NtGdiGetRasterizerCaps, 16 ) \ - SYSCALL_ENTRY( 0x0062, NtGdiGetRealizationInfo, 16 ) \ - SYSCALL_ENTRY( 0x0063, NtGdiGetRegionData, 24 ) \ - SYSCALL_ENTRY( 0x0064, NtGdiGetRgnBox, 16 ) \ - SYSCALL_ENTRY( 0x0065, NtGdiGetSpoolMessage, 32 ) \ - SYSCALL_ENTRY( 0x0066, NtGdiGetSystemPaletteUse, 8 ) \ - SYSCALL_ENTRY( 0x0067, NtGdiGetTextCharsetInfo, 24 ) \ - SYSCALL_ENTRY( 0x0068, NtGdiGetTextExtentExW, 64 ) \ - SYSCALL_ENTRY( 0x0069, NtGdiGetTextFaceW, 32 ) \ - SYSCALL_ENTRY( 0x006a, NtGdiGetTextMetricsW, 24 ) \ - SYSCALL_ENTRY( 0x006b, NtGdiGetTransform, 24 ) \ - SYSCALL_ENTRY( 0x006c, NtGdiGradientFill, 48 ) \ - SYSCALL_ENTRY( 0x006d, NtGdiHfontCreate, 40 ) \ - SYSCALL_ENTRY( 0x006e, NtGdiIcmBrushInfo, 64 ) \ - SYSCALL_ENTRY( 0x006f, NtGdiInitSpool, 0 ) \ - SYSCALL_ENTRY( 0x0070, NtGdiIntersectClipRect, 40 ) \ - SYSCALL_ENTRY( 0x0071, NtGdiInvertRgn, 16 ) \ - SYSCALL_ENTRY( 0x0072, NtGdiLineTo, 24 ) \ - SYSCALL_ENTRY( 0x0073, NtGdiMaskBlt, 104 ) \ - SYSCALL_ENTRY( 0x0074, NtGdiModifyWorldTransform, 24 ) \ - SYSCALL_ENTRY( 0x0075, NtGdiMoveTo, 32 ) \ - SYSCALL_ENTRY( 0x0076, NtGdiOffsetClipRgn, 24 ) \ - SYSCALL_ENTRY( 0x0077, NtGdiOffsetRgn, 24 ) \ - SYSCALL_ENTRY( 0x0078, NtGdiOpenDCW, 64 ) \ - SYSCALL_ENTRY( 0x0079, NtGdiPatBlt, 48 ) \ - SYSCALL_ENTRY( 0x007a, NtGdiPathToRegion, 8 ) \ - SYSCALL_ENTRY( 0x007b, NtGdiPlgBlt, 88 ) \ - SYSCALL_ENTRY( 0x007c, NtGdiPolyDraw, 32 ) \ - SYSCALL_ENTRY( 0x007d, NtGdiPolyPolyDraw, 40 ) \ - SYSCALL_ENTRY( 0x007e, NtGdiPtInRegion, 24 ) \ - SYSCALL_ENTRY( 0x007f, NtGdiPtVisible, 24 ) \ - SYSCALL_ENTRY( 0x0080, NtGdiRectInRegion, 16 ) \ - SYSCALL_ENTRY( 0x0081, NtGdiRectVisible, 16 ) \ - SYSCALL_ENTRY( 0x0082, NtGdiRectangle, 40 ) \ - SYSCALL_ENTRY( 0x0083, NtGdiRemoveFontMemResourceEx, 8 ) \ - SYSCALL_ENTRY( 0x0084, NtGdiRemoveFontResourceW, 48 ) \ - SYSCALL_ENTRY( 0x0085, NtGdiResetDC, 40 ) \ - SYSCALL_ENTRY( 0x0086, NtGdiResizePalette, 16 ) \ - SYSCALL_ENTRY( 0x0087, NtGdiRestoreDC, 16 ) \ - SYSCALL_ENTRY( 0x0088, NtGdiRoundRect, 56 ) \ - SYSCALL_ENTRY( 0x0089, NtGdiSaveDC, 8 ) \ - SYSCALL_ENTRY( 0x008a, NtGdiScaleViewportExtEx, 48 ) \ - SYSCALL_ENTRY( 0x008b, NtGdiScaleWindowExtEx, 48 ) \ - SYSCALL_ENTRY( 0x008c, NtGdiSelectBitmap, 16 ) \ - SYSCALL_ENTRY( 0x008d, NtGdiSelectBrush, 16 ) \ - SYSCALL_ENTRY( 0x008e, NtGdiSelectClipPath, 16 ) \ - SYSCALL_ENTRY( 0x008f, NtGdiSelectFont, 16 ) \ - SYSCALL_ENTRY( 0x0090, NtGdiSelectPen, 16 ) \ - SYSCALL_ENTRY( 0x0091, NtGdiSetBitmapBits, 24 ) \ - SYSCALL_ENTRY( 0x0092, NtGdiSetBitmapDimension, 32 ) \ - SYSCALL_ENTRY( 0x0093, NtGdiSetBoundsRect, 24 ) \ - SYSCALL_ENTRY( 0x0094, NtGdiSetBrushOrg, 32 ) \ - SYSCALL_ENTRY( 0x0095, NtGdiSetColorAdjustment, 16 ) \ - SYSCALL_ENTRY( 0x0096, NtGdiSetDIBitsToDeviceInternal, 128 ) \ - SYSCALL_ENTRY( 0x0097, NtGdiSetDeviceGammaRamp, 16 ) \ - SYSCALL_ENTRY( 0x0098, NtGdiSetLayout, 24 ) \ - SYSCALL_ENTRY( 0x0099, NtGdiSetMagicColors, 24 ) \ - SYSCALL_ENTRY( 0x009a, NtGdiSetMetaRgn, 8 ) \ - SYSCALL_ENTRY( 0x009b, NtGdiSetPixel, 32 ) \ - SYSCALL_ENTRY( 0x009c, NtGdiSetPixelFormat, 16 ) \ - SYSCALL_ENTRY( 0x009d, NtGdiSetRectRgn, 40 ) \ - SYSCALL_ENTRY( 0x009e, NtGdiSetSystemPaletteUse, 16 ) \ - SYSCALL_ENTRY( 0x009f, NtGdiSetTextJustification, 24 ) \ - SYSCALL_ENTRY( 0x00a0, NtGdiSetVirtualResolution, 40 ) \ - SYSCALL_ENTRY( 0x00a1, NtGdiStartDoc, 32 ) \ - SYSCALL_ENTRY( 0x00a2, NtGdiStartPage, 8 ) \ - SYSCALL_ENTRY( 0x00a3, NtGdiStretchBlt, 96 ) \ - SYSCALL_ENTRY( 0x00a4, NtGdiStretchDIBitsInternal, 128 ) \ - SYSCALL_ENTRY( 0x00a5, NtGdiStrokeAndFillPath, 8 ) \ - SYSCALL_ENTRY( 0x00a6, NtGdiStrokePath, 8 ) \ - SYSCALL_ENTRY( 0x00a7, NtGdiSwapBuffers, 8 ) \ - SYSCALL_ENTRY( 0x00a8, NtGdiTransformPoints, 40 ) \ - SYSCALL_ENTRY( 0x00a9, NtGdiTransparentBlt, 88 ) \ - SYSCALL_ENTRY( 0x00aa, NtGdiUnrealizeObject, 8 ) \ - SYSCALL_ENTRY( 0x00ab, NtGdiUpdateColors, 8 ) \ - SYSCALL_ENTRY( 0x00ac, NtGdiWidenPath, 8 ) \ - SYSCALL_ENTRY( 0x00ad, NtUserActivateKeyboardLayout, 16 ) \ - SYSCALL_ENTRY( 0x00ae, NtUserAddClipboardFormatListener, 8 ) \ - SYSCALL_ENTRY( 0x00af, NtUserAssociateInputContext, 24 ) \ - SYSCALL_ENTRY( 0x00b0, NtUserAttachThreadInput, 24 ) \ - SYSCALL_ENTRY( 0x00b1, NtUserBeginPaint, 16 ) \ - SYSCALL_ENTRY( 0x00b2, NtUserBuildHimcList, 32 ) \ - SYSCALL_ENTRY( 0x00b3, NtUserBuildHwndList, 64 ) \ - SYSCALL_ENTRY( 0x00b4, NtUserCallHwnd, 16 ) \ - SYSCALL_ENTRY( 0x00b5, NtUserCallHwndParam, 24 ) \ - SYSCALL_ENTRY( 0x00b6, NtUserCallMsgFilter, 16 ) \ - SYSCALL_ENTRY( 0x00b7, NtUserCallNextHookEx, 32 ) \ - SYSCALL_ENTRY( 0x00b8, NtUserCallNoParam, 8 ) \ - SYSCALL_ENTRY( 0x00b9, NtUserCallOneParam, 16 ) \ - SYSCALL_ENTRY( 0x00ba, NtUserCallTwoParam, 24 ) \ - SYSCALL_ENTRY( 0x00bb, NtUserChangeClipboardChain, 16 ) \ - SYSCALL_ENTRY( 0x00bc, NtUserChangeDisplaySettings, 40 ) \ - SYSCALL_ENTRY( 0x00bd, NtUserCheckMenuItem, 24 ) \ - SYSCALL_ENTRY( 0x00be, NtUserChildWindowFromPointEx, 32 ) \ - SYSCALL_ENTRY( 0x00bf, NtUserClipCursor, 8 ) \ - SYSCALL_ENTRY( 0x00c0, NtUserCloseClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00c1, NtUserCloseDesktop, 8 ) \ - SYSCALL_ENTRY( 0x00c2, NtUserCloseWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x00c3, NtUserCopyAcceleratorTable, 24 ) \ - SYSCALL_ENTRY( 0x00c4, NtUserCountClipboardFormats, 0 ) \ - SYSCALL_ENTRY( 0x00c5, NtUserCreateAcceleratorTable, 16 ) \ - SYSCALL_ENTRY( 0x00c6, NtUserCreateCaret, 32 ) \ - SYSCALL_ENTRY( 0x00c7, NtUserCreateDesktopEx, 48 ) \ - SYSCALL_ENTRY( 0x00c8, NtUserCreateInputContext, 8 ) \ - SYSCALL_ENTRY( 0x00c9, NtUserCreateWindowEx, 136 ) \ - SYSCALL_ENTRY( 0x00ca, NtUserCreateWindowStation, 56 ) \ - SYSCALL_ENTRY( 0x00cb, NtUserDeferWindowPosAndBand, 80 ) \ - SYSCALL_ENTRY( 0x00cc, NtUserDeleteMenu, 24 ) \ - SYSCALL_ENTRY( 0x00cd, NtUserDestroyAcceleratorTable, 8 ) \ - SYSCALL_ENTRY( 0x00ce, NtUserDestroyCursor, 16 ) \ - SYSCALL_ENTRY( 0x00cf, NtUserDestroyInputContext, 8 ) \ - SYSCALL_ENTRY( 0x00d0, NtUserDestroyMenu, 8 ) \ - SYSCALL_ENTRY( 0x00d1, NtUserDestroyWindow, 8 ) \ - SYSCALL_ENTRY( 0x00d2, NtUserDisableThreadIme, 8 ) \ - SYSCALL_ENTRY( 0x00d3, NtUserDispatchMessage, 8 ) \ - SYSCALL_ENTRY( 0x00d4, NtUserDisplayConfigGetDeviceInfo, 8 ) \ - SYSCALL_ENTRY( 0x00d5, NtUserDragDetect, 24 ) \ - SYSCALL_ENTRY( 0x00d6, NtUserDragObject, 40 ) \ - SYSCALL_ENTRY( 0x00d7, NtUserDrawCaptionTemp, 56 ) \ - SYSCALL_ENTRY( 0x00d8, NtUserDrawIconEx, 72 ) \ - SYSCALL_ENTRY( 0x00d9, NtUserDrawMenuBarTemp, 40 ) \ - SYSCALL_ENTRY( 0x00da, NtUserEmptyClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00db, NtUserEnableMenuItem, 24 ) \ - SYSCALL_ENTRY( 0x00dc, NtUserEnableMouseInPointer, 8 ) \ - SYSCALL_ENTRY( 0x00dd, NtUserEnableScrollBar, 24 ) \ - SYSCALL_ENTRY( 0x00de, NtUserEndDeferWindowPosEx, 16 ) \ - SYSCALL_ENTRY( 0x00df, NtUserEndMenu, 0 ) \ - SYSCALL_ENTRY( 0x00e0, NtUserEndPaint, 16 ) \ - SYSCALL_ENTRY( 0x00e1, NtUserEnumDisplayDevices, 32 ) \ - SYSCALL_ENTRY( 0x00e2, NtUserEnumDisplayMonitors, 32 ) \ - SYSCALL_ENTRY( 0x00e3, NtUserEnumDisplaySettings, 32 ) \ - SYSCALL_ENTRY( 0x00e4, NtUserExcludeUpdateRgn, 16 ) \ - SYSCALL_ENTRY( 0x00e5, NtUserFindExistingCursorIcon, 24 ) \ - SYSCALL_ENTRY( 0x00e6, NtUserFindWindowEx, 40 ) \ - SYSCALL_ENTRY( 0x00e7, NtUserFlashWindowEx, 8 ) \ - SYSCALL_ENTRY( 0x00e8, NtUserGetAncestor, 16 ) \ - SYSCALL_ENTRY( 0x00e9, NtUserGetAsyncKeyState, 8 ) \ - SYSCALL_ENTRY( 0x00ea, NtUserGetAtomName, 16 ) \ - SYSCALL_ENTRY( 0x00eb, NtUserGetCaretBlinkTime, 0 ) \ - SYSCALL_ENTRY( 0x00ec, NtUserGetCaretPos, 8 ) \ - SYSCALL_ENTRY( 0x00ed, NtUserGetClassInfoEx, 40 ) \ - SYSCALL_ENTRY( 0x00ee, NtUserGetClassName, 24 ) \ - SYSCALL_ENTRY( 0x00ef, NtUserGetClipboardData, 16 ) \ - SYSCALL_ENTRY( 0x00f0, NtUserGetClipboardFormatName, 24 ) \ - SYSCALL_ENTRY( 0x00f1, NtUserGetClipboardOwner, 0 ) \ - SYSCALL_ENTRY( 0x00f2, NtUserGetClipboardSequenceNumber, 0 ) \ - SYSCALL_ENTRY( 0x00f3, NtUserGetClipboardViewer, 0 ) \ - SYSCALL_ENTRY( 0x00f4, NtUserGetCursor, 0 ) \ - SYSCALL_ENTRY( 0x00f5, NtUserGetCursorFrameInfo, 32 ) \ - SYSCALL_ENTRY( 0x00f6, NtUserGetCursorInfo, 8 ) \ - SYSCALL_ENTRY( 0x00f7, NtUserGetDC, 8 ) \ - SYSCALL_ENTRY( 0x00f8, NtUserGetDCEx, 24 ) \ - SYSCALL_ENTRY( 0x00f9, NtUserGetDisplayConfigBufferSizes, 24 ) \ - SYSCALL_ENTRY( 0x00fa, NtUserGetDoubleClickTime, 0 ) \ - SYSCALL_ENTRY( 0x00fb, NtUserGetDpiForMonitor, 32 ) \ - SYSCALL_ENTRY( 0x00fc, NtUserGetForegroundWindow, 0 ) \ - SYSCALL_ENTRY( 0x00fd, NtUserGetGUIThreadInfo, 16 ) \ - SYSCALL_ENTRY( 0x00fe, NtUserGetIconInfo, 48 ) \ - SYSCALL_ENTRY( 0x00ff, NtUserGetIconSize, 32 ) \ - SYSCALL_ENTRY( 0x0100, NtUserGetInternalWindowPos, 24 ) \ - SYSCALL_ENTRY( 0x0101, NtUserGetKeyNameText, 24 ) \ - SYSCALL_ENTRY( 0x0102, NtUserGetKeyState, 8 ) \ - SYSCALL_ENTRY( 0x0103, NtUserGetKeyboardLayout, 8 ) \ - SYSCALL_ENTRY( 0x0104, NtUserGetKeyboardLayoutList, 16 ) \ - SYSCALL_ENTRY( 0x0105, NtUserGetKeyboardLayoutName, 8 ) \ - SYSCALL_ENTRY( 0x0106, NtUserGetKeyboardState, 8 ) \ - SYSCALL_ENTRY( 0x0107, NtUserGetLayeredWindowAttributes, 32 ) \ - SYSCALL_ENTRY( 0x0108, NtUserGetMenuBarInfo, 32 ) \ - SYSCALL_ENTRY( 0x0109, NtUserGetMenuItemRect, 32 ) \ - SYSCALL_ENTRY( 0x010a, NtUserGetMessage, 32 ) \ - SYSCALL_ENTRY( 0x010b, NtUserGetMouseMovePointsEx, 40 ) \ - SYSCALL_ENTRY( 0x010c, NtUserGetObjectInformation, 40 ) \ - SYSCALL_ENTRY( 0x010d, NtUserGetOpenClipboardWindow, 0 ) \ - SYSCALL_ENTRY( 0x010e, NtUserGetPointerInfoList, 64 ) \ - SYSCALL_ENTRY( 0x010f, NtUserGetPriorityClipboardFormat, 16 ) \ - SYSCALL_ENTRY( 0x0110, NtUserGetProcessDpiAwarenessContext, 8 ) \ - SYSCALL_ENTRY( 0x0111, NtUserGetProcessWindowStation, 0 ) \ - SYSCALL_ENTRY( 0x0112, NtUserGetProp, 16 ) \ - SYSCALL_ENTRY( 0x0113, NtUserGetQueueStatus, 8 ) \ - SYSCALL_ENTRY( 0x0114, NtUserGetRawInputBuffer, 24 ) \ - SYSCALL_ENTRY( 0x0115, NtUserGetRawInputData, 40 ) \ - SYSCALL_ENTRY( 0x0116, NtUserGetRawInputDeviceInfo, 32 ) \ - SYSCALL_ENTRY( 0x0117, NtUserGetRawInputDeviceList, 24 ) \ - SYSCALL_ENTRY( 0x0118, NtUserGetRegisteredRawInputDevices, 24 ) \ - SYSCALL_ENTRY( 0x0119, NtUserGetScrollBarInfo, 24 ) \ - SYSCALL_ENTRY( 0x011a, NtUserGetSystemDpiForProcess, 8 ) \ - SYSCALL_ENTRY( 0x011b, NtUserGetSystemMenu, 16 ) \ - SYSCALL_ENTRY( 0x011c, NtUserGetThreadDesktop, 8 ) \ - SYSCALL_ENTRY( 0x011d, NtUserGetTitleBarInfo, 16 ) \ - SYSCALL_ENTRY( 0x011e, NtUserGetUpdateRect, 24 ) \ - SYSCALL_ENTRY( 0x011f, NtUserGetUpdateRgn, 24 ) \ - SYSCALL_ENTRY( 0x0120, NtUserGetUpdatedClipboardFormats, 24 ) \ - SYSCALL_ENTRY( 0x0121, NtUserGetWindowDC, 8 ) \ - SYSCALL_ENTRY( 0x0122, NtUserGetWindowPlacement, 16 ) \ - SYSCALL_ENTRY( 0x0123, NtUserGetWindowRgnEx, 24 ) \ - SYSCALL_ENTRY( 0x0124, NtUserHideCaret, 8 ) \ - SYSCALL_ENTRY( 0x0125, NtUserHiliteMenuItem, 32 ) \ - SYSCALL_ENTRY( 0x0126, NtUserInitializeClientPfnArrays, 32 ) \ - SYSCALL_ENTRY( 0x0127, NtUserInternalGetWindowIcon, 16 ) \ - SYSCALL_ENTRY( 0x0128, NtUserInternalGetWindowText, 24 ) \ - SYSCALL_ENTRY( 0x0129, NtUserInvalidateRect, 24 ) \ - SYSCALL_ENTRY( 0x012a, NtUserInvalidateRgn, 24 ) \ - SYSCALL_ENTRY( 0x012b, NtUserIsClipboardFormatAvailable, 8 ) \ - SYSCALL_ENTRY( 0x012c, NtUserIsMouseInPointerEnabled, 0 ) \ - SYSCALL_ENTRY( 0x012d, NtUserKillTimer, 16 ) \ - SYSCALL_ENTRY( 0x012e, NtUserLockWindowUpdate, 8 ) \ - SYSCALL_ENTRY( 0x012f, NtUserLogicalToPerMonitorDPIPhysicalPoint, 16 ) \ - SYSCALL_ENTRY( 0x0130, NtUserMapVirtualKeyEx, 24 ) \ - SYSCALL_ENTRY( 0x0131, NtUserMenuItemFromPoint, 32 ) \ - SYSCALL_ENTRY( 0x0132, NtUserMessageCall, 56 ) \ - SYSCALL_ENTRY( 0x0133, NtUserMoveWindow, 48 ) \ - SYSCALL_ENTRY( 0x0134, NtUserMsgWaitForMultipleObjectsEx, 40 ) \ - SYSCALL_ENTRY( 0x0135, NtUserNotifyIMEStatus, 16 ) \ - SYSCALL_ENTRY( 0x0136, NtUserNotifyWinEvent, 32 ) \ - SYSCALL_ENTRY( 0x0137, NtUserOpenClipboard, 16 ) \ - SYSCALL_ENTRY( 0x0138, NtUserOpenDesktop, 24 ) \ - SYSCALL_ENTRY( 0x0139, NtUserOpenInputDesktop, 24 ) \ - SYSCALL_ENTRY( 0x013a, NtUserOpenWindowStation, 16 ) \ - SYSCALL_ENTRY( 0x013b, NtUserPeekMessage, 40 ) \ - SYSCALL_ENTRY( 0x013c, NtUserPerMonitorDPIPhysicalToLogicalPoint, 16 ) \ - SYSCALL_ENTRY( 0x013d, NtUserPostMessage, 32 ) \ - SYSCALL_ENTRY( 0x013e, NtUserPostThreadMessage, 32 ) \ - SYSCALL_ENTRY( 0x013f, NtUserPrintWindow, 24 ) \ - SYSCALL_ENTRY( 0x0140, NtUserQueryDisplayConfig, 48 ) \ - SYSCALL_ENTRY( 0x0141, NtUserQueryInputContext, 16 ) \ - SYSCALL_ENTRY( 0x0142, NtUserRealChildWindowFromPoint, 24 ) \ - SYSCALL_ENTRY( 0x0143, NtUserRedrawWindow, 32 ) \ - SYSCALL_ENTRY( 0x0144, NtUserRegisterClassExWOW, 56 ) \ - SYSCALL_ENTRY( 0x0145, NtUserRegisterHotKey, 32 ) \ - SYSCALL_ENTRY( 0x0146, NtUserRegisterRawInputDevices, 24 ) \ - SYSCALL_ENTRY( 0x0147, NtUserReleaseDC, 16 ) \ - SYSCALL_ENTRY( 0x0148, NtUserRemoveClipboardFormatListener, 8 ) \ - SYSCALL_ENTRY( 0x0149, NtUserRemoveMenu, 24 ) \ - SYSCALL_ENTRY( 0x014a, NtUserRemoveProp, 16 ) \ - SYSCALL_ENTRY( 0x014b, NtUserScrollDC, 56 ) \ - SYSCALL_ENTRY( 0x014c, NtUserScrollWindowEx, 64 ) \ - SYSCALL_ENTRY( 0x014d, NtUserSelectPalette, 24 ) \ - SYSCALL_ENTRY( 0x014e, NtUserSendInput, 24 ) \ - SYSCALL_ENTRY( 0x014f, NtUserSetActiveWindow, 8 ) \ - SYSCALL_ENTRY( 0x0150, NtUserSetCapture, 8 ) \ - SYSCALL_ENTRY( 0x0151, NtUserSetClassLong, 32 ) \ - SYSCALL_ENTRY( 0x0152, NtUserSetClassLongPtr, 32 ) \ - SYSCALL_ENTRY( 0x0153, NtUserSetClassWord, 24 ) \ - SYSCALL_ENTRY( 0x0154, NtUserSetClipboardData, 24 ) \ - SYSCALL_ENTRY( 0x0155, NtUserSetClipboardViewer, 8 ) \ - SYSCALL_ENTRY( 0x0156, NtUserSetCursor, 8 ) \ - SYSCALL_ENTRY( 0x0157, NtUserSetCursorIconData, 32 ) \ - SYSCALL_ENTRY( 0x0158, NtUserSetCursorPos, 16 ) \ - SYSCALL_ENTRY( 0x0159, NtUserSetFocus, 8 ) \ - SYSCALL_ENTRY( 0x015a, NtUserSetInternalWindowPos, 32 ) \ - SYSCALL_ENTRY( 0x015b, NtUserSetKeyboardState, 8 ) \ - SYSCALL_ENTRY( 0x015c, NtUserSetLayeredWindowAttributes, 32 ) \ - SYSCALL_ENTRY( 0x015d, NtUserSetMenu, 16 ) \ - SYSCALL_ENTRY( 0x015e, NtUserSetMenuContextHelpId, 16 ) \ - SYSCALL_ENTRY( 0x015f, NtUserSetMenuDefaultItem, 24 ) \ - SYSCALL_ENTRY( 0x0160, NtUserSetObjectInformation, 32 ) \ - SYSCALL_ENTRY( 0x0161, NtUserSetParent, 16 ) \ - SYSCALL_ENTRY( 0x0162, NtUserSetProcessDpiAwarenessContext, 16 ) \ - SYSCALL_ENTRY( 0x0163, NtUserSetProcessWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x0164, NtUserSetProp, 24 ) \ - SYSCALL_ENTRY( 0x0165, NtUserSetScrollInfo, 32 ) \ - SYSCALL_ENTRY( 0x0166, NtUserSetShellWindowEx, 16 ) \ - SYSCALL_ENTRY( 0x0167, NtUserSetSysColors, 24 ) \ - SYSCALL_ENTRY( 0x0168, NtUserSetSystemMenu, 16 ) \ - SYSCALL_ENTRY( 0x0169, NtUserSetSystemTimer, 24 ) \ - SYSCALL_ENTRY( 0x016a, NtUserSetThreadDesktop, 8 ) \ - SYSCALL_ENTRY( 0x016b, NtUserSetTimer, 40 ) \ - SYSCALL_ENTRY( 0x016c, NtUserSetWinEventHook, 64 ) \ - SYSCALL_ENTRY( 0x016d, NtUserSetWindowLong, 32 ) \ - SYSCALL_ENTRY( 0x016e, NtUserSetWindowLongPtr, 32 ) \ - SYSCALL_ENTRY( 0x016f, NtUserSetWindowPlacement, 16 ) \ - SYSCALL_ENTRY( 0x0170, NtUserSetWindowPos, 56 ) \ - SYSCALL_ENTRY( 0x0171, NtUserSetWindowRgn, 24 ) \ - SYSCALL_ENTRY( 0x0172, NtUserSetWindowWord, 24 ) \ - SYSCALL_ENTRY( 0x0173, NtUserSetWindowsHookEx, 48 ) \ - SYSCALL_ENTRY( 0x0174, NtUserShowCaret, 8 ) \ - SYSCALL_ENTRY( 0x0175, NtUserShowCursor, 8 ) \ - SYSCALL_ENTRY( 0x0176, NtUserShowScrollBar, 24 ) \ - SYSCALL_ENTRY( 0x0177, NtUserShowWindow, 16 ) \ - SYSCALL_ENTRY( 0x0178, NtUserShowWindowAsync, 16 ) \ - SYSCALL_ENTRY( 0x0179, NtUserSystemParametersInfo, 32 ) \ - SYSCALL_ENTRY( 0x017a, NtUserSystemParametersInfoForDpi, 40 ) \ - SYSCALL_ENTRY( 0x017b, NtUserThunkedMenuInfo, 16 ) \ - SYSCALL_ENTRY( 0x017c, NtUserThunkedMenuItemInfo, 48 ) \ - SYSCALL_ENTRY( 0x017d, NtUserToUnicodeEx, 56 ) \ - SYSCALL_ENTRY( 0x017e, NtUserTrackMouseEvent, 8 ) \ - SYSCALL_ENTRY( 0x017f, NtUserTrackPopupMenuEx, 48 ) \ - SYSCALL_ENTRY( 0x0180, NtUserTranslateAccelerator, 24 ) \ - SYSCALL_ENTRY( 0x0181, NtUserTranslateMessage, 16 ) \ - SYSCALL_ENTRY( 0x0182, NtUserUnhookWinEvent, 8 ) \ - SYSCALL_ENTRY( 0x0183, NtUserUnhookWindowsHookEx, 8 ) \ - SYSCALL_ENTRY( 0x0184, NtUserUnregisterClass, 24 ) \ - SYSCALL_ENTRY( 0x0185, NtUserUnregisterHotKey, 16 ) \ - SYSCALL_ENTRY( 0x0186, NtUserUpdateInputContext, 24 ) \ - SYSCALL_ENTRY( 0x0187, NtUserUpdateLayeredWindow, 80 ) \ - SYSCALL_ENTRY( 0x0188, NtUserValidateRect, 16 ) \ - SYSCALL_ENTRY( 0x0189, NtUserVkKeyScanEx, 16 ) \ - SYSCALL_ENTRY( 0x018a, NtUserWaitForInputIdle, 24 ) \ - SYSCALL_ENTRY( 0x018b, NtUserWaitMessage, 0 ) \ - SYSCALL_ENTRY( 0x018c, NtUserWindowFromDC, 8 ) \ - SYSCALL_ENTRY( 0x018d, NtUserWindowFromPoint, 16 ) \ - SYSCALL_ENTRY( 0x018e, __wine_get_file_outline_text_metric, 32 ) \ - SYSCALL_ENTRY( 0x018f, __wine_get_icm_profile, 32 ) \ - SYSCALL_ENTRY( 0x0190, __wine_send_input, 24 ) diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 24dccb6ec1d..e5586fd67a6 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -999,7 +999,7 @@ @ stub NtUserGetThreadState @ stdcall -syscall NtUserGetTitleBarInfo(long ptr) @ stub NtUserGetTopLevelWindow -@ stub NtUserGetTouchInputInfo +@ stdcall -syscall NtUserGetTouchInputInfo(ptr long ptr long) @ stub NtUserGetTouchValidationStatus @ stub NtUserGetUniformSpaceMapping @ stdcall -syscall NtUserGetUpdateRect(long ptr long) @@ -1056,7 +1056,7 @@ @ stub NtUserIsNonClientDpiScalingEnabled @ stub NtUserIsResizeLayoutSynchronizationEnabled @ stub NtUserIsTopLevelWindow -@ stub NtUserIsTouchWindow +@ stdcall -syscall NtUserIsTouchWindow(long ptr) @ stub NtUserIsWindowBroadcastingDpiToChildren @ stub NtUserIsWindowGDIScaledDpiMessageEnabled @ stdcall -syscall NtUserKillTimer(long long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index b08c0ceb716..dc65ca858cb 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -89,10 +89,10 @@ extern BOOL register_imm_window( HWND hwnd ); extern void unregister_imm_window( HWND hwnd ); /* input.c */ +extern BOOL enable_mouse_in_pointer; extern BOOL grab_pointer; extern BOOL grab_fullscreen; extern BOOL destroy_caret(void); -extern LONG global_key_state_counter; extern HWND get_active_window(void); extern HWND get_capture(void); extern BOOL get_cursor_pos( POINT *pt ); @@ -108,6 +108,8 @@ extern void update_mouse_tracking_info( HWND hwnd ); extern BOOL get_clip_cursor( RECT *rect ); extern BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ); extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ); +extern BOOL register_touch_window( HWND hwnd, UINT flags ); +extern BOOL unregister_touch_window( HWND hwnd ); /* menu.c */ extern HMENU create_menu( BOOL is_popup ); @@ -151,6 +153,7 @@ extern BOOL rawinput_device_get_usages( HANDLE handle, USHORT *usage_page, USHOR /* scroll.c */ extern void draw_nc_scrollbar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical ); +extern BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ); extern BOOL get_scroll_info( HWND hwnd, INT bar, SCROLLINFO *info ); extern void handle_scroll_event( HWND hwnd, INT bar, UINT msg, POINT pt ); extern LRESULT scroll_bar_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, @@ -178,6 +181,7 @@ extern int get_system_metrics( int index ); extern UINT get_thread_dpi(void); extern DPI_AWARENESS get_thread_dpi_awareness(void); extern RECT get_virtual_screen_rect( UINT dpi ); +extern BOOL is_window_rect_full_screen( const RECT *rect ); extern BOOL is_exiting_thread( DWORD tid ); extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ); extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ); @@ -188,7 +192,7 @@ extern RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ); extern HMONITOR monitor_from_point( POINT pt, UINT flags, UINT dpi ); extern HMONITOR monitor_from_rect( const RECT *rect, UINT flags, UINT dpi ); extern HMONITOR monitor_from_window( HWND hwnd, UINT flags, UINT dpi ); -extern BOOL update_display_cache( BOOL force ); +extern BOOL update_display_cache( BOOL force, BOOL increment_serial ); extern void user_lock(void); extern void user_unlock(void); extern void user_check_not_lock(void); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 69dd8caba5d..2dcc3e20d3e 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -652,6 +652,38 @@ HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *class, DWO return NULL; } +static BOOL enum_window_children( HWND *list, WNDENUMPROC func, LPARAM lParam ) +{ + HWND *child_list; + BOOL ret = FALSE; + + for ( ; *list; list++) + { + if (!is_window( *list )) continue; + child_list = list_window_children( 0, *list, NULL, 0 ); + ret = func( *list, lParam ); + if (child_list) + { + if (ret) ret = enum_window_children( child_list, func, lParam ); + free( child_list ); + } + if (!ret) return FALSE; + } + + return TRUE; +} + +static BOOL enum_child_windows( HWND parent, WNDENUMPROC func, LPARAM lParam ) +{ + HWND *list; + BOOL ret; + + if (!(list = list_window_children( 0, parent, NULL, 0 ))) return FALSE; + ret = enum_window_children( list, func, lParam ); + free( list ); + return ret; +} + /***************************************************************** * NtUserGetAncestor (win32u.@) */ @@ -841,6 +873,7 @@ BOOL enable_window( HWND hwnd, BOOL enable ) send_message( hwnd, WM_ENABLE, FALSE, 0 ); } } + NtUserNotifyWinEvent( EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, 0 ); return ret; } @@ -1202,6 +1235,7 @@ static HWND set_window_owner( HWND hwnd, HWND owner ) /* Helper function for SetWindowLong(). */ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL ansi ) { + const char *sgi = getenv( "SteamGameId" ); BOOL ok, made_visible = FALSE; LONG_PTR retval = 0; STYLESTRUCT style; @@ -1257,6 +1291,10 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO if (win->dwStyle & WS_MINIMIZE) newval |= WS_MINIMIZE; break; case GWL_EXSTYLE: + /* FIXME: Layered windows don't work well right now, disable them */ + if (sgi && !strcmp( sgi, "694280" )) newval &= ~WS_EX_LAYERED; + if (sgi && !strcmp( sgi, "312670" )) newval &= ~WS_EX_LAYERED; + if (sgi && !strcmp( sgi, "700600" )) newval &= ~WS_EX_LAYERED; style.styleOld = win->dwExStyle; style.styleNew = newval; release_win_ptr( win ); @@ -3507,6 +3545,10 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) winpos->cy = new_window_rect.bottom - new_window_rect.top; send_message( winpos->hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)winpos ); } + + if ((winpos->flags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE)) + NtUserNotifyWinEvent( EVENT_OBJECT_LOCATIONCHANGE, winpos->hwnd, OBJID_WINDOW, 0 ); + ret = TRUE; done: SetThreadDpiAwarenessContext( context ); @@ -4548,7 +4590,7 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) release_win_ptr( win ); if (!info->dwFlags || info->dwFlags & FLASHW_CAPTION) - send_message( hwnd, WM_NCACTIVATE, wparam, 0 ); + send_notify_message( hwnd, WM_NCACTIVATE, wparam, 0, 0 ); user_driver->pFlashWindowEx( info ); return wparam; @@ -4651,6 +4693,7 @@ static void send_destroy_message( HWND hwnd ) if (hwnd == NtUserGetClipboardOwner()) release_clipboard_owner( hwnd ); send_message( hwnd, WM_DESTROY, 0, 0); + NtUserNotifyWinEvent( EVENT_OBJECT_DESTROY, hwnd, OBJID_WINDOW, 0 ); /* * This WM_DESTROY message can trigger re-entrant calls to DestroyWindow @@ -5252,8 +5295,18 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, if ((cs.style & WS_THICKFRAME) || !(cs.style & (WS_POPUP | WS_CHILD))) { MINMAXINFO info = get_min_max_info( hwnd ); - cx = max( min( cx, info.ptMaxTrackSize.x ), info.ptMinTrackSize.x ); - cy = max( min( cy, info.ptMaxTrackSize.y ), info.ptMinTrackSize.y ); + + /* HACK: This code changes the window's size to fit the display. However, + * some games (Bayonetta, Dragon's Dogma) will then have the incorrect + * render size. So just let windows be too big to fit the display. */ + if (__wine_get_window_manager() != WINE_WM_X11_STEAMCOMPMGR) + { + cx = min( cx, info.ptMaxTrackSize.x ); + cy = min( cy, info.ptMaxTrackSize.y ); + } + + cx = max( cx, info.ptMinTrackSize.x ); + cy = max( cy, info.ptMinTrackSize.y ); } if (cx < 0) cx = 0; @@ -5590,6 +5643,12 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_ShowOwnedPopups: return show_owned_popups( hwnd, param ); + case NtUserCallHwndParam_EnumChildWindows: + { + struct enum_child_windows_params *params = (void *)param; + return enum_child_windows( hwnd, params->proc, params->lparam ); + } + /* temporary exports */ case NtUserSetWindowStyle: { diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index b187b246941..fbede26d8a8 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -42,12 +42,17 @@ WINE_DECLARE_DEBUG_CHANNEL(win); BOOL is_virtual_desktop(void) { - HANDLE desktop = NtUserGetThreadDesktop( GetCurrentThreadId() ); - USEROBJECTFLAGS flags = {0}; - DWORD len; + const desktop_shm_t *desktop = get_desktop_shared_memory(); + unsigned int flags; - if (!NtUserGetObjectInformation( desktop, UOI_FLAGS, &flags, sizeof(flags), &len )) return FALSE; - return !!(flags.dwFlags & DF_WINE_CREATE_DESKTOP); + if (!desktop) return FALSE; + SHARED_READ_BEGIN( desktop, desktop_shm_t ) + { + flags = desktop->flags; + } + SHARED_READ_END + + return !!(flags & DF_WINE_CREATE_DESKTOP); } /*********************************************************************** @@ -184,7 +189,7 @@ HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *dev } /* force update display cache to use virtual desktop display settings */ - if (flags & DF_WINE_CREATE_DESKTOP) update_display_cache( TRUE ); + if (flags & DF_WINE_CREATE_DESKTOP) update_display_cache( TRUE, TRUE ); return ret; } @@ -260,11 +265,14 @@ BOOL WINAPI NtUserSetThreadDesktop( HDESK handle ) if (ret) /* reset the desktop windows */ { struct user_thread_info *thread_info = get_user_thread_info(); - struct user_key_state_info *key_state_info = thread_info->key_state; thread_info->client_info.top_window = 0; thread_info->client_info.msg_window = 0; - if (key_state_info) key_state_info->time = 0; - if (was_virtual_desktop != is_virtual_desktop()) update_display_cache( TRUE ); + if (was_virtual_desktop != is_virtual_desktop()) update_display_cache( TRUE, TRUE ); + if (thread_info->desktop_shm) + { + NtUnmapViewOfSection( GetCurrentProcess(), (void *)thread_info->desktop_shm ); + thread_info->desktop_shm = NULL; + } } return ret; } @@ -387,6 +395,8 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, } } +#define TICKSPERSEC 10000000 + /*********************************************************************** * NtUserSetObjectInformation (win32u.@) */ @@ -394,8 +404,19 @@ BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DW { BOOL ret; const USEROBJECTFLAGS *obj_flags = info; + LONG64 close_timeout = 0; - if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) + if (index == 1000) + { + /* Wine specific: set desktop close timeout. */ + if (!info || len < sizeof(DWORD)) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + close_timeout = -(*(DWORD *)info * (ULONG64)TICKSPERSEC / 1000); + } + else if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) { RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; @@ -404,8 +425,16 @@ BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DW SERVER_START_REQ( set_user_object_info ) { req->handle = wine_server_obj_handle( handle ); - req->flags = SET_USER_OBJECT_SET_FLAGS; - req->obj_flags = obj_flags->dwFlags; + if (index == 1000) + { + req->flags = SET_USER_OBJECT_SET_CLOSE_TIMEOUT; + req->close_timeout = close_timeout; + } + else + { + req->flags = SET_USER_OBJECT_SET_FLAGS; + req->obj_flags = obj_flags->dwFlags; + } ret = !wine_server_call_err( req ); } SERVER_END_REQ; @@ -607,6 +636,176 @@ static const WCHAR *get_default_desktop( void *buf, size_t buf_size ) return defaultW; } +static volatile void *map_shared_memory_section( const WCHAR *name, SIZE_T size, HANDLE root ) +{ + OBJECT_ATTRIBUTES attr; + UNICODE_STRING section_str; + HANDLE handle; + UINT status; + void *ptr; + + RtlInitUnicodeString( §ion_str, name ); + InitializeObjectAttributes( &attr, §ion_str, 0, root, NULL ); + if (!(status = NtOpenSection( &handle, SECTION_ALL_ACCESS, &attr ))) + { + ptr = NULL; + status = NtMapViewOfSection( handle, GetCurrentProcess(), &ptr, 0, 0, NULL, + &size, ViewUnmap, 0, PAGE_READONLY ); + NtClose( handle ); + } + + if (status) + { + WARN( "Failed to map view of section %s, status %#x\n", debugstr_w(name), status ); + return NULL; + } + + return ptr; +} + +volatile struct global_shared_memory *get_global_shared_memory( void ) +{ + static const WCHAR global_mappingW[] = + { + '\\','?','?','\\','_','_','w','i','n','e','_','w','i','n','3','2','u','_','m','a','p','p','i','n','g',0 + }; + static struct global_shared_memory *global_shared; + struct global_shared_memory *ret; + UNICODE_STRING section_str; + OBJECT_ATTRIBUTES attr; + LARGE_INTEGER size_l; + unsigned int status; + HANDLE handle; + SIZE_T size; + + __WINE_ATOMIC_LOAD_RELAXED( &global_shared, &ret ); + if (ret) return ret; + + RtlInitUnicodeString( §ion_str, global_mappingW ); + InitializeObjectAttributes( &attr, §ion_str, OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT, NULL, NULL ); + size_l.QuadPart = sizeof(struct global_shared_memory); + status = NtCreateSection( &handle, SECTION_ALL_ACCESS, &attr, &size_l, PAGE_READWRITE, SEC_COMMIT, NULL ); + if (status && status != STATUS_OBJECT_NAME_EXISTS) + { + static int once; + if (!once++) + ERR( "Failed to get global shared memory, status %#x.\n", status ); + } + size = sizeof(struct global_shared_memory); + status = NtMapViewOfSection( handle, GetCurrentProcess(), (void **)&ret, 0, 0, NULL, + &size, ViewUnmap, 0, PAGE_READWRITE ); + NtClose( handle ); + if (status) + { + ERR( "failed to map view of section, status %#x\n", status ); + return NULL; + } + if (InterlockedCompareExchangePointer( (void **)&global_shared, ret, NULL )) + { + if (NtUnmapViewOfSection( GetCurrentProcess(), ret )) + ERR( "NtUnmapViewOfSection failed.\n" ); + ret = global_shared; + } + + return ret; +} + +const desktop_shm_t *get_desktop_shared_memory(void) +{ + static const WCHAR dir_desktop_maps[] = + { + '_','_','w','i','n','e','_','d','e','s','k','t','o','p','_','m','a','p','p','i','n','g','s','\\',0 + }; + struct user_thread_info *thread_info = get_user_thread_info(); + HANDLE root, handles[2]; + WCHAR buf[MAX_PATH], *ptr; + DWORD i, needed; + + if (thread_info->desktop_shm) return thread_info->desktop_shm; + + handles[0] = NtUserGetProcessWindowStation(); + handles[1] = NtUserGetThreadDesktop( GetCurrentThreadId() ); + + memcpy( buf, dir_desktop_maps, wcslen(dir_desktop_maps) * sizeof(WCHAR) ); + ptr = buf + wcslen(dir_desktop_maps); + + for (i = 0; i < 2; i++) + { + NtUserGetObjectInformation( handles[i], UOI_NAME, (void *)ptr, sizeof(buf) - (ptr - buf) * sizeof(WCHAR), &needed ); + ptr += needed / sizeof(WCHAR); + if (i == 0) *(ptr - 1) = '\\'; + } + + root = get_winstations_dir_handle(); + thread_info->desktop_shm = map_shared_memory_section( buf, sizeof(*thread_info->desktop_shm), root ); + NtClose( root ); + + return thread_info->desktop_shm; +} + +const queue_shm_t *get_queue_shared_memory(void) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + UINT tid = GetCurrentThreadId(); + WCHAR bufferW[MAX_PATH]; + char buffer[MAX_PATH]; + + if (thread_info->queue_shm) return thread_info->queue_shm; + + snprintf( buffer, ARRAY_SIZE(buffer), "\\KernelObjects\\__wine_thread_mappings\\%08x-queue", tid ); + asciiz_to_unicode( bufferW, buffer ); + thread_info->queue_shm = map_shared_memory_section( bufferW, sizeof(*thread_info->queue_shm), NULL ); + return thread_info->queue_shm; +} + +static const input_shm_t *get_thread_input_shared_memory( UINT tid, const input_shm_t *input_shm ) +{ + WCHAR bufferW[MAX_PATH]; + char buffer[MAX_PATH]; + + if (input_shm && input_shm->tid == tid) return input_shm; + if (input_shm) NtUnmapViewOfSection( GetCurrentProcess(), (void *)input_shm ); + + snprintf( buffer, ARRAY_SIZE(buffer), "\\KernelObjects\\__wine_thread_mappings\\%08x-input", tid ); + asciiz_to_unicode( bufferW, buffer ); + return map_shared_memory_section( bufferW, sizeof(*input_shm), NULL ); +} + +const input_shm_t *get_input_shared_memory(void) +{ + const queue_shm_t *queue = get_queue_shared_memory(); + struct user_thread_info *thread_info = get_user_thread_info(); + UINT tid; + + if (!queue) return NULL; + SHARED_READ_BEGIN( queue, queue_shm_t ) + { + tid = queue->input_tid; + } + SHARED_READ_END + + thread_info->input_shm = get_thread_input_shared_memory( tid, thread_info->input_shm ); + return thread_info->input_shm; +} + +const input_shm_t *get_foreground_shared_memory(void) +{ + const desktop_shm_t *desktop = get_desktop_shared_memory(); + struct user_thread_info *thread_info = get_user_thread_info(); + UINT tid; + + if (!desktop) return NULL; + SHARED_READ_BEGIN( desktop, desktop_shm_t ) + { + tid = desktop->foreground_tid; + } + SHARED_READ_END + + if (!tid) return NULL; + thread_info->foreground_shm = get_thread_input_shared_memory( tid, thread_info->foreground_shm ); + return thread_info->foreground_shm; +} + /*********************************************************************** * winstation_init * diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index bd3d441c445..1adbc5cce0b 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -61,6 +61,7 @@ struct controller IGameControllerImpl IGameControllerImpl_iface; IGameControllerInputSink IGameControllerInputSink_iface; IRawGameController IRawGameController_iface; + IRawGameController2 IRawGameController2_iface; IGameController *IGameController_outer; LONG ref; @@ -99,6 +100,12 @@ static HRESULT WINAPI controller_QueryInterface( IGameControllerImpl *iface, REF return S_OK; } + if (IsEqualGUID( iid, &IID_IRawGameController2 )) + { + IInspectable_AddRef( (*out = &impl->IRawGameController2_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -330,6 +337,58 @@ static const struct IRawGameControllerVtbl raw_controller_vtbl = raw_controller_GetSwitchKind, }; +DEFINE_IINSPECTABLE_OUTER( raw_controller_2, IRawGameController2, struct controller, IGameController_outer ) + +static HRESULT WINAPI raw_controller_2_get_SimpleHapticsControllers( IRawGameController2 *iface, IVectorView_SimpleHapticsController** value) +{ + static const struct vector_iids iids = + { + .vector = &IID_IVector_SimpleHapticsController, + .view = &IID_IVectorView_SimpleHapticsController, + .iterable = &IID_IIterable_SimpleHapticsController, + .iterator = &IID_IIterator_SimpleHapticsController, + }; + IVector_SimpleHapticsController *vector; + HRESULT hr; + + FIXME( "iface %p, value %p stub!\n", iface, value ); + + if (SUCCEEDED(hr = vector_create( &iids, (void **)&vector ))) + { + hr = IVector_SimpleHapticsController_GetView( vector, value ); + IVector_SimpleHapticsController_Release( vector ); + } + + return hr; +} + +static HRESULT WINAPI raw_controller_2_get_NonRoamableId( IRawGameController2 *iface, HSTRING* value ) +{ + struct controller *impl = impl_from_IRawGameController2( iface ); + return IWineGameControllerProvider_get_NonRoamableId( impl->wine_provider, value ); +} + +static HRESULT WINAPI raw_controller_2_get_DisplayName( IRawGameController2 *iface, HSTRING* value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IRawGameController2Vtbl raw_controller_2_vtbl = +{ + raw_controller_2_QueryInterface, + raw_controller_2_AddRef, + raw_controller_2_Release, + /* IInspectable methods */ + raw_controller_2_GetIids, + raw_controller_2_GetRuntimeClassName, + raw_controller_2_GetTrustLevel, + /* IRawGameController2 methods */ + raw_controller_2_get_SimpleHapticsControllers, + raw_controller_2_get_NonRoamableId, + raw_controller_2_get_DisplayName, +}; + struct controller_statics { IActivationFactory IActivationFactory_iface; @@ -525,6 +584,7 @@ static HRESULT WINAPI controller_factory_CreateGameController( ICustomGameContro impl->IGameControllerImpl_iface.lpVtbl = &controller_vtbl; impl->IGameControllerInputSink_iface.lpVtbl = &input_sink_vtbl; impl->IRawGameController_iface.lpVtbl = &raw_controller_vtbl; + impl->IRawGameController2_iface.lpVtbl = &raw_controller_2_vtbl; impl->ref = 1; TRACE( "created RawGameController %p\n", impl ); diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 6908d733a53..3515d5c9ba6 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -148,20 +148,81 @@ static BOOL CALLBACK count_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *a return DIENUM_CONTINUE; } +static BOOL steam_input_get_vid_pid( UINT slot, UINT16 *vid, UINT16 *pid ) +{ + const char *info = getenv( "SteamVirtualGamepadInfo" ); + char buffer[256]; + UINT current; + FILE *file; + + TRACE( "reading SteamVirtualGamepadInfo %s\n", debugstr_a(info) ); + + if (!info || !(file = fopen( info, "r" ))) return FALSE; + while (fscanf( file, "%255[^\n]\n", buffer ) == 1) + { + if (sscanf( buffer, "[slot %d]", ¤t )) continue; + if (current < slot) continue; + if (current > slot) break; + if (sscanf( buffer, "VID=0x%hx", vid )) continue; + if (sscanf( buffer, "PID=0x%hx", pid )) continue; + } + + fclose( file ); + + return TRUE; +} + +static HRESULT WINAPI wine_provider_get_NonRoamableId( IWineGameControllerProvider *iface, HSTRING *value ) +{ + struct provider *impl = impl_from_IWineGameControllerProvider( iface ); + WCHAR buffer[1024]; + UINT16 vid, pid; + HRESULT hr; + + FIXME( "iface %p, value %p stub!\n", iface, value ); + + if (FAILED(hr = IGameControllerProvider_get_HardwareVendorId( &impl->IGameControllerProvider_iface, &vid ))) return hr; + if (FAILED(hr = IGameControllerProvider_get_HardwareProductId( &impl->IGameControllerProvider_iface, &pid ))) return hr; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (vid == 0x28de && pid == 0x11ff) + { + const WCHAR *tmp; + char serial[256]; + UINT32 len, slot; + + if (!(tmp = wcschr( impl->device_path + 8, '#' )) || wcsnicmp( tmp - 6, L"&XI_", 4 )) return E_NOTIMPL; + if (swscanf( tmp - 2, L"%02u#%*u&%255[^&]&", &slot, serial ) != 2) return E_NOTIMPL; + + if (!steam_input_get_vid_pid( slot, &vid, &pid )) + { + vid = 0x045e; + pid = 0x028e; + } + + len = swprintf( buffer, ARRAY_SIZE(buffer), L"{wgi/nrid/:steam-%04X&%04X&%s#%d#%u}", vid, pid, serial, slot, GetCurrentProcessId() ); + return WindowsCreateString( buffer, len, value ); + } + + return E_NOTIMPL; +} + static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface, WineGameControllerType *value ) { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); DIDEVICEINSTANCEW instance = {.dwSize = sizeof(DIDEVICEINSTANCEW)}; + const WCHAR *tmp; HRESULT hr; TRACE( "iface %p, value %p.\n", iface, value ); if (FAILED(hr = IDirectInputDevice8_GetDeviceInfo( impl->dinput_device, &instance ))) return hr; - switch (GET_DIDEVICE_TYPE( instance.dwDevType )) + if ((tmp = wcschr( impl->device_path + 8, '#' )) && !wcsnicmp( tmp - 6, L"&XI_", 4 )) + *value = WineGameControllerType_Gamepad; + else switch (GET_DIDEVICE_TYPE( instance.dwDevType )) { case DI8DEVTYPE_DRIVING: *value = WineGameControllerType_RacingWheel; break; - case DI8DEVTYPE_GAMEPAD: *value = WineGameControllerType_Gamepad; break; default: { DWORD count = 0; @@ -354,6 +415,7 @@ static const struct IWineGameControllerProviderVtbl wine_provider_vtbl = wine_provider_GetRuntimeClassName, wine_provider_GetTrustLevel, /* IWineGameControllerProvider methods */ + wine_provider_get_NonRoamableId, wine_provider_get_Type, wine_provider_get_AxisCount, wine_provider_get_ButtonCount, diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index e7b6e96b8aa..a6fcc6e84f3 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -173,6 +173,8 @@ namespace Windows.Gaming.Input.Custom { interface IWineGameControllerProvider : IInspectable requires Windows.Gaming.Input.Custom.IGameControllerProvider { + [propget] HRESULT NonRoamableId([out, retval] HSTRING *value); + [propget] HRESULT Type([out, retval] WineGameControllerType *value); [propget] HRESULT AxisCount([out, retval] INT32 *value); [propget] HRESULT ButtonCount([out, retval] INT32 *value); diff --git a/dlls/windows.media.speech/Makefile.in b/dlls/windows.media.speech/Makefile.in index 5be66d8367e..ea1e4272139 100644 --- a/dlls/windows.media.speech/Makefile.in +++ b/dlls/windows.media.speech/Makefile.in @@ -1,5 +1,6 @@ MODULE = windows.media.speech.dll -IMPORTS = combase uuid +UNIXLIB = windows.media.speech.so +IMPORTS = combase uuid user32 SOURCES = \ async.c \ @@ -9,4 +10,5 @@ SOURCES = \ main.c \ recognizer.c \ synthesizer.c \ + unixlib.c \ vector.c diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c index 3c5f450cc65..5d82c06193b 100644 --- a/dlls/windows.media.speech/async.c +++ b/dlls/windows.media.speech/async.c @@ -490,10 +490,19 @@ static HRESULT WINAPI async_inspectable_put_Completed( IAsyncOperation_IInspecta IAsyncOperationCompletedHandler_IInspectable *handler ) { struct async_inspectable *impl = impl_from_IAsyncOperation_IInspectable(iface); + const char *var = getenv("SteamAppId"); HRESULT hr = S_OK; TRACE("iface %p, handler %p.\n", iface, handler); + /* + * HACK: Forza Horizon 5 will segfault when trying to get an interface if + * we invoke the handler, so we should just return S_OK and let it hang + * indefinitely. + */ + if (var && !strcmp(var, "1551360")) + return S_OK; + EnterCriticalSection(&impl->cs); if (impl->status == Closed) hr = E_ILLEGAL_METHOD_CALL; diff --git a/dlls/windows.media.speech/main.c b/dlls/windows.media.speech/main.c index e772a791588..d53e1599eb8 100644 --- a/dlls/windows.media.speech/main.c +++ b/dlls/windows.media.speech/main.c @@ -20,10 +20,36 @@ #include "initguid.h" #include "private.h" +#include "unixlib.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(speech); +BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) +{ + NTSTATUS status; + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + + if ((status = __wine_init_unix_call())) + ERR("loading the unixlib failed with status %#lx.\n", status); + + if ((status = WINE_UNIX_CALL(unix_process_attach, NULL))) + WARN("initializing the unixlib failed with status %#lx.\n", status); + + break; + case DLL_PROCESS_DETACH: + WINE_UNIX_CALL(unix_process_detach, NULL); + break; + } + + return TRUE; +} + HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) { FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out); diff --git a/dlls/windows.media.speech/private.h b/dlls/windows.media.speech/private.h index e80d73ec1fb..60d09c9f7d1 100644 --- a/dlls/windows.media.speech/private.h +++ b/dlls/windows.media.speech/private.h @@ -22,11 +22,16 @@ #include +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "winerror.h" +#include "winternl.h" #define COBJMACROS #include "corerror.h" #include "windef.h" #include "winbase.h" #include "winstring.h" +#include "winuser.h" #include "objbase.h" #include "activation.h" @@ -43,6 +48,8 @@ #include "wine/list.h" +#define SPERR_WINRT_INTERNAL_ERROR 0x800455a0 + /* * * Windows.Media.SpeechRecognition @@ -126,4 +133,14 @@ HRESULT vector_inspectable_create( const struct vector_iids *iids, IVector_IInsp #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \ DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface ) +struct synth_provider +{ + struct IVoiceInformation **voices; + unsigned num_voices; + void (*dispose)(struct synth_provider *provider); +}; + +HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, const WCHAR *locale, + VoiceGender gender, IVoiceInformation **pvoice); + #endif diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index 790d127fc64..c898ea7723f 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -25,8 +25,610 @@ #include "wine/debug.h" +#include "unixlib.h" +#include "wine/unixlib.h" + WINE_DEFAULT_DEBUG_CHANNEL(speech); +struct map_view_hstring_vector_view_hstring +{ + IMapView_HSTRING_IVectorView_HSTRING IMapView_HSTRING_IVectorView_HSTRING_iface; + LONG ref; +}; + +static inline struct map_view_hstring_vector_view_hstring *impl_from_IMapView_HSTRING_IVectorView_HSTRING( IMapView_HSTRING_IVectorView_HSTRING *iface ) +{ + return CONTAINING_RECORD(iface, struct map_view_hstring_vector_view_hstring, IMapView_HSTRING_IVectorView_HSTRING_iface); +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_QueryInterface( IMapView_HSTRING_IVectorView_HSTRING *iface, REFIID iid, void **out ) +{ + struct map_view_hstring_vector_view_hstring *impl = impl_from_IMapView_HSTRING_IVectorView_HSTRING(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IMapView_HSTRING_IVectorView_HSTRING)) + { + IInspectable_AddRef((*out = &impl->IMapView_HSTRING_IVectorView_HSTRING_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +ULONG WINAPI map_view_hstring_vector_view_hstring_AddRef( IMapView_HSTRING_IVectorView_HSTRING *iface ) +{ + struct map_view_hstring_vector_view_hstring *impl = impl_from_IMapView_HSTRING_IVectorView_HSTRING(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +ULONG WINAPI map_view_hstring_vector_view_hstring_Release( IMapView_HSTRING_IVectorView_HSTRING *iface ) +{ + struct map_view_hstring_vector_view_hstring *impl = impl_from_IMapView_HSTRING_IVectorView_HSTRING(iface); + + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + + if(!ref) + free(impl); + + return ref; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_GetIids( IMapView_HSTRING_IVectorView_HSTRING *iface, ULONG *iidCount, IID **iids ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_GetRuntimeClassName( IMapView_HSTRING_IVectorView_HSTRING *iface, HSTRING *className ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_GetTrustLevel( IMapView_HSTRING_IVectorView_HSTRING *iface, TrustLevel *trustLevel ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_Lookup( IMapView_HSTRING_IVectorView_HSTRING *iface, HSTRING key, IVectorView_HSTRING **value ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_get_Size( IMapView_HSTRING_IVectorView_HSTRING *iface, unsigned int *size ) +{ + FIXME("iface %p stub!\n", iface); + *size = 0; + return S_OK; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_HasKey( IMapView_HSTRING_IVectorView_HSTRING *iface, HSTRING key, boolean *found ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +HRESULT WINAPI map_view_hstring_vector_view_hstring_Split( IMapView_HSTRING_IVectorView_HSTRING *iface, IMapView_HSTRING_IVectorView_HSTRING **first, IMapView_HSTRING_IVectorView_HSTRING **second ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +static const struct IMapView_HSTRING_IVectorView_HSTRINGVtbl map_view_hstring_vector_view_hstring_vtbl = +{ + /* IUnknown methods */ + map_view_hstring_vector_view_hstring_QueryInterface, + map_view_hstring_vector_view_hstring_AddRef, + map_view_hstring_vector_view_hstring_Release, + /* IInspectable methods */ + map_view_hstring_vector_view_hstring_GetIids, + map_view_hstring_vector_view_hstring_GetRuntimeClassName, + map_view_hstring_vector_view_hstring_GetTrustLevel, + /* IMapView* > methods */ + map_view_hstring_vector_view_hstring_Lookup, + map_view_hstring_vector_view_hstring_get_Size, + map_view_hstring_vector_view_hstring_HasKey, + map_view_hstring_vector_view_hstring_Split +}; + + +static HRESULT map_view_hstring_vector_view_hstring_create( IMapView_HSTRING_IVectorView_HSTRING **out ) +{ + struct map_view_hstring_vector_view_hstring *impl; + + TRACE("out %p.\n", out); + + if (!(impl = calloc(1, sizeof(*impl)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + impl->IMapView_HSTRING_IVectorView_HSTRING_iface.lpVtbl = &map_view_hstring_vector_view_hstring_vtbl; + impl->ref = 1; + + *out = &impl->IMapView_HSTRING_IVectorView_HSTRING_iface; + TRACE("created %p\n", *out); + return S_OK; +} + +struct semantic_interpretation +{ + ISpeechRecognitionSemanticInterpretation ISpeechRecognitionSemanticInterpretation_iface; + LONG ref; +}; + +static inline struct semantic_interpretation *impl_from_ISpeechRecognitionSemanticInterpretation( ISpeechRecognitionSemanticInterpretation *iface ) +{ + return CONTAINING_RECORD(iface, struct semantic_interpretation, ISpeechRecognitionSemanticInterpretation_iface); +} + +HRESULT WINAPI semantic_interpretation_QueryInterface( ISpeechRecognitionSemanticInterpretation *iface, REFIID iid, void **out ) +{ + struct semantic_interpretation *impl = impl_from_ISpeechRecognitionSemanticInterpretation(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_ISpeechRecognitionSemanticInterpretation)) + { + IInspectable_AddRef((*out = &impl->ISpeechRecognitionSemanticInterpretation_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +ULONG WINAPI semantic_interpretation_AddRef( ISpeechRecognitionSemanticInterpretation *iface ) +{ + struct semantic_interpretation *impl = impl_from_ISpeechRecognitionSemanticInterpretation(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +ULONG WINAPI semantic_interpretation_Release( ISpeechRecognitionSemanticInterpretation *iface ) +{ + struct semantic_interpretation *impl = impl_from_ISpeechRecognitionSemanticInterpretation(iface); + + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + + if(!ref) + free(impl); + + return ref; +} + +HRESULT WINAPI semantic_interpretation_GetIids( ISpeechRecognitionSemanticInterpretation *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +HRESULT WINAPI semantic_interpretation_GetRuntimeClassName( ISpeechRecognitionSemanticInterpretation *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +HRESULT WINAPI semantic_interpretation_GetTrustLevel( ISpeechRecognitionSemanticInterpretation *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +HRESULT WINAPI semantic_interpretation_get_Properties( ISpeechRecognitionSemanticInterpretation *iface, IMapView_HSTRING_IVectorView_HSTRING **value ) +{ + FIXME("iface %p stub!\n", iface); + return map_view_hstring_vector_view_hstring_create(value); +} + +static const struct ISpeechRecognitionSemanticInterpretationVtbl semantic_interpretation_vtbl = +{ + /* IUnknown methods */ + semantic_interpretation_QueryInterface, + semantic_interpretation_AddRef, + semantic_interpretation_Release, + /* IInspectable methods */ + semantic_interpretation_GetIids, + semantic_interpretation_GetRuntimeClassName, + semantic_interpretation_GetTrustLevel, + /* ISpeechRecognitionSemanticInterpretation methods */ + semantic_interpretation_get_Properties +}; + + +static HRESULT semantic_interpretation_create( ISpeechRecognitionSemanticInterpretation **out ) +{ + struct semantic_interpretation *impl; + + TRACE("out %p.\n", out); + + if (!(impl = calloc(1, sizeof(*impl)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + impl->ISpeechRecognitionSemanticInterpretation_iface.lpVtbl = &semantic_interpretation_vtbl; + impl->ref = 1; + + *out = &impl->ISpeechRecognitionSemanticInterpretation_iface; + TRACE("created %p\n", *out); + return S_OK; +} + +struct recognition_result +{ + ISpeechRecognitionResult ISpeechRecognitionResult_iface; + ISpeechRecognitionResult2 ISpeechRecognitionResult2_iface; + LONG ref; + + ISpeechRecognitionConstraint *constraint; + HSTRING text; +}; + +static inline struct recognition_result *impl_from_ISpeechRecognitionResult( ISpeechRecognitionResult *iface ) +{ + return CONTAINING_RECORD(iface, struct recognition_result, ISpeechRecognitionResult_iface); +} + +static HRESULT WINAPI recognition_result_QueryInterface( ISpeechRecognitionResult *iface, REFIID iid, void **out ) +{ + struct recognition_result *impl = impl_from_ISpeechRecognitionResult(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_ISpeechRecognitionResult)) + { + IInspectable_AddRef((*out = &impl->ISpeechRecognitionResult_iface)); + return S_OK; + } + + if (IsEqualGUID(iid, &IID_ISpeechRecognitionResult2)) + { + IInspectable_AddRef((*out = &impl->ISpeechRecognitionResult2_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI recognition_result_AddRef( ISpeechRecognitionResult *iface ) +{ + struct recognition_result *impl = impl_from_ISpeechRecognitionResult(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI recognition_result_Release( ISpeechRecognitionResult *iface ) +{ + struct recognition_result *impl = impl_from_ISpeechRecognitionResult(iface); + + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + + if(!ref) + { + ISpeechRecognitionConstraint_Release(impl->constraint); + WindowsDeleteString(impl->text); + free(impl); + } + + return ref; +} + +static HRESULT WINAPI recognition_result_GetIids( ISpeechRecognitionResult *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_GetRuntimeClassName( ISpeechRecognitionResult *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_GetTrustLevel( ISpeechRecognitionResult *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_get_Status( ISpeechRecognitionResult *iface, SpeechRecognitionResultStatus *value ) +{ + FIXME("iface %p, operation %p stub!\n", iface, value); + *value = SpeechRecognitionResultStatus_Success; + return S_OK; +} + +static HRESULT WINAPI recognition_result_get_Text( ISpeechRecognitionResult *iface, HSTRING *value ) +{ + struct recognition_result *impl = impl_from_ISpeechRecognitionResult(iface); + TRACE("iface %p, operation %p, text: %s.\n", iface, value, debugstr_hstring(impl->text)); + return WindowsDuplicateString(impl->text, value); +} + +static HRESULT WINAPI recognition_result_get_Confidence( ISpeechRecognitionResult *iface, SpeechRecognitionConfidence *value ) +{ + FIXME("iface %p, operation %p semi stub!\n", iface, value); + *value = SpeechRecognitionConfidence_High; + return S_OK; +} + +static HRESULT WINAPI recognition_result_get_SemanticInterpretation( ISpeechRecognitionResult *iface, + ISpeechRecognitionSemanticInterpretation **value ) +{ + FIXME("iface %p, operation %p stub!\n", iface, value); + return semantic_interpretation_create(value); +} + +static HRESULT WINAPI recognition_result_GetAlternates( ISpeechRecognitionResult *iface, + UINT32 max_amount, + IVectorView_SpeechRecognitionResult **results ) +{ + IVector_IInspectable *vector; + struct vector_iids constraints_iids = + { + .iterable = &IID_IVectorView_SpeechRecognitionResult, + .iterator = &IID_IVectorView_SpeechRecognitionResult, + .vector = &IID_IVector_IInspectable, + .view = &IID_IVectorView_SpeechRecognitionResult, + }; + + FIXME("iface %p, max_amount %u, results %p stub!\n", iface, max_amount, results); + + vector_inspectable_create(&constraints_iids, (IVector_IInspectable **)&vector); + IVector_IInspectable_GetView(vector, (IVectorView_IInspectable **)results); + IVector_IInspectable_Release(vector); + return S_OK; +} + +static HRESULT WINAPI recognition_result_get_Constraint( ISpeechRecognitionResult *iface, ISpeechRecognitionConstraint **value ) +{ + struct recognition_result *impl = impl_from_ISpeechRecognitionResult(iface); + TRACE("iface %p, operation %p.\n", iface, value); + ISpeechRecognitionConstraint_AddRef((*value = impl->constraint)); + return S_OK; +} + +static HRESULT WINAPI recognition_result_get_RulePath( ISpeechRecognitionResult *iface, IVectorView_HSTRING **value ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_get_RawConfidence( ISpeechRecognitionResult *iface, DOUBLE *value ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +static const struct ISpeechRecognitionResultVtbl recognition_result_vtbl = +{ + /* IUnknown methods */ + recognition_result_QueryInterface, + recognition_result_AddRef, + recognition_result_Release, + /* IInspectable methods */ + recognition_result_GetIids, + recognition_result_GetRuntimeClassName, + recognition_result_GetTrustLevel, + /* ISpeechRecognitionResult methods */ + recognition_result_get_Status, + recognition_result_get_Text, + recognition_result_get_Confidence, + recognition_result_get_SemanticInterpretation, + recognition_result_GetAlternates, + recognition_result_get_Constraint, + recognition_result_get_RulePath, + recognition_result_get_RawConfidence +}; + +DEFINE_IINSPECTABLE(recognition_result2, ISpeechRecognitionResult2, struct recognition_result, ISpeechRecognitionResult_iface) + +static HRESULT WINAPI recognition_result2_get_PhraseStartTime( ISpeechRecognitionResult2 *iface, DateTime *value ) +{ + DateTime dt = { .UniversalTime = 0 }; + FIXME("iface %p, value %p stub!\n", iface, value); + *value = dt; + return S_OK; +} + + +static HRESULT WINAPI recognition_result2_get_PhraseDuration( ISpeechRecognitionResult2 *iface, TimeSpan *value ) +{ + TimeSpan ts = { .Duration = 50000000LL }; /* Use 5 seconds as stub value. */ + FIXME("iface %p, value %p stub!\n", iface, value); + *value = ts; + return S_OK; +} + +static const struct ISpeechRecognitionResult2Vtbl recognition_result2_vtbl = +{ + /* IUnknown methods */ + recognition_result2_QueryInterface, + recognition_result2_AddRef, + recognition_result2_Release, + /* IInspectable methods */ + recognition_result2_GetIids, + recognition_result2_GetRuntimeClassName, + recognition_result2_GetTrustLevel, + /* ISpeechRecognitionResult2 methods */ + recognition_result2_get_PhraseStartTime, + recognition_result2_get_PhraseDuration +}; + +static HRESULT WINAPI recognition_result_create( ISpeechRecognitionConstraint *constraint, + HSTRING result_text, + ISpeechRecognitionResult **out ) +{ + struct recognition_result *impl; + + TRACE("out %p.\n", out); + + if (!(impl = calloc(1, sizeof(*impl)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + impl->ISpeechRecognitionResult_iface.lpVtbl = &recognition_result_vtbl; + impl->ISpeechRecognitionResult2_iface.lpVtbl = &recognition_result2_vtbl; + impl->ref = 1; + + if (constraint) ISpeechRecognitionConstraint_AddRef((impl->constraint = constraint)); + WindowsDuplicateString(result_text, &impl->text); + + *out = &impl->ISpeechRecognitionResult_iface; + + TRACE("created %p.\n", *out); + + return S_OK; +} + +struct recognition_result_event_args +{ + ISpeechContinuousRecognitionResultGeneratedEventArgs ISpeechContinuousRecognitionResultGeneratedEventArgs_iface; + LONG ref; + + ISpeechRecognitionResult *result; +}; + +static inline struct recognition_result_event_args *impl_from_ISpeechContinuousRecognitionResultGeneratedEventArgs( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface ) +{ + return CONTAINING_RECORD(iface, struct recognition_result_event_args, ISpeechContinuousRecognitionResultGeneratedEventArgs_iface); +} + +static HRESULT WINAPI recognition_result_event_args_QueryInterface( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface, REFIID iid, void **out ) +{ + struct recognition_result_event_args *impl = impl_from_ISpeechContinuousRecognitionResultGeneratedEventArgs(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_ISpeechContinuousRecognitionResultGeneratedEventArgs)) + { + IInspectable_AddRef((*out = &impl->ISpeechContinuousRecognitionResultGeneratedEventArgs_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI recognition_result_event_args_AddRef( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface ) +{ + struct recognition_result_event_args *impl = impl_from_ISpeechContinuousRecognitionResultGeneratedEventArgs(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI recognition_result_event_args_Release( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface ) +{ + struct recognition_result_event_args *impl = impl_from_ISpeechContinuousRecognitionResultGeneratedEventArgs(iface); + + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + + if (!ref) + { + if (impl->result) ISpeechRecognitionResult_Release(impl->result); + free(impl); + } + + return ref; +} + +static HRESULT WINAPI recognition_result_event_args_GetIids( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_event_args_GetRuntimeClassName( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_event_args_GetTrustLevel( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI recognition_result_event_args_get_Result( ISpeechContinuousRecognitionResultGeneratedEventArgs *iface, + ISpeechRecognitionResult **value ) +{ + struct recognition_result_event_args *impl = impl_from_ISpeechContinuousRecognitionResultGeneratedEventArgs(iface); + FIXME("iface %p value %p stub!\n", iface, value); + ISpeechRecognitionResult_AddRef((*value = impl->result)); + return S_OK; +} + +static const struct ISpeechContinuousRecognitionResultGeneratedEventArgsVtbl recognition_result_event_args_vtbl = +{ + /* IUnknown methods */ + recognition_result_event_args_QueryInterface, + recognition_result_event_args_AddRef, + recognition_result_event_args_Release, + /* IInspectable methods */ + recognition_result_event_args_GetIids, + recognition_result_event_args_GetRuntimeClassName, + recognition_result_event_args_GetTrustLevel, + /* ISpeechContinuousRecognitionResultGeneratedEventArgs methods */ + recognition_result_event_args_get_Result +}; + +static HRESULT WINAPI recognition_result_event_args_create( ISpeechRecognitionResult *result, + ISpeechContinuousRecognitionResultGeneratedEventArgs **out ) +{ + struct recognition_result_event_args *impl; + + TRACE("out %p.\n", out); + + if (!(impl = calloc(1, sizeof(*impl)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + impl->ISpeechContinuousRecognitionResultGeneratedEventArgs_iface.lpVtbl = &recognition_result_event_args_vtbl; + impl->ref = 1; + if (result) ISpeechRecognitionResult_AddRef((impl->result = result)); + + *out = &impl->ISpeechContinuousRecognitionResultGeneratedEventArgs_iface; + + TRACE("created %p.\n", *out); + return S_OK; +} + /* * * ISpeechRecognitionCompilationResult @@ -171,6 +773,8 @@ struct session IAudioCaptureClient *capture_client; WAVEFORMATEX capture_wfx; + speech_recognizer_handle unix_handle; + HANDLE worker_thread, worker_control_event, audio_buf_event; BOOLEAN worker_running, worker_paused; CRITICAL_SECTION cs; @@ -187,15 +791,107 @@ static inline struct session *impl_from_ISpeechContinuousRecognitionSession( ISp return CONTAINING_RECORD(iface, struct session, ISpeechContinuousRecognitionSession_iface); } +static HRESULT session_find_constraint_by_string(struct session *session, WCHAR *str, HSTRING *hstr_out, ISpeechRecognitionConstraint **out) +{ + ISpeechRecognitionListConstraint *list_constraint; + IIterable_IInspectable *constraints_iterable; + IIterator_IInspectable *constraints_iterator; + ISpeechRecognitionConstraint *constraint; + IIterable_HSTRING *commands_iterable; + IIterator_HSTRING *commands_iterator; + BOOLEAN has_constraint, has_command; + IVector_HSTRING *commands; + const WCHAR *command_str; + HSTRING command; + HRESULT hr; + + TRACE("session %p, str %s, out %p.\n", session, debugstr_w(str), out); + + if (FAILED(hr = IVector_ISpeechRecognitionConstraint_QueryInterface(session->constraints, &IID_IIterable_ISpeechRecognitionConstraint, (void **)&constraints_iterable))) + return hr; + + if (FAILED(hr = IIterable_IInspectable_First(constraints_iterable, &constraints_iterator))) + { + IIterable_IInspectable_Release(constraints_iterable); + return hr; + } + + *out = NULL; + + for (hr = IIterator_IInspectable_get_HasCurrent(constraints_iterator, &has_constraint); SUCCEEDED(hr) && has_constraint && !(*out); hr = IIterator_IInspectable_MoveNext(constraints_iterator, &has_constraint)) + { + list_constraint = NULL; + commands_iterable = NULL; + commands_iterator = NULL; + commands = NULL; + + if (FAILED(IIterator_IInspectable_get_Current(constraints_iterator, (IInspectable **)&constraint))) + goto skip; + + if (FAILED(ISpeechRecognitionConstraint_QueryInterface(constraint, &IID_ISpeechRecognitionListConstraint, (void**)&list_constraint))) + goto skip; + + if (FAILED(ISpeechRecognitionListConstraint_get_Commands(list_constraint, &commands))) + goto skip; + + if (FAILED(IVector_HSTRING_QueryInterface(commands, &IID_IIterable_HSTRING, (void **)&commands_iterable))) + goto skip; + + if (FAILED(IIterable_HSTRING_First(commands_iterable, &commands_iterator))) + goto skip; + + for (hr = IIterator_HSTRING_get_HasCurrent(commands_iterator, &has_command); SUCCEEDED(hr) && has_command && !(*out); hr = IIterator_HSTRING_MoveNext(commands_iterator, &has_command)) + { + if (FAILED(IIterator_HSTRING_get_Current(commands_iterator, &command))) + continue; + + command_str = WindowsGetStringRawBuffer(command, NULL); + + TRACE("Comparing str %s to command_str %s.\n", debugstr_w(str), debugstr_w(command_str)); + + if (!wcsicmp(str, command_str)) + { + TRACE("constraint %p has str %s.\n", constraint, debugstr_w(str)); + ISpeechRecognitionConstraint_AddRef((*out = constraint)); + WindowsDuplicateString(command, hstr_out); + } + + WindowsDeleteString(command); + } + +skip: + if (commands_iterator) IIterator_HSTRING_Release(commands_iterator); + if (commands_iterable) IIterable_HSTRING_Release(commands_iterable); + if (commands) IVector_HSTRING_Release(commands); + + if (list_constraint) ISpeechRecognitionListConstraint_Release(list_constraint); + if (constraint) ISpeechRecognitionConstraint_Release(constraint); + } + + IIterator_IInspectable_Release(constraints_iterator); + IIterable_IInspectable_Release(constraints_iterable); + + hr = (*out) ? S_OK : COR_E_KEYNOTFOUND; + return hr; +} + static DWORD CALLBACK session_worker_thread_cb( void *args ) { ISpeechContinuousRecognitionSession *iface = args; struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + struct speech_get_recognition_result_params recognition_result_params; + struct speech_recognize_audio_params recognize_audio_params; + ISpeechContinuousRecognitionResultGeneratedEventArgs *event_args; + ISpeechRecognitionConstraint *constraint; + ISpeechRecognitionResult *result; BOOLEAN running = TRUE, paused = FALSE; UINT32 frame_count, tmp_buf_size; BYTE *audio_buf, *tmp_buf = NULL; + WCHAR *recognized_text; DWORD flags, status; + NTSTATUS nt_status; HANDLE events[2]; + HSTRING hstring; HRESULT hr; SetThreadDescription(GetCurrentThread(), L"wine_speech_recognition_session_worker"); @@ -245,6 +941,7 @@ static DWORD CALLBACK session_worker_thread_cb( void *args ) { SIZE_T packet_size = 0, tmp_buf_offset = 0; UINT32 frames_available = 0; + INT recognized_text_len = 0; while (tmp_buf_offset < tmp_buf_size && IAudioCaptureClient_GetBuffer(impl->capture_client, &audio_buf, &frames_available, &flags, NULL, NULL) == S_OK) @@ -264,7 +961,69 @@ static DWORD CALLBACK session_worker_thread_cb( void *args ) IAudioCaptureClient_ReleaseBuffer(impl->capture_client, frames_available); } - /* TODO: Send mic data to recognizer and handle results. */ + recognize_audio_params.handle = impl->unix_handle; + recognize_audio_params.samples = tmp_buf; + recognize_audio_params.samples_size = tmp_buf_offset; + recognize_audio_params.status = RECOGNITION_STATUS_EXCEPTION; + + if (NT_ERROR(nt_status = WINE_UNIX_CALL(unix_speech_recognize_audio, &recognize_audio_params))) + WARN("unix_speech_recognize_audio failed with status %#lx.\n", nt_status); + + if (recognize_audio_params.status != RECOGNITION_STATUS_RESULT_AVAILABLE) + continue; + + recognition_result_params.handle = impl->unix_handle; + recognition_result_params.result_buf = NULL; + recognition_result_params.result_buf_size = 512; + + do + { + recognition_result_params.result_buf = realloc(recognition_result_params.result_buf, recognition_result_params.result_buf_size); + } + while (WINE_UNIX_CALL(unix_speech_get_recognition_result, &recognition_result_params) == STATUS_BUFFER_TOO_SMALL && + recognition_result_params.result_buf); + + if (!recognition_result_params.result_buf) + { + WARN("memory allocation failed.\n"); + break; + } + + /* Silence was recognized. */ + if (!strcmp(recognition_result_params.result_buf, "")) + { + free(recognition_result_params.result_buf); + continue; + } + + recognized_text_len = MultiByteToWideChar(CP_UTF8, 0, recognition_result_params.result_buf, -1, NULL, 0); + + if (!(recognized_text = malloc(recognized_text_len * sizeof(WCHAR)))) + { + free(recognition_result_params.result_buf); + WARN("memory allocation failed.\n"); + break; + } + + MultiByteToWideChar(CP_UTF8, 0, recognition_result_params.result_buf, -1, recognized_text, recognized_text_len); + + if (SUCCEEDED(hr = session_find_constraint_by_string(impl, recognized_text, &hstring, &constraint))) + { + recognition_result_create(constraint, hstring, &result); + recognition_result_event_args_create(result, &event_args); + + typed_event_handlers_notify(&impl->result_handlers, + (IInspectable *)&impl->ISpeechContinuousRecognitionSession_iface, + (IInspectable *)event_args); + + ISpeechContinuousRecognitionResultGeneratedEventArgs_Release(event_args); + ISpeechRecognitionResult_Release(result); + WindowsDeleteString(hstring); + ISpeechRecognitionConstraint_Release(constraint); + } + + free(recognized_text); + free(recognition_result_params.result_buf); } else { @@ -319,7 +1078,9 @@ static ULONG WINAPI session_AddRef( ISpeechContinuousRecognitionSession *iface ) static ULONG WINAPI session_Release( ISpeechContinuousRecognitionSession *iface ) { struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + struct speech_release_recognizer_params release_params; ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); if (!ref) @@ -345,6 +1106,9 @@ static ULONG WINAPI session_Release( ISpeechContinuousRecognitionSession *iface impl->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&impl->cs); + release_params.handle = impl->unix_handle; + WINE_UNIX_CALL(unix_speech_release_recognizer, &release_params); + IVector_ISpeechRecognitionConstraint_Release(impl->constraints); free(impl); } @@ -725,17 +1489,155 @@ static HRESULT WINAPI recognizer_get_UIOptions( ISpeechRecognizer *iface, ISpeec return E_NOTIMPL; } +static HRESULT recognizer_create_unix_instance( struct session *session, const char **grammar, UINT32 grammar_size ) +{ + struct speech_create_recognizer_params create_params = { 0 }; + WCHAR locale[LOCALE_NAME_MAX_LENGTH]; + NTSTATUS status; + INT len; + + if (!(len = GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH))) + return E_FAIL; + + if (CharLowerBuffW(locale, len) != len) + return E_FAIL; + + if (!WideCharToMultiByte(CP_ACP, 0, locale, len, create_params.locale, ARRAY_SIZE(create_params.locale), NULL, NULL)) + return HRESULT_FROM_WIN32(GetLastError()); + + create_params.sample_rate = (FLOAT)session->capture_wfx.nSamplesPerSec; + create_params.grammar = grammar; + create_params.grammar_size = grammar_size; + + if ((status = WINE_UNIX_CALL(unix_speech_create_recognizer, &create_params))) + { + ERR("Unable to create Vosk instance for locale %s, status %#lx. Speech recognition won't work.\n", debugstr_a(create_params.locale), status); + return SPERR_WINRT_INTERNAL_ERROR; + } + + session->unix_handle = create_params.handle; + + return S_OK; +} + static HRESULT recognizer_compile_constraints_async( IInspectable *invoker, IInspectable **result ) { - return compilation_result_create(SpeechRecognitionResultStatus_Success, (ISpeechRecognitionCompilationResult **) result); + struct recognizer *impl = impl_from_ISpeechRecognizer((ISpeechRecognizer *)invoker); + struct session *session = impl_from_ISpeechContinuousRecognitionSession(impl->session); + struct speech_release_recognizer_params release_params; + ISpeechRecognitionListConstraint *list_constraint; + IIterable_IInspectable *constraints_iterable; + IIterator_IInspectable *constraints_iterator; + ISpeechRecognitionConstraint *constraint; + IIterable_HSTRING *commands_iterable; + IIterator_HSTRING *commands_iterator; + BOOLEAN has_constraint, has_command; + IVector_HSTRING *commands; + const WCHAR *command_str; + UINT32 grammar_size = 0, i = 0; + char **grammar = NULL; + HSTRING command; + UINT32 size = 0; + HRESULT hr; + + if (FAILED(hr = IVector_ISpeechRecognitionConstraint_QueryInterface(session->constraints, &IID_IIterable_ISpeechRecognitionConstraint, (void **)&constraints_iterable))) + return hr; + + if (FAILED(hr = IIterable_IInspectable_First(constraints_iterable, &constraints_iterator))) + { + IIterable_IInspectable_Release(constraints_iterable); + return hr; + } + + for (hr = IIterator_IInspectable_get_HasCurrent(constraints_iterator, &has_constraint); SUCCEEDED(hr) && has_constraint; hr = IIterator_IInspectable_MoveNext(constraints_iterator, &has_constraint)) + { + list_constraint = NULL; + commands_iterable = NULL; + commands_iterator = NULL; + commands = NULL; + + if (FAILED(IIterator_IInspectable_get_Current(constraints_iterator, (IInspectable **)&constraint))) + goto skip; + + if (FAILED(ISpeechRecognitionConstraint_QueryInterface(constraint, &IID_ISpeechRecognitionListConstraint, (void**)&list_constraint))) + goto skip; + + if (FAILED(ISpeechRecognitionListConstraint_get_Commands(list_constraint, &commands))) + goto skip; + + if (FAILED(IVector_HSTRING_QueryInterface(commands, &IID_IIterable_HSTRING, (void **)&commands_iterable))) + goto skip; + + if (FAILED(IIterable_HSTRING_First(commands_iterable, &commands_iterator))) + goto skip; + + if (FAILED(IVector_HSTRING_get_Size(commands, &size))) + goto skip; + + grammar_size += size; + grammar = realloc(grammar, grammar_size * sizeof(char *)); + + for (hr = IIterator_HSTRING_get_HasCurrent(commands_iterator, &has_command); SUCCEEDED(hr) && has_command; hr = IIterator_HSTRING_MoveNext(commands_iterator, &has_command)) + { + if (FAILED(IIterator_HSTRING_get_Current(commands_iterator, &command))) + continue; + + command_str = WindowsGetStringRawBuffer(command, NULL); + + if (command_str) + { + WCHAR *wstr = wcsdup(command_str); + size_t len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, grammar[i], 0, NULL, NULL); + grammar[i] = malloc(len * sizeof(char)); + + CharLowerW(wstr); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, grammar[i], len, NULL, NULL); + free(wstr); + i++; + } + + WindowsDeleteString(command); + } + +skip: + if (commands_iterator) IIterator_HSTRING_Release(commands_iterator); + if (commands_iterable) IIterable_HSTRING_Release(commands_iterable); + if (commands) IVector_HSTRING_Release(commands); + + if (list_constraint) ISpeechRecognitionListConstraint_Release(list_constraint); + if (constraint) ISpeechRecognitionConstraint_Release(constraint); + } + + IIterator_IInspectable_Release(constraints_iterator); + IIterable_IInspectable_Release(constraints_iterable); + + if (session->unix_handle) + { + release_params.handle = session->unix_handle; + WINE_UNIX_CALL(unix_speech_release_recognizer, &release_params); + session->unix_handle = 0; + } + + hr = recognizer_create_unix_instance(session, (const char **)grammar, grammar_size); + + for(i = 0; i < grammar_size; ++i) + free(grammar[i]); + free(grammar); + + if (FAILED(hr)) + { + WARN("Failed to created recognizer instance with grammar.\n"); + return compilation_result_create(SpeechRecognitionResultStatus_GrammarCompilationFailure, (ISpeechRecognitionCompilationResult **) result); + } + else return compilation_result_create(SpeechRecognitionResultStatus_Success, (ISpeechRecognitionCompilationResult **) result); } static HRESULT WINAPI recognizer_CompileConstraintsAsync( ISpeechRecognizer *iface, IAsyncOperation_SpeechRecognitionCompilationResult **operation ) { IAsyncOperation_IInspectable **value = (IAsyncOperation_IInspectable **)operation; - FIXME("iface %p, operation %p semi-stub!\n", iface, operation); - return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechRecognitionCompilationResult, NULL, recognizer_compile_constraints_async, value); + TRACE("iface %p, operation %p semi-stub!\n", iface, operation); + return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechRecognitionCompilationResult, (IInspectable *)iface, recognizer_compile_constraints_async, value); } static HRESULT WINAPI recognizer_RecognizeAsync( ISpeechRecognizer *iface, diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 39d14b84ab7..bdf7325f669 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -23,6 +23,219 @@ WINE_DEFAULT_DEBUG_CHANNEL(speech); +struct voice_information +{ + IVoiceInformation IVoiceInformation_iface; + LONG ref; + + HSTRING id; + HSTRING display_name; + HSTRING language; + HSTRING description; + VoiceGender gender; + BOOL is_static; +}; + +static inline struct voice_information *impl_from_IVoiceInformation( IVoiceInformation *iface ) +{ + return CONTAINING_RECORD(iface, struct voice_information, IVoiceInformation_iface); +} + +static void voice_information_delete( struct voice_information *voice_info ) +{ + WindowsDeleteString(voice_info->id); + WindowsDeleteString(voice_info->display_name); + WindowsDeleteString(voice_info->language); + WindowsDeleteString(voice_info->description); + free(voice_info); +} + +static HRESULT WINAPI voice_information_QueryInterface( IVoiceInformation *iface, REFIID iid, void **ppvObject) +{ + struct voice_information *impl = impl_from_IVoiceInformation( iface ); + + TRACE("iface %p, riid %s, ppv %p\n", iface, wine_dbgstr_guid(iid), ppvObject); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IVoiceInformation)) + { + IInspectable_AddRef((*ppvObject = &impl->IVoiceInformation_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *ppvObject = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI voice_information_AddRef( IVoiceInformation *iface ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI voice_information_Release( IVoiceInformation *iface ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + /* only deallocate non static instances */ + if (!ref && !impl->is_static) + voice_information_delete(impl); + return ref; +} + +static HRESULT WINAPI voice_information_GetIids( IVoiceInformation *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_GetRuntimeClassName( IVoiceInformation *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_GetTrustLevel( IVoiceInformation *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_get_DisplayName( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p!n", iface, value); + return WindowsDuplicateString(impl->display_name, value); +} + +static HRESULT WINAPI voice_information_get_Id( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->id, value); +} + +static HRESULT WINAPI voice_information_get_Language( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->language, value); +} + +static HRESULT WINAPI voice_information_get_Description( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->description, value); +} + +static HRESULT WINAPI voice_information_get_Gender( IVoiceInformation *iface, VoiceGender *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + *value = impl->gender; + return S_OK; +} + +static const struct IVoiceInformationVtbl voice_information_vtbl = +{ + /*** IUnknown methods ***/ + voice_information_QueryInterface, + voice_information_AddRef, + voice_information_Release, + + /*** IInspectable methods ***/ + voice_information_GetIids, + voice_information_GetRuntimeClassName, + voice_information_GetTrustLevel, + + /*** IVoiceInformation methods ***/ + voice_information_get_DisplayName, + voice_information_get_Id, + voice_information_get_Language, + voice_information_get_Description, + voice_information_get_Gender, +}; + +HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, const WCHAR *locale, + VoiceGender gender, IVoiceInformation **pvoice) +{ + struct voice_information *voice_info; + WCHAR *description; + HRESULT hr; + size_t len, langlen; + + voice_info = calloc(1, sizeof(*voice_info)); + if (!voice_info) return E_OUTOFMEMORY; + + len = wcslen(display_name) + 3; + langlen = GetLocaleInfoEx(locale, LOCALE_SLOCALIZEDDISPLAYNAME, NULL, 0); + description = malloc((len + langlen) * sizeof(WCHAR)); + wcscpy(description, display_name); + wcscat(description, L" - "); + GetLocaleInfoEx(locale, LOCALE_SLOCALIZEDDISPLAYNAME, description + len, langlen); + + hr = WindowsCreateString(display_name, wcslen(display_name), &voice_info->display_name); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(id, wcslen(id), &voice_info->id); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(locale, wcslen(locale), &voice_info->language); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(description, len + langlen - 1, &voice_info->description); + if (SUCCEEDED(hr)) + { + voice_info->gender = gender; + voice_info->is_static = TRUE; + voice_info->IVoiceInformation_iface.lpVtbl = &voice_information_vtbl; + *pvoice = &voice_info->IVoiceInformation_iface; + } + else + { + voice_information_delete(voice_info); + } + free(description); + return hr; +} + +HRESULT voice_information_clone(IVoiceInformation *voice, IVoiceInformation **out) +{ + struct voice_information *voice_info; + HRESULT hr; + + voice_info = calloc(1, sizeof(*voice_info)); + if (!voice_info) return E_OUTOFMEMORY; + + hr = IVoiceInformation_get_DisplayName(voice, &voice_info->display_name); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Id(voice, &voice_info->id); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Language(voice, &voice_info->language); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Description(voice, &voice_info->description); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Gender(voice, &voice_info->gender); + if (SUCCEEDED(hr)) + { + voice_info->IVoiceInformation_iface.lpVtbl = &voice_information_vtbl; + voice_info->ref = 1; + *out = &voice_info->IVoiceInformation_iface; + } + else + voice_information_delete(voice_info); + + return hr; +} + /* * * IVectorView_VoiceInformation @@ -33,6 +246,8 @@ struct voice_information_vector { IVectorView_VoiceInformation IVectorView_VoiceInformation_iface; LONG ref; + + struct synth_provider provider; }; static inline struct voice_information_vector *impl_from_IVectorView_VoiceInformation( IVectorView_VoiceInformation *iface ) @@ -44,7 +259,7 @@ static HRESULT WINAPI vector_view_voice_information_QueryInterface( IVectorView_ { struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); - TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + TRACE("iface %p, iid %s, out %p\n", iface, debugstr_guid(iid), out); if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IInspectable) || @@ -95,23 +310,39 @@ static HRESULT WINAPI vector_view_voice_information_GetTrustLevel( IVectorView_V static HRESULT WINAPI vector_view_voice_information_GetAt( IVectorView_VoiceInformation *iface, UINT32 index, IVoiceInformation **value ) { - FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); - *value = NULL; - return E_BOUNDS; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + TRACE("iface %p, index %#x, value %p\n", iface, index, value); + if (index >= impl->provider.num_voices) + { + *value = NULL; + return E_BOUNDS; + } + IVoiceInformation_AddRef( *value = impl->provider.voices[index] ); + return S_OK; } static HRESULT WINAPI vector_view_voice_information_get_Size( IVectorView_VoiceInformation *iface, UINT32 *value ) { - FIXME("iface %p, value %p stub!\n", iface, value); - *value = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + TRACE("iface %p, value %p\n", iface, value); + *value = impl->provider.num_voices; return S_OK; } static HRESULT WINAPI vector_view_voice_information_IndexOf( IVectorView_VoiceInformation *iface, IVoiceInformation *element, UINT32 *index, BOOLEAN *found ) { - FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); - *index = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + int i; + + TRACE("iface %p, element %p, index %p, found %p\n", iface, element, index, found); + for (i = 0; i < impl->provider.num_voices; i++) + if (element == impl->provider.voices[i]) + { + *index = i; + *found = TRUE; + return S_OK; + } *found = FALSE; return S_OK; } @@ -119,8 +350,18 @@ static HRESULT WINAPI vector_view_voice_information_IndexOf( IVectorView_VoiceIn static HRESULT WINAPI vector_view_voice_information_GetMany( IVectorView_VoiceInformation *iface, UINT32 start_index, UINT32 items_size, IVoiceInformation **items, UINT *value ) { - FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); - *value = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + int i; + + TRACE("iface %p, start_index %#x, items %p, value %p\n", iface, start_index, items, value); + if (start_index >= impl->provider.num_voices) + { + *value = 0; + return S_OK; + } + *value = min(impl->provider.num_voices - start_index, items_size); + for (i = 0; i < *value; i++) + IVoiceInformation_AddRef(items[i] = impl->provider.voices[start_index + i]); return S_OK; } @@ -143,7 +384,8 @@ static const struct IVectorView_VoiceInformationVtbl vector_view_voice_informati static struct voice_information_vector all_voices = { {&vector_view_voice_information_vtbl}, - 0 + 0, + {}, }; /* @@ -280,6 +522,309 @@ static HRESULT synthesis_stream_create( ISpeechSynthesisStream **out ) return hr; } +/* + * + * SpeechSynthesizerOptions runtimeclass + * + */ +struct synthesizer_options +{ + ISpeechSynthesizerOptions ISpeechSynthesizerOptions_iface; + ISpeechSynthesizerOptions2 ISpeechSynthesizerOptions2_iface; + ISpeechSynthesizerOptions3 ISpeechSynthesizerOptions3_iface; + LONG ref; + + /* options */ + boolean include_word_boundary; + boolean include_sentence_boundary; + + /* options 2 */ + double audio_volume; + double speaking_rate; + double audio_pitch; + + /* options 3 */ + enum SpeechAppendedSilence appended_silence; + enum SpeechPunctuationSilence punctuation_silence; +}; + +static inline struct synthesizer_options *impl_from_ISpeechSynthesizerOptions( ISpeechSynthesizerOptions *iface ) +{ + return CONTAINING_RECORD(iface, struct synthesizer_options, ISpeechSynthesizerOptions_iface); +} + +static HRESULT WINAPI synthesizer_options_QueryInterface( ISpeechSynthesizerOptions *iface, REFIID iid, void **out) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + + TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions_iface)); + return S_OK; + } + + if (IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions2)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions2_iface)); + return S_OK; + } + + if (IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions3)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions3_iface)); + return S_OK; + } + + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI synthesizer_options_AddRef( ISpeechSynthesizerOptions *iface ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI synthesizer_options_Release( ISpeechSynthesizerOptions *iface ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + + TRACE("iface %p, ref %lu.\n", iface, ref); + if (ref == 0) + free(impl); + return ref; +} + +static HRESULT WINAPI synthesizer_options_GetIids( ISpeechSynthesizerOptions *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub.\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_GetRuntimeClassName( ISpeechSynthesizerOptions *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub.\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_GetTrustLevel( ISpeechSynthesizerOptions *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub.\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_get_IncludeWordBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean *value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %p semi-stub.\n", iface, value); + + *value = impl->include_word_boundary; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_put_IncludeWordBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %s semi-stub.\n", iface, value ? "true" : "false"); + + impl->include_word_boundary = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_get_IncludeSentenceBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean *value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %p stub.\n", iface, value); + + *value = impl->include_sentence_boundary; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_put_IncludeSentenceBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %s stub.\n", iface, value ? "true" : "false"); + + impl->include_sentence_boundary = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptionsVtbl synthesizer_options_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options_QueryInterface, + synthesizer_options_AddRef, + synthesizer_options_Release, + /*** IInspectable methods ***/ + synthesizer_options_GetIids, + synthesizer_options_GetRuntimeClassName, + synthesizer_options_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options_get_IncludeWordBoundaryMetadata, + synthesizer_options_put_IncludeWordBoundaryMetadata, + synthesizer_options_get_IncludeSentenceBoundaryMetadata, + synthesizer_options_put_IncludeSentenceBoundaryMetadata, +}; + +DEFINE_IINSPECTABLE(synthesizer_options2, ISpeechSynthesizerOptions2, struct synthesizer_options, ISpeechSynthesizerOptions_iface) + +static HRESULT WINAPI synthesizer_options2_get_AudioVolume( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->audio_volume; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_AudioVolume( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->audio_volume = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_get_SpeakingRate( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->speaking_rate; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_SpeakingRate( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->speaking_rate = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_get_AudioPitch( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->audio_pitch; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_AudioPitch( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->audio_pitch = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptions2Vtbl synthesizer_options2_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options2_QueryInterface, + synthesizer_options2_AddRef, + synthesizer_options2_Release, + /*** IInspectable methods ***/ + synthesizer_options2_GetIids, + synthesizer_options2_GetRuntimeClassName, + synthesizer_options2_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options2_get_AudioVolume, + synthesizer_options2_put_AudioVolume, + synthesizer_options2_get_SpeakingRate, + synthesizer_options2_put_SpeakingRate, + synthesizer_options2_get_AudioPitch, + synthesizer_options2_put_AudioPitch, +}; + +DEFINE_IINSPECTABLE(synthesizer_options3, ISpeechSynthesizerOptions3, struct synthesizer_options, ISpeechSynthesizerOptions_iface) + +static HRESULT WINAPI synthesizer_options3_get_AppendedSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechAppendedSilence *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->appended_silence; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_put_AppendedSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechAppendedSilence value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %u semi-stub!\n", iface, value); + impl->appended_silence = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_get_PunctuationSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechPunctuationSilence *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->punctuation_silence; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_put_PunctuationSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechPunctuationSilence value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %u semi-stub!\n", iface, value); + impl->punctuation_silence = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptions3Vtbl synthesizer_options3_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options3_QueryInterface, + synthesizer_options3_AddRef, + synthesizer_options3_Release, + /*** IInspectable methods ***/ + synthesizer_options3_GetIids, + synthesizer_options3_GetRuntimeClassName, + synthesizer_options3_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options3_get_AppendedSilence, + synthesizer_options3_put_AppendedSilence, + synthesizer_options3_get_PunctuationSilence, + synthesizer_options3_put_PunctuationSilence, +}; + +static HRESULT synthesizer_options_allocate( struct synthesizer_options **out ) +{ + struct synthesizer_options *options; + + if (!(options = calloc(1, sizeof(*options)))) return E_OUTOFMEMORY; + + options->ISpeechSynthesizerOptions_iface.lpVtbl = &synthesizer_options_vtbl; + options->ISpeechSynthesizerOptions2_iface.lpVtbl = &synthesizer_options2_vtbl; + options->ISpeechSynthesizerOptions3_iface.lpVtbl = &synthesizer_options3_vtbl; + /* all other values default to 0 or false */ + options->audio_pitch = 1.0; + options->audio_volume = 1.0; + options->speaking_rate = 1.0; + options->ref = 1; + *out = options; + + return S_OK; +} + /* * * SpeechSynthesizer runtimeclass @@ -292,6 +837,9 @@ struct synthesizer ISpeechSynthesizer2 ISpeechSynthesizer2_iface; IClosable IClosable_iface; LONG ref; + + struct synthesizer_options *options; + IVoiceInformation *current_voice; }; /* @@ -352,7 +900,13 @@ static ULONG WINAPI synthesizer_Release( ISpeechSynthesizer *iface ) TRACE("iface %p, ref %lu.\n", iface, ref); if (!ref) + { + if (impl->options) + ISpeechSynthesizerOptions_Release(&impl->options->ISpeechSynthesizerOptions_iface); + if (impl->current_voice) + IVoiceInformation_Release(impl->current_voice); free(impl); + } return ref; } @@ -403,14 +957,49 @@ static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesize static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer(iface); + IVoiceInformation *voice; + HSTRING id, id2; + HRESULT hr; + INT32 cmp, idx; + + TRACE("iface %p, value %p semi-stub.\n", iface, value); + + hr = IVoiceInformation_get_Id(value, &id); + if (FAILED(hr)) return hr; + + for (idx = 0; ; idx++) + { + if (SUCCEEDED(hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, idx, &voice))) + { + if (SUCCEEDED(hr = IVoiceInformation_get_Id(voice, &id2))) + { + hr = WindowsCompareStringOrdinal(id, id2, &cmp); + WindowsDeleteString(id2); + } + IVoiceInformation_Release(voice); + } + if (FAILED(hr) || cmp == 0) break; + } + WindowsDeleteString(id); + + if (SUCCEEDED(hr)) + { + if (impl->current_voice) + IVoiceInformation_Release(impl->current_voice); + IVoiceInformation_AddRef(impl->current_voice = value); + } + return hr; } static HRESULT WINAPI synthesizer_get_Voice( ISpeechSynthesizer *iface, IVoiceInformation **value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer(iface); + + TRACE("iface %p, value %p.\n", iface, value); + if (!impl->current_voice) return E_NOTIMPL; + IVoiceInformation_AddRef(*value = impl->current_voice); + return S_OK; } static const struct ISpeechSynthesizerVtbl synthesizer_vtbl = @@ -440,8 +1029,21 @@ DEFINE_IINSPECTABLE(synthesizer2, ISpeechSynthesizer2, struct synthesizer, ISpee static HRESULT WINAPI synthesizer2_get_Options( ISpeechSynthesizer2 *iface, ISpeechSynthesizerOptions **value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer2(iface); + + WARN("iface %p, value %p semi-stub.\n", iface, value); + if (!impl->options) + { + struct synthesizer_options *options; + HRESULT hr = synthesizer_options_allocate(&options); + if (FAILED(hr)) return hr; + + if (InterlockedCompareExchangePointer((void **)&impl->options, options, NULL) != NULL) + /* another thread beat us */ + ISpeechSynthesizerOptions_AddRef(&options->ISpeechSynthesizerOptions_iface); + } + ISpeechSynthesizerOptions_AddRef(*value = &impl->options->ISpeechSynthesizerOptions_iface); + return S_OK; } static const struct ISpeechSynthesizer2Vtbl synthesizer2_vtbl = @@ -572,7 +1174,9 @@ static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLev static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) { + struct IVoiceInformation *static_voice; struct synthesizer *impl; + HRESULT hr; TRACE("iface %p, instance %p.\n", iface, instance); @@ -585,6 +1189,15 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp impl->ISpeechSynthesizer_iface.lpVtbl = &synthesizer_vtbl; impl->ISpeechSynthesizer2_iface.lpVtbl = &synthesizer2_vtbl; impl->IClosable_iface.lpVtbl = &closable_vtbl; + /* assuming default is the first one... */ + hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, 0, &static_voice); + if (SUCCEEDED(hr)) + hr = voice_information_clone(static_voice, &impl->current_voice); + if (FAILED(hr)) + { + free(impl); + return hr; + } impl->ref = 1; *instance = (IInspectable *)&impl->ISpeechSynthesizer_iface; @@ -604,6 +1217,26 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +static HRESULT dummy_provider_init(struct synth_provider *provider) +{ + HRESULT hr; + WCHAR locale[LOCALE_NAME_MAX_LENGTH]; + + if (GetUserDefaultLocaleName(locale, ARRAY_SIZE(locale)) > ARRAY_SIZE(locale)) + return E_OUTOFMEMORY; + + provider->voices = calloc(1, sizeof(all_voices.provider.voices[0])); + if (!provider->voices) return E_OUTOFMEMORY; + hr = voice_information_allocate(L"Dummy voice", L"--noid--", locale, VoiceGender_Male, &provider->voices[0]); + if (FAILED(hr)) + { + free(provider->voices); + } + else + provider->num_voices = 1; + return hr; +} + /* * * IInstalledVoicesStatic for SpeechSynthesizer runtimeclass @@ -612,18 +1245,46 @@ static const struct IActivationFactoryVtbl factory_vtbl = DEFINE_IINSPECTABLE(installed_voices_static, IInstalledVoicesStatic, struct synthesizer_statics, IActivationFactory_iface) +static CRITICAL_SECTION allvoices_cs; +static CRITICAL_SECTION_DEBUG allvoices_critsect_debug = +{ + 0, 0, &allvoices_cs, + { &allvoices_critsect_debug.ProcessLocksList, &allvoices_critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": allvoices_cs") } +}; +static CRITICAL_SECTION allvoices_cs = { &allvoices_critsect_debug, -1, 0, 0, 0, 0 }; + static HRESULT WINAPI installed_voices_static_get_AllVoices( IInstalledVoicesStatic *iface, IVectorView_VoiceInformation **value ) { + HRESULT hr; + TRACE("iface %p, value %p.\n", iface, value); - *value = &all_voices.IVectorView_VoiceInformation_iface; - IVectorView_VoiceInformation_AddRef(*value); - return S_OK; + + EnterCriticalSection(&allvoices_cs); + if (all_voices.provider.num_voices == 0) + hr = dummy_provider_init(&all_voices.provider); + else + hr = S_OK; + if (SUCCEEDED(hr)) + IVectorView_VoiceInformation_AddRef(*value = &all_voices.IVectorView_VoiceInformation_iface); + LeaveCriticalSection(&allvoices_cs); + return hr; } static HRESULT WINAPI installed_voices_static_get_DefaultVoice( IInstalledVoicesStatic *iface, IVoiceInformation **value ) { - FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + struct IVoiceInformation *static_voice; + HRESULT hr; + + TRACE("iface %p, value %p\n", iface, value); + + EnterCriticalSection(&allvoices_cs); + hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, 0, &static_voice); + if (SUCCEEDED(hr)) + hr = voice_information_clone(static_voice, value); + LeaveCriticalSection(&allvoices_cs); + + return hr; } static const struct IInstalledVoicesStaticVtbl installed_voices_static_vtbl = diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index ea1487d379c..a6c7d56e1e1 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -42,7 +42,6 @@ #define AsyncStatus_Closed 4 #define SPERR_WINRT_INTERNAL_ERROR 0x800455a0 -#define SPERR_WINRT_INCORRECT_FORMAT 0x80131537 #define IHandler_RecognitionResult ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionResultGeneratedEventArgs #define IHandler_RecognitionResultVtbl ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionResultGeneratedEventArgsVtbl @@ -203,7 +202,23 @@ HRESULT WINAPI recognition_result_handler_Invoke( IHandler_RecognitionResult *if ISpeechContinuousRecognitionSession *sender, ISpeechContinuousRecognitionResultGeneratedEventArgs *args ) { - trace("iface %p, sender %p, args %p.\n", iface, sender, args); + ISpeechRecognitionResult *result; + HSTRING hstring; + HRESULT hr; + + if (!args) return S_OK; + + hr = ISpeechContinuousRecognitionResultGeneratedEventArgs_get_Result(args, &result); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ISpeechRecognitionResult_get_Text(result, &hstring); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + trace("iface %p, sender %p, args %p, text %s.\n", iface, sender, args, debugstr_w(WindowsGetStringRawBuffer(hstring, NULL))); + + WindowsDeleteString(hstring); + ISpeechRecognitionResult_Release(result); + return S_OK; } @@ -674,6 +689,66 @@ static HRESULT WINAPI iterable_hstring_create_static( struct iterable_hstring *i return S_OK; } +#define check_comparable_presence(a, b) _check_comparable_presence( __LINE__, (a), (b)) +static void _check_comparable_presence( unsigned line, IVectorView_VoiceInformation *voices, IVoiceInformation *voice) +{ + HSTRING in_display, in_id, in_language; + HSTRING vc_display, vc_id, vc_language; + IVoiceInformation *vc_voice; + enum VoiceGender in_gender, vc_gender; + UINT32 size, idx, found_count = 0; + HRESULT hr; + INT32 cmp; + + hr = IVoiceInformation_get_DisplayName(voice, &in_display); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(voice, &in_id); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Language(voice, &in_language); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Gender(voice, &in_gender); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVectorView_VoiceInformation_get_Size(voices, &size); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (idx = 0; SUCCEEDED(hr = IVectorView_VoiceInformation_GetAt(voices, idx, &vc_voice)); idx++) + { + hr = IVoiceInformation_get_DisplayName(vc_voice, &vc_display); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(vc_voice, &vc_id); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Language(vc_voice, &vc_language); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Gender(vc_voice, &vc_gender); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + trace("%u] %s/%s/%s/%u\n", + idx - 1, debugstr_hstring(vc_display), debugstr_hstring(vc_id), debugstr_hstring(vc_language), vc_gender); + + if (SUCCEEDED(WindowsCompareStringOrdinal(in_display, vc_display, &cmp)) && !cmp && + SUCCEEDED(WindowsCompareStringOrdinal(in_id, vc_id, &cmp)) && !cmp && + SUCCEEDED(WindowsCompareStringOrdinal(in_language, vc_language, &cmp)) && !cmp && + in_gender == vc_gender) + { + found_count++; + } + WindowsDeleteString(vc_display); + WindowsDeleteString(vc_id); + WindowsDeleteString(vc_language); + IVoiceInformation_Release(vc_voice); + } + ok(hr == E_BOUNDS, "Got unexpected hr %#lx.\n", hr); + ok(idx != 0, "Vector view shouldn't be empty!\n"); + ok(idx == size, "Incoherent index/size %u/%u!\n", idx, size); + + ok_(__FILE__, line)(found_count == 1, "Found several (%u) instances of %s/%s/%s/%u\n", + found_count, + debugstr_hstring(in_display), debugstr_hstring(in_id), debugstr_hstring(in_language), in_gender); + + WindowsDeleteString(in_display); + WindowsDeleteString(in_id); + WindowsDeleteString(in_language); +} + static void test_ActivationFactory(void) { static const WCHAR *synthesizer_name = L"Windows.Media.SpeechSynthesis.SpeechSynthesizer"; @@ -796,10 +871,12 @@ static void test_SpeechSynthesizer(void) IClosable *closable; struct async_inspectable_handler async_inspectable_handler; HMODULE hdll; - HSTRING str, str2; + HSTRING str, str2, default_voice_id; HRESULT hr; - UINT32 size; + UINT32 size, idx; + BOOLEAN found; ULONG ref; + INT32 cmp; hr = RoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr); @@ -881,7 +958,7 @@ static void test_SpeechSynthesizer(void) size = 0xdeadbeef; hr = IVectorView_VoiceInformation_get_Size(voices, &size); ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#lx\n", hr); - todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size); + ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size); voice = (IVoiceInformation *)0xdeadbeef; hr = IVectorView_VoiceInformation_GetAt(voices, size, &voice); @@ -892,20 +969,27 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#lx\n", hr); ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size); - IVectorView_VoiceInformation_Release(voices); - hr = IInstalledVoicesStatic_get_DefaultVoice(voices_static, &voice); - todo_wine ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice failed, hr %#lx\n", hr); + ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice failed, hr %#lx\n", hr); - if (hr == S_OK) - { - IVoiceInformation_get_Description(voice, &str2); - trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); + /* check that VoiceInformation in static vector voice are not shared when exposed to user */ + idx = size; + hr = IVectorView_VoiceInformation_IndexOf(voices, voice, &idx, &found); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!found, "Shouldn't find default element\n"); - WindowsDeleteString(str2); - ref = IVoiceInformation_Release(voice); - ok(ref == 0, "Got unexpected ref %lu.\n", ref); - } + check_comparable_presence(voices, voice); + + hr = IVoiceInformation_get_Description(voice, &str2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); + WindowsDeleteString(str2); + + hr = IVoiceInformation_get_Id(voice, &default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ref = IVoiceInformation_Release(voice); + ok(ref == 0, "Got unexpected ref %lu.\n", ref); IInstalledVoicesStatic_Release(voices_static); IAgileObject_Release(agile_object); @@ -922,6 +1006,23 @@ static void test_SpeechSynthesizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechSynthesizer, (void **)&synthesizer); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ISpeechSynthesizer_get_Voice(synthesizer, &voice); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IVoiceInformation_get_Id(voice, &str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = WindowsDeleteString(str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + IVoiceInformation_Release(voice); + + hr = WindowsDeleteString(default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + /* Test SynthesizeTextToStreamAsync */ hr = WindowsCreateString(simple_synth_text, wcslen(simple_synth_text), &str); ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr); @@ -996,7 +1097,7 @@ static void test_SpeechSynthesizer(void) operation_ss_stream = (void *)0xdeadbeef; hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &operation_ss_stream); /* Broken on Win 8 + 8.1 */ - ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); + ok(hr == S_OK || broken(hr == COR_E_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); if (hr == S_OK) { @@ -1020,20 +1121,58 @@ static void test_SpeechSynthesizer(void) ISpeechSynthesizerOptions *options; hr = ISpeechSynthesizer2_get_Options(synthesizer2, &options); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) { + ISpeechSynthesizerOptions2 *options2; ISpeechSynthesizerOptions3 *options3; + boolean bool_value; + DOUBLE double_value; + enum SpeechAppendedSilence silence_value; + enum SpeechPunctuationSilence punctuation_value; check_interface(options, &IID_IAgileObject, TRUE); + bool_value = 0xff; + hr = ISpeechSynthesizerOptions_get_IncludeSentenceBoundaryMetadata(options, &bool_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(! bool_value, "Got unepected option %u\n", bool_value); + bool_value = 0xff; + hr = ISpeechSynthesizerOptions_get_IncludeWordBoundaryMetadata(options, &bool_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!bool_value, "Got unepected option %u\n", bool_value); + check_optional_interface(options, &IID_ISpeechSynthesizerOptions2, TRUE); /* Requires Win10 >= 1709 */ + hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions2, (void **)&options2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ISpeechSynthesizerOptions2_get_AudioPitch(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + hr = ISpeechSynthesizerOptions2_get_AudioVolume(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + hr = ISpeechSynthesizerOptions2_get_SpeakingRate(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + ISpeechSynthesizerOptions2_Release(options2); hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions3, (void **)&options3); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1803 */ if (hr == S_OK) { + hr = ISpeechSynthesizerOptions3_get_AppendedSilence(options3, &silence_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(silence_value == SpeechAppendedSilence_Default, "Got unepected option %u\n", silence_value); + + hr = ISpeechSynthesizerOptions3_get_PunctuationSilence(options3, &punctuation_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(punctuation_value == SpeechPunctuationSilence_Default, "Got unepected option %u\n", punctuation_value); + ref = ISpeechSynthesizerOptions3_Release(options3); ok(ref == 2, "Got unexpected ref %lu.\n", ref); } @@ -1184,7 +1323,7 @@ static void test_SpeechRecognizer(void) ok(ref == 1, "Got unexpected ref %lu.\n", ref); hr = RoActivateInstance(hstr, &inspectable); - ok(hr == S_OK || broken(hr == SPERR_WINRT_INTERNAL_ERROR), "Got unexpected hr %#lx.\n", hr); + ok(hr == S_OK || hr == SPERR_WINRT_INTERNAL_ERROR, "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) { @@ -1403,7 +1542,7 @@ static void test_SpeechRecognizer(void) } else if (hr == SPERR_WINRT_INTERNAL_ERROR) /* Not sure when this triggers. Probably if a language pack is not installed. */ { - win_skip("Could not init SpeechRecognizer with default language!\n"); + skip("Could not init SpeechRecognizer with default language!\n"); } done: @@ -1579,7 +1718,7 @@ static void test_Recognition(void) static const WCHAR *list_constraint_name = L"Windows.Media.SpeechRecognition.SpeechRecognitionListConstraint"; static const WCHAR *recognizer_name = L"Windows.Media.SpeechRecognition.SpeechRecognizer"; static const WCHAR *speech_constraint_tag = L"test_message"; - static const WCHAR *speech_constraints[] = { L"This is a test.", L"Number 5!", L"What time is it?" }; + static const WCHAR *speech_constraints[] = { L"This is a test", L"Number 5", L"What time is it" }; ISpeechRecognitionListConstraintFactory *listconstraint_factory = NULL; IAsyncOperation_SpeechRecognitionCompilationResult *operation = NULL; IVector_ISpeechRecognitionConstraint *constraints = NULL; @@ -1620,12 +1759,12 @@ static void test_Recognition(void) ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr); hr = RoActivateInstance(hstr, &inspectable); - ok(hr == S_OK || broken(hr == SPERR_WINRT_INTERNAL_ERROR || hr == REGDB_E_CLASSNOTREG), "Got unexpected hr %#lx.\n", hr); + ok(hr == S_OK || hr == SPERR_WINRT_INTERNAL_ERROR || broken(hr == REGDB_E_CLASSNOTREG), "Got unexpected hr %#lx.\n", hr); WindowsDeleteString(hstr); - if (FAILED(hr)) /* Win 8 and 8.1 and Win10 without enabled SR. */ + if (FAILED(hr)) /* Win 8 and 8.1 and Win10 without enabled SR. Wine with missing Unix side dependencies. */ { - win_skip("SpeechRecognizer cannot be activated!\n"); + skip("SpeechRecognizer cannot be activated!\n"); goto done; } @@ -1742,6 +1881,8 @@ static void test_Recognition(void) ok(hr == S_OK, "ISpeechRecognizer2_get_State failed, hr %#lx.\n", hr); ok(recog_state == SpeechRecognizerState_Capturing || broken(recog_state == SpeechRecognizerState_Idle), "recog_state was %u.\n", recog_state); + + Sleep(10000); /* * TODO: Use a loopback device together with prerecorded audio files to test the recognizer's functionality. */ diff --git a/dlls/windows.media.speech/unixlib.c b/dlls/windows.media.speech/unixlib.c new file mode 100644 index 00000000000..55e48a550ff --- /dev/null +++ b/dlls/windows.media.speech/unixlib.c @@ -0,0 +1,485 @@ +/* + * Unixlib for Windows.Media.Speech + * + * Copyright 2023 Bernhard Kölbl for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef SONAME_LIBVOSK +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#include +#pragma GCC diagnostic pop +#endif + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "winerror.h" +#include "winternl.h" + +#include "wine/debug.h" + +#include "unixlib.h" + +WINE_DEFAULT_DEBUG_CHANNEL(speech); +#ifdef SONAME_LIBVOSK +WINE_DECLARE_DEBUG_CHANNEL(winediag); + +static void *vosk_handle; +#define MAKE_FUNCPTR( f ) static typeof(f) * p_##f +MAKE_FUNCPTR(vosk_model_new); +MAKE_FUNCPTR(vosk_model_free); +MAKE_FUNCPTR(vosk_recognizer_new); +MAKE_FUNCPTR(vosk_recognizer_new_grm); +MAKE_FUNCPTR(vosk_recognizer_free); +MAKE_FUNCPTR(vosk_recognizer_accept_waveform); +MAKE_FUNCPTR(vosk_recognizer_final_result); +MAKE_FUNCPTR(vosk_recognizer_reset); +#undef MAKE_FUNCPTR + +static NTSTATUS process_attach( void *args ) +{ + if (!(vosk_handle = dlopen(SONAME_LIBVOSK, RTLD_NOW))) + { + ERR_(winediag)("Wine is unable to load the Unix side dependencies for speech recognition. " + "Make sure Vosk is installed and up to date on your system and try again.\n"); + return STATUS_DLL_NOT_FOUND; + } + +#define LOAD_FUNCPTR( f ) \ + if (!(p_##f = dlsym(vosk_handle, #f))) \ + { \ + ERR("failed to load %s\n", #f); \ + goto error; \ + } + LOAD_FUNCPTR(vosk_model_new) + LOAD_FUNCPTR(vosk_recognizer_new) + LOAD_FUNCPTR(vosk_recognizer_new_grm) + LOAD_FUNCPTR(vosk_model_free) + LOAD_FUNCPTR(vosk_recognizer_new) + LOAD_FUNCPTR(vosk_recognizer_free) + LOAD_FUNCPTR(vosk_recognizer_accept_waveform) + LOAD_FUNCPTR(vosk_recognizer_final_result) + LOAD_FUNCPTR(vosk_recognizer_reset) +#undef LOAD_FUNCPTR + + return STATUS_SUCCESS; + +error: + dlclose(vosk_handle); + vosk_handle = NULL; + return STATUS_DLL_NOT_FOUND; +} + +static NTSTATUS process_detach( void *args ) +{ + if (vosk_handle) + { + dlclose(vosk_handle); + vosk_handle = NULL; + } + return STATUS_SUCCESS; +} + +static inline speech_recognizer_handle vosk_recognizer_to_handle( VoskRecognizer *recognizer ) +{ + return (speech_recognizer_handle)(UINT_PTR)recognizer; +} + +static inline VoskRecognizer *vosk_recognizer_from_handle( speech_recognizer_handle handle ) +{ + return (VoskRecognizer *)(UINT_PTR)handle; +} + +static const char* map_lang_to_phasmophobia_dir(const char* lang, size_t len) +{ + if (!strncmp(lang, "ar", len)) + return "Arabic"; + if (!strncmp(lang, "ca", len)) + return "Catalan"; + if (!strncmp(lang, "zn", len)) + return "Chinese"; + if (!strncmp(lang, "cs", len)) + return "Czech"; + if (!strncmp(lang, "nl", len)) + return "Dutch"; + if (!strncmp(lang, "en", len)) + return "English"; + if (!strncmp(lang, "fr", len)) + return "French"; + if (!strncmp(lang, "de", len)) + return "German"; + if (!strncmp(lang, "de", len)) + return "German"; + if (!strncmp(lang, "el", len)) + return "Greek"; + if (!strncmp(lang, "it", len)) + return "Italian"; + if (!strncmp(lang, "ja", len)) + return "Japanese"; + if (!strncmp(lang, "pt", len)) + return "Portuguese"; + if (!strncmp(lang, "ru", len)) + return "Russian"; + if (!strncmp(lang, "es", len)) + return "Spanish"; + if (!strncmp(lang, "sw", len)) + return "Swedish"; + if (!strncmp(lang, "tr", len)) + return "Turkish"; + if (!strncmp(lang, "uk", len)) + return "Ukrainian"; + + return ""; +} + +static NTSTATUS find_model_by_locale_and_path( const char *path, const char *locale, VoskModel **model ) +{ + static const char *vosk_model_identifier_small = "vosk-model-small-"; + static const char *vosk_model_identifier = "vosk-model-"; + size_t ident_small_len = strlen(vosk_model_identifier_small); + size_t ident_len = strlen(vosk_model_identifier); + char *ent_name, *model_path, *best_match, *delim, *appid = getenv("SteamAppId"), *str = NULL; + NTSTATUS status = STATUS_UNSUCCESSFUL; + struct dirent *dirent; + size_t path_len, len; + DIR *dir; + + TRACE("path %s, locale %s, model %p.\n", path, debugstr_a(locale), model); + + if (!path || !locale || (len = strlen(locale)) < 4) + return STATUS_UNSUCCESSFUL; + + if (!(dir = opendir(path))) + return STATUS_UNSUCCESSFUL; + + delim = strchr(locale, '-'); + path_len = strlen(path); + best_match = NULL; + *model = NULL; + + while ((dirent = readdir(dir))) + { + ent_name = dirent->d_name; + + if (!strncmp(ent_name, vosk_model_identifier_small, ident_small_len)) + ent_name += ident_small_len; + else if (!strncmp(ent_name, vosk_model_identifier, ident_len)) + ent_name += ident_len; + else if (strcmp(appid, "739630") != 0) + continue; + + /* + * Find the first matching model for lang and region (en-us). + * If there isn't any, pick the first one just matching lang (en). + */ + if (!strncmp(ent_name, locale, len)) + { + if (best_match) free(best_match); + best_match = strdup(dirent->d_name); + break; + } + + if (!best_match && !strncmp(ent_name, locale, delim - locale)) + best_match = strdup(dirent->d_name); + + if (!best_match && !strcmp(appid, "739630")) + { + if ((str = (char *)map_lang_to_phasmophobia_dir(locale, delim - locale))) + best_match = strdup(str); + } + } + + closedir(dir); + + if (!best_match) + return STATUS_UNSUCCESSFUL; + + if (!(model_path = malloc(path_len + 1 /* '/' */ + strlen(best_match) + 1))) + { + status = STATUS_NO_MEMORY; + goto done; + } + + sprintf(model_path, "%s/%s", path, best_match); + + TRACE("trying to load Vosk model %s.\n", debugstr_a(model_path)); + + if ((*model = p_vosk_model_new(model_path)) != NULL) + status = STATUS_SUCCESS; + +done: + free(model_path); + free(best_match); + + return status; +} + +static NTSTATUS find_model_by_locale( const char *locale, VoskModel **model ) +{ + const char *suffix = NULL; + char *env, *path = NULL, *appid = getenv("SteamAppId"); + NTSTATUS status; + + TRACE("locale %s, model %p.\n", debugstr_a(locale), model); + + if (!model) + return STATUS_UNSUCCESSFUL; + + if (!find_model_by_locale_and_path(getenv("VOSK_MODEL_PATH"), locale, model)) + return STATUS_SUCCESS; + if (!find_model_by_locale_and_path("/usr/share/vosk", locale, model)) + return STATUS_SUCCESS; + + if ((env = getenv("XDG_CACHE_HOME"))) + suffix = "/vosk"; + else if ((env = getenv("HOME"))) + suffix = "/.cache/vosk"; + else + return STATUS_UNSUCCESSFUL; + + if (!(path = malloc(strlen(env) + strlen(suffix) + 1))) + return STATUS_NO_MEMORY; + + sprintf(path, "%s%s", env, suffix); + status = find_model_by_locale_and_path(path, locale, model); + free(path); + + /* Hack to load Vosk models from Phasmophobia, so they don't need to be downloaded separately.*/ + if (status && appid && !strcmp(appid, "739630") && (env = getenv("PWD"))) + { + suffix = "/Phasmophobia_Data/StreamingAssets/LanguageModels"; + + if (!(path = malloc(strlen(env) + strlen(suffix) + 1))) + return STATUS_NO_MEMORY; + + sprintf(path, "%s%s", env, suffix); + status = find_model_by_locale_and_path(path, locale, model); + free(path); + } + + return status; +} + +static NTSTATUS grammar_to_json_array(const char **grammar, UINT32 grammar_size, const char **array) +{ + size_t buf_size = strlen("[]") + 1, len; + char *buf; + UINT32 i; + + for (i = 0; i < grammar_size; ++i) + { + buf_size += strlen(grammar[i]) + 4; /* (4) - two double quotes, a comma and a space */ + } + + if (!(buf = malloc(buf_size))) + return STATUS_NO_MEMORY; + + *array = buf; + + *buf = '['; + buf++; + + for (i = 0; i < grammar_size; ++i) + { + *buf = '\"'; + buf++; + len = strlen(grammar[i]); + memcpy(buf, grammar[i], len); + buf += len; + *buf = '\"'; + buf++; + if (i < (grammar_size - 1)) + { + *buf = ','; + buf++; + *buf = ' '; + buf++; + } + } + + *buf = ']'; + buf++; + *buf = '\0'; + + return STATUS_SUCCESS; +} + +static NTSTATUS speech_create_recognizer( void *args ) +{ + struct speech_create_recognizer_params *params = args; + VoskRecognizer *recognizer = NULL; + VoskModel *model = NULL; + NTSTATUS status = STATUS_SUCCESS; + const char *grammar_json; + + TRACE("args %p.\n", args); + + if (!vosk_handle) + return STATUS_NOT_SUPPORTED; + + if ((status = find_model_by_locale(params->locale, &model))) + return status; + + if (params->grammar && grammar_to_json_array(params->grammar, params->grammar_size, &grammar_json) == STATUS_SUCCESS) + { + if (!(recognizer = p_vosk_recognizer_new_grm(model, params->sample_rate, grammar_json))) + status = STATUS_UNSUCCESSFUL; + } + else + { + if (!(recognizer = p_vosk_recognizer_new(model, params->sample_rate))) + status = STATUS_UNSUCCESSFUL; + } + + /* VoskModel is reference-counted. A VoskRecognizer keeps a reference to its model. */ + p_vosk_model_free(model); + + params->handle = vosk_recognizer_to_handle(recognizer); + return status; +} + +static NTSTATUS speech_release_recognizer( void *args ) +{ + struct speech_release_recognizer_params *params = args; + + TRACE("args %p.\n", args); + + if (!vosk_handle) + return STATUS_NOT_SUPPORTED; + + p_vosk_recognizer_free(vosk_recognizer_from_handle(params->handle)); + + return STATUS_SUCCESS; +} + +static NTSTATUS speech_recognize_audio( void *args ) +{ + struct speech_recognize_audio_params *params = args; + VoskRecognizer *recognizer = vosk_recognizer_from_handle(params->handle); + + if (!vosk_handle) + return STATUS_NOT_SUPPORTED; + + if (!recognizer) + return STATUS_UNSUCCESSFUL; + + params->status = p_vosk_recognizer_accept_waveform(recognizer, (const char *)params->samples, params->samples_size); + + return STATUS_SUCCESS; +} + +static NTSTATUS speech_get_recognition_result( void* args ) +{ + struct speech_get_recognition_result_params *params = args; + VoskRecognizer *recognizer = vosk_recognizer_from_handle(params->handle); + static const char *result_json_start = "{\n \"text\" : \""; + const size_t json_start_len = strlen(result_json_start); + static size_t last_result_len = 0; + static char *last_result = NULL; + const char *tmp = NULL; + + if (!vosk_handle) + return STATUS_NOT_SUPPORTED; + + if (!recognizer) + return STATUS_UNSUCCESSFUL; + + if (!last_result) + { + if ((tmp = p_vosk_recognizer_final_result(recognizer))) + { + last_result = strdup(tmp); + tmp = last_result; + + /* Operations to remove the JSON wrapper "{\n \"text\" : \"some recognized text\"\n}" -> "some recognized text\0" */ + memmove(last_result, last_result + json_start_len, strlen(last_result) - json_start_len + 1); + last_result = strrchr(last_result, '\"'); + last_result[0] = '\0'; + + last_result = (char *)tmp; + last_result_len = strlen(last_result); + } + else return STATUS_NOT_FOUND; + } + else if (params->result_buf_size >= last_result_len + 1) + { + memcpy(params->result_buf, last_result, last_result_len + 1); + p_vosk_recognizer_reset(recognizer); + + free (last_result); + last_result = NULL; + + return STATUS_SUCCESS; + } + + params->result_buf_size = last_result_len + 1; + return STATUS_BUFFER_TOO_SMALL; +} + +#else /* SONAME_LIBVOSK */ + +#define MAKE_UNSUPPORTED_FUNC( f ) \ + static NTSTATUS f( void *args ) \ + { \ + ERR("wine was compiled without Vosk support. Speech recognition won't work.\n"); \ + return STATUS_NOT_SUPPORTED; \ + } + +MAKE_UNSUPPORTED_FUNC(process_attach) +MAKE_UNSUPPORTED_FUNC(process_detach) +MAKE_UNSUPPORTED_FUNC(speech_create_recognizer) +MAKE_UNSUPPORTED_FUNC(speech_release_recognizer) +MAKE_UNSUPPORTED_FUNC(speech_recognize_audio) +MAKE_UNSUPPORTED_FUNC(speech_get_recognition_result) +#undef MAKE_UNSUPPORTED_FUNC + +#endif /* SONAME_LIBVOSK */ + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + process_attach, + process_detach, + speech_create_recognizer, + speech_release_recognizer, + speech_recognize_audio, + speech_get_recognition_result, +}; + +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + process_attach, + process_detach, + speech_create_recognizer, + speech_release_recognizer, + speech_recognize_audio, + speech_get_recognition_result, +}; diff --git a/dlls/windows.media.speech/unixlib.h b/dlls/windows.media.speech/unixlib.h new file mode 100644 index 00000000000..ad2fab738b9 --- /dev/null +++ b/dlls/windows.media.speech/unixlib.h @@ -0,0 +1,81 @@ +/* + * Unix library interface for Windows.Media.Speech + * + * Copyright 2023 Bernhard Kölbl for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_WINDOWS_MEDIA_SPEECH_UNIXLIB_H +#define __WINE_WINDOWS_MEDIA_SPEECH_UNIXLIB_H + +#include +#include + +#include "windef.h" +#include "winternl.h" +#include "wtypes.h" + +#include "wine/unixlib.h" + +typedef UINT64 speech_recognizer_handle; + +struct speech_create_recognizer_params +{ + speech_recognizer_handle handle; + CHAR locale[LOCALE_NAME_MAX_LENGTH]; + FLOAT sample_rate; + const char **grammar; + unsigned int grammar_size; +}; + +struct speech_release_recognizer_params +{ + speech_recognizer_handle handle; +}; + +enum speech_recognition_status +{ + RECOGNITION_STATUS_CONTINUING, + RECOGNITION_STATUS_RESULT_AVAILABLE, + RECOGNITION_STATUS_EXCEPTION, +}; + +struct speech_recognize_audio_params +{ + speech_recognizer_handle handle; + const BYTE *samples; + UINT32 samples_size; + enum speech_recognition_status status; +}; + +struct speech_get_recognition_result_params +{ + speech_recognizer_handle handle; + char *result_buf; + UINT32 result_buf_size; +}; + +enum vosk_funcs +{ + unix_process_attach, + unix_process_detach, + unix_speech_create_recognizer, + unix_speech_release_recognizer, + unix_speech_recognize_audio, + unix_speech_get_recognition_result, +}; + +#endif diff --git a/dlls/windows.perception.stub/Makefile.in b/dlls/windows.perception.stub/Makefile.in index 18c90e697c4..9583b64bb89 100644 --- a/dlls/windows.perception.stub/Makefile.in +++ b/dlls/windows.perception.stub/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.perception.stub.dll -IMPORTS = combase +IMPORTS = combase user32 SOURCES = \ classes.idl \ diff --git a/dlls/windows.perception.stub/holographicspace.c b/dlls/windows.perception.stub/holographicspace.c index 8a12147f4a8..f51be10a9c1 100644 --- a/dlls/windows.perception.stub/holographicspace.c +++ b/dlls/windows.perception.stub/holographicspace.c @@ -27,6 +27,7 @@ struct holographicspace IActivationFactory IActivationFactory_iface; IHolographicSpaceStatics2 IHolographicSpaceStatics2_iface; IHolographicSpaceStatics3 IHolographicSpaceStatics3_iface; + IHolographicSpaceInterop IHolographicSpaceInterop_iface; LONG ref; }; @@ -65,6 +66,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; } + if (IsEqualGUID( iid, &IID_IHolographicSpaceInterop )) + { + *out = &impl->IHolographicSpaceInterop_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -193,11 +201,39 @@ static const struct IHolographicSpaceStatics3Vtbl holographicspace_statics3_vtbl holographicspace_statics3_get_IsConfigured, }; +DEFINE_IINSPECTABLE( holographicspace_interop, IHolographicSpaceInterop, struct holographicspace, IActivationFactory_iface ) + +static HRESULT WINAPI holographicspace_interop_CreateForWindow( IHolographicSpaceInterop *iface, + HWND window, REFIID iid, void **holographic_space ) +{ + FIXME( "iface %p, window %p, iid %s, holographic_space %p.\n", iface, window, debugstr_guid( iid ), holographic_space ); + + FIXME( "HACK: Setting WS_EX_NOACTIVATE for %p.\n", window ); + SetWindowLongW( window, GWL_EXSTYLE, WS_EX_NOACTIVATE ); + + *holographic_space = NULL; + return E_NOTIMPL; +} + +static const struct IHolographicSpaceInteropVtbl holographicspace_interop_vtbl = +{ + holographicspace_interop_QueryInterface, + holographicspace_interop_AddRef, + holographicspace_interop_Release, + /* IInspectable methods */ + holographicspace_interop_GetIids, + holographicspace_interop_GetRuntimeClassName, + holographicspace_interop_GetTrustLevel, + /* IHolographicSpaceInterop methods */ + holographicspace_interop_CreateForWindow, +}; + static struct holographicspace holographicspace_statics = { {&factory_vtbl}, {&holographicspace_statics2_vtbl}, {&holographicspace_statics3_vtbl}, + {&holographicspace_interop_vtbl}, 1, }; diff --git a/dlls/windows.perception.stub/private.h b/dlls/windows.perception.stub/private.h index a6ae62916e1..ceaa2944174 100644 --- a/dlls/windows.perception.stub/private.h +++ b/dlls/windows.perception.stub/private.h @@ -36,6 +36,7 @@ #include "windows.perception.spatial.surfaces.h" #define WIDL_using_Windows_Graphics_Holographic #include "windows.graphics.holographic.h" +#include "holographicspaceinterop.h" extern IActivationFactory *observer_factory; extern IActivationFactory *holographicspace_factory; diff --git a/dlls/windows.perception.stub/tests/perception.c b/dlls/windows.perception.stub/tests/perception.c index d0bee4eb247..8714f44be4a 100644 --- a/dlls/windows.perception.stub/tests/perception.c +++ b/dlls/windows.perception.stub/tests/perception.c @@ -32,6 +32,7 @@ #include "windows.perception.spatial.surfaces.h" #define WIDL_using_Windows_Graphics_Holographic #include "windows.graphics.holographic.h" +#include "holographicspaceinterop.h" #include "wine/test.h" @@ -121,6 +122,7 @@ static void test_HolographicSpaceStatics(void) check_interface( factory, &IID_IUnknown ); check_interface( factory, &IID_IInspectable ); check_interface( factory, &IID_IAgileObject ); + check_interface( factory, &IID_IHolographicSpaceInterop ); hr = IActivationFactory_QueryInterface( factory, &IID_IHolographicSpaceStatics2, (void **)&holographicspace_statics2 ); if (hr == E_NOINTERFACE) /* win1607 */ diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index 9da717fc345..76db7439db1 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -398,4 +398,9 @@ extern HRESULT CommonDecoder_CreateInstance(struct decoder *decoder, extern HRESULT CommonEncoder_CreateInstance(struct encoder *encoder, const struct encoder_info *encoder_info, REFIID iid, void** ppv); +#ifdef _WIN64 +#undef setjmp +#define setjmp(buf) _setjmpex(buf, NULL) +#endif + #endif /* WINCODECS_PRIVATE_H */ diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index 94fc3c6fa4b..285d7ecf6de 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -2532,6 +2532,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = alsa_set_volumes, alsa_set_event_handle, alsa_not_implemented, + alsa_not_implemented, alsa_is_started, alsa_get_prop_value, alsa_not_implemented, @@ -2988,6 +2989,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = alsa_wow64_set_volumes, alsa_wow64_set_event_handle, alsa_not_implemented, + alsa_not_implemented, alsa_is_started, alsa_wow64_get_prop_value, alsa_not_implemented, diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c index 9f369094949..1606afb3f86 100644 --- a/dlls/wineandroid.drv/keyboard.c +++ b/dlls/wineandroid.drv/keyboard.c @@ -671,6 +671,7 @@ static BOOL get_async_key_state( BYTE state[256] ) static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags ) { + RAWINPUT rawinput; INPUT input; input.type = INPUT_KEYBOARD; @@ -680,7 +681,7 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags ) input.ki.time = 0; input.ki.dwExtraInfo = 0; - __wine_send_input( hwnd, &input, NULL ); + __wine_send_input( hwnd, &input, &rawinput ); } /*********************************************************************** diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index d62a2c53909..47a424b40b8 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -421,6 +421,7 @@ static int process_events( DWORD mask ) DPI_AWARENESS_CONTEXT context; struct java_event *event, *next, *previous; unsigned int count = 0; + RAWINPUT rawinput; assert( GetCurrentThreadId() == desktop_tid ); @@ -514,7 +515,7 @@ static int process_events( DWORD mask ) } SERVER_END_REQ; } - __wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input, NULL ); + __wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input, &rawinput ); } break; @@ -528,7 +529,7 @@ static int process_events( DWORD mask ) event->data.kbd.input.ki.wVk, event->data.kbd.input.ki.wVk, event->data.kbd.input.ki.wScan ); update_keyboard_lock_state( event->data.kbd.input.ki.wVk, event->data.kbd.lock_state ); - __wine_send_input( 0, &event->data.kbd.input, NULL ); + __wine_send_input( 0, &event->data.kbd.input, &rawinput ); break; default: diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index ed9d3aed4bd..f37c2593f2b 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -114,6 +114,8 @@ MAKE_FUNCPTR(SDL_GameControllerAddMapping); MAKE_FUNCPTR(SDL_RegisterEvents); MAKE_FUNCPTR(SDL_PushEvent); MAKE_FUNCPTR(SDL_GetTicks); +MAKE_FUNCPTR(SDL_LogSetPriority); +MAKE_FUNCPTR(SDL_SetHintWithPriority); static int (*pSDL_JoystickRumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); static int (*pSDL_JoystickRumbleTriggers)(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); @@ -197,7 +199,7 @@ static void set_hat_value(struct unix_device *iface, int index, int value) hid_device_set_hatswitch_y(iface, index, y); } -static BOOL descriptor_add_haptic(struct sdl_device *impl) +static BOOL descriptor_add_haptic(struct sdl_device *impl, BOOL force) { USHORT i, count = 0; USAGE usages[16]; @@ -226,16 +228,16 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl) if ((impl->effect_support & EFFECT_SUPPORT_PHYSICAL)) { /* SDL_HAPTIC_SQUARE doesn't exist */ - if (impl->effect_support & SDL_HAPTIC_SINE) usages[count++] = PID_USAGE_ET_SINE; - if (impl->effect_support & SDL_HAPTIC_TRIANGLE) usages[count++] = PID_USAGE_ET_TRIANGLE; - if (impl->effect_support & SDL_HAPTIC_SAWTOOTHUP) usages[count++] = PID_USAGE_ET_SAWTOOTH_UP; - if (impl->effect_support & SDL_HAPTIC_SAWTOOTHDOWN) usages[count++] = PID_USAGE_ET_SAWTOOTH_DOWN; - if (impl->effect_support & SDL_HAPTIC_SPRING) usages[count++] = PID_USAGE_ET_SPRING; - if (impl->effect_support & SDL_HAPTIC_DAMPER) usages[count++] = PID_USAGE_ET_DAMPER; - if (impl->effect_support & SDL_HAPTIC_INERTIA) usages[count++] = PID_USAGE_ET_INERTIA; - if (impl->effect_support & SDL_HAPTIC_FRICTION) usages[count++] = PID_USAGE_ET_FRICTION; - if (impl->effect_support & SDL_HAPTIC_CONSTANT) usages[count++] = PID_USAGE_ET_CONSTANT_FORCE; - if (impl->effect_support & SDL_HAPTIC_RAMP) usages[count++] = PID_USAGE_ET_RAMP; + if (force || (impl->effect_support & SDL_HAPTIC_SINE)) usages[count++] = PID_USAGE_ET_SINE; + if (force || (impl->effect_support & SDL_HAPTIC_TRIANGLE)) usages[count++] = PID_USAGE_ET_TRIANGLE; + if (force || (impl->effect_support & SDL_HAPTIC_SAWTOOTHUP)) usages[count++] = PID_USAGE_ET_SAWTOOTH_UP; + if (force || (impl->effect_support & SDL_HAPTIC_SAWTOOTHDOWN)) usages[count++] = PID_USAGE_ET_SAWTOOTH_DOWN; + if (force || (impl->effect_support & SDL_HAPTIC_SPRING)) usages[count++] = PID_USAGE_ET_SPRING; + if (force || (impl->effect_support & SDL_HAPTIC_DAMPER)) usages[count++] = PID_USAGE_ET_DAMPER; + if (force || (impl->effect_support & SDL_HAPTIC_INERTIA)) usages[count++] = PID_USAGE_ET_INERTIA; + if (force || (impl->effect_support & SDL_HAPTIC_FRICTION)) usages[count++] = PID_USAGE_ET_FRICTION; + if (force || (impl->effect_support & SDL_HAPTIC_CONSTANT)) usages[count++] = PID_USAGE_ET_CONSTANT_FORCE; + if (force || (impl->effect_support & SDL_HAPTIC_RAMP)) usages[count++] = PID_USAGE_ET_RAMP; if (!hid_device_add_physical(&impl->unix_device, usages, count)) return FALSE; @@ -246,6 +248,13 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl) return TRUE; } +static const USAGE_AND_PAGE g920_absolute_usages[] = +{ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X}, /* wheel */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Y}, /* accelerator */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Z}, /* brake */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_RZ}, /* clutch */ +}; static const USAGE_AND_PAGE absolute_axis_usages[] = { {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X}, @@ -270,6 +279,18 @@ static const USAGE_AND_PAGE relative_axis_usages[] = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_WHEEL}, }; +static int get_absolute_usages(struct sdl_device *impl, const USAGE_AND_PAGE **absolute_usages) +{ + if (is_logitech_g920(pSDL_JoystickGetVendor(impl->sdl_joystick), pSDL_JoystickGetProduct(impl->sdl_joystick))) + { + *absolute_usages = g920_absolute_usages; + return ARRAY_SIZE(g920_absolute_usages); + } + + *absolute_usages = absolute_axis_usages; + return ARRAY_SIZE(absolute_axis_usages); +} + static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) { const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_JOYSTICK}; @@ -277,12 +298,15 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) int i, button_count, axis_count, ball_count, hat_count; USAGE_AND_PAGE physical_usage; + const USAGE_AND_PAGE *absolute_usages = NULL; + size_t absolute_usages_count = get_absolute_usages(impl, &absolute_usages); + axis_count = pSDL_JoystickNumAxes(impl->sdl_joystick); if (options.split_controllers) axis_count = min(6, axis_count - impl->axis_offset); - if (axis_count > ARRAY_SIZE(absolute_axis_usages)) + if (axis_count > absolute_usages_count) { - FIXME("More than %zu absolute axes found, ignoring.\n", ARRAY_SIZE(absolute_axis_usages)); - axis_count = ARRAY_SIZE(absolute_axis_usages); + FIXME("More than %zu absolute axes found, ignoring.\n", absolute_usages_count); + axis_count = absolute_usages_count; } ball_count = pSDL_JoystickNumBalls(impl->sdl_joystick); @@ -338,8 +362,8 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) for (i = 0; i < axis_count; i++) { - if (!hid_device_add_axes(iface, 1, absolute_axis_usages[i].UsagePage, - &absolute_axis_usages[i].Usage, FALSE, -32768, 32767)) + if (!hid_device_add_axes(iface, 1, absolute_usages[i].UsagePage, + &absolute_usages[i].Usage, FALSE, -32768, 32767)) return STATUS_NO_MEMORY; } @@ -359,7 +383,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) if (!hid_device_end_input_report(iface)) return STATUS_NO_MEMORY; - if (!descriptor_add_haptic(impl)) + if (!descriptor_add_haptic(impl, physical_usage.Usage == HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE)) return STATUS_NO_MEMORY; if (!hid_device_end_report_descriptor(iface)) @@ -413,7 +437,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) if (!hid_device_end_input_report(iface)) return STATUS_NO_MEMORY; - if (!descriptor_add_haptic(impl)) + if (!descriptor_add_haptic(impl, FALSE)) return STATUS_NO_MEMORY; if (!hid_device_end_report_descriptor(iface)) @@ -592,7 +616,7 @@ static NTSTATUS sdl_device_physical_effect_control(struct unix_device *iface, BY TRACE("iface %p, index %u, control %04x, iterations %u.\n", iface, index, control, iterations); - if (impl->effect_ids[index] < 0) return STATUS_UNSUCCESSFUL; + if (id < 0) return STATUS_SUCCESS; switch (control) { @@ -938,8 +962,10 @@ static void sdl_add_device(unsigned int index) SDL_Joystick* joystick; SDL_JoystickID id; + SDL_JoystickType joystick_type; SDL_GameController *controller = NULL; - const char *product, *sdl_serial; + const char *product, *sdl_serial, *str, *env; + BOOL expose_steam_controller = (env = getenv("PROTON_EXPOSE_STEAM_CONTROLLER")) && atoi(env) == 1; char guid_str[33], buffer[ARRAY_SIZE(desc.product)]; int axis_count, axis_offset; @@ -949,7 +975,10 @@ static void sdl_add_device(unsigned int index) return; } - if (options.map_controllers && pSDL_IsGameController(index)) + joystick_type = pSDL_JoystickGetType(joystick); + if (options.map_controllers && pSDL_IsGameController(index) + && joystick_type != SDL_JOYSTICK_TYPE_WHEEL + && joystick_type != SDL_JOYSTICK_TYPE_FLIGHT_STICK) controller = pSDL_GameControllerOpen(index); if (controller) product = pSDL_GameControllerName(controller); @@ -958,7 +987,8 @@ static void sdl_add_device(unsigned int index) id = pSDL_JoystickInstanceID(joystick); - if (pSDL_JoystickGetProductVersion != NULL) { + if (pSDL_JoystickGetProductVersion != NULL) + { desc.vid = pSDL_JoystickGetVendor(joystick); desc.pid = pSDL_JoystickGetProduct(joystick); desc.version = pSDL_JoystickGetProductVersion(joystick); @@ -970,6 +1000,35 @@ static void sdl_add_device(unsigned int index) desc.version = 0; } + if (is_sdl_blacklisted(desc.vid, desc.pid)) + { + /* this device is blacklisted */ + TRACE("ignoring %s, in SDL blacklist\n", debugstr_device_desc(&desc)); + return; + } + + if (is_wine_blacklisted(desc.vid, desc.pid)) + { + /* this device is blacklisted */ + TRACE("ignoring %s, in Wine blacklist\n", debugstr_device_desc(&desc)); + return; + } + + if (desc.vid == 0x28de && desc.pid == 0x11ff && !expose_steam_controller) + { + TRACE("Steam virtual controller, pretending it's an Xbox 360 controller\n"); + desc.vid = 0x045e; + desc.pid = 0x028e; + } + + /* CW-Bug-Id: #20528 Check steam virtual controller indexes to keep them ordered */ + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if ((str = pSDL_JoystickName(joystick)) && sscanf(str, "Microsoft X-Box 360 pad %u", &desc.input) == 1) + { + if (!expose_steam_controller) desc.input++; + desc.version = 0; /* keep version fixed as 0 so we can hardcode it in ntdll rawinput pipe redirection */ + } + if (pSDL_JoystickGetSerial && (sdl_serial = pSDL_JoystickGetSerial(joystick))) { ntdll_umbstowcs(sdl_serial, strlen(sdl_serial) + 1, desc.serialnumber, ARRAY_SIZE(desc.serialnumber)); @@ -979,8 +1038,15 @@ static void sdl_add_device(unsigned int index) /* Overcooked! All You Can Eat only adds controllers with unique serial numbers * Prefer keeping serial numbers unique over keeping them consistent across runs */ pSDL_JoystickGetGUIDString(pSDL_JoystickGetGUID(joystick), guid_str, sizeof(guid_str)); - snprintf(buffer, sizeof(buffer), "%s.%d", guid_str, index); - TRACE("Making up serial number for %s: %s\n", product, buffer); + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (desc.input != -1) snprintf(buffer, sizeof(buffer), "%s", guid_str); + else + { + snprintf(buffer, sizeof(buffer), "%s.%d", guid_str, index); + TRACE("Making up serial number for %s: %s\n", product, buffer); + } + ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc.serialnumber, ARRAY_SIZE(desc.serialnumber)); } @@ -1130,6 +1196,8 @@ NTSTATUS sdl_bus_init(void *args) LOAD_FUNCPTR(SDL_RegisterEvents); LOAD_FUNCPTR(SDL_PushEvent); LOAD_FUNCPTR(SDL_GetTicks); + LOAD_FUNCPTR(SDL_LogSetPriority); + LOAD_FUNCPTR(SDL_SetHintWithPriority); #undef LOAD_FUNCPTR pSDL_JoystickRumble = dlsym(sdl_handle, "SDL_JoystickRumble"); pSDL_JoystickRumbleTriggers = dlsym(sdl_handle, "SDL_JoystickRumbleTriggers"); @@ -1139,6 +1207,10 @@ NTSTATUS sdl_bus_init(void *args) pSDL_JoystickGetType = dlsym(sdl_handle, "SDL_JoystickGetType"); pSDL_JoystickGetSerial = dlsym(sdl_handle, "SDL_JoystickGetSerial"); + /* CW-Bug-Id: #23185: Disable SDL 2.30 new behavior, we need the steam virtual + * controller name to figure which slot number it represents. */ + pSDL_SetHintWithPriority("SteamVirtualGamepadInfo", "", SDL_HINT_OVERRIDE); + if (pSDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) < 0) { ERR("could not init SDL: %s\n", pSDL_GetError()); @@ -1151,6 +1223,11 @@ NTSTATUS sdl_bus_init(void *args) goto failed; } + if (TRACE_ON(hid)) + { + pSDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE); + } + pSDL_JoystickEventState(SDL_ENABLE); pSDL_GameControllerEventState(SDL_ENABLE); diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 34b3305ed88..5da979c6c5a 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -25,6 +25,7 @@ #include "config.h" #include #include +#include #include #include #include @@ -555,6 +556,302 @@ static struct base_device *find_device_from_syspath(const char *path) #define test_bit(arr,bit) (((BYTE*)(arr))[(bit)>>3]&(1<<((bit)&7))) +/* Minimal compatibility with code taken from steam-runtime-tools */ +typedef int gboolean; +#define g_debug(fmt, ...) TRACE(fmt "\n", ## __VA_ARGS__) +#define G_N_ELEMENTS(arr) (sizeof(arr)/sizeof(arr[0])) + +typedef enum +{ + SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK = (1 << 0), + SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER = (1 << 1), + SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD = (1 << 2), + SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS = (1 << 3), + SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE = (1 << 4), + SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD = (1 << 5), + SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN = (1 << 6), + SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET = (1 << 7), + SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET_PAD = (1 << 8), + SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK = (1 << 9), + SRT_INPUT_DEVICE_TYPE_FLAGS_SWITCH = (1 << 10), + SRT_INPUT_DEVICE_TYPE_FLAGS_NONE = 0 +} SrtInputDeviceTypeFlags; + +#define BITS_PER_LONG (sizeof (unsigned long) * CHAR_BIT) +#define LONGS_FOR_BITS(x) ((((x)-1)/BITS_PER_LONG)+1) +typedef struct +{ + unsigned long ev[LONGS_FOR_BITS (EV_MAX)]; + unsigned long keys[LONGS_FOR_BITS (KEY_MAX)]; + unsigned long abs[LONGS_FOR_BITS (ABS_MAX)]; + unsigned long rel[LONGS_FOR_BITS (REL_MAX)]; + unsigned long ff[LONGS_FOR_BITS (FF_MAX)]; + unsigned long props[LONGS_FOR_BITS (INPUT_PROP_MAX)]; +} SrtEvdevCapabilities; + +static gboolean +_srt_get_caps_from_evdev (int fd, + unsigned int type, + unsigned long *bitmask, + size_t bitmask_len_longs) +{ + size_t bitmask_len_bytes = bitmask_len_longs * sizeof (*bitmask); + + memset (bitmask, 0, bitmask_len_bytes); + + if (ioctl (fd, EVIOCGBIT (type, bitmask_len_bytes), bitmask) < 0) + return FALSE; + + return TRUE; +} + +static gboolean +_srt_evdev_capabilities_set_from_evdev (SrtEvdevCapabilities *caps, + int fd) +{ + if (_srt_get_caps_from_evdev (fd, 0, caps->ev, G_N_ELEMENTS (caps->ev))) + { + _srt_get_caps_from_evdev (fd, EV_KEY, caps->keys, G_N_ELEMENTS (caps->keys)); + _srt_get_caps_from_evdev (fd, EV_ABS, caps->abs, G_N_ELEMENTS (caps->abs)); + _srt_get_caps_from_evdev (fd, EV_REL, caps->rel, G_N_ELEMENTS (caps->rel)); + _srt_get_caps_from_evdev (fd, EV_FF, caps->ff, G_N_ELEMENTS (caps->ff)); + ioctl (fd, EVIOCGPROP (sizeof (caps->props)), caps->props); + return TRUE; + } + + memset (caps, 0, sizeof (*caps)); + return FALSE; +} + +#define JOYSTICK_ABS_AXES \ + ((1 << ABS_X) | (1 << ABS_Y) \ + | (1 << ABS_RX) | (1 << ABS_RY) \ + | (1 << ABS_THROTTLE) | (1 << ABS_RUDDER) \ + | (1 << ABS_WHEEL) | (1 << ABS_GAS) | (1 << ABS_BRAKE) \ + | (1 << ABS_HAT0X) | (1 << ABS_HAT0Y) \ + | (1 << ABS_HAT1X) | (1 << ABS_HAT1Y) \ + | (1 << ABS_HAT2X) | (1 << ABS_HAT2Y) \ + | (1 << ABS_HAT3X) | (1 << ABS_HAT3Y)) + +static const unsigned int first_mouse_button = BTN_MOUSE; +static const unsigned int last_mouse_button = BTN_JOYSTICK - 1; + +static const unsigned int first_joystick_button = BTN_JOYSTICK; +static const unsigned int last_joystick_button = BTN_GAMEPAD - 1; + +static const unsigned int first_gamepad_button = BTN_GAMEPAD; +static const unsigned int last_gamepad_button = BTN_DIGI - 1; + +static const unsigned int first_dpad_button = BTN_DPAD_UP; +static const unsigned int last_dpad_button = BTN_DPAD_RIGHT; + +static const unsigned int first_extra_joystick_button = BTN_TRIGGER_HAPPY; +static const unsigned int last_extra_joystick_button = BTN_TRIGGER_HAPPY40; + +SrtInputDeviceTypeFlags +_srt_evdev_capabilities_guess_type (const SrtEvdevCapabilities *caps) +{ + SrtInputDeviceTypeFlags flags = SRT_INPUT_DEVICE_TYPE_FLAGS_NONE; + unsigned int i; + gboolean has_joystick_axes = FALSE; + gboolean has_joystick_buttons = FALSE; + + /* Some properties let us be fairly sure about a device */ + if (test_bit (caps->props, INPUT_PROP_ACCELEROMETER)) + { + g_debug ("INPUT_PROP_ACCELEROMETER => is accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + + if (test_bit (caps->props, INPUT_PROP_POINTING_STICK)) + { + g_debug ("INPUT_PROP_POINTING_STICK => is pointing stick"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK; + } + + if (test_bit (caps->props, INPUT_PROP_BUTTONPAD) + || test_bit (caps->props, INPUT_PROP_TOPBUTTONPAD)) + { + g_debug ("INPUT_PROP_[TOP]BUTTONPAD => is touchpad"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD; + } + + /* Devices with a stylus or pen are assumed to be graphics tablets */ + if (test_bit (caps->keys, BTN_STYLUS) + || test_bit (caps->keys, BTN_TOOL_PEN)) + { + g_debug ("Stylus or pen => is tablet"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET; + } + + /* Devices that accept a finger touch are assumed to be touchpads or + * touchscreens. + * + * In Steam we mostly only care about these as a way to + * reject non-joysticks, so we're not very precise here yet. + * + * SDL assumes that TOUCH means a touchscreen and FINGER + * means a touchpad. */ + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE + && (test_bit (caps->keys, BTN_TOOL_FINGER) + || test_bit (caps->keys, BTN_TOUCH) + || test_bit (caps->props, INPUT_PROP_SEMI_MT))) + { + g_debug ("Finger or touch or semi-MT => is touchpad or touchscreen"); + + if (test_bit (caps->props, INPUT_PROP_POINTER)) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD; + else + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN; + } + + /* Devices with mouse buttons are ... probably mice? */ + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE) + { + for (i = first_mouse_button; i <= last_mouse_button; i++) + { + if (test_bit (caps->keys, i)) + { + g_debug ("Mouse button => mouse"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE; + } + } + } + + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE) + { + for (i = ABS_X; i < ABS_Z; i++) + { + if (!test_bit (caps->abs, i)) + break; + } + + /* If it has 3 axes and no buttons it's probably an accelerometer. */ + if (i == ABS_Z && !test_bit (caps->ev, EV_KEY)) + { + g_debug ("3 left axes and no buttons => accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + + /* Same for RX..RZ (e.g. Wiimote) */ + for (i = ABS_RX; i < ABS_RZ; i++) + { + if (!test_bit (caps->abs, i)) + break; + } + + if (i == ABS_RZ && !test_bit (caps->ev, EV_KEY)) + { + g_debug ("3 right axes and no buttons => accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + } + + /* Bits 1 to 31 are ESC, numbers and Q to D, which SDL and udev both + * consider to be enough to count as a fully-functioned keyboard. */ + if ((caps->keys[0] & 0xfffffffe) == 0xfffffffe) + { + g_debug ("First few keys => keyboard"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD; + } + + /* If we have *any* keys, consider it to be something a bit + * keyboard-like. Bits 0 to 63 are all keyboard keys. + * Make sure we stop before reaching KEY_UP which is sometimes + * used on game controller mappings, e.g. for the Wiimote. */ + for (i = 0; i < (64 / BITS_PER_LONG); i++) + { + if (caps->keys[i] != 0) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS; + } + + if (caps->abs[0] & JOYSTICK_ABS_AXES) + has_joystick_axes = TRUE; + + /* Flight stick buttons */ + for (i = first_joystick_button; i <= last_joystick_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Gamepad buttons (Xbox, PS3, etc.) */ + for (i = first_gamepad_button; i <= last_gamepad_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Gamepad digital dpad */ + for (i = first_dpad_button; i <= last_dpad_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Steering wheel gear-change buttons */ + for (i = BTN_GEAR_DOWN; i <= BTN_GEAR_UP; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Reserved space for extra game-controller buttons, e.g. on Corsair + * gaming keyboards */ + for (i = first_extra_joystick_button; i <= last_extra_joystick_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + if (test_bit (caps->keys, last_mouse_button)) + { + /* Mice with a very large number of buttons can apparently + * overflow into the joystick-button space, but they're still not + * joysticks. */ + has_joystick_buttons = FALSE; + } + + /* TODO: Do we want to consider BTN_0 up to BTN_9 to be joystick buttons? + * libmanette and SDL look for BTN_1, udev does not. + * + * They're used by some game controllers, like BTN_1 and BTN_2 for the + * Wiimote, BTN_1..BTN_9 for the SpaceTec SpaceBall and BTN_0..BTN_3 + * for Playstation dance pads, but they're also used by + * non-game-controllers like Logitech mice. For now we entirely ignore + * these buttons: they are not evidence that it's a joystick, but + * neither are they evidence that it *isn't* a joystick. */ + + /* We consider it to be a joystick if there is some evidence that it is, + * and no evidence that it's something else. + * + * Unlike SDL, we accept devices with only axes and no buttons as a + * possible joystick, unless they have X/Y/Z axes in which case we + * assume they're accelerometers. */ + if ((has_joystick_buttons || has_joystick_axes) + && (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE)) + { + g_debug ("Looks like a joystick"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK; + } + + /* If we have *any* keys below BTN_MISC, consider it to be something + * a bit keyboard-like, but don't rule out *also* being considered + * to be a joystick (again for e.g. the Wiimote). */ + for (i = 0; i < (BTN_MISC / BITS_PER_LONG); i++) + { + if (caps->keys[i] != 0) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS; + } + + /* Also non-exclusive: don't rule out a device being a joystick and + * having a switch */ + if (test_bit (caps->ev, EV_SW)) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_SWITCH; + + return flags; +} + static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) { static const USAGE_AND_PAGE Unknown = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = 0}; @@ -565,6 +862,7 @@ static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) static const USAGE_AND_PAGE Tablet = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_PEN}; static const USAGE_AND_PAGE Touchscreen = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_SCREEN}; static const USAGE_AND_PAGE Touchpad = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_PAD}; + SrtEvdevCapabilities caps; struct udev_device *parent = dev; @@ -589,6 +887,33 @@ static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) parent = udev_device_get_parent_with_subsystem_devtype(parent, "input", NULL); } + /* In a container, udev properties might not be available. Fall back to deriving the device + * type from the fd's evdev capabilities. */ + if (_srt_evdev_capabilities_set_from_evdev (&caps, fd)) + { + SrtInputDeviceTypeFlags guessed_type; + + guessed_type = _srt_evdev_capabilities_guess_type (&caps); + + if (guessed_type & (SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE + | SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK)) + return &Mouse; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD) + return &Keyboard; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK) + return &Gamepad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS) + return &Keypad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD) + return &Touchpad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN) + return &Touchscreen; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET) + return &Tablet; + + /* Mapped to Unknown: ACCELEROMETER, TABLET_PAD, SWITCH. */ + } + return &Unknown; } @@ -1297,6 +1622,7 @@ static void udev_add_device(struct udev_device *dev, int fd) const char *subsystem; const char *devnode; int bus = 0; + int axes = -1, buttons = -1; if (!(devnode = udev_device_get_devnode(dev))) { @@ -1319,6 +1645,9 @@ static void udev_add_device(struct udev_device *dev, int fd) close(fd); return; } + + axes = count_abs_axis(fd); + buttons = count_buttons(fd, NULL); #endif get_device_subsystem_info(dev, "hid", &desc, &bus); @@ -1372,16 +1701,22 @@ static void udev_add_device(struct udev_device *dev, int fd) memcpy(desc.serialnumber, zeros, sizeof(zeros)); } - if (is_xbox_gamepad(desc.vid, desc.pid)) - desc.is_gamepad = TRUE; + if (!is_hidraw_enabled(desc.vid, desc.pid, axes, buttons)) + { + TRACE("hidraw %s: deferring %s to a different backend\n", debugstr_a(devnode), debugstr_device_desc(&desc)); + close(fd); + return; + } + if (is_sdl_blacklisted(desc.vid, desc.pid)) + { + /* this device is blacklisted */ + TRACE("hidraw %s: ignoring %s, in SDL blacklist\n", debugstr_a(devnode), debugstr_device_desc(&desc)); + close(fd); + return; + } #ifdef HAS_PROPER_INPUT_HEADER else - { - int axes=0, buttons=0; - axes = count_abs_axis(fd); - buttons = count_buttons(fd, NULL); desc.is_gamepad = (axes == 6 && buttons >= 14); - } #endif TRACE("dev %p, node %s, desc %s.\n", dev, debugstr_a(devnode), debugstr_device_desc(&desc)); @@ -1765,6 +2100,12 @@ NTSTATUS udev_bus_init(void *args) goto error; } + if (access("/run/pressure-vessel", R_OK) || access("/.flatpak-info", R_OK)) + { + TRACE("Container detected, bypassing udevd by default\n"); + options.disable_udevd = TRUE; + } + #ifdef HAVE_SYS_INOTIFY_H if (options.disable_udevd) monitor_fd = create_inotify(); if (monitor_fd < 0) options.disable_udevd = FALSE; diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index 6d2b484ccca..d31718c6293 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -209,13 +209,14 @@ static BOOL hid_device_add_hatswitch_count(struct unix_device *iface, BYTE count ERR("hatswitches should be added before buttons!\n"); else if ((iface->hid_device_state.bit_size % 8)) ERR("hatswitches should be byte aligned, missing padding!\n"); - else if (iface->hid_device_state.bit_size + 8 * count > 0x80000) + else if (iface->hid_device_state.bit_size + 4 * (count + 1) > 0x80000) ERR("report size overflow, too many elements!\n"); else { if (!iface->hid_device_state.hatswitch_count) iface->hid_device_state.hatswitch_start = offset; iface->hid_device_state.hatswitch_count += count; - iface->hid_device_state.bit_size += 8 * count; + iface->hid_device_state.bit_size += 4 * count; + if (count % 2) iface->hid_device_state.bit_size += 4; return TRUE; } @@ -231,16 +232,28 @@ BOOL hid_device_add_hatswitch(struct unix_device *iface, INT count) USAGE(1, HID_USAGE_GENERIC_HATSWITCH), LOGICAL_MINIMUM(1, 1), LOGICAL_MAXIMUM(1, 8), - REPORT_SIZE(1, 8), + REPORT_SIZE(1, 4), REPORT_COUNT(4, count), - UNIT(1, 0x0e /* none */), + UNIT(1, 0x0), /* None */ INPUT(1, Data|Var|Abs|Null), }; + const BYTE template_pad[] = + { + REPORT_COUNT(1, 4), + REPORT_SIZE(1, 1), + INPUT(1, Cnst|Ary|Abs), + }; if (!hid_device_add_hatswitch_count(iface, count)) return FALSE; - return hid_report_descriptor_append(desc, template, sizeof(template)); + if (!hid_report_descriptor_append(desc, template, sizeof(template))) + return FALSE; + + if ((count % 2) && !hid_report_descriptor_append(desc, template_pad, sizeof(template_pad))) + return FALSE; + + return TRUE; } static BOOL hid_device_add_axis_count(struct unix_device *iface, BOOL rel, BYTE count, @@ -1409,8 +1422,9 @@ BOOL hid_device_set_button(struct unix_device *iface, ULONG index, BOOL is_set) * +1 | 6 5 4 * v */ -static void hatswitch_decompose(BYTE value, LONG *x, LONG *y) +static void hatswitch_decompose(BYTE value, ULONG index, LONG *x, LONG *y) { + value = (index % 2) ? (value >> 4) : (value & 0x0f); *x = *y = 0; if (value == 8 || value == 1 || value == 2) *y = -1; if (value == 6 || value == 5 || value == 4) *y = +1; @@ -1418,49 +1432,61 @@ static void hatswitch_decompose(BYTE value, LONG *x, LONG *y) if (value == 2 || value == 3 || value == 4) *x = +1; } -static void hatswitch_compose(LONG x, LONG y, BYTE *value) +static void hatswitch_compose(LONG x, LONG y, BYTE *value, ULONG index) { - if (x == 0 && y == 0) *value = 0; - else if (x == 0 && y < 0) *value = 1; - else if (x > 0 && y < 0) *value = 2; - else if (x > 0 && y == 0) *value = 3; - else if (x > 0 && y > 0) *value = 4; - else if (x == 0 && y > 0) *value = 5; - else if (x < 0 && y > 0) *value = 6; - else if (x < 0 && y == 0) *value = 7; - else if (x < 0 && y < 0) *value = 8; + BYTE new_value = 0; + if (x == 0 && y == 0) new_value = 0; + else if (x == 0 && y < 0) new_value = 1; + else if (x > 0 && y < 0) new_value = 2; + else if (x > 0 && y == 0) new_value = 3; + else if (x > 0 && y > 0) new_value = 4; + else if (x == 0 && y > 0) new_value = 5; + else if (x < 0 && y > 0) new_value = 6; + else if (x < 0 && y == 0) new_value = 7; + else if (x < 0 && y < 0) new_value = 8; + + if (index % 2) + { + *value &= 0xf; + *value |= new_value << 4; + } + else + { + *value &= 0xf0; + *value |= new_value; + } } BOOL hid_device_set_hatswitch_x(struct unix_device *iface, ULONG index, LONG new_x) { struct hid_device_state *state = &iface->hid_device_state; - ULONG offset = state->hatswitch_start + index; + ULONG offset = state->hatswitch_start + index / 2; LONG x, y; if (index > state->hatswitch_count) return FALSE; - hatswitch_decompose(state->report_buf[offset], &x, &y); - hatswitch_compose(new_x, y, &state->report_buf[offset]); + hatswitch_decompose(state->report_buf[offset], index, &x, &y); + hatswitch_compose(new_x, y, &state->report_buf[offset], index); return TRUE; } BOOL hid_device_set_hatswitch_y(struct unix_device *iface, ULONG index, LONG new_y) { struct hid_device_state *state = &iface->hid_device_state; - ULONG offset = state->hatswitch_start + index; + ULONG offset = state->hatswitch_start + index / 2; LONG x, y; if (index > state->hatswitch_count) return FALSE; - hatswitch_decompose(state->report_buf[offset], &x, &y); - hatswitch_compose(x, new_y, &state->report_buf[offset]); + hatswitch_decompose(state->report_buf[offset], index, &x, &y); + hatswitch_compose(x, new_y, &state->report_buf[offset], index); return TRUE; } BOOL hid_device_move_hatswitch(struct unix_device *iface, ULONG index, LONG x, LONG y) { struct hid_device_state *state = &iface->hid_device_state; - ULONG offset = state->hatswitch_start + index; + ULONG offset = state->hatswitch_start + index / 2; LONG old_x, old_y; if (index > state->hatswitch_count) return FALSE; - hatswitch_decompose(state->report_buf[offset], &old_x, &old_y); - hatswitch_compose(old_x + x, old_y + y, &state->report_buf[offset]); + hatswitch_decompose(state->report_buf[offset], index, &old_x, &old_y); + hatswitch_compose(old_x + x, old_y + y, &state->report_buf[offset], index); return TRUE; } diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index e5adfed8611..dae6850415d 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -71,6 +71,7 @@ struct device_extension { struct list entry; DEVICE_OBJECT *device; + const WCHAR *bus_name; CRITICAL_SECTION cs; enum device_state state; @@ -189,7 +190,10 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device) WCHAR *dst; if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) - swprintf(dst, len, L"%i&%s&%x&%i", ext->desc.version, ext->desc.serialnumber, ext->desc.uid, ext->index); + { + swprintf(dst, len, L"%u&%s&%x&%u&%u", ext->desc.version, ext->desc.serialnumber, + ext->desc.uid, ext->index, ext->desc.is_gamepad); + } return dst; } @@ -283,7 +287,7 @@ static void remove_pending_irps(DEVICE_OBJECT *device) } } -static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, UINT64 unix_device) +static DEVICE_OBJECT *bus_create_hid_device(const WCHAR *bus_name, struct device_desc *desc, UINT64 unix_device) { struct device_extension *ext; DEVICE_OBJECT *device; @@ -306,6 +310,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, UINT64 uni /* fill out device_extension struct */ ext = (struct device_extension *)device->DeviceExtension; + ext->bus_name = bus_name; ext->device = device; ext->desc = *desc; ext->index = get_device_index(desc); @@ -334,6 +339,17 @@ static DEVICE_OBJECT *bus_find_unix_device(UINT64 unix_device) return NULL; } +static DEVICE_OBJECT *bus_find_device_from_vid_pid(const WCHAR *bus_name, struct device_desc *desc) +{ + struct device_extension *ext; + + LIST_FOR_EACH_ENTRY(ext, &device_list, struct device_extension, entry) + if (!wcscmp(ext->bus_name, bus_name) && ext->desc.vid == desc->vid && + ext->desc.pid == desc->pid) return ext->device; + + return NULL; +} + static void bus_unlink_hid_device(DEVICE_OBJECT *device) { struct device_extension *ext = (struct device_extension *)device->DeviceExtension; @@ -520,7 +536,7 @@ static void mouse_device_create(void) struct device_create_params params = {{0}}; if (winebus_call(mouse_create, ¶ms)) return; - mouse_obj = bus_create_hid_device(¶ms.desc, params.device); + mouse_obj = bus_create_hid_device(L"WINEBUS", ¶ms.desc, params.device); IoInvalidateDeviceRelations(bus_pdo, BusRelations); } @@ -529,7 +545,7 @@ static void keyboard_device_create(void) struct device_create_params params = {{0}}; if (winebus_call(keyboard_create, ¶ms)) return; - keyboard_obj = bus_create_hid_device(¶ms.desc, params.device); + keyboard_obj = bus_create_hid_device(L"WINEBUS", ¶ms.desc, params.device); IoInvalidateDeviceRelations(bus_pdo, BusRelations); } @@ -577,7 +593,20 @@ static DWORD CALLBACK bus_main_thread(void *args) IoInvalidateDeviceRelations(bus_pdo, BusRelations); break; case BUS_EVENT_TYPE_DEVICE_CREATED: - device = bus_create_hid_device(&event->device_created.desc, event->device); + RtlEnterCriticalSection(&device_list_cs); + if (!wcscmp(bus.name, L"SDL")) + { + if (bus_find_device_from_vid_pid(L"UDEV", &event->device_created.desc)) device = NULL; + else device = bus_create_hid_device(bus.name, &event->device_created.desc, event->device); + } + else if (!wcscmp(bus.name, L"UDEV")) + { + if ((device = bus_find_device_from_vid_pid(L"SDL", &event->device_created.desc))) + bus_unlink_hid_device(device); + device = bus_create_hid_device(bus.name, &event->device_created.desc, event->device); + } + else device = bus_create_hid_device(bus.name, &event->device_created.desc, event->device); + RtlLeaveCriticalSection(&device_list_cs); if (device) IoInvalidateDeviceRelations(bus_pdo, BusRelations); else { @@ -749,7 +778,7 @@ static NTSTATUS udev_driver_init(void) bus_options.disable_hidraw = check_bus_option(L"DisableHidraw", 0); if (bus_options.disable_hidraw) TRACE("UDEV hidraw devices disabled in registry\n"); - bus_options.disable_input = check_bus_option(L"DisableInput", 0); + bus_options.disable_input = check_bus_option(L"DisableInput", 1); if (bus_options.disable_input) TRACE("UDEV input devices disabled in registry\n"); bus_options.disable_udevd = check_bus_option(L"DisableUdevd", 0); if (bus_options.disable_udevd) TRACE("UDEV udevd use disabled in registry\n"); @@ -785,11 +814,9 @@ static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) mouse_device_create(); keyboard_device_create(); - if (!check_bus_option(L"Enable SDL", 1) || sdl_driver_init()) - { - udev_driver_init(); - iohid_driver_init(); - } + udev_driver_init(); + iohid_driver_init(); + sdl_driver_init(); irp->IoStatus.Status = STATUS_SUCCESS; break; diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index 1ec414cce73..a70c5fc8a95 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -266,8 +266,11 @@ extern void hid_device_drop_report(struct unix_device *iface); extern void hid_device_set_effect_state(struct unix_device *iface, BYTE index, BYTE flags); -BOOL is_xbox_gamepad(WORD vid, WORD pid); +BOOL is_sdl_blacklisted(WORD vid, WORD pid); +BOOL is_wine_blacklisted(WORD vid, WORD pid); BOOL is_dualshock4_gamepad(WORD vid, WORD pid); BOOL is_dualsense_gamepad(WORD vid, WORD pid); +BOOL is_logitech_g920(WORD vid, WORD pid); +BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons); #endif /* __WINEBUS_UNIX_PRIVATE_H */ diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index 82eab3717ca..223e96f3821 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -38,26 +38,27 @@ #include "unix_private.h" -BOOL is_xbox_gamepad(WORD vid, WORD pid) -{ - if (vid != 0x045e) return FALSE; - if (pid == 0x0202) return TRUE; /* Xbox Controller */ - if (pid == 0x0285) return TRUE; /* Xbox Controller S */ - if (pid == 0x0289) return TRUE; /* Xbox Controller S */ - if (pid == 0x028e) return TRUE; /* Xbox360 Controller */ - if (pid == 0x028f) return TRUE; /* Xbox360 Wireless Controller */ - if (pid == 0x02d1) return TRUE; /* Xbox One Controller */ - if (pid == 0x02dd) return TRUE; /* Xbox One Controller (Covert Forces/Firmware 2015) */ - if (pid == 0x02e0) return TRUE; /* Xbox One X Controller */ - if (pid == 0x02e3) return TRUE; /* Xbox One Elite Controller */ - if (pid == 0x02e6) return TRUE; /* Wireless XBox Controller Dongle */ - if (pid == 0x02ea) return TRUE; /* Xbox One S Controller */ - if (pid == 0x02fd) return TRUE; /* Xbox One S Controller (Firmware 2017) */ - if (pid == 0x0b00) return TRUE; /* Xbox Elite 2 */ - if (pid == 0x0b05) return TRUE; /* Xbox Elite 2 Wireless */ - if (pid == 0x0b12) return TRUE; /* Xbox Series */ - if (pid == 0x0b13) return TRUE; /* Xbox Series Wireless */ - if (pid == 0x0719) return TRUE; /* Xbox 360 Wireless Adapter */ +BOOL is_wine_blacklisted(WORD vid, WORD pid) +{ + if (vid == 0x056a) return TRUE; /* all Wacom devices */ + return FALSE; +} + +/* logic from SDL2's SDL_ShouldIgnoreGameController */ +BOOL is_sdl_blacklisted(WORD vid, WORD pid) +{ + const char *allow_virtual = getenv("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD"); + const char *whitelist = getenv("SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"); + const char *blacklist = getenv("SDL_GAMECONTROLLER_IGNORE_DEVICES"); + char needle[16]; + + if (vid == 0x28de && pid == 0x11ff && allow_virtual && *allow_virtual && + *allow_virtual != '0' && strcasecmp(allow_virtual, "false")) + return FALSE; + + sprintf(needle, "0x%04x/0x%04x", vid, pid); + if (whitelist) return strcasestr(whitelist, needle) == NULL; + if (blacklist) return strcasestr(blacklist, needle) != NULL; return FALSE; } @@ -78,6 +79,77 @@ BOOL is_dualsense_gamepad(WORD vid, WORD pid) return FALSE; } +BOOL is_logitech_g920(WORD vid, WORD pid) +{ + return vid == 0x046D && pid == 0xC262; +} + +static BOOL is_thrustmaster_hotas(WORD vid, WORD pid) +{ + return vid == 0x044F && (pid == 0xB679 || pid == 0xB687 || pid == 0xB10A); +} + +static BOOL is_simucube_wheel(WORD vid, WORD pid) +{ + if (vid != 0x16D0) return FALSE; + if (pid == 0x0D61) return TRUE; /* Simucube 2 Sport */ + if (pid == 0x0D60) return TRUE; /* Simucube 2 Pro */ + if (pid == 0x0D5F) return TRUE; /* Simucube 2 Ultimate */ + if (pid == 0x0D5A) return TRUE; /* Simucube 1 */ + return FALSE; +} + +static BOOL is_fanatec_pedals(WORD vid, WORD pid) +{ + if (vid != 0x0EB7) return FALSE; + if (pid == 0x183B) return TRUE; /* Fanatec ClubSport Pedals v3 */ + if (pid == 0x1839) return TRUE; /* Fanatec ClubSport Pedals v1/v2 */ + return FALSE; +} + +static BOOL is_vkb_controller(WORD vid, WORD pid, INT buttons) +{ + if (vid != 0x231D) return FALSE; + + /* comes with 128 buttons in the default configuration */ + if (buttons == 128) return TRUE; + + /* if customized, less than 128 buttons may be shown, decide by PID */ + if (pid == 0x0200) return TRUE; /* VKBsim Gladiator EVO Right Grip */ + if (pid == 0x0201) return TRUE; /* VKBsim Gladiator EVO Left Grip */ + return FALSE; +} + +static BOOL is_virpil_controller(WORD vid, WORD pid, INT buttons) +{ + if (vid != 0x3344) return FALSE; + + /* comes with 31 buttons in the default configuration, or 128 max */ + if ((buttons == 31) || (buttons == 128)) return TRUE; + + /* if customized, arbitrary amount of buttons may be shown, decide by PID */ + if (pid == 0x412f) return TRUE; /* Virpil Constellation ALPHA-R */ + return FALSE; +} + +BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons) +{ + const char *enabled = getenv("PROTON_ENABLE_HIDRAW"); + char needle[16]; + + if (is_dualshock4_gamepad(vid, pid)) return TRUE; + if (is_dualsense_gamepad(vid, pid)) return TRUE; + if (is_thrustmaster_hotas(vid, pid)) return TRUE; + if (is_simucube_wheel(vid, pid)) return TRUE; + if (is_fanatec_pedals(vid, pid)) return TRUE; + if (is_vkb_controller(vid, pid, buttons)) return TRUE; + if (is_virpil_controller(vid, pid, buttons)) return TRUE; + + sprintf(needle, "0x%04x/0x%04x", vid, pid); + if (enabled) return strcasestr(enabled, needle) != NULL; + return FALSE; +} + struct mouse_device { struct unix_device unix_device; diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index d78744455a8..375d53b968f 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -1873,6 +1873,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = unix_set_volumes, unix_set_event_handle, unix_not_implemented, + unix_not_implemented, unix_is_started, unix_get_prop_value, unix_midi_init, @@ -2328,6 +2329,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = unix_wow64_set_volumes, unix_wow64_set_event_handle, unix_not_implemented, + unix_not_implemented, unix_is_started, unix_wow64_get_prop_value, unix_wow64_midi_init, diff --git a/dlls/winecrt0/debug.c b/dlls/winecrt0/debug.c index 2ac4505fb85..fe516e088c5 100644 --- a/dlls/winecrt0/debug.c +++ b/dlls/winecrt0/debug.c @@ -30,6 +30,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); static const char * (__cdecl *p__wine_dbg_strdup)( const char *str ); static int (__cdecl *p__wine_dbg_output)( const char *str ); @@ -189,7 +190,16 @@ static int __cdecl fallback__wine_dbg_header( enum __wine_debug_class cls, /* skip header if partial line and no other thread came in between */ if (partial_line_tid == GetCurrentThreadId()) return 0; - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + static LARGE_INTEGER frequency; + LARGE_INTEGER counter, microsecs; + if (!frequency.QuadPart) QueryPerformanceFrequency(&frequency); + QueryPerformanceCounter(&counter); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { UINT ticks = GetTickCount(); pos += sprintf( pos, "%3u.%03u:", ticks / 1000, ticks % 1000 ); diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 57c6085c10a..052ff32d850 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1369,7 +1369,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d access |= WINED3D_RESOURCE_ACCESS_MAP_W; if (FAILED(hr = resource_init(resource, device, WINED3D_RTYPE_BUFFER, format, - WINED3D_MULTISAMPLE_NONE, 0, desc->usage, desc->bind_flags, access, + WINED3D_MULTISAMPLE_NONE, 0, desc->usage & ~WINED3DUSAGE_PRIVATE, desc->bind_flags, access, desc->byte_width, 1, 1, desc->byte_width, parent, parent_ops, &buffer_resource_ops))) { WARN("Failed to initialize resource, hr %#lx.\n", hr); @@ -1382,8 +1382,8 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d TRACE("buffer %p, size %#x, usage %#x, memory @ %p.\n", buffer, buffer->resource.size, buffer->resource.usage, buffer->resource.heap_memory); - if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING - || (desc->usage & WINED3DUSAGE_MANAGED)) + if (!(desc->usage & WINED3DUSAGE_PRIVATE) && (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING + || (desc->usage & WINED3DUSAGE_MANAGED))) { /* SWvp and managed buffers always return the same pointer in buffer * maps and retain data in DISCARD maps. Keep a system memory copy of @@ -1760,7 +1760,7 @@ static HRESULT wined3d_streaming_buffer_prepare(struct wined3d_device *device, TRACE("Growing buffer to %u bytes.\n", size); desc.byte_width = size; - desc.usage = WINED3DUSAGE_DYNAMIC; + desc.usage = WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_PRIVATE; desc.bind_flags = buffer->bind_flags; desc.access = WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_MAP_W; desc.misc_flags = 0; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4aeade1d2de..0177c5ced43 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5346,7 +5346,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL } else if (message == WM_DISPLAYCHANGE) { + BOOL inside_mode_change = wined3d_set_inside_mode_change(window, TRUE); + device->device_parent->ops->mode_changed(device->device_parent); + wined3d_set_inside_mode_change(window, inside_mode_change); } else if (message == WM_ACTIVATEAPP) { @@ -5356,8 +5359,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL * (e.g. Deus Ex: GOTY) to destroy the device, so take care to * deactivate the implicit swapchain last, and to avoid accessing the * "device" pointer afterwards. */ - while (i--) - wined3d_swapchain_activate(device->swapchains[i], wparam); + if (!wparam || !wined3d_get_activate_processed(window)) + { + wined3d_set_activate_processed(window, !!wparam); + while (i--) + wined3d_swapchain_activate(device->swapchains[i], wparam); + } } else if (message == WM_SYSCOMMAND) { @@ -5369,6 +5376,11 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL DefWindowProcA(window, message, wparam, lparam); } } + else if (message == WM_SIZE && !wined3d_get_inside_mode_change(window)) + { + if (!IsIconic(window)) + PostMessageW(window, WM_ACTIVATEAPP, 1, GetCurrentThreadId()); + } if (unicode) return CallWindowProcW(proc, window, message, wparam, lparam); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index ab4fa04b3cf..8af03012ed4 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -544,7 +544,7 @@ static const struct wined3d_gpu_description gpu_description_table[] = {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_21, "Radeon RX 6800/6800 XT / 6900 XT", DRIVER_AMD_RX, 16384}, {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620, "Radeon Pro V620", DRIVER_AMD_RX, 32768}, {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620_VF, "Radeon Pro V620 VF", DRIVER_AMD_RX, 32768}, - {HW_VENDOR_AMD, CARD_AMD_VANGOGH, "AMD VANGOGH", DRIVER_AMD_RX, 4096}, + {HW_VENDOR_AMD, CARD_AMD_VANGOGH, "AMD Radeon VANGOGH", DRIVER_AMD_RX, 4096}, {HW_VENDOR_AMD, CARD_AMD_RAPHAEL, "AMD Radeon(TM) Graphics", DRIVER_AMD_RX, 4096}, /* Red Hat */ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5dfcbb689b7..ba722a5fa84 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2561,6 +2561,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c shader_addline(buffer, ";\n"); } } + shader_addline(buffer, "const float FLT_MAX = 1e38;\n"); } /* Prototypes */ @@ -4214,9 +4215,10 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) { DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, ins->ctx->reg_maps->shader_version.minor); + struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *buffer = ins->ctx->buffer; + struct wined3d_string_buffer *prefix, *suffix; struct glsl_src_param src0_param; - const char *prefix, *suffix; unsigned int dst_size; DWORD dst_write_mask; @@ -4228,41 +4230,53 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) shader_glsl_add_src_param(ins, &ins->src[0], dst_write_mask, &src0_param); + prefix = string_buffer_get(priv->string_buffers); + suffix = string_buffer_get(priv->string_buffers); + switch (ins->handler_idx) { case WINED3DSIH_EXP: case WINED3DSIH_EXPP: - prefix = "exp2("; - suffix = ")"; + string_buffer_sprintf(prefix, "exp2("); + string_buffer_sprintf(suffix, ")"); break; case WINED3DSIH_LOG: case WINED3DSIH_LOGP: - prefix = "log2(abs("; - suffix = "))"; + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? -FLT_MAX : log2(abs(", src0_param.param_str); + else + string_buffer_sprintf(prefix, "log2(abs("); + string_buffer_sprintf(suffix, "))"); break; case WINED3DSIH_RCP: - prefix = "1.0 / "; - suffix = ""; + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? FLT_MAX : 1.0 / ", src0_param.param_str); + else + string_buffer_sprintf(prefix, "1.0 / "); break; case WINED3DSIH_RSQ: - prefix = "inversesqrt(abs("; - suffix = "))"; + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? FLT_MAX : inversesqrt(abs(", src0_param.param_str); + else + string_buffer_sprintf(prefix, "inversesqrt(abs("); + string_buffer_sprintf(suffix, "))"); break; default: - prefix = ""; - suffix = ""; FIXME("Unhandled instruction %#x.\n", ins->handler_idx); break; } if (dst_size > 1 && shader_version < WINED3D_SHADER_VERSION(4, 0)) - shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix, src0_param.param_str, suffix); + shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix->buffer, src0_param.param_str, suffix->buffer); else - shader_addline(buffer, "%s%s%s);\n", prefix, src0_param.param_str, suffix); + shader_addline(buffer, "%s%s%s);\n", prefix->buffer, src0_param.param_str, suffix->buffer); + + string_buffer_release(priv->string_buffers, prefix); + string_buffer_release(priv->string_buffers, suffix); } /** Process the WINED3DSIO_EXPP instruction in GLSL: diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 8a02847c840..6e9e5af7254 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2191,7 +2191,6 @@ static void set_window_state(struct wined3d_window_state *s) static const UINT timeout = 1500; DWORD window_tid = GetWindowThreadProcessId(s->window, NULL); DWORD tid = GetCurrentThreadId(); - HANDLE thread; TRACE("Window %p belongs to thread %#lx.\n", s->window, window_tid); /* If the window belongs to a different thread, modifying the style and/or @@ -2209,18 +2208,8 @@ static void set_window_state(struct wined3d_window_state *s) else KillTimer(s->window, WINED3D_WINDOW_TOPMOST_TIMER_ID); } - - set_window_state_thread(s); - } - else if ((thread = CreateThread(NULL, 0, set_window_state_thread, s, 0, NULL))) - { - SetThreadDescription(thread, L"wined3d_set_window_state"); - CloseHandle(thread); - } - else - { - ERR("Failed to create thread.\n"); } + set_window_state_thread(s); } HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state, diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 1368b4fc905..83fa519f3e5 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -42,6 +42,8 @@ struct wined3d_wndproc HWND window; BOOL unicode; BOOL filter; + BOOL activate_processed; + BOOL inside_mode_change; WNDPROC proc; struct wined3d_device *device; uint32_t flags; @@ -633,6 +635,73 @@ BOOL wined3d_filter_messages(HWND window, BOOL filter) return ret; } +BOOL wined3d_get_activate_processed(HWND window) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->activate_processed; + wined3d_wndproc_mutex_unlock(); + return ret; +} + +void wined3d_set_activate_processed(HWND window, BOOL activate_processed) +{ + struct wined3d_wndproc *entry; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return; + } + entry->activate_processed = activate_processed; + wined3d_wndproc_mutex_unlock(); +} + +BOOL wined3d_get_inside_mode_change(HWND window) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->inside_mode_change; + wined3d_wndproc_mutex_unlock(); + return ret; +} + +BOOL wined3d_set_inside_mode_change(HWND window, BOOL inside_mode_change) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->inside_mode_change; + entry->inside_mode_change = inside_mode_change; + wined3d_wndproc_mutex_unlock(); + return ret; +} + static LRESULT CALLBACK wined3d_wndproc(HWND window, UINT message, WPARAM wparam, LPARAM lparam) { struct wined3d_wndproc *entry; @@ -769,6 +838,8 @@ BOOL CDECL wined3d_register_window(struct wined3d *wined3d, HWND window, entry->device = device; entry->wined3d = wined3d; entry->flags = flags; + entry->activate_processed = FALSE; + entry->inside_mode_change = FALSE; wined3d_wndproc_mutex_unlock(); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 238456e78d8..55ef62a92b9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2785,6 +2785,10 @@ struct wined3d BOOL wined3d_filter_messages(HWND window, BOOL filter); HRESULT wined3d_init(struct wined3d *wined3d, uint32_t flags); void wined3d_unregister_window(HWND window); +BOOL wined3d_get_activate_processed(HWND window); +void wined3d_set_activate_processed(HWND window, BOOL activate_processed); +BOOL wined3d_get_inside_mode_change(HWND window); +BOOL wined3d_set_inside_mode_change(HWND window, BOOL inside_mode_change); BOOL wined3d_get_app_name(char *app_name, unsigned int app_name_size); diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 02b1b04fdf9..f76a7fb35f2 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -7,13 +7,13 @@ UNIX_CFLAGS = $(GSTREAMER_CFLAGS) UNIX_LIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS) SOURCES = \ - aac_decoder.c \ + audio_decoder.c \ color_convert.c \ - h264_decoder.c \ main.c \ media_sink.c \ media_source.c \ mfplat.c \ + new_media_source.c \ quartz_parser.c \ quartz_transform.c \ resampler.c \ @@ -26,8 +26,17 @@ SOURCES = \ wg_muxer.c \ wg_parser.c \ wg_sample.c \ + wg_source.c \ + wg_task_pool.c \ wg_transform.c \ winegstreamer_classes.idl \ wm_reader.c \ wma_decoder.c \ - wmv_decoder.c + wmv_decoder.c \ + media-converter/audioconv.c \ + media-converter/audioconvbin.c \ + media-converter/fossilize.c \ + media-converter/lib.c \ + media-converter/murmur3.c \ + media-converter/protondemuxer.c \ + media-converter/videoconv.c diff --git a/dlls/winegstreamer/aac_decoder.c b/dlls/winegstreamer/audio_decoder.c similarity index 68% rename from dlls/winegstreamer/aac_decoder.c rename to dlls/winegstreamer/audio_decoder.c index dfab7a8b0c0..771eae465fe 100644 --- a/dlls/winegstreamer/aac_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -32,22 +32,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); WINE_DECLARE_DEBUG_CHANNEL(winediag); -static struct -{ - const GUID *const guid; - UINT32 payload_type; -} aac_decoder_input_types[] = -{ - {&MFAudioFormat_AAC, 0}, - {&MFAudioFormat_RAW_AAC, -1}, - {&MFAudioFormat_AAC, 1}, - {&MFAudioFormat_AAC, 3}, - {&MFAudioFormat_ADTS, -1}, -}; -static const GUID *const aac_decoder_output_types[] = +#define NEXT_WAVEFORMATEXTENSIBLE(format) (WAVEFORMATEXTENSIBLE *)((BYTE *)(&(format)->Format + 1) + (format)->Format.cbSize) + +static WAVEFORMATEXTENSIBLE const audio_decoder_output_types[] = { - &MFAudioFormat_PCM, - &MFAudioFormat_Float, + {.Format = {.wFormatTag = WAVE_FORMAT_IEEE_FLOAT, .wBitsPerSample = 32, .nSamplesPerSec = 48000, .nChannels = 2}}, + {.Format = {.wFormatTag = WAVE_FORMAT_PCM, .wBitsPerSample = 16, .nSamplesPerSec = 48000, .nChannels = 2}}, }; static const UINT32 default_channel_mask[7] = @@ -61,10 +51,14 @@ static const UINT32 default_channel_mask[7] = KSAUDIO_SPEAKER_5POINT1, }; -struct aac_decoder +struct audio_decoder { IMFTransform IMFTransform_iface; LONG refcount; + + UINT input_type_count; + WAVEFORMATEXTENSIBLE *input_types; + IMFMediaType *input_type; IMFMediaType *output_type; @@ -72,12 +66,12 @@ struct aac_decoder struct wg_sample_queue *wg_sample_queue; }; -static struct aac_decoder *impl_from_IMFTransform(IMFTransform *iface) +static struct audio_decoder *impl_from_IMFTransform(IMFTransform *iface) { - return CONTAINING_RECORD(iface, struct aac_decoder, IMFTransform_iface); + return CONTAINING_RECORD(iface, struct audio_decoder, IMFTransform_iface); } -static HRESULT try_create_wg_transform(struct aac_decoder *decoder) +static HRESULT try_create_wg_transform(struct audio_decoder *decoder) { struct wg_format input_format, output_format; struct wg_transform_attrs attrs = {0}; @@ -102,7 +96,7 @@ static HRESULT try_create_wg_transform(struct aac_decoder *decoder) static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); @@ -121,7 +115,7 @@ static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, static ULONG WINAPI transform_AddRef(IMFTransform *iface) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); ULONG refcount = InterlockedIncrement(&decoder->refcount); TRACE("iface %p increasing refcount to %lu.\n", decoder, refcount); return refcount; @@ -129,7 +123,7 @@ static ULONG WINAPI transform_AddRef(IMFTransform *iface) static ULONG WINAPI transform_Release(IMFTransform *iface) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); ULONG refcount = InterlockedDecrement(&decoder->refcount); TRACE("iface %p decreasing refcount to %lu.\n", decoder, refcount); @@ -234,141 +228,77 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - IMFMediaType *media_type; - const GUID *subtype; - HRESULT hr; + struct audio_decoder *decoder = impl_from_IMFTransform(iface); + const WAVEFORMATEXTENSIBLE *format = decoder->input_types; + UINT count = decoder->input_type_count; TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + *type = NULL; if (id) return MF_E_INVALIDSTREAMNUMBER; - - *type = NULL; - if (index >= ARRAY_SIZE(aac_decoder_input_types)) - return MF_E_NO_MORE_TYPES; - subtype = aac_decoder_input_types[index].guid; - - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; - - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) - goto done; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, subtype))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, 6))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, 24))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, 48000))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 1152000))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1))) - goto done; - if (IsEqualGUID(subtype, &MFAudioFormat_AAC)) - { - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, 0))) - goto done; - if (aac_decoder_input_types[index].payload_type != -1 - && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AAC_PAYLOAD_TYPE, - aac_decoder_input_types[index].payload_type))) - goto done; - } - -done: - if (SUCCEEDED(hr)) - IMFMediaType_AddRef((*type = media_type)); - - IMFMediaType_Release(media_type); - return hr; + for (format = decoder->input_types; index > 0 && count > 0; index--, count--) + format = NEXT_WAVEFORMATEXTENSIBLE(format); + return count ? MFCreateAudioMediaType(&format->Format, (IMFAudioMediaType **)type) : MF_E_NO_MORE_TYPES; } static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - UINT32 channel_count, sample_size, sample_rate, block_alignment; - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); + UINT32 channel_count, sample_rate; + WAVEFORMATEXTENSIBLE wfx = {{0}}; IMFMediaType *media_type; - const GUID *output_type; HRESULT hr; TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + *type = NULL; + if (id) return MF_E_INVALIDSTREAMNUMBER; if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET; - *type = NULL; + wfx = audio_decoder_output_types[index % ARRAY_SIZE(audio_decoder_output_types)]; if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_NUM_CHANNELS, &channel_count)) || !channel_count) - channel_count = 2; + channel_count = wfx.Format.nChannels; + if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &sample_rate))) + sample_rate = wfx.Format.nSamplesPerSec; if (channel_count >= ARRAY_SIZE(default_channel_mask)) return MF_E_INVALIDMEDIATYPE; - if (channel_count > 2 && index >= ARRAY_SIZE(aac_decoder_output_types)) + if (channel_count > 2 && index >= ARRAY_SIZE(audio_decoder_output_types)) { /* If there are more than two channels in the input type GetOutputAvailableType additionally lists * types with 2 channels. */ - index -= ARRAY_SIZE(aac_decoder_output_types); + index -= ARRAY_SIZE(audio_decoder_output_types); channel_count = 2; } - if (index >= ARRAY_SIZE(aac_decoder_output_types)) + if (index >= ARRAY_SIZE(audio_decoder_output_types)) return MF_E_NO_MORE_TYPES; - index = ARRAY_SIZE(aac_decoder_output_types) - index - 1; - output_type = aac_decoder_output_types[index]; - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; + wfx.Format.nChannels = channel_count; + wfx.Format.nSamplesPerSec = sample_rate; + wfx.Format.nBlockAlign = wfx.Format.wBitsPerSample * wfx.Format.nChannels / 8; + wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) - goto done; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, output_type))) - goto done; - - if (IsEqualGUID(output_type, &MFAudioFormat_Float)) - sample_size = 32; - else if (IsEqualGUID(output_type, &MFAudioFormat_PCM)) - sample_size = 16; - else + if (wfx.Format.nChannels >= 3) { - FIXME("Subtype %s not implemented!\n", debugstr_guid(output_type)); - hr = E_NOTIMPL; - goto done; + wfx.SubFormat = MFAudioFormat_Base; + wfx.SubFormat.Data1 = wfx.Format.wFormatTag; + wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx.dwChannelMask = default_channel_mask[wfx.Format.nChannels]; } - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, channel_count))) - goto done; - - if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &sample_rate))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, sample_rate))) - goto done; - - block_alignment = sample_size * channel_count / 8; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, block_alignment))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, sample_rate * block_alignment))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1))) - goto done; + if (FAILED(hr = MFCreateAudioMediaType(&wfx.Format, (IMFAudioMediaType **)&media_type))) + return hr; if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, 1))) goto done; - if (channel_count < 3 && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1))) - goto done; - if (channel_count >= 3 && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_CHANNEL_MASK, - default_channel_mask[channel_count]))) - goto done; done: if (SUCCEEDED(hr)) @@ -378,42 +308,41 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR return hr; } +static BOOL matches_format(const WAVEFORMATEXTENSIBLE *a, const WAVEFORMATEXTENSIBLE *b) +{ + if (a->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE && b->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return IsEqualGUID(&a->SubFormat, &b->SubFormat); + if (a->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return a->SubFormat.Data1 == b->Format.wFormatTag; + if (b->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return b->SubFormat.Data1 == a->Format.wFormatTag; + return a->Format.wFormatTag == b->Format.wFormatTag; +} + static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); - MF_ATTRIBUTE_TYPE item_type; - UINT32 channel_count; - GUID major, subtype; + struct audio_decoder *decoder = impl_from_IMFTransform(iface); + UINT32 size, count = decoder->input_type_count; + WAVEFORMATEXTENSIBLE *format, wfx; HRESULT hr; - ULONG i; TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); if (id) return MF_E_INVALIDSTREAMNUMBER; - if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major))) - return E_INVALIDARG; - - if (!IsEqualGUID(&major, &MFMediaType_Audio) - || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) - return MF_E_INVALIDMEDIATYPE; - - for (i = 0; i < ARRAY_SIZE(aac_decoder_input_types); ++i) - if (IsEqualGUID(&subtype, aac_decoder_input_types[i].guid)) - break; - if (i == ARRAY_SIZE(aac_decoder_input_types)) - return MF_E_INVALIDMEDIATYPE; + if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(type, (WAVEFORMATEX **)&format, &size, + MFWaveFormatExConvertFlag_ForceExtensible))) + return hr; + wfx = *format; + CoTaskMemFree(format); - if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &channel_count)) - && channel_count >= ARRAY_SIZE(default_channel_mask)) + for (format = decoder->input_types; count > 0 && !matches_format(format, &wfx); count--) + format = NEXT_WAVEFORMATEXTENSIBLE(format); + if (!count) return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_USER_DATA, &item_type)) - || item_type != MF_ATTRIBUTE_BLOB) + if (wfx.Format.nChannels >= ARRAY_SIZE(default_channel_mask) || !wfx.Format.nSamplesPerSec || !wfx.Format.cbSize) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; @@ -432,9 +361,9 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); - MF_ATTRIBUTE_TYPE item_type; - GUID major, subtype; + struct audio_decoder *decoder = impl_from_IMFTransform(iface); + WAVEFORMATEXTENSIBLE *format, wfx; + UINT32 size; HRESULT hr; ULONG i; @@ -445,27 +374,19 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET; - if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) - || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) + if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(type, (WAVEFORMATEX **)&format, &size, + MFWaveFormatExConvertFlag_ForceExtensible))) return hr; + wfx = *format; + CoTaskMemFree(format); - if (!IsEqualGUID(&major, &MFMediaType_Audio)) - return MF_E_INVALIDMEDIATYPE; - - for (i = 0; i < ARRAY_SIZE(aac_decoder_output_types); ++i) - if (IsEqualGUID(&subtype, aac_decoder_output_types[i])) + for (i = 0; i < ARRAY_SIZE(audio_decoder_output_types); ++i) + if (matches_format(&audio_decoder_output_types[i], &wfx)) break; - if (i == ARRAY_SIZE(aac_decoder_output_types)) + if (i == ARRAY_SIZE(audio_decoder_output_types)) return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_NUM_CHANNELS, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) + if (!wfx.Format.wBitsPerSample || !wfx.Format.nChannels || !wfx.Format.nSamplesPerSec) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; @@ -489,7 +410,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); IMFMediaType *type; HRESULT hr; @@ -511,7 +432,7 @@ static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD i static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); IMFMediaType *type; HRESULT hr; @@ -533,7 +454,7 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); bool accepts_input; TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags); @@ -574,7 +495,7 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); @@ -587,7 +508,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); MFT_OUTPUT_STREAM_INFO info; HRESULT hr; @@ -645,6 +566,22 @@ static const IMFTransformVtbl transform_vtbl = transform_ProcessOutput, }; +static HEAACWAVEINFO aac_decoder_input_types[] = +{ +#define MAKE_HEAACWAVEINFO(format, payload) \ + {.wfx = {.wFormatTag = format, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)}, \ + .wPayloadType = payload} + + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_RAW_AAC1, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 1), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 3), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_ADTS_AAC, 0), + +#undef MAKE_HEAACWAVEINFO +}; + HRESULT aac_decoder_create(REFIID riid, void **ret) { static const struct wg_format output_format = @@ -661,7 +598,7 @@ HRESULT aac_decoder_create(REFIID riid, void **ret) static const struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_AUDIO_MPEG4}; struct wg_transform_attrs attrs = {0}; wg_transform_t transform; - struct aac_decoder *decoder; + struct audio_decoder *decoder; HRESULT hr; TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret); @@ -675,6 +612,11 @@ HRESULT aac_decoder_create(REFIID riid, void **ret) if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; + decoder->IMFTransform_iface.lpVtbl = &transform_vtbl; + decoder->refcount = 1; + + decoder->input_types = (WAVEFORMATEXTENSIBLE *)aac_decoder_input_types; + decoder->input_type_count = ARRAY_SIZE(aac_decoder_input_types); if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) { @@ -682,9 +624,44 @@ HRESULT aac_decoder_create(REFIID riid, void **ret) return hr; } + *ret = &decoder->IMFTransform_iface; + TRACE("Created decoder %p\n", *ret); + return S_OK; +} + +static WAVEFORMATEXTENSIBLE audio_decoder_input_types[] = +{ +#define MAKE_WAVEFORMATEXTENSIBLE(format) \ + {.Format = {.wFormatTag = WAVE_FORMAT_EXTENSIBLE, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)}, \ + .SubFormat = {format,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}} + + MAKE_WAVEFORMATEXTENSIBLE(MAKEFOURCC('G','S','T','a')), + +#undef MAKE_WAVEFORMATEXTENSIBLE +}; + +HRESULT audio_decoder_create(REFIID riid, void **ret) +{ + struct audio_decoder *decoder; + HRESULT hr; + + TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret); + + if (!(decoder = calloc(1, sizeof(*decoder)))) + return E_OUTOFMEMORY; decoder->IMFTransform_iface.lpVtbl = &transform_vtbl; decoder->refcount = 1; + decoder->input_types = audio_decoder_input_types; + decoder->input_type_count = ARRAY_SIZE(audio_decoder_input_types); + + if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) + { + free(decoder); + return hr; + } + *ret = &decoder->IMFTransform_iface; TRACE("Created decoder %p\n", *ret); return S_OK; diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 5e6cbbab5d5..bce9b5d2fe4 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -70,10 +70,10 @@ HRESULT wg_sample_queue_create(struct wg_sample_queue **out); void wg_sample_queue_destroy(struct wg_sample_queue *queue); void wg_sample_queue_flush(struct wg_sample_queue *queue, bool all); -wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed); +wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed, bool use_opengl); void wg_parser_destroy(wg_parser_t parser); -HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size); +HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size, const WCHAR *uri); void wg_parser_disconnect(wg_parser_t parser); bool wg_parser_get_next_read_offset(wg_parser_t parser, uint64_t *offset, uint32_t *size); @@ -84,7 +84,8 @@ wg_parser_stream_t wg_parser_get_stream(wg_parser_t parser, uint32_t index); void wg_parser_stream_get_preferred_format(wg_parser_stream_t stream, struct wg_format *format); void wg_parser_stream_get_codec_format(wg_parser_stream_t stream, struct wg_format *format); -void wg_parser_stream_enable(wg_parser_stream_t stream, const struct wg_format *format); +void wg_parser_stream_enable(wg_parser_stream_t stream, const struct wg_format *format, + uint32_t flags); void wg_parser_stream_disable(wg_parser_stream_t stream); bool wg_parser_stream_get_buffer(wg_parser_t parser, wg_parser_stream_t stream, @@ -102,6 +103,22 @@ char *wg_parser_stream_get_tag(wg_parser_stream_t stream, enum wg_parser_tag tag void wg_parser_stream_seek(wg_parser_stream_t stream, double rate, uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags); +HRESULT wg_source_create(const WCHAR *url, uint64_t file_size, + const void *data, uint32_t size, WCHAR mime_type[256], + wg_source_t *out); +void wg_source_destroy(wg_source_t source); +HRESULT wg_source_get_stream_count(wg_source_t source, uint32_t *stream_count); +HRESULT wg_source_get_duration(wg_source_t source, uint64_t *duration); +HRESULT wg_source_set_position(wg_source_t source, uint64_t time); +HRESULT wg_source_get_position(wg_source_t source, uint64_t *read_offset); +HRESULT wg_source_push_data(wg_source_t source, const void *data, uint32_t size); +HRESULT wg_source_read_data(wg_source_t source, UINT32 index, IMFSample **out); +bool wg_source_get_stream_format(wg_source_t source, UINT32 index, + struct wg_format *format); +char *wg_source_get_stream_tag(wg_source_t source, UINT32 index, + wg_parser_tag tag); +void wg_source_set_stream_flags(wg_source_t source, UINT32 index, BOOL select); + wg_transform_t wg_transform_create(const struct wg_format *input_format, const struct wg_format *output_format, const struct wg_transform_attrs *attrs); void wg_transform_destroy(wg_transform_t transform); @@ -165,14 +182,18 @@ HRESULT wg_transform_read_quartz(wg_transform_t transform, struct wg_sample *sam HRESULT wg_transform_read_dmo(wg_transform_t transform, DMO_OUTPUT_DATA_BUFFER *buffer); HRESULT gstreamer_byte_stream_handler_create(REFIID riid, void **obj); +HRESULT gstreamer_byte_stream_handler_2_create(REFIID riid, void **obj); unsigned int wg_format_get_stride(const struct wg_format *format); bool wg_video_format_is_rgb(enum wg_video_format format); +HRESULT audio_decoder_create(REFIID riid, void **ret); +HRESULT video_decoder_create(REFIID riid, void **ret); HRESULT aac_decoder_create(REFIID riid, void **ret); HRESULT h264_decoder_create(REFIID riid, void **ret); HRESULT video_processor_create(REFIID riid, void **ret); +HRESULT gstreamer_scheme_handler_create(REFIID riid, void **ret); extern const GUID MFAudioFormat_RAW_AAC; diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c deleted file mode 100644 index 5c48130eee9..00000000000 --- a/dlls/winegstreamer/h264_decoder.c +++ /dev/null @@ -1,917 +0,0 @@ -/* H264 Decoder Transform - * - * Copyright 2022 Rémi Bernon for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "gst_private.h" - -#include "mfapi.h" -#include "mferror.h" -#include "mfobjects.h" -#include "mftransform.h" - -#include "wine/debug.h" - -#include "initguid.h" - -#include "codecapi.h" - -WINE_DEFAULT_DEBUG_CHANNEL(mfplat); -WINE_DECLARE_DEBUG_CHANNEL(winediag); - -#define ALIGN_SIZE(size, alignment) (((size) + (alignment)) & ~((alignment))) - -static const GUID *const h264_decoder_input_types[] = -{ - &MFVideoFormat_H264, - &MFVideoFormat_H264_ES, -}; -static const GUID *const h264_decoder_output_types[] = -{ - &MFVideoFormat_NV12, - &MFVideoFormat_YV12, - &MFVideoFormat_IYUV, - &MFVideoFormat_I420, - &MFVideoFormat_YUY2, -}; - -struct h264_decoder -{ - IMFTransform IMFTransform_iface; - LONG refcount; - - IMFAttributes *attributes; - IMFAttributes *output_attributes; - - UINT64 sample_time; - IMFMediaType *input_type; - MFT_INPUT_STREAM_INFO input_info; - IMFMediaType *output_type; - MFT_OUTPUT_STREAM_INFO output_info; - IMFMediaType *stream_type; - - wg_transform_t wg_transform; - struct wg_sample_queue *wg_sample_queue; - - IMFVideoSampleAllocatorEx *allocator; - BOOL allocator_initialized; - IMFTransform *copier; - IMFMediaBuffer *temp_buffer; -}; - -static struct h264_decoder *impl_from_IMFTransform(IMFTransform *iface) -{ - return CONTAINING_RECORD(iface, struct h264_decoder, IMFTransform_iface); -} - -static HRESULT try_create_wg_transform(struct h264_decoder *decoder) -{ - /* Call of Duty: Black Ops 3 doesn't care about the ProcessInput/ProcessOutput - * return values, it calls them in a specific order and expects the decoder - * transform to be able to queue its input buffers. We need to use a buffer list - * to match its expectations. - */ - struct wg_transform_attrs attrs = - { - .output_plane_align = 15, - .input_queue_length = 15, - }; - struct wg_format input_format; - struct wg_format output_format; - UINT32 low_latency; - - if (decoder->wg_transform) - wg_transform_destroy(decoder->wg_transform); - decoder->wg_transform = 0; - - mf_media_type_to_wg_format(decoder->input_type, &input_format); - if (input_format.major_type == WG_MAJOR_TYPE_UNKNOWN) - return MF_E_INVALIDMEDIATYPE; - - mf_media_type_to_wg_format(decoder->output_type, &output_format); - if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN) - return MF_E_INVALIDMEDIATYPE; - - /* Don't force any specific size, H264 streams already have the metadata for it - * and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later. - */ - output_format.u.video.width = 0; - output_format.u.video.height = 0; - output_format.u.video.fps_d = 0; - output_format.u.video.fps_n = 0; - - if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency))) - attrs.low_latency = !!low_latency; - - if (!(decoder->wg_transform = wg_transform_create(&input_format, &output_format, &attrs))) - return E_FAIL; - - return S_OK; -} - -static HRESULT fill_output_media_type(struct h264_decoder *decoder, IMFMediaType *media_type) -{ - IMFMediaType *default_type = decoder->output_type; - UINT32 value, width, height; - MFVideoArea aperture; - UINT64 ratio; - GUID subtype; - HRESULT hr; - - if (FAILED(hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &subtype))) - return hr; - - if (FAILED(hr = IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &ratio))) - { - if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &ratio))) - ratio = (UINT64)1920 << 32 | 1080; - if (FAILED(hr = IMFMediaType_SetUINT64(media_type, &MF_MT_FRAME_SIZE, ratio))) - return hr; - } - width = ratio >> 32; - height = ratio; - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_FRAME_RATE, NULL))) - { - if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_RATE, &ratio))) - ratio = (UINT64)30000 << 32 | 1001; - if (FAILED(hr = IMFMediaType_SetUINT64(media_type, &MF_MT_FRAME_RATE, ratio))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_PIXEL_ASPECT_RATIO, NULL))) - { - if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_PIXEL_ASPECT_RATIO, &ratio))) - ratio = (UINT64)1 << 32 | 1; - if (FAILED(hr = IMFMediaType_SetUINT64(media_type, &MF_MT_PIXEL_ASPECT_RATIO, ratio))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_SAMPLE_SIZE, NULL))) - { - if (FAILED(hr = MFCalculateImageSize(&subtype, width, height, &value))) - return hr; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_SAMPLE_SIZE, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_DEFAULT_STRIDE, NULL))) - { - if (FAILED(hr = MFGetStrideForBitmapInfoHeader(subtype.Data1, width, (LONG *)&value))) - return hr; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_DEFAULT_STRIDE, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_INTERLACE_MODE, NULL))) - { - if (!default_type || FAILED(hr = IMFMediaType_GetUINT32(default_type, &MF_MT_INTERLACE_MODE, &value))) - value = MFVideoInterlace_MixedInterlaceOrProgressive; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_INTERLACE_MODE, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, NULL))) - { - if (!default_type || FAILED(hr = IMFMediaType_GetUINT32(default_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value))) - value = 1; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_VIDEO_ROTATION, NULL))) - { - if (!default_type || FAILED(hr = IMFMediaType_GetUINT32(default_type, &MF_MT_VIDEO_ROTATION, &value))) - value = 0; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_VIDEO_ROTATION, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_FIXED_SIZE_SAMPLES, NULL))) - { - if (!default_type || FAILED(hr = IMFMediaType_GetUINT32(default_type, &MF_MT_FIXED_SIZE_SAMPLES, &value))) - value = 1; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, value))) - return hr; - } - - if (FAILED(hr = IMFMediaType_GetItem(media_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, NULL)) - && SUCCEEDED(hr = IMFMediaType_GetBlob(decoder->stream_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, - (BYTE *)&aperture, sizeof(aperture), &value))) - { - if (FAILED(hr = IMFMediaType_SetBlob(media_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, - (BYTE *)&aperture, sizeof(aperture)))) - return hr; - } - - return S_OK; -} - -static HRESULT init_allocator(struct h264_decoder *decoder) -{ - HRESULT hr; - - if (decoder->allocator_initialized) - return S_OK; - - if (FAILED(hr = IMFTransform_SetInputType(decoder->copier, 0, decoder->output_type, 0))) - return hr; - if (FAILED(hr = IMFTransform_SetOutputType(decoder->copier, 0, decoder->output_type, 0))) - return hr; - - if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(decoder->allocator, 10, 10, - decoder->attributes, decoder->output_type))) - return hr; - decoder->allocator_initialized = TRUE; - return S_OK; -} - -static void uninit_allocator(struct h264_decoder *decoder) -{ - IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(decoder->allocator); - decoder->allocator_initialized = FALSE; -} - -static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); - - if (IsEqualGUID(iid, &IID_IUnknown) || - IsEqualGUID(iid, &IID_IMFTransform)) - *out = &decoder->IMFTransform_iface; - else - { - *out = NULL; - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*out); - return S_OK; -} - -static ULONG WINAPI transform_AddRef(IMFTransform *iface) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - ULONG refcount = InterlockedIncrement(&decoder->refcount); - - TRACE("iface %p increasing refcount to %lu.\n", decoder, refcount); - - return refcount; -} - -static ULONG WINAPI transform_Release(IMFTransform *iface) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - ULONG refcount = InterlockedDecrement(&decoder->refcount); - - TRACE("iface %p decreasing refcount to %lu.\n", decoder, refcount); - - if (!refcount) - { - IMFTransform_Release(decoder->copier); - IMFVideoSampleAllocatorEx_Release(decoder->allocator); - if (decoder->temp_buffer) - IMFMediaBuffer_Release(decoder->temp_buffer); - if (decoder->wg_transform) - wg_transform_destroy(decoder->wg_transform); - if (decoder->input_type) - IMFMediaType_Release(decoder->input_type); - if (decoder->output_type) - IMFMediaType_Release(decoder->output_type); - if (decoder->output_attributes) - IMFAttributes_Release(decoder->output_attributes); - if (decoder->attributes) - IMFAttributes_Release(decoder->attributes); - wg_sample_queue_destroy(decoder->wg_sample_queue); - free(decoder); - } - - return refcount; -} - -static HRESULT WINAPI transform_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, - DWORD *input_maximum, DWORD *output_minimum, DWORD *output_maximum) -{ - TRACE("iface %p, input_minimum %p, input_maximum %p, output_minimum %p, output_maximum %p.\n", - iface, input_minimum, input_maximum, output_minimum, output_maximum); - *input_minimum = *input_maximum = *output_minimum = *output_maximum = 1; - return S_OK; -} - -static HRESULT WINAPI transform_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs) -{ - TRACE("iface %p, inputs %p, outputs %p.\n", iface, inputs, outputs); - *inputs = *outputs = 1; - return S_OK; -} - -static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs, - DWORD output_size, DWORD *outputs) -{ - TRACE("iface %p, input_size %lu, inputs %p, output_size %lu, outputs %p.\n", iface, - input_size, inputs, output_size, outputs); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); - - *info = decoder->input_info; - return S_OK; -} - -static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); - - *info = decoder->output_info; - return S_OK; -} - -static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - FIXME("iface %p, attributes %p semi-stub!\n", iface, attributes); - - if (!attributes) - return E_POINTER; - - IMFAttributes_AddRef((*attributes = decoder->attributes)); - return S_OK; -} - -static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) -{ - TRACE("iface %p, id %#lx, attributes %p.\n", iface, id, attributes); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - FIXME("iface %p, id %#lx, attributes %p semi-stub!\n", iface, id, attributes); - - if (!attributes) - return E_POINTER; - if (id) - return MF_E_INVALIDSTREAMNUMBER; - - IMFAttributes_AddRef((*attributes = decoder->output_attributes)); - return S_OK; -} - -static HRESULT WINAPI transform_DeleteInputStream(IMFTransform *iface, DWORD id) -{ - TRACE("iface %p, id %#lx.\n", iface, id); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids) -{ - TRACE("iface %p, streams %lu, ids %p.\n", iface, streams, ids); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, - IMFMediaType **type) -{ - IMFMediaType *media_type; - const GUID *subtype; - HRESULT hr; - - TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); - - *type = NULL; - - if (index >= ARRAY_SIZE(h264_decoder_input_types)) - return MF_E_NO_MORE_TYPES; - subtype = h264_decoder_input_types[index]; - - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; - - if (SUCCEEDED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video)) && - SUCCEEDED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, subtype))) - IMFMediaType_AddRef((*type = media_type)); - - IMFMediaType_Release(media_type); - return hr; -} - -static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, - DWORD index, IMFMediaType **type) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - IMFMediaType *media_type; - const GUID *output_type; - HRESULT hr; - - TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); - - if (!decoder->input_type) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - *type = NULL; - - if (index >= ARRAY_SIZE(h264_decoder_output_types)) - return MF_E_NO_MORE_TYPES; - output_type = h264_decoder_output_types[index]; - - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; - - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video))) - goto done; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, output_type))) - goto done; - - hr = fill_output_media_type(decoder, media_type); - -done: - if (SUCCEEDED(hr)) - IMFMediaType_AddRef((*type = media_type)); - - IMFMediaType_Release(media_type); - return hr; -} - -static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - GUID major, subtype; - UINT64 frame_size; - HRESULT hr; - ULONG i; - - TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); - - if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || - FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) - return E_INVALIDARG; - - if (!IsEqualGUID(&major, &MFMediaType_Video)) - return MF_E_INVALIDMEDIATYPE; - - for (i = 0; i < ARRAY_SIZE(h264_decoder_input_types); ++i) - if (IsEqualGUID(&subtype, h264_decoder_input_types[i])) - break; - if (i == ARRAY_SIZE(h264_decoder_input_types)) - return MF_E_INVALIDMEDIATYPE; - if (flags & MFT_SET_TYPE_TEST_ONLY) - return S_OK; - - if (decoder->output_type) - { - IMFMediaType_Release(decoder->output_type); - decoder->output_type = NULL; - } - - if (decoder->input_type) - IMFMediaType_Release(decoder->input_type); - IMFMediaType_AddRef((decoder->input_type = type)); - - if (SUCCEEDED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) - { - if (FAILED(hr = IMFMediaType_SetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, frame_size))) - WARN("Failed to update stream type frame size, hr %#lx\n", hr); - decoder->output_info.cbSize = (frame_size >> 32) * (UINT32)frame_size * 2; - } - - return S_OK; -} - -static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - UINT64 frame_size, stream_frame_size; - GUID major, subtype; - HRESULT hr; - ULONG i; - - TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); - - if (!decoder->input_type) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || - FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) - return hr; - - if (!IsEqualGUID(&major, &MFMediaType_Video)) - return MF_E_INVALIDMEDIATYPE; - - for (i = 0; i < ARRAY_SIZE(h264_decoder_output_types); ++i) - if (IsEqualGUID(&subtype, h264_decoder_output_types[i])) - break; - if (i == ARRAY_SIZE(h264_decoder_output_types)) - return MF_E_INVALIDMEDIATYPE; - - if (FAILED(hr = IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) - return MF_E_INVALIDMEDIATYPE; - if (SUCCEEDED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &stream_frame_size)) - && frame_size != stream_frame_size) - return MF_E_INVALIDMEDIATYPE; - if (flags & MFT_SET_TYPE_TEST_ONLY) - return S_OK; - - if (decoder->output_type) - IMFMediaType_Release(decoder->output_type); - IMFMediaType_AddRef((decoder->output_type = type)); - - if (decoder->wg_transform) - { - struct wg_format output_format; - mf_media_type_to_wg_format(decoder->output_type, &output_format); - - /* Don't force any specific size, H264 streams already have the metadata for it - * and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later. - */ - output_format.u.video.width = 0; - output_format.u.video.height = 0; - output_format.u.video.fps_d = 0; - output_format.u.video.fps_n = 0; - - if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN - || !wg_transform_set_output_format(decoder->wg_transform, &output_format)) - { - IMFMediaType_Release(decoder->output_type); - decoder->output_type = NULL; - return MF_E_INVALIDMEDIATYPE; - } - } - else if (FAILED(hr = try_create_wg_transform(decoder))) - { - IMFMediaType_Release(decoder->output_type); - decoder->output_type = NULL; - } - - return hr; -} - -static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) -{ - FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - HRESULT hr; - - FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); - - if (!decoder->output_type) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - if (FAILED(hr = MFCreateMediaType(type))) - return hr; - - return IMFMediaType_CopyAllItems(decoder->output_type, (IMFAttributes *)*type); -} - -static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags); - - if (!decoder->wg_transform) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - *flags = MFT_INPUT_STATUS_ACCEPT_DATA; - return S_OK; -} - -static HRESULT WINAPI transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) -{ - FIXME("iface %p, flags %p stub!\n", iface, flags); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper) -{ - TRACE("iface %p, lower %I64d, upper %I64d.\n", iface, lower, upper); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event) -{ - FIXME("iface %p, id %#lx, event %p stub!\n", iface, id, event); - return E_NOTIMPL; -} - -static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - HRESULT hr; - - TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); - - switch (message) - { - case MFT_MESSAGE_SET_D3D_MANAGER: - if (FAILED(hr = IMFVideoSampleAllocatorEx_SetDirectXManager(decoder->allocator, (IUnknown *)param))) - return hr; - - uninit_allocator(decoder); - if (param) - decoder->output_info.dwFlags |= MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; - else - decoder->output_info.dwFlags &= ~MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; - return S_OK; - - case MFT_MESSAGE_COMMAND_DRAIN: - return wg_transform_drain(decoder->wg_transform); - - case MFT_MESSAGE_COMMAND_FLUSH: - return wg_transform_flush(decoder->wg_transform); - - default: - FIXME("Ignoring message %#x.\n", message); - return S_OK; - } -} - -static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - - TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); - - if (!decoder->wg_transform) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); -} - -static HRESULT output_sample(struct h264_decoder *decoder, IMFSample **out, IMFSample *src_sample) -{ - MFT_OUTPUT_DATA_BUFFER output[1]; - IMFSample *sample; - DWORD status; - HRESULT hr; - - if (FAILED(hr = init_allocator(decoder))) - { - ERR("Failed to initialize allocator, hr %#lx.\n", hr); - return hr; - } - if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(decoder->allocator, &sample))) - return hr; - - if (FAILED(hr = IMFTransform_ProcessInput(decoder->copier, 0, src_sample, 0))) - { - IMFSample_Release(sample); - return hr; - } - output[0].pSample = sample; - if (FAILED(hr = IMFTransform_ProcessOutput(decoder->copier, 0, 1, output, &status))) - { - IMFSample_Release(sample); - return hr; - } - *out = sample; - return S_OK; -} - -static HRESULT handle_stream_type_change(struct h264_decoder *decoder, const struct wg_format *format) -{ - UINT64 frame_size, frame_rate; - HRESULT hr; - - if (decoder->stream_type) - IMFMediaType_Release(decoder->stream_type); - if (!(decoder->stream_type = mf_media_type_from_wg_format(format))) - return E_OUTOFMEMORY; - - if (SUCCEEDED(IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_RATE, &frame_rate)) - && FAILED(hr = IMFMediaType_SetUINT64(decoder->stream_type, &MF_MT_FRAME_RATE, frame_rate))) - WARN("Failed to update stream type frame size, hr %#lx\n", hr); - - if (FAILED(hr = IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &frame_size))) - return hr; - decoder->output_info.cbSize = (frame_size >> 32) * (UINT32)frame_size * 2; - uninit_allocator(decoder); - - return MF_E_TRANSFORM_STREAM_CHANGE; -} - -static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, - MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) -{ - struct h264_decoder *decoder = impl_from_IMFTransform(iface); - struct wg_format wg_format; - UINT32 sample_size; - LONGLONG duration; - IMFSample *sample; - UINT64 frame_size, frame_rate; - GUID subtype; - DWORD size; - HRESULT hr; - - TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); - - if (count != 1) - return E_INVALIDARG; - - if (!decoder->wg_transform) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - *status = samples->dwStatus = 0; - if (!(sample = samples->pSample) && !(decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES)) - return E_INVALIDARG; - - if (FAILED(hr = IMFMediaType_GetGUID(decoder->output_type, &MF_MT_SUBTYPE, &subtype))) - return hr; - if (FAILED(hr = IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_SIZE, &frame_size))) - return hr; - if (FAILED(hr = MFCalculateImageSize(&subtype, frame_size >> 32, (UINT32)frame_size, &sample_size))) - return hr; - - if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) - { - if (decoder->temp_buffer) - { - if (FAILED(IMFMediaBuffer_GetMaxLength(decoder->temp_buffer, &size)) || size < sample_size) - { - IMFMediaBuffer_Release(decoder->temp_buffer); - decoder->temp_buffer = NULL; - } - } - if (!decoder->temp_buffer && FAILED(hr = MFCreateMemoryBuffer(sample_size, &decoder->temp_buffer))) - return hr; - if (FAILED(hr = MFCreateSample(&sample))) - return hr; - if (FAILED(hr = IMFSample_AddBuffer(sample, decoder->temp_buffer))) - { - IMFSample_Release(sample); - return hr; - } - } - - if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, sample, - sample_size, &wg_format, &samples->dwStatus))) - { - wg_sample_queue_flush(decoder->wg_sample_queue, false); - - if (FAILED(IMFMediaType_GetUINT64(decoder->input_type, &MF_MT_FRAME_RATE, &frame_rate))) - frame_rate = (UINT64)30000 << 32 | 1001; - - duration = (UINT64)10000000 * (UINT32)frame_rate / (frame_rate >> 32); - if (FAILED(IMFSample_SetSampleTime(sample, decoder->sample_time))) - WARN("Failed to set sample time\n"); - if (FAILED(IMFSample_SetSampleDuration(sample, duration))) - WARN("Failed to set sample duration\n"); - decoder->sample_time += duration; - } - - if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - { - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - hr = handle_stream_type_change(decoder, &wg_format); - } - - if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) - { - if (hr == S_OK && FAILED(hr = output_sample(decoder, &samples->pSample, sample))) - ERR("Failed to output sample, hr %#lx.\n", hr); - IMFSample_Release(sample); - } - - return hr; -} - -static const IMFTransformVtbl transform_vtbl = -{ - transform_QueryInterface, - transform_AddRef, - transform_Release, - transform_GetStreamLimits, - transform_GetStreamCount, - transform_GetStreamIDs, - transform_GetInputStreamInfo, - transform_GetOutputStreamInfo, - transform_GetAttributes, - transform_GetInputStreamAttributes, - transform_GetOutputStreamAttributes, - transform_DeleteInputStream, - transform_AddInputStreams, - transform_GetInputAvailableType, - transform_GetOutputAvailableType, - transform_SetInputType, - transform_SetOutputType, - transform_GetInputCurrentType, - transform_GetOutputCurrentType, - transform_GetInputStatus, - transform_GetOutputStatus, - transform_SetOutputBounds, - transform_ProcessEvent, - transform_ProcessMessage, - transform_ProcessInput, - transform_ProcessOutput, -}; - -HRESULT h264_decoder_create(REFIID riid, void **ret) -{ - static const struct wg_format output_format = - { - .major_type = WG_MAJOR_TYPE_VIDEO, - .u.video = - { - .format = WG_VIDEO_FORMAT_I420, - .width = 1920, - .height = 1080, - }, - }; - static const struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_VIDEO_H264}; - struct wg_transform_attrs attrs = {0}; - wg_transform_t transform; - struct h264_decoder *decoder; - HRESULT hr; - - TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret); - - if (!(transform = wg_transform_create(&input_format, &output_format, &attrs))) - { - ERR_(winediag)("GStreamer doesn't support H.264 decoding, please install appropriate plugins\n"); - return E_FAIL; - } - wg_transform_destroy(transform); - - if (!(decoder = calloc(1, sizeof(*decoder)))) - return E_OUTOFMEMORY; - - decoder->IMFTransform_iface.lpVtbl = &transform_vtbl; - decoder->refcount = 1; - - decoder->input_info.dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER - | MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE; - decoder->input_info.cbSize = 0x1000; - decoder->output_info.dwFlags = MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER - | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE; - decoder->output_info.cbSize = 1920 * 1088 * 2; - - if (FAILED(hr = MFCreateMediaType(&decoder->stream_type))) - goto failed; - if (FAILED(hr = MFCreateAttributes(&decoder->attributes, 16))) - goto failed; - if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_LOW_LATENCY, 0))) - goto failed; - if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, TRUE))) - goto failed; - if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &AVDecVideoAcceleration_H264, TRUE))) - goto failed; - - if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) - goto failed; - if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) - goto failed; - if (FAILED(hr = MFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&decoder->allocator))) - goto failed; - if (FAILED(hr = MFCreateSampleCopierMFT(&decoder->copier))) - goto failed; - - *ret = &decoder->IMFTransform_iface; - TRACE("Created decoder %p\n", *ret); - return S_OK; - -failed: - if (decoder->allocator) - IMFVideoSampleAllocatorEx_Release(decoder->allocator); - if (decoder->wg_sample_queue) - wg_sample_queue_destroy(decoder->wg_sample_queue); - if (decoder->output_attributes) - IMFAttributes_Release(decoder->output_attributes); - if (decoder->attributes) - IMFAttributes_Release(decoder->attributes); - if (decoder->stream_type) - IMFMediaType_Release(decoder->stream_type); - free(decoder); - return hr; -} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 74a6eee5b1d..992f6b3ae98 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -33,6 +33,8 @@ #include "wmcodecdsp.h" WINE_DEFAULT_DEBUG_CHANNEL(quartz); +WINE_DECLARE_DEBUG_CHANNEL(mfplat); +WINE_DECLARE_DEBUG_CHANNEL(wmvcore); DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); DEFINE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S'),0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71); @@ -66,17 +68,18 @@ bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size) return TRUE; } -wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed) +wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed, bool use_opengl) { struct wg_parser_create_params params = { .type = type, .output_compressed = output_compressed, + .use_opengl = use_opengl, .err_on = ERR_ON(quartz), .warn_on = WARN_ON(quartz), }; - TRACE("type %#x.\n", type); + TRACE("type %#x, use_opengl %u.\n", type, use_opengl); if (WINE_UNIX_CALL(unix_wg_parser_create, ¶ms)) return 0; @@ -93,12 +96,13 @@ void wg_parser_destroy(wg_parser_t parser) WINE_UNIX_CALL(unix_wg_parser_destroy, &parser); } -HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size) +HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size, const WCHAR *uri) { struct wg_parser_connect_params params = { .parser = parser, .file_size = file_size, + .uri = uri, }; TRACE("parser %#I64x, file_size %I64u.\n", parser, file_size); @@ -198,12 +202,14 @@ void wg_parser_stream_get_codec_format(wg_parser_stream_t stream, struct wg_form WINE_UNIX_CALL(unix_wg_parser_stream_get_codec_format, ¶ms); } -void wg_parser_stream_enable(wg_parser_stream_t stream, const struct wg_format *format) +void wg_parser_stream_enable(wg_parser_stream_t stream, const struct wg_format *format, + uint32_t flags) { struct wg_parser_stream_enable_params params = { .stream = stream, .format = format, + .flags = flags, }; TRACE("stream %#I64x, format %p.\n", stream, format); @@ -336,6 +342,196 @@ void wg_parser_stream_seek(wg_parser_stream_t stream, double rate, WINE_UNIX_CALL(unix_wg_parser_stream_seek, ¶ms); } +HRESULT wg_source_create(const WCHAR *url, uint64_t file_size, + const void *data, uint32_t size, WCHAR mime_type[256], + wg_source_t *out) +{ + struct wg_source_create_params params = + { + .file_size = file_size, + .data = data, .size = size, + }; + UINT len = url ? WideCharToMultiByte(CP_ACP, 0, url, -1, NULL, 0, NULL, NULL) : 0; + char *tmp = url ? malloc(len) : NULL; + NTSTATUS status; + + TRACE("url %s, file_size %#I64x, data %p, size %#x, mime_type %p\n", debugstr_w(url), + file_size, data, size, mime_type); + + if ((params.url = tmp)) + WideCharToMultiByte(CP_ACP, 0, url, -1, tmp, len, NULL, NULL); + + if ((status = WINE_UNIX_CALL(unix_wg_source_create, ¶ms))) + WARN("wg_source_create returned status %#lx\n", status); + else + { + TRACE("Returning source %#I64x.\n", params.source); + MultiByteToWideChar(CP_ACP, 0, params.mime_type, -1, mime_type, 256); + *out = params.source; + } + + free(tmp); + return HRESULT_FROM_NT(status); +} + +void wg_source_destroy(wg_source_t source) +{ + TRACE("source %#I64x.\n", source); + + WINE_UNIX_CALL(unix_wg_source_destroy, &source); +} + +HRESULT wg_source_get_stream_count(wg_source_t source, uint32_t *stream_count) +{ + struct wg_source_get_stream_count_params params = + { + .source = source, + }; + NTSTATUS status; + + TRACE("source %#I64x, stream_count %p\n", source, stream_count); + + if ((status = WINE_UNIX_CALL(unix_wg_source_get_stream_count, ¶ms)) + && status != STATUS_PENDING) + { + WARN("wg_source_get_stream_count returned status %#lx\n", status); + return HRESULT_FROM_NT(status); + } + + *stream_count = params.stream_count; + TRACE("source %#I64x, stream_count %u\n", source, *stream_count); + return S_OK; +} + +HRESULT wg_source_get_duration(wg_source_t source, uint64_t *duration) +{ + struct wg_source_get_duration_params params = + { + .source = source, + }; + NTSTATUS status; + + TRACE("source %#I64x, duration %p\n", source, duration); + + if ((status = WINE_UNIX_CALL(unix_wg_source_get_duration, ¶ms)) + && status != STATUS_PENDING) + { + WARN("wg_source_get_duration returned status %#lx\n", status); + return HRESULT_FROM_NT(status); + } + + *duration = params.duration; + TRACE("source %#I64x, duration %s\n", source, debugstr_time(*duration)); + return S_OK; +} + +HRESULT wg_source_get_position(wg_source_t source, uint64_t *read_offset) +{ + struct wg_source_get_position_params params = + { + .source = source, + }; + NTSTATUS status; + + TRACE("source %#I64x, read_offset %p\n", source, read_offset); + + if ((status = WINE_UNIX_CALL(unix_wg_source_get_position, ¶ms)) + && status != STATUS_PENDING) + { + WARN("wg_source_get_position returned status %#lx\n", status); + return HRESULT_FROM_NT(status); + } + + *read_offset = params.read_offset; + TRACE("source %#I64x, read_offset %#I64x\n", source, *read_offset); + return S_OK; +} + +HRESULT wg_source_set_position(wg_source_t source, uint64_t time) +{ + struct wg_source_set_position_params params = {.source = source, .time = time}; + + TRACE("source %#I64x, time %s\n", source, debugstr_time(time)); + + return HRESULT_FROM_NT(WINE_UNIX_CALL(unix_wg_source_set_position, ¶ms)); +} + +HRESULT wg_source_push_data(wg_source_t source, const void *data, uint32_t size) +{ + struct wg_source_push_data_params params = + { + .source = source, + .data = data, + .size = size, + }; + + TRACE("source %#I64x, data %p, size %#x\n", source, data, size); + + return HRESULT_FROM_NT(WINE_UNIX_CALL(unix_wg_source_push_data, ¶ms)); +} + +bool wg_source_get_stream_format(wg_source_t source, UINT32 index, + struct wg_format *format) +{ + struct wg_source_get_stream_format_params params = + { + .source = source, + .index = index, + }; + + TRACE("source %#I64x, index %u, format %p\n", source, + index, format); + + if (WINE_UNIX_CALL(unix_wg_source_get_stream_format, ¶ms)) + return false; + + *format = params.format; + return true; +} + +char *wg_source_get_stream_tag(wg_source_t source, UINT32 index, wg_parser_tag tag) +{ + struct wg_source_get_stream_tag_params params = + { + .source = source, + .index = index, + .tag = tag, + }; + char *buffer; + + TRACE("source %#I64x, index %u, tag %#I64x\n", source, index, tag); + + if (WINE_UNIX_CALL(unix_wg_source_get_stream_tag, ¶ms) != STATUS_BUFFER_TOO_SMALL) + return NULL; + if (!(buffer = malloc(params.size))) + { + ERR("No memory.\n"); + return NULL; + } + params.buffer = buffer; + if (WINE_UNIX_CALL(unix_wg_source_get_stream_tag, ¶ms)) + { + ERR("wg_source_get_stream_tag failed unexpectedly.\n"); + free(buffer); + return NULL; + } + return buffer; +} + +void wg_source_set_stream_flags(wg_source_t source, UINT32 index, BOOL select) +{ + struct wg_source_set_stream_flags_params params = + { + .source = source, + .index = index, + .select = select, + }; + + TRACE("source %#I64x, index %u, select %u\n", source, index, select); + + WINE_UNIX_CALL(unix_wg_source_set_stream_flags, ¶ms); +} + wg_transform_t wg_transform_create(const struct wg_format *input_format, const struct wg_format *output_format, const struct wg_transform_attrs *attrs) { @@ -646,6 +842,7 @@ bool wg_video_format_is_rgb(enum wg_video_format format) case WG_VIDEO_FORMAT_BGRA: case WG_VIDEO_FORMAT_BGRx: case WG_VIDEO_FORMAT_BGR: + case WG_VIDEO_FORMAT_RGBA: case WG_VIDEO_FORMAT_RGB15: case WG_VIDEO_FORMAT_RGB16: return true; @@ -810,9 +1007,15 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ctx) { + struct wg_init_gstreamer_params params = + { + .trace_on = TRACE_ON(mfplat) || TRACE_ON(quartz) || TRACE_ON(wmvcore), + .warn_on = WARN_ON(mfplat) || WARN_ON(quartz) || WARN_ON(wmvcore), + .err_on = ERR_ON(mfplat) || ERR_ON(quartz) || ERR_ON(wmvcore), + }; HINSTANCE handle; - if (WINE_UNIX_CALL(unix_wg_init_gstreamer, NULL)) + if (WINE_UNIX_CALL(unix_wg_init_gstreamer, ¶ms)) return FALSE; /* Unloading glib is a bad idea.. it installs atexit handlers, diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c new file mode 100644 index 00000000000..71612cbfddd --- /dev/null +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -0,0 +1,1102 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Algorithm + * --------- + * + * The application feeds encoded audio into XAudio2 in chunks. Since we don't have access to all + * chunks in a stream on initialization (as we do with the video converter), we continuously hash + * the stream as it is sent to us. Each "chunk" is identified as the hash of the entire stream up + * to that chunk. + * + * Since chunks are small (~2 kilobytes), this leads to a significant possibility of two different + * streams having identical intro chunks (imagine two streams that start with several seconds of + * silence). This means we need a tree of chunks. Suppose two incoming streams with chunks that + * hash as shown (i.e. identical intro chunks that diverge later): + * + * Stream 1: [AA BB CC DD] + * + * Stream 2: [AA BB YY ZZ] + * + * We record a tree and the transcoder will walk it depth-first in order to reconstruct each unique + * stream: + * + * AA => aa.ptna + * AA+BB => bb.ptna + * AA+BB+CC => cc.ptna + * AA+BB+CC+DD => dd.ptna + * AA+BB+YY => yy.ptna + * AA+BB+YY+ZZ => zz.ptna + * + * Upon playback, we chain each transcoded stream chunk together as the packets come in: + * + * AA -> start stream with aa.ptna + * BB -> play bb.ptna + * CC -> play cc.ptna + * DD -> play dd.ptna + * + * or: + * + * AA -> start stream with aa.ptna + * BB -> play bb.ptna + * YY -> play yy.ptna + * ZZ -> play zz.ptna + * + * or: + * + * AA -> start stream with aa.ptna + * NN -> not recognized, instead play blank.ptna and mark this stream as needs-transcoding + * OO -> play blank.ptna + * PP -> play blank.ptna + * When the Stream is destroyed, we'll record AA+NN+OO+PP into the needs-transcode database + * for the transcoder to convert later. + * + * + * Physical Format + * --------------- + * + * All stored values are little-endian. + * + * Transcoded audio is stored in the "transcoded" Fossilize database under the + * AUDIO_CONV_FOZ_TAG_PTNADATA tag. Each chunk is stored in one entry with as many of the following + * "Proton Audio" (ptna) packets as are required to store the entire transcoded chunk: + * + * uint32_t packet_header: Information about the upcoming packet, see bitmask: + * MSB [FFFF PPPP PPPP PPPP PPPP LLLL LLLL LLLL] LSB + * L: Number of _bytes_ in this packet following this header. + * P: Number of _samples_ at the end of this packet which are padding and should be skipped. + * F: Flag bits: + * 0x1: This packet is an Opus header + * 0x2, 0x4, 0x8: Reserved for future use. + * + * If the Opus header flag is set: + * Following packet is an Opus identification header, as defined in RFC 7845 "Ogg + * Encapsulation for the Opus Audio Codec" Section 5.1. + * + * + * If the header flag is not set: + * Following packet is raw Opus data to be sent to an Opus decoder. + * + * + * If we encounter a stream which needs transcoding, we record the buffers and metadata in + * a Fossilize database. The database has three tag types: + * + * AUDIO_CONV_FOZ_TAG_STREAM: This identifies each unique stream of buffers. For example: + * [hash(AA+BB+CC+DD)] -> [AA, BB, CC, DD] + * [hash(AA+BB+XX+YY)] -> [AA, BB, XX, YY] + * + * AUDIO_CONV_FOZ_TAG_AUDIODATA: This contans the actual encoded audio data. For example: + * [AA] -> [AA's buffer data] + * [BB] -> [BB's buffer data] + * + * AUDIO_CONV_FOZ_TAG_CODECINFO: This contans the codec data required to decode the buffer. Only + * the "head" of each stream is recorded. For example: + * [AA] -> [ + * uint32_t wmaversion (from WAVEFORMATEX.wFormatTag) + * uint32_t bitrate (from WAVEFORMATEX.nAvgBytesPerSec) + * uint32_t channels (WAVEFORMATEX.nChannels) + * uint32_t rate (WAVEFORMATEX.nSamplesPerSec) + * uint32_t block_align (WAVEFORMATEX.nBlockAlign) + * uint32_t depth (WAVEFORMATEX.wBitsPerSample) + * char[remainder of entry] codec_data (codec data which follows WAVEFORMATEX) + * ] + * + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +#include +#include +#include +#include + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +#define AUDIO_CONV_ENCODED_LENGTH_MASK 0x00000fff /* 4kB fits in here. */ +#define AUDIO_CONV_PADDING_LENGTH_MASK 0x0ffff000 /* 120ms of samples at 48kHz fits in here. */ +#define AUDIO_CONV_PADDING_LENGTH_SHIFT 12 +#define AUDIO_CONV_FLAG_MASK 0xf0000000 +#define AUDIO_CONV_FLAG_HEADER 0x10000000 /* This chunk is the Opus header. */ +#define _AUDIO_CONV_FLAG_RESERVED1 0x20000000 /* Not yet used */ +#define _AUDIO_CONV_FLAG_RESERVED2 0x40000000 /* Not yet used */ +#define _AUDIO_CONV_FLAG_V2 0x80000000 /* Indicates a "version 2" header, process somehow differently (TBD). */ + +/* Properties of the "blank" audio file. */ +#define _BLANK_AUDIO_FILE_LENGTH_MS 10.0 +#define _BLANK_AUDIO_FILE_RATE 48000.0 + +#define AUDIO_CONV_FOZ_TAG_STREAM 0 +#define AUDIO_CONV_FOZ_TAG_CODECINFO 1 +#define AUDIO_CONV_FOZ_TAG_AUDIODATA 2 +#define AUDIO_CONV_FOZ_TAG_PTNADATA 3 +#define AUDIO_CONV_FOZ_NUM_TAGS 4 + +typedef enum +{ + NO_LOOP, + LOOPING, + LOOP_ENDED, + LOOP_ERROR, +} loop_state; + +struct buffer_entry +{ + struct payload_hash hash; + GstBuffer *buffer; +}; + +/* Followed by codec_data_size bytes codec data. */ +struct need_transcode_head +{ + size_t codec_data_size; + uint32_t wmaversion; + uint32_t bitrate; + uint32_t channels; + uint32_t rate; + uint32_t block_align; + uint32_t depth; +} __attribute__((packed)); + +/* Represents a Stream, a sequence of buffers. */ +struct stream_state +{ + struct murmur3_128_state hash_state; + struct payload_hash current_hash; + GList *buffers; /* Entry type: struct buffer_entry. */ + GList *loop_buffers; /* Entry type: struct buffer_entry. */ + struct need_transcode_head *codec_info; + bool needs_dump; +}; + +struct stream_state_serializer +{ + struct stream_state *state; + int index; +}; + +struct audio_conv_state +{ + bool sent_header; + struct need_transcode_head *codec_data; + struct murmur3_128_state hash_state; + struct murmur3_128_state loop_hash_state; + struct stream_state *stream_state; + struct fozdb *read_fozdb; +}; + +typedef struct +{ + GstElement element; + GstPad *sink_pad, *src_pad; + pthread_mutex_t state_mutex; + struct audio_conv_state *state; +} AudioConv; + +typedef struct +{ + GstElementClass class; +} AudioConvClass; + +G_DEFINE_TYPE(AudioConv, audio_conv, GST_TYPE_ELEMENT); +#define AUDIO_CONV_TYPE (audio_conv_get_type()) +#define AUDIO_CONV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AUDIO_CONV_TYPE, AudioConv)) +#define parent_class (audio_conv_parent_class) +GST_ELEMENT_REGISTER_DEFINE(protonaudioconverter, "protonaudioconverter", + GST_RANK_MARGINAL, AUDIO_CONV_TYPE); + +static GstStaticPadTemplate audio_conv_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-wma;")); + +static GstStaticPadTemplate audio_conv_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-opus;")); + +static struct dump_fozdb dump_fozdb = {PTHREAD_MUTEX_INITIALIZER, NULL, false}; + +static struct buffer_entry *buffer_entry_create(struct payload_hash *hash, GstBuffer *buffer) +{ + struct buffer_entry *entry = calloc(1, sizeof(*entry)); + entry->hash = *hash; + entry->buffer = gst_buffer_ref(buffer); + return entry; +} + +static void buffer_entry_release(void *arg) +{ + struct buffer_entry *entry = arg; + gst_buffer_unref(entry->buffer); + free(entry); +} + +static bool dumping_disabled(void) +{ + return option_enabled("MEDIACONV_AUDIO_DONT_DUMP"); +} + +static bool hash_data(const uint8_t *data, size_t size, struct murmur3_128_state *hash_state, struct payload_hash *hash) +{ + struct bytes_reader reader; + bytes_reader_init(&reader, data, size); + return murmur3_128_full(&reader, bytes_reader_read, hash_state, hash); +} + +static int dump_fozdb_open_audio(bool create) +{ + return dump_fozdb_open(&dump_fozdb, create, "MEDIACONV_AUDIO_DUMP_FILE", AUDIO_CONV_FOZ_NUM_TAGS); +} + +static void dump_fozdb_discard_transcoded(void) +{ + GList *chunks_to_discard = NULL, *chunks_to_keep = NULL, *chunks = NULL, *list_iter; + struct payload_hash chunk_id, *stream_id; + struct fozdb *read_fozdb; + char *read_fozdb_path; + GHashTableIter iter; + int ret; + + if (dump_fozdb.already_cleaned) + return; + dump_fozdb.already_cleaned = true; + + if (discarding_disabled()) + return; + if (!file_exists(getenv("MEDIACONV_AUDIO_DUMP_FILE"))) + return; + + if ((dump_fozdb_open_audio(false)) < 0) + return; + + if (!(read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_AUDIO_TRANSCODED_FILE not set."); + return; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, AUDIO_CONV_FOZ_NUM_TAGS, &read_fozdb)) < 0) + { + GST_ERROR("Failed to create read fozdb, ret %d.", ret); + return; + } + + fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &iter); + while (g_hash_table_iter_next(&iter, (void *)&stream_id, NULL)) + { + uint32_t chunks_size, i; + size_t read_size; + + if (fozdb_entry_size(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + { + uint8_t *buffer = calloc(1, chunks_size); + if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, + 0, buffer, chunks_size, &read_size, true) == CONV_OK) + { + GList *stream_chunks = NULL; + bool has_all = true; + + for (i = 0; i < read_size / sizeof(chunk_id); ++i) + { + payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + if (!fozdb_has_entry(read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &chunk_id)) + { + has_all = false; + break; + } + stream_chunks = g_list_append(stream_chunks, + entry_name_create(AUDIO_CONV_FOZ_TAG_AUDIODATA, &chunk_id)); + } + + for (list_iter = stream_chunks; list_iter; list_iter = list_iter->next) + { + struct entry_name *entry = list_iter->data; + if (has_all) + { + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(entry->tag, &entry->hash)); + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + } + else + { + chunks_to_keep = g_list_append(chunks_to_keep, + entry_name_create(entry->tag, &entry->hash)); + chunks_to_keep = g_list_append(chunks_to_keep, + entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + } + } + + if (has_all) + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(AUDIO_CONV_FOZ_TAG_STREAM, stream_id)); + + g_list_free_full(stream_chunks, free); + } + free(buffer); + } + } + + for (list_iter = chunks_to_discard; list_iter; list_iter = list_iter->next) + { + struct entry_name *entry = list_iter->data; + if (!g_list_find_custom(chunks_to_keep, entry, entry_name_compare)) + chunks = g_list_append(chunks, entry_name_create(entry->tag, &entry->hash)); + } + + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, chunks)) < 0) + { + GST_ERROR("Failed to discard entries, ret %d.", ret); + dump_fozdb_close(&dump_fozdb); + } + + g_list_free_full(chunks, free); + g_list_free_full(chunks_to_keep, free); + g_list_free_full(chunks_to_discard, free); +} + +static bool need_transcode_head_create_from_caps(GstCaps *caps, struct need_transcode_head **out) +{ + int wmaversion, bitrate, channels, rate, block_align, depth; + const GstStructure *structure = gst_caps_get_structure(caps, 0); + struct need_transcode_head *head; + const GValue *codec_data_value; + GstBuffer *codec_data_buffer; + gsize codec_data_size; + + GST_DEBUG("caps %"GST_PTR_FORMAT", out %p.", caps, out); + + if (!gst_structure_get_int(structure, "wmaversion", &wmaversion)) + { + GST_ERROR("Caps have no wmaversion field."); + return false; + } + if (!gst_structure_get_int(structure, "bitrate", &bitrate)) + { + GST_ERROR("Caps have no bitrate field."); + return false; + } + if (!gst_structure_get_int(structure, "channels", &channels)) + { + GST_ERROR("Caps have no channels field."); + return false; + } + if (!gst_structure_get_int(structure, "rate", &rate)) + { + GST_ERROR("Caps have no rate field."); + return false; + } + if (!gst_structure_get_int(structure, "block_align", &block_align)) + { + GST_ERROR("Caps have no block_align field."); + return false; + } + if (!gst_structure_get_int(structure, "depth", &depth)) + { + GST_ERROR("Caps have no depth field."); + return false; + } + if (!(codec_data_value = gst_structure_get_value(structure, "codec_data")) + || !(codec_data_buffer = gst_value_get_buffer(codec_data_value))) + { + GST_ERROR("Caps have no codec_data field."); + return false; + } + + codec_data_size = gst_buffer_get_size(codec_data_buffer); + head = calloc(1, sizeof(*head) + codec_data_size); + head->codec_data_size = codec_data_size; + head->wmaversion = wmaversion; + head->bitrate = bitrate; + head->channels = channels; + head->rate = rate; + head->block_align = block_align; + head->depth = depth; + gst_buffer_extract(codec_data_buffer, 0, head + 1, codec_data_size); + + *out = head; + return true; +} + +static struct need_transcode_head *need_transcode_head_dup(struct need_transcode_head *head) +{ + size_t size = sizeof(*head) + head->codec_data_size; + struct need_transcode_head *dup; + + dup = calloc(1, size); + memcpy(dup, head, size); + + return dup; +} + + +static void need_transcode_head_serialize(struct need_transcode_head *head, + uint8_t *buffer, size_t buffer_size, size_t *out_size) +{ + *out_size = sizeof(*head) - sizeof(head->codec_data_size) + head->codec_data_size; + + if (buffer_size < *out_size) + { + GST_ERROR("Buffer too small: buffer size %zu, out size %zu.", buffer_size, *out_size); + return; + } + memcpy(buffer, &head->wmaversion, *out_size); +} + +static void stream_state_serializer_init(struct stream_state_serializer *serializer, struct stream_state *state) +{ + serializer->state = state; + serializer->index = 0; +} + +static int stream_state_serializer_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct stream_state_serializer *serializer = data_reader; + struct buffer_entry *entry; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (serializer->index >= g_list_length(serializer->state->buffers)) + return CONV_ERROR_DATA_END; + + entry = g_list_nth_data(serializer->state->buffers, serializer->index++); + memcpy(buffer, &entry->hash, sizeof(entry->hash)); + + *read_size = sizeof(entry->hash); + return CONV_OK; +} + +static struct stream_state *stream_state_create(void) +{ + struct stream_state *state; + state = calloc(1, sizeof(*state)); + murmur3_128_state_init(&state->hash_state, HASH_SEED); + return state; +} + +static void stream_state_release(struct stream_state *state) +{ + g_list_free_full(state->buffers, buffer_entry_release); + g_list_free_full(state->loop_buffers, buffer_entry_release); + if (state->codec_info) + free(state->codec_info); + free(state); +} + +static void stream_state_reset(struct stream_state *state) +{ + murmur3_128_state_reset(&state->hash_state); + memset(&state->current_hash, 0, sizeof(state->current_hash)); + g_list_free_full(g_steal_pointer(&state->buffers), buffer_entry_release); + g_list_free_full(g_steal_pointer(&state->loop_buffers), buffer_entry_release); + free(state->codec_info); + state->codec_info = NULL; + state->needs_dump = false; +} + +static loop_state stream_state_record_buffer(struct stream_state *state, struct payload_hash *buffer_hash, + struct payload_hash *loop_hash, GstBuffer *buffer, struct need_transcode_head *codec_info) +{ + if (!state->codec_info && codec_info) + state->codec_info = need_transcode_head_dup(codec_info); + + if (g_list_length(state->loop_buffers) < g_list_length(state->buffers)) + { + struct buffer_entry *entry = g_list_nth_data(state->buffers, g_list_length(state->loop_buffers)); + if (!memcmp(&entry->hash, loop_hash, sizeof(*loop_hash))) + { + state->loop_buffers = g_list_append(state->loop_buffers, + buffer_entry_create(buffer_hash /* Not loop_hash! */, buffer)); + if (g_list_length(state->loop_buffers) == g_list_length(state->buffers)) + { + /* Full loop, just drop them. */ + g_list_free_full(g_steal_pointer(&state->loop_buffers), buffer_entry_release); + return LOOP_ENDED; + } + + return LOOPING; + } + } + + /* Partial loop, track them and then continue */ + if (state->loop_buffers) + state->buffers = g_list_concat(state->buffers, g_steal_pointer(&state->loop_buffers)); + + state->buffers = g_list_append(state->buffers, buffer_entry_create(buffer_hash, buffer)); + + if (!hash_data((const uint8_t *)buffer_hash, sizeof(*buffer_hash), &state->hash_state, &state->current_hash)) + return LOOP_ERROR; + + return NO_LOOP; +} + +static bool stream_state_is_stream_subset(struct stream_state *state, struct fozdb *db, struct payload_hash *stream_id) +{ + uint64_t offset = 0; + GList *list_iter; + + for (list_iter = state->buffers; list_iter; list_iter = list_iter->next) + { + struct buffer_entry *entry = list_iter->data; + struct payload_hash buffer_id; + size_t read_size; + + if ((fozdb_read_entry_data(db, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, + offset, (uint8_t *)&buffer_id, sizeof(buffer_id), &read_size, true)) < 0 + || read_size != sizeof(buffer_id)) + return false; + + if (memcmp(&buffer_id, &entry->hash, sizeof(buffer_id)) != 0) + return false; + + offset += sizeof(buffer_id); + } + + GST_LOG("Stream id %s is a subset of %s, so not recording stream.", + format_hash(&state->current_hash), format_hash(stream_id)); + + return true; +} + +static int stream_state_write_to_foz(struct stream_state *state) +{ + struct stream_state_serializer serializer; + struct buffer_entry *entry; + struct bytes_reader reader; + uint8_t buffer[1024]; + size_t header_size; + GList *list_iter; + bool found; + int ret; + + GST_DEBUG("state %p, current hash %s.", state, format_hash(&state->current_hash)); + + if (!state->needs_dump || !state->buffers) + return CONV_OK; + + pthread_mutex_lock(&dump_fozdb.mutex); + + if ((ret = dump_fozdb_open_audio(true)) < 0) + { + GST_ERROR("Failed to open audio dump fozdb, ret %d.", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + found = fozdb_has_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &state->current_hash); + if (!found) + { + /* Are there any recorded streams of which this stream is a subset? */ + struct payload_hash *stream_id; + GHashTableIter stream_ids; + + fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &stream_ids); + while (g_hash_table_iter_next(&stream_ids, (void **)&stream_id, NULL)) + { + if (stream_state_is_stream_subset(state, dump_fozdb.fozdb, stream_id)) + { + found = true; + break; + } + } + } + + if (!found) + { + if (dumping_disabled()) + { + GST_LOG("Dumping disabled, so not recording stream id %s.", format_hash(&state->current_hash)); + } + else + { + GST_LOG("Recording stream id %s.", format_hash(&state->current_hash)); + + need_transcode_head_serialize(state->codec_info, buffer, sizeof(buffer), &header_size); + bytes_reader_init(&reader, buffer, header_size); + entry = state->buffers->data; + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash, + &reader, bytes_reader_read, true)) < 0) + { + GST_ERROR("Unable to write stream header, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + stream_state_serializer_init(&serializer, state); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &state->current_hash, + &serializer, stream_state_serializer_read, true)) < 0) + { + GST_ERROR("Unable to write stream, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + for (list_iter = state->buffers; list_iter; list_iter = list_iter->next) + { + struct gst_buffer_reader buffer_reader; + + entry = list_iter->data; + gst_buffer_reader_init(&buffer_reader, entry->buffer); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_AUDIODATA, &entry->hash, + &buffer_reader, gst_buffer_reader_read, true)) < 0) + { + GST_ERROR("Unable to write audio data, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + } + } + } + + pthread_mutex_unlock(&dump_fozdb.mutex); + return CONV_OK; +} + +static int audio_conv_state_create(struct audio_conv_state **out) +{ + struct audio_conv_state *state; + struct fozdb *fozdb = NULL; + char *read_fozdb_path; + int ret; + + if (!(read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_AUDIO_TRANSCODED_FILE is not set!"); + return CONV_ERROR_ENV_NOT_SET; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, AUDIO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create fozdb from %s, ret %d.", read_fozdb_path, ret); + + state = calloc(1, sizeof(*state)); + murmur3_128_state_init(&state->hash_state, HASH_SEED); + murmur3_128_state_init(&state->loop_hash_state, HASH_SEED); + state->stream_state = stream_state_create(); + state->read_fozdb = fozdb; + + *out = state; + return CONV_OK; +} + +static void audio_conv_state_release(struct audio_conv_state *state) +{ + free(state->codec_data); + stream_state_release(state->stream_state); + if (state->read_fozdb) + fozdb_release(state->read_fozdb); + free(state); +} + +static void audio_conv_state_reset(struct audio_conv_state *state) +{ + if (stream_state_write_to_foz(state->stream_state) < 0) + GST_ERROR("Failed to write stream to dump fozdb."); + + stream_state_reset(state->stream_state); + murmur3_128_state_reset(&state->hash_state); + murmur3_128_state_reset(&state->loop_hash_state); +} + +/* Allocate a buffer on success, free it after usage. */ +static int audio_conv_state_open_transcode_file(struct audio_conv_state *state, GstBuffer *buffer, + uint8_t **out_data, size_t *out_size) +{ + struct payload_hash hash, loop_hash; + uint32_t transcoded_size; + const char *blank_audio; + bool try_loop, hash_ok; + GstMapInfo map_info; + uint64_t file_size; + loop_state loop; + uint8_t *data; + size_t size; + int fd; + + /* Hash buffer. */ + if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) + return CONV_ERROR; + hash_ok = hash_data(map_info.data, map_info.size, &state->hash_state, &hash) + && hash_data(map_info.data, map_info.size, &state->loop_hash_state, &loop_hash); + gst_buffer_unmap(buffer, &map_info); + if (!hash_ok) + { + GST_ERROR("Failed to hash buffer."); + return CONV_ERROR; + } + + loop = stream_state_record_buffer(state->stream_state, &hash, &loop_hash, buffer, state->codec_data); + gst_buffer_unref(buffer); /* Buffer has been recorded, so unref it. */ + switch (loop) + { + case NO_LOOP: + murmur3_128_state_reset(&state->loop_hash_state); + try_loop = false; + break; + + case LOOP_ENDED: + murmur3_128_state_reset(&state->loop_hash_state); + case LOOPING: + try_loop = true; + break; + + case LOOP_ERROR: + default: + return CONV_ERROR; + } + + if (try_loop) + GST_INFO("Buffer hash: %s (Loop: %s).", format_hash(&hash), format_hash(&loop_hash)); + else + GST_INFO("Buffer hash: %s.", format_hash(&hash)); + + /* Try to read transcoded data. */ + if (state->read_fozdb) + { + if (fozdb_entry_size(state->read_fozdb, + AUDIO_CONV_FOZ_TAG_PTNADATA, &hash, &transcoded_size) == CONV_OK) + { + data = calloc(1, transcoded_size); + if (fozdb_read_entry_data(state->read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &hash, 0, + data, transcoded_size, &size, false) == CONV_OK) + { + *out_data = data; + *out_size = size; + return CONV_OK; + } + free(data); + } + + if (try_loop && fozdb_entry_size(state->read_fozdb, + AUDIO_CONV_FOZ_TAG_PTNADATA, &loop_hash, &transcoded_size) == CONV_OK) + { + data = calloc(1, transcoded_size); + if (fozdb_read_entry_data(state->read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &loop_hash, 0, + data, transcoded_size, &size, false) == CONV_OK) + { + *out_data = data; + *out_size = size; + return CONV_OK; + } + free(data); + } + } + + /* If we can't, return the blank file */ + state->stream_state->needs_dump = true; + if (!(blank_audio = getenv("MEDIACONV_BLANK_AUDIO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_AUDIO_FILE not set."); + return CONV_ERROR_ENV_NOT_SET; + } + if (!open_file(blank_audio, O_RDONLY, &fd)) + return CONV_ERROR_OPEN_FAILED; + if (!get_file_size(fd, &file_size)) + { + close(fd); + return CONV_ERROR; + } + data = calloc(1, file_size); + if (!complete_read(fd, data, file_size)) + { + free(data); + close(fd); + return CONV_ERROR_READ_FAILED; + } + + create_placeholder_file("placeholder-audio-used"); + + *out_data = data; + *out_size = file_size; + + return CONV_OK; +} + +/* Call pthread_mutex_unlock() to unlock after usage. */ +static struct audio_conv_state *audio_conv_lock_state(AudioConv *conv) +{ + pthread_mutex_lock(&conv->state_mutex); + if (!conv->state) + pthread_mutex_unlock(&conv->state_mutex); + return conv->state; +} + +static GstStateChangeReturn audio_conv_change_state(GstElement *element, GstStateChange transition) +{ + AudioConv *conv = AUDIO_CONV(element); + struct audio_conv_state *state; + int ret; + + GST_DEBUG_OBJECT(element, "State transition %s.", gst_state_change_get_name(transition)); + + switch (transition) + { + case GST_STATE_CHANGE_NULL_TO_READY: + /* Do runtime setup. */ + + /* Open fozdb here; this is the right place to fail + * and opening may be expensive. */ + pthread_mutex_lock(&dump_fozdb.mutex); + dump_fozdb_discard_transcoded(); + ret = dump_fozdb_open_audio(true); + pthread_mutex_unlock(&dump_fozdb.mutex); + if (ret < 0) + { + GST_ERROR("Failed to open dump fozdb, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + + /* Create audio conv state. */ + if ((ret = audio_conv_state_create(&state)) < 0) + { + GST_ERROR("Failed to create audio conv state, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + pthread_mutex_lock(&conv->state_mutex); + assert(!conv->state); + conv->state = state; + pthread_mutex_unlock(&conv->state_mutex); + break; + + case GST_STATE_CHANGE_READY_TO_NULL: + /* Do runtime teardown. */ + pthread_mutex_lock(&conv->state_mutex); + state = conv->state; + conv->state = NULL; + pthread_mutex_unlock(&conv->state_mutex); + + if (state && (ret = stream_state_write_to_foz(state->stream_state)) < 0) + GST_WARNING("Error writing out stream data, ret %d.", ret); + audio_conv_state_release(state); + break; + + default: + break; + } + + return GST_ELEMENT_CLASS(parent_class)->change_state(element, transition); + + /* XXX on ReadyToNull, sodium drops state _again_ here... why? */ +} + +static gboolean audio_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + AudioConv *conv = AUDIO_CONV(parent); + struct audio_conv_state *state; + GstCaps *caps; + bool ret; + + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + + switch (event->type) + { + case GST_EVENT_CAPS: + if ((state = audio_conv_lock_state(conv))) + { + gst_event_parse_caps(event, &caps); + if (!need_transcode_head_create_from_caps(caps, &state->codec_data)) + { + GST_ERROR("Invalid WMA caps!"); + pthread_mutex_unlock(&conv->state_mutex); + return false; + } + pthread_mutex_unlock(&conv->state_mutex); + } + + caps = gst_caps_from_string("audio/x-opus, channel-mapping-family=0"); + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; + + case GST_EVENT_FLUSH_STOP: + if ((state = audio_conv_lock_state(conv))) + { + audio_conv_state_reset(state); + pthread_mutex_unlock(&conv->state_mutex); + } + return gst_pad_event_default(pad, parent, event); + + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static GstFlowReturn audio_conv_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + size_t ptna_data_size, offset, encoded_len; + GstFlowReturn flow_ret = GST_FLOW_ERROR; + AudioConv *conv = AUDIO_CONV(parent); + struct audio_conv_state *state; + uint8_t *ptna_data = NULL; + int ret; + + GST_LOG_OBJECT(pad, "Handling buffer <%"GST_PTR_FORMAT">.", buffer); + + if (!(state = audio_conv_lock_state(conv))) + return flow_ret; + + if ((ret = audio_conv_state_open_transcode_file(state, buffer, &ptna_data, &ptna_data_size)) < 0) + { + GST_ERROR("Failed to read transcoded audio, ret %d. Things will go badly...", ret); + goto done; + } + + for (offset = 0; offset < ptna_data_size; offset += encoded_len) + { + uint32_t packet_header, flags, padding_len; + GstBuffer *new_buffer; + bool packet_is_header; + + if (offset + 4 >= ptna_data_size) + { + GST_WARNING( "Short read on ptna header?"); + break; + } + + packet_header = bytes_to_uint32(&ptna_data[offset]); + offset += 4; + + flags = packet_header & AUDIO_CONV_FLAG_MASK, + padding_len = (packet_header & AUDIO_CONV_PADDING_LENGTH_MASK) >> AUDIO_CONV_PADDING_LENGTH_SHIFT; + encoded_len = packet_header & AUDIO_CONV_ENCODED_LENGTH_MASK; + + if (offset + encoded_len > ptna_data_size) + { + GST_WARNING("Short read on ptna data?"); + break; + } + + packet_is_header = flags & AUDIO_CONV_FLAG_HEADER; + if (packet_is_header && state->sent_header) + continue; /* Only send one header. */ + + /* TODO: can we use a GstBuffer cache here? */ + new_buffer = gst_buffer_new_and_alloc(encoded_len); + if (!packet_is_header && padding_len > 0) + gst_buffer_add_audio_clipping_meta(new_buffer, GST_FORMAT_DEFAULT, 0, padding_len); + gst_buffer_fill(new_buffer, 0, ptna_data + offset, encoded_len); + + GST_LOG("Pushing one packet of len %zu.", encoded_len); + if ((flow_ret = gst_pad_push(conv->src_pad, new_buffer)) < 0) + { + GST_ERROR("Failed to push buffer <%"GST_PTR_FORMAT"> to src pad %"GST_PTR_FORMAT, + new_buffer, conv->src_pad); + goto done; + } + + if (packet_is_header) + state->sent_header = true; + } + + flow_ret = GST_FLOW_OK; + +done: + if (ptna_data) + free(ptna_data); + pthread_mutex_unlock(&conv->state_mutex); + return flow_ret; +} + +static gboolean audio_conv_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + AudioConv *conv = AUDIO_CONV(parent); + GstSchedulingFlags flags; + gint min, max, align; + GstQuery *peer_query; + + GST_DEBUG_OBJECT(pad, "Got query %"GST_PTR_FORMAT".", query); + + switch (query->type) + { + case GST_QUERY_SCHEDULING: + peer_query = gst_query_new_scheduling(); + if (!gst_pad_peer_query(conv->sink_pad, peer_query)) + { + gst_query_unref(peer_query); + return false; + } + gst_query_parse_scheduling(peer_query, &flags, &min, &max, &align); + gst_query_unref(peer_query); + gst_query_set_scheduling(query, flags, min, max, align); + return true; + + default: + return gst_pad_query_default(pad, parent, query); + } + +} + +static gboolean audio_conv_active_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean active) +{ + AudioConv *conv = AUDIO_CONV(parent); + return gst_pad_activate_mode(conv->sink_pad, mode, active); +} + +static void audio_conv_finalize(GObject *object) +{ + AudioConv *conv = AUDIO_CONV(object); + + pthread_mutex_destroy(&conv->state_mutex); + if (conv->state) + audio_conv_state_release(conv->state); + + G_OBJECT_CLASS(parent_class)->finalize(object); +} + +static void audio_conv_class_init(AudioConvClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton audio converter", + "Codec/Demuxer", + "Converts audio for Proton", + "Andrew Eikum , Ziqing Hui "); + + element_class->change_state = audio_conv_change_state; + object_class->finalize = audio_conv_finalize; + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_src_template)); +} + +static void audio_conv_init(AudioConv *conv) +{ + GstElement *element = GST_ELEMENT(conv); + + conv->sink_pad = gst_pad_new_from_static_template(&audio_conv_sink_template, "sink"); + gst_pad_set_event_function(conv->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_sink_event)); + gst_pad_set_chain_function(conv->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_chain)); + gst_element_add_pad(element, conv->sink_pad); + + conv->src_pad = gst_pad_new_from_static_template(&audio_conv_src_template, "src"); + gst_pad_set_query_function(conv->src_pad, GST_DEBUG_FUNCPTR(audio_conv_src_query)); + gst_pad_set_activatemode_function(conv->src_pad, GST_DEBUG_FUNCPTR(audio_conv_active_mode)); + gst_element_add_pad(element, conv->src_pad); + + pthread_mutex_init(&conv->state_mutex, NULL); + conv->state = NULL; +} diff --git a/dlls/winegstreamer/media-converter/audioconvbin.c b/dlls/winegstreamer/media-converter/audioconvbin.c new file mode 100644 index 00000000000..9857a0ff507 --- /dev/null +++ b/dlls/winegstreamer/media-converter/audioconvbin.c @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef struct +{ + GstBin bin; + GstElement *audio_conv, *opus_dec, *caps_setter; + GstPad *sink_pad, *src_pad; /* Ghost pads. */ +} AudioConvBin; + +typedef struct +{ + GstBinClass class; +} AudioConvBinClass; + +G_DEFINE_TYPE(AudioConvBin, audio_conv_bin, GST_TYPE_BIN); +#define AUDIO_CONV_BIN_TYPE (audio_conv_bin_get_type()) +#define AUDIO_CONV_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AUDIO_CONV_BIN_TYPE, AudioConvBin)) +GST_ELEMENT_REGISTER_DEFINE(protonaudioconverterbin, "protonaudioconverterbin", + GST_RANK_MARGINAL + 1, AUDIO_CONV_BIN_TYPE); + +static GstStaticPadTemplate audio_conv_bin_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-wma;")); + +static GstStaticPadTemplate audio_conv_bin_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-raw, format=S16LE;")); + +static void link_elements(GstElement *src_element, GstElement *sink_element) +{ + if (!gst_element_link(src_element, sink_element)) + GST_ERROR("Failed to link src element %"GST_PTR_FORMAT" to sink element %"GST_PTR_FORMAT".", + src_element, sink_element); +} + +static gboolean audio_conv_bin_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + AudioConvBin * bin = AUDIO_CONV_BIN(parent); + GstCaps *caps, *rate_caps; + GstStructure *structure; + GstPad *audio_conv_sink; + gint override_rate; + gboolean ret; + + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + + switch (event->type) + { + case GST_EVENT_CAPS: + gst_event_parse_caps(event, &caps); + if ((structure = gst_caps_get_structure(caps, 0)) + && gst_structure_get_int(structure, "rate", &override_rate)) + { + rate_caps = gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, override_rate, NULL); + g_object_set(bin->caps_setter, "caps", rate_caps, NULL); + } + else + { + GST_WARNING("Event has no rate."); + } + + /* Forward on to the real pad. */ + audio_conv_sink = gst_element_get_static_pad(bin->audio_conv, "sink"); + ret = gst_pad_send_event(audio_conv_sink, event); + gst_object_unref(audio_conv_sink); + return ret; + + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static void audio_conv_bin_class_init(AudioConvBinClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton audio converter with rate fixup", + "Codec/Decoder/Audio", + "Converts audio for Proton, fixing up samplerates", + "Andrew Eikum , Ziqing Hui "); + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_bin_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_bin_src_template)); +} + +static void audio_conv_bin_init(AudioConvBin *bin) +{ + GstElement *element = GST_ELEMENT(bin); + GstPad *sink, *src; + + bin->sink_pad = gst_ghost_pad_new_no_target_from_template("sink", + gst_element_get_pad_template(element, "sink")); + bin->src_pad = gst_ghost_pad_new_no_target_from_template("src", + gst_element_get_pad_template(element, "src")); + gst_pad_set_event_function(bin->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_bin_sink_event)); + + bin->audio_conv = create_element("protonaudioconverter", "protonmediaconverter"); + bin->opus_dec = create_element("opusdec", "base"); + bin->caps_setter = create_element("capssetter", "good"); + + gst_bin_add(GST_BIN(bin), bin->audio_conv); + gst_bin_add(GST_BIN(bin), bin->opus_dec); + gst_bin_add(GST_BIN(bin), bin->caps_setter); + + link_elements(bin->audio_conv, bin->opus_dec); + link_elements(bin->opus_dec, bin->caps_setter); + + sink = gst_element_get_static_pad(bin->audio_conv, "sink"); + src = gst_element_get_static_pad(bin->caps_setter, "src"); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->sink_pad), sink); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->src_pad), src); + gst_object_unref(src); + gst_object_unref(sink); + + gst_element_add_pad(element, bin->sink_pad); + gst_element_add_pad(element, bin->src_pad); + + GST_INFO("Initialized AudioConvBin %"GST_PTR_FORMAT": audio_conv %"GST_PTR_FORMAT", opus_dec %"GST_PTR_FORMAT", " + "caps_setter %"GST_PTR_FORMAT", sink_pad %"GST_PTR_FORMAT", src_pad %"GST_PTR_FORMAT".", + bin, bin->audio_conv, bin->opus_dec, bin->caps_setter, bin->sink_pad, bin->src_pad); +} diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c new file mode 100644 index 00000000000..057825ad5b5 --- /dev/null +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -0,0 +1,722 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * Based on "Fossilize," which is + * Copyright (c) 2018-2019 Hans-Kristian Arntzen + * https://github.com/ValveSoftware/Fossilize/ + */ + +/* This is a read/write implementation of the Fossilize database format. + * + * https://github.com/ValveSoftware/Fossilize/ + * + * That C++ implementation is specific to Vulkan, while this one tries to be generic to store any + * type of data. + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +/* Fossilize StreamArchive database format version 6: + * + * The file consists of a header, followed by an unlimited series of "entries". + * + * All multi-byte entities are little-endian. + * + * The file header is as follows: + * + * Field Type Description + * ----- ---- ----------- + * magic_number uint8_t[12] Constant value: "\x81""FOSSILIZEDB" + * version uint32_t StreamArchive version: 6 + * + * + * Each entry follows this format: + * + * Field Type Description + * ----- ---- ----------- + * name unsigned char[40] Application-defined entry identifier, stored in hexadecimal big-endian + * ASCII. Usually N-char tag followed by (40 - N)-char hash. + * size uint32_t Size of the payload as stored in this file. + * flags uint32_t Flags for this entry (e.g. compression). See below. + * crc32 uint32_t CRC32 of the payload as stored in this file. + * full_size uint32_t Size of this payload after decompression. + * payload uint8_t[stored_size] Entry data. + * + * The flags field may contain: + * 0x1: No compression. + * 0x2: Deflate compression. + */ + +#define FOZDB_MIN_COMPAT_VERSION 5 +#define FOZDB_VERSION 6 + +#define FOZDB_COMPRESSION_NONE 1 +#define FOZDB_COMPRESSION_DEFLATE 2 + +#define ENTRY_NAME_SIZE 40 + +#define BUFFER_COPY_BYTES (8 * 1024 * 1024) /* Tuneable. */ + +static const uint8_t FOZDB_MAGIC[] = {0x81, 'F', 'O', 'S', 'S', 'I', 'L', 'I', 'Z', 'E', 'D', 'B'}; + +struct file_header +{ + uint8_t magic[12]; + uint8_t unused1; + uint8_t unused2; + uint8_t unused3; + uint8_t version; +} __attribute__((packed)); + +struct payload_header +{ + uint32_t size; + uint32_t compression; + uint32_t crc; + uint32_t full_size; +} __attribute__((packed)); + +struct payload_entry +{ + struct payload_hash hash; + struct payload_header header; + uint64_t offset; +}; + +static guint hash_func(gconstpointer key) +{ + const struct payload_hash *payload_hash = key; + + return payload_hash->hash[0] + ^ payload_hash->hash[1] + ^ payload_hash->hash[2] + ^ payload_hash->hash[3]; +} + +static gboolean hash_equal(gconstpointer a, gconstpointer b) +{ + return memcmp(a, b, sizeof(struct payload_hash)) == 0; +} + +static bool tag_from_ascii_bytes(uint32_t *tag, const uint8_t *ascii_bytes) +{ + char str[sizeof(*tag) * 2 + 1] = {}; + + memcpy(str, ascii_bytes, sizeof(*tag) * 2); + + *tag = strtoul(str, NULL, 16); + if (errno != 0) + { + GST_ERROR("Failed to convert string \"%s\" to tag. %s.", str, strerror(errno)); + return false; + } + + return true; +} + +static bool hash_from_ascii_bytes(struct payload_hash *hash, const uint8_t *ascii_bytes) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(hash->hash); ++i) + { + uint32_t *hash_part = &hash->hash[ARRAY_SIZE(hash->hash) - 1 - i]; + char str[sizeof(hash_part) * 2 + 1] = {}; + + memcpy(str, ascii_bytes + sizeof(*hash_part) * 2 * i, sizeof(*hash_part) * 2); + + *hash_part = strtoul(str, NULL, 16); + + if (errno != 0) + { + GST_ERROR("Failed to convert string \"%s\" to hash part %u. %s.", str, 4 - i, strerror(errno)); + return false; + } + } + + return true; +} + +static void tag_to_ascii_bytes(uint32_t tag, uint8_t *ascii_bytes) +{ + char buffer[sizeof(tag) * 2 + 1]; + sprintf(buffer, "%08x", tag); + memcpy(ascii_bytes, buffer, sizeof(tag) * 2); +} + +static void hash_to_ascii_bytes(const struct payload_hash *hash, uint8_t *ascii_bytes) +{ + char buffer[sizeof(*hash) * 2 + 1]; + sprintf(buffer, "%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0]); + memcpy(ascii_bytes, buffer, sizeof(*hash) * 2); +} + +static void payload_header_from_bytes(struct payload_header *header, const uint8_t *bytes) +{ + header->size = bytes_to_uint32(bytes); + header->compression = bytes_to_uint32(bytes + 4); + header->crc = bytes_to_uint32(bytes + 8); + header->full_size = bytes_to_uint32(bytes + 12); +} + +static int fozdb_read_file_header(struct fozdb *db) +{ + struct file_header header; + + if (!complete_read(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to read file header."); + return CONV_ERROR_READ_FAILED; + } + if (memcmp(&header.magic, FOZDB_MAGIC, sizeof(FOZDB_MAGIC)) != 0) + { + GST_ERROR("Bad magic."); + return CONV_ERROR_CORRUPT_DATABASE; + } + if (header.version < FOZDB_MIN_COMPAT_VERSION || header.version > FOZDB_VERSION) + { + GST_ERROR("Incompatible version %u.", header.version); + return CONV_ERROR_CORRUPT_DATABASE; + } + + return CONV_OK; +} + +static int fozdb_read_entry_tag_hash_header(struct fozdb *db, + uint32_t *out_tag, struct payload_hash *out_hash, struct payload_header *out_header) +{ + uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; + struct payload_hash hash; + uint32_t tag; + + if (!complete_read(db->file, entry_name_and_header, sizeof(entry_name_and_header))) + { + GST_ERROR("Failed to read entry name and header."); + return CONV_ERROR_READ_FAILED; + } + + if (!tag_from_ascii_bytes(&tag, entry_name_and_header) + || !hash_from_ascii_bytes(&hash, entry_name_and_header + sizeof(tag) * 2)) + return CONV_ERROR_CORRUPT_DATABASE; + + payload_header_from_bytes(out_header, entry_name_and_header + ENTRY_NAME_SIZE); + + *out_tag = tag; + *out_hash = hash; + return CONV_OK; +} + +static bool fozdb_seek_to_next_entry(struct fozdb *db, struct payload_header *header, bool *truncated) +{ + uint64_t file_size = 0, data_offset = lseek(db->file, 0, SEEK_CUR); + + if (truncated) + *truncated = false; + + get_file_size(db->file, &file_size); + + if (lseek(db->file, header->size, SEEK_CUR) < 0) + { + GST_ERROR("Failed to seek to next entry. %s. " + "Entry data offset %#"PRIx64", size %#x, file size %#"PRIx64".", + strerror(errno), data_offset, header->size, file_size); + return false; + } + + if (file_size && data_offset + header->size > file_size) + { + /* Truncated chunk is not fatal. */ + GST_WARNING("Entry data larger than file, truncating database here. " + "Entry data offset %#"PRIx64", size %#x, file size %#"PRIx64".", + data_offset, header->size, file_size); + if (truncated) + *truncated = true; + } + + return true; +} + +static bool fozdb_write_entry_name(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +{ + uint8_t entry_name[ENTRY_NAME_SIZE]; + + tag_to_ascii_bytes(tag, entry_name); + hash_to_ascii_bytes(hash, entry_name + sizeof(tag) * 2); + + if (!complete_write(db->file, entry_name, sizeof(entry_name))) + { + GST_ERROR("Failed to write entry name."); + return false; + } + + return true; +} + +/* Copy an entry to write_pos. */ +static int fozdb_copy_entry(struct fozdb *db, + struct entry_name *name, struct payload_header *header, uint64_t entry_data_offset) +{ + uint64_t read_offset, entry_end = entry_data_offset + header->size; + ssize_t read_size; + uint8_t *buffer; + + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek file to write_pos."); + return CONV_ERROR_SEEK_FAILED; + } + + /* Write entry name. */ + if (!fozdb_write_entry_name(db, name->tag, &name->hash)) + return CONV_ERROR_WRITE_FAILED; + db->write_pos += ENTRY_NAME_SIZE; + + /* Write entry header. */ + if (!complete_write(db->file, header, sizeof(*header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos += sizeof(*header); + + /* Copy entry data. */ + buffer = calloc(1, BUFFER_COPY_BYTES); + for (read_offset = entry_data_offset; read_offset < entry_end; read_offset += read_size) + { + size_t to_read = min(entry_end - read_offset, BUFFER_COPY_BYTES); + + /* Read data from entry. */ + if (lseek(db->file, read_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to read offset. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_SEEK_FAILED; + } + if ((read_size = read(db->file, buffer, to_read)) < 0) + { + GST_ERROR("Failed to read entry data. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_READ_FAILED; + } + if (read_size == 0) + break; + + /* Write data to write_pos. */ + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to write_pos. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_SEEK_FAILED; + } + if (!complete_write(db->file, buffer, read_size)) + { + GST_ERROR("Failed to write entry data to write_pos."); + free(buffer); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos += read_size; + } + free(buffer); + + if (lseek(db->file, read_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to read offset. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + + return CONV_OK; +} + +int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out) +{ + struct fozdb *db; + size_t i; + int ret; + + GST_DEBUG("file_name %s, open_flags %d, read_only %d, num_tags %u, out %p.", + file_name, open_flags, read_only, num_tags, out); + + db = calloc(1, sizeof(*db)); + + if (!open_file(file_name, open_flags, &db->file)) + { + free(db); + return CONV_ERROR_OPEN_FAILED; + } + + db->file_name = file_name; + db->num_tags = num_tags; + db->read_only = read_only; + + /* Create entry hash tables. */ + db->seen_blobs = calloc(num_tags, sizeof(*db->seen_blobs)); + for (i = 0; i < num_tags; ++i) + db->seen_blobs[i] = g_hash_table_new_full(hash_func, hash_equal, NULL, free); + + /* Load entries. */ + if ((ret = fozdb_prepare(db)) < 0) + { + GST_ERROR("Failed to prepare fozdb, ret %d.", ret); + fozdb_release(db); + return ret; + } + + GST_INFO("Created fozdb %p from %s.", db, file_name); + + *out = db; + return CONV_OK; +} + +void fozdb_release(struct fozdb *db) +{ + int i; + + GST_DEBUG("db %p.", db); + + for (i = 0; i < db->num_tags; ++i) + g_hash_table_destroy(db->seen_blobs[i]); + free(db->seen_blobs); + close(db->file); + free(db); +} + +int fozdb_prepare(struct fozdb *db) +{ + uint64_t file_size; + int ret; + + GST_DEBUG("db %p, file_name %s, read_only %d, num_tags %u.", + db, db->file_name, db->read_only, db->num_tags); + + db->write_pos = lseek(db->file, 0, SEEK_SET); + if (!get_file_size(db->file, &file_size)) + return CONV_ERROR; + + /* New file, write foz header. */ + if (!file_size) + { + struct file_header file_header; + + memcpy(file_header.magic, FOZDB_MAGIC, sizeof(FOZDB_MAGIC)); + file_header.unused1 = 0; + file_header.unused2 = 0; + file_header.unused3 = 0; + file_header.version = FOZDB_VERSION; + + if (!complete_write(db->file, &file_header, sizeof(file_header))) + { + GST_ERROR("Failed to write file header."); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos = sizeof(file_header); + + return CONV_OK; + } + + /* Read file header. */ + if ((ret = fozdb_read_file_header(db)) < 0) + return ret; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + /* Read entries to seen_blobs. */ + while (db->write_pos < file_size) + { + struct payload_entry entry, *table_entry; + uint32_t tag; + + /* Read an entry. */ + if ((ret = fozdb_read_entry_tag_hash_header(db, &tag, &entry.hash, &entry.header) < 0)) + return ret; + entry.offset = lseek(db->file, 0, SEEK_CUR); + + if (!fozdb_seek_to_next_entry(db, &entry.header, NULL)) + return CONV_ERROR_SEEK_FAILED; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + GST_INFO("Got entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", + tag, format_hash(&entry.hash), entry.offset, entry.header.size, entry.header.crc); + + /* Insert entry to hash table. */ + if (tag >= db->num_tags) + { + GST_WARNING("Invalid tag %u.", tag); + + /* Ignore unknown tags for read-only DBs. */ + if (db->read_only) + continue; + else + return CONV_ERROR_INVALID_TAG; + } + table_entry = calloc(1, sizeof(*table_entry)); + *table_entry = entry; + g_hash_table_insert(db->seen_blobs[tag], &table_entry->hash, table_entry); + } + + return CONV_OK; +} + +bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +{ + if (tag >= db->num_tags) + return false; + return g_hash_table_contains(db->seen_blobs[tag], hash); +} + +int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size) +{ + struct payload_entry *entry; + + if (tag >= db->num_tags) + return CONV_ERROR_INVALID_TAG; + if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + return CONV_ERROR_ENTRY_NOT_FOUND; + + *size = entry->header.full_size; + + return CONV_OK; +} + +void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter) +{ + if (tag > db->num_tags) + { + GST_ERROR("Invalid tag %u.", tag); + return; + } + g_hash_table_iter_init(iter, db->seen_blobs[tag]); +} + +int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc) +{ + struct payload_entry *entry; + size_t to_copy; + + GST_DEBUG("db %p, file_name %s, tag %u, hash %s, offset %#"PRIx64", buffer %p, size %zu, read_size %p, with_crc %d.", + db, db->file_name, tag, format_hash(hash), offset, buffer, size, read_size, with_crc); + + if (tag >= db->num_tags) + return CONV_ERROR_INVALID_TAG; + if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + return CONV_ERROR_ENTRY_NOT_FOUND; + + if (entry->header.compression != FOZDB_COMPRESSION_NONE) + return CONV_ERROR_NOT_IMPLEMENTED; + + if (offset >= entry->header.full_size) + return CONV_OK; + + if (lseek(db->file, entry->offset + offset, SEEK_SET) < 0) + return CONV_ERROR_SEEK_FAILED; + + to_copy = min(entry->header.full_size - offset, size); + if (!complete_read(db->file, buffer, to_copy)) + { + GST_ERROR("Failed to read entry data."); + return CONV_ERROR_READ_FAILED; + } + *read_size = to_copy; + + if (entry->header.crc != 0 && with_crc && entry->header.crc != crc32(0, buffer, to_copy)) + { + GST_ERROR("Wrong check sum."); + return CONV_ERROR_WRONG_CHECKSUM; + } + + return CONV_OK; +} + +int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + void *data_src, data_read_callback read_callback, bool with_crc) +{ + struct payload_header header; + struct payload_entry *entry; + off_t header_offset; + uint32_t size = 0; + size_t read_size; + uint8_t *buffer; + uint64_t offset; + int ret; + + GST_DEBUG("db %p, file_name %s, tag %u, hash %s, data_src %p, read_callback %p, with_crc %d.", + db, db->file_name, tag, format_hash(hash), data_src, read_callback, with_crc); + + if (tag >= db->num_tags) + { + GST_ERROR("Invalid tag %u.", tag); + return CONV_ERROR_INVALID_TAG; + } + if (fozdb_has_entry(db, tag, hash)) + return CONV_OK; + + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek file to write_pos %#"PRIx64".", db->write_pos); + return CONV_ERROR_SEEK_FAILED; + } + + /* Write entry name. */ + if (!fozdb_write_entry_name(db, tag, hash)) + return CONV_ERROR_WRITE_FAILED; + + /* Write payload header first. */ + header_offset = lseek(db->file, 0, SEEK_CUR); + header.size = UINT32_MAX; /* Will be filled later. */ + header.compression = FOZDB_COMPRESSION_NONE; + header.crc = 0; /* Will be filled later. */ + header.full_size = UINT32_MAX; /* Will be filled later. */ + if (!complete_write(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + offset = lseek(db->file, 0, SEEK_CUR); + + /* Write data. */ + buffer = calloc(1, BUFFER_COPY_BYTES); + while ((ret = read_callback(data_src, buffer, BUFFER_COPY_BYTES, &read_size)) == CONV_OK) + { + if (size + read_size > UINT32_MAX) + { + GST_ERROR("Data too large. Fossilize format only supports 4 GB entries."); + free(buffer); + return CONV_ERROR; + } + + size += read_size; + if (!complete_write(db->file, buffer, read_size)) + { + GST_ERROR("Failed to write entry data."); + free(buffer); + return CONV_ERROR_WRITE_FAILED; + } + + if (with_crc) + header.crc = crc32(header.crc, buffer, read_size); + } + db->write_pos = lseek(db->file, 0, SEEK_CUR); + free(buffer); + if (ret != CONV_ERROR_DATA_END) + { + GST_ERROR("Failed to read data from data src, ret %d.", ret); + return ret; + } + + /* Seek back and fill in the size to header. */ + if (lseek(db->file, header_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek back to entry header. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + header.size = size; + header.full_size = size; + if (!complete_write(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + + /* Success. Record entry and exit. */ + entry = calloc(1, sizeof(*entry)); + entry->header = header; + entry->hash = *hash; + entry->offset = offset; + g_hash_table_insert(db->seen_blobs[tag], &entry->hash, entry); + + GST_INFO("Wrote entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", + tag, format_hash(&entry->hash), entry->offset, entry->header.size, entry->header.crc); + + return CONV_OK; +} + +/* Rewrites the database, discarding entries listed. */ +int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) +{ + uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; + uint64_t file_size; + int i, ret; + + GST_DEBUG("db %p, file_name %s, to_discard_entries %p.", db, db->file_name, to_discard_names); + + /* Rewind the file and clear the entry tables. */ + if (lseek(db->file, 0, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to file start. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + for (i = 0; i < db->num_tags; ++i) + g_hash_table_remove_all(db->seen_blobs[i]); + + /* Read file header. */ + if ((ret = fozdb_read_file_header(db)) < 0) + return ret; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + /* Read each entry and see if it should be discarded. */ + if (!get_file_size(db->file, &file_size)) + return CONV_ERROR; + while (lseek(db->file, 0, SEEK_CUR) < file_size) + { + struct payload_header header; + uint64_t entry_data_offset; + struct entry_name name; + bool truncated; + + if ((ret = fozdb_read_entry_tag_hash_header(db, &name.tag, &name.hash, &header) < 0)) + return CONV_ERROR_READ_FAILED; + entry_data_offset = lseek(db->file, 0, SEEK_CUR); + + /* Check if entry should be discarded. */ + if (g_list_find_custom(to_discard_names, &name, entry_name_compare)) + { + if (!fozdb_seek_to_next_entry(db, &header, &truncated)) + return CONV_ERROR_SEEK_FAILED; + if (truncated) + break; + } + else + { + if (db->write_pos == entry_data_offset - sizeof(entry_name_and_header)) + { + /* If we haven't dropped any chunks, we can just skip it rather than rewrite it. */ + if (!fozdb_seek_to_next_entry(db, &header, &truncated)) + return CONV_ERROR_SEEK_FAILED; + if (truncated) + break; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + } + else + { + /* We're offset, so we have to rewrite. */ + if ((ret = fozdb_copy_entry(db, &name, &header, entry_data_offset)) < 0) + return ret; + } + } + } + + if (ftruncate(db->file, db->write_pos) < 0) + { + GST_ERROR("Failed to truncate file. %s.", strerror(errno)); + return CONV_ERROR; + } + + return fozdb_prepare(db); +} diff --git a/dlls/winegstreamer/media-converter/lib.c b/dlls/winegstreamer/media-converter/lib.c new file mode 100644 index 00000000000..4f7884c1178 --- /dev/null +++ b/dlls/winegstreamer/media-converter/lib.c @@ -0,0 +1,336 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_ELEMENT_REGISTER_DECLARE(protonvideoconverter); +GST_ELEMENT_REGISTER_DECLARE(protonaudioconverter); +GST_ELEMENT_REGISTER_DECLARE(protonaudioconverterbin); +GST_ELEMENT_REGISTER_DECLARE(protondemuxer); + +GST_DEBUG_CATEGORY(media_converter_debug); + +static void get_dirname(const char *path, char *result) +{ + size_t i; + + for (i = strlen(path) - 1; i > 0; --i) + { + if (path[i] == '\\' || path[i] == '/') + break; + } + + memcpy(result, path, i); + result[i] = 0; +} + +static void path_concat(char *result, const char *a, const char *b) +{ + size_t a_len, b_offset; + + a_len = strlen(a); + b_offset = a_len; + memcpy(result, a, a_len); + + if (result[a_len - 1] != '/') + { + result[a_len] = '/'; + ++b_offset; + } + + strcpy(result + b_offset, b); +} + +static bool create_all_dir(const char *dir) +{ + char *ptr, buffer[4096] = {0}; + + strcpy(buffer, dir); + if (buffer[strlen(dir) - 1] != '/') + buffer[strlen(dir)] = '/'; + + ptr = strchr(buffer + 1, '/'); + while (ptr) + { + *ptr = '\0'; + + if (mkdir(buffer, 0777) < 0) + { + if (errno != EEXIST) + { + GST_ERROR("Failed to make directory %s. %s.", buffer, strerror(errno)); + return false; + } + } + *ptr = '/'; + + ptr = strchr(ptr + 1, '/'); + } + return true; +} + +static int create_file(const char *file_name) +{ + int fd, ret = CONV_OK; + char dir[4096]; + + get_dirname(file_name, dir); + if (access(dir, F_OK) < 0 && !create_all_dir(dir)) + return CONV_ERROR_PATH_NOT_FOUND; + + if ((fd = open(file_name, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) < 0) + { + GST_WARNING("Failed to open file %s with O_CREAT. %s.", file_name, strerror(errno)); + return CONV_ERROR_OPEN_FAILED; + } + + if (futimens(fd, NULL) < 0) + { + GST_WARNING("Failed to set file %s timestamps. %s.", file_name, strerror(errno)); + ret = CONV_ERROR; + } + + close(fd); + + return ret; +} + +bool open_file(const char *file_name, int open_flags, int *out_fd) +{ + int fd; + + if ((fd = open(file_name, open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) < 0) + { + GST_WARNING("Failed to open %s with flags %d. %s.", file_name, open_flags, strerror(errno)); + return false; + } + + *out_fd = fd; + return true; +} + +bool get_file_size(int fd, uint64_t *file_size) +{ + struct stat file_info; + + if (fstat(fd, &file_info) < 0) + { + GST_WARNING("Failed to fstat fd %d. %s.", fd, strerror(errno)); + return false; + } + + *file_size = file_info.st_size; + return true; +} + +bool complete_read(int file, void *buffer, size_t size) +{ + size_t current_read = 0; + ssize_t read_size; + errno = 0; + + while (current_read < size) + { + read_size = read(file, ((char *)buffer) + current_read, size - current_read); + if(read_size <= 0) + { + if(errno != EINTR && errno != EAGAIN) + return false; + } + else + { + current_read += read_size; + } + } + + return current_read == size; +} + +bool complete_write(int file, const void *buffer, size_t size) +{ + size_t current_write = 0; + ssize_t write_size; + errno = 0; + + while (current_write < size) + { + write_size = write(file, (const char *)buffer + current_write, size - current_write); + if(write_size < 0) + { + if(errno != EINTR && errno != EAGAIN) + return false; + } + else + { + current_write += write_size; + } + } + + return current_write == size; +} + +uint32_t crc32(uint32_t crc, const uint8_t *ptr, size_t buf_len) +{ + static const uint32_t s_crc_table[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, + 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, + 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, + 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, + 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, + 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, + 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, + 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, + 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, + 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, + 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, + 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, + 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, + 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, + 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, + 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, + 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, + 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, + 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, + 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + uint32_t crc32 = (uint32_t)crc ^ 0xffffffff; + const uint8_t *buffer = (const uint8_t *)ptr; + + while (buf_len >= 4) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[0]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[1]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[2]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[3]) & 0xff]; + buffer += 4; + buf_len -= 4; + } + + while (buf_len) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[0]) & 0xff]; + ++buffer; + --buf_len; + } + + return ~crc32; +} + +int create_placeholder_file(const char *file_name) +{ + const char *shader_path; + char path[1024]; + int ret; + + if ((shader_path = getenv("STEAM_COMPAT_SHADER_PATH"))) + { + path_concat(path, shader_path, file_name); + if ((ret = create_file(path)) < 0) + GST_ERROR("Failed to create %s file, ret %d.", file_name, ret); + } + else + { + GST_ERROR("Env STEAM_COMPAT_SHADER_PATH not set."); + ret = CONV_ERROR_ENV_NOT_SET; + } + + return ret; +} + +int dump_fozdb_open(struct dump_fozdb *db, bool create, const char *file_path_env, int num_tags) +{ + char *dump_file_path; + + if (db->fozdb) + return CONV_OK; + + if (!(dump_file_path = getenv(file_path_env))) + { + GST_ERROR("Env %s not set.", file_path_env); + return CONV_ERROR_ENV_NOT_SET; + } + + if (create) + create_file(dump_file_path); + + return fozdb_create(dump_file_path, O_RDWR, false, num_tags, &db->fozdb); +} + +void dump_fozdb_close(struct dump_fozdb *db) +{ + if (db->fozdb) + { + fozdb_release(db->fozdb); + db->fozdb = NULL; + } +} + +bool media_converter_init(void) +{ + GST_DEBUG_CATEGORY_INIT(media_converter_debug, + "protonmediaconverter", GST_DEBUG_FG_YELLOW, "Proton media converter"); + + if (!GST_ELEMENT_REGISTER(protonvideoconverter, NULL)) + { + GST_ERROR("Failed to register protonvideoconverter."); + return false; + } + + if (!GST_ELEMENT_REGISTER(protonaudioconverter, NULL)) + { + GST_ERROR("Failed to register protonaudioconverter."); + return false; + } + + if (!GST_ELEMENT_REGISTER(protonaudioconverterbin, NULL)) + { + GST_ERROR("Failed to register protonaudioconverterbin."); + return false; + } + + if (!GST_ELEMENT_REGISTER(protondemuxer, NULL)) + { + GST_ERROR("Failed to register protondemuxer."); + return false; + } + + return true; +} diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h new file mode 100644 index 00000000000..51b54147806 --- /dev/null +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -0,0 +1,287 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __MEDIA_CONVERTER_H__ +#define __MEDIA_CONVERTER_H__ + +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include + +#include "unix_private.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef int (*data_read_callback)(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size); + +/* Changing this will invalidate the cache. You MUST clear it. */ +#define HASH_SEED 0x4AA61F63 + +enum conv_ret +{ + CONV_OK = 0, + CONV_ERROR = -1, + CONV_ERROR_NOT_IMPLEMENTED = -2, + CONV_ERROR_INVALID_ARGUMENT = -3, + CONV_ERROR_OPEN_FAILED = -4, + CONV_ERROR_READ_FAILED = -5, + CONV_ERROR_WRITE_FAILED = -6, + CONV_ERROR_SEEK_FAILED = -7, + CONV_ERROR_CORRUPT_DATABASE = -8, + CONV_ERROR_WRONG_CHECKSUM = -9, + CONV_ERROR_ENTRY_NOT_FOUND = -10, + CONV_ERROR_ENV_NOT_SET = -11, + CONV_ERROR_PATH_NOT_FOUND = -12, + CONV_ERROR_INVALID_TAG = -13, + CONV_ERROR_DATA_END = -14, +}; + +struct murmur3_x64_128_state +{ + uint32_t seed; + uint64_t h1; + uint64_t h2; + size_t processed; +}; + +struct murmur3_x86_128_state +{ + uint32_t seed; + uint32_t h1; + uint32_t h2; + uint32_t h3; + uint32_t h4; + size_t processed; +}; + +struct bytes_reader +{ + const uint8_t *data; + size_t size; + size_t offset; +}; + +struct gst_buffer_reader +{ + GstBuffer *buffer; /* No ref here, no need to unref. */ + size_t offset; +}; + +struct payload_hash +{ + uint32_t hash[4]; +}; + +struct entry_name +{ + uint32_t tag; + struct payload_hash hash; +}; + +struct dump_fozdb +{ + pthread_mutex_t mutex; + struct fozdb *fozdb; + bool already_cleaned; +}; + +struct fozdb +{ + const char *file_name; + int file; + bool read_only; + uint64_t write_pos; + GHashTable **seen_blobs; + uint32_t num_tags; +}; + +/* lib.c. */ +extern bool open_file(const char *file_name, int open_flags, int *out_fd); +extern bool get_file_size(int fd, uint64_t *file_size); +extern bool complete_read(int file, void *buffer, size_t size); +extern bool complete_write(int file, const void *buffer, size_t size); +extern uint32_t crc32(uint32_t crc, const uint8_t *ptr, size_t buf_len); +extern int create_placeholder_file(const char *file_name); +extern int dump_fozdb_open(struct dump_fozdb *db, bool create, const char *file_path_env, int num_tags); +extern void dump_fozdb_close(struct dump_fozdb *db); + +/* murmur3.c. */ +extern void murmur3_x64_128_state_init(struct murmur3_x64_128_state *state, uint32_t seed); +extern void murmur3_x64_128_state_reset(struct murmur3_x64_128_state *state); +extern bool murmur3_x64_128_full(void *data_src, data_read_callback read_callback, + struct murmur3_x64_128_state* state, void *out); +extern bool murmur3_x64_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out); +extern void murmur3_x86_128_state_init(struct murmur3_x86_128_state *state, uint32_t seed); +extern void murmur3_x86_128_state_reset(struct murmur3_x86_128_state *state); +extern bool murmur3_x86_128_full(void *data_src, data_read_callback read_callback, + struct murmur3_x86_128_state* state, void *out); +extern bool murmur3_x86_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out); +#ifdef __x86_64__ +#define murmur3_128_state murmur3_x64_128_state +#define murmur3_128_state_init murmur3_x64_128_state_init +#define murmur3_128_state_reset murmur3_x64_128_state_reset +#define murmur3_128_full murmur3_x64_128_full +#define murmur3_128 murmur3_x64_128 +#elif defined(__i386__) +#define murmur3_128_state murmur3_x86_128_state +#define murmur3_128_state_init murmur3_x86_128_state_init +#define murmur3_128_state_reset murmur3_x86_128_state_reset +#define murmur3_128_full murmur3_x86_128_full +#define murmur3_128 murmur3_x86_128 +#endif /* __x86_64__ */ + +/* fossilize.c. */ +extern int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out); +extern void fozdb_release(struct fozdb *db); +extern int fozdb_prepare(struct fozdb *db); +extern bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash); +extern int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size); +extern void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter); +extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc); +extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + void *data_src, data_read_callback read_callback, bool with_crc); +extern int fozdb_discard_entries(struct fozdb *db, GList *to_discard_entries); + +static inline bool option_enabled(const char *env) +{ + const char *env_var; + + if (!(env_var = getenv(env))) + return false; + + return strcmp(env_var, "0") != 0; +} + +static inline bool discarding_disabled(void) +{ + return option_enabled("MEDIACONV_DONT_DISCARD"); +} + +static inline const char *format_hash(struct payload_hash *hash) +{ + int hash_str_size = 2 + sizeof(*hash) * 2 + 1; + static char buffer[1024] = {}; + static int offset = 0; + char *ret; + + if (offset + hash_str_size > sizeof(buffer)) + offset = 0; + + ret = buffer + offset; + sprintf(ret, "0x%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0]); + offset += hash_str_size; + + return ret; +} + +static inline void bytes_reader_init(struct bytes_reader *reader, const uint8_t *data, size_t size) +{ + reader->data = data; + reader->size = size; + reader->offset = 0; +} + +static inline int bytes_reader_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct bytes_reader *reader = data_reader; + size_t data_size, to_copy; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (!(data_size = reader->size - reader->offset)) + return CONV_ERROR_DATA_END; + + to_copy = min(data_size, size); + memcpy(buffer, reader->data + reader->offset, to_copy); + reader->offset += to_copy; + + *read_size = to_copy; + return CONV_OK; +} + +static inline void gst_buffer_reader_init(struct gst_buffer_reader *reader, GstBuffer *buffer) +{ + reader->buffer = buffer; /* No ref here, so no need to unref. */ + reader->offset = 0; +} + +static inline int gst_buffer_reader_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct gst_buffer_reader *reader = data_reader; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + *read_size = gst_buffer_extract(reader->buffer, reader->offset, buffer, size); + reader->offset += *read_size; + if (!*read_size) + return CONV_ERROR_DATA_END; + + return CONV_OK; +} + +static inline bool file_exists(const char *file_path) +{ + if (!file_path) + return false; + return access(file_path, F_OK) == 0; +} + +static inline struct entry_name *entry_name_create(uint32_t tag, struct payload_hash *hash) +{ + struct entry_name *entry = calloc(1, sizeof(*entry)); + entry->tag = tag; + entry->hash = *hash; + return entry; +} + +static inline gint entry_name_compare(const void *a, const void *b) +{ + return memcmp(a, b, sizeof(struct entry_name)); +} + +static inline uint32_t bytes_to_uint32(const uint8_t *bytes) +{ + return ((uint32_t)bytes[0] << 0) + | ((uint32_t)bytes[1] << 8) + | ((uint32_t)bytes[2] << 16) + | ((uint32_t)bytes[3] << 24); +} + +static inline void payload_hash_from_bytes(struct payload_hash *hash, uint8_t *bytes) +{ + hash->hash[0] = bytes_to_uint32(bytes + 0); + hash->hash[1] = bytes_to_uint32(bytes + 4); + hash->hash[2] = bytes_to_uint32(bytes + 8); + hash->hash[3] = bytes_to_uint32(bytes + 12); +} + +#endif /* __MEDIA_CONVERTER_H__ */ diff --git a/dlls/winegstreamer/media-converter/murmur3.c b/dlls/winegstreamer/media-converter/murmur3.c new file mode 100644 index 00000000000..014345e61d5 --- /dev/null +++ b/dlls/winegstreamer/media-converter/murmur3.c @@ -0,0 +1,371 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +static uint64_t rotl64(uint64_t value, uint8_t shift) +{ + return (value << shift) | (value >> (64 - shift)); +} + +static uint32_t rotl32(uint32_t value, uint8_t shift) +{ + return (value << shift) | (value >> (32 - shift)); +} + +static uint64_t fmix64(uint64_t h) +{ + const uint64_t c1 = 0xff51afd7ed558ccd; + const uint64_t c2 = 0xc4ceb9fe1a85ec53; + const uint32_t r = 33; + + h ^= h >> r; + h *= c1; + h ^= h >> r; + h *= c2; + h ^= h >> r; + + return h; +} + +static uint32_t fmix32 (uint32_t h) +{ + const uint32_t c1 = 0x85ebca6b; + const uint32_t c2 = 0xc2b2ae35; + const uint32_t r1 = 16; + const uint32_t r2 = 13; + + h ^= h >> r1; + h *= c1; + h ^= h >> r2; + h *= c2; + h ^= h >> r1; + + return h; +} + +void murmur3_x64_128_state_init(struct murmur3_x64_128_state *state, uint32_t seed) +{ + state->seed = seed; + state->h1 = seed; + state->h2 = seed; + state->processed = 0; +} + +void murmur3_x64_128_state_reset(struct murmur3_x64_128_state *state) +{ + state->h1 = state->seed; + state->h2 = state->seed; + state->processed = 0; +} + +bool murmur3_x64_128_full(void *data_reader, data_read_callback read_callback, + struct murmur3_x64_128_state* state, void *out) +{ + const uint64_t c1 = 0x87c37b91114253d5, c2 = 0x4cf5ad432745937f, c3 = 0x52dce729, c4 = 0x38495ab5, m = 5; + size_t read_size, processed = state->processed; + const uint32_t r1 = 27, r2 = 31, r3 = 33; + uint64_t h1 = state->h1, h2 = state->h2; + uint8_t buffer[16] = {0}; + uint64_t k1, k2; + int ret; + + while ((ret = read_callback(data_reader, buffer, sizeof(buffer), &read_size)) == CONV_OK) + { + processed += read_size; + + if (read_size == 16) + { + k1 = *(uint64_t *)&buffer[0]; + k2 = *(uint64_t *)&buffer[8]; + + k1 *= c1; + k1 = rotl64(k1, r2); + k1 *= c2; + h1 ^= k1; + h1 = rotl64(h1, r1); + h1 += h2; + h1 = h1 * m + c3; + + k2 *= c2; + k2 = rotl64(k2, r3); + k2 *= c1; + h2 ^= k2; + h2 = rotl64(h2, r2); + h2 += h1; + h2 = h2 * m + c4; + } + else + { + k1 = 0; + k2 = 0; + + switch (read_size) + { + case 15: + k2 ^= ((uint64_t)buffer[14]) << 48; + case 14: + k2 ^= ((uint64_t)buffer[13]) << 40; + case 13: + k2 ^= ((uint64_t)buffer[12]) << 32; + case 12: + k2 ^= ((uint64_t)buffer[11]) << 24; + case 11: + k2 ^= ((uint64_t)buffer[10]) << 16; + case 10: + k2 ^= ((uint64_t)buffer[9]) << 8; + case 9: + k2 ^= ((uint64_t)buffer[8]) << 0; + k2 *= c2; + k2 = rotl64(k2, r3); + k2 *= c1; + h2 ^= k2; + case 8: + k1 ^= ((uint64_t)buffer[7]) << 56; + case 7: + k1 ^= ((uint64_t)buffer[6]) << 48; + case 6: + k1 ^= ((uint64_t)buffer[5]) << 40; + case 5: + k1 ^= ((uint64_t)buffer[4]) << 32; + case 4: + k1 ^= ((uint64_t)buffer[3]) << 24; + case 3: + k1 ^= ((uint64_t)buffer[2]) << 16; + case 2: + k1 ^= ((uint64_t)buffer[1]) << 8; + case 1: + k1 ^= ((uint64_t)buffer[0]) << 0; + k1 *= c1; + k1 = rotl64(k1, r2); + k1 *= c2; + h1 ^= k1; + } + } + } + + if (ret != CONV_ERROR_DATA_END) + return false; + + state->processed = processed; + state->h1 = h1; + state->h2 = h2; + + h1 ^= (uint64_t)processed; + h2 ^= (uint64_t)processed; + h1 += h2; + h2 += h1; + h1 = fmix64(h1); + h2 = fmix64(h2); + h1 += h2; + h2 += h1; + + ((uint64_t *)out)[0] = h1; + ((uint64_t *)out)[1] = h2; + + return true; +} + +bool murmur3_x64_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out) +{ + struct murmur3_x64_128_state state; + murmur3_x64_128_state_init(&state, seed); + return murmur3_x64_128_full(data_src, read_callback, &state, out); +} + +void murmur3_x86_128_state_init(struct murmur3_x86_128_state *state, uint32_t seed) +{ + state->seed = seed; + state->h1 = seed; + state->h2 = seed; + state->h3 = seed; + state->h4 = seed; + state->processed = 0; +} + +void murmur3_x86_128_state_reset(struct murmur3_x86_128_state *state) +{ + state->h1 = state->seed; + state->h2 = state->seed; + state->h3 = state->seed; + state->h4 = state->seed; + state->processed = 0; +} + +bool murmur3_x86_128_full(void *data_reader, data_read_callback read_callback, + struct murmur3_x86_128_state *state, void *out) +{ + const uint32_t c1 = 0x239b961b, c2 = 0xab0e9789, c3 = 0x38b34ae5, c4 = 0xa1e38b93; + const uint32_t c5 = 0x561ccd1b, c6 = 0x0bcaa747, c7 = 0x96cd1c35, c8 = 0x32ac3b17; + uint32_t h1 = state->h1, h2 = state->h2, h3 = state->h3, h4 = state->h4; + size_t read_size, processed = state->processed; + unsigned char buffer[16] = {0}; + uint64_t k1, k2, k3, k4; + const uint32_t m = 5; + int ret; + + while ((ret = read_callback(data_reader, buffer, sizeof(buffer), &read_size)) == CONV_OK) + { + processed += read_size; + + if (read_size == 16) + { + k1 = *(uint32_t*)&buffer[0]; + k2 = *(uint32_t*)&buffer[4]; + k3 = *(uint32_t*)&buffer[8]; + k4 = *(uint32_t*)&buffer[12]; + + k1 *= c1; + k1 = rotl32(k1, 15); + k1 *= c2; + h1 ^= k1; + h1 = rotl32(h1, 19); + h1 += h2; + h1 = h1 * m + c5; + + k2 *= c2; + k2 = rotl32(k2, 16); + k2 *= c3; + h2 ^= k2; + h2 = rotl32(h2, 17); + h2 += h3; + h2 = h2 * m + c6; + + k3 *= c3; + k3 = rotl32(k3, 17); + k3 *= c4; + h3 ^= k3; + h3 = rotl32(h3, 15); + h3 += h4; + h3 = h3 * m + c7; + + k4 *= c4; + k4 = rotl32(k4, 18); + k4 *= c1; + h4 ^= k4; + h4 = rotl32(h4, 13); + h4 += h1; + h4 = h4 * m + c8; + } + else + { + k1 = 0; + k2 = 0; + k3 = 0; + k4 = 0; + + switch (read_size) + { + case 15: + k4 ^= buffer[14] << 16; + case 14: + k4 ^= buffer[13] << 8; + case 13: + k4 ^= buffer[12] << 0; + k4 *= c4; + k4 = rotl32(k4,18); + k4 *= c1; + h4 ^= k4; + case 12: + k3 ^= buffer[11] << 24; + case 11: + k3 ^= buffer[10] << 16; + case 10: + k3 ^= buffer[9] << 8; + case 9: + k3 ^= buffer[8] << 0; + k3 *= c3; + k3 = rotl32(k3, 17); + k3 *= c4; + h3 ^= k3; + case 8: + k2 ^= buffer[7] << 24; + case 7: + k2 ^= buffer[6] << 16; + case 6: + k2 ^= buffer[5] << 8; + case 5: + k2 ^= buffer[4] << 0; + k2 *= c2; + k2 = rotl32(k2, 16); + k2 *= c3; + h2 ^= k2; + case 4: + k1 ^= buffer[3] << 24; + case 3: + k1 ^= buffer[2] << 16; + case 2: + k1 ^= buffer[1] << 8; + case 1: + k1 ^= buffer[0] << 0; + k1 *= c1; + k1 = rotl32(k1, 15); + k1 *= c2; + h1 ^= k1; + } + } + } + + if (ret != CONV_ERROR_DATA_END) + return false; + + state->processed = processed; + state->h1 = h1; + state->h2 = h2; + state->h3 = h3; + state->h4 = h4; + + h1 ^= processed; + h2 ^= processed; + h3 ^= processed; + h4 ^= processed; + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + h1 = fmix32(h1); + h2 = fmix32(h2); + h3 = fmix32(h3); + h4 = fmix32(h4); + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + + ((uint32_t*)out)[0] = h1; + ((uint32_t*)out)[1] = h2; + ((uint32_t*)out)[2] = h3; + ((uint32_t*)out)[3] = h4; + + return true; +} + +bool murmur3_x86_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out) +{ + struct murmur3_x86_128_state state; + murmur3_x86_128_state_init(&state, seed); + return murmur3_x86_128_full(data_src, read_callback, &state, out); +} diff --git a/dlls/winegstreamer/media-converter/protondemuxer.c b/dlls/winegstreamer/media-converter/protondemuxer.c new file mode 100644 index 00000000000..124d105ca46 --- /dev/null +++ b/dlls/winegstreamer/media-converter/protondemuxer.c @@ -0,0 +1,250 @@ +/* + * Copyright 2024 Remi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef struct +{ + GstBin bin; + GstElement *video_conv, *demuxer; + GstPad *sink_pad; /* Ghost pad. */ + GstPad *inner_sink, *inner_src; +} ProtonDemuxer; + +typedef struct +{ + GstBinClass class; +} ProtonDemuxerClass; + +G_DEFINE_TYPE(ProtonDemuxer, proton_demuxer, GST_TYPE_BIN); +#define PROTON_DEMUXER_TYPE (proton_demuxer_get_type()) +#define PROTON_DEMUXER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PROTON_DEMUXER_TYPE, ProtonDemuxer)) +GST_ELEMENT_REGISTER_DEFINE(protondemuxer, "protondemuxer", GST_RANK_MARGINAL, PROTON_DEMUXER_TYPE); + +static GstStaticPadTemplate proton_demuxer_sink_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, + GST_PAD_ALWAYS, GST_STATIC_CAPS("video/x-ms-asf; video/x-msvideo; video/mpeg; video/quicktime;")); +static GstStaticPadTemplate proton_demuxer_src_template = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, + GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + +static gboolean proton_demuxer_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + return gst_pad_event_default(pad, parent, event); +} + +static void proton_demuxer_pad_added(GstElement *element, GstPad *pad, gpointer user) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(user); + GstPad *ghost_src, *src_pad; + GstElement *decoder = NULL; + GstEvent *event; + GstCaps *caps; + + GST_DEBUG_OBJECT(element, "Got inner pad added %"GST_PTR_FORMAT".", pad); + + if ((caps = gst_pad_get_current_caps(pad))) + { + const char *mime_type = gst_structure_get_name(gst_caps_get_structure(caps, 0)); + GST_DEBUG_OBJECT(element, "Got inner pad caps %"GST_PTR_FORMAT".", caps); + + if (!strcmp(mime_type, "audio/x-vorbis")) + decoder = create_element("vorbisdec", "base"); + else if (!strcmp(mime_type, "audio/x-opus")) + decoder = create_element("opusdec", "base"); + + gst_caps_unref(caps); + } + + if (!decoder) + ghost_src = gst_ghost_pad_new(GST_PAD_NAME(pad), pad); + else + { + gst_bin_add(GST_BIN(bin), decoder); + link_src_to_element(pad, decoder); + + src_pad = gst_element_get_static_pad(decoder, "src"); + ghost_src = gst_ghost_pad_new(GST_PAD_NAME(src_pad), src_pad); + gst_object_unref(src_pad); + + gst_element_sync_state_with_parent(decoder); + } + + if ((event = gst_pad_get_sticky_event(pad, GST_EVENT_STREAM_START, 0))) + { + gst_pad_store_sticky_event(ghost_src, event); + gst_event_unref(event); + } + + gst_pad_set_active(ghost_src, true); + gst_element_add_pad(GST_ELEMENT(&bin->bin), ghost_src); +} + +static void proton_demuxer_no_more_pads(GstElement *element, gpointer user) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(user); + GST_DEBUG_OBJECT(element, "Got inner no-more-pads."); + gst_element_no_more_pads(GST_ELEMENT(&bin->bin)); +} + +static GstFlowReturn proton_demuxer_inner_sink_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + GST_DEBUG_OBJECT(pad, "Got inner sink buffer %"GST_PTR_FORMAT".", buffer); + return gst_pad_push(bin->inner_src, buffer); +} + +static gboolean proton_demuxer_inner_sink_event_caps(ProtonDemuxer *bin, GstEvent *event) +{ + GstCaps *src_caps, *any_caps; + GstEvent *stream_start; + GstPad *src; + + gst_event_parse_caps(event, &src_caps); + + if (!bin->demuxer) + { + if (!(any_caps = gst_caps_new_any())) + return false; + if (!(bin->demuxer = find_element(GST_ELEMENT_FACTORY_TYPE_DECODABLE, src_caps, any_caps))) + { + gst_caps_unref(any_caps); + return false; + } + gst_caps_unref(any_caps); + g_signal_connect(bin->demuxer, "pad-added", G_CALLBACK(proton_demuxer_pad_added), bin); + g_signal_connect(bin->demuxer, "no-more-pads", G_CALLBACK(proton_demuxer_no_more_pads), bin); + + if ((src = gst_element_get_static_pad(bin->demuxer, "src"))) + { + GstPad *ghost_src = gst_ghost_pad_new_no_target_from_template(GST_PAD_NAME(src), + gst_element_get_pad_template(GST_ELEMENT(&bin->bin), "src")); + gst_ghost_pad_set_target(GST_GHOST_PAD(ghost_src), src); + gst_element_add_pad(GST_ELEMENT(&bin->bin), ghost_src); + gst_object_unref(src); + + gst_element_no_more_pads(GST_ELEMENT(&bin->bin)); + } + + gst_bin_add(GST_BIN(bin), bin->demuxer); + link_src_to_element(bin->inner_src, bin->demuxer); + gst_pad_set_active(bin->inner_src, true); + + if ((stream_start = gst_pad_get_sticky_event(bin->inner_sink, GST_EVENT_STREAM_START, 0))) + push_event(bin->inner_src, stream_start); + + gst_element_sync_state_with_parent(bin->demuxer); + } + + return gst_pad_push_event(bin->inner_src, event); +} + +static gboolean proton_demuxer_inner_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + + GST_DEBUG_OBJECT(pad, "Got inner sink event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_CAPS) + return proton_demuxer_inner_sink_event_caps(bin, event); + if (!bin->demuxer) + return gst_pad_event_default(pad, parent, event); + if (event->type == GST_EVENT_STREAM_START) + { + GstEvent *stream_start; + if ((stream_start = gst_pad_get_sticky_event(bin->inner_src, GST_EVENT_STREAM_START, 0))) + push_event(bin->inner_src, stream_start); + return gst_pad_event_default(pad, parent, event); + } + + return gst_pad_push_event(bin->inner_src, event); +} + +static gboolean proton_demuxer_inner_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + + GST_DEBUG_OBJECT(pad, "Got inner src query %"GST_PTR_FORMAT".", query); + + if (!bin->demuxer) + return gst_pad_query_default(pad, parent, query); + return gst_pad_peer_query(bin->inner_sink, query); +} + +static gboolean proton_demuxer_inner_src_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + GST_DEBUG_OBJECT(pad, "Got inner src event %"GST_PTR_FORMAT".", event); + return gst_pad_push_event(bin->inner_sink, event); +} + +static void proton_demuxer_class_init(ProtonDemuxerClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + + /* wg_parser autoplugging ordering relies on the element "Proton video converter" name */ + gst_element_class_set_metadata(element_class, "Proton video converter", "Codec/Demuxer", "Demuxes video for Proton", + "Andrew Eikum , Ziqing Hui "); + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&proton_demuxer_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&proton_demuxer_src_template)); +} + +static void proton_demuxer_init(ProtonDemuxer *bin) +{ + GstStaticPadTemplate inner_sink_template = GST_STATIC_PAD_TEMPLATE("inner-sink", + GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + GstStaticPadTemplate inner_src_template = GST_STATIC_PAD_TEMPLATE("inner-src", + GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + GstElement *element = GST_ELEMENT(bin); + GstPad *sink; + + bin->sink_pad = gst_ghost_pad_new_no_target_from_template("sink", gst_element_get_pad_template(element, "sink")); + gst_pad_set_event_function(bin->sink_pad, GST_DEBUG_FUNCPTR(proton_demuxer_sink_event)); + + bin->inner_sink = gst_pad_new_from_static_template(&inner_sink_template, "inner-sink"); + gst_pad_set_chain_function(bin->inner_sink, GST_DEBUG_FUNCPTR(proton_demuxer_inner_sink_chain)); + gst_pad_set_event_function(bin->inner_sink, GST_DEBUG_FUNCPTR(proton_demuxer_inner_sink_event)); + gst_pad_set_element_private(bin->inner_sink, bin); + + bin->inner_src = gst_pad_new_from_static_template(&inner_src_template, "inner-src"); + gst_pad_set_query_function(bin->inner_src, GST_DEBUG_FUNCPTR(proton_demuxer_inner_src_query)); + gst_pad_set_event_function(bin->inner_src, GST_DEBUG_FUNCPTR(proton_demuxer_inner_src_event)); + gst_pad_set_element_private(bin->inner_src, bin); + + bin->video_conv = create_element("protonvideoconverter", "protonmediaconverter"); + gst_bin_add(GST_BIN(bin), bin->video_conv); + link_element_to_sink(bin->video_conv, bin->inner_sink); + gst_pad_set_active(bin->inner_sink, true); + + sink = gst_element_get_static_pad(bin->video_conv, "sink"); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->sink_pad), sink); + gst_object_unref(sink); + + gst_element_add_pad(element, bin->sink_pad); + + GST_INFO("Initialized ProtonDemuxer %"GST_PTR_FORMAT": video_conv %"GST_PTR_FORMAT", demuxer %"GST_PTR_FORMAT", " + "sink_pad %"GST_PTR_FORMAT".", bin, bin->video_conv, bin->demuxer, bin->sink_pad); +} diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c new file mode 100644 index 00000000000..0f916b86f66 --- /dev/null +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -0,0 +1,1245 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Algorithm + * --------- + * + * Nicely, both Quartz and Media Foundation allow us random access to the entire data stream. So we + * can easily hash the entire incoming stream and substitute it with our Ogg Theora video. If there + * is a cache miss, then we dump the entire incoming stream. In case of a cache hit, we dump + * nothing. + * + * Incoming video data is stored in the video.foz Fossilize database. + * + * Transcoded video data is stored in the transcoded_video.foz Fossilize database. + * + * + * Hashing algorithm + * ----------------- + * + * We use murmur3 hash with the seed given below. We use the x32 variant for 32-bit programs, and + * the x64 variant for 64-bit programs. + * + * For speed when hashing, we specify a stride which will skip over chunks of the input. However, + * we will always hash the first "stride" number of bytes, to try to avoid collisions on smaller + * files with size between chunk and stride. + * + * For example, the 'H's below are hashed, the 'x's are skipped: + * + * int chunk = 4; + * int stride = chunk * 3; + * H = hashed, x = skipped + * [HHHH HHHH HHHH HHHH xxxx xxxx HHHH xxxx xxxx HHHH xxxx] < data stream + * ^^^^ ^^^^ ^^^^ stride prefix, hashed + * ^^^^ chunk + * ^^^^ ^^^^ ^^^^ stride + * ^^^^ chunk + * ^^^^ ^^^^ ^^^^ stride + * ^^^^ chunk + * ^^^^ ^^^^ stride + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" +#include + +#include + +#define HASH_CHUNK_SIZE (8 * 1024 * 1024) /* 8 MB. */ +#define HASH_STRIDE (HASH_CHUNK_SIZE * 6) + +#define VIDEO_CONV_FOZ_TAG_VIDEODATA 0 +#define VIDEO_CONV_FOZ_TAG_OGVDATA 1 +#define VIDEO_CONV_FOZ_TAG_STREAM 2 +#define VIDEO_CONV_FOZ_TAG_MKVDATA 3 +#define VIDEO_CONV_FOZ_NUM_TAGS 4 + +#define DURATION_NONE (UINT64_MAX) + +struct pad_reader +{ + GstPad *pad; + size_t offset; + uint8_t *chunk; + size_t chunk_offset; + size_t chunk_end; + size_t stride; /* Set to SIZE_MAX to skip no bytes. */ +}; + +struct hashes_reader +{ + GList *current_hash; +}; + +enum video_conv_state_flags +{ + VIDEO_CONV_STREAM_STARTED = 1, + VIDEO_CONV_HAS_TRANSCODED = 2, + VIDEO_CONV_IS_DUMPING = 4, +}; + +struct video_conv_state +{ + struct payload_hash transcode_hash; + struct fozdb *read_fozdb; + int blank_file; + uint64_t upstream_duration; + uint64_t our_duration; + uint32_t transcoded_tag; + uint32_t state_flags; + uint64_t read_offset; + GList *chunk_hashes; +}; + +typedef struct +{ + GstElement element; + GstPad *sink_pad, *src_pad; + pthread_mutex_t state_mutex; + struct video_conv_state *state; + GstPadMode active_mode; + GstAdapter *adapter; +} VideoConv; + +typedef struct +{ + GstElementClass class; +} VideoConvClass; + +G_DEFINE_TYPE(VideoConv, video_conv, GST_TYPE_ELEMENT); +#define VIDEO_CONV_TYPE (video_conv_get_type()) +#define VIDEO_CONV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIDEO_CONV_TYPE, VideoConv)) +#define parent_class (video_conv_parent_class) +GST_ELEMENT_REGISTER_DEFINE(protonvideoconverter, "protonvideoconverter", + GST_RANK_MARGINAL + 1, VIDEO_CONV_TYPE); + +static GstStaticPadTemplate video_conv_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("video/x-ms-asf; video/x-msvideo; video/mpeg; video/quicktime;")); + +static GstStaticPadTemplate video_conv_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("video/x-matroska; application/ogg;")); + +static struct dump_fozdb dump_fozdb = {PTHREAD_MUTEX_INITIALIZER, NULL, false}; + +void hashes_reader_init(struct hashes_reader *reader, GList *hashes) +{ + reader->current_hash = hashes; +} + +static int hashes_reader_read(void *reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct payload_hash *hash = (struct payload_hash *)buffer; + struct hashes_reader *hashes_reader = reader; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (!hashes_reader->current_hash) + return CONV_ERROR_DATA_END; + + *hash = *(struct payload_hash *)(hashes_reader->current_hash->data); + hashes_reader->current_hash = hashes_reader->current_hash->next; + + *read_size = sizeof(*hash); + return CONV_OK; +} + +static int dump_fozdb_open_video(bool create) +{ + return dump_fozdb_open(&dump_fozdb, create, "MEDIACONV_VIDEO_DUMP_FILE", VIDEO_CONV_FOZ_NUM_TAGS); +} + +static void dump_fozdb_discard_transcoded(void) +{ + GList *to_discard_chunks = NULL; + struct payload_hash *stream_id; + struct fozdb *read_fozdb; + char *read_fozdb_path; + GHashTableIter iter; + int ret; + + if (dump_fozdb.already_cleaned) + return; + dump_fozdb.already_cleaned = true; + + if (discarding_disabled()) + return; + if (!file_exists(getenv("MEDIACONV_VIDEO_DUMP_FILE"))) + return; + + if (dump_fozdb_open_video(false) < 0) + return; + + if (!(read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_VIDEO_TRANSCODED_FILE not set."); + return; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, VIDEO_CONV_FOZ_NUM_TAGS, &read_fozdb)) < 0) + { + GST_ERROR("Failed to create read fozdb, ret %d.", ret); + return; + } + + fozdb_iter_tag(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &iter); + while (g_hash_table_iter_next(&iter, (void **)&stream_id, NULL)) + { + struct payload_hash chunk_id; + uint32_t chunks_size, i; + size_t read_size; + + if (fozdb_has_entry(read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, stream_id)) + { + if (fozdb_entry_size(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + { + uint8_t *buffer = calloc(1, chunks_size); + if (fozdb_read_entry_data(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, + 0, buffer, chunks_size, &read_size, true) == CONV_OK) + { + for (i = 0; i < read_size / sizeof(chunk_id); ++i) + { + payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + to_discard_chunks = g_list_append(to_discard_chunks, + entry_name_create(VIDEO_CONV_FOZ_TAG_VIDEODATA, &chunk_id)); + } + } + free(buffer); + } + + to_discard_chunks = g_list_append(to_discard_chunks, + entry_name_create(VIDEO_CONV_FOZ_TAG_STREAM, stream_id)); + } + } + + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, to_discard_chunks)) < 0) + { + GST_ERROR("Failed to discard entries, ret %d.", ret); + dump_fozdb_close(&dump_fozdb); + } + + g_list_free_full(to_discard_chunks, free); +} + +struct pad_reader *pad_reader_create_with_stride(GstPad *pad, size_t stride) +{ + struct pad_reader *pad_reader; + + pad_reader = calloc(1, sizeof(*pad_reader)); + pad_reader->chunk = calloc(HASH_CHUNK_SIZE, sizeof(*pad_reader->chunk)); + pad_reader->stride = stride; + gst_object_ref((pad_reader->pad = pad)); + + return pad_reader; +} + +struct pad_reader *pad_reader_create(GstPad *pad) +{ + return pad_reader_create_with_stride(pad, SIZE_MAX); +} + +void pad_reader_release(struct pad_reader *reader) +{ + gst_object_unref(reader->pad); + free(reader->chunk); + free(reader); +} + +int pad_reader_read(void *data_src, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct pad_reader *reader = data_src; + GstBuffer *gst_buffer = NULL; + GstFlowReturn gst_ret; + size_t to_copy; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (reader->chunk_offset >= reader->chunk_end) + { + reader->chunk_offset = 0; + reader->chunk_end = 0; + + if ((gst_ret = gst_pad_pull_range(reader->pad, + reader->offset, HASH_CHUNK_SIZE, &gst_buffer)) == GST_FLOW_OK) + { + gsize buffer_size = gst_buffer_get_size(gst_buffer); + + if (reader->offset + buffer_size < reader->stride) + { + to_copy = buffer_size; + reader->offset += to_copy; + } + else if (reader->offset < reader->stride) + { + to_copy = reader->stride - reader->offset; + reader->offset = reader->stride; + } + else + { + to_copy = buffer_size; + reader->offset += reader->stride; + } + + if (size >= to_copy) /* Copy directly into out buffer and return. */ + { + *read_size = gst_buffer_extract(gst_buffer, 0, buffer, to_copy); + gst_buffer_unref(gst_buffer); + return CONV_OK; + } + else + { + reader->chunk_end = gst_buffer_extract(gst_buffer, 0, reader->chunk, to_copy); + gst_buffer_unref(gst_buffer); + } + } + else if (gst_ret == GST_FLOW_EOS) + { + return CONV_ERROR_DATA_END; + } + else + { + GST_WARNING("Failed to pull data from %"GST_PTR_FORMAT", reason %s.", + reader->pad, gst_flow_get_name(gst_ret)); + return CONV_ERROR; + } + } + + /* Copy chunk data to output buffer. */ + to_copy = min(reader->chunk_end - reader->chunk_offset, size); + memcpy(buffer, reader->chunk + reader->chunk_offset, to_copy); + reader->chunk_offset += to_copy; + + *read_size = to_copy; + return CONV_OK; +} + +static int video_conv_state_create(struct video_conv_state **out) +{ + struct video_conv_state *state; + struct fozdb *fozdb = NULL; + char *read_fozdb_path, *blank_video; + uint64_t blank_file_size; + int ret, fd; + + if (!(read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) + { + GST_ERROR("MEDIACONV_VIDEO_TRANSCODED_FILE is not set."); + return CONV_ERROR_ENV_NOT_SET; + } + if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); + return CONV_ERROR_ENV_NOT_SET; + } + + if (!open_file(blank_video, O_RDONLY, &fd)) + return CONV_ERROR_OPEN_FAILED; + if (!get_file_size(fd, &blank_file_size)) + { + close(fd); + return CONV_ERROR_OPEN_FAILED; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, VIDEO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create read fozdb from %s, ret %d.", read_fozdb_path, ret); + + state = calloc(1, sizeof(*state)); + state->read_fozdb = fozdb; + state->blank_file = fd; + state->upstream_duration = DURATION_NONE; + state->our_duration = blank_file_size; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; + + *out = state; + return CONV_OK; +} + +static void video_conv_state_release(struct video_conv_state *state) +{ + if (state->read_fozdb) + fozdb_release(state->read_fozdb); + close(state->blank_file); + free(state); +} + +/* Return true if the file is transcoded, false if not. */ +bool video_conv_state_begin_transcode(struct video_conv_state *state, struct payload_hash *hash) +{ + GST_DEBUG("state %p, hash %s.", state, format_hash(hash)); + + state->transcode_hash = *hash; + + if (state->read_fozdb) + { + uint32_t entry_size; + + if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_MKVDATA, hash, &entry_size) == CONV_OK) + { + GST_DEBUG("Found an MKV video for hash %s.", format_hash(hash)); + state->our_duration = entry_size; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; + state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; + return true; + } + + if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, hash, &entry_size) == CONV_OK) + { + GST_DEBUG("Found an OGV video for hash %s.", format_hash(hash)); + state->our_duration = entry_size; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_OGVDATA; + state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; + return true; + } + } + + GST_INFO("No transcoded video for %s. Substituting a blank video.", format_hash(hash)); + state->state_flags &= ~VIDEO_CONV_HAS_TRANSCODED; + + create_placeholder_file("placeholder-video-used"); + + return false; +} + +int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset, + uint8_t *buffer, size_t size, size_t *fill_size) +{ + size_t to_copy; + bool read_ok; + int ret; + + if (state->state_flags & VIDEO_CONV_HAS_TRANSCODED) + { + if ((ret = fozdb_read_entry_data(state->read_fozdb, state->transcoded_tag, &state->transcode_hash, + offset, buffer, size, fill_size, false)) < 0) + GST_ERROR("Failed to read entry data, ret %d.", ret); + return ret; + } + else /* Fill blank video data to buffer. */ + { + offset = offset % state->our_duration; + to_copy = min(state->our_duration - offset, size); + + /* Copy data. */ + if (lseek(state->blank_file, offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to %#"PRIx64". %s.", offset, strerror(errno)); + return CONV_ERROR; + } + if (!(read_ok = complete_read(state->blank_file, buffer, to_copy))) + { + GST_ERROR("Failed to read blank video data."); + return CONV_ERROR_READ_FAILED; + } + *fill_size = to_copy; + return CONV_OK; + } +} + +/* Call pthread_mutex_unlock() to unlock after usage. */ +static struct video_conv_state *video_conv_lock_state(VideoConv *conv) +{ + pthread_mutex_lock(&conv->state_mutex); + if (!conv->state) + pthread_mutex_unlock(&conv->state_mutex); + return conv->state; +} + +static GstStateChangeReturn video_conv_change_state(GstElement *element, GstStateChange transition) +{ + VideoConv *conv = VIDEO_CONV(element); + struct video_conv_state *state; + int ret; + + GST_INFO_OBJECT(element, "State transition: %s.", gst_state_change_get_name(transition)); + + switch (transition) + { + case GST_STATE_CHANGE_NULL_TO_READY: + /* Do runtime setup. */ + if ((ret = video_conv_state_create(&state)) < 0) + { + GST_ERROR("Failed to create video conv state, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + pthread_mutex_lock(&conv->state_mutex); + assert(!conv->state); + conv->state = state; + pthread_mutex_unlock(&conv->state_mutex); + break; + + case GST_STATE_CHANGE_READY_TO_NULL: + /* Do runtime teardown. */ + pthread_mutex_lock(&conv->state_mutex); + video_conv_state_release(conv->state); + conv->state = NULL; + pthread_mutex_unlock(&conv->state_mutex); + break; + + default: + break; + } + + return GST_ELEMENT_CLASS(parent_class)->change_state(element, transition); + + /* XXX on ReadyToNull, sodium drops state _again_ here... why? */ +} + +static uint64_t video_conv_duration_ours_to_upstream(VideoConv *conv, uint64_t pos) +{ + struct video_conv_state *state = conv->state; + + if (state->upstream_duration != DURATION_NONE && state->our_duration != DURATION_NONE) + return gst_util_uint64_scale_round(pos, state->upstream_duration, state->our_duration); + else + return DURATION_NONE; +} + +static void video_conv_query_upstream_duration(VideoConv *conv) +{ + gint64 duration; + + if (gst_pad_peer_query_duration(conv->sink_pad, GST_FORMAT_BYTES, &duration)) + conv->state->upstream_duration = duration; + else + GST_ERROR_OBJECT(conv, "Failed to query upstream duration."); +} + +static bool video_conv_get_upstream_range(VideoConv *conv, uint64_t offset, uint32_t requested_size, + uint64_t *upstream_offset, uint64_t *upstream_requested_size) +{ + struct video_conv_state *state; + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + + *upstream_offset = video_conv_duration_ours_to_upstream(conv, offset); + *upstream_requested_size = video_conv_duration_ours_to_upstream(conv, requested_size); + + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + +static uint64_t video_conv_duration_ours_to_downstream(VideoConv *conv, uint64_t pos) +{ + struct video_conv_state *state = conv->state; + + if (state->upstream_duration != DURATION_NONE && state->our_duration != DURATION_NONE) + return gst_util_uint64_scale_round(pos, state->our_duration, state->upstream_duration); + else + return DURATION_NONE; +} + +static bool video_conv_get_downstream_range(VideoConv *conv, uint64_t offset, uint32_t end, + uint64_t *downstream_offset, uint64_t *downstream_end) +{ + struct video_conv_state *state; + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + + *downstream_offset = video_conv_duration_ours_to_downstream(conv, offset); + *downstream_end = video_conv_duration_ours_to_downstream(conv, end); + + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + +static bool video_conv_hash_upstream_data(VideoConv *conv, struct payload_hash *hash) +{ + bool ret = false; + + memset(hash, 0, sizeof(*hash)); + + if (conv->active_mode == GST_PAD_MODE_PUSH && gst_adapter_available(conv->adapter) > 0) + { + struct bytes_reader bytes_reader; + gsize read_size = gst_adapter_available(conv->adapter); + const void *buffer = gst_adapter_map(conv->adapter, read_size); + bytes_reader_init(&bytes_reader, buffer, read_size); + ret = murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, hash); + gst_adapter_unmap(conv->adapter); + gst_adapter_clear(conv->adapter); + } + else if (gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) + { + struct pad_reader *reader = pad_reader_create_with_stride(conv->sink_pad, HASH_STRIDE); + ret = murmur3_128(reader, pad_reader_read, HASH_SEED, hash); + pad_reader_release(reader); + conv->active_mode = GST_PAD_MODE_PULL; + } + + return ret; +} + +static int video_conv_dump_upstream_chunk(VideoConv *conv, const void *buffer, size_t read_size, + GList **chunk_hashes) +{ + struct bytes_reader bytes_reader; + struct payload_hash *chunk_hash; + + bytes_reader_init(&bytes_reader, buffer, read_size); + chunk_hash = calloc(1, sizeof(*chunk_hash)); + murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, chunk_hash); + *chunk_hashes = g_list_append(*chunk_hashes, chunk_hash); + + bytes_reader_init(&bytes_reader, buffer, read_size); + return fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_VIDEODATA, chunk_hash, + &bytes_reader, bytes_reader_read, true); +} + +static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *hash) +{ + struct hashes_reader chunk_hashes_reader; + struct pad_reader *pad_reader = NULL; + GList *chunk_hashes = NULL; + uint8_t *buffer = NULL; + size_t read_size; + int ret; + + GST_DEBUG("Dumping upstream data, hash %s.", format_hash(hash)); + + if ((ret = dump_fozdb_open_video(true)) < 0) + { + GST_ERROR("Failed to open video dump fozdb, ret %d.", ret); + goto done; + } + + if (conv->active_mode == GST_PAD_MODE_PUSH) + { + conv->state->state_flags |= VIDEO_CONV_IS_DUMPING; + return 0; + } + + buffer = calloc(1, HASH_CHUNK_SIZE); + pad_reader = pad_reader_create(conv->sink_pad); + while ((ret = pad_reader_read(pad_reader, buffer, HASH_CHUNK_SIZE, &read_size)) == CONV_OK) + { + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, read_size, &chunk_hashes)) < 0) + { + GST_ERROR("Error writing video data to fozdb, ret %d.", ret); + goto done; + } + } + + if (ret != CONV_ERROR_DATA_END) + { + GST_ERROR("Failed to read data from pad reader, ret %d.", ret); + goto done; + } + + hashes_reader_init(&chunk_hashes_reader, chunk_hashes); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, hash, + &chunk_hashes_reader, hashes_reader_read, true)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + +done: + if (chunk_hashes) + g_list_free_full(chunk_hashes, free); + if (pad_reader) + pad_reader_release(pad_reader); + if (buffer) + free(buffer); + return ret; +} + +static void video_conv_init_transcode(VideoConv *conv) +{ + struct video_conv_state *state = conv->state; + struct payload_hash hash; + int ret; + + if (state->state_flags & VIDEO_CONV_HAS_TRANSCODED) + return; + + pthread_mutex_lock(&dump_fozdb.mutex); + + dump_fozdb_discard_transcoded(); + + if (video_conv_hash_upstream_data(conv, &hash)) + { + GST_INFO("Got upstream data hash: %s.", format_hash(&hash)); + if (!video_conv_state_begin_transcode(state, &hash) + && (ret = video_conv_dump_upstream_data(conv, &hash)) < 0) + GST_ERROR("Failed to dump upstream data, ret %d.", ret); + } + else + { + GST_WARNING("Failed to hash upstream data."); + } + + if (!(state->state_flags & VIDEO_CONV_IS_DUMPING)) + pthread_mutex_unlock(&dump_fozdb.mutex); +} + +static uint32_t video_conv_get_state_flags(VideoConv *conv) +{ + struct video_conv_state *state; + uint32_t state_flags; + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return 0; + } + state_flags = state->state_flags; + pthread_mutex_unlock(&conv->state_mutex); + + return state_flags; +} + +static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_hash *hash) +{ + struct video_conv_state *state; + + push_event(conv->src_pad, gst_event_new_stream_start(format_hash(hash))); + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + state->state_flags |= VIDEO_CONV_STREAM_STARTED; + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + +static gboolean video_conv_push_caps(VideoConv *conv, uint32_t transcode_tag) +{ + GstCaps *caps; + gboolean ret; + + if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) + caps = gst_caps_from_string("video/x-matroska"); + else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) + caps = gst_caps_from_string("application/ogg"); + else + return false; + + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; +} + +static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) +{ + struct video_conv_state *state; + uint32_t transcode_tag; + + gst_event_unref(event); + + /* push_event, below, can also grab state and cause a deadlock, so make sure it's + * unlocked before calling */ + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + + video_conv_init_transcode(conv); + transcode_tag = state->transcoded_tag; + + pthread_mutex_unlock(&conv->state_mutex); + + return video_conv_push_caps(conv, transcode_tag); +} + +static gboolean video_conv_sink_event_eos(VideoConv *conv, GstEvent *event) +{ + struct video_conv_state *state; + struct payload_hash hash; + uint32_t transcode_tag; + uint32_t state_flags; + int ret; + + gst_event_unref(event); + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->state_flags & VIDEO_CONV_IS_DUMPING) + { + struct hashes_reader chunk_hashes_reader; + gsize read_bytes; + + if ((read_bytes = gst_adapter_available(conv->adapter))) + { + const void *buffer = gst_adapter_map(conv->adapter, read_bytes); + + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, read_bytes, &state->chunk_hashes)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + + gst_adapter_unmap(conv->adapter); + gst_adapter_clear(conv->adapter); + } + + hashes_reader_init(&chunk_hashes_reader, state->chunk_hashes); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &state->transcode_hash, + &chunk_hashes_reader, hashes_reader_read, true)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + + if (state->chunk_hashes) + g_list_free_full(state->chunk_hashes, free); + + pthread_mutex_unlock(&dump_fozdb.mutex); + state->state_flags &= ~VIDEO_CONV_IS_DUMPING; + pthread_mutex_unlock(&conv->state_mutex); + + return gst_pad_push_event(conv->src_pad, gst_event_new_eos()); + } + + video_conv_init_transcode(conv); + hash = state->transcode_hash; + state_flags = state->state_flags; + transcode_tag = state->transcoded_tag; + + pthread_mutex_unlock(&conv->state_mutex); + + if (!(state_flags & VIDEO_CONV_STREAM_STARTED)) + { + /* rewind and start a new stream for dumping or playback */ + if (!push_event(conv->sink_pad, gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, -1))) + return false; + if (!video_conv_push_stream_start(conv, &hash)) + return false; + if (!video_conv_push_caps(conv, transcode_tag)) + return false; + + /* return false to cancel upstream pads EOS event handling and avoid setting EOS flag */ + return false; + } + + return gst_pad_push_event(conv->src_pad, gst_event_new_eos()); +} + +static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + VideoConv *conv = VIDEO_CONV(parent); + + GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_CAPS) + return video_conv_sink_event_caps(conv, event); + if (event->type == GST_EVENT_EOS) + return video_conv_sink_event_eos(conv, event); + + if (video_conv_get_state_flags(conv) & VIDEO_CONV_STREAM_STARTED) + return gst_pad_event_default(pad, parent, event); + + gst_event_unref(event); + return true; +} + +static gboolean video_conv_src_event_seek(VideoConv *conv, GstEvent *event) +{ + guint seqnum = gst_event_get_seqnum(event); + guint64 upstream_offset, upstream_size; + GstSeekType offset_type, stop_type; + struct video_conv_state *state; + gint64 offset, stop; + GstSeekFlags flags; + GstFormat format; + gdouble rate; + + gst_event_parse_seek(event, &rate, &format, &flags, &offset_type, &offset, &stop_type, &stop); + gst_event_unref(event); + if (format != GST_FORMAT_BYTES) + return false; + + GST_TRACE("conv %p, rate %f, format %s, flags %#x, offset_type %u, cur %#" G_GINT64_MODIFIER "x, " + "stop_type %u, stop %#" G_GINT64_MODIFIER "x.", conv, rate, gst_format_get_name(format), + flags, offset_type, offset, stop_type, stop); + + if (!(state = video_conv_lock_state(conv))) + return GST_FLOW_ERROR; + if (state->state_flags & VIDEO_CONV_IS_DUMPING) + { + pthread_mutex_unlock(&conv->state_mutex); + return true; + } + pthread_mutex_unlock(&conv->state_mutex); + + if (!video_conv_get_upstream_range(conv, offset, HASH_CHUNK_SIZE, &upstream_offset, &upstream_size)) + return false; + + if ((event = gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, upstream_offset, GST_SEEK_TYPE_NONE, -1))) + gst_event_set_seqnum(event, seqnum); + return push_event(conv->sink_pad, event); +} + +static gboolean video_conv_src_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + VideoConv *conv = VIDEO_CONV(parent); + + GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_SEEK) + return video_conv_src_event_seek(conv, event); + + if (video_conv_get_state_flags(conv) & VIDEO_CONV_STREAM_STARTED) + return gst_pad_event_default(pad, parent, event); + + gst_event_unref(event); + return true; +} + +static void video_conv_dump_buffered_chunks(VideoConv *conv, gsize bytes_available) +{ + struct video_conv_state *state = conv->state; + int ret; + + while (bytes_available >= HASH_CHUNK_SIZE) + { + const void *buffer = gst_adapter_map(conv->adapter, HASH_CHUNK_SIZE); + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, HASH_CHUNK_SIZE, &state->chunk_hashes)) < 0) + { + pthread_mutex_unlock(&dump_fozdb.mutex); + state->state_flags &= ~VIDEO_CONV_IS_DUMPING; + break; + } + + gst_adapter_unmap(conv->adapter); + gst_adapter_flush(conv->adapter, HASH_CHUNK_SIZE); + bytes_available -= HASH_CHUNK_SIZE; + } +} + +static GstFlowReturn video_conv_sink_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + gsize buffer_size = gst_buffer_get_size(buffer), buffer_offset = GST_BUFFER_OFFSET(buffer); + uint64_t downstream_offset, downstream_end, seek_offset = -1; + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + GstBuffer *transcoded = NULL; + uint32_t state_flags; + int ret = 0; + + GST_DEBUG_OBJECT(pad, "Got buffer %"GST_PTR_FORMAT".", buffer); + + if (!(state = video_conv_lock_state(conv))) + return GST_FLOW_ERROR; + state_flags = state->state_flags; + + if ((state_flags & VIDEO_CONV_IS_DUMPING) || !(state_flags & VIDEO_CONV_STREAM_STARTED)) + { + gsize bytes_available = gst_adapter_available(conv->adapter) + buffer_size; + gst_adapter_push(conv->adapter, buffer); + + if (state_flags & VIDEO_CONV_IS_DUMPING) + video_conv_dump_buffered_chunks(conv, bytes_available); + else if (!(bytes_available % HASH_CHUNK_SIZE) && bytes_available >= HASH_STRIDE) + { + state->read_offset += HASH_STRIDE; + seek_offset = state->read_offset; + } + } + + pthread_mutex_unlock(&conv->state_mutex); + + if (ret < 0) + { + GST_ERROR("Failed to dump or read transcoded buffer, error %d.", ret); + if (transcoded) + gst_buffer_unref(transcoded); + return GST_FLOW_ERROR; + } + + if (seek_offset != -1 && !push_event(pad, gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, seek_offset, GST_SEEK_TYPE_NONE, -1))) + return GST_FLOW_ERROR; + if (!(state_flags & VIDEO_CONV_STREAM_STARTED)) + return GST_FLOW_OK; + + if (!video_conv_get_downstream_range(conv, buffer_offset, buffer_offset + buffer_size, + &downstream_offset, &downstream_end)) + return GST_FLOW_ERROR; + + if (downstream_end == downstream_offset) + return GST_FLOW_OK; + if (!(transcoded = gst_buffer_new_and_alloc(downstream_end - downstream_offset))) + return GST_FLOW_ERROR; + else + { + GstBufferMapInfo map; + size_t fill_size = 0; + + if (gst_buffer_map(transcoded, &map, GST_MAP_READWRITE)) + { + ret = video_conv_state_fill_buffer(state, downstream_offset, map.data, map.size, &fill_size); + gst_buffer_unmap(transcoded, &map); + gst_buffer_set_size(transcoded, fill_size); + } + + if (gst_buffer_get_size(transcoded)) + { + GST_BUFFER_OFFSET(transcoded) = downstream_offset; + return gst_pad_push(conv->src_pad, transcoded); + } + + gst_buffer_unref(transcoded); + } + + return GST_FLOW_OK; +} + +static GstFlowReturn video_conv_src_get_range(GstPad *pad, GstObject *parent, + guint64 offset, guint request_size, GstBuffer **buffer) +{ + GstBuffer *my_buffer, *upstream_buffer = NULL, *new_buffer = NULL; + uint64_t upstream_offset, upstream_request_size; + GstFlowReturn flow_ret = GST_FLOW_ERROR; + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + size_t fill_size; + GstMapInfo map; + int ret; + + if (!video_conv_get_upstream_range(conv, offset, request_size, &upstream_offset, &upstream_request_size)) + return flow_ret; + + if (!(state = video_conv_lock_state(conv))) + return flow_ret; + + /* Read and ignore upstream bytes. */ + if ((flow_ret = gst_pad_pull_range(conv->sink_pad, upstream_offset, upstream_request_size, &upstream_buffer)) < 0) + { + GST_ERROR("Failed to pull upstream data from %"GST_PTR_FORMAT", offset %#"PRIx64", size %#"PRIx64", reason %s.", + conv->sink_pad, upstream_offset, upstream_request_size, gst_flow_get_name(flow_ret)); + goto done; + } + gst_buffer_unref(upstream_buffer); + + /* Allocate and map buffer. */ + my_buffer = *buffer; + if (!my_buffer) + { + /* XXX: can we use a buffer cache here? */ + if (!(new_buffer = gst_buffer_new_and_alloc(request_size))) + { + GST_ERROR("Failed to allocate buffer of %u bytes.", request_size); + goto done; + } + my_buffer = new_buffer; + } + if (!gst_buffer_map(my_buffer, &map, GST_MAP_READWRITE)) + { + GST_ERROR("Failed to map buffer <%"GST_PTR_FORMAT">.", my_buffer); + goto done; + } + + /* Fill buffer. */ + ret = video_conv_state_fill_buffer(state, offset, map.data, map.size, &fill_size); + gst_buffer_unmap(my_buffer, &map); + if (ret < 0) + { + GST_ERROR("Failed to fill buffer, ret %d.", ret); + goto done; + } + + if (fill_size > 0 || !gst_buffer_get_size(my_buffer)) + { + gst_buffer_set_size(my_buffer, fill_size); + *buffer = my_buffer; + flow_ret = GST_FLOW_OK; + } + else + { + flow_ret = GST_FLOW_EOS; + } + +done: + if (flow_ret < 0 && new_buffer) + gst_buffer_unref(new_buffer); + pthread_mutex_unlock(&conv->state_mutex); + return flow_ret; +} + +static gboolean video_conv_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + GstSchedulingFlags flags; + gint min, max, align; + GstQuery *peer_query; + uint64_t duration; + GstFormat format; + + GST_DEBUG_OBJECT(pad, "Got query %"GST_PTR_FORMAT".", query); + + switch (query->type) + { + case GST_QUERY_SCHEDULING: + peer_query = gst_query_new_scheduling(); + if (!gst_pad_peer_query(conv->sink_pad, peer_query)) + { + GST_ERROR_OBJECT(conv->sink_pad, "Failed to query scheduling from peer."); + gst_query_unref(peer_query); + return false; + } + gst_query_parse_scheduling(peer_query, &flags, &min, &max, &align); + gst_query_unref(peer_query); + + gst_query_set_scheduling(query, flags, min, max, align); + if (conv->active_mode != GST_PAD_MODE_NONE) + gst_query_add_scheduling_mode(query, conv->active_mode); + else + { + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PUSH); + } + + return true; + + case GST_QUERY_DURATION: + gst_query_parse_duration(query, &format, NULL); + if (format != GST_FORMAT_BYTES) + { + GST_WARNING("Duration query format is not GST_FORMAT_BYTES."); + return false; + } + + if (!(state = video_conv_lock_state(conv))) + return false; + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + duration = state->our_duration; + pthread_mutex_unlock(&conv->state_mutex); + + if (duration == DURATION_NONE) + return false; + gst_query_set_duration(query, GST_FORMAT_BYTES, duration); + return true; + + default: + return gst_pad_query_default(pad, parent, query); + } +} + +static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean active) +{ + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + struct payload_hash hash; + uint32_t state_flags; + + GST_DEBUG_OBJECT(pad, "mode %s, active %d.", gst_pad_mode_get_name(mode), active); + + if (!gst_pad_activate_mode(conv->sink_pad, mode, active)) + { + GST_ERROR_OBJECT(conv->sink_pad, "Failed to active sink pad: mode %s, active %d.", + gst_pad_mode_get_name(mode), active); + return false; + } + + conv->active_mode = mode; + if (mode != GST_PAD_MODE_PULL) + return true; + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + + video_conv_init_transcode(conv); + hash = state->transcode_hash; + state_flags = state->state_flags; + + /* push_event, below, can also grab state and cause a deadlock, so make sure it's + * unlocked before calling */ + pthread_mutex_unlock(&conv->state_mutex); + + if (active && !(state_flags & VIDEO_CONV_STREAM_STARTED) && (state_flags & VIDEO_CONV_HAS_TRANSCODED)) + return video_conv_push_stream_start(conv, &hash); + return true; +} + + +static void video_conv_finalize(GObject *object) +{ + VideoConv *conv = VIDEO_CONV(object); + + gst_object_unref(conv->adapter); + pthread_mutex_destroy(&conv->state_mutex); + if (conv->state) + video_conv_state_release(conv->state); + + G_OBJECT_CLASS(parent_class)->finalize(object); +} + +static void video_conv_class_init(VideoConvClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton video converter", + "Codec/Demuxer", + "Converts video for Proton", + "Andrew Eikum , Ziqing Hui "); + + element_class->change_state = video_conv_change_state; + object_class->finalize = video_conv_finalize; + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&video_conv_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&video_conv_src_template)); +} + +static void video_conv_init(VideoConv *conv) +{ + GstElement *element = GST_ELEMENT(conv); + + conv->sink_pad = gst_pad_new_from_static_template(&video_conv_sink_template, "sink"); + gst_pad_set_event_function(conv->sink_pad, GST_DEBUG_FUNCPTR(video_conv_sink_event)); + gst_pad_set_chain_function(conv->sink_pad, GST_DEBUG_FUNCPTR(video_conv_sink_chain)); + gst_element_add_pad(element, conv->sink_pad); + + conv->src_pad = gst_pad_new_from_static_template(&video_conv_src_template, "src"); + gst_pad_set_event_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_event)); + gst_pad_set_getrange_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_get_range)); + gst_pad_set_query_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_query)); + gst_pad_set_activatemode_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_active_mode)); + gst_element_add_pad(element, conv->src_pad); + + pthread_mutex_init(&conv->state_mutex, NULL); + conv->state = NULL; + conv->adapter = gst_adapter_new(); + conv->active_mode = GST_PAD_MODE_NONE; +} diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 9cc54f8e146..83ab880f8ef 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -36,6 +36,7 @@ struct object_context IMFByteStream *stream; UINT64 file_size; WCHAR *url; + enum wg_parser_type type; }; static struct object_context *impl_from_IUnknown(IUnknown *iface) @@ -95,7 +96,7 @@ static const IUnknownVtbl object_context_vtbl = }; static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const WCHAR *url, - QWORD file_size, IMFAsyncResult *result, IUnknown **out) + QWORD file_size, IMFAsyncResult *result, enum wg_parser_type type, IUnknown **out) { WCHAR *tmp_url = url ? wcsdup(url) : NULL; struct object_context *context; @@ -113,6 +114,7 @@ static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const W context->file_size = file_size; context->url = tmp_url; context->result = result; + context->type = type; IMFAsyncResult_AddRef(context->result); *out = &context->IUnknown_iface; @@ -137,6 +139,9 @@ struct media_stream DWORD stream_id; BOOL active; BOOL eos; + + DWORD busy; + CONDITION_VARIABLE cond; }; enum source_async_op @@ -391,7 +396,7 @@ static HRESULT stream_descriptor_set_tag(IMFStreamDescriptor *descriptor, wg_par return hr; } -static HRESULT init_video_media_types(struct wg_format *format, IMFMediaType *types[6], DWORD *types_count) +static HRESULT init_video_media_types(struct wg_format *format, IMFMediaType *types[9], DWORD *types_count) { /* Try to prefer YUV formats over RGB ones. Most decoders output in the * YUV color space, and it's generally much less expensive for @@ -402,6 +407,9 @@ static HRESULT init_video_media_types(struct wg_format *format, IMFMediaType *ty WG_VIDEO_FORMAT_YV12, WG_VIDEO_FORMAT_YUY2, WG_VIDEO_FORMAT_I420, + WG_VIDEO_FORMAT_BGRA, + WG_VIDEO_FORMAT_BGRx, + WG_VIDEO_FORMAT_RGBA, }; UINT count = *types_count, i; GUID base_subtype; @@ -438,15 +446,22 @@ static HRESULT init_video_media_types(struct wg_format *format, IMFMediaType *ty } } + for (i = 0; i < count; i++) + { + IMFMediaType_SetUINT32(types[i], &MF_MT_VIDEO_NOMINAL_RANGE, + MFNominalRange_Normal); + } + done: *types_count = count; return hr; } -static HRESULT init_audio_media_types(struct wg_format *format, IMFMediaType *types[6], DWORD *types_count) +static HRESULT init_audio_media_types(struct wg_format *format, IMFMediaType *types[9], DWORD *types_count) { /* Expose at least one PCM and one floating point type for the - consumer to pick from. */ + consumer to pick from. Moreover, ensure that we expose S16LE first, + as games such as MGSV expect the native media type to be 16 bps. */ static const enum wg_audio_format audio_types[] = { WG_AUDIO_FORMAT_S16LE, @@ -454,16 +469,25 @@ static HRESULT init_audio_media_types(struct wg_format *format, IMFMediaType *ty }; UINT count = *types_count, i; + BOOL has_native_format = FALSE; + for (i = 0; i < ARRAY_SIZE(audio_types); i++) { - struct wg_format new_format = *format; - if (new_format.u.audio.format == audio_types[i]) - continue; + struct wg_format new_format; + + new_format = *format; new_format.u.audio.format = audio_types[i]; if ((types[count] = mf_media_type_from_wg_format(&new_format))) + { + if (format->u.audio.format == audio_types[i]) + has_native_format = TRUE; count++; + } } + if (!has_native_format && (types[count] = mf_media_type_from_wg_format(format))) + count++; + *types_count = count; return S_OK; } @@ -472,13 +496,12 @@ static HRESULT stream_descriptor_create(UINT32 id, struct wg_format *format, IMF { IMFStreamDescriptor *descriptor; IMFMediaTypeHandler *handler; - IMFMediaType *types[6]; + IMFMediaType *types[9]; DWORD count = 0; HRESULT hr; - if (!(types[0] = mf_media_type_from_wg_format(format))) - return MF_E_INVALIDMEDIATYPE; - count = 1; + if ((types[0] = mf_media_type_from_wg_format(format))) + count = 1; if (format->major_type == WG_MAJOR_TYPE_VIDEO) { @@ -573,7 +596,7 @@ static HRESULT media_stream_start(struct media_stream *stream, BOOL active, BOOL if (FAILED(hr = wg_format_from_stream_descriptor(stream->descriptor, &format))) WARN("Failed to get wg_format from stream descriptor, hr %#lx\n", hr); - wg_parser_stream_enable(stream->wg_stream, &format); + wg_parser_stream_enable(stream->wg_stream, &format, 0); if (FAILED(hr = IMFMediaEventQueue_QueueEventParamUnk(source->event_queue, active ? MEUpdatedStream : MENewStream, &GUID_NULL, S_OK, (IUnknown *)&stream->IMFMediaStream_iface))) @@ -786,12 +809,25 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) { struct media_source *source = impl_from_IMFMediaSource(stream->media_source); struct wg_parser_buffer buffer; + BOOL ret; TRACE("%p, %p\n", stream, token); - if (wg_parser_stream_get_buffer(source->wg_parser, stream->wg_stream, &buffer)) - return media_stream_send_sample(stream, &buffer, token); + stream->busy = TRUE; + LeaveCriticalSection(&source->cs); + ret = wg_parser_stream_get_buffer(source->wg_parser, stream->wg_stream, &buffer); + EnterCriticalSection(&source->cs); + stream->busy = FALSE; + WakeConditionVariable(&stream->cond); + if (source->state == SOURCE_SHUTDOWN) + { + WARN("media source has been shutdown, returning\n"); + return MF_E_SHUTDOWN; + } + + if (ret) + return media_stream_send_sample(stream, &buffer, token); return media_stream_send_eos(source, stream); } @@ -1357,6 +1393,7 @@ static ULONG WINAPI media_source_Release(IMFMediaSource *iface) if (!ref) { IMFMediaSource_Shutdown(iface); + MFUnlockWorkQueue(source->async_commands_queue); IMFMediaEventQueue_Release(source->event_queue); IMFByteStream_Release(source->byte_stream); wg_parser_destroy(source->wg_parser); @@ -1427,6 +1464,7 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **descriptor) { struct media_source *source = impl_from_IMFMediaSource(iface); + BOOL video_selected = FALSE, audio_selected = FALSE; HRESULT hr; UINT i; @@ -1443,8 +1481,22 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * for (i = 0; i < source->stream_count; ++i) { - if (FAILED(hr = IMFPresentationDescriptor_SelectStream(*descriptor, i))) - WARN("Failed to select stream %u, hr %#lx\n", i, hr); + struct wg_format format; + + wg_format_from_stream_descriptor(source->descriptors[i], &format); + + if (format.major_type >= WG_MAJOR_TYPE_VIDEO) + { + if (!video_selected && FAILED(hr = IMFPresentationDescriptor_SelectStream(*descriptor, i))) + WARN("Failed to select stream %u, hr %#lx\n", i, hr); + video_selected = TRUE; + } + else if (format.major_type >= WG_MAJOR_TYPE_AUDIO) + { + if (!audio_selected && FAILED(hr = IMFPresentationDescriptor_SelectStream(*descriptor, i))) + WARN("Failed to select stream %u, hr %#lx\n", i, hr); + audio_selected = TRUE; + } } hr = S_OK; @@ -1538,6 +1590,7 @@ static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface) static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface); + UINT i; TRACE("%p.\n", iface); @@ -1551,6 +1604,14 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) source->state = SOURCE_SHUTDOWN; + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + wg_parser_stream_disable(stream->wg_stream); + while (stream->busy) + SleepConditionVariableCS(&stream->cond, &source->cs, INFINITE); + } + wg_parser_disconnect(source->wg_parser); source->read_thread_shutdown = true; @@ -1643,7 +1704,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue))) goto fail; - if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE))) + if (!(parser = wg_parser_create(context->type, FALSE, FALSE))) { hr = E_OUTOFMEMORY; goto fail; @@ -1654,7 +1715,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc object->state = SOURCE_OPENING; - if (FAILED(hr = wg_parser_connect(parser, object->file_size))) + if (FAILED(hr = wg_parser_connect(parser, object->file_size, context->url))) goto fail; stream_count = wg_parser_get_stream_count(parser); @@ -1684,11 +1745,33 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc object->duration = max(object->duration, wg_parser_stream_get_duration(wg_stream)); IMFStreamDescriptor_AddRef(descriptor); - object->descriptors[i] = descriptor; + object->descriptors[stream_count - 1 - i] = descriptor; object->streams[i] = stream; object->stream_count++; } + /* Hack for bug 19766 - Biomutant (597820) [T5] Title Hangs After Intro Cut Scene Unless Skipped. + * + * Unreal Engine 4 games expect presentation clock correlated time to run past media source + * duration[1], which assumes that all streams in a media source have the same duration. + * Biomutant_Trailer.mp4 from Biomutant(597820) has a 1:27.734s video stream and a 1:27.776s + * audio stream so the media source duration is reported to be 1:27.776s. However, the game + * builds a topology that only uses the video stream. So the last presentation clock correlated + * time could be something before the media source duration 1:27.776s before it's stopped. In + * Unreal Engine 4.18 source, on every frame FWmfMediaSession::GetEvents()[2] checks + * "Time > CurrentDuration" to decide whether to stop its media session. With the time check + * fails, the game will hang forever waiting for the session to stop. This hack shortens the + * media source duration to satisfy the condition check. The reason why it works on Windows is + * probably due to a delay caused a busy CPU and different scheduling. + * + * [1][2]: UnrealEngine-4.18/Engine/Plugins/Media/WmfMedia/Source/WmfMedia/Private/Wmf/WmfMediaSession.cpp#FWmfMediaSession::GetEvents() + */ + { + const char *id = getenv("SteamGameId"); + if (id && !strcmp(id, "597820") && object->duration == 877760000) /* Biomutant_Trailer.mp4 */ + object->duration = 877340000; + } + media_source_init_descriptors(object); object->state = SOURCE_STOPPED; @@ -1699,11 +1782,15 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc fail: WARN("Failed to construct MFMediaSource, hr %#lx.\n", hr); - while (object->streams && object->stream_count--) + for (i = 0; i < stream_count; i++) { - struct media_stream *stream = object->streams[object->stream_count]; - IMFStreamDescriptor_Release(object->descriptors[object->stream_count]); - IMFMediaStream_Release(&stream->IMFMediaStream_iface); + if (object->streams && object->streams[i]) + IMFMediaStream_Release(&object->streams[i]->IMFMediaStream_iface); + } + for (i = 0; i < stream_count; i++) + { + if (object->descriptors && object->descriptors[i]) + IMFStreamDescriptor_Release(object->descriptors[i]); } free(object->descriptors); free(object->streams); @@ -1879,7 +1966,7 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa if (FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) return hr; - if (FAILED(hr = object_context_create(flags, stream, url, file_size, result, &context))) + if (FAILED(hr = object_context_create(flags, stream, url, file_size, result, WG_PARSER_DECODEBIN, &context))) { IMFAsyncResult_Release(result); return hr; @@ -2051,3 +2138,265 @@ HRESULT gstreamer_byte_stream_handler_create(REFIID riid, void **obj) return hr; } + +struct scheme_handler +{ + IMFSchemeHandler IMFSchemeHandler_iface; + IMFAsyncCallback IMFAsyncCallback_iface; + LONG refcount; + struct list results; + CRITICAL_SECTION cs; +}; + +static struct scheme_handler *impl_from_IMFSchemeHandler(IMFSchemeHandler *iface) +{ + return CONTAINING_RECORD(iface, struct scheme_handler, IMFSchemeHandler_iface); +} + +static struct scheme_handler *scheme_handler_from_IMFAsyncCallback(IMFAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct scheme_handler, IMFAsyncCallback_iface); +} + +static struct result_entry *scheme_handler_find_result_entry(struct scheme_handler *handler, IMFAsyncResult *result) +{ + struct result_entry *entry; + + EnterCriticalSection(&handler->cs); + LIST_FOR_EACH_ENTRY(entry, &handler->results, struct result_entry, entry) + { + if (result == entry->result) + { + list_remove(&entry->entry); + LeaveCriticalSection(&handler->cs); + return entry; + } + } + LeaveCriticalSection(&handler->cs); + + return NULL; +} + + +static HRESULT WINAPI scheme_handler_QueryIntace(IMFSchemeHandler *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFSchemeHandler) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFSchemeHandler_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI scheme_handler_AddRef(IMFSchemeHandler *iface) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + ULONG refcount = InterlockedIncrement(&handler->refcount); + + TRACE("%p, refcount %lu.\n", handler, refcount); + + return refcount; +} + +static ULONG WINAPI scheme_handler_Release(IMFSchemeHandler *iface) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + ULONG refcount = InterlockedDecrement(&handler->refcount); + struct result_entry *result, *next; + + TRACE("%p, refcount %lu.\n", iface, refcount); + + if (!refcount) + { + LIST_FOR_EACH_ENTRY_SAFE(result, next, &handler->results, struct result_entry, entry) + result_entry_destroy(result); + DeleteCriticalSection(&handler->cs); + free(handler); + } + + return refcount; +} + +static HRESULT WINAPI scheme_handler_BeginCreateObject(IMFSchemeHandler *iface, const WCHAR *url, DWORD flags, + IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback, IUnknown *state) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + IMFByteStream *bytestream; + IMFAsyncResult *result; + IUnknown *context; + IStream *stream; + HRESULT hr; + + TRACE("%p, %s, %#lx, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state); + + if (cancel_cookie) + *cancel_cookie = NULL; + + if (FAILED(hr = CreateStreamOnHGlobal(0, TRUE, &stream))) + return hr; + + hr = MFCreateMFByteStreamOnStream(stream, &bytestream); + IStream_Release(stream); + if (FAILED(hr)) + return hr; + + if (FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) + return hr; + if (FAILED(hr = object_context_create(flags, bytestream, url, 0, result, WG_PARSER_URIDECODEBIN, &context))) + { + IMFAsyncResult_Release(result); + return hr; + } + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_IO, &handler->IMFAsyncCallback_iface, context); + IUnknown_Release(context); + IMFAsyncResult_Release(result); + + return hr; +} + +static HRESULT WINAPI scheme_handler_EndCreateObject(IMFSchemeHandler *iface, IMFAsyncResult *result, + MF_OBJECT_TYPE *obj_type, IUnknown **object) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + struct result_entry *entry; + HRESULT hr; + + TRACE("%p, %p, %p, %p.\n", iface, result, obj_type, object); + + if (!(entry = scheme_handler_find_result_entry(handler, result))) + { + *obj_type = MF_OBJECT_INVALID; + *object = NULL; + return MF_E_UNEXPECTED; + } + + hr = IMFAsyncResult_GetStatus(entry->result); + *obj_type = MF_OBJECT_MEDIASOURCE; + *object = entry->object; + IUnknown_AddRef(*object); + result_entry_destroy(entry); + + return hr; +} + +static HRESULT WINAPI scheme_handler_CancelObjectCreation(IMFSchemeHandler *iface, IUnknown *cancel_cookie) +{ + /* Cancellation is not supported. */ + TRACE("%p, %p.\n", iface, cancel_cookie); + return MF_E_UNEXPECTED; +} + +static const IMFSchemeHandlerVtbl scheme_handler_vtbl = +{ + scheme_handler_QueryIntace, + scheme_handler_AddRef, + scheme_handler_Release, + scheme_handler_BeginCreateObject, + scheme_handler_EndCreateObject, + scheme_handler_CancelObjectCreation, +}; + +static HRESULT WINAPI scheme_handler_callback_QueryInterface(IMFAsyncCallback *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFAsyncCallback_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI scheme_handler_callback_AddRef(IMFAsyncCallback *iface) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + return IMFSchemeHandler_AddRef(&handler->IMFSchemeHandler_iface); +} + +static ULONG WINAPI scheme_handler_callback_Release(IMFAsyncCallback *iface) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + return IMFSchemeHandler_Release(&handler->IMFSchemeHandler_iface); +} + +static HRESULT WINAPI scheme_handler_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI scheme_handler_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + IUnknown *object, *state = IMFAsyncResult_GetStateNoAddRef(result); + struct object_context *context; + struct result_entry *entry; + HRESULT hr; + + if (!state || !(context = impl_from_IUnknown(state))) + return E_INVALIDARG; + + if (FAILED(hr = media_source_create(context, (IMFMediaSource **)&object))) + WARN("Failed to create media source, hr %#lx\n", hr); + else + { + if (FAILED(hr = result_entry_create(context->result, MF_OBJECT_MEDIASOURCE, object, &entry))) + WARN("Failed to create handler result, hr %#lx\n", hr); + else + { + EnterCriticalSection(&handler->cs); + list_add_tail(&handler->results, &entry->entry); + LeaveCriticalSection(&handler->cs); + } + + IUnknown_Release(object); + } + + IMFAsyncResult_SetStatus(context->result, hr); + MFInvokeCallback(context->result); + + return S_OK; +} + +static const IMFAsyncCallbackVtbl scheme_handler_callback_vtbl = +{ + scheme_handler_callback_QueryInterface, + scheme_handler_callback_AddRef, + scheme_handler_callback_Release, + scheme_handler_callback_GetParameters, + scheme_handler_callback_Invoke, +}; + +HRESULT gstreamer_scheme_handler_create(REFIID riid, void **obj) +{ + struct scheme_handler *handler; + HRESULT hr; + + TRACE("%s, %p.\n", debugstr_guid(riid), obj); + + if (!(handler = calloc(1, sizeof(*handler)))) + return E_OUTOFMEMORY; + + list_init(&handler->results); + InitializeCriticalSection(&handler->cs); + + handler->IMFSchemeHandler_iface.lpVtbl = &scheme_handler_vtbl; + handler->IMFAsyncCallback_iface.lpVtbl = &scheme_handler_callback_vtbl; + handler->refcount = 1; + + hr = IMFSchemeHandler_QueryInterface(&handler->IMFSchemeHandler_iface, riid, obj); + IMFSchemeHandler_Release(&handler->IMFSchemeHandler_iface); + + return hr; +} diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 0e1d489d8e5..0c2e37abe8a 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "gst_private.h" #include "ks.h" @@ -25,6 +27,8 @@ #include "initguid.h" #include "d3d9types.h" #include "mfapi.h" +#include "mmreg.h" +#include "mferror.h" #include "wine/debug.h" #include "wine/list.h" @@ -36,9 +40,15 @@ DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20 DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); DEFINE_MEDIATYPE_GUID(MFAudioFormat_RAW_AAC,WAVE_FORMAT_RAW_AAC1); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_XMAudio2, 0x0166); DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IV50,MAKEFOURCC('I','V','5','0')); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_GStreamer,MAKEFOURCC('G','S','T','a')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_GStreamer,MAKEFOURCC('G','S','T','v')); + +extern GUID MEDIASUBTYPE_VC1S; struct class_factory { @@ -117,6 +127,11 @@ static const IClassFactoryVtbl class_factory_vtbl = }; static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; +static const GUID CLSID_GStreamerByteStreamHandler2 = {0x317df619, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; +static const GUID CLSID_GStreamerAudioDecoder = {0x480b1517, 0xc8e9, 0x4eae, {0xb0, 0x06, 0xe6, 0x30, 0x07, 0x18, 0xd8, 0x5d}}; +static const GUID CLSID_GStreamerVideoDecoder = {0x480b1518, 0xc8e9, 0x4eae, {0xb0, 0x06, 0xe6, 0x30, 0x07, 0x18, 0xd8, 0x5d}}; + +static const GUID CLSID_GStreamerSchemePlugin = {0x587eeb6a,0x7336,0x4ebd,{0xa4,0xf2,0x91,0xc9,0x48,0xde,0x62,0x2c}}; static const struct class_object { @@ -125,10 +140,14 @@ static const struct class_object } class_objects[] = { + { &CLSID_GStreamerAudioDecoder, &audio_decoder_create }, + { &CLSID_GStreamerVideoDecoder, &video_decoder_create }, { &CLSID_VideoProcessorMFT, &video_processor_create }, { &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create }, + { &CLSID_GStreamerByteStreamHandler2, &gstreamer_byte_stream_handler_2_create }, { &CLSID_MSAACDecMFT, &aac_decoder_create }, { &CLSID_MSH264DecoderMFT, &h264_decoder_create }, + { &CLSID_GStreamerSchemePlugin, &gstreamer_scheme_handler_create }, }; HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) @@ -324,6 +343,34 @@ HRESULT mfplat_DllRegisterServer(void) {MFMediaType_Video, MFVideoFormat_NV11}, }; + MFT_REGISTER_TYPE_INFO audio_decoder_input_types[] = + { + {MFMediaType_Audio, MFAudioFormat_GStreamer}, + }; + MFT_REGISTER_TYPE_INFO audio_decoder_output_types[] = + { + {MFMediaType_Audio, MFAudioFormat_Float}, + {MFMediaType_Audio, MFAudioFormat_PCM}, + }; + + MFT_REGISTER_TYPE_INFO video_decoder_input_types[] = + { + {MFMediaType_Video, MFVideoFormat_GStreamer}, + {MFMediaType_Video, MFVideoFormat_IV50}, + }; + MFT_REGISTER_TYPE_INFO video_decoder_output_types[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_RGB32}, + {MFMediaType_Video, MFVideoFormat_RGB24}, + {MFMediaType_Video, MFVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_RGB555}, + {MFMediaType_Video, MFVideoFormat_RGB8}, + }; + struct mft { GUID clsid; @@ -397,6 +444,39 @@ HRESULT mfplat_DllRegisterServer(void) ARRAY_SIZE(resampler_types), resampler_types, }, + { + CLSID_CFrameRateConvertDmo, + MFT_CATEGORY_VIDEO_EFFECT, + L"Frame Rate Converter", + MFT_ENUM_FLAG_SYNCMFT, + /* FIXME: check the actual media types */ + ARRAY_SIZE(color_convert_input_types), + color_convert_input_types, + ARRAY_SIZE(color_convert_output_types), + color_convert_output_types, + }, + { + CLSID_CResizerDMO, + MFT_CATEGORY_VIDEO_EFFECT, + L"Resizer MFT", + MFT_ENUM_FLAG_SYNCMFT, + /* FIXME: check the actual media types */ + ARRAY_SIZE(color_convert_input_types), + color_convert_input_types, + ARRAY_SIZE(color_convert_output_types), + color_convert_output_types, + }, + { + CLSID_CColorControlDmo, + MFT_CATEGORY_VIDEO_EFFECT, + L"Color Control", + MFT_ENUM_FLAG_SYNCMFT, + /* FIXME: check the actual media types */ + ARRAY_SIZE(color_convert_input_types), + color_convert_input_types, + ARRAY_SIZE(color_convert_output_types), + color_convert_output_types, + }, { CLSID_CColorConvertDMO, MFT_CATEGORY_VIDEO_EFFECT, @@ -407,6 +487,39 @@ HRESULT mfplat_DllRegisterServer(void) ARRAY_SIZE(color_convert_output_types), color_convert_output_types, }, + { + CLSID_GStreamerAudioDecoder, + MFT_CATEGORY_AUDIO_DECODER, + L"Wine Audio Decoder MFT", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(audio_decoder_input_types), + audio_decoder_input_types, + ARRAY_SIZE(audio_decoder_output_types), + audio_decoder_output_types, + }, + { + CLSID_GStreamerVideoDecoder, + MFT_CATEGORY_VIDEO_DECODER, + L"Wine Video Decoder MFT", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(video_decoder_input_types), + video_decoder_input_types, + ARRAY_SIZE(video_decoder_output_types), + video_decoder_output_types, + }, + { + /* HACK: Register the video processor as a decoder too as + * the media source currently always decodes. + */ + CLSID_VideoProcessorMFT, + MFT_CATEGORY_VIDEO_DECODER, + L"Null Decoder", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(video_processor_input_types), + video_processor_input_types, + ARRAY_SIZE(video_processor_output_types), + video_processor_output_types, + }, }; unsigned int i; @@ -437,6 +550,7 @@ video_formats[] = {&MFVideoFormat_ARGB32, WG_VIDEO_FORMAT_BGRA}, {&MFVideoFormat_RGB32, WG_VIDEO_FORMAT_BGRx}, {&MFVideoFormat_RGB24, WG_VIDEO_FORMAT_BGR}, + {&MFVideoFormat_ABGR32, WG_VIDEO_FORMAT_RGBA}, {&MFVideoFormat_RGB555, WG_VIDEO_FORMAT_RGB15}, {&MFVideoFormat_RGB565, WG_VIDEO_FORMAT_RGB16}, {&MFVideoFormat_AYUV, WG_VIDEO_FORMAT_AYUV}, @@ -526,6 +640,7 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format * IMFMediaType_SetUINT32(type, &MF_MT_COMPRESSED, FALSE); IMFMediaType_SetUINT32(type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE); IMFMediaType_SetUINT32(type, &MF_MT_VIDEO_ROTATION, MFVideoRotationFormat_0); + IMFMediaType_SetUINT32(type, &MF_MT_VIDEO_NOMINAL_RANGE, MFNominalRange_Normal); if (format->u.video.height < 0) stride = -stride; @@ -554,6 +669,74 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format * return NULL; } +static IMFMediaType *mf_media_type_from_wg_format_audio_encoded(const struct wg_format *format) +{ + IMFMediaType *type; + UINT32 value; + HRESULT hr; + + if (FAILED(MFCreateMediaType(&type))) + return NULL; + if (FAILED(hr = IMFMediaType_SetGUID(type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) + goto done; + if (FAILED(hr = IMFMediaType_SetGUID(type, &MF_MT_SUBTYPE, &MFAudioFormat_GStreamer))) + goto done; + + value = format->u.audio_encoded.rate; + if (value && FAILED(hr = IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, value))) + goto done; + value = format->u.audio_encoded.channels; + if (value && FAILED(hr = IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, value))) + goto done; + if (FAILED(hr = IMFMediaType_SetBlob(type, &MF_MT_USER_DATA, (BYTE *)format->u.audio_encoded.caps, + strlen(format->u.audio_encoded.caps) + 1))) + goto done; + +done: + if (FAILED(hr)) + { + IMFMediaType_Release(type); + return NULL; + } + return type; +} + +static IMFMediaType *mf_media_type_from_wg_format_video_encoded(const struct wg_format *format) +{ + UINT64 frame_rate, frame_size; + IMFMediaType *type; + HRESULT hr; + + if (FAILED(MFCreateMediaType(&type))) + return NULL; + if (FAILED(hr = IMFMediaType_SetGUID(type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video))) + goto done; + if (FAILED(hr = IMFMediaType_SetGUID(type, &MF_MT_SUBTYPE, &MFVideoFormat_GStreamer))) + goto done; + if (FAILED(hr = IMFMediaType_SetUINT32(type, &MF_MT_VIDEO_ROTATION, MFVideoRotationFormat_0))) + goto done; + if (FAILED(hr = IMFMediaType_SetUINT32(type, &MF_MT_COMPRESSED, TRUE))) + goto done; + + frame_size = (UINT64)format->u.video_encoded.width << 32 | format->u.video_encoded.height; + if (FAILED(hr = IMFMediaType_SetUINT64(type, &MF_MT_FRAME_SIZE, frame_size))) + goto done; + frame_rate = (UINT64)format->u.video_encoded.fps_n << 32 | format->u.video_encoded.fps_d; + if (FAILED(hr = IMFMediaType_SetUINT64(type, &MF_MT_FRAME_RATE, frame_rate))) + goto done; + if (FAILED(hr = IMFMediaType_SetBlob(type, &MF_MT_USER_DATA, (BYTE *)format->u.video_encoded.caps, + strlen(format->u.video_encoded.caps) + 1))) + goto done; + +done: + if (FAILED(hr)) + { + IMFMediaType_Release(type); + return NULL; + } + return type; +} + IMFMediaType *mf_media_type_from_wg_format(const struct wg_format *format) { switch (format->major_type) @@ -573,9 +756,13 @@ IMFMediaType *mf_media_type_from_wg_format(const struct wg_format *format) case WG_MAJOR_TYPE_AUDIO: return mf_media_type_from_wg_format_audio(format); + case WG_MAJOR_TYPE_AUDIO_ENCODED: + return mf_media_type_from_wg_format_audio_encoded(format); case WG_MAJOR_TYPE_VIDEO: return mf_media_type_from_wg_format_video(format); + case WG_MAJOR_TYPE_VIDEO_ENCODED: + return mf_media_type_from_wg_format_video_encoded(format); } assert(0); @@ -608,6 +795,10 @@ static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *sub channel_mask = KSAUDIO_SPEAKER_MONO; else if (channels == 2) channel_mask = KSAUDIO_SPEAKER_STEREO; + else if (channels == 6) + channel_mask = KSAUDIO_SPEAKER_5POINT1; + else if (channels == 8) + channel_mask = KSAUDIO_SPEAKER_7POINT1; else { FIXME("Channel mask is not set.\n"); @@ -633,29 +824,14 @@ static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *sub static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, const GUID *subtype, struct wg_format *format) { - /* Audio specific config is stored at after HEAACWAVEINFO in MF_MT_USER_DATA - * https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-heaacwaveformat - */ - typedef struct - { - WORD wPayloadType; - WORD wAudioProfileLevelIndication; - WORD wStructType; - WORD wReserved1; - DWORD dwReserved2; - } HEAACWAVEINFO; - typedef struct - { - HEAACWAVEINFO wfInfo; - BYTE pbAudioSpecificConfig[1]; - } HEAACWAVEFORMAT; - - BYTE buffer[64]; - HEAACWAVEFORMAT *user_data = (HEAACWAVEFORMAT *)buffer; + BYTE buffer[sizeof(HEAACWAVEFORMAT) + 64]; + HEAACWAVEFORMAT *wfx = (HEAACWAVEFORMAT *)buffer; UINT32 codec_data_size; BOOL raw_aac; - if (FAILED(IMFMediaType_GetBlob(type, &MF_MT_USER_DATA, buffer, sizeof(buffer), &codec_data_size))) + wfx->wfInfo.wfx.cbSize = sizeof(buffer) - sizeof(wfx->wfInfo.wfx); + if (FAILED(IMFMediaType_GetBlob(type, &MF_MT_USER_DATA, (BYTE *)(&wfx->wfInfo.wfx + 1), + wfx->wfInfo.wfx.cbSize, &codec_data_size))) { FIXME("Codec data is not set.\n"); return; @@ -663,16 +839,16 @@ static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, const GUI raw_aac = IsEqualGUID(subtype, &MFAudioFormat_RAW_AAC); if (!raw_aac) - codec_data_size -= min(codec_data_size, offsetof(HEAACWAVEFORMAT, pbAudioSpecificConfig)); + codec_data_size -= min(codec_data_size, sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)); if (codec_data_size > sizeof(format->u.audio_mpeg4.codec_data)) { FIXME("Codec data needs %u bytes.\n", codec_data_size); return; } if (raw_aac) - memcpy(format->u.audio_mpeg4.codec_data, buffer, codec_data_size); + memcpy(format->u.audio_mpeg4.codec_data, (BYTE *)(&wfx->wfInfo.wfx + 1), codec_data_size); else - memcpy(format->u.audio_mpeg4.codec_data, user_data->pbAudioSpecificConfig, codec_data_size); + memcpy(format->u.audio_mpeg4.codec_data, wfx->pbAudioSpecificConfig, codec_data_size); format->major_type = WG_MAJOR_TYPE_AUDIO_MPEG4; @@ -682,6 +858,29 @@ static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, const GUI format->u.audio_mpeg4.codec_data_len = codec_data_size; } +static void mf_media_type_to_wg_format_audio_encoded(IMFMediaType *type, struct wg_format *format) +{ + UINT32 caps_len; + BYTE *caps; + HRESULT hr; + + memset(format, 0, sizeof(*format)); + format->major_type = WG_MAJOR_TYPE_AUDIO_ENCODED; + + if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &format->u.audio_encoded.rate))) + WARN("Failed to get MF_MT_AUDIO_SAMPLES_PER_SECOND for type %p, hr %#lx.\n", type, hr); + if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &format->u.audio_encoded.channels))) + WARN("Failed to get MF_MT_AUDIO_NUM_CHANNELS for type %p, hr %#lx.\n", type, hr); + + if (FAILED(hr = IMFMediaType_GetAllocatedBlob(type, &MF_MT_USER_DATA, &caps, &caps_len))) + WARN("Failed to get MF_MT_USER_DATA for type %p, hr %#lx.\n", type, hr); + else + { + strcpy(format->u.audio_encoded.caps, (char *)caps); + CoTaskMemFree(caps); + } +} + static enum wg_video_format mf_video_format_to_wg(const GUID *subtype) { unsigned int i; @@ -745,6 +944,7 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID { UINT32 rate, depth, channels, block_align, bytes_per_second, codec_data_len; BYTE codec_data[64]; + bool is_xma = false; UINT32 version; if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &rate))) @@ -786,6 +986,11 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID version = 3; else if (IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless)) version = 4; + else if (IsEqualGUID(subtype, &MFAudioFormat_XMAudio2)) + { + version = 2; + is_xma = true; + } else { assert(0); @@ -801,6 +1006,7 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID format->u.audio_wma.block_align = block_align; format->u.audio_wma.codec_data_len = codec_data_len; memcpy(format->u.audio_wma.codec_data, codec_data, codec_data_len); + format->u.audio_wma.is_xma = is_xma; } static void mf_media_type_to_wg_format_video_h264(IMFMediaType *type, struct wg_format *format) @@ -877,6 +1083,77 @@ static void mf_media_type_to_wg_format_video_indeo(IMFMediaType *type, uint32_t format->u.video_indeo.version = version; } +static void mf_media_type_to_wg_format_wmv(IMFMediaType *type, const GUID *subtype, struct wg_format *format) +{ + UINT64 frame_rate, frame_size; + + format->major_type = WG_MAJOR_TYPE_VIDEO_WMV; + format->u.video_wmv.width = 0; + format->u.video_wmv.height = 0; + format->u.video_wmv.fps_n = 1; + format->u.video_wmv.fps_d = 1; + + if (SUCCEEDED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) + { + format->u.video_wmv.width = (UINT32)(frame_size >> 32); + format->u.video_wmv.height = (UINT32)frame_size; + } + + if (SUCCEEDED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_RATE, &frame_rate)) && (UINT32)frame_rate) + { + format->u.video_wmv.fps_n = (UINT32)(frame_rate >> 32); + format->u.video_wmv.fps_d = (UINT32)frame_rate; + } + + if (IsEqualGUID(subtype, &MFVideoFormat_WMV1)) + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WMV1; + else if (IsEqualGUID(subtype, &MFVideoFormat_WMV2)) + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WMV2; + else if (IsEqualGUID(subtype, &MFVideoFormat_WMV3)) + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WMV3; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_WMVA)) + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WMVA; + else if (IsEqualGUID(subtype, &MFVideoFormat_WVC1)) + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WVC1; + else + format->u.video_wmv.format = WG_WMV_VIDEO_FORMAT_UNKNOWN; +} + +static void mf_media_type_to_wg_format_video_encoded(IMFMediaType *type, struct wg_format *format) +{ + UINT64 frame_rate, frame_size; + UINT32 caps_len; + HRESULT hr; + BYTE *caps; + + memset(format, 0, sizeof(*format)); + format->major_type = WG_MAJOR_TYPE_VIDEO_ENCODED; + + if (FAILED(hr = IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) + WARN("Failed to get MF_MT_FRAME_SIZE for type %p, hr %#lx.\n", type, hr); + else + { + format->u.video_encoded.width = frame_size >> 32; + format->u.video_encoded.height = (UINT32)frame_size; + } + + if (FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_RATE, &frame_rate)) && (UINT32)frame_rate) + WARN("Failed to get MF_MT_FRAME_RATE for type %p, hr %#lx.\n", type, hr); + else + { + format->u.video_encoded.fps_n = frame_rate >> 32; + format->u.video_encoded.fps_d = (UINT32)frame_rate; + } + + if (FAILED(hr = IMFMediaType_GetAllocatedBlob(type, &MF_MT_USER_DATA, &caps, &caps_len))) + WARN("Failed to get MF_MT_USER_DATA for type %p, hr %#lx.\n", type, hr); + else + { + strcpy(format->u.video_encoded.caps, (char *)caps); + CoTaskMemFree(caps); + } +} + void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format) { GUID major_type, subtype; @@ -899,10 +1176,13 @@ void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format) if (IsEqualGUID(&subtype, &MEDIASUBTYPE_MSAUDIO1) || IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV8) || IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV9) || - IsEqualGUID(&subtype, &MFAudioFormat_WMAudio_Lossless)) + IsEqualGUID(&subtype, &MFAudioFormat_WMAudio_Lossless) || + IsEqualGUID(&subtype, &MFAudioFormat_XMAudio2)) mf_media_type_to_wg_format_audio_wma(type, &subtype, format); else if (IsEqualGUID(&subtype, &MFAudioFormat_AAC) || IsEqualGUID(&subtype, &MFAudioFormat_RAW_AAC)) mf_media_type_to_wg_format_audio_mpeg4(type, &subtype, format); + else if (IsEqualGUID(&subtype, &MFAudioFormat_GStreamer)) + mf_media_type_to_wg_format_audio_encoded(type, format); else mf_media_type_to_wg_format_audio(type, &subtype, format); } @@ -912,6 +1192,18 @@ void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format) mf_media_type_to_wg_format_video_h264(type, format); else if (IsEqualGUID(&subtype, &MFVideoFormat_IV50)) mf_media_type_to_wg_format_video_indeo(type, 5, format); + else if (IsEqualGUID(&subtype, &MFVideoFormat_WMV1) + || IsEqualGUID(&subtype, &MFVideoFormat_WMV2) + || IsEqualGUID(&subtype, &MFVideoFormat_WMV3) + || IsEqualGUID(&subtype, &MEDIASUBTYPE_WMVP) + || IsEqualGUID(&subtype, &MEDIASUBTYPE_WVP2) + || IsEqualGUID(&subtype, &MEDIASUBTYPE_WMVR) + || IsEqualGUID(&subtype, &MEDIASUBTYPE_WMVA) + || IsEqualGUID(&subtype, &MFVideoFormat_WVC1) + || IsEqualGUID(&subtype, &MEDIASUBTYPE_VC1S)) + mf_media_type_to_wg_format_wmv(type, &subtype, format); + else if (IsEqualGUID(&subtype, &MFVideoFormat_GStreamer)) + mf_media_type_to_wg_format_video_encoded(type, format); else mf_media_type_to_wg_format_video(type, &subtype, format); } diff --git a/dlls/winegstreamer/new_media_source.c b/dlls/winegstreamer/new_media_source.c new file mode 100644 index 00000000000..efaf6a3e087 --- /dev/null +++ b/dlls/winegstreamer/new_media_source.c @@ -0,0 +1,2116 @@ +/* GStreamer Media Source + * + * Copyright 2020 Derek Lesho + * Copyright 2020 Zebediah Figura for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "gst_private.h" + +#include "mfapi.h" +#include "mferror.h" + +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mfplat); + +#define SOURCE_BUFFER_SIZE (32 * 1024) + +struct object_context +{ + IUnknown IUnknown_iface; + LONG refcount; + + IMFAsyncResult *result; + IMFByteStream *stream; + UINT64 file_size; + WCHAR *url; + + BYTE *buffer; + wg_source_t wg_source; + WCHAR mime_type[256]; + UINT32 stream_count; +}; + +static struct object_context *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct object_context, IUnknown_iface); +} + +static HRESULT WINAPI object_context_QueryInterface(IUnknown *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI object_context_AddRef(IUnknown *iface) +{ + struct object_context *context = impl_from_IUnknown(iface); + ULONG refcount = InterlockedIncrement(&context->refcount); + + TRACE("%p, refcount %lu.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI object_context_Release(IUnknown *iface) +{ + struct object_context *context = impl_from_IUnknown(iface); + ULONG refcount = InterlockedDecrement(&context->refcount); + + TRACE("%p, refcount %lu.\n", iface, refcount); + + if (!refcount) + { + if (context->wg_source) + wg_source_destroy(context->wg_source); + IMFAsyncResult_Release(context->result); + IMFByteStream_Release(context->stream); + free(context->buffer); + free(context->url); + free(context); + } + + return refcount; +} + +static const IUnknownVtbl object_context_vtbl = +{ + object_context_QueryInterface, + object_context_AddRef, + object_context_Release, +}; + +static WCHAR *byte_stream_get_url(IMFByteStream *stream, const WCHAR *url) +{ + IMFAttributes *attributes; + WCHAR buffer[MAX_PATH]; + UINT32 size; + HRESULT hr; + + if (SUCCEEDED(hr = IMFByteStream_QueryInterface(stream, &IID_IMFAttributes, (void **)&attributes))) + { + if (FAILED(hr = IMFAttributes_GetString(attributes, &MF_BYTESTREAM_ORIGIN_NAME, + buffer, ARRAY_SIZE(buffer), &size))) + WARN("Failed to get MF_BYTESTREAM_ORIGIN_NAME got size %#x, hr %#lx\n", size, hr); + else + url = buffer; + IMFAttributes_Release(attributes); + } + + return url ? wcsdup(url) : NULL; +} + +static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const WCHAR *url, + QWORD file_size, IMFAsyncResult *result, IUnknown **out, BYTE **out_buf) +{ + WCHAR *tmp_url = byte_stream_get_url(stream, url); + struct object_context *context; + + if (!(context = calloc(1, sizeof(*context))) + || !(context->buffer = malloc(SOURCE_BUFFER_SIZE))) + { + free(tmp_url); + free(context); + return E_OUTOFMEMORY; + } + + context->IUnknown_iface.lpVtbl = &object_context_vtbl; + context->refcount = 1; + context->stream = stream; + IMFByteStream_AddRef(context->stream); + context->file_size = file_size; + context->url = tmp_url; + context->result = result; + IMFAsyncResult_AddRef(context->result); + + *out = &context->IUnknown_iface; + *out_buf = context->buffer; + return S_OK; +} + +struct media_source_fallback_callback +{ + IMFAsyncCallback IMFAsyncCallback_iface; + IMFAsyncResult *result; + HANDLE event; +}; + +static HRESULT WINAPI media_source_fallback_callback_QueryInterface(IMFAsyncCallback *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFAsyncCallback_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI media_source_fallback_callback_AddRef(IMFAsyncCallback *iface) +{ + return 2; +} + +static ULONG WINAPI media_source_fallback_callback_Release(IMFAsyncCallback *iface) +{ + return 1; +} + +static HRESULT WINAPI media_source_fallback_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_fallback_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) +{ + struct media_source_fallback_callback *impl = CONTAINING_RECORD(iface, struct media_source_fallback_callback, IMFAsyncCallback_iface); + + IMFAsyncResult_AddRef((impl->result = result)); + SetEvent(impl->event); + + return S_OK; +} + +static const IMFAsyncCallbackVtbl media_source_fallback_callback_vtbl = +{ + media_source_fallback_callback_QueryInterface, + media_source_fallback_callback_AddRef, + media_source_fallback_callback_Release, + media_source_fallback_callback_GetParameters, + media_source_fallback_callback_Invoke, +}; + +static HRESULT create_media_source_fallback(struct object_context *context, IUnknown **object) +{ + static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; + struct media_source_fallback_callback callback = {{&media_source_fallback_callback_vtbl}}; + IMFByteStreamHandler *handler; + MF_OBJECT_TYPE type; + HRESULT hr; + + if (!(callback.event = CreateEventW(NULL, FALSE, FALSE, NULL))) + return HRESULT_FROM_WIN32(GetLastError()); + + if (FAILED(hr = CoCreateInstance(&CLSID_GStreamerByteStreamHandler, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFByteStreamHandler, (void **)&handler))) + { + CloseHandle(callback.event); + return hr; + } + + if (SUCCEEDED(hr = IMFByteStreamHandler_BeginCreateObject(handler, context->stream, NULL, MF_RESOLUTION_MEDIASOURCE, + NULL, NULL, &callback.IMFAsyncCallback_iface, NULL))) + { + WaitForSingleObject(callback.event, INFINITE); + hr = IMFByteStreamHandler_EndCreateObject(handler, callback.result, &type, object); + IMFAsyncResult_Release(callback.result); + } + + IMFByteStreamHandler_Release(handler); + CloseHandle(callback.event); + return hr; +} + +struct media_stream +{ + IMFMediaStream IMFMediaStream_iface; + LONG ref; + + IMFMediaSource *media_source; + IMFMediaEventQueue *event_queue; + IMFStreamDescriptor *descriptor; + + IUnknown **token_queue; + LONG token_queue_count; + LONG token_queue_cap; + + BOOL active; + BOOL eos; +}; + +enum source_async_op +{ + SOURCE_ASYNC_START, + SOURCE_ASYNC_PAUSE, + SOURCE_ASYNC_STOP, + SOURCE_ASYNC_REQUEST_SAMPLE, +}; + +struct source_async_command +{ + IUnknown IUnknown_iface; + LONG refcount; + enum source_async_op op; + union + { + struct + { + IMFPresentationDescriptor *descriptor; + GUID format; + PROPVARIANT position; + } start; + struct + { + struct media_stream *stream; + IUnknown *token; + } request_sample; + } u; +}; + +struct media_source +{ + IMFMediaSource IMFMediaSource_iface; + IMFGetService IMFGetService_iface; + IMFRateSupport IMFRateSupport_iface; + IMFRateControl IMFRateControl_iface; + IMFAsyncCallback async_commands_callback; + LONG ref; + DWORD async_commands_queue; + IMFMediaEventQueue *event_queue; + IMFByteStream *byte_stream; + + CRITICAL_SECTION cs; + + wg_source_t wg_source; + WCHAR mime_type[256]; + UINT64 file_size; + UINT64 duration; + BYTE *read_buffer; + + IMFStreamDescriptor **descriptors; + struct media_stream **streams; + ULONG stream_count; + UINT *stream_map; + + enum + { + SOURCE_OPENING, + SOURCE_STOPPED, + SOURCE_PAUSED, + SOURCE_RUNNING, + SOURCE_SHUTDOWN, + } state; + float rate; +}; + +static inline struct media_stream *impl_from_IMFMediaStream(IMFMediaStream *iface) +{ + return CONTAINING_RECORD(iface, struct media_stream, IMFMediaStream_iface); +} + +static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); +} + +static inline struct media_source *impl_from_IMFGetService(IMFGetService *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFGetService_iface); +} + +static inline struct media_source *impl_from_IMFRateSupport(IMFRateSupport *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFRateSupport_iface); +} + +static inline struct media_source *impl_from_IMFRateControl(IMFRateControl *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFRateControl_iface); +} + +static inline struct media_source *impl_from_async_commands_callback_IMFAsyncCallback(IMFAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, async_commands_callback); +} + +static inline struct source_async_command *impl_from_async_command_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct source_async_command, IUnknown_iface); +} + +static HRESULT WINAPI source_async_command_QueryInterface(IUnknown *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI source_async_command_AddRef(IUnknown *iface) +{ + struct source_async_command *command = impl_from_async_command_IUnknown(iface); + return InterlockedIncrement(&command->refcount); +} + +static ULONG WINAPI source_async_command_Release(IUnknown *iface) +{ + struct source_async_command *command = impl_from_async_command_IUnknown(iface); + ULONG refcount = InterlockedDecrement(&command->refcount); + + if (!refcount) + { + if (command->op == SOURCE_ASYNC_START) + { + IMFPresentationDescriptor_Release(command->u.start.descriptor); + PropVariantClear(&command->u.start.position); + } + else if (command->op == SOURCE_ASYNC_REQUEST_SAMPLE) + { + if (command->u.request_sample.token) + IUnknown_Release(command->u.request_sample.token); + } + free(command); + } + + return refcount; +} + +static const IUnknownVtbl source_async_command_vtbl = +{ + source_async_command_QueryInterface, + source_async_command_AddRef, + source_async_command_Release, +}; + +static HRESULT source_create_async_op(enum source_async_op op, IUnknown **out) +{ + struct source_async_command *command; + + if (!(command = calloc(1, sizeof(*command)))) + return E_OUTOFMEMORY; + + command->IUnknown_iface.lpVtbl = &source_async_command_vtbl; + command->refcount = 1; + command->op = op; + + *out = &command->IUnknown_iface; + return S_OK; +} + +static HRESULT WINAPI callback_QueryInterface(IMFAsyncCallback *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFAsyncCallback_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static HRESULT WINAPI callback_GetParameters(IMFAsyncCallback *iface, + DWORD *flags, DWORD *queue) +{ + return E_NOTIMPL; +} + +static ULONG WINAPI source_async_commands_callback_AddRef(IMFAsyncCallback *iface) +{ + struct media_source *source = impl_from_async_commands_callback_IMFAsyncCallback(iface); + return IMFMediaSource_AddRef(&source->IMFMediaSource_iface); +} + +static ULONG WINAPI source_async_commands_callback_Release(IMFAsyncCallback *iface) +{ + struct media_source *source = impl_from_async_commands_callback_IMFAsyncCallback(iface); + return IMFMediaSource_Release(&source->IMFMediaSource_iface); +} + +static HRESULT stream_descriptor_get_media_type(IMFStreamDescriptor *descriptor, IMFMediaType **media_type) +{ + IMFMediaTypeHandler *handler; + HRESULT hr; + + if (FAILED(hr = IMFStreamDescriptor_GetMediaTypeHandler(descriptor, &handler))) + return hr; + hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, media_type); + IMFMediaTypeHandler_Release(handler); + + return hr; +} + +static HRESULT stream_descriptor_get_major_type(IMFStreamDescriptor *descriptor, GUID *major) +{ + IMFMediaTypeHandler *handler; + HRESULT hr; + + if (FAILED(hr = IMFStreamDescriptor_GetMediaTypeHandler(descriptor, &handler))) + return hr; + hr = IMFMediaTypeHandler_GetMajorType(handler, major); + IMFMediaTypeHandler_Release(handler); + + return hr; +} + +static HRESULT wg_format_from_stream_descriptor(IMFStreamDescriptor *descriptor, struct wg_format *format) +{ + IMFMediaType *media_type; + HRESULT hr; + + if (FAILED(hr = stream_descriptor_get_media_type(descriptor, &media_type))) + return hr; + mf_media_type_to_wg_format(media_type, format); + IMFMediaType_Release(media_type); + + return hr; +} + +static HRESULT stream_descriptor_set_tag(IMFStreamDescriptor *descriptor, + wg_source_t source, UINT index, const GUID *attr, enum wg_parser_tag tag) +{ + WCHAR *strW; + HRESULT hr; + DWORD len; + char *str; + + if (!(str = wg_source_get_stream_tag(source, index, tag)) + || !(len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0))) + hr = S_OK; + else if (!(strW = malloc(len * sizeof(*strW)))) + hr = E_OUTOFMEMORY; + else + { + if (MultiByteToWideChar(CP_UTF8, 0, str, -1, strW, len)) + hr = IMFStreamDescriptor_SetString(descriptor, attr, strW); + else + hr = E_FAIL; + free(strW); + } + + free(str); + return hr; +} + +static HRESULT stream_descriptor_create(UINT32 id, struct wg_format *format, IMFStreamDescriptor **out) +{ + IMFStreamDescriptor *descriptor; + IMFMediaTypeHandler *handler; + IMFMediaType *type; + HRESULT hr; + + if (!(type = mf_media_type_from_wg_format(format))) + return MF_E_INVALIDMEDIATYPE; + if (FAILED(hr = MFCreateStreamDescriptor(id, 1, &type, &descriptor))) + goto done; + + if (FAILED(hr = IMFStreamDescriptor_GetMediaTypeHandler(descriptor, &handler))) + IMFStreamDescriptor_Release(descriptor); + else + { + hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, type); + IMFMediaTypeHandler_Release(handler); + } + +done: + IMFMediaType_Release(type); + *out = SUCCEEDED(hr) ? descriptor : NULL; + return hr; +} + +static BOOL enqueue_token(struct media_stream *stream, IUnknown *token) +{ + if (stream->token_queue_count == stream->token_queue_cap) + { + IUnknown **buf; + stream->token_queue_cap = stream->token_queue_cap * 2 + 1; + buf = realloc(stream->token_queue, stream->token_queue_cap * sizeof(*buf)); + if (buf) + stream->token_queue = buf; + else + { + stream->token_queue_cap = stream->token_queue_count; + return FALSE; + } + } + stream->token_queue[stream->token_queue_count++] = token; + return TRUE; +} + +static void flush_token_queue(struct media_stream *stream, BOOL send) +{ + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + LONG i; + + for (i = 0; i < stream->token_queue_count; i++) + { + if (send) + { + IUnknown *op; + HRESULT hr; + + if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_REQUEST_SAMPLE, &op))) + { + struct source_async_command *command = impl_from_async_command_IUnknown(op); + command->u.request_sample.stream = stream; + command->u.request_sample.token = stream->token_queue[i]; + + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, op); + IUnknown_Release(op); + } + if (FAILED(hr)) + WARN("Could not enqueue sample request, hr %#lx\n", hr); + } + else if (stream->token_queue[i]) + IUnknown_Release(stream->token_queue[i]); + } + free(stream->token_queue); + stream->token_queue = NULL; + stream->token_queue_count = 0; + stream->token_queue_cap = 0; +} + +static HRESULT media_stream_start(struct media_stream *stream, BOOL active, BOOL seeking, const PROPVARIANT *position) +{ + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + struct wg_format format; + HRESULT hr; + + TRACE("source %p, stream %p\n", source, stream); + + if (FAILED(hr = wg_format_from_stream_descriptor(stream->descriptor, &format))) + WARN("Failed to get wg_format from stream descriptor, hr %#lx\n", hr); + + if (FAILED(hr = IMFMediaEventQueue_QueueEventParamUnk(source->event_queue, active ? MEUpdatedStream : MENewStream, + &GUID_NULL, S_OK, (IUnknown *)&stream->IMFMediaStream_iface))) + WARN("Failed to send source stream event, hr %#lx\n", hr); + return IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, seeking ? MEStreamSeeked : MEStreamStarted, + &GUID_NULL, S_OK, position); +} + +static HRESULT media_source_start(struct media_source *source, IMFPresentationDescriptor *descriptor, + GUID *format, PROPVARIANT *position) +{ + BOOL starting = source->state == SOURCE_STOPPED, seek_message = !starting && position->vt != VT_EMPTY; + IMFStreamDescriptor **descriptors; + DWORD i, count; + HRESULT hr; + + TRACE("source %p, descriptor %p, format %s, position %s\n", source, descriptor, + debugstr_guid(format), wine_dbgstr_variant((VARIANT *)position)); + + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + + /* seek to beginning on stop->play */ + if (source->state == SOURCE_STOPPED && position->vt == VT_EMPTY) + { + position->vt = VT_I8; + position->hVal.QuadPart = 0; + } + + if (!(descriptors = calloc(source->stream_count, sizeof(*descriptors)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorCount(descriptor, &count))) + WARN("Failed to get presentation descriptor stream count, hr %#lx\n", hr); + + for (i = 0; i < count; i++) + { + IMFStreamDescriptor *stream_descriptor; + BOOL selected; + DWORD id; + + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(descriptor, i, + &selected, &stream_descriptor))) + WARN("Failed to get presentation stream descriptor, hr %#lx\n", hr); + else + { + if (FAILED(hr = IMFStreamDescriptor_GetStreamIdentifier(stream_descriptor, &id))) + WARN("Failed to get stream descriptor id, hr %#lx\n", hr); + else if (id > source->stream_count) + WARN("Invalid stream descriptor id %lu, hr %#lx\n", id, hr); + else if (selected) + IMFStreamDescriptor_AddRef((descriptors[id - 1] = stream_descriptor)); + + IMFStreamDescriptor_Release(stream_descriptor); + } + } + + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + BOOL was_active = !starting && stream->active; + + if (position->vt != VT_EMPTY) + stream->eos = FALSE; + + if (!(stream->active = !!descriptors[i])) + wg_source_set_stream_flags(source->wg_source, source->stream_map[i], FALSE); + else + { + if (FAILED(hr = media_stream_start(stream, was_active, seek_message, position))) + WARN("Failed to start media stream, hr %#lx\n", hr); + else + wg_source_set_stream_flags(source->wg_source, source->stream_map[i], TRUE); + IMFStreamDescriptor_Release(descriptors[i]); + } + } + + free(descriptors); + + source->state = SOURCE_RUNNING; + if (position->vt == VT_I8) + wg_source_set_position(source->wg_source, position->hVal.QuadPart); + + for (i = 0; i < source->stream_count; i++) + flush_token_queue(source->streams[i], position->vt == VT_EMPTY); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, + seek_message ? MESourceSeeked : MESourceStarted, &GUID_NULL, S_OK, position); +} + +static HRESULT media_source_pause(struct media_source *source) +{ + unsigned int i; + HRESULT hr; + + TRACE("source %p\n", source); + + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + if (stream->active && FAILED(hr = IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamPaused, + &GUID_NULL, S_OK, NULL))) + WARN("Failed to queue MEStreamPaused event, hr %#lx\n", hr); + } + + source->state = SOURCE_PAUSED; + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourcePaused, &GUID_NULL, S_OK, NULL); +} + +static HRESULT media_source_stop(struct media_source *source) +{ + unsigned int i; + HRESULT hr; + + TRACE("source %p\n", source); + + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + if (stream->active && FAILED(hr = IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamStopped, + &GUID_NULL, S_OK, NULL))) + WARN("Failed to queue MEStreamStopped event, hr %#lx\n", hr); + } + + source->state = SOURCE_STOPPED; + + for (i = 0; i < source->stream_count; i++) + flush_token_queue(source->streams[i], FALSE); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourceStopped, &GUID_NULL, S_OK, NULL); +} + +static HRESULT media_stream_send_eos(struct media_source *source, struct media_stream *stream) +{ + PROPVARIANT empty = {.vt = VT_EMPTY}; + HRESULT hr; + UINT i; + + TRACE("source %p, stream %p\n", source, stream); + + stream->eos = TRUE; + if (FAILED(hr = IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEEndOfStream, &GUID_NULL, S_OK, &empty))) + WARN("Failed to queue MEEndOfStream event, hr %#lx\n", hr); + + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + if (stream->active && !stream->eos) + return S_OK; + } + + if (FAILED(hr = IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MEEndOfPresentation, &GUID_NULL, S_OK, &empty))) + WARN("Failed to queue MEEndOfPresentation event, hr %#lx\n", hr); + return S_OK; +} + +static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) +{ + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + DWORD id, read_size; + UINT64 read_offset; + IMFSample *sample; + HRESULT hr; + + TRACE("%p, %p\n", stream, token); + + if (FAILED(hr = IMFStreamDescriptor_GetStreamIdentifier(stream->descriptor, &id))) + return hr; + id = source->stream_map[id - 1]; + + while (SUCCEEDED(hr) && (hr = wg_source_read_data(source->wg_source, id, &sample)) == E_PENDING) + { + if (FAILED(hr = wg_source_get_position(source->wg_source, &read_offset))) + break; + if (FAILED(hr = IMFByteStream_SetCurrentPosition(source->byte_stream, read_offset))) + WARN("Failed to seek stream to %#I64x, hr %#lx\n", read_offset, hr); + else if (FAILED(hr = IMFByteStream_Read(source->byte_stream, source->read_buffer, SOURCE_BUFFER_SIZE, &read_size))) + WARN("Failed to read %#lx bytes from stream, hr %#lx\n", read_size, hr); + else if (FAILED(hr = wg_source_push_data(source->wg_source, source->read_buffer, read_size))) + WARN("Failed to push %#lx bytes to source, hr %#lx\n", read_size, hr); + } + + if (FAILED(hr)) + WARN("Failed to read stream %lu data, hr %#lx\n", id, hr); + else + { + if (!token || SUCCEEDED(hr = IMFSample_SetUnknown(sample, &MFSampleExtension_Token, token))) + hr = IMFMediaEventQueue_QueueEventParamUnk(stream->event_queue, MEMediaSample, + &GUID_NULL, S_OK, (IUnknown *)sample); + IMFSample_Release(sample); + return hr; + } + + return media_stream_send_eos(source, stream); +} + +static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) +{ + struct media_source *source = impl_from_async_commands_callback_IMFAsyncCallback(iface); + struct source_async_command *command; + IUnknown *state; + HRESULT hr; + + if (FAILED(hr = IMFAsyncResult_GetState(result, &state))) + return hr; + + EnterCriticalSection(&source->cs); + + command = impl_from_async_command_IUnknown(state); + switch (command->op) + { + case SOURCE_ASYNC_START: + { + IMFPresentationDescriptor *descriptor = command->u.start.descriptor; + GUID format = command->u.start.format; + PROPVARIANT position = command->u.start.position; + + if (FAILED(hr = media_source_start(source, descriptor, &format, &position))) + WARN("Failed to start source %p, hr %#lx\n", source, hr); + break; + } + case SOURCE_ASYNC_PAUSE: + if (FAILED(hr = media_source_pause(source))) + WARN("Failed to pause source %p, hr %#lx\n", source, hr); + break; + case SOURCE_ASYNC_STOP: + if (FAILED(hr = media_source_stop(source))) + WARN("Failed to stop source %p, hr %#lx\n", source, hr); + break; + case SOURCE_ASYNC_REQUEST_SAMPLE: + if (source->state == SOURCE_PAUSED) + enqueue_token(command->u.request_sample.stream, command->u.request_sample.token); + else if (source->state == SOURCE_RUNNING) + { + if (FAILED(hr = wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token))) + WARN("Failed to request sample, hr %#lx\n", hr); + } + break; + } + + LeaveCriticalSection(&source->cs); + + IUnknown_Release(state); + + return S_OK; +} + +static const IMFAsyncCallbackVtbl source_async_commands_callback_vtbl = +{ + callback_QueryInterface, + source_async_commands_callback_AddRef, + source_async_commands_callback_Release, + callback_GetParameters, + source_async_commands_Invoke, +}; + +static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFMediaStream) || + IsEqualIID(riid, &IID_IMFMediaEventGenerator) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = &stream->IMFMediaStream_iface; + } + else + { + FIXME("(%s, %p)\n", debugstr_guid(riid), out); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*out); + return S_OK; +} + +static ULONG WINAPI media_stream_AddRef(IMFMediaStream *iface) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + ULONG ref = InterlockedIncrement(&stream->ref); + + TRACE("%p, refcount %lu.\n", iface, ref); + + return ref; +} + +static ULONG WINAPI media_stream_Release(IMFMediaStream *iface) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + ULONG ref = InterlockedDecrement(&stream->ref); + + TRACE("%p, refcount %lu.\n", iface, ref); + + if (!ref) + { + IMFMediaSource_Release(stream->media_source); + IMFStreamDescriptor_Release(stream->descriptor); + IMFMediaEventQueue_Release(stream->event_queue); + flush_token_queue(stream, FALSE); + free(stream); + } + + return ref; +} + +static HRESULT WINAPI media_stream_GetEvent(IMFMediaStream *iface, DWORD flags, IMFMediaEvent **event) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + + TRACE("%p, %#lx, %p.\n", iface, flags, event); + + return IMFMediaEventQueue_GetEvent(stream->event_queue, flags, event); +} + +static HRESULT WINAPI media_stream_BeginGetEvent(IMFMediaStream *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + + TRACE("%p, %p, %p.\n", iface, callback, state); + + return IMFMediaEventQueue_BeginGetEvent(stream->event_queue, callback, state); +} + +static HRESULT WINAPI media_stream_EndGetEvent(IMFMediaStream *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + + TRACE("%p, %p, %p.\n", stream, result, event); + + return IMFMediaEventQueue_EndGetEvent(stream->event_queue, result, event); +} + +static HRESULT WINAPI media_stream_QueueEvent(IMFMediaStream *iface, MediaEventType event_type, REFGUID ext_type, + HRESULT hr, const PROPVARIANT *value) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + + TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value); + + return IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, event_type, ext_type, hr, value); +} + +static HRESULT WINAPI media_stream_GetMediaSource(IMFMediaStream *iface, IMFMediaSource **out) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + HRESULT hr = S_OK; + + TRACE("%p, %p.\n", iface, out); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else + { + IMFMediaSource_AddRef(&source->IMFMediaSource_iface); + *out = &source->IMFMediaSource_iface; + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_stream_GetStreamDescriptor(IMFMediaStream* iface, IMFStreamDescriptor **descriptor) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + HRESULT hr = S_OK; + + TRACE("%p, %p.\n", iface, descriptor); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else + { + IMFStreamDescriptor_AddRef(stream->descriptor); + *descriptor = stream->descriptor; + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown *token) +{ + struct media_stream *stream = impl_from_IMFMediaStream(iface); + struct media_source *source = impl_from_IMFMediaSource(stream->media_source); + IUnknown *op; + HRESULT hr; + + TRACE("%p, %p.\n", iface, token); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (!stream->active) + hr = MF_E_MEDIA_SOURCE_WRONGSTATE; + else if (stream->eos) + hr = MF_E_END_OF_STREAM; + else if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_REQUEST_SAMPLE, &op))) + { + struct source_async_command *command = impl_from_async_command_IUnknown(op); + command->u.request_sample.stream = stream; + if (token) + IUnknown_AddRef(token); + command->u.request_sample.token = token; + + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, op); + IUnknown_Release(op); + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static const IMFMediaStreamVtbl media_stream_vtbl = +{ + media_stream_QueryInterface, + media_stream_AddRef, + media_stream_Release, + media_stream_GetEvent, + media_stream_BeginGetEvent, + media_stream_EndGetEvent, + media_stream_QueueEvent, + media_stream_GetMediaSource, + media_stream_GetStreamDescriptor, + media_stream_RequestSample +}; + +static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor *descriptor, struct media_stream **out) +{ + struct media_stream *object; + HRESULT hr; + + TRACE("source %p, descriptor %p.\n", source, descriptor); + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IMFMediaStream_iface.lpVtbl = &media_stream_vtbl; + object->ref = 1; + + if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) + { + free(object); + return hr; + } + + IMFMediaSource_AddRef(source); + object->media_source = source; + IMFStreamDescriptor_AddRef(descriptor); + object->descriptor = descriptor; + + TRACE("Created stream object %p.\n", object); + + *out = object; + return S_OK; +} + +static HRESULT WINAPI media_source_get_service_QueryInterface(IMFGetService *iface, REFIID riid, void **obj) +{ + struct media_source *source = impl_from_IMFGetService(iface); + return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj); +} + +static ULONG WINAPI media_source_get_service_AddRef(IMFGetService *iface) +{ + struct media_source *source = impl_from_IMFGetService(iface); + return IMFMediaSource_AddRef(&source->IMFMediaSource_iface); +} + +static ULONG WINAPI media_source_get_service_Release(IMFGetService *iface) +{ + struct media_source *source = impl_from_IMFGetService(iface); + return IMFMediaSource_Release(&source->IMFMediaSource_iface); +} + +static HRESULT WINAPI media_source_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj) +{ + struct media_source *source = impl_from_IMFGetService(iface); + + TRACE("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj); + + *obj = NULL; + + if (IsEqualGUID(service, &MF_RATE_CONTROL_SERVICE)) + { + if (IsEqualIID(riid, &IID_IMFRateSupport)) + { + *obj = &source->IMFRateSupport_iface; + } + else if (IsEqualIID(riid, &IID_IMFRateControl)) + { + *obj = &source->IMFRateControl_iface; + } + } + else + FIXME("Unsupported service %s.\n", debugstr_guid(service)); + + if (*obj) + IUnknown_AddRef((IUnknown *)*obj); + + return *obj ? S_OK : E_NOINTERFACE; +} + +static const IMFGetServiceVtbl media_source_get_service_vtbl = +{ + media_source_get_service_QueryInterface, + media_source_get_service_AddRef, + media_source_get_service_Release, + media_source_get_service_GetService, +}; + +static HRESULT WINAPI media_source_rate_support_QueryInterface(IMFRateSupport *iface, REFIID riid, void **obj) +{ + struct media_source *source = impl_from_IMFRateSupport(iface); + return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj); +} + +static ULONG WINAPI media_source_rate_support_AddRef(IMFRateSupport *iface) +{ + struct media_source *source = impl_from_IMFRateSupport(iface); + return IMFMediaSource_AddRef(&source->IMFMediaSource_iface); +} + +static ULONG WINAPI media_source_rate_support_Release(IMFRateSupport *iface) +{ + struct media_source *source = impl_from_IMFRateSupport(iface); + return IMFMediaSource_Release(&source->IMFMediaSource_iface); +} + +static HRESULT WINAPI media_source_rate_support_GetSlowestRate(IMFRateSupport *iface, MFRATE_DIRECTION direction, BOOL thin, float *rate) +{ + TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate); + + *rate = 0.0f; + + return S_OK; +} + +static HRESULT WINAPI media_source_rate_support_GetFastestRate(IMFRateSupport *iface, MFRATE_DIRECTION direction, BOOL thin, float *rate) +{ + TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate); + + *rate = direction == MFRATE_FORWARD ? 1e6f : -1e6f; + + return S_OK; +} + +static HRESULT WINAPI media_source_rate_support_IsRateSupported(IMFRateSupport *iface, BOOL thin, float rate, + float *nearest_rate) +{ + TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_rate); + + if (nearest_rate) + *nearest_rate = rate; + + return rate >= -1e6f && rate <= 1e6f ? S_OK : MF_E_UNSUPPORTED_RATE; +} + +static const IMFRateSupportVtbl media_source_rate_support_vtbl = +{ + media_source_rate_support_QueryInterface, + media_source_rate_support_AddRef, + media_source_rate_support_Release, + media_source_rate_support_GetSlowestRate, + media_source_rate_support_GetFastestRate, + media_source_rate_support_IsRateSupported, +}; + +static HRESULT WINAPI media_source_rate_control_QueryInterface(IMFRateControl *iface, REFIID riid, void **obj) +{ + struct media_source *source = impl_from_IMFRateControl(iface); + return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj); +} + +static ULONG WINAPI media_source_rate_control_AddRef(IMFRateControl *iface) +{ + struct media_source *source = impl_from_IMFRateControl(iface); + return IMFMediaSource_AddRef(&source->IMFMediaSource_iface); +} + +static ULONG WINAPI media_source_rate_control_Release(IMFRateControl *iface) +{ + struct media_source *source = impl_from_IMFRateControl(iface); + return IMFMediaSource_Release(&source->IMFMediaSource_iface); +} + +static HRESULT WINAPI media_source_rate_control_SetRate(IMFRateControl *iface, BOOL thin, float rate) +{ + struct media_source *source = impl_from_IMFRateControl(iface); + HRESULT hr; + + FIXME("%p, %d, %f.\n", iface, thin, rate); + + if (rate < 0.0f) + return MF_E_REVERSE_UNSUPPORTED; + + if (thin) + return MF_E_THINNING_UNSUPPORTED; + + if (FAILED(hr = IMFRateSupport_IsRateSupported(&source->IMFRateSupport_iface, thin, rate, NULL))) + return hr; + + EnterCriticalSection(&source->cs); + source->rate = rate; + LeaveCriticalSection(&source->cs); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourceRateChanged, &GUID_NULL, S_OK, NULL); +} + +static HRESULT WINAPI media_source_rate_control_GetRate(IMFRateControl *iface, BOOL *thin, float *rate) +{ + struct media_source *source = impl_from_IMFRateControl(iface); + + TRACE("%p, %p, %p.\n", iface, thin, rate); + + if (thin) + *thin = FALSE; + + EnterCriticalSection(&source->cs); + *rate = source->rate; + LeaveCriticalSection(&source->cs); + + return S_OK; +} + +static const IMFRateControlVtbl media_source_rate_control_vtbl = +{ + media_source_rate_control_QueryInterface, + media_source_rate_control_AddRef, + media_source_rate_control_Release, + media_source_rate_control_SetRate, + media_source_rate_control_GetRate, +}; + +static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFMediaSource) || + IsEqualIID(riid, &IID_IMFMediaEventGenerator) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = &source->IMFMediaSource_iface; + } + else if (IsEqualIID(riid, &IID_IMFGetService)) + { + *out = &source->IMFGetService_iface; + } + else + { + FIXME("%s, %p.\n", debugstr_guid(riid), out); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*out); + return S_OK; +} + +static ULONG WINAPI media_source_AddRef(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedIncrement(&source->ref); + + TRACE("%p, refcount %lu.\n", iface, ref); + + return ref; +} + +static ULONG WINAPI media_source_Release(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedDecrement(&source->ref); + + TRACE("%p, refcount %lu.\n", iface, ref); + + if (!ref) + { + IMFMediaSource_Shutdown(iface); + IMFMediaEventQueue_Release(source->event_queue); + IMFByteStream_Release(source->byte_stream); + wg_source_destroy(source->wg_source); + free(source->read_buffer); + source->cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&source->cs); + free(source); + } + + return ref; +} + +static HRESULT WINAPI media_source_GetEvent(IMFMediaSource *iface, DWORD flags, IMFMediaEvent **event) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p, %#lx, %p.\n", iface, flags, event); + + return IMFMediaEventQueue_GetEvent(source->event_queue, flags, event); +} + +static HRESULT WINAPI media_source_BeginGetEvent(IMFMediaSource *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p, %p, %p.\n", iface, callback, state); + + return IMFMediaEventQueue_BeginGetEvent(source->event_queue, callback, state); +} + +static HRESULT WINAPI media_source_EndGetEvent(IMFMediaSource *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p, %p, %p.\n", iface, result, event); + + return IMFMediaEventQueue_EndGetEvent(source->event_queue, result, event); +} + +static HRESULT WINAPI media_source_QueueEvent(IMFMediaSource *iface, MediaEventType event_type, REFGUID ext_type, + HRESULT hr, const PROPVARIANT *value) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, event_type, ext_type, hr, value); +} + +static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWORD *characteristics) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + HRESULT hr = S_OK; + + TRACE("%p, %p.\n", iface, characteristics); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else + *characteristics = MFMEDIASOURCE_CAN_SEEK | MFMEDIASOURCE_CAN_PAUSE; + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **descriptor) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + HRESULT hr; + UINT i; + + TRACE("%p, %p.\n", iface, descriptor); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (SUCCEEDED(hr = MFCreatePresentationDescriptor(source->stream_count, source->descriptors, descriptor))) + { + if (FAILED(hr = IMFPresentationDescriptor_SetString(*descriptor, &MF_PD_MIME_TYPE, source->mime_type))) + WARN("Failed to set presentation descriptor MF_PD_MIME_TYPE, hr %#lx\n", hr); + if (FAILED(hr = IMFPresentationDescriptor_SetUINT64(*descriptor, &MF_PD_TOTAL_FILE_SIZE, source->file_size))) + WARN("Failed to set presentation descriptor MF_PD_TOTAL_FILE_SIZE, hr %#lx\n", hr); + if (FAILED(hr = IMFPresentationDescriptor_SetUINT64(*descriptor, &MF_PD_DURATION, source->duration))) + WARN("Failed to set presentation descriptor MF_PD_DURATION, hr %#lx\n", hr); + + for (i = 0; i < source->stream_count; ++i) + { + if (!source->streams[i]->active) + continue; + if (FAILED(hr = IMFPresentationDescriptor_SelectStream(*descriptor, i))) + WARN("Failed to select stream %u, hr %#lx\n", i, hr); + } + + hr = S_OK; + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor, + const GUID *time_format, const PROPVARIANT *position) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + IUnknown *op; + HRESULT hr; + + TRACE("%p, %p, %p, %p.\n", iface, descriptor, time_format, position); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (!(IsEqualIID(time_format, &GUID_NULL))) + hr = MF_E_UNSUPPORTED_TIME_FORMAT; + else if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_START, &op))) + { + struct source_async_command *command = impl_from_async_command_IUnknown(op); + command->u.start.descriptor = descriptor; + IMFPresentationDescriptor_AddRef(descriptor); + command->u.start.format = *time_format; + PropVariantCopy(&command->u.start.position, position); + + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, op); + IUnknown_Release(op); + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + IUnknown *op; + HRESULT hr; + + TRACE("%p.\n", iface); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_STOP, &op))) + { + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, op); + IUnknown_Release(op); + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + IUnknown *op; + HRESULT hr; + + TRACE("%p.\n", iface); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (source->state != SOURCE_RUNNING) + hr = MF_E_INVALID_STATE_TRANSITION; + else if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_PAUSE, &op))) + { + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, op); + IUnknown_Release(op); + } + + LeaveCriticalSection(&source->cs); + + return S_OK; +} + +static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("%p.\n", iface); + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + { + LeaveCriticalSection(&source->cs); + return MF_E_SHUTDOWN; + } + + source->state = SOURCE_SHUTDOWN; + + IMFMediaEventQueue_Shutdown(source->event_queue); + IMFByteStream_Close(source->byte_stream); + + while (source->stream_count--) + { + struct media_stream *stream = source->streams[source->stream_count]; + IMFStreamDescriptor_Release(source->descriptors[source->stream_count]); + IMFMediaEventQueue_Shutdown(stream->event_queue); + IMFMediaStream_Release(&stream->IMFMediaStream_iface); + } + free(source->stream_map); + free(source->descriptors); + free(source->streams); + + LeaveCriticalSection(&source->cs); + + MFUnlockWorkQueue(source->async_commands_queue); + + return S_OK; +} + +static const IMFMediaSourceVtbl IMFMediaSource_vtbl = +{ + media_source_QueryInterface, + media_source_AddRef, + media_source_Release, + media_source_GetEvent, + media_source_BeginGetEvent, + media_source_EndGetEvent, + media_source_QueueEvent, + media_source_GetCharacteristics, + media_source_CreatePresentationDescriptor, + media_source_Start, + media_source_Stop, + media_source_Pause, + media_source_Shutdown, +}; + +static void media_source_init_stream_map(struct media_source *source, UINT stream_count) +{ + struct wg_format format; + int i, n = 0; + + if (wcscmp(source->mime_type, L"video/mp4")) + { + for (i = stream_count - 1; i >= 0; i--) + { + TRACE("mapping stream %u to wg_source stream %u\n", i, i); + source->stream_map[i] = i; + } + return; + } + + for (i = stream_count - 1; i >= 0; i--) + { + wg_source_get_stream_format(source->wg_source, i, &format); + if (format.major_type == WG_MAJOR_TYPE_UNKNOWN) continue; + if (format.major_type >= WG_MAJOR_TYPE_VIDEO) continue; + TRACE("mapping stream %u to wg_source stream %u\n", n, i); + source->stream_map[n++] = i; + } + for (i = stream_count - 1; i >= 0; i--) + { + wg_source_get_stream_format(source->wg_source, i, &format); + if (format.major_type == WG_MAJOR_TYPE_UNKNOWN) continue; + if (format.major_type < WG_MAJOR_TYPE_VIDEO) continue; + TRACE("mapping stream %u to wg_source stream %u\n", n, i); + source->stream_map[n++] = i; + } + for (i = stream_count - 1; i >= 0; i--) + { + wg_source_get_stream_format(source->wg_source, i, &format); + if (format.major_type != WG_MAJOR_TYPE_UNKNOWN) continue; + TRACE("mapping stream %u to wg_source stream %u\n", n, i); + source->stream_map[n++] = i; + } +} + +static void media_source_init_descriptors(struct media_source *source) +{ + UINT i, last_audio = -1, last_video = -1, first_audio = -1, first_video = -1; + HRESULT hr; + + for (i = 0; i < source->stream_count; i++) + { + IMFStreamDescriptor *descriptor = source->descriptors[i]; + GUID major = GUID_NULL; + UINT exclude = -1; + + if (FAILED(hr = stream_descriptor_get_major_type(descriptor, &major))) + WARN("Failed to get major type from stream descriptor, hr %#lx\n", hr); + + if (IsEqualGUID(&major, &MFMediaType_Audio)) + { + if (first_audio == -1) + first_audio = i; + exclude = last_audio; + last_audio = i; + } + else if (IsEqualGUID(&major, &MFMediaType_Video)) + { + if (first_video == -1) + first_video = i; + exclude = last_video; + last_video = i; + } + + if (exclude != -1) + { + if (FAILED(IMFStreamDescriptor_SetUINT32(source->descriptors[exclude], &MF_SD_MUTUALLY_EXCLUSIVE, 1))) + WARN("Failed to set stream %u MF_SD_MUTUALLY_EXCLUSIVE\n", exclude); + else if (FAILED(IMFStreamDescriptor_SetUINT32(descriptor, &MF_SD_MUTUALLY_EXCLUSIVE, 1))) + WARN("Failed to set stream %u MF_SD_MUTUALLY_EXCLUSIVE\n", i); + } + + if (FAILED(hr = stream_descriptor_set_tag(descriptor, source->wg_source, source->stream_map[i], + &MF_SD_LANGUAGE, WG_PARSER_TAG_LANGUAGE))) + WARN("Failed to set stream descriptor language, hr %#lx\n", hr); + if (FAILED(hr = stream_descriptor_set_tag(descriptor, source->wg_source, source->stream_map[i], + &MF_SD_STREAM_NAME, WG_PARSER_TAG_NAME))) + WARN("Failed to set stream descriptor name, hr %#lx\n", hr); + } + + if (!wcscmp(source->mime_type, L"video/mp4")) + { + if (last_audio != -1) + source->streams[last_audio]->active = TRUE; + if (last_video != -1) + source->streams[last_video]->active = TRUE; + } + else + { + if (first_audio != -1) + source->streams[first_audio]->active = TRUE; + if (first_video != -1) + source->streams[first_video]->active = TRUE; + } +} + +static HRESULT media_source_create(struct object_context *context, IMFMediaSource **out) +{ + UINT32 stream_count = context->stream_count; + struct media_source *object; + unsigned int i; + HRESULT hr; + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; + object->IMFGetService_iface.lpVtbl = &media_source_get_service_vtbl; + object->IMFRateSupport_iface.lpVtbl = &media_source_rate_support_vtbl; + object->IMFRateControl_iface.lpVtbl = &media_source_rate_control_vtbl; + object->async_commands_callback.lpVtbl = &source_async_commands_callback_vtbl; + object->ref = 1; + object->byte_stream = context->stream; + IMFByteStream_AddRef(context->stream); + wcscpy(object->mime_type, context->mime_type); + object->file_size = context->file_size; + object->rate = 1.0f; + InitializeCriticalSection(&object->cs); + object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs"); + + object->read_buffer = context->buffer; + context->buffer = NULL; + object->wg_source = context->wg_source; + context->wg_source = 0; + + if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) + goto fail; + if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue))) + goto fail; + if (FAILED(hr = wg_source_get_duration(object->wg_source, &object->duration))) + goto fail; + object->state = SOURCE_OPENING; + + if (!(object->descriptors = calloc(stream_count, sizeof(*object->descriptors))) + || !(object->stream_map = calloc(stream_count, sizeof(*object->stream_map))) + || !(object->streams = calloc(stream_count, sizeof(*object->streams)))) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + media_source_init_stream_map(object, stream_count); + + for (i = 0; i < stream_count; ++i) + { + IMFStreamDescriptor *descriptor; + struct media_stream *stream; + struct wg_format format; + + if (FAILED(hr = wg_source_get_stream_format(object->wg_source, object->stream_map[i], &format))) + goto fail; + if (FAILED(hr = stream_descriptor_create(i + 1, &format, &descriptor))) + goto fail; + if (FAILED(hr = media_stream_create(&object->IMFMediaSource_iface, descriptor, &stream))) + { + IMFStreamDescriptor_Release(descriptor); + goto fail; + } + + IMFStreamDescriptor_AddRef(descriptor); + object->descriptors[i] = descriptor; + object->streams[i] = stream; + object->stream_count++; + } + + media_source_init_descriptors(object); + object->state = SOURCE_STOPPED; + + *out = &object->IMFMediaSource_iface; + TRACE("Created IMFMediaSource %p\n", *out); + return S_OK; + +fail: + WARN("Failed to construct MFMediaSource, hr %#lx.\n", hr); + + while (object->streams && object->stream_count--) + { + struct media_stream *stream = object->streams[object->stream_count]; + IMFStreamDescriptor_Release(object->descriptors[object->stream_count]); + IMFMediaStream_Release(&stream->IMFMediaStream_iface); + } + free(object->stream_map); + free(object->descriptors); + free(object->streams); + + if (object->wg_source) + wg_source_destroy(object->wg_source); + if (object->async_commands_queue) + MFUnlockWorkQueue(object->async_commands_queue); + if (object->event_queue) + IMFMediaEventQueue_Release(object->event_queue); + IMFByteStream_Release(object->byte_stream); + free(object->read_buffer); + free(object); + + return hr; +} + +struct result_entry +{ + struct list entry; + IMFAsyncResult *result; + MF_OBJECT_TYPE type; + IUnknown *object; +}; + +static HRESULT result_entry_create(IMFAsyncResult *result, MF_OBJECT_TYPE type, + IUnknown *object, struct result_entry **out) +{ + struct result_entry *entry; + + if (!(entry = malloc(sizeof(*entry)))) + return E_OUTOFMEMORY; + + entry->result = result; + IMFAsyncResult_AddRef(entry->result); + entry->object = object; + IUnknown_AddRef(entry->object); + entry->type = type; + + *out = entry; + return S_OK; +} + +static void result_entry_destroy(struct result_entry *entry) +{ + IMFAsyncResult_Release(entry->result); + IUnknown_Release(entry->object); + free(entry); +} + +struct stream_handler +{ + IMFByteStreamHandler IMFByteStreamHandler_iface; + IMFAsyncCallback IMFAsyncCallback_iface; + LONG refcount; + struct list results; + CRITICAL_SECTION cs; +}; + +static struct result_entry *handler_find_result_entry(struct stream_handler *handler, IMFAsyncResult *result) +{ + struct result_entry *entry; + + EnterCriticalSection(&handler->cs); + LIST_FOR_EACH_ENTRY(entry, &handler->results, struct result_entry, entry) + { + if (result == entry->result) + { + list_remove(&entry->entry); + LeaveCriticalSection(&handler->cs); + return entry; + } + } + LeaveCriticalSection(&handler->cs); + + return NULL; +} + +static struct stream_handler *impl_from_IMFByteStreamHandler(IMFByteStreamHandler *iface) +{ + return CONTAINING_RECORD(iface, struct stream_handler, IMFByteStreamHandler_iface); +} + +static struct stream_handler *impl_from_IMFAsyncCallback(IMFAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct stream_handler, IMFAsyncCallback_iface); +} + +static HRESULT WINAPI stream_handler_QueryInterface(IMFByteStreamHandler *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFByteStreamHandler) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFByteStreamHandler_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI stream_handler_AddRef(IMFByteStreamHandler *iface) +{ + struct stream_handler *handler = impl_from_IMFByteStreamHandler(iface); + ULONG refcount = InterlockedIncrement(&handler->refcount); + + TRACE("%p, refcount %lu.\n", handler, refcount); + + return refcount; +} + +static ULONG WINAPI stream_handler_Release(IMFByteStreamHandler *iface) +{ + struct stream_handler *handler = impl_from_IMFByteStreamHandler(iface); + ULONG refcount = InterlockedDecrement(&handler->refcount); + struct result_entry *result, *next; + + TRACE("%p, refcount %lu.\n", iface, refcount); + + if (!refcount) + { + LIST_FOR_EACH_ENTRY_SAFE(result, next, &handler->results, struct result_entry, entry) + result_entry_destroy(result); + DeleteCriticalSection(&handler->cs); + free(handler); + } + + return refcount; +} + +static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *iface, IMFByteStream *stream, const WCHAR *url, DWORD flags, + IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback, IUnknown *state) +{ + struct stream_handler *handler = impl_from_IMFByteStreamHandler(iface); + IMFAsyncResult *result; + IUnknown *context; + QWORD file_size, position; + BYTE *buffer; + HRESULT hr; + DWORD caps; + + TRACE("%p, %s, %#lx, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state); + + if (cancel_cookie) + *cancel_cookie = NULL; + + if (!stream) + return E_INVALIDARG; + if (flags != MF_RESOLUTION_MEDIASOURCE) + FIXME("Unimplemented flags %#lx\n", flags); + + if (FAILED(hr = IMFByteStream_GetCapabilities(stream, &caps))) + return hr; + if (!(caps & MFBYTESTREAM_IS_SEEKABLE)) + { + FIXME("Non-seekable bytestreams not supported.\n"); + return MF_E_BYTESTREAM_NOT_SEEKABLE; + } + if (FAILED(hr = IMFByteStream_GetLength(stream, &file_size))) + { + FIXME("Failed to get byte stream length, hr %#lx.\n", hr); + return hr; + } + + if (FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) + return hr; + if (FAILED(hr = object_context_create(flags, stream, url, file_size, result, &context, &buffer))) + goto done; + + if (FAILED(hr = IMFByteStream_GetCurrentPosition(stream, &position))) + WARN("Failed to get byte stream position, hr %#lx\n", hr); + else if (position != 0 && FAILED(hr = IMFByteStream_SetCurrentPosition(stream, 0))) + WARN("Failed to set byte stream position, hr %#lx\n", hr); + else if (FAILED(hr = IMFByteStream_BeginRead(stream, buffer, min(SOURCE_BUFFER_SIZE, file_size), + &handler->IMFAsyncCallback_iface, context))) + WARN("Failed to queue byte stream async read, hr %#lx\n", hr); + IUnknown_Release(context); + + if (SUCCEEDED(hr) && cancel_cookie) + { + *cancel_cookie = (IUnknown *)result; + IUnknown_AddRef(*cancel_cookie); + } + +done: + IMFAsyncResult_Release(result); + + return hr; +} + +static HRESULT WINAPI stream_handler_EndCreateObject(IMFByteStreamHandler *iface, IMFAsyncResult *result, + MF_OBJECT_TYPE *type, IUnknown **object) +{ + struct stream_handler *handler = impl_from_IMFByteStreamHandler(iface); + struct result_entry *entry; + HRESULT hr; + + TRACE("%p, %p, %p, %p.\n", iface, result, type, object); + + if (!(entry = handler_find_result_entry(handler, result))) + { + *type = MF_OBJECT_INVALID; + *object = NULL; + return MF_E_UNEXPECTED; + } + + hr = IMFAsyncResult_GetStatus(entry->result); + *type = entry->type; + *object = entry->object; + IUnknown_AddRef(*object); + result_entry_destroy(entry); + return hr; +} + +static HRESULT WINAPI stream_handler_CancelObjectCreation(IMFByteStreamHandler *iface, IUnknown *cookie) +{ + struct stream_handler *handler = impl_from_IMFByteStreamHandler(iface); + IMFAsyncResult *result = (IMFAsyncResult *)cookie; + struct result_entry *entry; + + TRACE("%p, %p.\n", iface, cookie); + + if (!(entry = handler_find_result_entry(handler, result))) + return MF_E_UNEXPECTED; + + result_entry_destroy(entry); + return S_OK; +} + +static HRESULT WINAPI stream_handler_GetMaxNumberOfBytesRequiredForResolution(IMFByteStreamHandler *iface, QWORD *bytes) +{ + FIXME("stub (%p %p)\n", iface, bytes); + return E_NOTIMPL; +} + +static const IMFByteStreamHandlerVtbl stream_handler_vtbl = +{ + stream_handler_QueryInterface, + stream_handler_AddRef, + stream_handler_Release, + stream_handler_BeginCreateObject, + stream_handler_EndCreateObject, + stream_handler_CancelObjectCreation, + stream_handler_GetMaxNumberOfBytesRequiredForResolution, +}; + +static HRESULT WINAPI stream_handler_callback_QueryInterface(IMFAsyncCallback *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFAsyncCallback_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI stream_handler_callback_AddRef(IMFAsyncCallback *iface) +{ + struct stream_handler *handler = impl_from_IMFAsyncCallback(iface); + return IMFByteStreamHandler_AddRef(&handler->IMFByteStreamHandler_iface); +} + +static ULONG WINAPI stream_handler_callback_Release(IMFAsyncCallback *iface) +{ + struct stream_handler *handler = impl_from_IMFAsyncCallback(iface); + return IMFByteStreamHandler_Release(&handler->IMFByteStreamHandler_iface); +} + +static HRESULT WINAPI stream_handler_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI stream_handler_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) +{ + struct stream_handler *handler = impl_from_IMFAsyncCallback(iface); + IUnknown *object, *state = IMFAsyncResult_GetStateNoAddRef(result); + struct object_context *context; + struct result_entry *entry; + UINT64 read_offset; + DWORD size = 0; + HRESULT hr; + + if (!state || !(context = impl_from_IUnknown(state))) + return E_INVALIDARG; + + if (FAILED(hr = IMFByteStream_EndRead(context->stream, result, &size))) + WARN("Failed to complete stream read, hr %#lx\n", hr); + else if (!context->wg_source && FAILED(hr = wg_source_create(context->url, context->file_size, + context->buffer, size, context->mime_type, &context->wg_source))) + WARN("Failed to create wg_source, hr %#lx\n", hr); + else if (FAILED(hr = wg_source_push_data(context->wg_source, context->buffer, size))) + WARN("Failed to push wg_source data, hr %#lx\n", hr); + else if (FAILED(hr = wg_source_get_stream_count(context->wg_source, &context->stream_count))) + WARN("Failed to get wg_source status, hr %#lx\n", hr); + else if (!context->stream_count) + { + QWORD position, offset; + if (FAILED(hr = wg_source_get_position(context->wg_source, &read_offset))) + WARN("Failed to get wg_source position, hr %#lx\n", hr); + else if (FAILED(hr = IMFByteStream_GetCurrentPosition(context->stream, &position))) + WARN("Failed to get current byte stream position, hr %#lx\n", hr); + else if (position != (offset = min(read_offset, context->file_size)) + && FAILED(hr = IMFByteStream_SetCurrentPosition(context->stream, offset))) + WARN("Failed to set current byte stream position, hr %#lx\n", hr); + else + { + UINT32 read_size = min(SOURCE_BUFFER_SIZE, context->file_size - offset); + return IMFByteStream_BeginRead(context->stream, context->buffer, read_size, + &handler->IMFAsyncCallback_iface, state); + } + } + else if (FAILED(hr = media_source_create(context, (IMFMediaSource **)&object))) + WARN("Failed to create media source, hr %#lx\n", hr); + + if (FAILED(hr)) + { + FIXME("Falling back to old media source, hr %#lx\n", hr); + hr = create_media_source_fallback(context, (IUnknown **)&object); + } + + if (SUCCEEDED(hr)) + { + if (FAILED(hr = result_entry_create(context->result, MF_OBJECT_MEDIASOURCE, object, &entry))) + WARN("Failed to create handler result, hr %#lx\n", hr); + else + { + EnterCriticalSection(&handler->cs); + list_add_tail(&handler->results, &entry->entry); + LeaveCriticalSection(&handler->cs); + } + + IUnknown_Release(object); + } + + IMFAsyncResult_SetStatus(context->result, hr); + MFInvokeCallback(context->result); + + return S_OK; +} + +static const IMFAsyncCallbackVtbl stream_handler_callback_vtbl = +{ + stream_handler_callback_QueryInterface, + stream_handler_callback_AddRef, + stream_handler_callback_Release, + stream_handler_callback_GetParameters, + stream_handler_callback_Invoke, +}; + +HRESULT gstreamer_byte_stream_handler_2_create(REFIID riid, void **obj) +{ + struct stream_handler *handler; + HRESULT hr; + + TRACE("%s, %p.\n", debugstr_guid(riid), obj); + + if (!(handler = calloc(1, sizeof(*handler)))) + return E_OUTOFMEMORY; + + list_init(&handler->results); + InitializeCriticalSection(&handler->cs); + + handler->IMFByteStreamHandler_iface.lpVtbl = &stream_handler_vtbl; + handler->IMFAsyncCallback_iface.lpVtbl = &stream_handler_callback_vtbl; + handler->refcount = 1; + + hr = IMFByteStreamHandler_QueryInterface(&handler->IMFByteStreamHandler_iface, riid, obj); + IMFByteStreamHandler_Release(&handler->IMFByteStreamHandler_iface); + + return hr; +} diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 44e13d05c2a..569a7010ebb 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -29,6 +29,8 @@ #include "dvdmedia.h" #include "mmreg.h" #include "ks.h" +#include "mfapi.h" +#include "d3d9types.h" #include "wmcodecdsp.h" #include "initguid.h" #include "ksmedia.h" @@ -39,6 +41,8 @@ static const GUID MEDIASUBTYPE_CVID = {mmioFOURCC('c','v','i','d'), 0x0000, 0x00 static const GUID MEDIASUBTYPE_VC1S = {mmioFOURCC('V','C','1','S'), 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; static const GUID MEDIASUBTYPE_MP3 = {WAVE_FORMAT_MPEGLAYER3, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; static const GUID MEDIASUBTYPE_WMV_Unknown = {0x7ce12ca9, 0xbfbf, 0x43d9, {0x9d, 0x00, 0x82, 0xb8, 0xed, 0x54, 0x31, 0x6b}}; +static const GUID MEDIASUBTYPE_XMAUDIO2 = {0x0166, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; +extern const GUID MFVideoFormat_ABGR32; struct parser { @@ -299,6 +303,11 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form subtype = &MEDIASUBTYPE_WMAUDIO2; codec_data_len = WMAUDIO2_WFX_EXTRA_BYTES; fmt_tag = WAVE_FORMAT_WMAUDIO2; + if (format->u.audio_wma.is_xma) + { + subtype = &MEDIASUBTYPE_XMAUDIO2; + fmt_tag = 0x0166; + } break; case 3: subtype = &MEDIASUBTYPE_WMAUDIO3; @@ -348,6 +357,7 @@ static unsigned int wg_format_get_max_size_video_raw(enum wg_video_format format { case WG_VIDEO_FORMAT_BGRA: case WG_VIDEO_FORMAT_BGRx: + case WG_VIDEO_FORMAT_RGBA: case WG_VIDEO_FORMAT_AYUV: return width * height * 4; @@ -457,8 +467,10 @@ unsigned int wg_format_get_max_size(const struct wg_format *format) return format->u.audio_wma.rate * format->u.audio_wma.channels * format->u.audio_wma.depth / 8; case WG_MAJOR_TYPE_AUDIO_MPEG4: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_INDEO: + case WG_MAJOR_TYPE_VIDEO_ENCODED: FIXME("Format %u not implemented!\n", format->major_type); return 0; @@ -479,6 +491,7 @@ static const GUID *wg_video_format_get_mediasubtype(enum wg_video_format format) case WG_VIDEO_FORMAT_BGRA: return &MEDIASUBTYPE_ARGB32; case WG_VIDEO_FORMAT_BGRx: return &MEDIASUBTYPE_RGB32; case WG_VIDEO_FORMAT_BGR: return &MEDIASUBTYPE_RGB24; + case WG_VIDEO_FORMAT_RGBA: return &MFVideoFormat_ABGR32; case WG_VIDEO_FORMAT_RGB15: return &MEDIASUBTYPE_RGB555; case WG_VIDEO_FORMAT_RGB16: return &MEDIASUBTYPE_RGB565; case WG_VIDEO_FORMAT_AYUV: return &MEDIASUBTYPE_AYUV; @@ -502,6 +515,7 @@ static DWORD wg_video_format_get_compression(enum wg_video_format format) case WG_VIDEO_FORMAT_BGRA: return BI_RGB; case WG_VIDEO_FORMAT_BGRx: return BI_RGB; case WG_VIDEO_FORMAT_BGR: return BI_RGB; + case WG_VIDEO_FORMAT_RGBA: return BI_RGB; case WG_VIDEO_FORMAT_RGB15: return BI_RGB; case WG_VIDEO_FORMAT_RGB16: return BI_BITFIELDS; case WG_VIDEO_FORMAT_AYUV: return mmioFOURCC('A','Y','U','V'); @@ -525,6 +539,7 @@ static WORD wg_video_format_get_depth(enum wg_video_format format) case WG_VIDEO_FORMAT_BGRA: return 32; case WG_VIDEO_FORMAT_BGRx: return 32; case WG_VIDEO_FORMAT_BGR: return 24; + case WG_VIDEO_FORMAT_RGBA: return 32; case WG_VIDEO_FORMAT_RGB15: return 16; case WG_VIDEO_FORMAT_RGB16: return 16; case WG_VIDEO_FORMAT_AYUV: return 32; @@ -716,8 +731,10 @@ bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool switch (format->major_type) { case WG_MAJOR_TYPE_AUDIO_MPEG4: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_INDEO: + case WG_MAJOR_TYPE_VIDEO_ENCODED: FIXME("Format %u not implemented!\n", format->major_type); /* fallthrough */ case WG_MAJOR_TYPE_UNKNOWN: @@ -862,7 +879,8 @@ static bool amt_to_wg_format_audio_mpeg1_layer3(const AM_MEDIA_TYPE *mt, struct return true; } -static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format *format) +static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format *format, + bool is_xma) { const WAVEFORMATEX *audio_format = (const WAVEFORMATEX *)mt->pbFormat; @@ -888,6 +906,7 @@ static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format else assert(false); format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + format->u.audio_wma.is_xma = is_xma; format->u.audio_wma.bitrate = audio_format->nAvgBytesPerSec * 8; format->u.audio_wma.rate = audio_format->nSamplesPerSec; format->u.audio_wma.depth = audio_format->wBitsPerSample; @@ -923,6 +942,7 @@ static bool amt_to_wg_format_video(const AM_MEDIA_TYPE *mt, struct wg_format *fo {&MEDIASUBTYPE_ARGB32, WG_VIDEO_FORMAT_BGRA}, {&MEDIASUBTYPE_RGB32, WG_VIDEO_FORMAT_BGRx}, {&MEDIASUBTYPE_RGB24, WG_VIDEO_FORMAT_BGR}, + {&MFVideoFormat_ABGR32, WG_VIDEO_FORMAT_RGBA}, {&MEDIASUBTYPE_RGB555, WG_VIDEO_FORMAT_RGB15}, {&MEDIASUBTYPE_RGB565, WG_VIDEO_FORMAT_RGB16}, {&MEDIASUBTYPE_AYUV, WG_VIDEO_FORMAT_AYUV}, @@ -1067,7 +1087,9 @@ bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO2) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO3) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO_LOSSLESS)) - return amt_to_wg_format_audio_wma(mt, format); + return amt_to_wg_format_audio_wma(mt, format, false); + if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_XMAUDIO2)) + return amt_to_wg_format_audio_wma(mt, format, true); return amt_to_wg_format_audio(mt, format); } @@ -1424,7 +1446,7 @@ static HRESULT parser_init_stream(struct strmbase_filter *iface) { ret = amt_to_wg_format(&source->pin.pin.mt, &format); assert(ret); - wg_parser_stream_enable(source->wg_stream, &format); + wg_parser_stream_enable(source->wg_stream, &format, STREAM_ENABLE_FLAG_FLIP_RGB); } else { @@ -1527,7 +1549,7 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons filter->sink_connected = true; filter->read_thread = CreateThread(NULL, 0, read_thread, filter, 0, NULL); - if (FAILED(hr = wg_parser_connect(filter->wg_parser, file_size))) + if (FAILED(hr = wg_parser_connect(filter->wg_parser, file_size, NULL))) goto err; if (!filter->init_gst(filter)) @@ -1575,10 +1597,18 @@ static BOOL decodebin_parser_filter_init_gst(struct parser *filter) unsigned int i, stream_count; WCHAR source_name[20]; + const char *sgi = getenv("SteamGameId"); + const WCHAR *format; + + /* King of Fighters XIII requests the WMV decoder filter pins by name + * to connect them to a Sample Grabber filter. + */ + format = (sgi && !strcmp(sgi, "222940")) ? L"out%u" : L"Stream %02u"; + stream_count = wg_parser_get_stream_count(parser); for (i = 0; i < stream_count; ++i) { - swprintf(source_name, ARRAY_SIZE(source_name), L"Stream %02u", i); + swprintf(source_name, ARRAY_SIZE(source_name), format, i); if (!create_pin(filter, wg_parser_get_stream(parser, i), source_name)) return FALSE; } @@ -1657,7 +1687,7 @@ static HRESULT parser_create(enum wg_parser_type type, BOOL output_compressed, s if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; - if (!(object->wg_parser = wg_parser_create(type, output_compressed))) + if (!(object->wg_parser = wg_parser_create(type, output_compressed, FALSE))) { free(object); return E_OUTOFMEMORY; diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index bb2cb864735..a165b8f1cfe 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -26,6 +26,11 @@ #include #include +#include +#include +#include +#include + /* unixlib.c */ GST_DEBUG_CATEGORY_EXTERN(wine); @@ -52,6 +57,20 @@ extern void wg_format_from_caps(struct wg_format *format, const GstCaps *caps); extern bool wg_format_compare(const struct wg_format *a, const struct wg_format *b); extern GstCaps *wg_format_to_caps(const struct wg_format *format); +/* wg_source.c */ + +extern NTSTATUS wg_source_create(void *args); +extern NTSTATUS wg_source_destroy(void *args); +extern NTSTATUS wg_source_get_stream_count(void *args); +extern NTSTATUS wg_source_get_duration(void *args); +extern NTSTATUS wg_source_get_position(void *args); +extern NTSTATUS wg_source_set_position(void *args); +extern NTSTATUS wg_source_push_data(void *args); +extern NTSTATUS wg_source_read_data(void *args); +extern NTSTATUS wg_source_get_stream_format(void *args); +extern NTSTATUS wg_source_get_stream_tag(void *args); +extern NTSTATUS wg_source_set_stream_flags(void *args); + /* wg_transform.c */ extern NTSTATUS wg_transform_create(void *args); @@ -74,6 +93,10 @@ extern NTSTATUS wg_muxer_push_sample(void *args); extern NTSTATUS wg_muxer_read_data(void *args); extern NTSTATUS wg_muxer_finalize(void *args); +/* wg_task_pool.c */ + +extern GstTaskPool *wg_task_pool_new(void); + /* wg_allocator.c */ static inline BYTE *wg_sample_data(struct wg_sample *sample) @@ -89,4 +112,34 @@ extern void wg_allocator_provide_sample(GstAllocator *allocator, struct wg_sampl extern void wg_allocator_release_sample(GstAllocator *allocator, struct wg_sample *sample, bool discard_data); +static inline void touch_h264_used_tag(void) +{ + const char *e; + + GST_LOG("h264 is used"); + + if ((e = getenv("STEAM_COMPAT_SHADER_PATH"))) + { + char buffer[PATH_MAX]; + int fd; + + snprintf(buffer, sizeof(buffer), "%s/h264-used", e); + + fd = open(buffer, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (fd == -1) + { + GST_WARNING("Failed to open/create \"%s/h264-used\"", e); + return; + } + + futimens(fd, NULL); + + close(fd); + } + else + { + GST_WARNING("STEAM_COMPAT_SHADER_PATH not set, cannot create h264-used file"); + } +} + #endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */ diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index db9d1eb114f..881566339eb 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -28,10 +28,9 @@ #include #include +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_30 #include -#include -#include -#include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -47,6 +46,10 @@ GST_DEBUG_CATEGORY(wine); +extern bool media_converter_init(void); + +GstGLDisplay *gl_display; + GstStreamType stream_type_from_caps(GstCaps *caps) { const gchar *media_type; @@ -246,6 +249,9 @@ bool push_event(GstPad *pad, GstEvent *event) NTSTATUS wg_init_gstreamer(void *arg) { + struct wg_init_gstreamer_params *params = arg; + static GstGLContext *gl_context; + char arg0[] = "wine"; char arg1[] = "--gst-disable-registry-fork"; char *args[] = {arg0, arg1, NULL}; @@ -253,6 +259,38 @@ NTSTATUS wg_init_gstreamer(void *arg) char **argv = args; GError *err; + const char *e; + + if ((e = getenv("WINE_GST_REGISTRY_DIR"))) + { + char gst_reg[PATH_MAX]; +#if defined(__x86_64__) + const char *arch = "/registry.x86_64.bin"; +#elif defined(__i386__) + const char *arch = "/registry.i386.bin"; +#else +#error Bad arch +#endif + strcpy(gst_reg, e); + strcat(gst_reg, arch); + setenv("GST_REGISTRY_1_0", gst_reg, 1); + } + + if (params->trace_on) + setenv("GST_DEBUG", "WINE:9,protonmediaconverter:9,4", FALSE); + if (params->warn_on) + setenv("GST_DEBUG", "WINE:3,protonmediaconverter:3,3", FALSE); + if (params->err_on) + setenv("GST_DEBUG", "WINE:1,protonmediaconverter:1,1", FALSE); + setenv("GST_DEBUG_NO_COLOR", "1", FALSE); + + /* GStreamer installs a temporary SEGV handler when it loads plugins + * to initialize its registry calling exit(-1) when any fault is caught. + * We need to make sure any signal reaches our signal handlers to catch + * and handle them, or eventually propagate the exceptions to the user. + */ + gst_segtrap_set_enabled(false); + if (!gst_init_check(&argc, &argv, &err)) { fprintf(stderr, "winegstreamer: failed to initialize GStreamer: %s\n", err->message); @@ -264,5 +302,35 @@ NTSTATUS wg_init_gstreamer(void *arg) GST_INFO("GStreamer library version %s; wine built with %d.%d.%d.", gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO); + + if (!(gl_display = gst_gl_display_new())) + GST_ERROR("Failed to create OpenGL display"); + else + { + GError *error = NULL; + gboolean ret; + + GST_OBJECT_LOCK(gl_display); + ret = gst_gl_display_create_context(gl_display, NULL, &gl_context, &error); + GST_OBJECT_UNLOCK(gl_display); + g_clear_error(&error); + + if (ret) + gst_gl_display_add_context(gl_display, gl_context); + else + { + GST_ERROR("Failed to create OpenGL context"); + gst_object_unref(gl_display); + gl_display = NULL; + } + } + + if (!media_converter_init()) + { + GST_ERROR("Failed to init media converter."); + gst_object_unref(gl_display); + return STATUS_UNSUCCESSFUL; + } + return STATUS_SUCCESS; } diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 516fc19b4e3..fe21a24f6f5 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -37,12 +37,14 @@ enum wg_major_type WG_MAJOR_TYPE_AUDIO_MPEG1, WG_MAJOR_TYPE_AUDIO_MPEG4, WG_MAJOR_TYPE_AUDIO_WMA, + WG_MAJOR_TYPE_AUDIO_ENCODED, WG_MAJOR_TYPE_VIDEO, WG_MAJOR_TYPE_VIDEO_CINEPAK, WG_MAJOR_TYPE_VIDEO_H264, WG_MAJOR_TYPE_VIDEO_WMV, WG_MAJOR_TYPE_VIDEO_INDEO, WG_MAJOR_TYPE_VIDEO_MPEG1, + WG_MAJOR_TYPE_VIDEO_ENCODED, }; typedef UINT32 wg_audio_format; @@ -66,6 +68,7 @@ enum wg_video_format WG_VIDEO_FORMAT_BGRA, WG_VIDEO_FORMAT_BGRx, WG_VIDEO_FORMAT_BGR, + WG_VIDEO_FORMAT_RGBA, WG_VIDEO_FORMAT_RGB15, WG_VIDEO_FORMAT_RGB16, @@ -125,7 +128,14 @@ struct wg_format uint32_t block_align; uint32_t codec_data_len; unsigned char codec_data[64]; + UINT8 is_xma; } audio_wma; + struct + { + uint32_t channels; + uint32_t rate; + char caps[512]; + } audio_encoded; struct { @@ -171,6 +181,12 @@ struct wg_format int32_t width, height; uint32_t fps_n, fps_d; } video_mpeg1; + struct + { + int32_t width, height; + uint32_t fps_n, fps_d; + char caps[512]; + } video_encoded; } u; }; @@ -211,18 +227,28 @@ enum wg_parser_type WG_PARSER_DECODEBIN, WG_PARSER_AVIDEMUX, WG_PARSER_WAVPARSE, + WG_PARSER_URIDECODEBIN, }; typedef UINT64 wg_parser_t; typedef UINT64 wg_parser_stream_t; +typedef UINT64 wg_source_t; typedef UINT64 wg_transform_t; typedef UINT64 wg_muxer_t; +struct wg_init_gstreamer_params +{ + UINT8 trace_on; + UINT8 warn_on; + UINT8 err_on; +}; + struct wg_parser_create_params { wg_parser_t parser; wg_parser_type type; UINT8 output_compressed; + UINT8 use_opengl; UINT8 err_on; UINT8 warn_on; }; @@ -230,6 +256,7 @@ struct wg_parser_create_params struct wg_parser_connect_params { wg_parser_t parser; + const WCHAR *uri; UINT64 file_size; }; @@ -272,10 +299,13 @@ struct wg_parser_stream_get_codec_format_params struct wg_format *format; }; +#define STREAM_ENABLE_FLAG_FLIP_RGB 0x1 + struct wg_parser_stream_enable_params { wg_parser_stream_t stream; const struct wg_format *format; + uint32_t flags; }; struct wg_parser_stream_get_buffer_params @@ -332,10 +362,82 @@ struct wg_parser_stream_seek_params DWORD start_flags, stop_flags; }; +struct wg_source_create_params +{ + const char *url; + UINT64 file_size; + const void *data; + UINT32 size; + char mime_type[256]; + wg_source_t source; +}; + +struct wg_source_get_stream_count_params +{ + wg_source_t source; + UINT32 stream_count; +}; + +struct wg_source_get_duration_params +{ + wg_source_t source; + UINT64 duration; +}; + +struct wg_source_get_position_params +{ + wg_source_t source; + UINT64 read_offset; +}; + +struct wg_source_set_position_params +{ + wg_source_t source; + UINT64 time; +}; + +struct wg_source_push_data_params +{ + wg_source_t source; + const void *data; + UINT32 size; +}; + +struct wg_source_read_data_params +{ + wg_source_t source; + UINT32 index; + struct wg_sample *sample; +}; + +struct wg_source_get_stream_format_params +{ + wg_source_t source; + UINT32 index; + struct wg_format format; +}; + +struct wg_source_get_stream_tag_params +{ + wg_source_t source; + UINT32 index; + wg_parser_tag tag; + UINT32 size; + char *buffer; +}; + +struct wg_source_set_stream_flags_params +{ + wg_source_t source; + UINT32 index; + UINT32 select; +}; + struct wg_transform_attrs { UINT32 output_plane_align; UINT32 input_queue_length; + BOOL allow_size_change; BOOL low_latency; }; @@ -441,6 +543,18 @@ enum unix_funcs unix_wg_parser_stream_get_tag, unix_wg_parser_stream_seek, + unix_wg_source_create, + unix_wg_source_destroy, + unix_wg_source_get_stream_count, + unix_wg_source_get_duration, + unix_wg_source_get_position, + unix_wg_source_set_position, + unix_wg_source_push_data, + unix_wg_source_read_data, + unix_wg_source_get_stream_format, + unix_wg_source_get_stream_tag, + unix_wg_source_set_stream_flags, + unix_wg_transform_create, unix_wg_transform_destroy, unix_wg_transform_set_output_format, diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 2faab78faf2..44e5c4821f2 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -27,25 +27,25 @@ #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(mfplat); +#include "initguid.h" + +#include "codecapi.h" -DEFINE_MEDIATYPE_GUID(MFVideoFormat_IV50, MAKEFOURCC('I','V','5','0')); +WINE_DEFAULT_DEBUG_CHANNEL(mfplat); +WINE_DECLARE_DEBUG_CHANNEL(winediag); -static const GUID *const input_types[] = +extern GUID MFVideoFormat_GStreamer; +static const GUID *const video_decoder_input_types[] = { - &MFVideoFormat_IV50, + &MFVideoFormat_GStreamer, }; -static const GUID *const output_types[] = +static const GUID *const video_decoder_output_types[] = { + &MFVideoFormat_NV12, &MFVideoFormat_YV12, + &MFVideoFormat_IYUV, + &MFVideoFormat_I420, &MFVideoFormat_YUY2, - &MFVideoFormat_NV11, - &MFVideoFormat_NV12, - &MFVideoFormat_RGB32, - &MFVideoFormat_RGB24, - &MFVideoFormat_RGB565, - &MFVideoFormat_RGB555, - &MFVideoFormat_RGB8, }; struct video_decoder @@ -53,12 +53,28 @@ struct video_decoder IMFTransform IMFTransform_iface; LONG refcount; + IMFAttributes *attributes; + IMFAttributes *output_attributes; + + UINT input_type_count; + const GUID *const *input_types; + UINT output_type_count; + const GUID *const *output_types; + + UINT64 sample_time; IMFMediaType *input_type; + MFT_INPUT_STREAM_INFO input_info; IMFMediaType *output_type; + MFT_OUTPUT_STREAM_INFO output_info; + IMFMediaType *stream_type; - struct wg_format wg_format; wg_transform_t wg_transform; struct wg_sample_queue *wg_sample_queue; + + IMFVideoSampleAllocatorEx *allocator; + BOOL allocator_initialized; + IMFTransform *copier; + IMFMediaBuffer *temp_buffer; }; static struct video_decoder *impl_from_IMFTransform(IMFTransform *iface) @@ -68,9 +84,20 @@ static struct video_decoder *impl_from_IMFTransform(IMFTransform *iface) static HRESULT try_create_wg_transform(struct video_decoder *decoder) { - struct wg_transform_attrs attrs = {0}; + /* Call of Duty: Black Ops 3 doesn't care about the ProcessInput/ProcessOutput + * return values, it calls them in a specific order and expects the decoder + * transform to be able to queue its input buffers. We need to use a buffer list + * to match its expectations. + */ + struct wg_transform_attrs attrs = + { + .output_plane_align = 15, + .input_queue_length = 15, + .allow_size_change = TRUE, + }; struct wg_format input_format; struct wg_format output_format; + UINT32 low_latency; if (decoder->wg_transform) wg_transform_destroy(decoder->wg_transform); @@ -84,8 +111,14 @@ static HRESULT try_create_wg_transform(struct video_decoder *decoder) if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN) return MF_E_INVALIDMEDIATYPE; - output_format.u.video.fps_d = 0; - output_format.u.video.fps_n = 0; + if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency))) + attrs.low_latency = !!low_latency; + + { + const char *sgi; + if ((sgi = getenv("SteamGameId")) && (!strcmp(sgi, "2009100") || !strcmp(sgi, "2555360") || !strcmp(sgi, "1630110"))) + attrs.low_latency = FALSE; + } if (!(decoder->wg_transform = wg_transform_create(&input_format, &output_format, &attrs))) { @@ -96,6 +129,105 @@ static HRESULT try_create_wg_transform(struct video_decoder *decoder) return S_OK; } +static HRESULT create_output_media_type(struct video_decoder *decoder, const GUID *subtype, + IMFMediaType **media_type) +{ + IMFMediaType *default_type = decoder->output_type; + IMFVideoMediaType *video_type; + UINT32 value, width, height; + MFVideoArea aperture; + UINT64 ratio; + HRESULT hr; + + if (FAILED(hr = MFCreateVideoMediaTypeFromSubtype(subtype, &video_type))) + return hr; + + if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &ratio))) + ratio = (UINT64)1920 << 32 | 1080; + if (FAILED(hr = IMFVideoMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, ratio))) + goto done; + width = ratio >> 32; + height = ratio; + + if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_RATE, &ratio))) + ratio = (UINT64)30000 << 32 | 1001; + if (FAILED(hr = IMFVideoMediaType_SetUINT64(video_type, &MF_MT_FRAME_RATE, ratio))) + goto done; + + if (FAILED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_PIXEL_ASPECT_RATIO, &ratio))) + ratio = (UINT64)1 << 32 | 1; + if (FAILED(hr = IMFVideoMediaType_SetUINT64(video_type, &MF_MT_PIXEL_ASPECT_RATIO, ratio))) + goto done; + + if (FAILED(hr = MFCalculateImageSize(subtype, width, height, &value))) + goto done; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_SAMPLE_SIZE, value))) + goto done; + + if (FAILED(hr = MFGetStrideForBitmapInfoHeader(subtype->Data1, width, (LONG *)&value))) + goto done; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_DEFAULT_STRIDE, value))) + goto done; + + if (!default_type || FAILED(IMFMediaType_GetUINT32(default_type, &MF_MT_INTERLACE_MODE, &value))) + value = MFVideoInterlace_MixedInterlaceOrProgressive; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_INTERLACE_MODE, value))) + goto done; + + if (!default_type || FAILED(IMFMediaType_GetUINT32(default_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value))) + value = 1; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, value))) + goto done; + + if (!default_type || FAILED(IMFMediaType_GetUINT32(default_type, &MF_MT_VIDEO_ROTATION, &value))) + value = 0; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_VIDEO_ROTATION, value))) + goto done; + + if (!default_type || FAILED(IMFMediaType_GetUINT32(default_type, &MF_MT_FIXED_SIZE_SAMPLES, &value))) + value = 1; + if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_FIXED_SIZE_SAMPLES, value))) + goto done; + + if (SUCCEEDED(IMFMediaType_GetBlob(decoder->stream_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, + (BYTE *)&aperture, sizeof(aperture), &value))) + { + if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, + (BYTE *)&aperture, sizeof(aperture)))) + goto done; + } + + IMFMediaType_AddRef((*media_type = (IMFMediaType *)video_type)); +done: + IMFVideoMediaType_Release(video_type); + return hr; +} + +static HRESULT init_allocator(struct video_decoder *decoder) +{ + HRESULT hr; + + if (decoder->allocator_initialized) + return S_OK; + + if (FAILED(hr = IMFTransform_SetInputType(decoder->copier, 0, decoder->output_type, 0))) + return hr; + if (FAILED(hr = IMFTransform_SetOutputType(decoder->copier, 0, decoder->output_type, 0))) + return hr; + + if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(decoder->allocator, 10, 10, + decoder->attributes, decoder->output_type))) + return hr; + decoder->allocator_initialized = TRUE; + return S_OK; +} + +static void uninit_allocator(struct video_decoder *decoder) +{ + IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(decoder->allocator); + decoder->allocator_initialized = FALSE; +} + static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) { struct video_decoder *decoder = impl_from_IMFTransform(iface); @@ -135,13 +267,20 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) if (!refcount) { + IMFTransform_Release(decoder->copier); + IMFVideoSampleAllocatorEx_Release(decoder->allocator); + if (decoder->temp_buffer) + IMFMediaBuffer_Release(decoder->temp_buffer); if (decoder->wg_transform) wg_transform_destroy(decoder->wg_transform); if (decoder->input_type) IMFMediaType_Release(decoder->input_type); if (decoder->output_type) IMFMediaType_Release(decoder->output_type); - + if (decoder->output_attributes) + IMFAttributes_Release(decoder->output_attributes); + if (decoder->attributes) + IMFAttributes_Release(decoder->attributes); wg_sample_queue_destroy(decoder->wg_sample_queue); free(decoder); } @@ -152,79 +291,119 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) static HRESULT WINAPI transform_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, DWORD *input_maximum, DWORD *output_minimum, DWORD *output_maximum) { - FIXME("iface %p, input_minimum %p, input_maximum %p, output_minimum %p, output_maximum %p.\n", + TRACE("iface %p, input_minimum %p, input_maximum %p, output_minimum %p, output_maximum %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum); - return E_NOTIMPL; + *input_minimum = *input_maximum = *output_minimum = *output_maximum = 1; + return S_OK; } static HRESULT WINAPI transform_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs) { - FIXME("iface %p, inputs %p, outputs %p.\n", iface, inputs, outputs); - return E_NOTIMPL; + TRACE("iface %p, inputs %p, outputs %p.\n", iface, inputs, outputs); + *inputs = *outputs = 1; + return S_OK; } static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs, DWORD output_size, DWORD *outputs) { - FIXME("iface %p, input_size %lu, inputs %p, output_size %lu, outputs %p.\n", - iface, input_size, inputs, output_size, outputs); + TRACE("iface %p, input_size %lu, inputs %p, output_size %lu, outputs %p.\n", iface, + input_size, inputs, output_size, outputs); return E_NOTIMPL; } static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info) { - FIXME("iface %p, id %#lx, info %p.\n", iface, id, info); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); + + *info = decoder->input_info; + return S_OK; } static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info) { - FIXME("iface %p, id %#lx, info %p.\n", iface, id, info); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); + + *info = decoder->output_info; + return S_OK; } static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) { + struct video_decoder *decoder = impl_from_IMFTransform(iface); + FIXME("iface %p, attributes %p semi-stub!\n", iface, attributes); - return E_NOTIMPL; + + if (!attributes) + return E_POINTER; + + IMFAttributes_AddRef((*attributes = decoder->attributes)); + return S_OK; } static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) { - FIXME("iface %p, id %#lx, attributes %p.\n", iface, id, attributes); + TRACE("iface %p, id %#lx, attributes %p.\n", iface, id, attributes); return E_NOTIMPL; } static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) { - FIXME("iface %p, id %#lx, attributes %p stub!\n", iface, id, attributes); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + FIXME("iface %p, id %#lx, attributes %p semi-stub!\n", iface, id, attributes); + + if (!attributes) + return E_POINTER; + if (id) + return MF_E_INVALIDSTREAMNUMBER; + + IMFAttributes_AddRef((*attributes = decoder->output_attributes)); + return S_OK; } static HRESULT WINAPI transform_DeleteInputStream(IMFTransform *iface, DWORD id) { - FIXME("iface %p, id %#lx.\n", iface, id); + TRACE("iface %p, id %#lx.\n", iface, id); return E_NOTIMPL; } static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids) { - FIXME("iface %p, streams %lu, ids %p.\n", iface, streams, ids); + TRACE("iface %p, streams %lu, ids %p.\n", iface, streams, ids); return E_NOTIMPL; } static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - FIXME("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + + *type = NULL; + if (index >= decoder->input_type_count) + return MF_E_NO_MORE_TYPES; + return MFCreateVideoMediaTypeFromSubtype(decoder->input_types[index], (IMFVideoMediaType **)type); } static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - FIXME("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + + *type = NULL; + if (!decoder->input_type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + if (index >= decoder->output_type_count) + return MF_E_NO_MORE_TYPES; + return create_output_media_type(decoder, decoder->output_types[index], type); } static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) @@ -244,16 +423,11 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (!IsEqualGUID(&major, &MFMediaType_Video)) return MF_E_INVALIDMEDIATYPE; - for (i = 0; i < ARRAY_SIZE(input_types); ++i) - if (IsEqualGUID(&subtype, input_types[i])) + for (i = 0; i < decoder->input_type_count; ++i) + if (IsEqualGUID(&subtype, decoder->input_types[i])) break; - if (i == ARRAY_SIZE(input_types)) + if (i == decoder->input_type_count) return MF_E_INVALIDMEDIATYPE; - - if (FAILED(hr = IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size)) || - (frame_size >> 32) == 0 || (UINT32)frame_size == 0) - return MF_E_INVALIDMEDIATYPE; - if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; @@ -267,15 +441,21 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM IMFMediaType_Release(decoder->input_type); IMFMediaType_AddRef((decoder->input_type = type)); + if (SUCCEEDED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) + { + if (FAILED(hr = IMFMediaType_SetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, frame_size))) + WARN("Failed to update stream type frame size, hr %#lx\n", hr); + MFCalculateImageSize(decoder->output_types[0], frame_size >> 32, frame_size, (UINT32 *)&decoder->output_info.cbSize); + } + return S_OK; } static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct video_decoder *decoder = impl_from_IMFTransform(iface); + UINT64 frame_size, stream_frame_size; GUID major, subtype; - UINT64 frame_size; - struct wg_format output_format; HRESULT hr; ULONG i; @@ -291,15 +471,17 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (!IsEqualGUID(&major, &MFMediaType_Video)) return MF_E_INVALIDMEDIATYPE; - for (i = 0; i < ARRAY_SIZE(output_types); ++i) - if (IsEqualGUID(&subtype, output_types[i])) + for (i = 0; i < decoder->output_type_count; ++i) + if (IsEqualGUID(&subtype, decoder->output_types[i])) break; - if (i == ARRAY_SIZE(output_types)) + if (i == decoder->output_type_count) return MF_E_INVALIDMEDIATYPE; if (FAILED(hr = IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size))) - return hr; - + return MF_E_INVALIDMEDIATYPE; + if (SUCCEEDED(IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &stream_frame_size)) + && frame_size != stream_frame_size) + return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; @@ -309,13 +491,11 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (decoder->wg_transform) { + struct wg_format output_format; mf_media_type_to_wg_format(decoder->output_type, &output_format); - output_format.u.video.fps_d = 0; - output_format.u.video.fps_n = 0; - if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN - || !wg_transform_set_output_format(decoder->wg_transform, &output_format)) + || !wg_transform_set_output_format(decoder->wg_transform, &output_format)) { IMFMediaType_Release(decoder->output_type); decoder->output_type = NULL; @@ -326,31 +506,54 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF { IMFMediaType_Release(decoder->output_type); decoder->output_type = NULL; - return hr; } - decoder->wg_format.u.video.width = frame_size >> 32; - decoder->wg_format.u.video.height = (UINT32)frame_size; - return hr; } static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) { - FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, id %#lx, type %p\n", iface, id, type); + + if (!decoder->input_type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + return IMFMediaType_CopyAllItems(decoder->input_type, (IMFAttributes *)*type); } static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) { - FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, id %#lx, type %p\n", iface, id, type); + + if (!decoder->output_type) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + return IMFMediaType_CopyAllItems(decoder->output_type, (IMFAttributes *)*type); } static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) { - FIXME("iface %p, id %#lx, flags %p stub!\n", iface, id, flags); - return E_NOTIMPL; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags); + + if (!decoder->wg_transform) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + *flags = MFT_INPUT_STATUS_ACCEPT_DATA; + return S_OK; } static HRESULT WINAPI transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) @@ -373,23 +576,105 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("iface %p, message %#x, param %Ix stub!\n", iface, message, param); - return S_OK; + struct video_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); + + switch (message) + { + case MFT_MESSAGE_SET_D3D_MANAGER: + if (FAILED(hr = IMFVideoSampleAllocatorEx_SetDirectXManager(decoder->allocator, (IUnknown *)param))) + return hr; + + uninit_allocator(decoder); + if (param) + decoder->output_info.dwFlags |= MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; + else + decoder->output_info.dwFlags &= ~MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; + return S_OK; + + case MFT_MESSAGE_COMMAND_DRAIN: + return wg_transform_drain(decoder->wg_transform); + + case MFT_MESSAGE_COMMAND_FLUSH: + return wg_transform_flush(decoder->wg_transform); + + case MFT_MESSAGE_NOTIFY_START_OF_STREAM: + decoder->sample_time = 0; + return S_OK; + + default: + FIXME("Ignoring message %#x.\n", message); + return S_OK; + } } static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct video_decoder *decoder = impl_from_IMFTransform(iface); - HRESULT hr; TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - hr = wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); + return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); +} - return hr; +static HRESULT output_sample(struct video_decoder *decoder, IMFSample **out, IMFSample *src_sample) +{ + MFT_OUTPUT_DATA_BUFFER output[1]; + IMFSample *sample; + DWORD status; + HRESULT hr; + + if (FAILED(hr = init_allocator(decoder))) + { + ERR("Failed to initialize allocator, hr %#lx.\n", hr); + return hr; + } + if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(decoder->allocator, &sample))) + return hr; + + if (FAILED(hr = IMFTransform_ProcessInput(decoder->copier, 0, src_sample, 0))) + { + IMFSample_Release(sample); + return hr; + } + output[0].pSample = sample; + if (FAILED(hr = IMFTransform_ProcessOutput(decoder->copier, 0, 1, output, &status))) + { + IMFSample_Release(sample); + return hr; + } + *out = sample; + return S_OK; +} + +static HRESULT handle_stream_type_change(struct video_decoder *decoder, const struct wg_format *format) +{ + UINT64 frame_size, frame_rate; + GUID subtype; + HRESULT hr; + + if (decoder->stream_type) + IMFMediaType_Release(decoder->stream_type); + if (!(decoder->stream_type = mf_media_type_from_wg_format(format))) + return E_OUTOFMEMORY; + + if (SUCCEEDED(IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_RATE, &frame_rate)) + && FAILED(hr = IMFMediaType_SetUINT64(decoder->stream_type, &MF_MT_FRAME_RATE, frame_rate))) + WARN("Failed to update stream type frame size, hr %#lx\n", hr); + + if (FAILED(hr = IMFMediaType_GetUINT64(decoder->stream_type, &MF_MT_FRAME_SIZE, &frame_size))) + return hr; + if (FAILED(hr = IMFMediaType_GetGUID(decoder->stream_type, &MF_MT_SUBTYPE, &subtype))) + return hr; + MFCalculateImageSize(&subtype, frame_size >> 32, frame_size, (UINT32 *)&decoder->output_info.cbSize); + uninit_allocator(decoder); + + return MF_E_TRANSFORM_STREAM_CHANGE; } static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, @@ -398,8 +683,11 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, struct video_decoder *decoder = impl_from_IMFTransform(iface); struct wg_format wg_format; UINT32 sample_size; - UINT64 frame_rate; + LONGLONG duration; + IMFSample *sample; + UINT64 frame_size, frame_rate; GUID subtype; + DWORD size; HRESULT hr; TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); @@ -411,36 +699,65 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_TRANSFORM_TYPE_NOT_SET; *status = samples->dwStatus = 0; - if (!samples->pSample) + if (!(sample = samples->pSample) && !(decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES)) return E_INVALIDARG; if (FAILED(hr = IMFMediaType_GetGUID(decoder->output_type, &MF_MT_SUBTYPE, &subtype))) return hr; - if (FAILED(hr = MFCalculateImageSize(&subtype, decoder->wg_format.u.video.width, - decoder->wg_format.u.video.height, &sample_size))) + if (FAILED(hr = IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_SIZE, &frame_size))) + return hr; + if (FAILED(hr = MFCalculateImageSize(&subtype, frame_size >> 32, (UINT32)frame_size, &sample_size))) return hr; - if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, samples->pSample, - sample_size, &wg_format, &samples->dwStatus))) - wg_sample_queue_flush(decoder->wg_sample_queue, false); - - if (hr == MF_E_TRANSFORM_STREAM_CHANGE) + if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) { - decoder->wg_format = wg_format; - - if (FAILED(hr = MFCalculateImageSize(&subtype, decoder->wg_format.u.video.width, - decoder->wg_format.u.video.height, &sample_size))) + if (decoder->temp_buffer) + { + if (FAILED(IMFMediaBuffer_GetMaxLength(decoder->temp_buffer, &size)) || size < sample_size) + { + IMFMediaBuffer_Release(decoder->temp_buffer); + decoder->temp_buffer = NULL; + } + } + if (!decoder->temp_buffer && FAILED(hr = MFCreateMemoryBuffer(sample_size, &decoder->temp_buffer))) return hr; - - /* keep the frame rate that was requested, GStreamer doesn't provide any */ - if (SUCCEEDED(IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_RATE, &frame_rate))) + if (FAILED(hr = MFCreateSample(&sample))) + return hr; + if (FAILED(hr = IMFSample_AddBuffer(sample, decoder->temp_buffer))) { - decoder->wg_format.u.video.fps_n = frame_rate >> 32; - decoder->wg_format.u.video.fps_d = (UINT32)frame_rate; + IMFSample_Release(sample); + return hr; } + } + if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, sample, + sample_size, &wg_format, &samples->dwStatus))) + { + wg_sample_queue_flush(decoder->wg_sample_queue, false); + + if (FAILED(IMFMediaType_GetUINT64(decoder->input_type, &MF_MT_FRAME_RATE, &frame_rate))) + frame_rate = (UINT64)30000 << 32 | 1001; + + duration = (UINT64)10000000 * (UINT32)frame_rate / (frame_rate >> 32); + if (FAILED(IMFSample_SetSampleTime(sample, decoder->sample_time))) + WARN("Failed to set sample time\n"); + if (FAILED(IMFSample_SetSampleDuration(sample, duration))) + WARN("Failed to set sample duration\n"); + decoder->sample_time += duration; + } + + if (hr == MF_E_TRANSFORM_STREAM_CHANGE) + { samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; + hr = handle_stream_type_change(decoder, &wg_format); + } + + if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) + { + if (hr == S_OK && FAILED(hr = output_sample(decoder, &samples->pSample, sample))) + ERR("Failed to output sample, hr %#lx.\n", hr); + IMFSample_Release(sample); } return hr; @@ -476,33 +793,158 @@ static const IMFTransformVtbl transform_vtbl = transform_ProcessOutput, }; -HRESULT WINAPI winegstreamer_create_video_decoder(IMFTransform **out) +static HRESULT video_decoder_create_with_types(const GUID *const *input_types, UINT input_type_count, + const GUID *const *output_types, UINT output_type_count, IMFTransform **ret) { struct video_decoder *decoder; HRESULT hr; - TRACE("out %p.\n", out); - - if (!init_gstreamer()) - return E_FAIL; - if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; decoder->IMFTransform_iface.lpVtbl = &transform_vtbl; decoder->refcount = 1; - decoder->wg_format.u.video.fps_d = 1; - decoder->wg_format.u.video.fps_n = 1; + decoder->input_type_count = input_type_count; + decoder->input_types = input_types; + decoder->output_type_count = output_type_count; + decoder->output_types = output_types; + + decoder->input_info.dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER + | MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE; + decoder->input_info.cbSize = 0x1000; + decoder->output_info.dwFlags = MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER + | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE; + decoder->output_info.cbSize = 1920 * 1088 * 2; + if (FAILED(hr = MFCreateMediaType(&decoder->stream_type))) + goto failed; + if (FAILED(hr = MFCreateAttributes(&decoder->attributes, 16))) + goto failed; + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_LOW_LATENCY, 0))) + goto failed; + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, TRUE))) + goto failed; + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &AVDecVideoAcceleration_H264, TRUE))) + goto failed; + + { + const char *sgi; + if ((sgi = getenv("SteamGameId")) && ((!strcmp(sgi, "2073850")) || (!strcmp(sgi, "2009100")) || (!strcmp(sgi, "2555360")))) + IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, FALSE); + } + + if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) + goto failed; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) goto failed; + if (FAILED(hr = MFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&decoder->allocator))) + goto failed; + if (FAILED(hr = MFCreateSampleCopierMFT(&decoder->copier))) + goto failed; - *out = &decoder->IMFTransform_iface; - TRACE("created decoder %p.\n", *out); + *ret = &decoder->IMFTransform_iface; + TRACE("Created decoder %p\n", *ret); return S_OK; failed: + if (decoder->allocator) + IMFVideoSampleAllocatorEx_Release(decoder->allocator); + if (decoder->wg_sample_queue) + wg_sample_queue_destroy(decoder->wg_sample_queue); + if (decoder->output_attributes) + IMFAttributes_Release(decoder->output_attributes); + if (decoder->attributes) + IMFAttributes_Release(decoder->attributes); + if (decoder->stream_type) + IMFMediaType_Release(decoder->stream_type); free(decoder); return hr; } + +HRESULT video_decoder_create(REFIID riid, void **out) +{ + IMFTransform *iface; + HRESULT hr; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (FAILED(hr = video_decoder_create_with_types(video_decoder_input_types, ARRAY_SIZE(video_decoder_input_types), + video_decoder_output_types, ARRAY_SIZE(video_decoder_output_types), &iface))) + return hr; + + hr = IMFTransform_QueryInterface(iface, riid, out); + IMFTransform_Release(iface); + return hr; +} + +static const GUID *const h264_decoder_input_types[] = +{ + &MFVideoFormat_H264, + &MFVideoFormat_H264_ES, +}; + +HRESULT h264_decoder_create(REFIID riid, void **out) +{ + static const struct wg_format output_format = + { + .major_type = WG_MAJOR_TYPE_VIDEO, + .u.video = + { + .format = WG_VIDEO_FORMAT_I420, + .width = 1920, + .height = 1080, + }, + }; + static const struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_VIDEO_H264}; + struct wg_transform_attrs attrs = {0}; + wg_transform_t transform; + IMFTransform *iface; + HRESULT hr; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(transform = wg_transform_create(&input_format, &output_format, &attrs))) + { + ERR_(winediag)("GStreamer doesn't support H.264 decoding, please install appropriate plugins\n"); + return E_FAIL; + } + wg_transform_destroy(transform); + + if (FAILED(hr = video_decoder_create_with_types(h264_decoder_input_types, ARRAY_SIZE(h264_decoder_input_types), + video_decoder_output_types, ARRAY_SIZE(video_decoder_output_types), &iface))) + return hr; + + hr = IMFTransform_QueryInterface(iface, riid, out); + IMFTransform_Release(iface); + return hr; +} + +extern GUID MFVideoFormat_IV50; +static const GUID *const iv50_decoder_input_types[] = +{ + &MFVideoFormat_IV50, +}; +static const GUID *const iv50_decoder_output_types[] = +{ + &MFVideoFormat_YV12, + &MFVideoFormat_YUY2, + &MFVideoFormat_NV11, + &MFVideoFormat_NV12, + &MFVideoFormat_RGB32, + &MFVideoFormat_RGB24, + &MFVideoFormat_RGB565, + &MFVideoFormat_RGB555, + &MFVideoFormat_RGB8, +}; + +HRESULT WINAPI winegstreamer_create_video_decoder(IMFTransform **out) +{ + TRACE("out %p.\n", out); + + if (!init_gstreamer()) + return E_FAIL; + + return video_decoder_create_with_types(iv50_decoder_input_types, ARRAY_SIZE(iv50_decoder_input_types), + iv50_decoder_output_types, ARRAY_SIZE(iv50_decoder_output_types), out); +} diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 3075bf997d2..1cbb37dafc7 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -102,6 +102,13 @@ static HRESULT try_create_wg_transform(struct video_processor *impl) if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN) return MF_E_INVALIDMEDIATYPE; + /* prevent fps differences from failing to connect the elements */ + if (output_format.u.video.fps_d || output_format.u.video.fps_n) + { + input_format.u.video.fps_d = output_format.u.video.fps_d; + input_format.u.video.fps_n = output_format.u.video.fps_n; + } + if (!(impl->wg_transform = wg_transform_create(&input_format, &output_format, &attrs))) return E_FAIL; diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index 6da97685736..6a1e6ac15b4 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -141,6 +141,8 @@ static enum wg_video_format wg_video_format_from_gst(GstVideoFormat format) return WG_VIDEO_FORMAT_BGRx; case GST_VIDEO_FORMAT_BGR: return WG_VIDEO_FORMAT_BGR; + case GST_VIDEO_FORMAT_RGBA: + return WG_VIDEO_FORMAT_RGBA; case GST_VIDEO_FORMAT_RGB15: return WG_VIDEO_FORMAT_RGB15; case GST_VIDEO_FORMAT_RGB16: @@ -265,6 +267,25 @@ static void wg_format_from_caps_audio_wma(struct wg_format *format, const GstCap gst_buffer_unmap(codec_data, &map); } +static void wg_format_from_caps_audio_encoded(struct wg_format *format, const GstCaps *caps, + const GstAudioInfo *info) +{ + gchar *str; + gint len; + + format->major_type = WG_MAJOR_TYPE_AUDIO_ENCODED; + format->u.audio_encoded.rate = info->rate; + format->u.audio_encoded.channels = info->channels; + + str = gst_caps_to_string(caps); + len = strlen(str) + 1; + if (len >= ARRAY_SIZE(format->u.audio_encoded.caps)) + GST_FIXME("wg_format.audio_encoded.caps buffer is too small, need %u bytes", len); + else + memcpy(format->u.audio_encoded.caps, str, len); + g_free(str); +} + static void wg_format_from_caps_video_cinepak(struct wg_format *format, const GstCaps *caps) { const GstStructure *structure = gst_caps_get_structure(caps, 0); @@ -390,47 +411,66 @@ static void wg_format_from_caps_video_mpeg1(struct wg_format *format, const GstC format->u.video_mpeg1.fps_d = fps_d; } +static void wg_format_from_caps_video_encoded(struct wg_format *format, const GstCaps *caps, + const GstVideoInfo *info) +{ + gchar *str; + gint len; + + format->major_type = WG_MAJOR_TYPE_VIDEO_ENCODED; + format->u.video_encoded.width = info->width; + format->u.video_encoded.height = info->height; + format->u.video_encoded.fps_n = info->fps_n; + format->u.video_encoded.fps_d = info->fps_d; + + str = gst_caps_to_string(caps); + len = strlen(str) + 1; + if (len >= ARRAY_SIZE(format->u.video_encoded.caps)) + GST_FIXME("wg_format.video_encoded.caps buffer is too small, need %u bytes", len); + else + memcpy(format->u.video_encoded.caps, str, len); + g_free(str); +} + void wg_format_from_caps(struct wg_format *format, const GstCaps *caps) { const GstStructure *structure = gst_caps_get_structure(caps, 0); const char *name = gst_structure_get_name(structure); + GstAudioInfo audio_info; + GstVideoInfo video_info; gboolean parsed; memset(format, 0, sizeof(*format)); - if (!strcmp(name, "audio/x-raw")) + if (g_str_has_prefix(name, "audio/") && gst_audio_info_from_caps(&audio_info, caps)) { - GstAudioInfo info; - - if (gst_audio_info_from_caps(&info, caps)) - wg_format_from_audio_info(format, &info); - } - else if (!strcmp(name, "video/x-raw")) - { - GstVideoInfo info; - - if (gst_video_info_from_caps(&info, caps)) - wg_format_from_video_info(format, &info); - } - else if (!strcmp(name, "audio/mpeg") && gst_structure_get_boolean(structure, "parsed", &parsed) && parsed) - { - wg_format_from_caps_audio_mpeg1(format, caps); - } - else if (!strcmp(name, "audio/x-wma")) - { - wg_format_from_caps_audio_wma(format, caps); - } - else if (!strcmp(name, "video/x-cinepak")) - { - wg_format_from_caps_video_cinepak(format, caps); - } - else if (!strcmp(name, "video/x-wmv")) - { - wg_format_from_caps_video_wmv(format, caps); + if (GST_AUDIO_INFO_FORMAT(&audio_info) != GST_AUDIO_FORMAT_ENCODED) + wg_format_from_audio_info(format, &audio_info); + else if (!strcmp(name, "audio/mpeg") && gst_structure_get_boolean(structure, "parsed", &parsed) && parsed) + wg_format_from_caps_audio_mpeg1(format, caps); + else if (!strcmp(name, "audio/x-wma")) + wg_format_from_caps_audio_wma(format, caps); + else + { + GST_FIXME("Using fallback for encoded audio caps %" GST_PTR_FORMAT ".", caps); + wg_format_from_caps_audio_encoded(format, caps, &audio_info); + } } - else if (!strcmp(name, "video/mpeg") && gst_structure_get_boolean(structure, "parsed", &parsed) && parsed) + else if (g_str_has_prefix(name, "video/") && gst_video_info_from_caps(&video_info, caps)) { - wg_format_from_caps_video_mpeg1(format, caps); + if (GST_VIDEO_INFO_FORMAT(&video_info) != GST_VIDEO_FORMAT_ENCODED) + wg_format_from_video_info(format, &video_info); + else if (!strcmp(name, "video/x-cinepak")) + wg_format_from_caps_video_cinepak(format, caps); + else if (!strcmp(name, "video/x-wmv")) + wg_format_from_caps_video_wmv(format, caps); + else if (!strcmp(name, "video/mpeg") && gst_structure_get_boolean(structure, "parsed", &parsed) && parsed) + wg_format_from_caps_video_mpeg1(format, caps); + else + { + GST_FIXME("Using fallback for encoded video caps %" GST_PTR_FORMAT ".", caps); + wg_format_from_caps_video_encoded(format, caps, &video_info); + } } else { @@ -494,6 +534,8 @@ static void wg_channel_mask_to_gst(GstAudioChannelPosition *positions, uint32_t else { GST_WARNING("Incomplete channel mask %#x.", orig_mask); + if (!orig_mask) + positions[i] = position_map[bit]; } } } @@ -566,6 +608,7 @@ static GstVideoFormat wg_video_format_to_gst(enum wg_video_format format) case WG_VIDEO_FORMAT_BGRA: return GST_VIDEO_FORMAT_BGRA; case WG_VIDEO_FORMAT_BGRx: return GST_VIDEO_FORMAT_BGRx; case WG_VIDEO_FORMAT_BGR: return GST_VIDEO_FORMAT_BGR; + case WG_VIDEO_FORMAT_RGBA: return GST_VIDEO_FORMAT_RGBA; case WG_VIDEO_FORMAT_RGB15: return GST_VIDEO_FORMAT_RGB15; case WG_VIDEO_FORMAT_RGB16: return GST_VIDEO_FORMAT_RGB16; case WG_VIDEO_FORMAT_AYUV: return GST_VIDEO_FORMAT_AYUV; @@ -610,6 +653,7 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format) /* Remove fields which we don't specify but might have some default value */ gst_structure_remove_fields(structure, "colorimetry", "chroma-site", NULL); + gst_structure_remove_fields(structure, "pixel-aspect-ratio", NULL); } } return caps; @@ -637,10 +681,20 @@ static GstCaps *wg_format_to_caps_audio_wma(const struct wg_format *format) GstBuffer *buffer; GstCaps *caps; - if (!(caps = gst_caps_new_empty_simple("audio/x-wma"))) - return NULL; - if (format->u.audio_wma.version) - gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, format->u.audio_wma.version, NULL); + if (format->u.audio_wma.is_xma) + { + if (!(caps = gst_caps_new_empty_simple("audio/x-xma"))) + return NULL; + if (format->u.audio_wma.version) + gst_caps_set_simple(caps, "xmaversion", G_TYPE_INT, format->u.audio_wma.version, NULL); + } + else + { + if (!(caps = gst_caps_new_empty_simple("audio/x-wma"))) + return NULL; + if (format->u.audio_wma.version) + gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, format->u.audio_wma.version, NULL); + } if (format->u.audio_wma.bitrate) gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->u.audio_wma.bitrate, NULL); @@ -867,6 +921,8 @@ GstCaps *wg_format_to_caps(const struct wg_format *format) return wg_format_to_caps_audio_mpeg4(format); case WG_MAJOR_TYPE_AUDIO_WMA: return wg_format_to_caps_audio_wma(format); + case WG_MAJOR_TYPE_AUDIO_ENCODED: + return gst_caps_from_string(format->u.audio_encoded.caps); case WG_MAJOR_TYPE_VIDEO: return wg_format_to_caps_video(format); case WG_MAJOR_TYPE_VIDEO_CINEPAK: @@ -879,6 +935,8 @@ GstCaps *wg_format_to_caps(const struct wg_format *format) return wg_format_to_caps_video_indeo(format); case WG_MAJOR_TYPE_VIDEO_MPEG1: return wg_format_to_caps_video_mpeg1(format); + case WG_MAJOR_TYPE_VIDEO_ENCODED: + return gst_caps_from_string(format->u.video_encoded.caps); } assert(0); return NULL; @@ -894,9 +952,11 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b) case WG_MAJOR_TYPE_AUDIO_MPEG1: case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_MPEG1: + case WG_MAJOR_TYPE_VIDEO_ENCODED: GST_FIXME("Format %u not implemented!", a->major_type); /* fallthrough */ case WG_MAJOR_TYPE_UNKNOWN: diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 7193062e89b..64c88740640 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -30,11 +30,14 @@ #include #include +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_30 #include #include #include #include +#include + #include "ntstatus.h" #define WIN32_NO_STATUS #include "winternl.h" @@ -42,6 +45,8 @@ #include "unix_private.h" +extern GstGLDisplay *gl_display; + typedef enum { GST_AUTOPLUG_SELECT_TRY, @@ -68,10 +73,12 @@ struct wg_parser GstElement *container, *decodebin; GstBus *bus; + GstTaskPool *task_pool; GstPad *my_src; guint64 file_size, start_offset, next_offset, stop_offset; guint64 next_pull_offset; + gchar *uri; pthread_t push_thread; @@ -97,6 +104,11 @@ struct wg_parser gchar *sink_caps; struct input_cache_chunk input_cache_chunks[4]; + + bool using_qtdemux; + bool use_mediaconv; + bool use_opengl; + GstContext *context; }; static const unsigned int input_cache_chunk_size = 512 << 10; @@ -118,6 +130,8 @@ struct wg_parser_stream uint64_t duration; gchar *tags[WG_PARSER_TAG_COUNT]; + gchar *stream_id; + int seq_id; }; static struct wg_parser *get_parser(wg_parser_t parser) @@ -134,7 +148,9 @@ static bool format_is_compressed(struct wg_format *format) { return format->major_type != WG_MAJOR_TYPE_UNKNOWN && format->major_type != WG_MAJOR_TYPE_VIDEO - && format->major_type != WG_MAJOR_TYPE_AUDIO; + && format->major_type != WG_MAJOR_TYPE_AUDIO + && format->major_type != WG_MAJOR_TYPE_VIDEO_ENCODED + && format->major_type != WG_MAJOR_TYPE_AUDIO_ENCODED; } static NTSTATUS wg_parser_get_stream_count(void *args) @@ -254,7 +270,7 @@ static NTSTATUS wg_parser_stream_enable(void *args) if (format->major_type == WG_MAJOR_TYPE_VIDEO) { - bool flip = (format->u.video.height < 0); + bool flip = (params->flags & STREAM_ENABLE_FLAG_FLIP_RGB) && (format->u.video.height < 0); gst_util_set_object_arg(G_OBJECT(stream->flip), "method", flip ? "vertical-flip" : "none"); } @@ -272,6 +288,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) stream->enabled = false; stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; pthread_mutex_unlock(&parser->mutex); + pthread_cond_signal(&stream->event_cond); pthread_cond_signal(&stream->event_empty_cond); return S_OK; } @@ -514,6 +531,19 @@ static gboolean autoplug_continue_cb(GstElement * decodebin, GstPad *pad, GstCap return !format_is_compressed(&format); } +gboolean caps_detect_h264(GstCapsFeatures *features, GstStructure *structure, gpointer user_data) +{ + const char *cap_name = gst_structure_get_name(structure); + + if (!strcmp(cap_name, "video/x-h264")) + { + touch_h264_used_tag(); + return FALSE; + } + + return TRUE; +} + static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user) { @@ -523,6 +553,10 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GST_INFO("Using \"%s\".", name); + gst_caps_foreach(caps, caps_detect_h264, NULL); + + if (parser->error) + return GST_AUTOPLUG_SELECT_SKIP; if (strstr(name, "Player protection")) { GST_WARNING("Blacklisted a/52 decoder because it only works in Totem."); @@ -533,6 +567,13 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GST_WARNING("Disabled video acceleration since it breaks in wine."); return GST_AUTOPLUG_SELECT_SKIP; } + if (!strcmp(name, "Proton video converter") && !parser->use_mediaconv) + { + GST_INFO("Skipping \"Proton video converter\"."); + return GST_AUTOPLUG_SELECT_SKIP; + } + if (!strcmp(name, "QuickTime demuxer")) + parser->using_qtdemux = true; if (!parser->sink_caps && strstr(klass, GST_ELEMENT_FACTORY_KLASS_DEMUXER)) parser->sink_caps = g_strdup(gst_structure_get_name(gst_caps_get_structure(caps, 0))); @@ -540,18 +581,95 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, return GST_AUTOPLUG_SELECT_TRY; } +static gint find_videoconv_cb(gconstpointer a, gconstpointer b) +{ + const GValue *val_a = a, *val_b = b; + GstElementFactory *factory_a = g_value_get_object(val_a), *factory_b = g_value_get_object(val_b); + const char *name_a = gst_element_factory_get_longname(factory_a), *name_b = gst_element_factory_get_longname(factory_b); + + if (!strcmp(name_a, "Proton video converter")) + return -1; + if (!strcmp(name_b, "Proton video converter")) + return 1; + return 0; +} + +static GValueArray *autoplug_sort_cb(GstElement *bin, GstPad *pad, + GstCaps *caps, GValueArray *factories, gpointer user) +{ + struct wg_parser *parser = user; + GValueArray *ret = g_value_array_copy(factories); + + if (!parser->use_mediaconv) + return NULL; + + GST_DEBUG("parser %p.", parser); + + g_value_array_sort(ret, find_videoconv_cb); + return ret; +} + +static int streams_compare(const void *comp1, const void *comp2) +{ + const struct wg_parser_stream * const *stream1 = comp1; + const struct wg_parser_stream * const *stream2 = comp2; + const char *s1, *s2; + int ret; + + s1 = (*stream1)->stream_id ? strchr((*stream1)->stream_id, '/') : NULL; + s2 = (*stream2)->stream_id ? strchr((*stream2)->stream_id, '/') : NULL; + + if (!s1 || !s2) + { + if (!s1 && !s2) + return (*stream1)->seq_id - (*stream2)->seq_id; + if (!s1) + return -1; + return 1; + } + if ((ret = strcmp(s1, s2))) + return ret; + return (*stream1)->seq_id - (*stream2)->seq_id; +} + static void no_more_pads_cb(GstElement *element, gpointer user) { struct wg_parser *parser = user; GST_DEBUG("parser %p.", parser); + if (parser->using_qtdemux) + qsort(parser->streams, parser->stream_count, sizeof(*parser->streams), streams_compare); + pthread_mutex_lock(&parser->mutex); parser->no_more_pads = true; pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->init_cond); } +static void deep_element_added_cb(GstBin *self, GstBin *sub_bin, GstElement *element, gpointer user) +{ + GstElementFactory *factory = NULL; + const char *name = NULL; + + if (element) + factory = gst_element_get_factory(element); + + if (factory) + name = gst_element_factory_get_longname(factory); + + if (name && strstr(name, "Dav1d")) + { +#if defined(__x86_64__) + GST_DEBUG("%s found, setting n-threads to 4.", name); + g_object_set(element, "n-threads", G_GINT64_CONSTANT(4), NULL); +#else + GST_DEBUG("%s found, setting n-threads to 1.", name); + g_object_set(element, "n-threads", G_GINT64_CONSTANT(1), NULL); +#endif + } +} + static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) { struct wg_parser_stream *stream = gst_pad_get_element_private(pad); @@ -788,7 +906,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) } } -static struct wg_parser_stream *create_stream(struct wg_parser *parser) +static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id) { struct wg_parser_stream *stream, **new_array; char pad_name[19]; @@ -802,6 +920,8 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser) gst_segment_init(&stream->segment, GST_FORMAT_UNDEFINED); + stream->stream_id = id; + stream->seq_id = parser->stream_count; stream->parser = parser; stream->number = parser->stream_count; stream->no_more_pads = true; @@ -822,8 +942,14 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser) static void free_stream(struct wg_parser_stream *stream) { + GstPad *peer; unsigned int i; + if ((peer = gst_pad_get_peer(stream->my_sink))) + { + gst_pad_unlink(peer, stream->my_sink); + gst_object_unref(peer); + } gst_object_unref(stream->my_sink); if (stream->buffer) @@ -841,6 +967,10 @@ static void free_stream(struct wg_parser_stream *stream) if (stream->tags[i]) g_free(stream->tags[i]); } + + if (stream->stream_id) + g_free(stream->stream_id); + free(stream); } @@ -855,8 +985,76 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser name = gst_structure_get_name(gst_caps_get_structure(caps, 0)); gst_caps_unref(caps); - if (!strcmp(name, "video/x-raw")) + if (!strcmp(name, "video/x-raw") && parser->use_opengl) { + if (!(element = create_element("glupload", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glcolorconvert", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glvideoflip", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + stream->flip = element; + if (!(element = create_element("gldeinterlace", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glcolorconvert", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("gldownload", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + + if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) + return false; + } + else if (!strcmp(name, "video/x-raw")) + { + /* Hack?: Flatten down the colorimetry to default values, without + * actually modifying the video at all. + * + * We want to do color matrix conversions when converting from YUV to + * RGB or vice versa. We do *not* want to do color matrix conversions + * when converting YUV <-> YUV or RGB <-> RGB, because these are slow + * (it essentially means always using the slow path, never going through + * liborc). However, we have two videoconvert elements, and it's + * basically impossible to know what conversions each is going to do + * until caps are negotiated (without depending on some implementation + * details, and even then it'snot exactly trivial). And setting + * matrix-mode after caps are negotiated has no effect. + * + * Nor can we just retain colorimetry information the way we retain + * other caps values, because videoconvert automatically clears it if + * not doing passthrough. I think that this would only happen if we have + * to do a double conversion, but that is possible. Not likely, but I + * don't want to have to be the one to find out that there's still a + * game broken. + * + * [Note that we'd actually kind of like to retain colorimetry + * information, just in case it does ever become relevant to pass that + * on to the next DirectShow filter. Hence I think the correct solution + * for upstream is to get videoconvert to Not Do That.] + * + * So as a fallback solution, we force an identity transformation of + * the caps to those with a "default" color matrix—i.e. transform the + * caps, but not the data. We do this by *pre*pending a capssetter to + * the front of the chain, and we remove the matrix-mode setting for the + * videoconvert elements. + */ + if (!(element = create_element("capssetter", "good")) + || !append_element(parser->container, element, &first, &last)) + return false; + gst_util_set_object_arg(G_OBJECT(element), "join", "true"); + /* Actually, this is invalid, but it causes videoconvert to use default + * colorimetry as a result. Yes, this is depending on undocumented + * implementation details. It's a hack. + * + * Sadly there doesn't seem to be a way to get capssetter to clear + * certain fields while leaving others untouched. */ + gst_util_set_object_arg(G_OBJECT(element), "caps", "video/x-raw,colorimetry=0:0:0:0"); + /* DirectShow can express interlaced video, but downstream filters can't * necessarily consume it. In particular, the video renderer can't. */ if (!(element = create_element("deinterlace", "good")) @@ -975,7 +1173,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) if (gst_pad_is_linked(pad)) return; - if (!(stream = create_stream(parser))) + if (!(stream = create_stream(parser, gst_pad_get_stream_id(pad)))) return; caps = gst_pad_query_caps(pad, NULL); @@ -1247,6 +1445,13 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); return TRUE; + case GST_QUERY_LATENCY: + { + const char *live = getenv("WINE_ENABLE_GST_LIVE_LATENCY"); + gst_query_set_latency(query, live && !strcmp(live, "1"), 0, 0); + return TRUE; + } + default: GST_WARNING("Unhandled query type %s.", GST_QUERY_TYPE_NAME(query)); return FALSE; @@ -1348,9 +1553,12 @@ static gboolean src_activate_mode_cb(GstPad *pad, GstObject *parent, GstPadMode return FALSE; } +static BOOL decodebin_parser_init_gst(struct wg_parser *parser); + static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer user) { struct wg_parser *parser = user; + const GstStructure *structure; gchar *dbg_info = NULL; GError *err = NULL; @@ -1391,6 +1599,39 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use pthread_cond_signal(&parser->init_cond); break; + case GST_MESSAGE_ELEMENT: + structure = gst_message_get_structure(msg); + if (gst_structure_has_name(structure, "missing-plugin")) + { + pthread_mutex_lock(&parser->mutex); + if (!parser->use_mediaconv && parser->init_gst == decodebin_parser_init_gst) + { + GST_WARNING("Autoplugged element failed to initialise, trying again with protonvideoconvert."); + parser->error = true; + pthread_cond_signal(&parser->init_cond); + } + pthread_mutex_unlock(&parser->mutex); + } + break; + + case GST_MESSAGE_STREAM_STATUS: + { + GstStreamStatusType type; + GstElement *element; + const GValue *val; + GstTask *task; + + gst_message_parse_stream_status(msg, &type, &element); + val = gst_message_get_stream_status_object(msg); + GST_DEBUG("parser %p, message %s, type %u, value %p (%s).", parser, GST_MESSAGE_TYPE_NAME(msg), type, val, G_VALUE_TYPE_NAME(val)); + + if (G_VALUE_TYPE(val) == GST_TYPE_TASK && (task = g_value_get_object(val)) + && type == GST_STREAM_STATUS_TYPE_CREATE) + gst_task_set_pool(task, parser->task_pool); + + break; + } + default: break; } @@ -1552,11 +1793,23 @@ static NTSTATUS wg_parser_connect(void *args) GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); const struct wg_parser_connect_params *params = args; struct wg_parser *parser = get_parser(params->parser); + const WCHAR *uri = params->uri; unsigned int i; int ret; + bool use_mediaconv = false; + parser->file_size = params->file_size; parser->sink_connected = true; + if (uri) + { + parser->uri = malloc(wcslen(uri) * 3 + 1); + ntdll_wcstoumbs(uri, wcslen(uri) + 1, parser->uri, wcslen(uri) * 3 + 1, FALSE); + } + else + { + parser->uri = NULL; + } if (!parser->bus) { @@ -1566,6 +1819,8 @@ static NTSTATUS wg_parser_connect(void *args) parser->container = gst_bin_new(NULL); gst_element_set_bus(parser->container, parser->bus); + if (parser->context) + gst_element_set_context(parser->container, parser->context); parser->my_src = gst_pad_new_from_static_template(&src_template, "quartz-src"); gst_pad_set_getrange_function(parser->my_src, src_getrange_cb); @@ -1583,9 +1838,16 @@ static NTSTATUS wg_parser_connect(void *args) gst_element_set_state(parser->container, GST_STATE_PAUSED); ret = gst_element_get_state(parser->container, NULL, NULL, -1); + if (ret == GST_STATE_CHANGE_FAILURE) { - GST_ERROR("Failed to play stream."); + if (!parser->use_mediaconv && parser->init_gst == decodebin_parser_init_gst) + { + GST_WARNING("Failed to play media, trying again with protonvideoconvert."); + use_mediaconv = true; + } + else + GST_ERROR("Failed to play stream."); goto out; } @@ -1595,6 +1857,8 @@ static NTSTATUS wg_parser_connect(void *args) pthread_cond_wait(&parser->init_cond, &parser->mutex); if (parser->error) { + if (!parser->use_mediaconv && parser->init_gst == decodebin_parser_init_gst) + use_mediaconv = true; pthread_mutex_unlock(&parser->mutex); goto out; } @@ -1711,6 +1975,15 @@ static NTSTATUS wg_parser_connect(void *args) pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->read_cond); + if (use_mediaconv) + { + HRESULT hr; + parser->use_mediaconv = true; + hr = wg_parser_connect(args); + parser->use_mediaconv = false; + return hr; + } + return E_FAIL; } @@ -1757,6 +2030,7 @@ static NTSTATUS wg_parser_disconnect(void *args) parser->input_cache_chunks[i].data = NULL; } + gst_task_pool_cleanup(parser->task_pool); return S_OK; } @@ -1770,11 +2044,14 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; + g_object_set(element, "max-size-bytes", G_MAXUINT, NULL); g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); + g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); + g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); pthread_mutex_lock(&parser->mutex); parser->no_more_pads = false; @@ -1786,6 +2063,30 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) return TRUE; } +static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) +{ + GstElement *element; + + if (!(element = create_element("uridecodebin", "base"))) + return FALSE; + + gst_bin_add(GST_BIN(parser->container), element); + parser->decodebin = element; + + g_object_set(parser->decodebin, "uri", parser->uri, NULL); + g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); + g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); + g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); + g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); + g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); + + pthread_mutex_lock(&parser->mutex); + parser->no_more_pads = false; + pthread_mutex_unlock(&parser->mutex); + + return TRUE; +} + static BOOL avi_parser_init_gst(struct wg_parser *parser) { GstElement *element; @@ -1822,7 +2123,7 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) if (!link_src_to_element(parser->my_src, element)) return FALSE; - if (!(stream = create_stream(parser))) + if (!(stream = create_stream(parser, NULL))) return FALSE; if (!link_element_to_sink(element, stream->my_sink)) @@ -1841,13 +2142,31 @@ static NTSTATUS wg_parser_create(void *args) [WG_PARSER_DECODEBIN] = decodebin_parser_init_gst, [WG_PARSER_AVIDEMUX] = avi_parser_init_gst, [WG_PARSER_WAVPARSE] = wave_parser_init_gst, + [WG_PARSER_URIDECODEBIN] = uridecodebin_parser_init_gst, }; struct wg_parser_create_params *params = args; struct wg_parser *parser; + GError *error; if (!(parser = calloc(1, sizeof(*parser)))) return E_OUTOFMEMORY; + if ((parser->use_opengl = params->use_opengl && gl_display)) + { + if ((parser->context = gst_context_new(GST_GL_DISPLAY_CONTEXT_TYPE, false))) + gst_context_set_gl_display(parser->context, gl_display); + else + { + GST_ERROR("Failed to create parser context"); + parser->use_opengl = FALSE; + } + } + if (!(parser->task_pool = wg_task_pool_new())) + { + free(parser); + return E_OUTOFMEMORY; + } + gst_task_pool_prepare(parser->task_pool, &error); pthread_mutex_init(&parser->mutex, NULL); pthread_cond_init(&parser->init_cond, NULL); @@ -1871,12 +2190,17 @@ static NTSTATUS wg_parser_destroy(void *args) gst_bus_set_sync_handler(parser->bus, NULL, NULL, NULL); gst_object_unref(parser->bus); } + gst_object_unref(parser->task_pool); + + if (parser->context) + gst_context_unref(parser->context); pthread_mutex_destroy(&parser->mutex); pthread_cond_destroy(&parser->init_cond); pthread_cond_destroy(&parser->read_cond); pthread_cond_destroy(&parser->read_done_cond); + free(parser->uri); free(parser); return S_OK; } @@ -1912,6 +2236,18 @@ const unixlib_entry_t __wine_unix_call_funcs[] = X(wg_parser_stream_get_tag), X(wg_parser_stream_seek), + X(wg_source_create), + X(wg_source_destroy), + X(wg_source_get_stream_count), + X(wg_source_get_duration), + X(wg_source_get_position), + X(wg_source_set_position), + X(wg_source_push_data), + X(wg_source_read_data), + X(wg_source_get_stream_format), + X(wg_source_get_stream_tag), + X(wg_source_set_stream_flags), + X(wg_transform_create), X(wg_transform_destroy), X(wg_transform_set_output_format), @@ -2059,6 +2395,90 @@ static NTSTATUS wow64_wg_parser_stream_get_tag(void *args) return wg_parser_stream_get_tag(¶ms); } +NTSTATUS wow64_wg_source_create(void *args) +{ + struct + { + PTR32 url; + UINT64 file_size; + PTR32 data; + UINT32 size; + char mime_type[256]; + wg_source_t source; + } *params32 = args; + struct wg_source_create_params params = + { + .url = ULongToPtr(params32->url), + .file_size = params32->file_size, + .data = ULongToPtr(params32->data), + .size = params32->size, + }; + NTSTATUS ret; + + ret = wg_source_create(¶ms); + strcpy(params32->mime_type, params.mime_type); + params32->source = params.source; + return ret; +} + +NTSTATUS wow64_wg_source_push_data(void *args) +{ + struct + { + wg_source_t source; + PTR32 data; + UINT32 size; + } *params32 = args; + struct wg_source_push_data_params params = + { + .source = params32->source, + .data = ULongToPtr(params32->data), + .size = params32->size, + }; + + return wg_source_push_data(¶ms); +} + +NTSTATUS wow64_wg_source_read_data(void *args) +{ + struct + { + wg_source_t source; + UINT32 index; + PTR32 sample; + } *params32 = args; + struct wg_source_read_data_params params = + { + .source = params32->source, + .index = params32->index, + .sample = ULongToPtr(params32->sample), + }; + + return wg_source_read_data(¶ms); +} + +NTSTATUS wow64_wg_source_get_stream_tag(void *args) +{ + struct + { + wg_source_t source; + UINT32 index; + wg_parser_tag tag; + UINT32 size; + PTR32 buffer; + } *params32 = args; + struct wg_source_get_stream_tag_params params = + { + .source = params32->source, + .index = params32->index, + .tag = params32->tag, + .size = params32->size, + .buffer = ULongToPtr(params32->buffer), + }; + + return wg_source_get_stream_tag(¶ms); +} + NTSTATUS wow64_wg_transform_create(void *args) { struct @@ -2245,6 +2665,16 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = X64(wg_parser_stream_get_tag), X(wg_parser_stream_seek), + X64(wg_source_create), + X(wg_source_destroy), + X(wg_source_get_stream_count), + X(wg_source_get_duration), + X(wg_source_get_position), + X64(wg_source_push_data), + X64(wg_source_read_data), + X(wg_source_get_stream_format), + X64(wg_source_get_stream_tag), + X64(wg_transform_create), X(wg_transform_destroy), X64(wg_transform_set_output_format), diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index 31281066957..513907d9d77 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "gst_private.h" #include "wmcodecdsp.h" @@ -534,3 +536,70 @@ HRESULT wg_transform_read_dmo(wg_transform_t transform, DMO_OUTPUT_DATA_BUFFER * wg_sample_release(wg_sample); return hr; } + +HRESULT wg_source_read_data(wg_source_t source, UINT32 index, IMFSample **out) +{ + struct wg_sample wg_sample = {0}; + struct wg_source_read_data_params params = + { + .source = source, + .index = index, + .sample = &wg_sample, + }; + IMFMediaBuffer *buffer; + IMFSample *sample; + NTSTATUS status; + HRESULT hr; + + TRACE("source %#I64x, index %u, out %p\n", source, index, out); + + status = WINE_UNIX_CALL(unix_wg_source_read_data, ¶ms); + if (status == STATUS_PENDING) return E_PENDING; + if (status == STATUS_END_OF_FILE) return MF_E_END_OF_STREAM; + if (status != STATUS_BUFFER_TOO_SMALL) return HRESULT_FROM_NT(status); + + if (FAILED(hr = MFCreateSample(&sample))) + return hr; + if (SUCCEEDED(hr = MFCreateMemoryBuffer(wg_sample.max_size, &buffer))) + { + hr = IMFSample_AddBuffer(sample, buffer); + IMFMediaBuffer_Release(buffer); + } + + if (FAILED(hr) || FAILED(hr = wg_sample_create_mf(sample, ¶ms.sample))) + goto error; + + status = WINE_UNIX_CALL(unix_wg_source_read_data, ¶ms); + if (FAILED(hr = HRESULT_FROM_NT(status))) + { + wg_sample_release(params.sample); + goto error; + } + + if (params.sample->flags & WG_SAMPLE_FLAG_HAS_PTS) + IMFSample_SetSampleTime(sample, params.sample->pts); + if (params.sample->flags & WG_SAMPLE_FLAG_HAS_DURATION) + IMFSample_SetSampleDuration(sample, params.sample->duration); + if (params.sample->flags & WG_SAMPLE_FLAG_SYNC_POINT) + IMFSample_SetUINT32(sample, &MFSampleExtension_CleanPoint, 1); + if (params.sample->flags & WG_SAMPLE_FLAG_DISCONTINUITY) + IMFSample_SetUINT32(sample, &MFSampleExtension_Discontinuity, 1); + + if (SUCCEEDED(hr = IMFSample_ConvertToContiguousBuffer(sample, &buffer))) + { + hr = IMFMediaBuffer_SetCurrentLength(buffer, params.sample->size); + IMFMediaBuffer_Release(buffer); + } + wg_sample_release(params.sample); + + if (FAILED(hr)) + goto error; + + *out = sample; + TRACE("source %#I64x, index %u, out %p\n", source, index, *out); + return S_OK; + +error: + IMFSample_Release(sample); + return hr; +} diff --git a/dlls/winegstreamer/wg_source.c b/dlls/winegstreamer/wg_source.c new file mode 100644 index 00000000000..6e000e36e31 --- /dev/null +++ b/dlls/winegstreamer/wg_source.c @@ -0,0 +1,992 @@ +/* + * Copyright 2023 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "winternl.h" +#include "mferror.h" + +#include "unix_private.h" + +#define WG_SOURCE_MAX_STREAMS 32 + +struct source_stream +{ + GstPad *pad; + GstAtomicQueue *queue; + GstBuffer *buffer; + gboolean eos; +}; + +struct wg_source +{ + gchar *url; + GstPad *src_pad; + GstElement *container; + GstSegment segment; + bool valid_segment; + guint64 max_duration; + + guint stream_count; + struct source_stream streams[WG_SOURCE_MAX_STREAMS]; +}; + +static struct wg_source *get_source(wg_source_t source) +{ + return (struct wg_source *)(ULONG_PTR)source; +} + +static const char *media_type_from_caps(GstCaps *caps) +{ + GstStructure *structure; + if (!caps || !(structure = gst_caps_get_structure(caps, 0))) + return ""; + return gst_structure_get_name(structure); +} + +static GstCaps *detect_caps_from_data(const char *url, const void *data, guint size) +{ + const char *extension = url ? strrchr(url, '.') : NULL; + GstTypeFindProbability probability; + GstCaps *caps; + gchar *str; + + if (!(caps = gst_type_find_helper_for_data_with_extension(NULL, data, size, + extension ? extension + 1 : NULL, &probability))) + { + GST_ERROR("Failed to detect caps for url %s, data %p, size %u", url, data, size); + return NULL; + } + + str = gst_caps_to_string(caps); + if (probability > GST_TYPE_FIND_POSSIBLE) + GST_INFO("Detected caps %s with probability %u for url %s, data %p, size %u", + str, probability, url, data, size); + else + GST_FIXME("Detected caps %s with probability %u for url %s, data %p, size %u", + str, probability, url, data, size); + g_free(str); + + return caps; +} + +static GstPad *create_pad_with_caps(GstPadDirection direction, GstCaps *caps) +{ + GstCaps *pad_caps = caps ? gst_caps_ref(caps) : gst_caps_new_any(); + const char *name = direction == GST_PAD_SRC ? "src" : "sink"; + GstPadTemplate *template; + GstPad *pad; + + if (!pad_caps || !(template = gst_pad_template_new(name, direction, GST_PAD_ALWAYS, pad_caps))) + return NULL; + pad = gst_pad_new_from_template(template, "src"); + g_object_unref(template); + gst_caps_unref(pad_caps); + return pad; +} + +static GstBuffer *create_buffer_from_bytes(const void *data, guint size) +{ + GstBuffer *buffer; + + if (!(buffer = gst_buffer_new_and_alloc(size))) + GST_ERROR("Failed to allocate buffer for %#x bytes\n", size); + else + { + gst_buffer_fill(buffer, 0, data, size); + gst_buffer_set_size(buffer, size); + } + + return buffer; +} + +static GstStream *source_get_stream(struct wg_source *source, guint index) +{ + return index >= source->stream_count ? NULL : gst_pad_get_stream(source->streams[index].pad); +} + +static GstCaps *source_get_stream_caps(struct wg_source *source, guint index) +{ + GstStream *stream; + GstCaps *caps; + if (!(stream = source_get_stream(source, index))) + return NULL; + caps = gst_stream_get_caps(stream); + gst_object_unref(stream); + return caps; +} + +static GstTagList *source_get_stream_tags(struct wg_source *source, guint index) +{ + GstStream *stream; + GstTagList *tags; + if (!(stream = source_get_stream(source, index))) + return NULL; + tags = gst_stream_get_tags(stream); + gst_object_unref(stream); + return tags; +} + +static bool source_set_stream_flags(struct wg_source *source, guint index, GstStreamFlags flags) +{ + GstStream *stream; + if (!(stream = source_get_stream(source, index))) + return false; + gst_stream_set_stream_flags(stream, flags); + gst_object_unref(stream); + return true; +} + +static GstStreamFlags source_get_stream_flags(struct wg_source *source, guint index) +{ + GstStreamFlags flags; + GstStream *stream; + if (!(stream = source_get_stream(source, index))) + return 0; + flags = gst_stream_get_stream_flags(stream); + gst_object_unref(stream); + return flags; +} + +static NTSTATUS source_get_stream_buffer(struct wg_source *source, guint index, GstBuffer **buffer) +{ + GstBuffer **stream_buffer; + if (index >= source->stream_count) + return STATUS_INVALID_PARAMETER; + + stream_buffer = &source->streams[index].buffer; + if (!*stream_buffer && !(*stream_buffer = gst_atomic_queue_pop(source->streams[index].queue))) + return source->streams[index].eos ? STATUS_END_OF_FILE : STATUS_PENDING; + + *buffer = gst_buffer_ref(*stream_buffer); + return STATUS_SUCCESS; +} + +static gboolean src_event_seek(struct wg_source *source, GstEvent *event) +{ + guint32 i, seqnum = gst_event_get_seqnum(event); + GstSeekType cur_type, stop_type; + GstSeekFlags flags; + GstFormat format; + gint64 cur, stop; + gdouble rate; + + gst_event_parse_seek(event, &rate, &format, &flags, &cur_type, &cur, &stop_type, &stop); + gst_event_unref(event); + if (format != GST_FORMAT_BYTES) + return false; + + GST_TRACE("source %p, rate %f, format %s, flags %#x, cur_type %u, cur %#" G_GINT64_MODIFIER "x, " + "stop_type %u, stop %#" G_GINT64_MODIFIER "x.", source, rate, gst_format_get_name(format), + flags, cur_type, cur, stop_type, stop); + + if (flags & GST_SEEK_FLAG_FLUSH) + { + if (!(event = gst_event_new_flush_start())) + GST_ERROR("Failed to allocate flush_start event"); + else + { + gst_event_set_seqnum(event, seqnum); + if (!gst_pad_push_event(source->src_pad, event)) + GST_ERROR("Failed to push flush_start event"); + } + } + + source->segment.start = cur; + + for (i = 0; i < ARRAY_SIZE(source->streams); i++) + source->streams[i].eos = false; + + if (flags & GST_SEEK_FLAG_FLUSH) + { + if (!(event = gst_event_new_flush_stop(true))) + GST_ERROR("Failed to allocate flush_stop event"); + else + { + gst_event_set_seqnum(event, seqnum); + if (!gst_pad_push_event(source->src_pad, event)) + GST_ERROR("Failed to push flush_stop event"); + } + source->valid_segment = false; + } + + return true; +} + +static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +{ + struct wg_source *source = gst_pad_get_element_private(pad); + + switch (GST_EVENT_TYPE(event)) + { + case GST_EVENT_SEEK: + return src_event_seek(source, event); + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static gboolean src_query_duration(struct wg_source *source, GstQuery *query) +{ + GstFormat format; + + gst_query_parse_duration(query, &format, NULL); + GST_TRACE("source %p, format %s", source, gst_format_get_name(format)); + if (format != GST_FORMAT_BYTES) + return false; + + gst_query_set_duration(query, format, source->segment.stop); + return true; +} + +static gboolean src_query_scheduling(struct wg_source *source, GstQuery *query) +{ + GST_TRACE("source %p", source); + gst_query_set_scheduling(query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0); + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PUSH); + return true; +} + +static gboolean src_query_seeking(struct wg_source *source, GstQuery *query) +{ + GstFormat format; + + gst_query_parse_seeking(query, &format, NULL, NULL, NULL); + GST_TRACE("source %p, format %s", source, gst_format_get_name(format)); + if (format != GST_FORMAT_BYTES) + return false; + + gst_query_set_seeking(query, GST_FORMAT_BYTES, 1, 0, source->segment.stop); + return true; +} + +static gboolean src_query_uri(struct wg_source *source, GstQuery *query) +{ + gchar *uri; + + gst_query_parse_uri(query, &uri); + GST_TRACE("source %p, uri %s", source, uri); + gst_query_set_uri(query, source->url); + + return true; +} + +static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +{ + struct wg_source *source = gst_pad_get_element_private(pad); + + switch (GST_QUERY_TYPE(query)) + { + case GST_QUERY_DURATION: + return src_query_duration(source, query); + case GST_QUERY_SCHEDULING: + return src_query_scheduling(source, query); + case GST_QUERY_SEEKING: + return src_query_seeking(source, query); + case GST_QUERY_URI: + if (!source->url) + return false; + return src_query_uri(source, query); + default: + return gst_pad_query_default(pad, parent, query); + } +} + +static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + struct wg_source *source = gst_pad_get_element_private(pad); + guint index; + + GST_TRACE("source %p, pad %p, buffer %p.", source, pad, buffer); + + for (index = 0; index < source->stream_count; index++) + if (source->streams[index].pad == pad) + break; + + if (source_get_stream_flags(source, index) & GST_STREAM_FLAG_SELECT) + gst_atomic_queue_push(source->streams[index].queue, buffer); + else + gst_buffer_unref(buffer); + + return GST_FLOW_OK; +} + +static gboolean sink_event_caps(struct wg_source *source, GstPad *pad, GstEvent *event) +{ + GstStream *stream; + GstCaps *caps; + gchar *str; + + gst_event_parse_caps(event, &caps); + str = gst_caps_to_string(caps); + GST_TRACE("source %p, pad %p, caps %s", source, pad, str); + g_free(str); + + if ((stream = gst_pad_get_stream(pad))) + { + gst_stream_set_caps(stream, gst_caps_copy(caps)); + gst_stream_set_stream_type(stream, stream_type_from_caps(caps)); + gst_object_unref(stream); + } + + gst_event_unref(event); + return !!stream; +} + +static gboolean sink_event_tag(struct wg_source *source, GstPad *pad, GstEvent *event) +{ + GstTagList *new_tags; + GstStream *stream; + + gst_event_parse_tag(event, &new_tags); + GST_TRACE("source %p, pad %p, new_tags %p", source, pad, new_tags); + + if ((stream = gst_pad_get_stream(pad))) + { + GstTagList *old_tags = gst_stream_get_tags(stream); + if ((new_tags = gst_tag_list_merge(old_tags, new_tags, GST_TAG_MERGE_REPLACE))) + { + gst_stream_set_tags(stream, new_tags); + gst_tag_list_unref(new_tags); + } + if (old_tags) + gst_tag_list_unref(old_tags); + gst_object_unref(stream); + } + + gst_event_unref(event); + return stream && new_tags; +} + +static gboolean sink_event_stream_start(struct wg_source *source, GstPad *pad, GstEvent *event) +{ + guint group, flags; + GstStream *stream; + gint64 duration; + const gchar *id; + + gst_event_parse_stream_start(event, &id); + gst_event_parse_stream(event, &stream); + gst_event_parse_stream_flags(event, &flags); + if (!gst_event_parse_group_id(event, &group)) + group = -1; + + if (gst_pad_peer_query_duration(pad, GST_FORMAT_TIME, &duration) && GST_CLOCK_TIME_IS_VALID(duration)) + source->max_duration = max(source->max_duration, duration); + + GST_TRACE("source %p, pad %p, stream %p, id %s, flags %#x, group %d, duration %" GST_TIME_FORMAT, + source, pad, stream, id, flags, group, GST_TIME_ARGS(duration)); + + gst_event_unref(event); + return true; +} + +static gboolean sink_event_eos(struct wg_source *source, GstPad *pad, GstEvent *event) +{ + guint index; + + GST_TRACE("source %p, pad %p, event %p", source, pad, event); + + for (index = 0; index < source->stream_count; index++) + if (source->streams[index].pad == pad) + break; + + if (index < source->stream_count) + source->streams[index].eos = true; + + gst_event_unref(event); + return true; +} + +static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +{ + struct wg_source *source = gst_pad_get_element_private(pad); + + switch (GST_EVENT_TYPE(event)) + { + case GST_EVENT_CAPS: + return sink_event_caps(source, pad, event); + case GST_EVENT_TAG: + return sink_event_tag(source, pad, event); + case GST_EVENT_STREAM_START: + return sink_event_stream_start(source, pad, event); + case GST_EVENT_EOS: + return sink_event_eos(source, pad, event); + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static GstEvent *create_stream_start_event(const char *stream_id) +{ + GstStream *stream; + GstEvent *event; + + if (!(stream = gst_stream_new(stream_id, NULL, GST_STREAM_TYPE_UNKNOWN, 0))) + return NULL; + gst_stream_set_stream_flags(stream, GST_STREAM_FLAG_SELECT); + if ((event = gst_event_new_stream_start(stream_id))) + { + gst_event_set_stream(event, stream); + gst_object_unref(stream); + } + + return event; +} + +static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) +{ + struct wg_source *source = user; + char stream_id[256]; + GstFlowReturn ret; + GstPad *sink_pad; + GstEvent *event; + guint index; + + GST_TRACE("source %p, element %p, pad %p.", source, element, pad); + if ((index = source->stream_count++) >= ARRAY_SIZE(source->streams)) + { + GST_FIXME("Not enough sink pads, need %u", source->stream_count); + return; + } + + sink_pad = source->streams[index].pad; + if (gst_pad_link(pad, sink_pad) < 0 || !gst_pad_set_active(sink_pad, true)) + GST_ERROR("Failed to link new pad to sink pad %p", sink_pad); + + snprintf(stream_id, ARRAY_SIZE(stream_id), "wg_source/%03u", index); + if (!(event = create_stream_start_event(stream_id))) + GST_ERROR("Failed to create stream event for sink pad %p", sink_pad); + else + { + if ((ret = gst_pad_store_sticky_event(pad, event)) < 0) + GST_ERROR("Failed to create pad %p stream, ret %d", sink_pad, ret); + if ((ret = gst_pad_store_sticky_event(sink_pad, event)) < 0) + GST_ERROR("Failed to create pad %p stream, ret %d", sink_pad, ret); + gst_event_unref(event); + } +} + +NTSTATUS wg_source_create(void *args) +{ + struct wg_source_create_params *params = args; + GstElement *first = NULL, *last = NULL, *element; + GstCaps *src_caps, *any_caps; + struct wg_source *source; + const gchar *media_type; + GstEvent *event; + GstPad *peer; + guint i; + + if (!(src_caps = detect_caps_from_data(params->url, params->data, params->size))) + return STATUS_UNSUCCESSFUL; + if (!(source = calloc(1, sizeof(*source)))) + { + gst_caps_unref(src_caps); + return STATUS_UNSUCCESSFUL; + } + source->url = params->url ? strdup(params->url) : NULL; + gst_segment_init(&source->segment, GST_FORMAT_BYTES); + source->segment.stop = params->file_size; + + media_type = gst_structure_get_name(gst_caps_get_structure(src_caps, 0)); + if (!strcmp(media_type, "video/quicktime")) + strcpy(params->mime_type, "video/mp4"); + else if (!strcmp(media_type, "video/x-msvideo")) + strcpy(params->mime_type, "video/avi"); + else + lstrcpynA(params->mime_type, media_type, ARRAY_SIZE(params->mime_type)); + + if (!(source->container = gst_bin_new("wg_source"))) + goto error; + GST_OBJECT_FLAG_SET(source->container, GST_BIN_FLAG_STREAMS_AWARE); + + if (!(source->src_pad = create_pad_with_caps(GST_PAD_SRC, src_caps))) + goto error; + gst_pad_set_element_private(source->src_pad, source); + gst_pad_set_query_function(source->src_pad, src_query_cb); + gst_pad_set_event_function(source->src_pad, src_event_cb); + + for (i = 0; i < ARRAY_SIZE(source->streams); i++) + { + if (!(source->streams[i].pad = create_pad_with_caps(GST_PAD_SINK, NULL))) + goto error; + if (!(source->streams[i].queue = gst_atomic_queue_new(1))) + goto error; + gst_pad_set_element_private(source->streams[i].pad, source); + gst_pad_set_chain_function(source->streams[i].pad, sink_chain_cb); + gst_pad_set_event_function(source->streams[i].pad, sink_event_cb); + } + + if (!(any_caps = gst_caps_new_any())) + goto error; + if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODABLE, src_caps, any_caps)) + || !append_element(source->container, element, &first, &last)) + { + gst_caps_unref(any_caps); + goto error; + } + g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), source); + gst_caps_unref(any_caps); + + if (!link_src_to_element(source->src_pad, first)) + goto error; + if (!gst_pad_set_active(source->src_pad, true)) + goto error; + + /* try to link the first output pad, some demuxers only have static pads */ + if ((peer = gst_element_get_static_pad(last, "src"))) + { + GstPad *sink_pad = source->streams[0].pad; + if (gst_pad_link(peer, sink_pad) < 0 || !gst_pad_set_active(sink_pad, true)) + GST_ERROR("Failed to link static source pad %p", peer); + else + source->stream_count++; + gst_object_unref(peer); + } + + gst_element_set_state(source->container, GST_STATE_PAUSED); + if (!gst_element_get_state(source->container, NULL, NULL, -1)) + goto error; + + if (!(event = create_stream_start_event("wg_source")) + || !push_event(source->src_pad, event)) + goto error; + gst_caps_unref(src_caps); + + params->source = (wg_source_t)(ULONG_PTR)source; + GST_INFO("Created winegstreamer source %p.", source); + return STATUS_SUCCESS; + +error: + if (source->container) + { + gst_element_set_state(source->container, GST_STATE_NULL); + gst_object_unref(source->container); + } + for (i = 0; i < ARRAY_SIZE(source->streams); i++) + { + if (source->streams[i].buffer) + gst_buffer_unref(source->streams[i].buffer); + if (source->streams[i].queue) + gst_atomic_queue_unref(source->streams[i].queue); + if (source->streams[i].pad) + gst_object_unref(source->streams[i].pad); + } + if (source->src_pad) + gst_object_unref(source->src_pad); + free(source->url); + free(source); + + gst_caps_unref(src_caps); + + GST_ERROR("Failed to create winegstreamer source."); + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS wg_source_destroy(void *args) +{ + struct wg_source *source = get_source(*(wg_source_t *)args); + guint i; + + GST_TRACE("source %p", source); + + gst_element_set_state(source->container, GST_STATE_NULL); + gst_object_unref(source->container); + for (i = 0; i < ARRAY_SIZE(source->streams); i++) + { + if (source->streams[i].buffer) + gst_buffer_unref(source->streams[i].buffer); + gst_atomic_queue_unref(source->streams[i].queue); + gst_object_unref(source->streams[i].pad); + } + gst_object_unref(source->src_pad); + free(source->url); + free(source); + + return STATUS_SUCCESS; +} + +NTSTATUS wg_source_get_stream_count(void *args) +{ + struct wg_source_get_stream_count_params *params = args; + struct wg_source *source = get_source(params->source); + UINT i, stream_count; + GstCaps *caps; + + GST_TRACE("source %p", source); + + for (i = 0, stream_count = source->stream_count; i < stream_count; i++) + { + if (!(caps = source_get_stream_caps(source, i))) + return STATUS_PENDING; + gst_caps_unref(caps); + } + + params->stream_count = stream_count; + return STATUS_SUCCESS; +} + +NTSTATUS wg_source_get_duration(void *args) +{ + struct wg_source_get_duration_params *params = args; + struct wg_source *source = get_source(params->source); + + GST_TRACE("source %p", source); + + params->duration = source->max_duration / 100; + return STATUS_SUCCESS; +} + +NTSTATUS wg_source_get_position(void *args) +{ + struct wg_source_get_position_params *params = args; + struct wg_source *source = get_source(params->source); + + GST_TRACE("source %p", source); + + params->read_offset = source->segment.start; + return STATUS_SUCCESS; +} + +NTSTATUS wg_source_set_position(void *args) +{ + struct wg_source_set_position_params *params = args; + struct wg_source *source = get_source(params->source); + guint64 time = params->time * 100; + GstEvent *event; + guint i; + + GST_TRACE("source %p", source); + + if (!(event = gst_event_new_seek(1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1)) + || !gst_pad_push_event(source->streams[0].pad, event)) + GST_WARNING("Failed to seek source %p to %" G_GINT64_MODIFIER "x", source, time); + + for (i = 0; i < source->stream_count; i++) + { + GstBuffer *buffer; + + while (!source_get_stream_buffer(source, i, &buffer)) + { + gst_buffer_unref(source->streams[i].buffer); + source->streams[i].buffer = NULL; + gst_buffer_unref(buffer); + } + } + + return S_OK; +} + +NTSTATUS wg_source_push_data(void *args) +{ + struct wg_source_push_data_params *params = args; + struct wg_source *source = get_source(params->source); + GstFlowReturn ret = GST_FLOW_OK; + GstBuffer *buffer; + GstEvent *event; + + GST_TRACE("source %p, data %p, size %#x", source, params->data, params->size); + + if (!source->valid_segment) + { + if (!(event = gst_event_new_segment(&source->segment)) + || !gst_pad_push_event(source->src_pad, event)) + GST_ERROR("Failed to push new segment event"); + source->valid_segment = true; + } + + if (!params->size) + { + if (source->segment.start != source->segment.stop) + goto eos; + return STATUS_SUCCESS; + } + + if (!(buffer = create_buffer_from_bytes(params->data, params->size))) + { + GST_WARNING("Failed to allocate buffer for data"); + return STATUS_UNSUCCESSFUL; + } + + source->segment.start += params->size; + if ((ret = gst_pad_push(source->src_pad, buffer)) && ret != GST_FLOW_EOS) + { + GST_WARNING("Failed to push data buffer, ret %d", ret); + source->segment.start -= params->size; + return STATUS_UNSUCCESSFUL; + } + + if (source->segment.start != source->segment.stop) + return STATUS_SUCCESS; + +eos: + if (!(event = gst_event_new_eos()) + || !gst_pad_push_event(source->src_pad, event)) + GST_WARNING("Failed to push EOS event"); + source->segment.start = source->segment.stop; + + return STATUS_SUCCESS; +} + +NTSTATUS wg_source_read_data(void *args) +{ + struct wg_source_read_data_params *params = args; + struct wg_source *source = get_source(params->source); + struct wg_sample *sample = params->sample; + NTSTATUS status = STATUS_SUCCESS; + guint index = params->index; + GstMapInfo info = {0}; + GstBuffer *buffer; + + GST_TRACE("source %p, index %#x, sample %p", source, index, sample); + + if ((status = source_get_stream_buffer(source, index, &buffer))) + return status; + + if (!gst_buffer_map(buffer, &info, GST_MAP_READ)) + status = STATUS_UNSUCCESSFUL; + else + { + if (info.size > sample->max_size) + status = STATUS_BUFFER_TOO_SMALL; + else + { + memcpy(wg_sample_data(sample), info.data, info.size); + sample->size = info.size; + + if (GST_BUFFER_PTS_IS_VALID(buffer)) + { + sample->flags |= WG_SAMPLE_FLAG_HAS_PTS; + sample->pts = GST_BUFFER_PTS(buffer) / 100; + } + else if (GST_BUFFER_DTS_IS_VALID(buffer)) + { + sample->flags |= WG_SAMPLE_FLAG_HAS_PTS; + sample->pts = GST_BUFFER_DTS(buffer) / 100; + } + if (GST_BUFFER_DURATION_IS_VALID(buffer)) + { + GstClockTime duration = GST_BUFFER_DURATION(buffer) / 100; + sample->flags |= WG_SAMPLE_FLAG_HAS_DURATION; + sample->duration = duration; + } + if (!GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT)) + sample->flags |= WG_SAMPLE_FLAG_SYNC_POINT; + if (GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DISCONT)) + sample->flags |= WG_SAMPLE_FLAG_DISCONTINUITY; + + gst_buffer_unref(source->streams[index].buffer); + source->streams[index].buffer = NULL; + } + + sample->max_size = info.size; + gst_buffer_unmap(buffer, &info); + } + + gst_buffer_unref(buffer); + return status; +} + +NTSTATUS wg_source_get_stream_format(void *args) +{ + struct wg_source_get_stream_format_params *params = args; + struct wg_source *source = get_source(params->source); + guint index = params->index; + GstCaps *caps; + + GST_TRACE("source %p, index %u", source, index); + + if (!(caps = source_get_stream_caps(source, index))) + return STATUS_UNSUCCESSFUL; + wg_format_from_caps(¶ms->format, caps); + + gst_caps_unref(caps); + return STATUS_SUCCESS; +} + +static gchar *stream_lang_from_tags(GstTagList *tags, bool is_quicktime) +{ + gchar *value; + + if (!gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &value) || !value) + return NULL; + + if (is_quicktime) + { + /* For QuickTime media, we convert the language tags to ISO 639-1. */ + const gchar *lang_code_iso_639_1 = gst_tag_get_language_code_iso_639_1(value); + gchar *tmp = lang_code_iso_639_1 ? g_strdup(lang_code_iso_639_1) : NULL; + g_free(value); + value = tmp; + } + + return value; +} + +static gchar *stream_name_from_tags(GstTagList *tags) +{ + /* Extract stream name from Quick Time demuxer private tag where it puts unrecognized chunks. */ + guint i, tag_count = gst_tag_list_get_tag_size(tags, "private-qt-tag"); + gchar *value = NULL; + + for (i = 0; !value && i < tag_count; ++i) + { + const gchar *name; + const GValue *val; + GstSample *sample; + GstBuffer *buf; + gsize size; + + if (!(val = gst_tag_list_get_value_index(tags, "private-qt-tag", i))) + continue; + if (!GST_VALUE_HOLDS_SAMPLE(val) || !(sample = gst_value_get_sample(val))) + continue; + name = gst_structure_get_name(gst_sample_get_info(sample)); + if (!name || strcmp(name, "application/x-gst-qt-name-tag")) + continue; + if (!(buf = gst_sample_get_buffer(sample))) + continue; + if ((size = gst_buffer_get_size(buf)) < 8) + continue; + size -= 8; + if (!(value = g_malloc(size + 1))) + return NULL; + if (gst_buffer_extract(buf, 8, value, size) != size) + { + g_free(value); + value = NULL; + continue; + } + value[size] = 0; + } + + return value; +} + +NTSTATUS wg_source_get_stream_tag(void *args) +{ + struct wg_source_get_stream_tag_params *params = args; + struct wg_source *source = get_source(params->source); + enum wg_parser_tag tag = params->tag; + guint index = params->index; + GstTagList *tags; + NTSTATUS status; + uint32_t len; + gchar *value; + + GST_TRACE("source %p, index %u, tag %u", source, index, tag); + + if (params->tag >= WG_PARSER_TAG_COUNT) + return STATUS_INVALID_PARAMETER; + if (!(tags = source_get_stream_tags(source, index))) + return STATUS_UNSUCCESSFUL; + + switch (tag) + { + case WG_PARSER_TAG_LANGUAGE: + { + bool is_quicktime = false; + GstCaps *caps; + + if ((caps = gst_pad_get_current_caps(source->src_pad))) + { + is_quicktime = !strcmp(media_type_from_caps(caps), "video/quicktime"); + gst_caps_unref(caps); + } + + value = stream_lang_from_tags(tags, is_quicktime); + break; + } + case WG_PARSER_TAG_NAME: + value = stream_name_from_tags(tags); + break; + default: + GST_FIXME("Unsupported stream tag %u", tag); + value = NULL; + break; + } + + if (!value) + goto error; + + if ((len = strlen(value) + 1) > params->size) + { + params->size = len; + status = STATUS_BUFFER_TOO_SMALL; + } + else + { + memcpy(params->buffer, value, len); + status = STATUS_SUCCESS; + } + + gst_tag_list_unref(tags); + g_free(value); + return status; + +error: + gst_tag_list_unref(tags); + return STATUS_NOT_FOUND; +} + +NTSTATUS wg_source_set_stream_flags(void *args) +{ + struct wg_source_set_stream_flags_params *params = args; + struct wg_source *source = get_source(params->source); + BOOL select = params->select; + guint index = params->index; + GstStreamFlags flags; + + GST_TRACE("source %p, index %u, select %u", source, index, select); + + flags = select ? GST_STREAM_FLAG_SELECT : GST_STREAM_FLAG_UNSELECT; + if (!source_set_stream_flags(source, index, flags)) + return STATUS_UNSUCCESSFUL; + + if (!select) + { + GstBuffer *buffer; + + while (!source_get_stream_buffer(source, index, &buffer)) + { + gst_buffer_unref(source->streams[index].buffer); + source->streams[index].buffer = NULL; + gst_buffer_unref(buffer); + } + } + + return STATUS_SUCCESS; +} diff --git a/dlls/winegstreamer/wg_task_pool.c b/dlls/winegstreamer/wg_task_pool.c new file mode 100644 index 00000000000..ec7da286d5f --- /dev/null +++ b/dlls/winegstreamer/wg_task_pool.c @@ -0,0 +1,98 @@ +/* + * GStreamer task pool + * + * Copyright 2023 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include + +#include + +#include "unix_private.h" + +typedef struct +{ + GstTaskPool parent; +} WgTaskPool; + +typedef struct +{ + GstTaskPoolClass parent_class; +} WgTaskPoolClass; + +G_DEFINE_TYPE(WgTaskPool, wg_task_pool, GST_TYPE_TASK_POOL); + +static void wg_task_pool_prepare(GstTaskPool *pool, GError **error) +{ + GST_LOG("pool %p, error %p", pool, error); +} + +static void wg_task_pool_cleanup(GstTaskPool *pool) +{ + GST_LOG("pool %p", pool); +} + +static gpointer wg_task_pool_push(GstTaskPool *pool, GstTaskPoolFunction func, gpointer data, GError **error) +{ + pthread_t *tid; + gint res; + + GST_LOG("pool %p, func %p, data %p, error %p", pool, func, data, error); + + if (!(tid = malloc(sizeof(*tid))) || !(res = pthread_create(tid, NULL, (void *)func, data))) + return tid; + + g_set_error(error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN, "Error creating thread: %s", g_strerror(res)); + free(tid); + + return NULL; +} + +static void wg_task_pool_join(GstTaskPool *pool, gpointer id) +{ + pthread_t *tid = id; + + GST_LOG("pool %p, id %p", pool, id); + + pthread_join(*tid, NULL); + free(tid); +} + +static void wg_task_pool_class_init(WgTaskPoolClass *klass) +{ + GstTaskPoolClass *parent_class = (GstTaskPoolClass *)klass; + parent_class->prepare = wg_task_pool_prepare; + parent_class->cleanup = wg_task_pool_cleanup; + parent_class->push = wg_task_pool_push; + parent_class->join = wg_task_pool_join; +} + +static void wg_task_pool_init(WgTaskPool *pool) +{ +} + +GstTaskPool *wg_task_pool_new(void) +{ + return g_object_new(wg_task_pool_get_type(), NULL); +} diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index ab5ce381fc5..3a17ac9b401 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -87,7 +87,7 @@ static GstFlowReturn transform_sink_chain_cb(GstPad *pad, GstObject *parent, Gst struct wg_transform *transform = gst_pad_get_element_private(pad); GstSample *sample; - GST_LOG("transform %p, buffer %p.", transform, buffer); + GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, buffer); if (!(sample = gst_sample_new(buffer, transform->output_caps, NULL, NULL))) { @@ -107,7 +107,7 @@ static GstFlowReturn transform_sink_chain_cb(GstPad *pad, GstObject *parent, Gst static gboolean transform_src_query_latency(struct wg_transform *transform, GstQuery *query) { - GST_LOG("transform %p, query %p", transform, query); + GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, query); gst_query_set_latency(query, transform->attrs.low_latency, 0, 0); return true; } @@ -121,132 +121,177 @@ static gboolean transform_src_query_cb(GstPad *pad, GstObject *parent, GstQuery case GST_QUERY_LATENCY: return transform_src_query_latency(transform, query); default: + GST_TRACE("transform %p, ignoring %"GST_PTR_FORMAT, transform, query); return gst_pad_query_default(pad, parent, query); } } -static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +static gboolean transform_sink_query_allocation(struct wg_transform *transform, GstQuery *query) { - struct wg_transform *transform = gst_pad_get_element_private(pad); + gsize plane_align = transform->attrs.output_plane_align; + GstStructure *config, *params; + GstVideoAlignment align; + gboolean needs_pool; + GstBufferPool *pool; + GstVideoInfo info; + GstCaps *caps; - GST_LOG("transform %p, type \"%s\".", transform, gst_query_type_get_name(query->type)); + GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, query); - switch (query->type) - { - case GST_QUERY_ALLOCATION: - { - gsize plane_align = transform->attrs.output_plane_align; - GstStructure *config, *params; - GstVideoAlignment align; - gboolean needs_pool; - GstBufferPool *pool; - GstVideoInfo info; - GstCaps *caps; + gst_query_parse_allocation(query, &caps, &needs_pool); + if (stream_type_from_caps(caps) != GST_STREAM_TYPE_VIDEO || !needs_pool) + return false; - gst_query_parse_allocation(query, &caps, &needs_pool); - if (stream_type_from_caps(caps) != GST_STREAM_TYPE_VIDEO || !needs_pool) - break; + if (!gst_video_info_from_caps(&info, caps) + || !(pool = gst_video_buffer_pool_new())) + return false; - if (!gst_video_info_from_caps(&info, caps) - || !(pool = gst_video_buffer_pool_new())) - break; + align_video_info_planes(plane_align, &info, &align); - align_video_info_planes(plane_align, &info, &align); + if ((params = gst_structure_new("video-meta", + "padding-top", G_TYPE_UINT, align.padding_top, + "padding-bottom", G_TYPE_UINT, align.padding_bottom, + "padding-left", G_TYPE_UINT, align.padding_left, + "padding-right", G_TYPE_UINT, align.padding_right, + NULL))) + { + gst_query_add_allocation_meta(query, GST_VIDEO_META_API_TYPE, params); + gst_structure_free(params); + } - if ((params = gst_structure_new("video-meta", - "padding-top", G_TYPE_UINT, align.padding_top, - "padding-bottom", G_TYPE_UINT, align.padding_bottom, - "padding-left", G_TYPE_UINT, align.padding_left, - "padding-right", G_TYPE_UINT, align.padding_right, - NULL))) - { - gst_query_add_allocation_meta(query, GST_VIDEO_META_API_TYPE, params); - gst_structure_free(params); - } + if (!(config = gst_buffer_pool_get_config(pool))) + GST_ERROR("Failed to get %"GST_PTR_FORMAT" config.", pool); + else + { + gst_buffer_pool_config_add_option(config, GST_BUFFER_POOL_OPTION_VIDEO_META); + gst_buffer_pool_config_add_option(config, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); + gst_buffer_pool_config_set_video_alignment(config, &align); + + gst_buffer_pool_config_set_params(config, caps, + info.size, 0, 0); + gst_buffer_pool_config_set_allocator(config, transform->allocator, NULL); + if (!gst_buffer_pool_set_config(pool, config)) + GST_ERROR("Failed to set %"GST_PTR_FORMAT" config.", pool); + } - if (!(config = gst_buffer_pool_get_config(pool))) - GST_ERROR("Failed to get pool %p config.", pool); - else - { - gst_buffer_pool_config_add_option(config, GST_BUFFER_POOL_OPTION_VIDEO_META); - gst_buffer_pool_config_add_option(config, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); - gst_buffer_pool_config_set_video_alignment(config, &align); - - gst_buffer_pool_config_set_params(config, caps, - info.size, 0, 0); - gst_buffer_pool_config_set_allocator(config, transform->allocator, NULL); - if (!gst_buffer_pool_set_config(pool, config)) - GST_ERROR("Failed to set pool %p config.", pool); - } + /* Prevent pool reconfiguration, we don't want another alignment. */ + if (!gst_buffer_pool_set_active(pool, true)) + GST_ERROR("%"GST_PTR_FORMAT" failed to activate.", pool); - /* Prevent pool reconfiguration, we don't want another alignment. */ - if (!gst_buffer_pool_set_active(pool, true)) - GST_ERROR("Pool %p failed to activate.", pool); + gst_query_add_allocation_pool(query, pool, info.size, 0, 0); + gst_query_add_allocation_param(query, transform->allocator, NULL); - gst_query_add_allocation_pool(query, pool, info.size, 0, 0); - gst_query_add_allocation_param(query, transform->allocator, NULL); + GST_INFO("Proposing %"GST_PTR_FORMAT", buffer size %#zx, %"GST_PTR_FORMAT", for %"GST_PTR_FORMAT, + pool, info.size, transform->allocator, query); - GST_INFO("Proposing pool %p, buffer size %#zx, allocator %p, for query %p.", - pool, info.size, transform->allocator, query); + g_object_unref(pool); + return true; +} - g_object_unref(pool); - return true; - } +static GstCaps *transform_format_to_caps(struct wg_transform *transform, const struct wg_format *format) +{ + struct wg_format copy = *format; - case GST_QUERY_CAPS: - { - GstCaps *caps, *filter, *temp; + if (format->major_type == WG_MAJOR_TYPE_VIDEO) + { + if (transform->attrs.allow_size_change) + copy.u.video.width = copy.u.video.height = 0; + copy.u.video.fps_n = copy.u.video.fps_d = 0; + } - gst_query_parse_caps(query, &filter); - if (!(caps = wg_format_to_caps(&transform->output_format))) - break; + return wg_format_to_caps(©); +} - if (filter) - { - temp = gst_caps_intersect(caps, filter); - gst_caps_unref(caps); - caps = temp; - } +static gboolean transform_sink_query_caps(struct wg_transform *transform, GstQuery *query) +{ + GstCaps *caps, *filter, *temp; - GST_INFO("Returning caps %" GST_PTR_FORMAT, caps); + GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, query); - gst_query_set_caps_result(query, caps); - gst_caps_unref(caps); - return true; - } + gst_query_parse_caps(query, &filter); + if (!(caps = transform_format_to_caps(transform, &transform->output_format))) + return false; - default: - GST_WARNING("Ignoring \"%s\" query.", gst_query_type_get_name(query->type)); - break; + if (filter) + { + temp = gst_caps_intersect(caps, filter); + gst_caps_unref(caps); + caps = temp; } - return gst_pad_query_default(pad, parent, query); + GST_INFO("Returning caps %" GST_PTR_FORMAT, caps); + + gst_query_set_caps_result(query, caps); + gst_caps_unref(caps); + return true; } -static gboolean transform_sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) { struct wg_transform *transform = gst_pad_get_element_private(pad); - GST_LOG("transform %p, type \"%s\".", transform, GST_EVENT_TYPE_NAME(event)); + switch (query->type) + { + case GST_QUERY_ALLOCATION: + if (transform_sink_query_allocation(transform, query)) + return true; + break; + case GST_QUERY_CAPS: + if (transform_sink_query_caps(transform, query)) + return true; + break; + default: + break; + } + + GST_TRACE("transform %p, ignoring %"GST_PTR_FORMAT, transform, query); + return gst_pad_query_default(pad, parent, query); +} - switch (event->type) +static gboolean transform_output_caps_is_compatible(struct wg_transform *transform, GstCaps *caps) +{ + GstCaps *copy = gst_caps_copy(caps); + gboolean ret; + gsize i; + + for (i = 0; i < gst_caps_get_size(copy); ++i) { - case GST_EVENT_CAPS: - { - GstCaps *caps; + GstStructure *structure = gst_caps_get_structure(copy, i); + gst_structure_remove_fields(structure, "framerate", NULL); + } - gst_event_parse_caps(event, &caps); + ret = gst_caps_is_always_compatible(transform->output_caps, copy); + gst_caps_unref(copy); + return ret; +} - transform->output_caps_changed = transform->output_caps_changed - || !gst_caps_is_always_compatible(transform->output_caps, caps); +static void transform_sink_event_caps(struct wg_transform *transform, GstEvent *event) +{ + GstCaps *caps; - gst_caps_unref(transform->output_caps); - transform->output_caps = gst_caps_ref(caps); - break; - } - default: - GST_WARNING("Ignoring \"%s\" event.", GST_EVENT_TYPE_NAME(event)); - break; + GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, event); + + gst_event_parse_caps(event, &caps); + + transform->output_caps_changed = transform->output_caps_changed + || !transform_output_caps_is_compatible(transform, caps); + + gst_caps_unref(transform->output_caps); + transform->output_caps = gst_caps_ref(caps); +} + +static gboolean transform_sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +{ + struct wg_transform *transform = gst_pad_get_element_private(pad); + + switch (event->type) + { + case GST_EVENT_CAPS: + transform_sink_event_caps(transform, event); + break; + default: + GST_TRACE("transform %p, ignoring %"GST_PTR_FORMAT, transform, event); + break; } gst_event_unref(event); @@ -300,6 +345,10 @@ NTSTATUS wg_transform_create(void *args) const gchar *media_type; GstEvent *event; + /* to detect h264_decoder_create() */ + if (input_format.major_type == WG_MAJOR_TYPE_VIDEO_H264) + touch_h264_used_tag(); + if (!(transform = calloc(1, sizeof(*transform)))) return STATUS_NO_MEMORY; if (!(transform->container = gst_bin_new("wg_transform"))) @@ -315,7 +364,7 @@ NTSTATUS wg_transform_create(void *args) transform->attrs = *params->attrs; transform->output_format = output_format; - if (!(src_caps = wg_format_to_caps(&input_format))) + if (!(src_caps = transform_format_to_caps(transform, &input_format))) goto out; if (!(template = gst_pad_template_new("src", GST_PAD_SRC, GST_PAD_ALWAYS, src_caps))) goto out; @@ -324,10 +373,12 @@ NTSTATUS wg_transform_create(void *args) if (!transform->my_src) goto out; + GST_INFO("transform %p input caps %"GST_PTR_FORMAT, transform, src_caps); + gst_pad_set_element_private(transform->my_src, transform); gst_pad_set_query_function(transform->my_src, transform_src_query_cb); - if (!(transform->output_caps = wg_format_to_caps(&output_format))) + if (!(transform->output_caps = transform_format_to_caps(transform, &output_format))) goto out; if (!(template = gst_pad_template_new("sink", GST_PAD_SINK, GST_PAD_ALWAYS, transform->output_caps))) goto out; @@ -336,6 +387,8 @@ NTSTATUS wg_transform_create(void *args) if (!transform->my_sink) goto out; + GST_INFO("transform %p output caps %"GST_PTR_FORMAT, transform, transform->output_caps); + gst_pad_set_element_private(transform->my_sink, transform); gst_pad_set_event_function(transform->my_sink, transform_sink_event_cb); gst_pad_set_query_function(transform->my_sink, transform_sink_query_cb); @@ -351,10 +404,12 @@ NTSTATUS wg_transform_create(void *args) switch (input_format.major_type) { - case WG_MAJOR_TYPE_VIDEO_H264: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_AUDIO_MPEG1: case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: + case WG_MAJOR_TYPE_VIDEO_ENCODED: + case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_CINEPAK: case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_WMV: @@ -369,6 +424,7 @@ NTSTATUS wg_transform_create(void *args) case WG_MAJOR_TYPE_AUDIO: case WG_MAJOR_TYPE_VIDEO: + transform->attrs.input_queue_length = 16; break; case WG_MAJOR_TYPE_UNKNOWN: GST_FIXME("Format %u not implemented!", input_format.major_type); @@ -399,6 +455,19 @@ NTSTATUS wg_transform_create(void *args) break; case WG_MAJOR_TYPE_VIDEO: + { + const char *sgi; + if ((sgi = getenv("SteamGameId")) && ((!strcmp(sgi, "2009100")) || (!strcmp(sgi, "2555360")))) + { + if (!(element = create_element("videoconvert", "base")) + || !append_element(transform->container, element, &first, &last)) + goto out; + gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0"); + /* HACK: skip slow?? videoflip for some games */ + break; + } + } + if (!(element = create_element("videoconvert", "base")) || !append_element(transform->container, element, &first, &last)) goto out; @@ -419,11 +488,13 @@ NTSTATUS wg_transform_create(void *args) case WG_MAJOR_TYPE_AUDIO_MPEG1: case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_CINEPAK: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_MPEG1: + case WG_MAJOR_TYPE_VIDEO_ENCODED: GST_FIXME("Format %u not implemented!", output_format.major_type); goto out; } @@ -448,6 +519,20 @@ NTSTATUS wg_transform_create(void *args) || !push_event(transform->my_src, event)) goto out; + /* Check that the caps event have been accepted */ + if (input_format.major_type == WG_MAJOR_TYPE_VIDEO_H264) + { + GstPad *peer; + if (!(peer = gst_pad_get_peer(transform->my_src))) + goto out; + else if (!gst_pad_has_current_caps(peer)) + { + gst_object_unref(peer); + goto out; + } + gst_object_unref(peer); + } + /* We need to use GST_FORMAT_TIME here because it's the only format * some elements such avdec_wmav2 correctly support. */ gst_segment_init(&transform->segment, GST_FORMAT_TIME); @@ -498,14 +583,16 @@ NTSTATUS wg_transform_set_output_format(void *args) GstSample *sample; GstCaps *caps; - if (!(caps = wg_format_to_caps(format))) + if (!(caps = transform_format_to_caps(transform, format))) { GST_ERROR("Failed to convert format %p to caps.", format); return STATUS_UNSUCCESSFUL; } transform->output_format = *format; - if (gst_caps_is_always_compatible(transform->output_caps, caps)) + GST_INFO("transform %p output caps %"GST_PTR_FORMAT, transform, caps); + + if (transform_output_caps_is_compatible(transform, caps)) { gst_caps_unref(caps); return STATUS_SUCCESS; @@ -582,7 +669,7 @@ NTSTATUS wg_transform_push_data(void *args) else { InterlockedIncrement(&sample->refcount); - GST_INFO("Wrapped %u/%u bytes from sample %p to buffer %p", sample->size, sample->max_size, sample, buffer); + GST_INFO("Wrapped %u/%u bytes from sample %p to %"GST_PTR_FORMAT, sample->size, sample->max_size, sample, buffer); } if (sample->flags & WG_SAMPLE_FLAG_HAS_PTS) @@ -689,7 +776,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi if (!gst_buffer_map(buffer, &info, GST_MAP_READ)) { - GST_ERROR("Failed to map buffer %p", buffer); + GST_ERROR("Failed to map buffer %"GST_PTR_FORMAT, buffer); sample->size = 0; return STATUS_UNSUCCESSFUL; } @@ -706,7 +793,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi if (status) { - GST_ERROR("Failed to copy buffer %p", buffer); + GST_ERROR("Failed to copy buffer %"GST_PTR_FORMAT, buffer); sample->size = 0; return status; } @@ -795,6 +882,8 @@ NTSTATUS wg_transform_read_data(void *args) { GST_MINI_OBJECT_FLAG_UNSET(transform->output_sample, GST_SAMPLE_FLAG_WG_CAPS_CHANGED); + GST_INFO("transform %p output caps %"GST_PTR_FORMAT, transform, output_caps); + if (format) { gsize plane_align = transform->attrs.output_plane_align; diff --git a/dlls/winegstreamer/winegstreamer.rgs b/dlls/winegstreamer/winegstreamer.rgs index 923ba673f8c..c50d3a05747 100644 --- a/dlls/winegstreamer/winegstreamer.rgs +++ b/dlls/winegstreamer/winegstreamer.rgs @@ -12,3 +12,31 @@ HKCR } } } + +HKLM +{ + NoRemove 'Software' + { + NoRemove 'Microsoft' + { + NoRemove 'Windows Media Foundation' + { + NoRemove 'SchemeHandlers' + { + 'http:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + 'https:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + 'rtsp:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + } + } + } + } +} diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index bb727ca8645..dc56ad2b0ab 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -83,6 +83,24 @@ coclass VideoProcessorMFT {} ] coclass GStreamerByteStreamHandler {} +[ + threading(both), + uuid(317df619-5e5a-468a-9f15-d827a9a08162) +] +coclass GStreamerByteStreamHandler2 {} + +[ + threading(both), + uuid(480b1517-c8e9-4eae-b006-e6300718d85d) +] +coclass GStreamerAudioDecoder {} + +[ + threading(both), + uuid(480b1518-c8e9-4eae-b006-e6300718d85d) +] +coclass GStreamerVideoDecoder {} + [ threading(both), uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a) @@ -131,3 +149,10 @@ coclass MFMP3SinkClassFactory {} uuid(a22c4fc7-6e91-4e1d-89e9-53b2667b72ba) ] coclass MFMPEG4SinkClassFactory {} + +[ + helpstring("GStreamer scheme handler"), + threading(both), + uuid(587eeb6a-7336-4ebd-a4f2-91c948de622c) +] +coclass GStreamerSchemePlugin { } diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index e3a2bfc343b..a172f1cfbb3 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1452,7 +1452,10 @@ static HRESULT init_stream(struct wm_reader *reader) HRESULT hr; WORD i; - if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE))) + /* 32-bit GStreamer ORC cannot efficiently convert I420 to RGBA, use OpenGL converter + * in that case but keep the usual codepath otherwise. + */ + if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE, sizeof(void *) == 4))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; @@ -1464,7 +1467,7 @@ static HRESULT init_stream(struct wm_reader *reader) goto out_destroy_parser; } - if (FAILED(hr = wg_parser_connect(reader->wg_parser, reader->file_size))) + if (FAILED(hr = wg_parser_connect(reader->wg_parser, reader->file_size, NULL))) { ERR("Failed to connect parser, hr %#lx.\n", hr); goto out_shutdown_thread; @@ -1482,7 +1485,7 @@ static HRESULT init_stream(struct wm_reader *reader) { struct wm_stream *stream = &reader->streams[i]; - stream->wg_stream = wg_parser_get_stream(reader->wg_parser, i); + stream->wg_stream = wg_parser_get_stream(reader->wg_parser, reader->stream_count - i - 1); stream->reader = reader; stream->index = i; stream->selection = WMT_ON; @@ -1510,8 +1513,20 @@ static HRESULT init_stream(struct wm_reader *reader) /* API consumers expect RGB video to be bottom-up. */ if (stream->format.u.video.height > 0) stream->format.u.video.height = -stream->format.u.video.height; + + { + /* HACK: Persona 4 Golden tries to read compressed samples, and + * then autoplug them via quartz to a filter that only accepts + * BGRx. This is not trivial to implement. Return BGRx from the + * wmvcore reader for now. */ + + const char *id = getenv("SteamGameId"); + + if (id && !strcmp(id, "1113000")) + stream->format.u.video.format = WG_VIDEO_FORMAT_BGRx; + } } - wg_parser_stream_enable(stream->wg_stream, &stream->format); + wg_parser_stream_enable(stream->wg_stream, &stream->format, STREAM_ENABLE_FLAG_FLIP_RGB); } /* We probably discarded events because streams weren't enabled yet. @@ -1557,7 +1572,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) wg_parser_destroy(reader->wg_parser); reader->wg_parser = 0; - if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, read_compressed))) + if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, read_compressed, sizeof(void *) == 4 && !read_compressed))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; @@ -1569,7 +1584,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) goto out_destroy_parser; } - if (FAILED(hr = wg_parser_connect(reader->wg_parser, reader->file_size))) + if (FAILED(hr = wg_parser_connect(reader->wg_parser, reader->file_size, NULL))) { ERR("Failed to connect parser, hr %#lx.\n", hr); goto out_shutdown_thread; @@ -1582,11 +1597,11 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) struct wm_stream *stream = &reader->streams[i]; struct wg_format format; - stream->wg_stream = wg_parser_get_stream(reader->wg_parser, i); + stream->wg_stream = wg_parser_get_stream(reader->wg_parser, reader->stream_count - i - 1); stream->reader = reader; wg_parser_stream_get_preferred_format(stream->wg_stream, &format); if (stream->selection == WMT_ON) - wg_parser_stream_enable(stream->wg_stream, read_compressed ? &format : &stream->format); + wg_parser_stream_enable(stream->wg_stream, read_compressed ? &format : &stream->format, STREAM_ENABLE_FLAG_FLIP_RGB); } /* We probably discarded events because streams weren't enabled yet. @@ -1629,6 +1644,7 @@ static const enum wg_video_format video_formats[] = WG_VIDEO_FORMAT_YUY2, WG_VIDEO_FORMAT_UYVY, WG_VIDEO_FORMAT_YVYU, + WG_VIDEO_FORMAT_BGRA, WG_VIDEO_FORMAT_BGRx, WG_VIDEO_FORMAT_BGR, WG_VIDEO_FORMAT_RGB16, @@ -1659,6 +1675,10 @@ static const char *get_major_type_string(enum wg_major_type type) return "indeo"; case WG_MAJOR_TYPE_VIDEO_MPEG1: return "mpeg1-video"; + case WG_MAJOR_TYPE_AUDIO_ENCODED: + return "unknown-audio"; + case WG_MAJOR_TYPE_VIDEO_ENCODED: + return "unknown-video"; case WG_MAJOR_TYPE_UNKNOWN: return "unknown"; } @@ -1698,7 +1718,7 @@ static HRESULT wm_reader_read_stream_sample(struct wm_reader *reader, struct wg_ HRESULT hr; BYTE *data; - if (!(stream = wm_reader_get_stream_by_stream_number(reader, buffer->stream + 1))) + if (!(stream = wm_reader_get_stream_by_stream_number(reader, reader->stream_count - buffer->stream))) return E_INVALIDARG; TRACE("Got buffer for '%s' stream %p.\n", get_major_type_string(stream->format.major_type), stream); @@ -1936,7 +1956,8 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, if (!stream_number && !output_number && !ret_stream_number) return E_INVALIDARG; - EnterCriticalSection(&reader->cs); + if (reader->outer == &reader->IUnknown_inner) + EnterCriticalSection(&reader->cs); if (!stream_number) stream = NULL; @@ -1953,7 +1974,7 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, if (!wg_parser_stream_get_buffer(reader->wg_parser, stream ? stream->wg_stream : 0, &wg_buffer)) hr = NS_E_NO_MORE_SAMPLES; else if (SUCCEEDED(hr = wm_reader_read_stream_sample(reader, &wg_buffer, sample, pts, duration, flags))) - stream_number = wg_buffer.stream + 1; + stream_number = reader->stream_count - wg_buffer.stream; } if (stream && hr == NS_E_NO_MORE_SAMPLES) @@ -1964,7 +1985,8 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, if (ret_stream_number && (hr == S_OK || stream_number)) *ret_stream_number = stream_number; - LeaveCriticalSection(&reader->cs); + if (reader->outer == &reader->IUnknown_inner) + LeaveCriticalSection(&reader->cs); return hr; } @@ -2025,11 +2047,13 @@ static HRESULT WINAPI reader_GetOutputFormat(IWMSyncReader2 *iface, case WG_MAJOR_TYPE_AUDIO_MPEG1: case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_CINEPAK: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_MPEG1: + case WG_MAJOR_TYPE_VIDEO_ENCODED: FIXME("Format %u not implemented!\n", format.major_type); break; case WG_MAJOR_TYPE_UNKNOWN: @@ -2068,11 +2092,13 @@ static HRESULT WINAPI reader_GetOutputFormatCount(IWMSyncReader2 *iface, DWORD o case WG_MAJOR_TYPE_AUDIO_MPEG1: case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: + case WG_MAJOR_TYPE_AUDIO_ENCODED: case WG_MAJOR_TYPE_VIDEO_CINEPAK: case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_MPEG1: + case WG_MAJOR_TYPE_VIDEO_ENCODED: FIXME("Format %u not implemented!\n", format.major_type); /* fallthrough */ case WG_MAJOR_TYPE_AUDIO: @@ -2224,18 +2250,36 @@ static HRESULT WINAPI reader_Open(IWMSyncReader2 *iface, const WCHAR *filename) static HRESULT WINAPI reader_OpenStream(IWMSyncReader2 *iface, IStream *stream) { + static const ULONG64 canary_size = 0xdeadbeeffeedcafe; struct wm_reader *reader = impl_from_IWMSyncReader2(iface); STATSTG stat; HRESULT hr; TRACE("reader %p, stream %p.\n", reader, stream); + stat.cbSize.QuadPart = canary_size; if (FAILED(hr = IStream_Stat(stream, &stat, STATFLAG_NONAME))) { ERR("Failed to stat stream, hr %#lx.\n", hr); return hr; } + if (stat.cbSize.QuadPart == canary_size) + { + /* Call of Juarez: Gunslinger implements IStream_Stat as an empty function returning S_OK, leaving + * the output stat unchanged. Windows doesn't call IStream_Seek(_SEEK_END) and probably validates + * the size against WMV file headers so the bigger cbSize doesn't change anything. + * Such streams work as soon as the uninitialized cbSize is big enough which is usually the case + * (if that is not the case Windows will favour shorter cbSize). */ + static const LARGE_INTEGER zero = { 0 }; + ULARGE_INTEGER pos = { .QuadPart = canary_size }; + + if (SUCCEEDED(hr = IStream_Seek(stream, zero, STREAM_SEEK_END, &pos))) + IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); + stat.cbSize.QuadPart = pos.QuadPart == canary_size ? 0 : pos.QuadPart; + ERR("IStream_Stat did not fill the stream size, size from _Seek %I64u.\n", stat.cbSize.QuadPart); + } + EnterCriticalSection(&reader->cs); if (reader->wg_parser) @@ -2325,7 +2369,7 @@ static HRESULT WINAPI reader_SetOutputProps(IWMSyncReader2 *iface, DWORD output, } stream->format = format; - wg_parser_stream_enable(stream->wg_stream, &format); + wg_parser_stream_enable(stream->wg_stream, &format, STREAM_ENABLE_FLAG_FLIP_RGB); /* Re-decode any buffers that might have been generated with the old format. * @@ -2421,8 +2465,11 @@ static HRESULT WINAPI reader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD st return E_INVALIDARG; } - stream->read_compressed = compressed; - reinit_stream(reader, compressed); + if (stream->read_compressed != compressed) + { + stream->read_compressed = compressed; + reinit_stream(reader, compressed); + } LeaveCriticalSection(&reader->cs); return S_OK; @@ -2472,11 +2519,11 @@ static HRESULT WINAPI reader_SetStreamsSelected(IWMSyncReader2 *iface, { struct wg_format format; wg_parser_stream_get_preferred_format(stream->wg_stream, &format); - wg_parser_stream_enable(stream->wg_stream, &format); + wg_parser_stream_enable(stream->wg_stream, &format, STREAM_ENABLE_FLAG_FLIP_RGB); } else { - wg_parser_stream_enable(stream->wg_stream, &stream->format); + wg_parser_stream_enable(stream->wg_stream, &stream->format, STREAM_ENABLE_FLAG_FLIP_RGB); } } } diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 62279e4d108..a4380d3a3b5 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -29,7 +29,8 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wmadec); -WINE_DECLARE_DEBUG_CHANNEL(winediag); + +extern const GUID MFAudioFormat_XMAudio2; static const GUID *const wma_decoder_input_types[] = { @@ -37,6 +38,7 @@ static const GUID *const wma_decoder_input_types[] = &MFAudioFormat_WMAudioV8, &MFAudioFormat_WMAudioV9, &MFAudioFormat_WMAudio_Lossless, + &MFAudioFormat_XMAudio2, }; static const GUID *const wma_decoder_output_types[] = { @@ -499,7 +501,18 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("iface %p, message %#x, param %p stub!\n", iface, message, (void *)param); + struct wma_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, message %#x, param %p.\n", iface, message, (void *)param); + + if (!decoder->wg_transform) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + if (message == MFT_MESSAGE_COMMAND_DRAIN) + return wg_transform_drain(decoder->wg_transform); + + FIXME("Ignoring message %#x.\n", message); + return S_OK; } @@ -700,7 +713,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index { struct wma_decoder *decoder = impl_from_IMediaObject(iface); struct wg_format wg_format; - unsigned int i; TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); @@ -727,15 +739,8 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Audio)) return DMO_E_TYPE_NOT_ACCEPTED; - for (i = 0; i < ARRAY_SIZE(wma_decoder_input_types); ++i) - if (IsEqualGUID(&type->subtype, wma_decoder_input_types[i])) - break; - if (i == ARRAY_SIZE(wma_decoder_input_types)) - return DMO_E_TYPE_NOT_ACCEPTED; - if (!amt_to_wg_format((const AM_MEDIA_TYPE *)type, &wg_format)) return DMO_E_TYPE_NOT_ACCEPTED; - assert(wg_format.major_type == WG_MAJOR_TYPE_AUDIO_WMA); if (flags & DMO_SET_TYPEF_TEST_ONLY) return S_OK; @@ -1026,32 +1031,11 @@ static const IPropertyBagVtbl property_bag_vtbl = HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out) { - static const struct wg_format output_format = - { - .major_type = WG_MAJOR_TYPE_AUDIO, - .u.audio = - { - .format = WG_AUDIO_FORMAT_F32LE, - .channel_mask = 1, - .channels = 1, - .rate = 44100, - }, - }; - static const struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_AUDIO_WMA}; - struct wg_transform_attrs attrs = {0}; - wg_transform_t transform; struct wma_decoder *decoder; HRESULT hr; TRACE("outer %p, out %p.\n", outer, out); - if (!(transform = wg_transform_create(&input_format, &output_format, &attrs))) - { - ERR_(winediag)("GStreamer doesn't support WMA decoding, please install appropriate plugins\n"); - return E_FAIL; - } - wg_transform_destroy(transform); - if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; diff --git a/dlls/winegstreamer/wmv_decoder.c b/dlls/winegstreamer/wmv_decoder.c index 89da25074c6..edd6c744e94 100644 --- a/dlls/winegstreamer/wmv_decoder.c +++ b/dlls/winegstreamer/wmv_decoder.c @@ -28,7 +28,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mfplat); -WINE_DECLARE_DEBUG_CHANNEL(winediag); extern const GUID MEDIASUBTYPE_VC1S; @@ -486,7 +485,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index { struct wmv_decoder *decoder = impl_from_IMediaObject(iface); struct wg_format wg_format; - unsigned int i; TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); @@ -511,17 +509,8 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Video)) return DMO_E_TYPE_NOT_ACCEPTED; - for (i = 0; i < ARRAY_SIZE(wmv_decoder_input_types); ++i) - if (IsEqualGUID(&type->subtype, wmv_decoder_input_types[i])) - break; - if (i == ARRAY_SIZE(wmv_decoder_input_types)) - return DMO_E_TYPE_NOT_ACCEPTED; - if (!amt_to_wg_format((const AM_MEDIA_TYPE *)type, &wg_format)) return DMO_E_TYPE_NOT_ACCEPTED; - assert(wg_format.major_type == WG_MAJOR_TYPE_VIDEO_WMV); - wg_format.u.video_wmv.fps_n = 0; - wg_format.u.video_wmv.fps_d = 0; if (flags & DMO_SET_TYPEF_TEST_ONLY) return S_OK; @@ -579,8 +568,6 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde if (!amt_to_wg_format((const AM_MEDIA_TYPE *)type, &wg_format)) return DMO_E_TYPE_NOT_ACCEPTED; assert(wg_format.major_type == WG_MAJOR_TYPE_VIDEO); - wg_format.u.video.fps_n = 0; - wg_format.u.video.fps_d = 0; if (flags & DMO_SET_TYPEF_TEST_ONLY) return S_OK; @@ -880,35 +867,11 @@ static const IPropertyStoreVtbl property_store_vtbl = HRESULT wmv_decoder_create(IUnknown *outer, IUnknown **out) { - static const struct wg_format input_format = - { - .major_type = WG_MAJOR_TYPE_VIDEO_WMV, - .u.video_wmv.format = WG_WMV_VIDEO_FORMAT_WMV3, - }; - static const struct wg_format output_format = - { - .major_type = WG_MAJOR_TYPE_VIDEO, - .u.video = - { - .format = WG_VIDEO_FORMAT_NV12, - .width = 1920, - .height = 1080, - }, - }; - struct wg_transform_attrs attrs = {0}; - wg_transform_t transform; struct wmv_decoder *decoder; HRESULT hr; TRACE("outer %p, out %p.\n", outer, out); - if (!(transform = wg_transform_create(&input_format, &output_format, &attrs))) - { - ERR_(winediag)("GStreamer doesn't support WMV decoding, please install appropriate plugins.\n"); - return E_FAIL; - } - wg_transform_destroy(transform); - if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index bf1daa7a5df..b378bb0c99e 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -990,6 +990,7 @@ void macdrv_compute_keyboard_layout(struct macdrv_thread_data *thread_data) */ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, unsigned int flags, unsigned int time) { + RAWINPUT rawinput; INPUT input; TRACE_(key)("hwnd %p vkey=%04x scan=%04x flags=%04x\n", hwnd, vkey, scan, flags); @@ -1001,7 +1002,7 @@ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, unsigned input.ki.time = time; input.ki.dwExtraInfo = 0; - __wine_send_input(hwnd, &input, NULL); + __wine_send_input(hwnd, &input, &rawinput); } diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 2f05a33a8b5..5799cb06a19 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -129,6 +129,7 @@ static const CFStringRef cocoa_cursor_names[] = static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags, int x, int y, DWORD mouse_data, BOOL drag, unsigned long time) { + RAWINPUT rawinput; INPUT input; HWND top_level_hwnd; @@ -158,7 +159,7 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags, input.mi.time = time; input.mi.dwExtraInfo = 0; - __wine_send_input(top_level_hwnd, &input, NULL); + __wine_send_input(top_level_hwnd, &input, &rawinput); } diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c index 22d47155861..53e34a0235b 100644 --- a/dlls/winemac.drv/vulkan.c +++ b/dlls/winemac.drv/vulkan.c @@ -591,6 +591,8 @@ static VkSurfaceKHR macdrv_wine_get_host_surface(VkSurfaceKHR surface) static const struct vulkan_funcs vulkan_funcs = { + NULL, + NULL, macdrv_vkCreateInstance, macdrv_vkCreateSwapchainKHR, macdrv_vkCreateWin32SurfaceKHR, diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 9a7a0fbb5d9..41a82cbf5da 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1731,6 +1731,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = oss_get_position, oss_set_volumes, oss_set_event_handle, + NULL, oss_test_connect, oss_is_started, oss_get_prop_value, @@ -2226,6 +2227,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = oss_wow64_get_position, oss_wow64_set_volumes, oss_wow64_set_event_handle, + oss_not_implemented, oss_wow64_test_connect, oss_is_started, oss_wow64_get_prop_value, diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 62658fc98e6..944cf938bdc 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -395,6 +395,7 @@ static HRESULT pulse_connect(const char *name) pa_context_unref(pulse_ctx); pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), name); + setenv("PULSE_PROP_application.name", name, 1); if (!pulse_ctx) { ERR("Failed to create context\n"); return E_FAIL; @@ -723,7 +724,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE ret = -1; else if (render) ret = pa_stream_connect_playback(stream, pulse_name, &attr, - PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS, NULL, NULL); + PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS|PA_STREAM_VARIABLE_RATE, NULL, NULL); else ret = pa_stream_connect_record(stream, pulse_name, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS); if (ret >= 0) { @@ -1070,6 +1071,8 @@ static HRESULT pulse_stream_connect(struct pulse_stream *stream, const char *pul else pulse_name = NULL; /* use default */ + if (stream->dataflow == eRender) flags |= PA_STREAM_VARIABLE_RATE; + if (stream->dataflow == eRender) ret = pa_stream_connect_playback(stream->stream, pulse_name, &attr, flags, NULL, NULL); else @@ -2438,6 +2441,41 @@ static NTSTATUS pulse_set_event_handle(void *args) return STATUS_SUCCESS; } +static NTSTATUS pulse_set_sample_rate(void *args) +{ + struct set_sample_rate_params *params = args; + struct pulse_stream *stream = handle_get_stream(params->stream); + HRESULT hr = S_OK; + pa_operation *o; + int success; + + pulse_lock(); + if (!pulse_stream_valid(stream)) + hr = AUDCLNT_E_DEVICE_INVALIDATED; + else + { + if (!(o = pa_stream_update_sample_rate(stream->stream, params->new_rate, pulse_op_cb, &success))) + success = 0; + else + { + while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) + pthread_cond_wait(&pulse_cond, &pulse_mutex); + pa_operation_unref(o); + } + + if (!success) hr = E_FAIL; + else + { + stream->ss.rate = params->new_rate; + stream->period_bytes = pa_frame_size(&stream->ss) * muldiv(stream->mmdev_period_usec, stream->ss.rate, 1000000); + } + } + pulse_unlock(); + + params->result = hr; + return STATUS_SUCCESS; +} + static NTSTATUS pulse_is_started(void *args) { struct is_started_params *params = args; @@ -2562,6 +2600,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = pulse_get_position, pulse_set_volumes, pulse_set_event_handle, + pulse_set_sample_rate, pulse_test_connect, pulse_is_started, pulse_get_prop_value, @@ -3033,6 +3072,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = pulse_wow64_get_position, pulse_wow64_set_volumes, pulse_wow64_set_event_handle, + pulse_not_implemented, pulse_wow64_test_connect, pulse_is_started, pulse_wow64_get_prop_value, diff --git a/dlls/winevulkan/loader.c b/dlls/winevulkan/loader.c index 19fd240f0cb..e35b4f42427 100644 --- a/dlls/winevulkan/loader.c +++ b/dlls/winevulkan/loader.c @@ -39,20 +39,6 @@ static HINSTANCE hinstance; static void *wine_vk_get_global_proc_addr(const char *name); -#define wine_vk_find_struct(s, t) wine_vk_find_struct_((void *)s, VK_STRUCTURE_TYPE_##t) -static void *wine_vk_find_struct_(void *s, VkStructureType t) -{ - VkBaseOutStructure *header; - - for (header = s; header; header = header->pNext) - { - if (header->sType == t) - return header; - } - - return NULL; -} - VkResult WINAPI vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayerProperties *properties) { TRACE("%p, %p\n", count, properties); @@ -430,6 +416,41 @@ static void fill_luid_property(VkPhysicalDeviceProperties2 *properties2) device_node_mask); } +static void fixup_device_id(UINT *vendor_id, UINT *device_id) +{ + const char *sgi; + + if (*vendor_id == 0x10de /* NVIDIA */ && (sgi = getenv("WINE_HIDE_NVIDIA_GPU")) && *sgi != '0') + { + *vendor_id = 0x1002; /* AMD */ + *device_id = 0x73df; /* RX 6700XT */ + } + else if (*vendor_id == 0x1002 /* AMD */ && (sgi = getenv("WINE_HIDE_AMD_GPU")) && *sgi != '0') + { + *vendor_id = 0x10de; /* NVIDIA */ + *device_id = 0x2487; /* RTX 3060 */ + } + else if (*vendor_id == 0x1002 && (*device_id == 0x163f || *device_id == 0x1435) && (sgi = getenv("WINE_HIDE_VANGOGH_GPU")) && *sgi != '0') + { + *device_id = 0x687f; /* Radeon RX Vega 56/64 */ + } +} + +void WINAPI vkGetPhysicalDeviceProperties(VkPhysicalDevice physical_device, + VkPhysicalDeviceProperties *properties) +{ + struct vkGetPhysicalDeviceProperties_params params; + NTSTATUS status; + + TRACE("%p, %p\n", physical_device, properties); + + params.physicalDevice = physical_device; + params.pProperties = properties; + status = UNIX_CALL(vkGetPhysicalDeviceProperties, ¶ms); + assert(!status); + fixup_device_id(&properties->vendorID, &properties->deviceID); +} + void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, VkPhysicalDeviceProperties2 *properties2) { @@ -443,6 +464,7 @@ void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, status = UNIX_CALL(vkGetPhysicalDeviceProperties2, ¶ms); assert(!status); fill_luid_property(properties2); + fixup_device_id(&properties2->properties.vendorID, &properties2->properties.deviceID); } void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev, @@ -458,6 +480,7 @@ void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev, status = UNIX_CALL(vkGetPhysicalDeviceProperties2KHR, ¶ms); assert(!status); fill_luid_property(properties2); + fixup_device_id(&properties2->properties.vendorID, &properties2->properties.deviceID); } VkResult WINAPI vkCreateDevice(VkPhysicalDevice phys_dev, const VkDeviceCreateInfo *create_info, @@ -602,15 +625,19 @@ void WINAPI vkFreeCommandBuffers(VkDevice device, VkCommandPool cmd_pool, uint32 } } -static BOOL WINAPI call_vulkan_debug_report_callback( struct wine_vk_debug_report_params *params, ULONG size ) +static NTSTATUS WINAPI call_vulkan_debug_report_callback( void *args, ULONG size ) { - return params->user_callback(params->flags, params->object_type, params->object_handle, params->location, - params->code, params->layer_prefix, params->message, params->user_data); + struct wine_vk_debug_report_params *params = args; + VkBool32 ret = params->user_callback(params->flags, params->object_type, params->object_handle, params->location, + params->code, params->layer_prefix, params->message, params->user_data); + return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS ); } -static BOOL WINAPI call_vulkan_debug_utils_callback( struct wine_vk_debug_utils_params *params, ULONG size ) +static NTSTATUS WINAPI call_vulkan_debug_utils_callback( void *args, ULONG size ) { - return params->user_callback(params->severity, params->message_types, ¶ms->data, params->user_data); + struct wine_vk_debug_utils_params *params = args; + VkBool32 ret = params->user_callback(params->severity, params->message_types, ¶ms->data, params->user_data); + return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS ); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved) diff --git a/dlls/winevulkan/loader_thunks.c b/dlls/winevulkan/loader_thunks.c deleted file mode 100644 index f0f108e15f3..00000000000 --- a/dlls/winevulkan/loader_thunks.c +++ /dev/null @@ -1,6669 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "vulkan_loader.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vulkan); - -VkResult WINAPI vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, uint32_t *pImageIndex) -{ - struct vkAcquireNextImage2KHR_params params; - NTSTATUS status; - params.device = device; - params.pAcquireInfo = pAcquireInfo; - params.pImageIndex = pImageIndex; - status = UNIX_CALL(vkAcquireNextImage2KHR, ¶ms); - assert(!status && "vkAcquireNextImage2KHR"); - return params.result; -} - -VkResult WINAPI vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) -{ - struct vkAcquireNextImageKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.timeout = timeout; - params.semaphore = semaphore; - params.fence = fence; - params.pImageIndex = pImageIndex; - status = UNIX_CALL(vkAcquireNextImageKHR, ¶ms); - assert(!status && "vkAcquireNextImageKHR"); - return params.result; -} - -VkResult WINAPI vkAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo, VkPerformanceConfigurationINTEL *pConfiguration) -{ - struct vkAcquirePerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.device = device; - params.pAcquireInfo = pAcquireInfo; - params.pConfiguration = pConfiguration; - status = UNIX_CALL(vkAcquirePerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkAcquirePerformanceConfigurationINTEL"); - return params.result; -} - -VkResult WINAPI vkAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR *pInfo) -{ - struct vkAcquireProfilingLockKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkAcquireProfilingLockKHR, ¶ms); - assert(!status && "vkAcquireProfilingLockKHR"); - return params.result; -} - -VkResult WINAPI vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets) -{ - struct vkAllocateDescriptorSets_params params; - NTSTATUS status; - params.device = device; - params.pAllocateInfo = pAllocateInfo; - params.pDescriptorSets = pDescriptorSets; - status = UNIX_CALL(vkAllocateDescriptorSets, ¶ms); - assert(!status && "vkAllocateDescriptorSets"); - return params.result; -} - -VkResult WINAPI vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) -{ - struct vkAllocateMemory_params params; - NTSTATUS status; - params.device = device; - params.pAllocateInfo = pAllocateInfo; - params.pAllocator = pAllocator; - params.pMemory = pMemory; - status = UNIX_CALL(vkAllocateMemory, ¶ms); - assert(!status && "vkAllocateMemory"); - return params.result; -} - -VkResult WINAPI vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) -{ - struct vkBeginCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pBeginInfo = pBeginInfo; - status = UNIX_CALL(vkBeginCommandBuffer, ¶ms); - assert(!status && "vkBeginCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV *pBindInfos) -{ - struct vkBindAccelerationStructureMemoryNV_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindAccelerationStructureMemoryNV, ¶ms); - assert(!status && "vkBindAccelerationStructureMemoryNV"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) -{ - struct vkBindBufferMemory_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.memory = memory; - params.memoryOffset = memoryOffset; - status = UNIX_CALL(vkBindBufferMemory, ¶ms); - assert(!status && "vkBindBufferMemory"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) -{ - struct vkBindBufferMemory2_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindBufferMemory2, ¶ms); - assert(!status && "vkBindBufferMemory2"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) -{ - struct vkBindBufferMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindBufferMemory2KHR, ¶ms); - assert(!status && "vkBindBufferMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) -{ - struct vkBindImageMemory_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.memory = memory; - params.memoryOffset = memoryOffset; - status = UNIX_CALL(vkBindImageMemory, ¶ms); - assert(!status && "vkBindImageMemory"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos) -{ - struct vkBindImageMemory2_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindImageMemory2, ¶ms); - assert(!status && "vkBindImageMemory2"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos) -{ - struct vkBindImageMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindImageMemory2KHR, ¶ms); - assert(!status && "vkBindImageMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkBindOpticalFlowSessionImageNV(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout) -{ - struct vkBindOpticalFlowSessionImageNV_params params; - NTSTATUS status; - params.device = device; - params.session = session; - params.bindingPoint = bindingPoint; - params.view = view; - params.layout = layout; - status = UNIX_CALL(vkBindOpticalFlowSessionImageNV, ¶ms); - assert(!status && "vkBindOpticalFlowSessionImageNV"); - return params.result; -} - -VkResult WINAPI vkBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos) -{ - struct vkBuildAccelerationStructuresKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.ppBuildRangeInfos = ppBuildRangeInfos; - status = UNIX_CALL(vkBuildAccelerationStructuresKHR, ¶ms); - assert(!status && "vkBuildAccelerationStructuresKHR"); - return params.result; -} - -VkResult WINAPI vkBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos) -{ - struct vkBuildMicromapsEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.infoCount = infoCount; - params.pInfos = pInfos; - status = UNIX_CALL(vkBuildMicromapsEXT, ¶ms); - assert(!status && "vkBuildMicromapsEXT"); - return params.result; -} - -void WINAPI vkCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin) -{ - struct vkCmdBeginConditionalRenderingEXT_params params; - params.commandBuffer = commandBuffer; - params.pConditionalRenderingBegin = pConditionalRenderingBegin; - UNIX_CALL(vkCmdBeginConditionalRenderingEXT, ¶ms); -} - -void WINAPI vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkCmdBeginDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - params.pLabelInfo = pLabelInfo; - UNIX_CALL(vkCmdBeginDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) -{ - struct vkCmdBeginQuery_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.flags = flags; - UNIX_CALL(vkCmdBeginQuery, ¶ms); -} - -void WINAPI vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) -{ - struct vkCmdBeginQueryIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.flags = flags; - params.index = index; - UNIX_CALL(vkCmdBeginQueryIndexedEXT, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents) -{ - struct vkCmdBeginRenderPass_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.contents = contents; - UNIX_CALL(vkCmdBeginRenderPass, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo) -{ - struct vkCmdBeginRenderPass2_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.pSubpassBeginInfo = pSubpassBeginInfo; - UNIX_CALL(vkCmdBeginRenderPass2, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo) -{ - struct vkCmdBeginRenderPass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.pSubpassBeginInfo = pSubpassBeginInfo; - UNIX_CALL(vkCmdBeginRenderPass2KHR, ¶ms); -} - -void WINAPI vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo) -{ - struct vkCmdBeginRendering_params params; - params.commandBuffer = commandBuffer; - params.pRenderingInfo = pRenderingInfo; - UNIX_CALL(vkCmdBeginRendering, ¶ms); -} - -void WINAPI vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo) -{ - struct vkCmdBeginRenderingKHR_params params; - params.commandBuffer = commandBuffer; - params.pRenderingInfo = pRenderingInfo; - UNIX_CALL(vkCmdBeginRenderingKHR, ¶ms); -} - -void WINAPI vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets) -{ - struct vkCmdBeginTransformFeedbackEXT_params params; - params.commandBuffer = commandBuffer; - params.firstCounterBuffer = firstCounterBuffer; - params.counterBufferCount = counterBufferCount; - params.pCounterBuffers = pCounterBuffers; - params.pCounterBufferOffsets = pCounterBufferOffsets; - UNIX_CALL(vkCmdBeginTransformFeedbackEXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorBufferEmbeddedSamplersEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.set = set; - UNIX_CALL(vkCmdBindDescriptorBufferEmbeddedSamplersEXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos) -{ - struct vkCmdBindDescriptorBuffersEXT_params params; - params.commandBuffer = commandBuffer; - params.bufferCount = bufferCount; - params.pBindingInfos = pBindingInfos; - UNIX_CALL(vkCmdBindDescriptorBuffersEXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) -{ - struct vkCmdBindDescriptorSets_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.firstSet = firstSet; - params.descriptorSetCount = descriptorSetCount; - params.pDescriptorSets = pDescriptorSets; - params.dynamicOffsetCount = dynamicOffsetCount; - params.pDynamicOffsets = pDynamicOffsets; - UNIX_CALL(vkCmdBindDescriptorSets, ¶ms); -} - -void WINAPI vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) -{ - struct vkCmdBindIndexBuffer_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.indexType = indexType; - UNIX_CALL(vkCmdBindIndexBuffer, ¶ms); -} - -void WINAPI vkCmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) -{ - struct vkCmdBindIndexBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.size = size; - params.indexType = indexType; - UNIX_CALL(vkCmdBindIndexBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) -{ - struct vkCmdBindInvocationMaskHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.imageView = imageView; - params.imageLayout = imageLayout; - UNIX_CALL(vkCmdBindInvocationMaskHUAWEI, ¶ms); -} - -void WINAPI vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) -{ - struct vkCmdBindPipeline_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - UNIX_CALL(vkCmdBindPipeline, ¶ms); -} - -void WINAPI vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) -{ - struct vkCmdBindPipelineShaderGroupNV_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - params.groupIndex = groupIndex; - UNIX_CALL(vkCmdBindPipelineShaderGroupNV, ¶ms); -} - -void WINAPI vkCmdBindShadersEXT(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits *pStages, const VkShaderEXT *pShaders) -{ - struct vkCmdBindShadersEXT_params params; - params.commandBuffer = commandBuffer; - params.stageCount = stageCount; - params.pStages = pStages; - params.pShaders = pShaders; - UNIX_CALL(vkCmdBindShadersEXT, ¶ms); -} - -void WINAPI vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) -{ - struct vkCmdBindShadingRateImageNV_params params; - params.commandBuffer = commandBuffer; - params.imageView = imageView; - params.imageLayout = imageLayout; - UNIX_CALL(vkCmdBindShadingRateImageNV, ¶ms); -} - -void WINAPI vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes) -{ - struct vkCmdBindTransformFeedbackBuffersEXT_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - UNIX_CALL(vkCmdBindTransformFeedbackBuffersEXT, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets) -{ - struct vkCmdBindVertexBuffers_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - UNIX_CALL(vkCmdBindVertexBuffers, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) -{ - struct vkCmdBindVertexBuffers2_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - params.pStrides = pStrides; - UNIX_CALL(vkCmdBindVertexBuffers2, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) -{ - struct vkCmdBindVertexBuffers2EXT_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - params.pStrides = pStrides; - UNIX_CALL(vkCmdBindVertexBuffers2EXT, ¶ms); -} - -void WINAPI vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter) -{ - struct vkCmdBlitImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - params.filter = filter; - UNIX_CALL(vkCmdBlitImage, ¶ms); -} - -void WINAPI vkCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo) -{ - struct vkCmdBlitImage2_params params; - params.commandBuffer = commandBuffer; - params.pBlitImageInfo = pBlitImageInfo; - UNIX_CALL(vkCmdBlitImage2, ¶ms); -} - -void WINAPI vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo) -{ - struct vkCmdBlitImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pBlitImageInfo = pBlitImageInfo; - UNIX_CALL(vkCmdBlitImage2KHR, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) -{ - struct vkCmdBuildAccelerationStructureNV_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - params.instanceData = instanceData; - params.instanceOffset = instanceOffset; - params.update = update; - params.dst = dst; - params.src = src; - params.scratch = scratch; - params.scratchOffset = scratchOffset; - UNIX_CALL(vkCmdBuildAccelerationStructureNV, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t * const*ppMaxPrimitiveCounts) -{ - struct vkCmdBuildAccelerationStructuresIndirectKHR_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.pIndirectDeviceAddresses = pIndirectDeviceAddresses; - params.pIndirectStrides = pIndirectStrides; - params.ppMaxPrimitiveCounts = ppMaxPrimitiveCounts; - UNIX_CALL(vkCmdBuildAccelerationStructuresIndirectKHR, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos) -{ - struct vkCmdBuildAccelerationStructuresKHR_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.ppBuildRangeInfos = ppBuildRangeInfos; - UNIX_CALL(vkCmdBuildAccelerationStructuresKHR, ¶ms); -} - -void WINAPI vkCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos) -{ - struct vkCmdBuildMicromapsEXT_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - UNIX_CALL(vkCmdBuildMicromapsEXT, ¶ms); -} - -void WINAPI vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects) -{ - struct vkCmdClearAttachments_params params; - params.commandBuffer = commandBuffer; - params.attachmentCount = attachmentCount; - params.pAttachments = pAttachments; - params.rectCount = rectCount; - params.pRects = pRects; - UNIX_CALL(vkCmdClearAttachments, ¶ms); -} - -void WINAPI vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges) -{ - struct vkCmdClearColorImage_params params; - params.commandBuffer = commandBuffer; - params.image = image; - params.imageLayout = imageLayout; - params.pColor = pColor; - params.rangeCount = rangeCount; - params.pRanges = pRanges; - UNIX_CALL(vkCmdClearColorImage, ¶ms); -} - -void WINAPI vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges) -{ - struct vkCmdClearDepthStencilImage_params params; - params.commandBuffer = commandBuffer; - params.image = image; - params.imageLayout = imageLayout; - params.pDepthStencil = pDepthStencil; - params.rangeCount = rangeCount; - params.pRanges = pRanges; - UNIX_CALL(vkCmdClearDepthStencilImage, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo) -{ - struct vkCmdCopyAccelerationStructureKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyAccelerationStructureKHR, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) -{ - struct vkCmdCopyAccelerationStructureNV_params params; - params.commandBuffer = commandBuffer; - params.dst = dst; - params.src = src; - params.mode = mode; - UNIX_CALL(vkCmdCopyAccelerationStructureNV, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) -{ - struct vkCmdCopyAccelerationStructureToMemoryKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyAccelerationStructureToMemoryKHR, ¶ms); -} - -void WINAPI vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions) -{ - struct vkCmdCopyBuffer_params params; - params.commandBuffer = commandBuffer; - params.srcBuffer = srcBuffer; - params.dstBuffer = dstBuffer; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyBuffer, ¶ms); -} - -void WINAPI vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) -{ - struct vkCmdCopyBuffer2_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferInfo = pCopyBufferInfo; - UNIX_CALL(vkCmdCopyBuffer2, ¶ms); -} - -void WINAPI vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) -{ - struct vkCmdCopyBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferInfo = pCopyBufferInfo; - UNIX_CALL(vkCmdCopyBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions) -{ - struct vkCmdCopyBufferToImage_params params; - params.commandBuffer = commandBuffer; - params.srcBuffer = srcBuffer; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyBufferToImage, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) -{ - struct vkCmdCopyBufferToImage2_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferToImageInfo = pCopyBufferToImageInfo; - UNIX_CALL(vkCmdCopyBufferToImage2, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) -{ - struct vkCmdCopyBufferToImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferToImageInfo = pCopyBufferToImageInfo; - UNIX_CALL(vkCmdCopyBufferToImage2KHR, ¶ms); -} - -void WINAPI vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions) -{ - struct vkCmdCopyImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyImage, ¶ms); -} - -void WINAPI vkCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo) -{ - struct vkCmdCopyImage2_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageInfo = pCopyImageInfo; - UNIX_CALL(vkCmdCopyImage2, ¶ms); -} - -void WINAPI vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo) -{ - struct vkCmdCopyImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageInfo = pCopyImageInfo; - UNIX_CALL(vkCmdCopyImage2KHR, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) -{ - struct vkCmdCopyImageToBuffer_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstBuffer = dstBuffer; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyImageToBuffer, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo) -{ - struct vkCmdCopyImageToBuffer2_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageToBufferInfo = pCopyImageToBufferInfo; - UNIX_CALL(vkCmdCopyImageToBuffer2, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo) -{ - struct vkCmdCopyImageToBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageToBufferInfo = pCopyImageToBufferInfo; - UNIX_CALL(vkCmdCopyImageToBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdCopyMemoryIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride) -{ - struct vkCmdCopyMemoryIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.copyBufferAddress = copyBufferAddress; - params.copyCount = copyCount; - params.stride = stride; - UNIX_CALL(vkCmdCopyMemoryIndirectNV, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) -{ - struct vkCmdCopyMemoryToAccelerationStructureKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMemoryToAccelerationStructureKHR, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToImageIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers *pImageSubresources) -{ - struct vkCmdCopyMemoryToImageIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.copyBufferAddress = copyBufferAddress; - params.copyCount = copyCount; - params.stride = stride; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.pImageSubresources = pImageSubresources; - UNIX_CALL(vkCmdCopyMemoryToImageIndirectNV, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo) -{ - struct vkCmdCopyMemoryToMicromapEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMemoryToMicromapEXT, ¶ms); -} - -void WINAPI vkCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo) -{ - struct vkCmdCopyMicromapEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMicromapEXT, ¶ms); -} - -void WINAPI vkCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo) -{ - struct vkCmdCopyMicromapToMemoryEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMicromapToMemoryEXT, ¶ms); -} - -void WINAPI vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) -{ - struct vkCmdCopyQueryPoolResults_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.stride = stride; - params.flags = flags; - UNIX_CALL(vkCmdCopyQueryPoolResults, ¶ms); -} - -void WINAPI vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX *pLaunchInfo) -{ - struct vkCmdCuLaunchKernelNVX_params params; - params.commandBuffer = commandBuffer; - params.pLaunchInfo = pLaunchInfo; - UNIX_CALL(vkCmdCuLaunchKernelNVX, ¶ms); -} - -void WINAPI vkCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV *pLaunchInfo) -{ - struct vkCmdCudaLaunchKernelNV_params params; - params.commandBuffer = commandBuffer; - params.pLaunchInfo = pLaunchInfo; - UNIX_CALL(vkCmdCudaLaunchKernelNV, ¶ms); -} - -void WINAPI vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo) -{ - struct vkCmdDebugMarkerBeginEXT_params params; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - UNIX_CALL(vkCmdDebugMarkerBeginEXT, ¶ms); -} - -void WINAPI vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdDebugMarkerEndEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdDebugMarkerEndEXT, ¶ms); -} - -void WINAPI vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo) -{ - struct vkCmdDebugMarkerInsertEXT_params params; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - UNIX_CALL(vkCmdDebugMarkerInsertEXT, ¶ms); -} - -void WINAPI vkCmdDecompressMemoryIndirectCountNV(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride) -{ - struct vkCmdDecompressMemoryIndirectCountNV_params params; - params.commandBuffer = commandBuffer; - params.indirectCommandsAddress = indirectCommandsAddress; - params.indirectCommandsCountAddress = indirectCommandsCountAddress; - params.stride = stride; - UNIX_CALL(vkCmdDecompressMemoryIndirectCountNV, ¶ms); -} - -void WINAPI vkCmdDecompressMemoryNV(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV *pDecompressMemoryRegions) -{ - struct vkCmdDecompressMemoryNV_params params; - params.commandBuffer = commandBuffer; - params.decompressRegionCount = decompressRegionCount; - params.pDecompressMemoryRegions = pDecompressMemoryRegions; - UNIX_CALL(vkCmdDecompressMemoryNV, ¶ms); -} - -void WINAPI vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatch_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatch, ¶ms); -} - -void WINAPI vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatchBase_params params; - params.commandBuffer = commandBuffer; - params.baseGroupX = baseGroupX; - params.baseGroupY = baseGroupY; - params.baseGroupZ = baseGroupZ; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatchBase, ¶ms); -} - -void WINAPI vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatchBaseKHR_params params; - params.commandBuffer = commandBuffer; - params.baseGroupX = baseGroupX; - params.baseGroupY = baseGroupY; - params.baseGroupZ = baseGroupZ; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatchBaseKHR, ¶ms); -} - -void WINAPI vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) -{ - struct vkCmdDispatchIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - UNIX_CALL(vkCmdDispatchIndirect, ¶ms); -} - -void WINAPI vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) -{ - struct vkCmdDraw_params params; - params.commandBuffer = commandBuffer; - params.vertexCount = vertexCount; - params.instanceCount = instanceCount; - params.firstVertex = firstVertex; - params.firstInstance = firstInstance; - UNIX_CALL(vkCmdDraw, ¶ms); -} - -void WINAPI vkCmdDrawClusterHUAWEI(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDrawClusterHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDrawClusterHUAWEI, ¶ms); -} - -void WINAPI vkCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) -{ - struct vkCmdDrawClusterIndirectHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - UNIX_CALL(vkCmdDrawClusterIndirectHUAWEI, ¶ms); -} - -void WINAPI vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) -{ - struct vkCmdDrawIndexed_params params; - params.commandBuffer = commandBuffer; - params.indexCount = indexCount; - params.instanceCount = instanceCount; - params.firstIndex = firstIndex; - params.vertexOffset = vertexOffset; - params.firstInstance = firstInstance; - UNIX_CALL(vkCmdDrawIndexed, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirect, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCount_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCount, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCountAMD_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCountAMD, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCountKHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCountKHR, ¶ms); -} - -void WINAPI vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirect, ¶ms); -} - -void WINAPI vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) -{ - struct vkCmdDrawIndirectByteCountEXT_params params; - params.commandBuffer = commandBuffer; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.counterBuffer = counterBuffer; - params.counterBufferOffset = counterBufferOffset; - params.counterOffset = counterOffset; - params.vertexStride = vertexStride; - UNIX_CALL(vkCmdDrawIndirectByteCountEXT, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCount_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCount, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCountAMD_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCountAMD, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCountKHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCountKHR, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDrawMeshTasksEXT_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDrawMeshTasksEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectCountEXT_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectCountEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectCountNV_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectCountNV, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectEXT_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectNV, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) -{ - struct vkCmdDrawMeshTasksNV_params params; - params.commandBuffer = commandBuffer; - params.taskCount = taskCount; - params.firstTask = firstTask; - UNIX_CALL(vkCmdDrawMeshTasksNV, ¶ms); -} - -void WINAPI vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawInfoEXT *pVertexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride) -{ - struct vkCmdDrawMultiEXT_params params; - params.commandBuffer = commandBuffer; - params.drawCount = drawCount; - params.pVertexInfo = pVertexInfo; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.stride = stride; - UNIX_CALL(vkCmdDrawMultiEXT, ¶ms); -} - -void WINAPI vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawIndexedInfoEXT *pIndexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride, const int32_t *pVertexOffset) -{ - struct vkCmdDrawMultiIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.drawCount = drawCount; - params.pIndexInfo = pIndexInfo; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.stride = stride; - params.pVertexOffset = pVertexOffset; - UNIX_CALL(vkCmdDrawMultiIndexedEXT, ¶ms); -} - -void WINAPI vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndConditionalRenderingEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndConditionalRenderingEXT, ¶ms); -} - -void WINAPI vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdEndQuery_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdEndQuery, ¶ms); -} - -void WINAPI vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) -{ - struct vkCmdEndQueryIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.index = index; - UNIX_CALL(vkCmdEndQueryIndexedEXT, ¶ms); -} - -void WINAPI vkCmdEndRenderPass(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRenderPass_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRenderPass, ¶ms); -} - -void WINAPI vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdEndRenderPass2_params params; - params.commandBuffer = commandBuffer; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdEndRenderPass2, ¶ms); -} - -void WINAPI vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdEndRenderPass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdEndRenderPass2KHR, ¶ms); -} - -void WINAPI vkCmdEndRendering(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRendering_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRendering, ¶ms); -} - -void WINAPI vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRenderingKHR_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRenderingKHR, ¶ms); -} - -void WINAPI vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets) -{ - struct vkCmdEndTransformFeedbackEXT_params params; - params.commandBuffer = commandBuffer; - params.firstCounterBuffer = firstCounterBuffer; - params.counterBufferCount = counterBufferCount; - params.pCounterBuffers = pCounterBuffers; - params.pCounterBufferOffsets = pCounterBufferOffsets; - UNIX_CALL(vkCmdEndTransformFeedbackEXT, ¶ms); -} - -void WINAPI vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) -{ - struct vkCmdExecuteCommands_params params; - params.commandBuffer = commandBuffer; - params.commandBufferCount = commandBufferCount; - params.pCommandBuffers = pCommandBuffers; - UNIX_CALL(vkCmdExecuteCommands, ¶ms); -} - -void WINAPI vkCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo) -{ - struct vkCmdExecuteGeneratedCommandsNV_params params; - params.commandBuffer = commandBuffer; - params.isPreprocessed = isPreprocessed; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - UNIX_CALL(vkCmdExecuteGeneratedCommandsNV, ¶ms); -} - -void WINAPI vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) -{ - struct vkCmdFillBuffer_params params; - params.commandBuffer = commandBuffer; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.size = size; - params.data = data; - UNIX_CALL(vkCmdFillBuffer, ¶ms); -} - -void WINAPI vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkCmdInsertDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - params.pLabelInfo = pLabelInfo; - UNIX_CALL(vkCmdInsertDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) -{ - struct vkCmdNextSubpass_params params; - params.commandBuffer = commandBuffer; - params.contents = contents; - UNIX_CALL(vkCmdNextSubpass, ¶ms); -} - -void WINAPI vkCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdNextSubpass2_params params; - params.commandBuffer = commandBuffer; - params.pSubpassBeginInfo = pSubpassBeginInfo; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdNextSubpass2, ¶ms); -} - -void WINAPI vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdNextSubpass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pSubpassBeginInfo = pSubpassBeginInfo; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdNextSubpass2KHR, ¶ms); -} - -void WINAPI vkCmdOpticalFlowExecuteNV(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV *pExecuteInfo) -{ - struct vkCmdOpticalFlowExecuteNV_params params; - params.commandBuffer = commandBuffer; - params.session = session; - params.pExecuteInfo = pExecuteInfo; - UNIX_CALL(vkCmdOpticalFlowExecuteNV, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) -{ - struct vkCmdPipelineBarrier_params params; - params.commandBuffer = commandBuffer; - params.srcStageMask = srcStageMask; - params.dstStageMask = dstStageMask; - params.dependencyFlags = dependencyFlags; - params.memoryBarrierCount = memoryBarrierCount; - params.pMemoryBarriers = pMemoryBarriers; - params.bufferMemoryBarrierCount = bufferMemoryBarrierCount; - params.pBufferMemoryBarriers = pBufferMemoryBarriers; - params.imageMemoryBarrierCount = imageMemoryBarrierCount; - params.pImageMemoryBarriers = pImageMemoryBarriers; - UNIX_CALL(vkCmdPipelineBarrier, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdPipelineBarrier2_params params; - params.commandBuffer = commandBuffer; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdPipelineBarrier2, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdPipelineBarrier2KHR_params params; - params.commandBuffer = commandBuffer; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdPipelineBarrier2KHR, ¶ms); -} - -void WINAPI vkCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo) -{ - struct vkCmdPreprocessGeneratedCommandsNV_params params; - params.commandBuffer = commandBuffer; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - UNIX_CALL(vkCmdPreprocessGeneratedCommandsNV, ¶ms); -} - -void WINAPI vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues) -{ - struct vkCmdPushConstants_params params; - params.commandBuffer = commandBuffer; - params.layout = layout; - params.stageFlags = stageFlags; - params.offset = offset; - params.size = size; - params.pValues = pValues; - UNIX_CALL(vkCmdPushConstants, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) -{ - struct vkCmdPushDescriptorSetKHR_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.set = set; - params.descriptorWriteCount = descriptorWriteCount; - params.pDescriptorWrites = pDescriptorWrites; - UNIX_CALL(vkCmdPushDescriptorSetKHR, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) -{ - struct vkCmdPushDescriptorSetWithTemplateKHR_params params; - params.commandBuffer = commandBuffer; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.layout = layout; - params.set = set; - params.pData = pData; - UNIX_CALL(vkCmdPushDescriptorSetWithTemplateKHR, ¶ms); -} - -void WINAPI vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) -{ - struct vkCmdResetEvent_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent, ¶ms); -} - -void WINAPI vkCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) -{ - struct vkCmdResetEvent2_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent2, ¶ms); -} - -void WINAPI vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) -{ - struct vkCmdResetEvent2KHR_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent2KHR, ¶ms); -} - -void WINAPI vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkCmdResetQueryPool_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - UNIX_CALL(vkCmdResetQueryPool, ¶ms); -} - -void WINAPI vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions) -{ - struct vkCmdResolveImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdResolveImage, ¶ms); -} - -void WINAPI vkCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo) -{ - struct vkCmdResolveImage2_params params; - params.commandBuffer = commandBuffer; - params.pResolveImageInfo = pResolveImageInfo; - UNIX_CALL(vkCmdResolveImage2, ¶ms); -} - -void WINAPI vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo) -{ - struct vkCmdResolveImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pResolveImageInfo = pResolveImageInfo; - UNIX_CALL(vkCmdResolveImage2KHR, ¶ms); -} - -void WINAPI vkCmdSetAlphaToCoverageEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable) -{ - struct vkCmdSetAlphaToCoverageEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.alphaToCoverageEnable = alphaToCoverageEnable; - UNIX_CALL(vkCmdSetAlphaToCoverageEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable) -{ - struct vkCmdSetAlphaToOneEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.alphaToOneEnable = alphaToOneEnable; - UNIX_CALL(vkCmdSetAlphaToOneEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetAttachmentFeedbackLoopEnableEXT(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask) -{ - struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.aspectMask = aspectMask; - UNIX_CALL(vkCmdSetAttachmentFeedbackLoopEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) -{ - struct vkCmdSetBlendConstants_params params; - params.commandBuffer = commandBuffer; - params.blendConstants = blendConstants; - UNIX_CALL(vkCmdSetBlendConstants, ¶ms); -} - -void WINAPI vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void *pCheckpointMarker) -{ - struct vkCmdSetCheckpointNV_params params; - params.commandBuffer = commandBuffer; - params.pCheckpointMarker = pCheckpointMarker; - UNIX_CALL(vkCmdSetCheckpointNV, ¶ms); -} - -void WINAPI vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders) -{ - struct vkCmdSetCoarseSampleOrderNV_params params; - params.commandBuffer = commandBuffer; - params.sampleOrderType = sampleOrderType; - params.customSampleOrderCount = customSampleOrderCount; - params.pCustomSampleOrders = pCustomSampleOrders; - UNIX_CALL(vkCmdSetCoarseSampleOrderNV, ¶ms); -} - -void WINAPI vkCmdSetColorBlendAdvancedEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT *pColorBlendAdvanced) -{ - struct vkCmdSetColorBlendAdvancedEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendAdvanced = pColorBlendAdvanced; - UNIX_CALL(vkCmdSetColorBlendAdvancedEXT, ¶ms); -} - -void WINAPI vkCmdSetColorBlendEnableEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32 *pColorBlendEnables) -{ - struct vkCmdSetColorBlendEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendEnables = pColorBlendEnables; - UNIX_CALL(vkCmdSetColorBlendEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetColorBlendEquationEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT *pColorBlendEquations) -{ - struct vkCmdSetColorBlendEquationEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendEquations = pColorBlendEquations; - UNIX_CALL(vkCmdSetColorBlendEquationEXT, ¶ms); -} - -void WINAPI vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32 *pColorWriteEnables) -{ - struct vkCmdSetColorWriteEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.attachmentCount = attachmentCount; - params.pColorWriteEnables = pColorWriteEnables; - UNIX_CALL(vkCmdSetColorWriteEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetColorWriteMaskEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags *pColorWriteMasks) -{ - struct vkCmdSetColorWriteMaskEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorWriteMasks = pColorWriteMasks; - UNIX_CALL(vkCmdSetColorWriteMaskEXT, ¶ms); -} - -void WINAPI vkCmdSetConservativeRasterizationModeEXT(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode) -{ - struct vkCmdSetConservativeRasterizationModeEXT_params params; - params.commandBuffer = commandBuffer; - params.conservativeRasterizationMode = conservativeRasterizationMode; - UNIX_CALL(vkCmdSetConservativeRasterizationModeEXT, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationModeNV(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode) -{ - struct vkCmdSetCoverageModulationModeNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationMode = coverageModulationMode; - UNIX_CALL(vkCmdSetCoverageModulationModeNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationTableEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable) -{ - struct vkCmdSetCoverageModulationTableEnableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationTableEnable = coverageModulationTableEnable; - UNIX_CALL(vkCmdSetCoverageModulationTableEnableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationTableNV(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float *pCoverageModulationTable) -{ - struct vkCmdSetCoverageModulationTableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationTableCount = coverageModulationTableCount; - params.pCoverageModulationTable = pCoverageModulationTable; - UNIX_CALL(vkCmdSetCoverageModulationTableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageReductionModeNV(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode) -{ - struct vkCmdSetCoverageReductionModeNV_params params; - params.commandBuffer = commandBuffer; - params.coverageReductionMode = coverageReductionMode; - UNIX_CALL(vkCmdSetCoverageReductionModeNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageToColorEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable) -{ - struct vkCmdSetCoverageToColorEnableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageToColorEnable = coverageToColorEnable; - UNIX_CALL(vkCmdSetCoverageToColorEnableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageToColorLocationNV(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation) -{ - struct vkCmdSetCoverageToColorLocationNV_params params; - params.commandBuffer = commandBuffer; - params.coverageToColorLocation = coverageToColorLocation; - UNIX_CALL(vkCmdSetCoverageToColorLocationNV, ¶ms); -} - -void WINAPI vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) -{ - struct vkCmdSetCullMode_params params; - params.commandBuffer = commandBuffer; - params.cullMode = cullMode; - UNIX_CALL(vkCmdSetCullMode, ¶ms); -} - -void WINAPI vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) -{ - struct vkCmdSetCullModeEXT_params params; - params.commandBuffer = commandBuffer; - params.cullMode = cullMode; - UNIX_CALL(vkCmdSetCullModeEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) -{ - struct vkCmdSetDepthBias_params params; - params.commandBuffer = commandBuffer; - params.depthBiasConstantFactor = depthBiasConstantFactor; - params.depthBiasClamp = depthBiasClamp; - params.depthBiasSlopeFactor = depthBiasSlopeFactor; - UNIX_CALL(vkCmdSetDepthBias, ¶ms); -} - -void WINAPI vkCmdSetDepthBias2EXT(VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT *pDepthBiasInfo) -{ - struct vkCmdSetDepthBias2EXT_params params; - params.commandBuffer = commandBuffer; - params.pDepthBiasInfo = pDepthBiasInfo; - UNIX_CALL(vkCmdSetDepthBias2EXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) -{ - struct vkCmdSetDepthBiasEnable_params params; - params.commandBuffer = commandBuffer; - params.depthBiasEnable = depthBiasEnable; - UNIX_CALL(vkCmdSetDepthBiasEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) -{ - struct vkCmdSetDepthBiasEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthBiasEnable = depthBiasEnable; - UNIX_CALL(vkCmdSetDepthBiasEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) -{ - struct vkCmdSetDepthBounds_params params; - params.commandBuffer = commandBuffer; - params.minDepthBounds = minDepthBounds; - params.maxDepthBounds = maxDepthBounds; - UNIX_CALL(vkCmdSetDepthBounds, ¶ms); -} - -void WINAPI vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) -{ - struct vkCmdSetDepthBoundsTestEnable_params params; - params.commandBuffer = commandBuffer; - params.depthBoundsTestEnable = depthBoundsTestEnable; - UNIX_CALL(vkCmdSetDepthBoundsTestEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) -{ - struct vkCmdSetDepthBoundsTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthBoundsTestEnable = depthBoundsTestEnable; - UNIX_CALL(vkCmdSetDepthBoundsTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable) -{ - struct vkCmdSetDepthClampEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthClampEnable = depthClampEnable; - UNIX_CALL(vkCmdSetDepthClampEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable) -{ - struct vkCmdSetDepthClipEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthClipEnable = depthClipEnable; - UNIX_CALL(vkCmdSetDepthClipEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClipNegativeOneToOneEXT(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne) -{ - struct vkCmdSetDepthClipNegativeOneToOneEXT_params params; - params.commandBuffer = commandBuffer; - params.negativeOneToOne = negativeOneToOne; - UNIX_CALL(vkCmdSetDepthClipNegativeOneToOneEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) -{ - struct vkCmdSetDepthCompareOp_params params; - params.commandBuffer = commandBuffer; - params.depthCompareOp = depthCompareOp; - UNIX_CALL(vkCmdSetDepthCompareOp, ¶ms); -} - -void WINAPI vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) -{ - struct vkCmdSetDepthCompareOpEXT_params params; - params.commandBuffer = commandBuffer; - params.depthCompareOp = depthCompareOp; - UNIX_CALL(vkCmdSetDepthCompareOpEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) -{ - struct vkCmdSetDepthTestEnable_params params; - params.commandBuffer = commandBuffer; - params.depthTestEnable = depthTestEnable; - UNIX_CALL(vkCmdSetDepthTestEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) -{ - struct vkCmdSetDepthTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthTestEnable = depthTestEnable; - UNIX_CALL(vkCmdSetDepthTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) -{ - struct vkCmdSetDepthWriteEnable_params params; - params.commandBuffer = commandBuffer; - params.depthWriteEnable = depthWriteEnable; - UNIX_CALL(vkCmdSetDepthWriteEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) -{ - struct vkCmdSetDepthWriteEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthWriteEnable = depthWriteEnable; - UNIX_CALL(vkCmdSetDepthWriteEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDescriptorBufferOffsetsEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t *pBufferIndices, const VkDeviceSize *pOffsets) -{ - struct vkCmdSetDescriptorBufferOffsetsEXT_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.firstSet = firstSet; - params.setCount = setCount; - params.pBufferIndices = pBufferIndices; - params.pOffsets = pOffsets; - UNIX_CALL(vkCmdSetDescriptorBufferOffsetsEXT, ¶ms); -} - -void WINAPI vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) -{ - struct vkCmdSetDeviceMask_params params; - params.commandBuffer = commandBuffer; - params.deviceMask = deviceMask; - UNIX_CALL(vkCmdSetDeviceMask, ¶ms); -} - -void WINAPI vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) -{ - struct vkCmdSetDeviceMaskKHR_params params; - params.commandBuffer = commandBuffer; - params.deviceMask = deviceMask; - UNIX_CALL(vkCmdSetDeviceMaskKHR, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) -{ - struct vkCmdSetDiscardRectangleEXT_params params; - params.commandBuffer = commandBuffer; - params.firstDiscardRectangle = firstDiscardRectangle; - params.discardRectangleCount = discardRectangleCount; - params.pDiscardRectangles = pDiscardRectangles; - UNIX_CALL(vkCmdSetDiscardRectangleEXT, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable) -{ - struct vkCmdSetDiscardRectangleEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.discardRectangleEnable = discardRectangleEnable; - UNIX_CALL(vkCmdSetDiscardRectangleEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode) -{ - struct vkCmdSetDiscardRectangleModeEXT_params params; - params.commandBuffer = commandBuffer; - params.discardRectangleMode = discardRectangleMode; - UNIX_CALL(vkCmdSetDiscardRectangleModeEXT, ¶ms); -} - -void WINAPI vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) -{ - struct vkCmdSetEvent_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdSetEvent, ¶ms); -} - -void WINAPI vkCmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdSetEvent2_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdSetEvent2, ¶ms); -} - -void WINAPI vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdSetEvent2KHR_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdSetEvent2KHR, ¶ms); -} - -void WINAPI vkCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables) -{ - struct vkCmdSetExclusiveScissorEnableNV_params params; - params.commandBuffer = commandBuffer; - params.firstExclusiveScissor = firstExclusiveScissor; - params.exclusiveScissorCount = exclusiveScissorCount; - params.pExclusiveScissorEnables = pExclusiveScissorEnables; - UNIX_CALL(vkCmdSetExclusiveScissorEnableNV, ¶ms); -} - -void WINAPI vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors) -{ - struct vkCmdSetExclusiveScissorNV_params params; - params.commandBuffer = commandBuffer; - params.firstExclusiveScissor = firstExclusiveScissor; - params.exclusiveScissorCount = exclusiveScissorCount; - params.pExclusiveScissors = pExclusiveScissors; - UNIX_CALL(vkCmdSetExclusiveScissorNV, ¶ms); -} - -void WINAPI vkCmdSetExtraPrimitiveOverestimationSizeEXT(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize) -{ - struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params params; - params.commandBuffer = commandBuffer; - params.extraPrimitiveOverestimationSize = extraPrimitiveOverestimationSize; - UNIX_CALL(vkCmdSetExtraPrimitiveOverestimationSizeEXT, ¶ms); -} - -void WINAPI vkCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) -{ - struct vkCmdSetFragmentShadingRateEnumNV_params params; - params.commandBuffer = commandBuffer; - params.shadingRate = shadingRate; - params.combinerOps = combinerOps; - UNIX_CALL(vkCmdSetFragmentShadingRateEnumNV, ¶ms); -} - -void WINAPI vkCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D *pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) -{ - struct vkCmdSetFragmentShadingRateKHR_params params; - params.commandBuffer = commandBuffer; - params.pFragmentSize = pFragmentSize; - params.combinerOps = combinerOps; - UNIX_CALL(vkCmdSetFragmentShadingRateKHR, ¶ms); -} - -void WINAPI vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace) -{ - struct vkCmdSetFrontFace_params params; - params.commandBuffer = commandBuffer; - params.frontFace = frontFace; - UNIX_CALL(vkCmdSetFrontFace, ¶ms); -} - -void WINAPI vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) -{ - struct vkCmdSetFrontFaceEXT_params params; - params.commandBuffer = commandBuffer; - params.frontFace = frontFace; - UNIX_CALL(vkCmdSetFrontFaceEXT, ¶ms); -} - -void WINAPI vkCmdSetLineRasterizationModeEXT(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode) -{ - struct vkCmdSetLineRasterizationModeEXT_params params; - params.commandBuffer = commandBuffer; - params.lineRasterizationMode = lineRasterizationMode; - UNIX_CALL(vkCmdSetLineRasterizationModeEXT, ¶ms); -} - -void WINAPI vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) -{ - struct vkCmdSetLineStippleEXT_params params; - params.commandBuffer = commandBuffer; - params.lineStippleFactor = lineStippleFactor; - params.lineStipplePattern = lineStipplePattern; - UNIX_CALL(vkCmdSetLineStippleEXT, ¶ms); -} - -void WINAPI vkCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable) -{ - struct vkCmdSetLineStippleEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.stippledLineEnable = stippledLineEnable; - UNIX_CALL(vkCmdSetLineStippleEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) -{ - struct vkCmdSetLineWidth_params params; - params.commandBuffer = commandBuffer; - params.lineWidth = lineWidth; - UNIX_CALL(vkCmdSetLineWidth, ¶ms); -} - -void WINAPI vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp) -{ - struct vkCmdSetLogicOpEXT_params params; - params.commandBuffer = commandBuffer; - params.logicOp = logicOp; - UNIX_CALL(vkCmdSetLogicOpEXT, ¶ms); -} - -void WINAPI vkCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable) -{ - struct vkCmdSetLogicOpEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.logicOpEnable = logicOpEnable; - UNIX_CALL(vkCmdSetLogicOpEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints) -{ - struct vkCmdSetPatchControlPointsEXT_params params; - params.commandBuffer = commandBuffer; - params.patchControlPoints = patchControlPoints; - UNIX_CALL(vkCmdSetPatchControlPointsEXT, ¶ms); -} - -VkResult WINAPI vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL *pMarkerInfo) -{ - struct vkCmdSetPerformanceMarkerINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - status = UNIX_CALL(vkCmdSetPerformanceMarkerINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceMarkerINTEL"); - return params.result; -} - -VkResult WINAPI vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL *pOverrideInfo) -{ - struct vkCmdSetPerformanceOverrideINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pOverrideInfo = pOverrideInfo; - status = UNIX_CALL(vkCmdSetPerformanceOverrideINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceOverrideINTEL"); - return params.result; -} - -VkResult WINAPI vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo) -{ - struct vkCmdSetPerformanceStreamMarkerINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - status = UNIX_CALL(vkCmdSetPerformanceStreamMarkerINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceStreamMarkerINTEL"); - return params.result; -} - -void WINAPI vkCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode) -{ - struct vkCmdSetPolygonModeEXT_params params; - params.commandBuffer = commandBuffer; - params.polygonMode = polygonMode; - UNIX_CALL(vkCmdSetPolygonModeEXT, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) -{ - struct vkCmdSetPrimitiveRestartEnable_params params; - params.commandBuffer = commandBuffer; - params.primitiveRestartEnable = primitiveRestartEnable; - UNIX_CALL(vkCmdSetPrimitiveRestartEnable, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) -{ - struct vkCmdSetPrimitiveRestartEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.primitiveRestartEnable = primitiveRestartEnable; - UNIX_CALL(vkCmdSetPrimitiveRestartEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) -{ - struct vkCmdSetPrimitiveTopology_params params; - params.commandBuffer = commandBuffer; - params.primitiveTopology = primitiveTopology; - UNIX_CALL(vkCmdSetPrimitiveTopology, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) -{ - struct vkCmdSetPrimitiveTopologyEXT_params params; - params.commandBuffer = commandBuffer; - params.primitiveTopology = primitiveTopology; - UNIX_CALL(vkCmdSetPrimitiveTopologyEXT, ¶ms); -} - -void WINAPI vkCmdSetProvokingVertexModeEXT(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode) -{ - struct vkCmdSetProvokingVertexModeEXT_params params; - params.commandBuffer = commandBuffer; - params.provokingVertexMode = provokingVertexMode; - UNIX_CALL(vkCmdSetProvokingVertexModeEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples) -{ - struct vkCmdSetRasterizationSamplesEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizationSamples = rasterizationSamples; - UNIX_CALL(vkCmdSetRasterizationSamplesEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizationStreamEXT(VkCommandBuffer commandBuffer, uint32_t rasterizationStream) -{ - struct vkCmdSetRasterizationStreamEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizationStream = rasterizationStream; - UNIX_CALL(vkCmdSetRasterizationStreamEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) -{ - struct vkCmdSetRasterizerDiscardEnable_params params; - params.commandBuffer = commandBuffer; - params.rasterizerDiscardEnable = rasterizerDiscardEnable; - UNIX_CALL(vkCmdSetRasterizerDiscardEnable, ¶ms); -} - -void WINAPI vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) -{ - struct vkCmdSetRasterizerDiscardEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizerDiscardEnable = rasterizerDiscardEnable; - UNIX_CALL(vkCmdSetRasterizerDiscardEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) -{ - struct vkCmdSetRayTracingPipelineStackSizeKHR_params params; - params.commandBuffer = commandBuffer; - params.pipelineStackSize = pipelineStackSize; - UNIX_CALL(vkCmdSetRayTracingPipelineStackSizeKHR, ¶ms); -} - -void WINAPI vkCmdSetRepresentativeFragmentTestEnableNV(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable) -{ - struct vkCmdSetRepresentativeFragmentTestEnableNV_params params; - params.commandBuffer = commandBuffer; - params.representativeFragmentTestEnable = representativeFragmentTestEnable; - UNIX_CALL(vkCmdSetRepresentativeFragmentTestEnableNV, ¶ms); -} - -void WINAPI vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT *pSampleLocationsInfo) -{ - struct vkCmdSetSampleLocationsEXT_params params; - params.commandBuffer = commandBuffer; - params.pSampleLocationsInfo = pSampleLocationsInfo; - UNIX_CALL(vkCmdSetSampleLocationsEXT, ¶ms); -} - -void WINAPI vkCmdSetSampleLocationsEnableEXT(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable) -{ - struct vkCmdSetSampleLocationsEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.sampleLocationsEnable = sampleLocationsEnable; - UNIX_CALL(vkCmdSetSampleLocationsEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetSampleMaskEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask *pSampleMask) -{ - struct vkCmdSetSampleMaskEXT_params params; - params.commandBuffer = commandBuffer; - params.samples = samples; - params.pSampleMask = pSampleMask; - UNIX_CALL(vkCmdSetSampleMaskEXT, ¶ms); -} - -void WINAPI vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissor_params params; - params.commandBuffer = commandBuffer; - params.firstScissor = firstScissor; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissor, ¶ms); -} - -void WINAPI vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissorWithCount_params params; - params.commandBuffer = commandBuffer; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissorWithCount, ¶ms); -} - -void WINAPI vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissorWithCountEXT_params params; - params.commandBuffer = commandBuffer; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissorWithCountEXT, ¶ms); -} - -void WINAPI vkCmdSetShadingRateImageEnableNV(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable) -{ - struct vkCmdSetShadingRateImageEnableNV_params params; - params.commandBuffer = commandBuffer; - params.shadingRateImageEnable = shadingRateImageEnable; - UNIX_CALL(vkCmdSetShadingRateImageEnableNV, ¶ms); -} - -void WINAPI vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) -{ - struct vkCmdSetStencilCompareMask_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.compareMask = compareMask; - UNIX_CALL(vkCmdSetStencilCompareMask, ¶ms); -} - -void WINAPI vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) -{ - struct vkCmdSetStencilOp_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.failOp = failOp; - params.passOp = passOp; - params.depthFailOp = depthFailOp; - params.compareOp = compareOp; - UNIX_CALL(vkCmdSetStencilOp, ¶ms); -} - -void WINAPI vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) -{ - struct vkCmdSetStencilOpEXT_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.failOp = failOp; - params.passOp = passOp; - params.depthFailOp = depthFailOp; - params.compareOp = compareOp; - UNIX_CALL(vkCmdSetStencilOpEXT, ¶ms); -} - -void WINAPI vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) -{ - struct vkCmdSetStencilReference_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.reference = reference; - UNIX_CALL(vkCmdSetStencilReference, ¶ms); -} - -void WINAPI vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) -{ - struct vkCmdSetStencilTestEnable_params params; - params.commandBuffer = commandBuffer; - params.stencilTestEnable = stencilTestEnable; - UNIX_CALL(vkCmdSetStencilTestEnable, ¶ms); -} - -void WINAPI vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) -{ - struct vkCmdSetStencilTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.stencilTestEnable = stencilTestEnable; - UNIX_CALL(vkCmdSetStencilTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) -{ - struct vkCmdSetStencilWriteMask_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.writeMask = writeMask; - UNIX_CALL(vkCmdSetStencilWriteMask, ¶ms); -} - -void WINAPI vkCmdSetTessellationDomainOriginEXT(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin) -{ - struct vkCmdSetTessellationDomainOriginEXT_params params; - params.commandBuffer = commandBuffer; - params.domainOrigin = domainOrigin; - UNIX_CALL(vkCmdSetTessellationDomainOriginEXT, ¶ms); -} - -void WINAPI vkCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions) -{ - struct vkCmdSetVertexInputEXT_params params; - params.commandBuffer = commandBuffer; - params.vertexBindingDescriptionCount = vertexBindingDescriptionCount; - params.pVertexBindingDescriptions = pVertexBindingDescriptions; - params.vertexAttributeDescriptionCount = vertexAttributeDescriptionCount; - params.pVertexAttributeDescriptions = pVertexAttributeDescriptions; - UNIX_CALL(vkCmdSetVertexInputEXT, ¶ms); -} - -void WINAPI vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewport_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewport, ¶ms); -} - -void WINAPI vkCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes) -{ - struct vkCmdSetViewportShadingRatePaletteNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pShadingRatePalettes = pShadingRatePalettes; - UNIX_CALL(vkCmdSetViewportShadingRatePaletteNV, ¶ms); -} - -void WINAPI vkCmdSetViewportSwizzleNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV *pViewportSwizzles) -{ - struct vkCmdSetViewportSwizzleNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewportSwizzles = pViewportSwizzles; - UNIX_CALL(vkCmdSetViewportSwizzleNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWScalingEnableNV(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable) -{ - struct vkCmdSetViewportWScalingEnableNV_params params; - params.commandBuffer = commandBuffer; - params.viewportWScalingEnable = viewportWScalingEnable; - UNIX_CALL(vkCmdSetViewportWScalingEnableNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings) -{ - struct vkCmdSetViewportWScalingNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewportWScalings = pViewportWScalings; - UNIX_CALL(vkCmdSetViewportWScalingNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewportWithCount_params params; - params.commandBuffer = commandBuffer; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewportWithCount, ¶ms); -} - -void WINAPI vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewportWithCountEXT_params params; - params.commandBuffer = commandBuffer; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewportWithCountEXT, ¶ms); -} - -void WINAPI vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer) -{ - struct vkCmdSubpassShadingHUAWEI_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdSubpassShadingHUAWEI, ¶ms); -} - -void WINAPI vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) -{ - struct vkCmdTraceRaysIndirect2KHR_params params; - params.commandBuffer = commandBuffer; - params.indirectDeviceAddress = indirectDeviceAddress; - UNIX_CALL(vkCmdTraceRaysIndirect2KHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) -{ - struct vkCmdTraceRaysIndirectKHR_params params; - params.commandBuffer = commandBuffer; - params.pRaygenShaderBindingTable = pRaygenShaderBindingTable; - params.pMissShaderBindingTable = pMissShaderBindingTable; - params.pHitShaderBindingTable = pHitShaderBindingTable; - params.pCallableShaderBindingTable = pCallableShaderBindingTable; - params.indirectDeviceAddress = indirectDeviceAddress; - UNIX_CALL(vkCmdTraceRaysIndirectKHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) -{ - struct vkCmdTraceRaysKHR_params params; - params.commandBuffer = commandBuffer; - params.pRaygenShaderBindingTable = pRaygenShaderBindingTable; - params.pMissShaderBindingTable = pMissShaderBindingTable; - params.pHitShaderBindingTable = pHitShaderBindingTable; - params.pCallableShaderBindingTable = pCallableShaderBindingTable; - params.width = width; - params.height = height; - params.depth = depth; - UNIX_CALL(vkCmdTraceRaysKHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) -{ - struct vkCmdTraceRaysNV_params params; - params.commandBuffer = commandBuffer; - params.raygenShaderBindingTableBuffer = raygenShaderBindingTableBuffer; - params.raygenShaderBindingOffset = raygenShaderBindingOffset; - params.missShaderBindingTableBuffer = missShaderBindingTableBuffer; - params.missShaderBindingOffset = missShaderBindingOffset; - params.missShaderBindingStride = missShaderBindingStride; - params.hitShaderBindingTableBuffer = hitShaderBindingTableBuffer; - params.hitShaderBindingOffset = hitShaderBindingOffset; - params.hitShaderBindingStride = hitShaderBindingStride; - params.callableShaderBindingTableBuffer = callableShaderBindingTableBuffer; - params.callableShaderBindingOffset = callableShaderBindingOffset; - params.callableShaderBindingStride = callableShaderBindingStride; - params.width = width; - params.height = height; - params.depth = depth; - UNIX_CALL(vkCmdTraceRaysNV, ¶ms); -} - -void WINAPI vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData) -{ - struct vkCmdUpdateBuffer_params params; - params.commandBuffer = commandBuffer; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.dataSize = dataSize; - params.pData = pData; - UNIX_CALL(vkCmdUpdateBuffer, ¶ms); -} - -void WINAPI vkCmdUpdatePipelineIndirectBufferNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) -{ - struct vkCmdUpdatePipelineIndirectBufferNV_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - UNIX_CALL(vkCmdUpdatePipelineIndirectBufferNV, ¶ms); -} - -void WINAPI vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) -{ - struct vkCmdWaitEvents_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.srcStageMask = srcStageMask; - params.dstStageMask = dstStageMask; - params.memoryBarrierCount = memoryBarrierCount; - params.pMemoryBarriers = pMemoryBarriers; - params.bufferMemoryBarrierCount = bufferMemoryBarrierCount; - params.pBufferMemoryBarriers = pBufferMemoryBarriers; - params.imageMemoryBarrierCount = imageMemoryBarrierCount; - params.pImageMemoryBarriers = pImageMemoryBarriers; - UNIX_CALL(vkCmdWaitEvents, ¶ms); -} - -void WINAPI vkCmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos) -{ - struct vkCmdWaitEvents2_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.pDependencyInfos = pDependencyInfos; - UNIX_CALL(vkCmdWaitEvents2, ¶ms); -} - -void WINAPI vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos) -{ - struct vkCmdWaitEvents2KHR_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.pDependencyInfos = pDependencyInfos; - UNIX_CALL(vkCmdWaitEvents2KHR, ¶ms); -} - -void WINAPI vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteAccelerationStructuresPropertiesKHR_params params; - params.commandBuffer = commandBuffer; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteAccelerationStructuresPropertiesKHR, ¶ms); -} - -void WINAPI vkCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteAccelerationStructuresPropertiesNV_params params; - params.commandBuffer = commandBuffer; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteAccelerationStructuresPropertiesNV, ¶ms); -} - -void WINAPI vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) -{ - struct vkCmdWriteBufferMarker2AMD_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.marker = marker; - UNIX_CALL(vkCmdWriteBufferMarker2AMD, ¶ms); -} - -void WINAPI vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) -{ - struct vkCmdWriteBufferMarkerAMD_params params; - params.commandBuffer = commandBuffer; - params.pipelineStage = pipelineStage; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.marker = marker; - UNIX_CALL(vkCmdWriteBufferMarkerAMD, ¶ms); -} - -void WINAPI vkCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteMicromapsPropertiesEXT_params params; - params.commandBuffer = commandBuffer; - params.micromapCount = micromapCount; - params.pMicromaps = pMicromaps; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteMicromapsPropertiesEXT, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp_params params; - params.commandBuffer = commandBuffer; - params.pipelineStage = pipelineStage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp2_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp2, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp2KHR_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp2KHR, ¶ms); -} - -VkResult WINAPI vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) -{ - struct vkCompileDeferredNV_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.shader = shader; - status = UNIX_CALL(vkCompileDeferredNV, ¶ms); - assert(!status && "vkCompileDeferredNV"); - return params.result; -} - -VkResult WINAPI vkCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo) -{ - struct vkCopyAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyAccelerationStructureKHR, ¶ms); - assert(!status && "vkCopyAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) -{ - struct vkCopyAccelerationStructureToMemoryKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyAccelerationStructureToMemoryKHR, ¶ms); - assert(!status && "vkCopyAccelerationStructureToMemoryKHR"); - return params.result; -} - -VkResult WINAPI vkCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfoEXT *pCopyImageToImageInfo) -{ - struct vkCopyImageToImageEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToImageInfo = pCopyImageToImageInfo; - status = UNIX_CALL(vkCopyImageToImageEXT, ¶ms); - assert(!status && "vkCopyImageToImageEXT"); - return params.result; -} - -VkResult WINAPI vkCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfoEXT *pCopyImageToMemoryInfo) -{ - struct vkCopyImageToMemoryEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToMemoryInfo = pCopyImageToMemoryInfo; - status = UNIX_CALL(vkCopyImageToMemoryEXT, ¶ms); - assert(!status && "vkCopyImageToMemoryEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) -{ - struct vkCopyMemoryToAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMemoryToAccelerationStructureKHR, ¶ms); - assert(!status && "vkCopyMemoryToAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfoEXT *pCopyMemoryToImageInfo) -{ - struct vkCopyMemoryToImageEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyMemoryToImageInfo = pCopyMemoryToImageInfo; - status = UNIX_CALL(vkCopyMemoryToImageEXT, ¶ms); - assert(!status && "vkCopyMemoryToImageEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT *pInfo) -{ - struct vkCopyMemoryToMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMemoryToMicromapEXT, ¶ms); - assert(!status && "vkCopyMemoryToMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT *pInfo) -{ - struct vkCopyMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMicromapEXT, ¶ms); - assert(!status && "vkCopyMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT *pInfo) -{ - struct vkCopyMicromapToMemoryEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMicromapToMemoryEXT, ¶ms); - assert(!status && "vkCopyMicromapToMemoryEXT"); - return params.result; -} - -VkResult WINAPI vkCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure) -{ - struct vkCreateAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pAccelerationStructure = pAccelerationStructure; - status = UNIX_CALL(vkCreateAccelerationStructureKHR, ¶ms); - assert(!status && "vkCreateAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure) -{ - struct vkCreateAccelerationStructureNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pAccelerationStructure = pAccelerationStructure; - status = UNIX_CALL(vkCreateAccelerationStructureNV, ¶ms); - assert(!status && "vkCreateAccelerationStructureNV"); - return params.result; -} - -VkResult WINAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) -{ - struct vkCreateBuffer_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pBuffer = pBuffer; - status = UNIX_CALL(vkCreateBuffer, ¶ms); - assert(!status && "vkCreateBuffer"); - return params.result; -} - -VkResult WINAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView) -{ - struct vkCreateBufferView_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pView = pView; - status = UNIX_CALL(vkCreateBufferView, ¶ms); - assert(!status && "vkCreateBufferView"); - return params.result; -} - -VkResult WINAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateComputePipelines_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateComputePipelines, ¶ms); - assert(!status && "vkCreateComputePipelines"); - return params.result; -} - -VkResult WINAPI vkCreateCuFunctionNVX(VkDevice device, const VkCuFunctionCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuFunctionNVX *pFunction) -{ - struct vkCreateCuFunctionNVX_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFunction = pFunction; - status = UNIX_CALL(vkCreateCuFunctionNVX, ¶ms); - assert(!status && "vkCreateCuFunctionNVX"); - return params.result; -} - -VkResult WINAPI vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuModuleNVX *pModule) -{ - struct vkCreateCuModuleNVX_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pModule = pModule; - status = UNIX_CALL(vkCreateCuModuleNVX, ¶ms); - assert(!status && "vkCreateCuModuleNVX"); - return params.result; -} - -VkResult WINAPI vkCreateCudaFunctionNV(VkDevice device, const VkCudaFunctionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaFunctionNV *pFunction) -{ - struct vkCreateCudaFunctionNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFunction = pFunction; - status = UNIX_CALL(vkCreateCudaFunctionNV, ¶ms); - assert(!status && "vkCreateCudaFunctionNV"); - return params.result; -} - -VkResult WINAPI vkCreateCudaModuleNV(VkDevice device, const VkCudaModuleCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaModuleNV *pModule) -{ - struct vkCreateCudaModuleNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pModule = pModule; - status = UNIX_CALL(vkCreateCudaModuleNV, ¶ms); - assert(!status && "vkCreateCudaModuleNV"); - return params.result; -} - -VkResult WINAPI vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) -{ - struct vkCreateDebugReportCallbackEXT_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pCallback = pCallback; - status = UNIX_CALL(vkCreateDebugReportCallbackEXT, ¶ms); - assert(!status && "vkCreateDebugReportCallbackEXT"); - return params.result; -} - -VkResult WINAPI vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) -{ - struct vkCreateDebugUtilsMessengerEXT_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pMessenger = pMessenger; - status = UNIX_CALL(vkCreateDebugUtilsMessengerEXT, ¶ms); - assert(!status && "vkCreateDebugUtilsMessengerEXT"); - return params.result; -} - -VkResult WINAPI vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation) -{ - struct vkCreateDeferredOperationKHR_params params; - NTSTATUS status; - params.device = device; - params.pAllocator = pAllocator; - params.pDeferredOperation = pDeferredOperation; - status = UNIX_CALL(vkCreateDeferredOperationKHR, ¶ms); - assert(!status && "vkCreateDeferredOperationKHR"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool) -{ - struct vkCreateDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorPool = pDescriptorPool; - status = UNIX_CALL(vkCreateDescriptorPool, ¶ms); - assert(!status && "vkCreateDescriptorPool"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout) -{ - struct vkCreateDescriptorSetLayout_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSetLayout = pSetLayout; - status = UNIX_CALL(vkCreateDescriptorSetLayout, ¶ms); - assert(!status && "vkCreateDescriptorSetLayout"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate) -{ - struct vkCreateDescriptorUpdateTemplate_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorUpdateTemplate = pDescriptorUpdateTemplate; - status = UNIX_CALL(vkCreateDescriptorUpdateTemplate, ¶ms); - assert(!status && "vkCreateDescriptorUpdateTemplate"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate) -{ - struct vkCreateDescriptorUpdateTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorUpdateTemplate = pDescriptorUpdateTemplate; - status = UNIX_CALL(vkCreateDescriptorUpdateTemplateKHR, ¶ms); - assert(!status && "vkCreateDescriptorUpdateTemplateKHR"); - return params.result; -} - -VkResult WINAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) -{ - struct vkCreateEvent_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pEvent = pEvent; - status = UNIX_CALL(vkCreateEvent, ¶ms); - assert(!status && "vkCreateEvent"); - return params.result; -} - -VkResult WINAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence) -{ - struct vkCreateFence_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFence = pFence; - status = UNIX_CALL(vkCreateFence, ¶ms); - assert(!status && "vkCreateFence"); - return params.result; -} - -VkResult WINAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) -{ - struct vkCreateFramebuffer_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFramebuffer = pFramebuffer; - status = UNIX_CALL(vkCreateFramebuffer, ¶ms); - assert(!status && "vkCreateFramebuffer"); - return params.result; -} - -VkResult WINAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateGraphicsPipelines_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateGraphicsPipelines, ¶ms); - assert(!status && "vkCreateGraphicsPipelines"); - return params.result; -} - -VkResult WINAPI vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) -{ - struct vkCreateImage_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pImage = pImage; - status = UNIX_CALL(vkCreateImage, ¶ms); - assert(!status && "vkCreateImage"); - return params.result; -} - -VkResult WINAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView) -{ - struct vkCreateImageView_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pView = pView; - status = UNIX_CALL(vkCreateImageView, ¶ms); - assert(!status && "vkCreateImageView"); - return params.result; -} - -VkResult WINAPI vkCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutNV *pIndirectCommandsLayout) -{ - struct vkCreateIndirectCommandsLayoutNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pIndirectCommandsLayout = pIndirectCommandsLayout; - status = UNIX_CALL(vkCreateIndirectCommandsLayoutNV, ¶ms); - assert(!status && "vkCreateIndirectCommandsLayoutNV"); - return params.result; -} - -VkResult WINAPI vkCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap) -{ - struct vkCreateMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pMicromap = pMicromap; - status = UNIX_CALL(vkCreateMicromapEXT, ¶ms); - assert(!status && "vkCreateMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCreateOpticalFlowSessionNV(VkDevice device, const VkOpticalFlowSessionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkOpticalFlowSessionNV *pSession) -{ - struct vkCreateOpticalFlowSessionNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSession = pSession; - status = UNIX_CALL(vkCreateOpticalFlowSessionNV, ¶ms); - assert(!status && "vkCreateOpticalFlowSessionNV"); - return params.result; -} - -VkResult WINAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache) -{ - struct vkCreatePipelineCache_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPipelineCache = pPipelineCache; - status = UNIX_CALL(vkCreatePipelineCache, ¶ms); - assert(!status && "vkCreatePipelineCache"); - return params.result; -} - -VkResult WINAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) -{ - struct vkCreatePipelineLayout_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPipelineLayout = pPipelineLayout; - status = UNIX_CALL(vkCreatePipelineLayout, ¶ms); - assert(!status && "vkCreatePipelineLayout"); - return params.result; -} - -VkResult WINAPI vkCreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot) -{ - struct vkCreatePrivateDataSlot_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPrivateDataSlot = pPrivateDataSlot; - status = UNIX_CALL(vkCreatePrivateDataSlot, ¶ms); - assert(!status && "vkCreatePrivateDataSlot"); - return params.result; -} - -VkResult WINAPI vkCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot) -{ - struct vkCreatePrivateDataSlotEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPrivateDataSlot = pPrivateDataSlot; - status = UNIX_CALL(vkCreatePrivateDataSlotEXT, ¶ms); - assert(!status && "vkCreatePrivateDataSlotEXT"); - return params.result; -} - -VkResult WINAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) -{ - struct vkCreateQueryPool_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pQueryPool = pQueryPool; - status = UNIX_CALL(vkCreateQueryPool, ¶ms); - assert(!status && "vkCreateQueryPool"); - return params.result; -} - -VkResult WINAPI vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateRayTracingPipelinesKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateRayTracingPipelinesKHR, ¶ms); - assert(!status && "vkCreateRayTracingPipelinesKHR"); - return params.result; -} - -VkResult WINAPI vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateRayTracingPipelinesNV_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateRayTracingPipelinesNV, ¶ms); - assert(!status && "vkCreateRayTracingPipelinesNV"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass, ¶ms); - assert(!status && "vkCreateRenderPass"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass2_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass2, ¶ms); - assert(!status && "vkCreateRenderPass2"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass2KHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass2KHR, ¶ms); - assert(!status && "vkCreateRenderPass2KHR"); - return params.result; -} - -VkResult WINAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) -{ - struct vkCreateSampler_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSampler = pSampler; - status = UNIX_CALL(vkCreateSampler, ¶ms); - assert(!status && "vkCreateSampler"); - return params.result; -} - -VkResult WINAPI vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion) -{ - struct vkCreateSamplerYcbcrConversion_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pYcbcrConversion = pYcbcrConversion; - status = UNIX_CALL(vkCreateSamplerYcbcrConversion, ¶ms); - assert(!status && "vkCreateSamplerYcbcrConversion"); - return params.result; -} - -VkResult WINAPI vkCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion) -{ - struct vkCreateSamplerYcbcrConversionKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pYcbcrConversion = pYcbcrConversion; - status = UNIX_CALL(vkCreateSamplerYcbcrConversionKHR, ¶ms); - assert(!status && "vkCreateSamplerYcbcrConversionKHR"); - return params.result; -} - -VkResult WINAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) -{ - struct vkCreateSemaphore_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSemaphore = pSemaphore; - status = UNIX_CALL(vkCreateSemaphore, ¶ms); - assert(!status && "vkCreateSemaphore"); - return params.result; -} - -VkResult WINAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule) -{ - struct vkCreateShaderModule_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pShaderModule = pShaderModule; - status = UNIX_CALL(vkCreateShaderModule, ¶ms); - assert(!status && "vkCreateShaderModule"); - return params.result; -} - -VkResult WINAPI vkCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders) -{ - struct vkCreateShadersEXT_params params; - NTSTATUS status; - params.device = device; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pShaders = pShaders; - status = UNIX_CALL(vkCreateShadersEXT, ¶ms); - assert(!status && "vkCreateShadersEXT"); - return params.result; -} - -VkResult WINAPI vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) -{ - struct vkCreateSwapchainKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSwapchain = pSwapchain; - status = UNIX_CALL(vkCreateSwapchainKHR, ¶ms); - assert(!status && "vkCreateSwapchainKHR"); - return params.result; -} - -VkResult WINAPI vkCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkValidationCacheEXT *pValidationCache) -{ - struct vkCreateValidationCacheEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pValidationCache = pValidationCache; - status = UNIX_CALL(vkCreateValidationCacheEXT, ¶ms); - assert(!status && "vkCreateValidationCacheEXT"); - return params.result; -} - -VkResult WINAPI vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) -{ - struct vkCreateWin32SurfaceKHR_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSurface = pSurface; - status = UNIX_CALL(vkCreateWin32SurfaceKHR, ¶ms); - assert(!status && "vkCreateWin32SurfaceKHR"); - return params.result; -} - -VkResult WINAPI vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) -{ - struct vkDebugMarkerSetObjectNameEXT_params params; - NTSTATUS status; - params.device = device; - params.pNameInfo = pNameInfo; - status = UNIX_CALL(vkDebugMarkerSetObjectNameEXT, ¶ms); - assert(!status && "vkDebugMarkerSetObjectNameEXT"); - return params.result; -} - -VkResult WINAPI vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) -{ - struct vkDebugMarkerSetObjectTagEXT_params params; - NTSTATUS status; - params.device = device; - params.pTagInfo = pTagInfo; - status = UNIX_CALL(vkDebugMarkerSetObjectTagEXT, ¶ms); - assert(!status && "vkDebugMarkerSetObjectTagEXT"); - return params.result; -} - -void WINAPI vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage) -{ - struct vkDebugReportMessageEXT_params params; - NTSTATUS status; - params.instance = instance; - params.flags = flags; - params.objectType = objectType; - params.object = object; - params.location = location; - params.messageCode = messageCode; - params.pLayerPrefix = pLayerPrefix; - params.pMessage = pMessage; - status = UNIX_CALL(vkDebugReportMessageEXT, ¶ms); - assert(!status && "vkDebugReportMessageEXT"); -} - -VkResult WINAPI vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkDeferredOperationJoinKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkDeferredOperationJoinKHR, ¶ms); - assert(!status && "vkDeferredOperationJoinKHR"); - return params.result; -} - -void WINAPI vkDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyAccelerationStructureKHR, ¶ms); - assert(!status && "vkDestroyAccelerationStructureKHR"); -} - -void WINAPI vkDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyAccelerationStructureNV_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyAccelerationStructureNV, ¶ms); - assert(!status && "vkDestroyAccelerationStructureNV"); -} - -void WINAPI vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyBuffer_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyBuffer, ¶ms); - assert(!status && "vkDestroyBuffer"); -} - -void WINAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyBufferView_params params; - NTSTATUS status; - params.device = device; - params.bufferView = bufferView; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyBufferView, ¶ms); - assert(!status && "vkDestroyBufferView"); -} - -void WINAPI vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCuFunctionNVX_params params; - NTSTATUS status; - params.device = device; - params.function = function; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCuFunctionNVX, ¶ms); - assert(!status && "vkDestroyCuFunctionNVX"); -} - -void WINAPI vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCuModuleNVX_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCuModuleNVX, ¶ms); - assert(!status && "vkDestroyCuModuleNVX"); -} - -void WINAPI vkDestroyCudaFunctionNV(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCudaFunctionNV_params params; - NTSTATUS status; - params.device = device; - params.function = function; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCudaFunctionNV, ¶ms); - assert(!status && "vkDestroyCudaFunctionNV"); -} - -void WINAPI vkDestroyCudaModuleNV(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCudaModuleNV_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCudaModuleNV, ¶ms); - assert(!status && "vkDestroyCudaModuleNV"); -} - -void WINAPI vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDebugReportCallbackEXT_params params; - NTSTATUS status; - params.instance = instance; - params.callback = callback; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDebugReportCallbackEXT, ¶ms); - assert(!status && "vkDestroyDebugReportCallbackEXT"); -} - -void WINAPI vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDebugUtilsMessengerEXT_params params; - NTSTATUS status; - params.instance = instance; - params.messenger = messenger; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDebugUtilsMessengerEXT, ¶ms); - assert(!status && "vkDestroyDebugUtilsMessengerEXT"); -} - -void WINAPI vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDeferredOperationKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDeferredOperationKHR, ¶ms); - assert(!status && "vkDestroyDeferredOperationKHR"); -} - -void WINAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorPool, ¶ms); - assert(!status && "vkDestroyDescriptorPool"); -} - -void WINAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorSetLayout_params params; - NTSTATUS status; - params.device = device; - params.descriptorSetLayout = descriptorSetLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorSetLayout, ¶ms); - assert(!status && "vkDestroyDescriptorSetLayout"); -} - -void WINAPI vkDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorUpdateTemplate_params params; - NTSTATUS status; - params.device = device; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorUpdateTemplate, ¶ms); - assert(!status && "vkDestroyDescriptorUpdateTemplate"); -} - -void WINAPI vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorUpdateTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorUpdateTemplateKHR, ¶ms); - assert(!status && "vkDestroyDescriptorUpdateTemplateKHR"); -} - -void WINAPI vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyEvent, ¶ms); - assert(!status && "vkDestroyEvent"); -} - -void WINAPI vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyFence_params params; - NTSTATUS status; - params.device = device; - params.fence = fence; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyFence, ¶ms); - assert(!status && "vkDestroyFence"); -} - -void WINAPI vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyFramebuffer_params params; - NTSTATUS status; - params.device = device; - params.framebuffer = framebuffer; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyFramebuffer, ¶ms); - assert(!status && "vkDestroyFramebuffer"); -} - -void WINAPI vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyImage_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyImage, ¶ms); - assert(!status && "vkDestroyImage"); -} - -void WINAPI vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyImageView_params params; - NTSTATUS status; - params.device = device; - params.imageView = imageView; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyImageView, ¶ms); - assert(!status && "vkDestroyImageView"); -} - -void WINAPI vkDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyIndirectCommandsLayoutNV_params params; - NTSTATUS status; - params.device = device; - params.indirectCommandsLayout = indirectCommandsLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyIndirectCommandsLayoutNV, ¶ms); - assert(!status && "vkDestroyIndirectCommandsLayoutNV"); -} - -void WINAPI vkDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.micromap = micromap; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyMicromapEXT, ¶ms); - assert(!status && "vkDestroyMicromapEXT"); -} - -void WINAPI vkDestroyOpticalFlowSessionNV(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyOpticalFlowSessionNV_params params; - NTSTATUS status; - params.device = device; - params.session = session; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyOpticalFlowSessionNV, ¶ms); - assert(!status && "vkDestroyOpticalFlowSessionNV"); -} - -void WINAPI vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipeline_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipeline, ¶ms); - assert(!status && "vkDestroyPipeline"); -} - -void WINAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipelineCache_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipelineCache, ¶ms); - assert(!status && "vkDestroyPipelineCache"); -} - -void WINAPI vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipelineLayout_params params; - NTSTATUS status; - params.device = device; - params.pipelineLayout = pipelineLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipelineLayout, ¶ms); - assert(!status && "vkDestroyPipelineLayout"); -} - -void WINAPI vkDestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPrivateDataSlot_params params; - NTSTATUS status; - params.device = device; - params.privateDataSlot = privateDataSlot; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPrivateDataSlot, ¶ms); - assert(!status && "vkDestroyPrivateDataSlot"); -} - -void WINAPI vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPrivateDataSlotEXT_params params; - NTSTATUS status; - params.device = device; - params.privateDataSlot = privateDataSlot; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPrivateDataSlotEXT, ¶ms); - assert(!status && "vkDestroyPrivateDataSlotEXT"); -} - -void WINAPI vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyQueryPool_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyQueryPool, ¶ms); - assert(!status && "vkDestroyQueryPool"); -} - -void WINAPI vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyRenderPass_params params; - NTSTATUS status; - params.device = device; - params.renderPass = renderPass; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyRenderPass, ¶ms); - assert(!status && "vkDestroyRenderPass"); -} - -void WINAPI vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySampler_params params; - NTSTATUS status; - params.device = device; - params.sampler = sampler; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySampler, ¶ms); - assert(!status && "vkDestroySampler"); -} - -void WINAPI vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySamplerYcbcrConversion_params params; - NTSTATUS status; - params.device = device; - params.ycbcrConversion = ycbcrConversion; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySamplerYcbcrConversion, ¶ms); - assert(!status && "vkDestroySamplerYcbcrConversion"); -} - -void WINAPI vkDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySamplerYcbcrConversionKHR_params params; - NTSTATUS status; - params.device = device; - params.ycbcrConversion = ycbcrConversion; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySamplerYcbcrConversionKHR, ¶ms); - assert(!status && "vkDestroySamplerYcbcrConversionKHR"); -} - -void WINAPI vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySemaphore_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySemaphore, ¶ms); - assert(!status && "vkDestroySemaphore"); -} - -void WINAPI vkDestroyShaderEXT(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyShaderEXT_params params; - NTSTATUS status; - params.device = device; - params.shader = shader; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyShaderEXT, ¶ms); - assert(!status && "vkDestroyShaderEXT"); -} - -void WINAPI vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyShaderModule_params params; - NTSTATUS status; - params.device = device; - params.shaderModule = shaderModule; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyShaderModule, ¶ms); - assert(!status && "vkDestroyShaderModule"); -} - -void WINAPI vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySurfaceKHR_params params; - NTSTATUS status; - params.instance = instance; - params.surface = surface; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySurfaceKHR, ¶ms); - assert(!status && "vkDestroySurfaceKHR"); -} - -void WINAPI vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySwapchainKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySwapchainKHR, ¶ms); - assert(!status && "vkDestroySwapchainKHR"); -} - -void WINAPI vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyValidationCacheEXT_params params; - NTSTATUS status; - params.device = device; - params.validationCache = validationCache; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyValidationCacheEXT, ¶ms); - assert(!status && "vkDestroyValidationCacheEXT"); -} - -VkResult WINAPI vkDeviceWaitIdle(VkDevice device) -{ - struct vkDeviceWaitIdle_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkDeviceWaitIdle, ¶ms); - assert(!status && "vkDeviceWaitIdle"); - return params.result; -} - -VkResult WINAPI vkEndCommandBuffer(VkCommandBuffer commandBuffer) -{ - struct vkEndCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - status = UNIX_CALL(vkEndCommandBuffer, ¶ms); - assert(!status && "vkEndCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) -{ - struct vkEnumerateDeviceExtensionProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pLayerName = pLayerName; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkEnumerateDeviceExtensionProperties, ¶ms); - assert(!status && "vkEnumerateDeviceExtensionProperties"); - return params.result; -} - -VkResult WINAPI vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties) -{ - struct vkEnumerateDeviceLayerProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkEnumerateDeviceLayerProperties, ¶ms); - assert(!status && "vkEnumerateDeviceLayerProperties"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) -{ - struct vkEnumeratePhysicalDeviceGroups_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceGroupCount = pPhysicalDeviceGroupCount; - params.pPhysicalDeviceGroupProperties = pPhysicalDeviceGroupProperties; - status = UNIX_CALL(vkEnumeratePhysicalDeviceGroups, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceGroups"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) -{ - struct vkEnumeratePhysicalDeviceGroupsKHR_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceGroupCount = pPhysicalDeviceGroupCount; - params.pPhysicalDeviceGroupProperties = pPhysicalDeviceGroupProperties; - status = UNIX_CALL(vkEnumeratePhysicalDeviceGroupsKHR, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceGroupsKHR"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pCounterCount, VkPerformanceCounterKHR *pCounters, VkPerformanceCounterDescriptionKHR *pCounterDescriptions) -{ - struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - params.pCounterCount = pCounterCount; - params.pCounters = pCounters; - params.pCounterDescriptions = pCounterDescriptions; - status = UNIX_CALL(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) -{ - struct vkEnumeratePhysicalDevices_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceCount = pPhysicalDeviceCount; - params.pPhysicalDevices = pPhysicalDevices; - status = UNIX_CALL(vkEnumeratePhysicalDevices, ¶ms); - assert(!status && "vkEnumeratePhysicalDevices"); - return params.result; -} - -VkResult WINAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) -{ - struct vkFlushMappedMemoryRanges_params params; - NTSTATUS status; - params.device = device; - params.memoryRangeCount = memoryRangeCount; - params.pMemoryRanges = pMemoryRanges; - status = UNIX_CALL(vkFlushMappedMemoryRanges, ¶ms); - assert(!status && "vkFlushMappedMemoryRanges"); - return params.result; -} - -VkResult WINAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets) -{ - struct vkFreeDescriptorSets_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.descriptorSetCount = descriptorSetCount; - params.pDescriptorSets = pDescriptorSets; - status = UNIX_CALL(vkFreeDescriptorSets, ¶ms); - assert(!status && "vkFreeDescriptorSets"); - return params.result; -} - -void WINAPI vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) -{ - struct vkFreeMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkFreeMemory, ¶ms); - assert(!status && "vkFreeMemory"); -} - -void WINAPI vkGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo) -{ - struct vkGetAccelerationStructureBuildSizesKHR_params params; - NTSTATUS status; - params.device = device; - params.buildType = buildType; - params.pBuildInfo = pBuildInfo; - params.pMaxPrimitiveCounts = pMaxPrimitiveCounts; - params.pSizeInfo = pSizeInfo; - status = UNIX_CALL(vkGetAccelerationStructureBuildSizesKHR, ¶ms); - assert(!status && "vkGetAccelerationStructureBuildSizesKHR"); -} - -VkDeviceAddress WINAPI vkGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR *pInfo) -{ - struct vkGetAccelerationStructureDeviceAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetAccelerationStructureDeviceAddressKHR, ¶ms); - assert(!status && "vkGetAccelerationStructureDeviceAddressKHR"); - return params.result; -} - -VkResult WINAPI vkGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void *pData) -{ - struct vkGetAccelerationStructureHandleNV_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetAccelerationStructureHandleNV, ¶ms); - assert(!status && "vkGetAccelerationStructureHandleNV"); - return params.result; -} - -void WINAPI vkGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2KHR *pMemoryRequirements) -{ - struct vkGetAccelerationStructureMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetAccelerationStructureMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetAccelerationStructureMemoryRequirementsNV"); -} - -VkResult WINAPI vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddress, ¶ms); - assert(!status && "vkGetBufferDeviceAddress"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddressEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddressEXT, ¶ms); - assert(!status && "vkGetBufferDeviceAddressEXT"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddressKHR, ¶ms); - assert(!status && "vkGetBufferDeviceAddressKHR"); - return params.result; -} - -void WINAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements"); -} - -void WINAPI vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements2, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements2"); -} - -void WINAPI vkGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements2KHR"); -} - -uint64_t WINAPI vkGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferOpaqueCaptureAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferOpaqueCaptureAddress, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureAddress"); - return params.result; -} - -uint64_t WINAPI vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferOpaqueCaptureAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferOpaqueCaptureAddressKHR, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureAddressKHR"); - return params.result; -} - -VkResult WINAPI vkGetBufferOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetBufferOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation) -{ - struct vkGetCalibratedTimestampsEXT_params params; - NTSTATUS status; - params.device = device; - params.timestampCount = timestampCount; - params.pTimestampInfos = pTimestampInfos; - params.pTimestamps = pTimestamps; - params.pMaxDeviation = pMaxDeviation; - status = UNIX_CALL(vkGetCalibratedTimestampsEXT, ¶ms); - assert(!status && "vkGetCalibratedTimestampsEXT"); - return params.result; -} - -VkResult WINAPI vkGetCudaModuleCacheNV(VkDevice device, VkCudaModuleNV module, size_t *pCacheSize, void *pCacheData) -{ - struct vkGetCudaModuleCacheNV_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pCacheSize = pCacheSize; - params.pCacheData = pCacheData; - status = UNIX_CALL(vkGetCudaModuleCacheNV, ¶ms); - assert(!status && "vkGetCudaModuleCacheNV"); - return params.result; -} - -uint32_t WINAPI vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkGetDeferredOperationMaxConcurrencyKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkGetDeferredOperationMaxConcurrencyKHR, ¶ms); - assert(!status && "vkGetDeferredOperationMaxConcurrencyKHR"); - return params.result; -} - -VkResult WINAPI vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkGetDeferredOperationResultKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkGetDeferredOperationResultKHR, ¶ms); - assert(!status && "vkGetDeferredOperationResultKHR"); - return params.result; -} - -void WINAPI vkGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, void *pDescriptor) -{ - struct vkGetDescriptorEXT_params params; - params.device = device; - params.pDescriptorInfo = pDescriptorInfo; - params.dataSize = dataSize; - params.pDescriptor = pDescriptor; - UNIX_CALL(vkGetDescriptorEXT, ¶ms); -} - -void WINAPI vkGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void **ppData) -{ - struct vkGetDescriptorSetHostMappingVALVE_params params; - NTSTATUS status; - params.device = device; - params.descriptorSet = descriptorSet; - params.ppData = ppData; - status = UNIX_CALL(vkGetDescriptorSetHostMappingVALVE, ¶ms); - assert(!status && "vkGetDescriptorSetHostMappingVALVE"); -} - -void WINAPI vkGetDescriptorSetLayoutBindingOffsetEXT(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize *pOffset) -{ - struct vkGetDescriptorSetLayoutBindingOffsetEXT_params params; - NTSTATUS status; - params.device = device; - params.layout = layout; - params.binding = binding; - params.pOffset = pOffset; - status = UNIX_CALL(vkGetDescriptorSetLayoutBindingOffsetEXT, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutBindingOffsetEXT"); -} - -void WINAPI vkGetDescriptorSetLayoutHostMappingInfoVALVE(VkDevice device, const VkDescriptorSetBindingReferenceVALVE *pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping) -{ - struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params params; - NTSTATUS status; - params.device = device; - params.pBindingReference = pBindingReference; - params.pHostMapping = pHostMapping; - status = UNIX_CALL(vkGetDescriptorSetLayoutHostMappingInfoVALVE, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutHostMappingInfoVALVE"); -} - -void WINAPI vkGetDescriptorSetLayoutSizeEXT(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize *pLayoutSizeInBytes) -{ - struct vkGetDescriptorSetLayoutSizeEXT_params params; - NTSTATUS status; - params.device = device; - params.layout = layout; - params.pLayoutSizeInBytes = pLayoutSizeInBytes; - status = UNIX_CALL(vkGetDescriptorSetLayoutSizeEXT, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSizeEXT"); -} - -void WINAPI vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport) -{ - struct vkGetDescriptorSetLayoutSupport_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pSupport = pSupport; - status = UNIX_CALL(vkGetDescriptorSetLayoutSupport, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSupport"); -} - -void WINAPI vkGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport) -{ - struct vkGetDescriptorSetLayoutSupportKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pSupport = pSupport; - status = UNIX_CALL(vkGetDescriptorSetLayoutSupportKHR, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSupportKHR"); -} - -void WINAPI vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility) -{ - struct vkGetDeviceAccelerationStructureCompatibilityKHR_params params; - NTSTATUS status; - params.device = device; - params.pVersionInfo = pVersionInfo; - params.pCompatibility = pCompatibility; - status = UNIX_CALL(vkGetDeviceAccelerationStructureCompatibilityKHR, ¶ms); - assert(!status && "vkGetDeviceAccelerationStructureCompatibilityKHR"); -} - -void WINAPI vkGetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceBufferMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceBufferMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceBufferMemoryRequirements"); -} - -void WINAPI vkGetDeviceBufferMemoryRequirementsKHR(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceBufferMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceBufferMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceBufferMemoryRequirementsKHR"); -} - -VkResult WINAPI vkGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultCountsEXT *pFaultCounts, VkDeviceFaultInfoEXT *pFaultInfo) -{ - struct vkGetDeviceFaultInfoEXT_params params; - NTSTATUS status; - params.device = device; - params.pFaultCounts = pFaultCounts; - params.pFaultInfo = pFaultInfo; - status = UNIX_CALL(vkGetDeviceFaultInfoEXT, ¶ms); - assert(!status && "vkGetDeviceFaultInfoEXT"); - return params.result; -} - -void WINAPI vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures) -{ - struct vkGetDeviceGroupPeerMemoryFeatures_params params; - NTSTATUS status; - params.device = device; - params.heapIndex = heapIndex; - params.localDeviceIndex = localDeviceIndex; - params.remoteDeviceIndex = remoteDeviceIndex; - params.pPeerMemoryFeatures = pPeerMemoryFeatures; - status = UNIX_CALL(vkGetDeviceGroupPeerMemoryFeatures, ¶ms); - assert(!status && "vkGetDeviceGroupPeerMemoryFeatures"); -} - -void WINAPI vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures) -{ - struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params params; - NTSTATUS status; - params.device = device; - params.heapIndex = heapIndex; - params.localDeviceIndex = localDeviceIndex; - params.remoteDeviceIndex = remoteDeviceIndex; - params.pPeerMemoryFeatures = pPeerMemoryFeatures; - status = UNIX_CALL(vkGetDeviceGroupPeerMemoryFeaturesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupPeerMemoryFeaturesKHR"); -} - -VkResult WINAPI vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities) -{ - struct vkGetDeviceGroupPresentCapabilitiesKHR_params params; - NTSTATUS status; - params.device = device; - params.pDeviceGroupPresentCapabilities = pDeviceGroupPresentCapabilities; - status = UNIX_CALL(vkGetDeviceGroupPresentCapabilitiesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupPresentCapabilitiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes) -{ - struct vkGetDeviceGroupSurfacePresentModesKHR_params params; - NTSTATUS status; - params.device = device; - params.surface = surface; - params.pModes = pModes; - status = UNIX_CALL(vkGetDeviceGroupSurfacePresentModesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupSurfacePresentModesKHR"); - return params.result; -} - -void WINAPI vkGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceImageMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceImageMemoryRequirements"); -} - -void WINAPI vkGetDeviceImageMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceImageMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceImageMemoryRequirementsKHR"); -} - -void WINAPI vkGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetDeviceImageSparseMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageSparseMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceImageSparseMemoryRequirements"); -} - -void WINAPI vkGetDeviceImageSparseMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetDeviceImageSparseMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageSparseMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceImageSparseMemoryRequirementsKHR"); -} - -void WINAPI vkGetDeviceImageSubresourceLayoutKHR(VkDevice device, const VkDeviceImageSubresourceInfoKHR *pInfo, VkSubresourceLayout2KHR *pLayout) -{ - struct vkGetDeviceImageSubresourceLayoutKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetDeviceImageSubresourceLayoutKHR, ¶ms); - assert(!status && "vkGetDeviceImageSubresourceLayoutKHR"); -} - -void WINAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes) -{ - struct vkGetDeviceMemoryCommitment_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.pCommittedMemoryInBytes = pCommittedMemoryInBytes; - status = UNIX_CALL(vkGetDeviceMemoryCommitment, ¶ms); - assert(!status && "vkGetDeviceMemoryCommitment"); -} - -uint64_t WINAPI vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetDeviceMemoryOpaqueCaptureAddress, ¶ms); - assert(!status && "vkGetDeviceMemoryOpaqueCaptureAddress"); - return params.result; -} - -uint64_t WINAPI vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetDeviceMemoryOpaqueCaptureAddressKHR, ¶ms); - assert(!status && "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); - return params.result; -} - -void WINAPI vkGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility) -{ - struct vkGetDeviceMicromapCompatibilityEXT_params params; - NTSTATUS status; - params.device = device; - params.pVersionInfo = pVersionInfo; - params.pCompatibility = pCompatibility; - status = UNIX_CALL(vkGetDeviceMicromapCompatibilityEXT, ¶ms); - assert(!status && "vkGetDeviceMicromapCompatibilityEXT"); -} - -void WINAPI vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) -{ - struct vkGetDeviceQueue_params params; - NTSTATUS status; - params.device = device; - params.queueFamilyIndex = queueFamilyIndex; - params.queueIndex = queueIndex; - params.pQueue = pQueue; - status = UNIX_CALL(vkGetDeviceQueue, ¶ms); - assert(!status && "vkGetDeviceQueue"); -} - -void WINAPI vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) -{ - struct vkGetDeviceQueue2_params params; - NTSTATUS status; - params.device = device; - params.pQueueInfo = pQueueInfo; - params.pQueue = pQueue; - status = UNIX_CALL(vkGetDeviceQueue2, ¶ms); - assert(!status && "vkGetDeviceQueue2"); -} - -VkResult WINAPI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device, VkRenderPass renderpass, VkExtent2D *pMaxWorkgroupSize) -{ - struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params params; - NTSTATUS status; - params.device = device; - params.renderpass = renderpass; - params.pMaxWorkgroupSize = pMaxWorkgroupSize; - status = UNIX_CALL(vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, ¶ms); - assert(!status && "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI"); - return params.result; -} - -VkResult WINAPI vkGetDynamicRenderingTilePropertiesQCOM(VkDevice device, const VkRenderingInfo *pRenderingInfo, VkTilePropertiesQCOM *pProperties) -{ - struct vkGetDynamicRenderingTilePropertiesQCOM_params params; - NTSTATUS status; - params.device = device; - params.pRenderingInfo = pRenderingInfo; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetDynamicRenderingTilePropertiesQCOM, ¶ms); - assert(!status && "vkGetDynamicRenderingTilePropertiesQCOM"); - return params.result; -} - -VkResult WINAPI vkGetEventStatus(VkDevice device, VkEvent event) -{ - struct vkGetEventStatus_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkGetEventStatus, ¶ms); - assert(!status && "vkGetEventStatus"); - return params.result; -} - -VkResult WINAPI vkGetFenceStatus(VkDevice device, VkFence fence) -{ - struct vkGetFenceStatus_params params; - NTSTATUS status; - params.device = device; - params.fence = fence; - status = UNIX_CALL(vkGetFenceStatus, ¶ms); - assert(!status && "vkGetFenceStatus"); - return params.result; -} - -VkResult WINAPI vkGetFramebufferTilePropertiesQCOM(VkDevice device, VkFramebuffer framebuffer, uint32_t *pPropertiesCount, VkTilePropertiesQCOM *pProperties) -{ - struct vkGetFramebufferTilePropertiesQCOM_params params; - NTSTATUS status; - params.device = device; - params.framebuffer = framebuffer; - params.pPropertiesCount = pPropertiesCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetFramebufferTilePropertiesQCOM, ¶ms); - assert(!status && "vkGetFramebufferTilePropertiesQCOM"); - return params.result; -} - -void WINAPI vkGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetGeneratedCommandsMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetGeneratedCommandsMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetGeneratedCommandsMemoryRequirementsNV"); -} - -void WINAPI vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements, ¶ms); - assert(!status && "vkGetImageMemoryRequirements"); -} - -void WINAPI vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements2, ¶ms); - assert(!status && "vkGetImageMemoryRequirements2"); -} - -void WINAPI vkGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetImageMemoryRequirements2KHR"); -} - -VkResult WINAPI vkGetImageOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetImageOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetImageOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetImageOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -void WINAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements"); -} - -void WINAPI vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements2, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements2"); -} - -void WINAPI vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements2KHR"); -} - -void WINAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) -{ - struct vkGetImageSubresourceLayout_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout, ¶ms); - assert(!status && "vkGetImageSubresourceLayout"); -} - -void WINAPI vkGetImageSubresourceLayout2EXT(VkDevice device, VkImage image, const VkImageSubresource2KHR *pSubresource, VkSubresourceLayout2KHR *pLayout) -{ - struct vkGetImageSubresourceLayout2EXT_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout2EXT, ¶ms); - assert(!status && "vkGetImageSubresourceLayout2EXT"); -} - -void WINAPI vkGetImageSubresourceLayout2KHR(VkDevice device, VkImage image, const VkImageSubresource2KHR *pSubresource, VkSubresourceLayout2KHR *pLayout) -{ - struct vkGetImageSubresourceLayout2KHR_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout2KHR, ¶ms); - assert(!status && "vkGetImageSubresourceLayout2KHR"); -} - -VkResult WINAPI vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties) -{ - struct vkGetImageViewAddressNVX_params params; - NTSTATUS status; - params.device = device; - params.imageView = imageView; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetImageViewAddressNVX, ¶ms); - assert(!status && "vkGetImageViewAddressNVX"); - return params.result; -} - -uint32_t WINAPI vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo) -{ - struct vkGetImageViewHandleNVX_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetImageViewHandleNVX, ¶ms); - assert(!status && "vkGetImageViewHandleNVX"); - return params.result; -} - -VkResult WINAPI vkGetImageViewOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetImageViewOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetImageViewOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -void WINAPI vkGetLatencyTimingsNV(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo) -{ - struct vkGetLatencyTimingsNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pLatencyMarkerInfo = pLatencyMarkerInfo; - status = UNIX_CALL(vkGetLatencyTimingsNV, ¶ms); - assert(!status && "vkGetLatencyTimingsNV"); -} - -VkResult WINAPI vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties) -{ - struct vkGetMemoryHostPointerPropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.handleType = handleType; - params.pHostPointer = pHostPointer; - params.pMemoryHostPointerProperties = pMemoryHostPointerProperties; - status = UNIX_CALL(vkGetMemoryHostPointerPropertiesEXT, ¶ms); - assert(!status && "vkGetMemoryHostPointerPropertiesEXT"); - return params.result; -} - -void WINAPI vkGetMicromapBuildSizesEXT(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT *pBuildInfo, VkMicromapBuildSizesInfoEXT *pSizeInfo) -{ - struct vkGetMicromapBuildSizesEXT_params params; - NTSTATUS status; - params.device = device; - params.buildType = buildType; - params.pBuildInfo = pBuildInfo; - params.pSizeInfo = pSizeInfo; - status = UNIX_CALL(vkGetMicromapBuildSizesEXT, ¶ms); - assert(!status && "vkGetMicromapBuildSizesEXT"); -} - -VkResult WINAPI vkGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL *pValue) -{ - struct vkGetPerformanceParameterINTEL_params params; - NTSTATUS status; - params.device = device; - params.parameter = parameter; - params.pValue = pValue; - status = UNIX_CALL(vkGetPerformanceParameterINTEL, ¶ms); - assert(!status && "vkGetPerformanceParameterINTEL"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainEXT *pTimeDomains) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pTimeDomainCount = pTimeDomainCount; - params.pTimeDomains = pTimeDomains; - status = UNIX_CALL(vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesKHR *pProperties) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesNV *pProperties) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) -{ - struct vkGetPhysicalDeviceExternalBufferProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalBufferInfo = pExternalBufferInfo; - params.pExternalBufferProperties = pExternalBufferProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalBufferProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalBufferProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) -{ - struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalBufferInfo = pExternalBufferInfo; - params.pExternalBufferProperties = pExternalBufferProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalBufferPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalBufferPropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties) -{ - struct vkGetPhysicalDeviceExternalFenceProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalFenceInfo = pExternalFenceInfo; - params.pExternalFenceProperties = pExternalFenceProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalFenceProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalFenceProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties) -{ - struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalFenceInfo = pExternalFenceInfo; - params.pExternalFenceProperties = pExternalFenceProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalFencePropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalFencePropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties) -{ - struct vkGetPhysicalDeviceExternalSemaphoreProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalSemaphoreInfo = pExternalSemaphoreInfo; - params.pExternalSemaphoreProperties = pExternalSemaphoreProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalSemaphoreProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalSemaphoreProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties) -{ - struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalSemaphoreInfo = pExternalSemaphoreInfo; - params.pExternalSemaphoreProperties = pExternalSemaphoreProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures"); -} - -void WINAPI vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures2, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures2"); -} - -void WINAPI vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures2KHR"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties2"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties2KHR"); -} - -VkResult WINAPI vkGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t *pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates) -{ - struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFragmentShadingRateCount = pFragmentShadingRateCount; - params.pFragmentShadingRates = pFragmentShadingRates; - status = UNIX_CALL(vkGetPhysicalDeviceFragmentShadingRatesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFragmentShadingRatesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.type = type; - params.tiling = tiling; - params.usage = usage; - params.flags = flags; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pImageFormatInfo = pImageFormatInfo; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties2"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pImageFormatInfo = pImageFormatInfo; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties2KHR"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties"); -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties2"); -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties2KHR"); -} - -void WINAPI vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT *pMultisampleProperties) -{ - struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.samples = samples; - params.pMultisampleProperties = pMultisampleProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMultisamplePropertiesEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceMultisamplePropertiesEXT"); -} - -VkResult WINAPI vkGetPhysicalDeviceOpticalFlowImageFormatsNV(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo, uint32_t *pFormatCount, VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pOpticalFlowImageFormatInfo = pOpticalFlowImageFormatInfo; - params.pFormatCount = pFormatCount; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceOpticalFlowImageFormatsNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceOpticalFlowImageFormatsNV"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pRectCount, VkRect2D *pRects) -{ - struct vkGetPhysicalDevicePresentRectanglesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pRectCount = pRectCount; - params.pRects = pRects; - status = UNIX_CALL(vkGetPhysicalDevicePresentRectanglesKHR, ¶ms); - assert(!status && "vkGetPhysicalDevicePresentRectanglesKHR"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) -{ - struct vkGetPhysicalDeviceProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceProperties"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo, uint32_t *pNumPasses) -{ - struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPerformanceQueryCreateInfo = pPerformanceQueryCreateInfo; - params.pNumPasses = pNumPasses; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties2"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.type = type; - params.samples = samples; - params.usage = usage; - params.tiling = tiling; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFormatInfo = pFormatInfo; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties2"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFormatInfo = pFormatInfo; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); -} - -VkResult WINAPI vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t *pCombinationCount, VkFramebufferMixedSamplesCombinationNV *pCombinations) -{ - struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pCombinationCount = pCombinationCount; - params.pCombinations = pCombinations; - status = UNIX_CALL(vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities) -{ - struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pSurfaceInfo = pSurfaceInfo; - params.pSurfaceCapabilities = pSurfaceCapabilities; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceCapabilities2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceCapabilities2KHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) -{ - struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pSurfaceCapabilities = pSurfaceCapabilities; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceCapabilitiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats) -{ - struct vkGetPhysicalDeviceSurfaceFormats2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pSurfaceInfo = pSurfaceInfo; - params.pSurfaceFormatCount = pSurfaceFormatCount; - params.pSurfaceFormats = pSurfaceFormats; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceFormats2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceFormats2KHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats) -{ - struct vkGetPhysicalDeviceSurfaceFormatsKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pSurfaceFormatCount = pSurfaceFormatCount; - params.pSurfaceFormats = pSurfaceFormats; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceFormatsKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceFormatsKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes) -{ - struct vkGetPhysicalDeviceSurfacePresentModesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pPresentModeCount = pPresentModeCount; - params.pPresentModes = pPresentModes; - status = UNIX_CALL(vkGetPhysicalDeviceSurfacePresentModesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfacePresentModesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported) -{ - struct vkGetPhysicalDeviceSurfaceSupportKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - params.surface = surface; - params.pSupported = pSupported; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceSupportKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceSupportKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties) -{ - struct vkGetPhysicalDeviceToolProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pToolCount = pToolCount; - params.pToolProperties = pToolProperties; - status = UNIX_CALL(vkGetPhysicalDeviceToolProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceToolProperties"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties) -{ - struct vkGetPhysicalDeviceToolPropertiesEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pToolCount = pToolCount; - params.pToolProperties = pToolProperties; - status = UNIX_CALL(vkGetPhysicalDeviceToolPropertiesEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceToolPropertiesEXT"); - return params.result; -} - -VkBool32 WINAPI vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) -{ - struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - status = UNIX_CALL(vkGetPhysicalDeviceWin32PresentationSupportKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceWin32PresentationSupportKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData) -{ - struct vkGetPipelineCacheData_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetPipelineCacheData, ¶ms); - assert(!status && "vkGetPipelineCacheData"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations) -{ - struct vkGetPipelineExecutableInternalRepresentationsKHR_params params; - NTSTATUS status; - params.device = device; - params.pExecutableInfo = pExecutableInfo; - params.pInternalRepresentationCount = pInternalRepresentationCount; - params.pInternalRepresentations = pInternalRepresentations; - status = UNIX_CALL(vkGetPipelineExecutableInternalRepresentationsKHR, ¶ms); - assert(!status && "vkGetPipelineExecutableInternalRepresentationsKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR *pPipelineInfo, uint32_t *pExecutableCount, VkPipelineExecutablePropertiesKHR *pProperties) -{ - struct vkGetPipelineExecutablePropertiesKHR_params params; - NTSTATUS status; - params.device = device; - params.pPipelineInfo = pPipelineInfo; - params.pExecutableCount = pExecutableCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPipelineExecutablePropertiesKHR, ¶ms); - assert(!status && "vkGetPipelineExecutablePropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pStatisticCount, VkPipelineExecutableStatisticKHR *pStatistics) -{ - struct vkGetPipelineExecutableStatisticsKHR_params params; - NTSTATUS status; - params.device = device; - params.pExecutableInfo = pExecutableInfo; - params.pStatisticCount = pStatisticCount; - params.pStatistics = pStatistics; - status = UNIX_CALL(vkGetPipelineExecutableStatisticsKHR, ¶ms); - assert(!status && "vkGetPipelineExecutableStatisticsKHR"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetPipelineIndirectDeviceAddressNV(VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV *pInfo) -{ - struct vkGetPipelineIndirectDeviceAddressNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetPipelineIndirectDeviceAddressNV, ¶ms); - assert(!status && "vkGetPipelineIndirectDeviceAddressNV"); - return params.result; -} - -void WINAPI vkGetPipelineIndirectMemoryRequirementsNV(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetPipelineIndirectMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetPipelineIndirectMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetPipelineIndirectMemoryRequirementsNV"); -} - -VkResult WINAPI vkGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties) -{ - struct vkGetPipelinePropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.pPipelineInfo = pPipelineInfo; - params.pPipelineProperties = pPipelineProperties; - status = UNIX_CALL(vkGetPipelinePropertiesEXT, ¶ms); - assert(!status && "vkGetPipelinePropertiesEXT"); - return params.result; -} - -void WINAPI vkGetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData) -{ - struct vkGetPrivateData_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.pData = pData; - status = UNIX_CALL(vkGetPrivateData, ¶ms); - assert(!status && "vkGetPrivateData"); -} - -void WINAPI vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData) -{ - struct vkGetPrivateDataEXT_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.pData = pData; - status = UNIX_CALL(vkGetPrivateDataEXT, ¶ms); - assert(!status && "vkGetPrivateDataEXT"); -} - -VkResult WINAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags) -{ - struct vkGetQueryPoolResults_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - params.flags = flags; - status = UNIX_CALL(vkGetQueryPoolResults, ¶ms); - assert(!status && "vkGetQueryPoolResults"); - return params.result; -} - -void WINAPI vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointData2NV *pCheckpointData) -{ - struct vkGetQueueCheckpointData2NV_params params; - NTSTATUS status; - params.queue = queue; - params.pCheckpointDataCount = pCheckpointDataCount; - params.pCheckpointData = pCheckpointData; - status = UNIX_CALL(vkGetQueueCheckpointData2NV, ¶ms); - assert(!status && "vkGetQueueCheckpointData2NV"); -} - -void WINAPI vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointDataNV *pCheckpointData) -{ - struct vkGetQueueCheckpointDataNV_params params; - NTSTATUS status; - params.queue = queue; - params.pCheckpointDataCount = pCheckpointDataCount; - params.pCheckpointData = pCheckpointData; - status = UNIX_CALL(vkGetQueueCheckpointDataNV, ¶ms); - assert(!status && "vkGetQueueCheckpointDataNV"); -} - -VkResult WINAPI vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, ¶ms); - assert(!status && "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); - return params.result; -} - -VkResult WINAPI vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingShaderGroupHandlesKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingShaderGroupHandlesKHR, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupHandlesKHR"); - return params.result; -} - -VkResult WINAPI vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingShaderGroupHandlesNV_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingShaderGroupHandlesNV, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupHandlesNV"); - return params.result; -} - -VkDeviceSize WINAPI vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) -{ - struct vkGetRayTracingShaderGroupStackSizeKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.group = group; - params.groupShader = groupShader; - status = UNIX_CALL(vkGetRayTracingShaderGroupStackSizeKHR, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupStackSizeKHR"); - return params.result; -} - -void WINAPI vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) -{ - struct vkGetRenderAreaGranularity_params params; - NTSTATUS status; - params.device = device; - params.renderPass = renderPass; - params.pGranularity = pGranularity; - status = UNIX_CALL(vkGetRenderAreaGranularity, ¶ms); - assert(!status && "vkGetRenderAreaGranularity"); -} - -void WINAPI vkGetRenderingAreaGranularityKHR(VkDevice device, const VkRenderingAreaInfoKHR *pRenderingAreaInfo, VkExtent2D *pGranularity) -{ - struct vkGetRenderingAreaGranularityKHR_params params; - NTSTATUS status; - params.device = device; - params.pRenderingAreaInfo = pRenderingAreaInfo; - params.pGranularity = pGranularity; - status = UNIX_CALL(vkGetRenderingAreaGranularityKHR, ¶ms); - assert(!status && "vkGetRenderingAreaGranularityKHR"); -} - -VkResult WINAPI vkGetSamplerOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetSamplerOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetSamplerOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t *pValue) -{ - struct vkGetSemaphoreCounterValue_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pValue = pValue; - status = UNIX_CALL(vkGetSemaphoreCounterValue, ¶ms); - assert(!status && "vkGetSemaphoreCounterValue"); - return params.result; -} - -VkResult WINAPI vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t *pValue) -{ - struct vkGetSemaphoreCounterValueKHR_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pValue = pValue; - status = UNIX_CALL(vkGetSemaphoreCounterValueKHR, ¶ms); - assert(!status && "vkGetSemaphoreCounterValueKHR"); - return params.result; -} - -VkResult WINAPI vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData) -{ - struct vkGetShaderBinaryDataEXT_params params; - NTSTATUS status; - params.device = device; - params.shader = shader; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetShaderBinaryDataEXT, ¶ms); - assert(!status && "vkGetShaderBinaryDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t *pInfoSize, void *pInfo) -{ - struct vkGetShaderInfoAMD_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.shaderStage = shaderStage; - params.infoType = infoType; - params.pInfoSize = pInfoSize; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetShaderInfoAMD, ¶ms); - assert(!status && "vkGetShaderInfoAMD"); - return params.result; -} - -void WINAPI vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, VkShaderModuleIdentifierEXT *pIdentifier) -{ - struct vkGetShaderModuleCreateInfoIdentifierEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pIdentifier = pIdentifier; - status = UNIX_CALL(vkGetShaderModuleCreateInfoIdentifierEXT, ¶ms); - assert(!status && "vkGetShaderModuleCreateInfoIdentifierEXT"); -} - -void WINAPI vkGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT *pIdentifier) -{ - struct vkGetShaderModuleIdentifierEXT_params params; - NTSTATUS status; - params.device = device; - params.shaderModule = shaderModule; - params.pIdentifier = pIdentifier; - status = UNIX_CALL(vkGetShaderModuleIdentifierEXT, ¶ms); - assert(!status && "vkGetShaderModuleIdentifierEXT"); -} - -VkResult WINAPI vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) -{ - struct vkGetSwapchainImagesKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSwapchainImageCount = pSwapchainImageCount; - params.pSwapchainImages = pSwapchainImages; - status = UNIX_CALL(vkGetSwapchainImagesKHR, ¶ms); - assert(!status && "vkGetSwapchainImagesKHR"); - return params.result; -} - -VkResult WINAPI vkGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t *pDataSize, void *pData) -{ - struct vkGetValidationCacheDataEXT_params params; - NTSTATUS status; - params.device = device; - params.validationCache = validationCache; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetValidationCacheDataEXT, ¶ms); - assert(!status && "vkGetValidationCacheDataEXT"); - return params.result; -} - -VkResult WINAPI vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo) -{ - struct vkInitializePerformanceApiINTEL_params params; - NTSTATUS status; - params.device = device; - params.pInitializeInfo = pInitializeInfo; - status = UNIX_CALL(vkInitializePerformanceApiINTEL, ¶ms); - assert(!status && "vkInitializePerformanceApiINTEL"); - return params.result; -} - -VkResult WINAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) -{ - struct vkInvalidateMappedMemoryRanges_params params; - NTSTATUS status; - params.device = device; - params.memoryRangeCount = memoryRangeCount; - params.pMemoryRanges = pMemoryRanges; - status = UNIX_CALL(vkInvalidateMappedMemoryRanges, ¶ms); - assert(!status && "vkInvalidateMappedMemoryRanges"); - return params.result; -} - -VkResult WINAPI vkLatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV *pSleepInfo) -{ - struct vkLatencySleepNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSleepInfo = pSleepInfo; - status = UNIX_CALL(vkLatencySleepNV, ¶ms); - assert(!status && "vkLatencySleepNV"); - return params.result; -} - -VkResult WINAPI vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData) -{ - struct vkMapMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.offset = offset; - params.size = size; - params.flags = flags; - params.ppData = ppData; - status = UNIX_CALL(vkMapMemory, ¶ms); - assert(!status && "vkMapMemory"); - return params.result; -} - -VkResult WINAPI vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData) -{ - struct vkMapMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.pMemoryMapInfo = pMemoryMapInfo; - params.ppData = ppData; - status = UNIX_CALL(vkMapMemory2KHR, ¶ms); - assert(!status && "vkMapMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) -{ - struct vkMergePipelineCaches_params params; - NTSTATUS status; - params.device = device; - params.dstCache = dstCache; - params.srcCacheCount = srcCacheCount; - params.pSrcCaches = pSrcCaches; - status = UNIX_CALL(vkMergePipelineCaches, ¶ms); - assert(!status && "vkMergePipelineCaches"); - return params.result; -} - -VkResult WINAPI vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT *pSrcCaches) -{ - struct vkMergeValidationCachesEXT_params params; - NTSTATUS status; - params.device = device; - params.dstCache = dstCache; - params.srcCacheCount = srcCacheCount; - params.pSrcCaches = pSrcCaches; - status = UNIX_CALL(vkMergeValidationCachesEXT, ¶ms); - assert(!status && "vkMergeValidationCachesEXT"); - return params.result; -} - -void WINAPI vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkQueueBeginDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - params.pLabelInfo = pLabelInfo; - status = UNIX_CALL(vkQueueBeginDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueBeginDebugUtilsLabelEXT"); -} - -VkResult WINAPI vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence) -{ - struct vkQueueBindSparse_params params; - NTSTATUS status; - params.queue = queue; - params.bindInfoCount = bindInfoCount; - params.pBindInfo = pBindInfo; - params.fence = fence; - status = UNIX_CALL(vkQueueBindSparse, ¶ms); - assert(!status && "vkQueueBindSparse"); - return params.result; -} - -void WINAPI vkQueueEndDebugUtilsLabelEXT(VkQueue queue) -{ - struct vkQueueEndDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - status = UNIX_CALL(vkQueueEndDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueEndDebugUtilsLabelEXT"); -} - -void WINAPI vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkQueueInsertDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - params.pLabelInfo = pLabelInfo; - status = UNIX_CALL(vkQueueInsertDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueInsertDebugUtilsLabelEXT"); -} - -void WINAPI vkQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo) -{ - struct vkQueueNotifyOutOfBandNV_params params; - NTSTATUS status; - params.queue = queue; - params.pQueueTypeInfo = pQueueTypeInfo; - status = UNIX_CALL(vkQueueNotifyOutOfBandNV, ¶ms); - assert(!status && "vkQueueNotifyOutOfBandNV"); -} - -VkResult WINAPI vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) -{ - struct vkQueuePresentKHR_params params; - NTSTATUS status; - params.queue = queue; - params.pPresentInfo = pPresentInfo; - status = UNIX_CALL(vkQueuePresentKHR, ¶ms); - assert(!status && "vkQueuePresentKHR"); - return params.result; -} - -VkResult WINAPI vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) -{ - struct vkQueueSetPerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.queue = queue; - params.configuration = configuration; - status = UNIX_CALL(vkQueueSetPerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkQueueSetPerformanceConfigurationINTEL"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) -{ - struct vkQueueSubmit_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit, ¶ms); - assert(!status && "vkQueueSubmit"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence) -{ - struct vkQueueSubmit2_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit2, ¶ms); - assert(!status && "vkQueueSubmit2"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence) -{ - struct vkQueueSubmit2KHR_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit2KHR, ¶ms); - assert(!status && "vkQueueSubmit2KHR"); - return params.result; -} - -VkResult WINAPI vkQueueWaitIdle(VkQueue queue) -{ - struct vkQueueWaitIdle_params params; - NTSTATUS status; - params.queue = queue; - status = UNIX_CALL(vkQueueWaitIdle, ¶ms); - assert(!status && "vkQueueWaitIdle"); - return params.result; -} - -VkResult WINAPI vkReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration) -{ - struct vkReleasePerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.device = device; - params.configuration = configuration; - status = UNIX_CALL(vkReleasePerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkReleasePerformanceConfigurationINTEL"); - return params.result; -} - -void WINAPI vkReleaseProfilingLockKHR(VkDevice device) -{ - struct vkReleaseProfilingLockKHR_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkReleaseProfilingLockKHR, ¶ms); - assert(!status && "vkReleaseProfilingLockKHR"); -} - -VkResult WINAPI vkReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo) -{ - struct vkReleaseSwapchainImagesEXT_params params; - NTSTATUS status; - params.device = device; - params.pReleaseInfo = pReleaseInfo; - status = UNIX_CALL(vkReleaseSwapchainImagesEXT, ¶ms); - assert(!status && "vkReleaseSwapchainImagesEXT"); - return params.result; -} - -VkResult WINAPI vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) -{ - struct vkResetCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.flags = flags; - status = UNIX_CALL(vkResetCommandBuffer, ¶ms); - assert(!status && "vkResetCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) -{ - struct vkResetCommandPool_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkResetCommandPool, ¶ms); - assert(!status && "vkResetCommandPool"); - return params.result; -} - -VkResult WINAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) -{ - struct vkResetDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.flags = flags; - status = UNIX_CALL(vkResetDescriptorPool, ¶ms); - assert(!status && "vkResetDescriptorPool"); - return params.result; -} - -VkResult WINAPI vkResetEvent(VkDevice device, VkEvent event) -{ - struct vkResetEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkResetEvent, ¶ms); - assert(!status && "vkResetEvent"); - return params.result; -} - -VkResult WINAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) -{ - struct vkResetFences_params params; - NTSTATUS status; - params.device = device; - params.fenceCount = fenceCount; - params.pFences = pFences; - status = UNIX_CALL(vkResetFences, ¶ms); - assert(!status && "vkResetFences"); - return params.result; -} - -void WINAPI vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkResetQueryPool_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - status = UNIX_CALL(vkResetQueryPool, ¶ms); - assert(!status && "vkResetQueryPool"); -} - -void WINAPI vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkResetQueryPoolEXT_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - status = UNIX_CALL(vkResetQueryPoolEXT, ¶ms); - assert(!status && "vkResetQueryPoolEXT"); -} - -VkResult WINAPI vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) -{ - struct vkSetDebugUtilsObjectNameEXT_params params; - NTSTATUS status; - params.device = device; - params.pNameInfo = pNameInfo; - status = UNIX_CALL(vkSetDebugUtilsObjectNameEXT, ¶ms); - assert(!status && "vkSetDebugUtilsObjectNameEXT"); - return params.result; -} - -VkResult WINAPI vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) -{ - struct vkSetDebugUtilsObjectTagEXT_params params; - NTSTATUS status; - params.device = device; - params.pTagInfo = pTagInfo; - status = UNIX_CALL(vkSetDebugUtilsObjectTagEXT, ¶ms); - assert(!status && "vkSetDebugUtilsObjectTagEXT"); - return params.result; -} - -void WINAPI vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority) -{ - struct vkSetDeviceMemoryPriorityEXT_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.priority = priority; - status = UNIX_CALL(vkSetDeviceMemoryPriorityEXT, ¶ms); - assert(!status && "vkSetDeviceMemoryPriorityEXT"); -} - -VkResult WINAPI vkSetEvent(VkDevice device, VkEvent event) -{ - struct vkSetEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkSetEvent, ¶ms); - assert(!status && "vkSetEvent"); - return params.result; -} - -void WINAPI vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata) -{ - struct vkSetHdrMetadataEXT_params params; - NTSTATUS status; - params.device = device; - params.swapchainCount = swapchainCount; - params.pSwapchains = pSwapchains; - params.pMetadata = pMetadata; - status = UNIX_CALL(vkSetHdrMetadataEXT, ¶ms); - assert(!status && "vkSetHdrMetadataEXT"); -} - -void WINAPI vkSetLatencyMarkerNV(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo) -{ - struct vkSetLatencyMarkerNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pLatencyMarkerInfo = pLatencyMarkerInfo; - status = UNIX_CALL(vkSetLatencyMarkerNV, ¶ms); - assert(!status && "vkSetLatencyMarkerNV"); -} - -VkResult WINAPI vkSetLatencySleepModeNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV *pSleepModeInfo) -{ - struct vkSetLatencySleepModeNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSleepModeInfo = pSleepModeInfo; - status = UNIX_CALL(vkSetLatencySleepModeNV, ¶ms); - assert(!status && "vkSetLatencySleepModeNV"); - return params.result; -} - -VkResult WINAPI vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) -{ - struct vkSetPrivateData_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.data = data; - status = UNIX_CALL(vkSetPrivateData, ¶ms); - assert(!status && "vkSetPrivateData"); - return params.result; -} - -VkResult WINAPI vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) -{ - struct vkSetPrivateDataEXT_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.data = data; - status = UNIX_CALL(vkSetPrivateDataEXT, ¶ms); - assert(!status && "vkSetPrivateDataEXT"); - return params.result; -} - -VkResult WINAPI vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo) -{ - struct vkSignalSemaphore_params params; - NTSTATUS status; - params.device = device; - params.pSignalInfo = pSignalInfo; - status = UNIX_CALL(vkSignalSemaphore, ¶ms); - assert(!status && "vkSignalSemaphore"); - return params.result; -} - -VkResult WINAPI vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo) -{ - struct vkSignalSemaphoreKHR_params params; - NTSTATUS status; - params.device = device; - params.pSignalInfo = pSignalInfo; - status = UNIX_CALL(vkSignalSemaphoreKHR, ¶ms); - assert(!status && "vkSignalSemaphoreKHR"); - return params.result; -} - -void WINAPI vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) -{ - struct vkSubmitDebugUtilsMessageEXT_params params; - NTSTATUS status; - params.instance = instance; - params.messageSeverity = messageSeverity; - params.messageTypes = messageTypes; - params.pCallbackData = pCallbackData; - status = UNIX_CALL(vkSubmitDebugUtilsMessageEXT, ¶ms); - assert(!status && "vkSubmitDebugUtilsMessageEXT"); -} - -VkResult WINAPI vkTransitionImageLayoutEXT(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfoEXT *pTransitions) -{ - struct vkTransitionImageLayoutEXT_params params; - NTSTATUS status; - params.device = device; - params.transitionCount = transitionCount; - params.pTransitions = pTransitions; - status = UNIX_CALL(vkTransitionImageLayoutEXT, ¶ms); - assert(!status && "vkTransitionImageLayoutEXT"); - return params.result; -} - -void WINAPI vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) -{ - struct vkTrimCommandPool_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkTrimCommandPool, ¶ms); - assert(!status && "vkTrimCommandPool"); -} - -void WINAPI vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) -{ - struct vkTrimCommandPoolKHR_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkTrimCommandPoolKHR, ¶ms); - assert(!status && "vkTrimCommandPoolKHR"); -} - -void WINAPI vkUninitializePerformanceApiINTEL(VkDevice device) -{ - struct vkUninitializePerformanceApiINTEL_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkUninitializePerformanceApiINTEL, ¶ms); - assert(!status && "vkUninitializePerformanceApiINTEL"); -} - -void WINAPI vkUnmapMemory(VkDevice device, VkDeviceMemory memory) -{ - struct vkUnmapMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - status = UNIX_CALL(vkUnmapMemory, ¶ms); - assert(!status && "vkUnmapMemory"); -} - -VkResult WINAPI vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo) -{ - struct vkUnmapMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.pMemoryUnmapInfo = pMemoryUnmapInfo; - status = UNIX_CALL(vkUnmapMemory2KHR, ¶ms); - assert(!status && "vkUnmapMemory2KHR"); - return params.result; -} - -void WINAPI vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData) -{ - struct vkUpdateDescriptorSetWithTemplate_params params; - params.device = device; - params.descriptorSet = descriptorSet; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pData = pData; - UNIX_CALL(vkUpdateDescriptorSetWithTemplate, ¶ms); -} - -void WINAPI vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData) -{ - struct vkUpdateDescriptorSetWithTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.descriptorSet = descriptorSet; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pData = pData; - status = UNIX_CALL(vkUpdateDescriptorSetWithTemplateKHR, ¶ms); - assert(!status && "vkUpdateDescriptorSetWithTemplateKHR"); -} - -void WINAPI vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) -{ - struct vkUpdateDescriptorSets_params params; - params.device = device; - params.descriptorWriteCount = descriptorWriteCount; - params.pDescriptorWrites = pDescriptorWrites; - params.descriptorCopyCount = descriptorCopyCount; - params.pDescriptorCopies = pDescriptorCopies; - UNIX_CALL(vkUpdateDescriptorSets, ¶ms); -} - -VkResult WINAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout) -{ - struct vkWaitForFences_params params; - NTSTATUS status; - params.device = device; - params.fenceCount = fenceCount; - params.pFences = pFences; - params.waitAll = waitAll; - params.timeout = timeout; - status = UNIX_CALL(vkWaitForFences, ¶ms); - assert(!status && "vkWaitForFences"); - return params.result; -} - -VkResult WINAPI vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout) -{ - struct vkWaitForPresentKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.presentId = presentId; - params.timeout = timeout; - status = UNIX_CALL(vkWaitForPresentKHR, ¶ms); - assert(!status && "vkWaitForPresentKHR"); - return params.result; -} - -VkResult WINAPI vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout) -{ - struct vkWaitSemaphores_params params; - NTSTATUS status; - params.device = device; - params.pWaitInfo = pWaitInfo; - params.timeout = timeout; - status = UNIX_CALL(vkWaitSemaphores, ¶ms); - assert(!status && "vkWaitSemaphores"); - return params.result; -} - -VkResult WINAPI vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout) -{ - struct vkWaitSemaphoresKHR_params params; - NTSTATUS status; - params.device = device; - params.pWaitInfo = pWaitInfo; - params.timeout = timeout; - status = UNIX_CALL(vkWaitSemaphoresKHR, ¶ms); - assert(!status && "vkWaitSemaphoresKHR"); - return params.result; -} - -VkResult WINAPI vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, size_t dataSize, void *pData, size_t stride) -{ - struct vkWriteAccelerationStructuresPropertiesKHR_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - status = UNIX_CALL(vkWriteAccelerationStructuresPropertiesKHR, ¶ms); - assert(!status && "vkWriteAccelerationStructuresPropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, size_t dataSize, void *pData, size_t stride) -{ - struct vkWriteMicromapsPropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.micromapCount = micromapCount; - params.pMicromaps = pMicromaps; - params.queryType = queryType; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - status = UNIX_CALL(vkWriteMicromapsPropertiesEXT, ¶ms); - assert(!status && "vkWriteMicromapsPropertiesEXT"); - return params.result; -} - -static const struct vulkan_func vk_device_dispatch_table[] = -{ - {"vkAcquireNextImage2KHR", vkAcquireNextImage2KHR}, - {"vkAcquireNextImageKHR", vkAcquireNextImageKHR}, - {"vkAcquirePerformanceConfigurationINTEL", vkAcquirePerformanceConfigurationINTEL}, - {"vkAcquireProfilingLockKHR", vkAcquireProfilingLockKHR}, - {"vkAllocateCommandBuffers", vkAllocateCommandBuffers}, - {"vkAllocateDescriptorSets", vkAllocateDescriptorSets}, - {"vkAllocateMemory", vkAllocateMemory}, - {"vkBeginCommandBuffer", vkBeginCommandBuffer}, - {"vkBindAccelerationStructureMemoryNV", vkBindAccelerationStructureMemoryNV}, - {"vkBindBufferMemory", vkBindBufferMemory}, - {"vkBindBufferMemory2", vkBindBufferMemory2}, - {"vkBindBufferMemory2KHR", vkBindBufferMemory2KHR}, - {"vkBindImageMemory", vkBindImageMemory}, - {"vkBindImageMemory2", vkBindImageMemory2}, - {"vkBindImageMemory2KHR", vkBindImageMemory2KHR}, - {"vkBindOpticalFlowSessionImageNV", vkBindOpticalFlowSessionImageNV}, - {"vkBuildAccelerationStructuresKHR", vkBuildAccelerationStructuresKHR}, - {"vkBuildMicromapsEXT", vkBuildMicromapsEXT}, - {"vkCmdBeginConditionalRenderingEXT", vkCmdBeginConditionalRenderingEXT}, - {"vkCmdBeginDebugUtilsLabelEXT", vkCmdBeginDebugUtilsLabelEXT}, - {"vkCmdBeginQuery", vkCmdBeginQuery}, - {"vkCmdBeginQueryIndexedEXT", vkCmdBeginQueryIndexedEXT}, - {"vkCmdBeginRenderPass", vkCmdBeginRenderPass}, - {"vkCmdBeginRenderPass2", vkCmdBeginRenderPass2}, - {"vkCmdBeginRenderPass2KHR", vkCmdBeginRenderPass2KHR}, - {"vkCmdBeginRendering", vkCmdBeginRendering}, - {"vkCmdBeginRenderingKHR", vkCmdBeginRenderingKHR}, - {"vkCmdBeginTransformFeedbackEXT", vkCmdBeginTransformFeedbackEXT}, - {"vkCmdBindDescriptorBufferEmbeddedSamplersEXT", vkCmdBindDescriptorBufferEmbeddedSamplersEXT}, - {"vkCmdBindDescriptorBuffersEXT", vkCmdBindDescriptorBuffersEXT}, - {"vkCmdBindDescriptorSets", vkCmdBindDescriptorSets}, - {"vkCmdBindIndexBuffer", vkCmdBindIndexBuffer}, - {"vkCmdBindIndexBuffer2KHR", vkCmdBindIndexBuffer2KHR}, - {"vkCmdBindInvocationMaskHUAWEI", vkCmdBindInvocationMaskHUAWEI}, - {"vkCmdBindPipeline", vkCmdBindPipeline}, - {"vkCmdBindPipelineShaderGroupNV", vkCmdBindPipelineShaderGroupNV}, - {"vkCmdBindShadersEXT", vkCmdBindShadersEXT}, - {"vkCmdBindShadingRateImageNV", vkCmdBindShadingRateImageNV}, - {"vkCmdBindTransformFeedbackBuffersEXT", vkCmdBindTransformFeedbackBuffersEXT}, - {"vkCmdBindVertexBuffers", vkCmdBindVertexBuffers}, - {"vkCmdBindVertexBuffers2", vkCmdBindVertexBuffers2}, - {"vkCmdBindVertexBuffers2EXT", vkCmdBindVertexBuffers2EXT}, - {"vkCmdBlitImage", vkCmdBlitImage}, - {"vkCmdBlitImage2", vkCmdBlitImage2}, - {"vkCmdBlitImage2KHR", vkCmdBlitImage2KHR}, - {"vkCmdBuildAccelerationStructureNV", vkCmdBuildAccelerationStructureNV}, - {"vkCmdBuildAccelerationStructuresIndirectKHR", vkCmdBuildAccelerationStructuresIndirectKHR}, - {"vkCmdBuildAccelerationStructuresKHR", vkCmdBuildAccelerationStructuresKHR}, - {"vkCmdBuildMicromapsEXT", vkCmdBuildMicromapsEXT}, - {"vkCmdClearAttachments", vkCmdClearAttachments}, - {"vkCmdClearColorImage", vkCmdClearColorImage}, - {"vkCmdClearDepthStencilImage", vkCmdClearDepthStencilImage}, - {"vkCmdCopyAccelerationStructureKHR", vkCmdCopyAccelerationStructureKHR}, - {"vkCmdCopyAccelerationStructureNV", vkCmdCopyAccelerationStructureNV}, - {"vkCmdCopyAccelerationStructureToMemoryKHR", vkCmdCopyAccelerationStructureToMemoryKHR}, - {"vkCmdCopyBuffer", vkCmdCopyBuffer}, - {"vkCmdCopyBuffer2", vkCmdCopyBuffer2}, - {"vkCmdCopyBuffer2KHR", vkCmdCopyBuffer2KHR}, - {"vkCmdCopyBufferToImage", vkCmdCopyBufferToImage}, - {"vkCmdCopyBufferToImage2", vkCmdCopyBufferToImage2}, - {"vkCmdCopyBufferToImage2KHR", vkCmdCopyBufferToImage2KHR}, - {"vkCmdCopyImage", vkCmdCopyImage}, - {"vkCmdCopyImage2", vkCmdCopyImage2}, - {"vkCmdCopyImage2KHR", vkCmdCopyImage2KHR}, - {"vkCmdCopyImageToBuffer", vkCmdCopyImageToBuffer}, - {"vkCmdCopyImageToBuffer2", vkCmdCopyImageToBuffer2}, - {"vkCmdCopyImageToBuffer2KHR", vkCmdCopyImageToBuffer2KHR}, - {"vkCmdCopyMemoryIndirectNV", vkCmdCopyMemoryIndirectNV}, - {"vkCmdCopyMemoryToAccelerationStructureKHR", vkCmdCopyMemoryToAccelerationStructureKHR}, - {"vkCmdCopyMemoryToImageIndirectNV", vkCmdCopyMemoryToImageIndirectNV}, - {"vkCmdCopyMemoryToMicromapEXT", vkCmdCopyMemoryToMicromapEXT}, - {"vkCmdCopyMicromapEXT", vkCmdCopyMicromapEXT}, - {"vkCmdCopyMicromapToMemoryEXT", vkCmdCopyMicromapToMemoryEXT}, - {"vkCmdCopyQueryPoolResults", vkCmdCopyQueryPoolResults}, - {"vkCmdCuLaunchKernelNVX", vkCmdCuLaunchKernelNVX}, - {"vkCmdCudaLaunchKernelNV", vkCmdCudaLaunchKernelNV}, - {"vkCmdDebugMarkerBeginEXT", vkCmdDebugMarkerBeginEXT}, - {"vkCmdDebugMarkerEndEXT", vkCmdDebugMarkerEndEXT}, - {"vkCmdDebugMarkerInsertEXT", vkCmdDebugMarkerInsertEXT}, - {"vkCmdDecompressMemoryIndirectCountNV", vkCmdDecompressMemoryIndirectCountNV}, - {"vkCmdDecompressMemoryNV", vkCmdDecompressMemoryNV}, - {"vkCmdDispatch", vkCmdDispatch}, - {"vkCmdDispatchBase", vkCmdDispatchBase}, - {"vkCmdDispatchBaseKHR", vkCmdDispatchBaseKHR}, - {"vkCmdDispatchIndirect", vkCmdDispatchIndirect}, - {"vkCmdDraw", vkCmdDraw}, - {"vkCmdDrawClusterHUAWEI", vkCmdDrawClusterHUAWEI}, - {"vkCmdDrawClusterIndirectHUAWEI", vkCmdDrawClusterIndirectHUAWEI}, - {"vkCmdDrawIndexed", vkCmdDrawIndexed}, - {"vkCmdDrawIndexedIndirect", vkCmdDrawIndexedIndirect}, - {"vkCmdDrawIndexedIndirectCount", vkCmdDrawIndexedIndirectCount}, - {"vkCmdDrawIndexedIndirectCountAMD", vkCmdDrawIndexedIndirectCountAMD}, - {"vkCmdDrawIndexedIndirectCountKHR", vkCmdDrawIndexedIndirectCountKHR}, - {"vkCmdDrawIndirect", vkCmdDrawIndirect}, - {"vkCmdDrawIndirectByteCountEXT", vkCmdDrawIndirectByteCountEXT}, - {"vkCmdDrawIndirectCount", vkCmdDrawIndirectCount}, - {"vkCmdDrawIndirectCountAMD", vkCmdDrawIndirectCountAMD}, - {"vkCmdDrawIndirectCountKHR", vkCmdDrawIndirectCountKHR}, - {"vkCmdDrawMeshTasksEXT", vkCmdDrawMeshTasksEXT}, - {"vkCmdDrawMeshTasksIndirectCountEXT", vkCmdDrawMeshTasksIndirectCountEXT}, - {"vkCmdDrawMeshTasksIndirectCountNV", vkCmdDrawMeshTasksIndirectCountNV}, - {"vkCmdDrawMeshTasksIndirectEXT", vkCmdDrawMeshTasksIndirectEXT}, - {"vkCmdDrawMeshTasksIndirectNV", vkCmdDrawMeshTasksIndirectNV}, - {"vkCmdDrawMeshTasksNV", vkCmdDrawMeshTasksNV}, - {"vkCmdDrawMultiEXT", vkCmdDrawMultiEXT}, - {"vkCmdDrawMultiIndexedEXT", vkCmdDrawMultiIndexedEXT}, - {"vkCmdEndConditionalRenderingEXT", vkCmdEndConditionalRenderingEXT}, - {"vkCmdEndDebugUtilsLabelEXT", vkCmdEndDebugUtilsLabelEXT}, - {"vkCmdEndQuery", vkCmdEndQuery}, - {"vkCmdEndQueryIndexedEXT", vkCmdEndQueryIndexedEXT}, - {"vkCmdEndRenderPass", vkCmdEndRenderPass}, - {"vkCmdEndRenderPass2", vkCmdEndRenderPass2}, - {"vkCmdEndRenderPass2KHR", vkCmdEndRenderPass2KHR}, - {"vkCmdEndRendering", vkCmdEndRendering}, - {"vkCmdEndRenderingKHR", vkCmdEndRenderingKHR}, - {"vkCmdEndTransformFeedbackEXT", vkCmdEndTransformFeedbackEXT}, - {"vkCmdExecuteCommands", vkCmdExecuteCommands}, - {"vkCmdExecuteGeneratedCommandsNV", vkCmdExecuteGeneratedCommandsNV}, - {"vkCmdFillBuffer", vkCmdFillBuffer}, - {"vkCmdInsertDebugUtilsLabelEXT", vkCmdInsertDebugUtilsLabelEXT}, - {"vkCmdNextSubpass", vkCmdNextSubpass}, - {"vkCmdNextSubpass2", vkCmdNextSubpass2}, - {"vkCmdNextSubpass2KHR", vkCmdNextSubpass2KHR}, - {"vkCmdOpticalFlowExecuteNV", vkCmdOpticalFlowExecuteNV}, - {"vkCmdPipelineBarrier", vkCmdPipelineBarrier}, - {"vkCmdPipelineBarrier2", vkCmdPipelineBarrier2}, - {"vkCmdPipelineBarrier2KHR", vkCmdPipelineBarrier2KHR}, - {"vkCmdPreprocessGeneratedCommandsNV", vkCmdPreprocessGeneratedCommandsNV}, - {"vkCmdPushConstants", vkCmdPushConstants}, - {"vkCmdPushDescriptorSetKHR", vkCmdPushDescriptorSetKHR}, - {"vkCmdPushDescriptorSetWithTemplateKHR", vkCmdPushDescriptorSetWithTemplateKHR}, - {"vkCmdResetEvent", vkCmdResetEvent}, - {"vkCmdResetEvent2", vkCmdResetEvent2}, - {"vkCmdResetEvent2KHR", vkCmdResetEvent2KHR}, - {"vkCmdResetQueryPool", vkCmdResetQueryPool}, - {"vkCmdResolveImage", vkCmdResolveImage}, - {"vkCmdResolveImage2", vkCmdResolveImage2}, - {"vkCmdResolveImage2KHR", vkCmdResolveImage2KHR}, - {"vkCmdSetAlphaToCoverageEnableEXT", vkCmdSetAlphaToCoverageEnableEXT}, - {"vkCmdSetAlphaToOneEnableEXT", vkCmdSetAlphaToOneEnableEXT}, - {"vkCmdSetAttachmentFeedbackLoopEnableEXT", vkCmdSetAttachmentFeedbackLoopEnableEXT}, - {"vkCmdSetBlendConstants", vkCmdSetBlendConstants}, - {"vkCmdSetCheckpointNV", vkCmdSetCheckpointNV}, - {"vkCmdSetCoarseSampleOrderNV", vkCmdSetCoarseSampleOrderNV}, - {"vkCmdSetColorBlendAdvancedEXT", vkCmdSetColorBlendAdvancedEXT}, - {"vkCmdSetColorBlendEnableEXT", vkCmdSetColorBlendEnableEXT}, - {"vkCmdSetColorBlendEquationEXT", vkCmdSetColorBlendEquationEXT}, - {"vkCmdSetColorWriteEnableEXT", vkCmdSetColorWriteEnableEXT}, - {"vkCmdSetColorWriteMaskEXT", vkCmdSetColorWriteMaskEXT}, - {"vkCmdSetConservativeRasterizationModeEXT", vkCmdSetConservativeRasterizationModeEXT}, - {"vkCmdSetCoverageModulationModeNV", vkCmdSetCoverageModulationModeNV}, - {"vkCmdSetCoverageModulationTableEnableNV", vkCmdSetCoverageModulationTableEnableNV}, - {"vkCmdSetCoverageModulationTableNV", vkCmdSetCoverageModulationTableNV}, - {"vkCmdSetCoverageReductionModeNV", vkCmdSetCoverageReductionModeNV}, - {"vkCmdSetCoverageToColorEnableNV", vkCmdSetCoverageToColorEnableNV}, - {"vkCmdSetCoverageToColorLocationNV", vkCmdSetCoverageToColorLocationNV}, - {"vkCmdSetCullMode", vkCmdSetCullMode}, - {"vkCmdSetCullModeEXT", vkCmdSetCullModeEXT}, - {"vkCmdSetDepthBias", vkCmdSetDepthBias}, - {"vkCmdSetDepthBias2EXT", vkCmdSetDepthBias2EXT}, - {"vkCmdSetDepthBiasEnable", vkCmdSetDepthBiasEnable}, - {"vkCmdSetDepthBiasEnableEXT", vkCmdSetDepthBiasEnableEXT}, - {"vkCmdSetDepthBounds", vkCmdSetDepthBounds}, - {"vkCmdSetDepthBoundsTestEnable", vkCmdSetDepthBoundsTestEnable}, - {"vkCmdSetDepthBoundsTestEnableEXT", vkCmdSetDepthBoundsTestEnableEXT}, - {"vkCmdSetDepthClampEnableEXT", vkCmdSetDepthClampEnableEXT}, - {"vkCmdSetDepthClipEnableEXT", vkCmdSetDepthClipEnableEXT}, - {"vkCmdSetDepthClipNegativeOneToOneEXT", vkCmdSetDepthClipNegativeOneToOneEXT}, - {"vkCmdSetDepthCompareOp", vkCmdSetDepthCompareOp}, - {"vkCmdSetDepthCompareOpEXT", vkCmdSetDepthCompareOpEXT}, - {"vkCmdSetDepthTestEnable", vkCmdSetDepthTestEnable}, - {"vkCmdSetDepthTestEnableEXT", vkCmdSetDepthTestEnableEXT}, - {"vkCmdSetDepthWriteEnable", vkCmdSetDepthWriteEnable}, - {"vkCmdSetDepthWriteEnableEXT", vkCmdSetDepthWriteEnableEXT}, - {"vkCmdSetDescriptorBufferOffsetsEXT", vkCmdSetDescriptorBufferOffsetsEXT}, - {"vkCmdSetDeviceMask", vkCmdSetDeviceMask}, - {"vkCmdSetDeviceMaskKHR", vkCmdSetDeviceMaskKHR}, - {"vkCmdSetDiscardRectangleEXT", vkCmdSetDiscardRectangleEXT}, - {"vkCmdSetDiscardRectangleEnableEXT", vkCmdSetDiscardRectangleEnableEXT}, - {"vkCmdSetDiscardRectangleModeEXT", vkCmdSetDiscardRectangleModeEXT}, - {"vkCmdSetEvent", vkCmdSetEvent}, - {"vkCmdSetEvent2", vkCmdSetEvent2}, - {"vkCmdSetEvent2KHR", vkCmdSetEvent2KHR}, - {"vkCmdSetExclusiveScissorEnableNV", vkCmdSetExclusiveScissorEnableNV}, - {"vkCmdSetExclusiveScissorNV", vkCmdSetExclusiveScissorNV}, - {"vkCmdSetExtraPrimitiveOverestimationSizeEXT", vkCmdSetExtraPrimitiveOverestimationSizeEXT}, - {"vkCmdSetFragmentShadingRateEnumNV", vkCmdSetFragmentShadingRateEnumNV}, - {"vkCmdSetFragmentShadingRateKHR", vkCmdSetFragmentShadingRateKHR}, - {"vkCmdSetFrontFace", vkCmdSetFrontFace}, - {"vkCmdSetFrontFaceEXT", vkCmdSetFrontFaceEXT}, - {"vkCmdSetLineRasterizationModeEXT", vkCmdSetLineRasterizationModeEXT}, - {"vkCmdSetLineStippleEXT", vkCmdSetLineStippleEXT}, - {"vkCmdSetLineStippleEnableEXT", vkCmdSetLineStippleEnableEXT}, - {"vkCmdSetLineWidth", vkCmdSetLineWidth}, - {"vkCmdSetLogicOpEXT", vkCmdSetLogicOpEXT}, - {"vkCmdSetLogicOpEnableEXT", vkCmdSetLogicOpEnableEXT}, - {"vkCmdSetPatchControlPointsEXT", vkCmdSetPatchControlPointsEXT}, - {"vkCmdSetPerformanceMarkerINTEL", vkCmdSetPerformanceMarkerINTEL}, - {"vkCmdSetPerformanceOverrideINTEL", vkCmdSetPerformanceOverrideINTEL}, - {"vkCmdSetPerformanceStreamMarkerINTEL", vkCmdSetPerformanceStreamMarkerINTEL}, - {"vkCmdSetPolygonModeEXT", vkCmdSetPolygonModeEXT}, - {"vkCmdSetPrimitiveRestartEnable", vkCmdSetPrimitiveRestartEnable}, - {"vkCmdSetPrimitiveRestartEnableEXT", vkCmdSetPrimitiveRestartEnableEXT}, - {"vkCmdSetPrimitiveTopology", vkCmdSetPrimitiveTopology}, - {"vkCmdSetPrimitiveTopologyEXT", vkCmdSetPrimitiveTopologyEXT}, - {"vkCmdSetProvokingVertexModeEXT", vkCmdSetProvokingVertexModeEXT}, - {"vkCmdSetRasterizationSamplesEXT", vkCmdSetRasterizationSamplesEXT}, - {"vkCmdSetRasterizationStreamEXT", vkCmdSetRasterizationStreamEXT}, - {"vkCmdSetRasterizerDiscardEnable", vkCmdSetRasterizerDiscardEnable}, - {"vkCmdSetRasterizerDiscardEnableEXT", vkCmdSetRasterizerDiscardEnableEXT}, - {"vkCmdSetRayTracingPipelineStackSizeKHR", vkCmdSetRayTracingPipelineStackSizeKHR}, - {"vkCmdSetRepresentativeFragmentTestEnableNV", vkCmdSetRepresentativeFragmentTestEnableNV}, - {"vkCmdSetSampleLocationsEXT", vkCmdSetSampleLocationsEXT}, - {"vkCmdSetSampleLocationsEnableEXT", vkCmdSetSampleLocationsEnableEXT}, - {"vkCmdSetSampleMaskEXT", vkCmdSetSampleMaskEXT}, - {"vkCmdSetScissor", vkCmdSetScissor}, - {"vkCmdSetScissorWithCount", vkCmdSetScissorWithCount}, - {"vkCmdSetScissorWithCountEXT", vkCmdSetScissorWithCountEXT}, - {"vkCmdSetShadingRateImageEnableNV", vkCmdSetShadingRateImageEnableNV}, - {"vkCmdSetStencilCompareMask", vkCmdSetStencilCompareMask}, - {"vkCmdSetStencilOp", vkCmdSetStencilOp}, - {"vkCmdSetStencilOpEXT", vkCmdSetStencilOpEXT}, - {"vkCmdSetStencilReference", vkCmdSetStencilReference}, - {"vkCmdSetStencilTestEnable", vkCmdSetStencilTestEnable}, - {"vkCmdSetStencilTestEnableEXT", vkCmdSetStencilTestEnableEXT}, - {"vkCmdSetStencilWriteMask", vkCmdSetStencilWriteMask}, - {"vkCmdSetTessellationDomainOriginEXT", vkCmdSetTessellationDomainOriginEXT}, - {"vkCmdSetVertexInputEXT", vkCmdSetVertexInputEXT}, - {"vkCmdSetViewport", vkCmdSetViewport}, - {"vkCmdSetViewportShadingRatePaletteNV", vkCmdSetViewportShadingRatePaletteNV}, - {"vkCmdSetViewportSwizzleNV", vkCmdSetViewportSwizzleNV}, - {"vkCmdSetViewportWScalingEnableNV", vkCmdSetViewportWScalingEnableNV}, - {"vkCmdSetViewportWScalingNV", vkCmdSetViewportWScalingNV}, - {"vkCmdSetViewportWithCount", vkCmdSetViewportWithCount}, - {"vkCmdSetViewportWithCountEXT", vkCmdSetViewportWithCountEXT}, - {"vkCmdSubpassShadingHUAWEI", vkCmdSubpassShadingHUAWEI}, - {"vkCmdTraceRaysIndirect2KHR", vkCmdTraceRaysIndirect2KHR}, - {"vkCmdTraceRaysIndirectKHR", vkCmdTraceRaysIndirectKHR}, - {"vkCmdTraceRaysKHR", vkCmdTraceRaysKHR}, - {"vkCmdTraceRaysNV", vkCmdTraceRaysNV}, - {"vkCmdUpdateBuffer", vkCmdUpdateBuffer}, - {"vkCmdUpdatePipelineIndirectBufferNV", vkCmdUpdatePipelineIndirectBufferNV}, - {"vkCmdWaitEvents", vkCmdWaitEvents}, - {"vkCmdWaitEvents2", vkCmdWaitEvents2}, - {"vkCmdWaitEvents2KHR", vkCmdWaitEvents2KHR}, - {"vkCmdWriteAccelerationStructuresPropertiesKHR", vkCmdWriteAccelerationStructuresPropertiesKHR}, - {"vkCmdWriteAccelerationStructuresPropertiesNV", vkCmdWriteAccelerationStructuresPropertiesNV}, - {"vkCmdWriteBufferMarker2AMD", vkCmdWriteBufferMarker2AMD}, - {"vkCmdWriteBufferMarkerAMD", vkCmdWriteBufferMarkerAMD}, - {"vkCmdWriteMicromapsPropertiesEXT", vkCmdWriteMicromapsPropertiesEXT}, - {"vkCmdWriteTimestamp", vkCmdWriteTimestamp}, - {"vkCmdWriteTimestamp2", vkCmdWriteTimestamp2}, - {"vkCmdWriteTimestamp2KHR", vkCmdWriteTimestamp2KHR}, - {"vkCompileDeferredNV", vkCompileDeferredNV}, - {"vkCopyAccelerationStructureKHR", vkCopyAccelerationStructureKHR}, - {"vkCopyAccelerationStructureToMemoryKHR", vkCopyAccelerationStructureToMemoryKHR}, - {"vkCopyImageToImageEXT", vkCopyImageToImageEXT}, - {"vkCopyImageToMemoryEXT", vkCopyImageToMemoryEXT}, - {"vkCopyMemoryToAccelerationStructureKHR", vkCopyMemoryToAccelerationStructureKHR}, - {"vkCopyMemoryToImageEXT", vkCopyMemoryToImageEXT}, - {"vkCopyMemoryToMicromapEXT", vkCopyMemoryToMicromapEXT}, - {"vkCopyMicromapEXT", vkCopyMicromapEXT}, - {"vkCopyMicromapToMemoryEXT", vkCopyMicromapToMemoryEXT}, - {"vkCreateAccelerationStructureKHR", vkCreateAccelerationStructureKHR}, - {"vkCreateAccelerationStructureNV", vkCreateAccelerationStructureNV}, - {"vkCreateBuffer", vkCreateBuffer}, - {"vkCreateBufferView", vkCreateBufferView}, - {"vkCreateCommandPool", vkCreateCommandPool}, - {"vkCreateComputePipelines", vkCreateComputePipelines}, - {"vkCreateCuFunctionNVX", vkCreateCuFunctionNVX}, - {"vkCreateCuModuleNVX", vkCreateCuModuleNVX}, - {"vkCreateCudaFunctionNV", vkCreateCudaFunctionNV}, - {"vkCreateCudaModuleNV", vkCreateCudaModuleNV}, - {"vkCreateDeferredOperationKHR", vkCreateDeferredOperationKHR}, - {"vkCreateDescriptorPool", vkCreateDescriptorPool}, - {"vkCreateDescriptorSetLayout", vkCreateDescriptorSetLayout}, - {"vkCreateDescriptorUpdateTemplate", vkCreateDescriptorUpdateTemplate}, - {"vkCreateDescriptorUpdateTemplateKHR", vkCreateDescriptorUpdateTemplateKHR}, - {"vkCreateEvent", vkCreateEvent}, - {"vkCreateFence", vkCreateFence}, - {"vkCreateFramebuffer", vkCreateFramebuffer}, - {"vkCreateGraphicsPipelines", vkCreateGraphicsPipelines}, - {"vkCreateImage", vkCreateImage}, - {"vkCreateImageView", vkCreateImageView}, - {"vkCreateIndirectCommandsLayoutNV", vkCreateIndirectCommandsLayoutNV}, - {"vkCreateMicromapEXT", vkCreateMicromapEXT}, - {"vkCreateOpticalFlowSessionNV", vkCreateOpticalFlowSessionNV}, - {"vkCreatePipelineCache", vkCreatePipelineCache}, - {"vkCreatePipelineLayout", vkCreatePipelineLayout}, - {"vkCreatePrivateDataSlot", vkCreatePrivateDataSlot}, - {"vkCreatePrivateDataSlotEXT", vkCreatePrivateDataSlotEXT}, - {"vkCreateQueryPool", vkCreateQueryPool}, - {"vkCreateRayTracingPipelinesKHR", vkCreateRayTracingPipelinesKHR}, - {"vkCreateRayTracingPipelinesNV", vkCreateRayTracingPipelinesNV}, - {"vkCreateRenderPass", vkCreateRenderPass}, - {"vkCreateRenderPass2", vkCreateRenderPass2}, - {"vkCreateRenderPass2KHR", vkCreateRenderPass2KHR}, - {"vkCreateSampler", vkCreateSampler}, - {"vkCreateSamplerYcbcrConversion", vkCreateSamplerYcbcrConversion}, - {"vkCreateSamplerYcbcrConversionKHR", vkCreateSamplerYcbcrConversionKHR}, - {"vkCreateSemaphore", vkCreateSemaphore}, - {"vkCreateShaderModule", vkCreateShaderModule}, - {"vkCreateShadersEXT", vkCreateShadersEXT}, - {"vkCreateSwapchainKHR", vkCreateSwapchainKHR}, - {"vkCreateValidationCacheEXT", vkCreateValidationCacheEXT}, - {"vkDebugMarkerSetObjectNameEXT", vkDebugMarkerSetObjectNameEXT}, - {"vkDebugMarkerSetObjectTagEXT", vkDebugMarkerSetObjectTagEXT}, - {"vkDeferredOperationJoinKHR", vkDeferredOperationJoinKHR}, - {"vkDestroyAccelerationStructureKHR", vkDestroyAccelerationStructureKHR}, - {"vkDestroyAccelerationStructureNV", vkDestroyAccelerationStructureNV}, - {"vkDestroyBuffer", vkDestroyBuffer}, - {"vkDestroyBufferView", vkDestroyBufferView}, - {"vkDestroyCommandPool", vkDestroyCommandPool}, - {"vkDestroyCuFunctionNVX", vkDestroyCuFunctionNVX}, - {"vkDestroyCuModuleNVX", vkDestroyCuModuleNVX}, - {"vkDestroyCudaFunctionNV", vkDestroyCudaFunctionNV}, - {"vkDestroyCudaModuleNV", vkDestroyCudaModuleNV}, - {"vkDestroyDeferredOperationKHR", vkDestroyDeferredOperationKHR}, - {"vkDestroyDescriptorPool", vkDestroyDescriptorPool}, - {"vkDestroyDescriptorSetLayout", vkDestroyDescriptorSetLayout}, - {"vkDestroyDescriptorUpdateTemplate", vkDestroyDescriptorUpdateTemplate}, - {"vkDestroyDescriptorUpdateTemplateKHR", vkDestroyDescriptorUpdateTemplateKHR}, - {"vkDestroyDevice", vkDestroyDevice}, - {"vkDestroyEvent", vkDestroyEvent}, - {"vkDestroyFence", vkDestroyFence}, - {"vkDestroyFramebuffer", vkDestroyFramebuffer}, - {"vkDestroyImage", vkDestroyImage}, - {"vkDestroyImageView", vkDestroyImageView}, - {"vkDestroyIndirectCommandsLayoutNV", vkDestroyIndirectCommandsLayoutNV}, - {"vkDestroyMicromapEXT", vkDestroyMicromapEXT}, - {"vkDestroyOpticalFlowSessionNV", vkDestroyOpticalFlowSessionNV}, - {"vkDestroyPipeline", vkDestroyPipeline}, - {"vkDestroyPipelineCache", vkDestroyPipelineCache}, - {"vkDestroyPipelineLayout", vkDestroyPipelineLayout}, - {"vkDestroyPrivateDataSlot", vkDestroyPrivateDataSlot}, - {"vkDestroyPrivateDataSlotEXT", vkDestroyPrivateDataSlotEXT}, - {"vkDestroyQueryPool", vkDestroyQueryPool}, - {"vkDestroyRenderPass", vkDestroyRenderPass}, - {"vkDestroySampler", vkDestroySampler}, - {"vkDestroySamplerYcbcrConversion", vkDestroySamplerYcbcrConversion}, - {"vkDestroySamplerYcbcrConversionKHR", vkDestroySamplerYcbcrConversionKHR}, - {"vkDestroySemaphore", vkDestroySemaphore}, - {"vkDestroyShaderEXT", vkDestroyShaderEXT}, - {"vkDestroyShaderModule", vkDestroyShaderModule}, - {"vkDestroySwapchainKHR", vkDestroySwapchainKHR}, - {"vkDestroyValidationCacheEXT", vkDestroyValidationCacheEXT}, - {"vkDeviceWaitIdle", vkDeviceWaitIdle}, - {"vkEndCommandBuffer", vkEndCommandBuffer}, - {"vkFlushMappedMemoryRanges", vkFlushMappedMemoryRanges}, - {"vkFreeCommandBuffers", vkFreeCommandBuffers}, - {"vkFreeDescriptorSets", vkFreeDescriptorSets}, - {"vkFreeMemory", vkFreeMemory}, - {"vkGetAccelerationStructureBuildSizesKHR", vkGetAccelerationStructureBuildSizesKHR}, - {"vkGetAccelerationStructureDeviceAddressKHR", vkGetAccelerationStructureDeviceAddressKHR}, - {"vkGetAccelerationStructureHandleNV", vkGetAccelerationStructureHandleNV}, - {"vkGetAccelerationStructureMemoryRequirementsNV", vkGetAccelerationStructureMemoryRequirementsNV}, - {"vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT", vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT}, - {"vkGetBufferDeviceAddress", vkGetBufferDeviceAddress}, - {"vkGetBufferDeviceAddressEXT", vkGetBufferDeviceAddressEXT}, - {"vkGetBufferDeviceAddressKHR", vkGetBufferDeviceAddressKHR}, - {"vkGetBufferMemoryRequirements", vkGetBufferMemoryRequirements}, - {"vkGetBufferMemoryRequirements2", vkGetBufferMemoryRequirements2}, - {"vkGetBufferMemoryRequirements2KHR", vkGetBufferMemoryRequirements2KHR}, - {"vkGetBufferOpaqueCaptureAddress", vkGetBufferOpaqueCaptureAddress}, - {"vkGetBufferOpaqueCaptureAddressKHR", vkGetBufferOpaqueCaptureAddressKHR}, - {"vkGetBufferOpaqueCaptureDescriptorDataEXT", vkGetBufferOpaqueCaptureDescriptorDataEXT}, - {"vkGetCalibratedTimestampsEXT", vkGetCalibratedTimestampsEXT}, - {"vkGetCudaModuleCacheNV", vkGetCudaModuleCacheNV}, - {"vkGetDeferredOperationMaxConcurrencyKHR", vkGetDeferredOperationMaxConcurrencyKHR}, - {"vkGetDeferredOperationResultKHR", vkGetDeferredOperationResultKHR}, - {"vkGetDescriptorEXT", vkGetDescriptorEXT}, - {"vkGetDescriptorSetHostMappingVALVE", vkGetDescriptorSetHostMappingVALVE}, - {"vkGetDescriptorSetLayoutBindingOffsetEXT", vkGetDescriptorSetLayoutBindingOffsetEXT}, - {"vkGetDescriptorSetLayoutHostMappingInfoVALVE", vkGetDescriptorSetLayoutHostMappingInfoVALVE}, - {"vkGetDescriptorSetLayoutSizeEXT", vkGetDescriptorSetLayoutSizeEXT}, - {"vkGetDescriptorSetLayoutSupport", vkGetDescriptorSetLayoutSupport}, - {"vkGetDescriptorSetLayoutSupportKHR", vkGetDescriptorSetLayoutSupportKHR}, - {"vkGetDeviceAccelerationStructureCompatibilityKHR", vkGetDeviceAccelerationStructureCompatibilityKHR}, - {"vkGetDeviceBufferMemoryRequirements", vkGetDeviceBufferMemoryRequirements}, - {"vkGetDeviceBufferMemoryRequirementsKHR", vkGetDeviceBufferMemoryRequirementsKHR}, - {"vkGetDeviceFaultInfoEXT", vkGetDeviceFaultInfoEXT}, - {"vkGetDeviceGroupPeerMemoryFeatures", vkGetDeviceGroupPeerMemoryFeatures}, - {"vkGetDeviceGroupPeerMemoryFeaturesKHR", vkGetDeviceGroupPeerMemoryFeaturesKHR}, - {"vkGetDeviceGroupPresentCapabilitiesKHR", vkGetDeviceGroupPresentCapabilitiesKHR}, - {"vkGetDeviceGroupSurfacePresentModesKHR", vkGetDeviceGroupSurfacePresentModesKHR}, - {"vkGetDeviceImageMemoryRequirements", vkGetDeviceImageMemoryRequirements}, - {"vkGetDeviceImageMemoryRequirementsKHR", vkGetDeviceImageMemoryRequirementsKHR}, - {"vkGetDeviceImageSparseMemoryRequirements", vkGetDeviceImageSparseMemoryRequirements}, - {"vkGetDeviceImageSparseMemoryRequirementsKHR", vkGetDeviceImageSparseMemoryRequirementsKHR}, - {"vkGetDeviceImageSubresourceLayoutKHR", vkGetDeviceImageSubresourceLayoutKHR}, - {"vkGetDeviceMemoryCommitment", vkGetDeviceMemoryCommitment}, - {"vkGetDeviceMemoryOpaqueCaptureAddress", vkGetDeviceMemoryOpaqueCaptureAddress}, - {"vkGetDeviceMemoryOpaqueCaptureAddressKHR", vkGetDeviceMemoryOpaqueCaptureAddressKHR}, - {"vkGetDeviceMicromapCompatibilityEXT", vkGetDeviceMicromapCompatibilityEXT}, - {"vkGetDeviceProcAddr", vkGetDeviceProcAddr}, - {"vkGetDeviceQueue", vkGetDeviceQueue}, - {"vkGetDeviceQueue2", vkGetDeviceQueue2}, - {"vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI", vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI}, - {"vkGetDynamicRenderingTilePropertiesQCOM", vkGetDynamicRenderingTilePropertiesQCOM}, - {"vkGetEventStatus", vkGetEventStatus}, - {"vkGetFenceStatus", vkGetFenceStatus}, - {"vkGetFramebufferTilePropertiesQCOM", vkGetFramebufferTilePropertiesQCOM}, - {"vkGetGeneratedCommandsMemoryRequirementsNV", vkGetGeneratedCommandsMemoryRequirementsNV}, - {"vkGetImageMemoryRequirements", vkGetImageMemoryRequirements}, - {"vkGetImageMemoryRequirements2", vkGetImageMemoryRequirements2}, - {"vkGetImageMemoryRequirements2KHR", vkGetImageMemoryRequirements2KHR}, - {"vkGetImageOpaqueCaptureDescriptorDataEXT", vkGetImageOpaqueCaptureDescriptorDataEXT}, - {"vkGetImageSparseMemoryRequirements", vkGetImageSparseMemoryRequirements}, - {"vkGetImageSparseMemoryRequirements2", vkGetImageSparseMemoryRequirements2}, - {"vkGetImageSparseMemoryRequirements2KHR", vkGetImageSparseMemoryRequirements2KHR}, - {"vkGetImageSubresourceLayout", vkGetImageSubresourceLayout}, - {"vkGetImageSubresourceLayout2EXT", vkGetImageSubresourceLayout2EXT}, - {"vkGetImageSubresourceLayout2KHR", vkGetImageSubresourceLayout2KHR}, - {"vkGetImageViewAddressNVX", vkGetImageViewAddressNVX}, - {"vkGetImageViewHandleNVX", vkGetImageViewHandleNVX}, - {"vkGetImageViewOpaqueCaptureDescriptorDataEXT", vkGetImageViewOpaqueCaptureDescriptorDataEXT}, - {"vkGetLatencyTimingsNV", vkGetLatencyTimingsNV}, - {"vkGetMemoryHostPointerPropertiesEXT", vkGetMemoryHostPointerPropertiesEXT}, - {"vkGetMicromapBuildSizesEXT", vkGetMicromapBuildSizesEXT}, - {"vkGetPerformanceParameterINTEL", vkGetPerformanceParameterINTEL}, - {"vkGetPipelineCacheData", vkGetPipelineCacheData}, - {"vkGetPipelineExecutableInternalRepresentationsKHR", vkGetPipelineExecutableInternalRepresentationsKHR}, - {"vkGetPipelineExecutablePropertiesKHR", vkGetPipelineExecutablePropertiesKHR}, - {"vkGetPipelineExecutableStatisticsKHR", vkGetPipelineExecutableStatisticsKHR}, - {"vkGetPipelineIndirectDeviceAddressNV", vkGetPipelineIndirectDeviceAddressNV}, - {"vkGetPipelineIndirectMemoryRequirementsNV", vkGetPipelineIndirectMemoryRequirementsNV}, - {"vkGetPipelinePropertiesEXT", vkGetPipelinePropertiesEXT}, - {"vkGetPrivateData", vkGetPrivateData}, - {"vkGetPrivateDataEXT", vkGetPrivateDataEXT}, - {"vkGetQueryPoolResults", vkGetQueryPoolResults}, - {"vkGetQueueCheckpointData2NV", vkGetQueueCheckpointData2NV}, - {"vkGetQueueCheckpointDataNV", vkGetQueueCheckpointDataNV}, - {"vkGetRayTracingCaptureReplayShaderGroupHandlesKHR", vkGetRayTracingCaptureReplayShaderGroupHandlesKHR}, - {"vkGetRayTracingShaderGroupHandlesKHR", vkGetRayTracingShaderGroupHandlesKHR}, - {"vkGetRayTracingShaderGroupHandlesNV", vkGetRayTracingShaderGroupHandlesNV}, - {"vkGetRayTracingShaderGroupStackSizeKHR", vkGetRayTracingShaderGroupStackSizeKHR}, - {"vkGetRenderAreaGranularity", vkGetRenderAreaGranularity}, - {"vkGetRenderingAreaGranularityKHR", vkGetRenderingAreaGranularityKHR}, - {"vkGetSamplerOpaqueCaptureDescriptorDataEXT", vkGetSamplerOpaqueCaptureDescriptorDataEXT}, - {"vkGetSemaphoreCounterValue", vkGetSemaphoreCounterValue}, - {"vkGetSemaphoreCounterValueKHR", vkGetSemaphoreCounterValueKHR}, - {"vkGetShaderBinaryDataEXT", vkGetShaderBinaryDataEXT}, - {"vkGetShaderInfoAMD", vkGetShaderInfoAMD}, - {"vkGetShaderModuleCreateInfoIdentifierEXT", vkGetShaderModuleCreateInfoIdentifierEXT}, - {"vkGetShaderModuleIdentifierEXT", vkGetShaderModuleIdentifierEXT}, - {"vkGetSwapchainImagesKHR", vkGetSwapchainImagesKHR}, - {"vkGetValidationCacheDataEXT", vkGetValidationCacheDataEXT}, - {"vkInitializePerformanceApiINTEL", vkInitializePerformanceApiINTEL}, - {"vkInvalidateMappedMemoryRanges", vkInvalidateMappedMemoryRanges}, - {"vkLatencySleepNV", vkLatencySleepNV}, - {"vkMapMemory", vkMapMemory}, - {"vkMapMemory2KHR", vkMapMemory2KHR}, - {"vkMergePipelineCaches", vkMergePipelineCaches}, - {"vkMergeValidationCachesEXT", vkMergeValidationCachesEXT}, - {"vkQueueBeginDebugUtilsLabelEXT", vkQueueBeginDebugUtilsLabelEXT}, - {"vkQueueBindSparse", vkQueueBindSparse}, - {"vkQueueEndDebugUtilsLabelEXT", vkQueueEndDebugUtilsLabelEXT}, - {"vkQueueInsertDebugUtilsLabelEXT", vkQueueInsertDebugUtilsLabelEXT}, - {"vkQueueNotifyOutOfBandNV", vkQueueNotifyOutOfBandNV}, - {"vkQueuePresentKHR", vkQueuePresentKHR}, - {"vkQueueSetPerformanceConfigurationINTEL", vkQueueSetPerformanceConfigurationINTEL}, - {"vkQueueSubmit", vkQueueSubmit}, - {"vkQueueSubmit2", vkQueueSubmit2}, - {"vkQueueSubmit2KHR", vkQueueSubmit2KHR}, - {"vkQueueWaitIdle", vkQueueWaitIdle}, - {"vkReleasePerformanceConfigurationINTEL", vkReleasePerformanceConfigurationINTEL}, - {"vkReleaseProfilingLockKHR", vkReleaseProfilingLockKHR}, - {"vkReleaseSwapchainImagesEXT", vkReleaseSwapchainImagesEXT}, - {"vkResetCommandBuffer", vkResetCommandBuffer}, - {"vkResetCommandPool", vkResetCommandPool}, - {"vkResetDescriptorPool", vkResetDescriptorPool}, - {"vkResetEvent", vkResetEvent}, - {"vkResetFences", vkResetFences}, - {"vkResetQueryPool", vkResetQueryPool}, - {"vkResetQueryPoolEXT", vkResetQueryPoolEXT}, - {"vkSetDebugUtilsObjectNameEXT", vkSetDebugUtilsObjectNameEXT}, - {"vkSetDebugUtilsObjectTagEXT", vkSetDebugUtilsObjectTagEXT}, - {"vkSetDeviceMemoryPriorityEXT", vkSetDeviceMemoryPriorityEXT}, - {"vkSetEvent", vkSetEvent}, - {"vkSetHdrMetadataEXT", vkSetHdrMetadataEXT}, - {"vkSetLatencyMarkerNV", vkSetLatencyMarkerNV}, - {"vkSetLatencySleepModeNV", vkSetLatencySleepModeNV}, - {"vkSetPrivateData", vkSetPrivateData}, - {"vkSetPrivateDataEXT", vkSetPrivateDataEXT}, - {"vkSignalSemaphore", vkSignalSemaphore}, - {"vkSignalSemaphoreKHR", vkSignalSemaphoreKHR}, - {"vkTransitionImageLayoutEXT", vkTransitionImageLayoutEXT}, - {"vkTrimCommandPool", vkTrimCommandPool}, - {"vkTrimCommandPoolKHR", vkTrimCommandPoolKHR}, - {"vkUninitializePerformanceApiINTEL", vkUninitializePerformanceApiINTEL}, - {"vkUnmapMemory", vkUnmapMemory}, - {"vkUnmapMemory2KHR", vkUnmapMemory2KHR}, - {"vkUpdateDescriptorSetWithTemplate", vkUpdateDescriptorSetWithTemplate}, - {"vkUpdateDescriptorSetWithTemplateKHR", vkUpdateDescriptorSetWithTemplateKHR}, - {"vkUpdateDescriptorSets", vkUpdateDescriptorSets}, - {"vkWaitForFences", vkWaitForFences}, - {"vkWaitForPresentKHR", vkWaitForPresentKHR}, - {"vkWaitSemaphores", vkWaitSemaphores}, - {"vkWaitSemaphoresKHR", vkWaitSemaphoresKHR}, - {"vkWriteAccelerationStructuresPropertiesKHR", vkWriteAccelerationStructuresPropertiesKHR}, - {"vkWriteMicromapsPropertiesEXT", vkWriteMicromapsPropertiesEXT}, -}; - -static const struct vulkan_func vk_phys_dev_dispatch_table[] = -{ - {"vkCreateDevice", vkCreateDevice}, - {"vkEnumerateDeviceExtensionProperties", vkEnumerateDeviceExtensionProperties}, - {"vkEnumerateDeviceLayerProperties", vkEnumerateDeviceLayerProperties}, - {"vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR", vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR}, - {"vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", vkGetPhysicalDeviceCalibrateableTimeDomainsEXT}, - {"vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR", vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR}, - {"vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", vkGetPhysicalDeviceCooperativeMatrixPropertiesNV}, - {"vkGetPhysicalDeviceExternalBufferProperties", vkGetPhysicalDeviceExternalBufferProperties}, - {"vkGetPhysicalDeviceExternalBufferPropertiesKHR", vkGetPhysicalDeviceExternalBufferPropertiesKHR}, - {"vkGetPhysicalDeviceExternalFenceProperties", vkGetPhysicalDeviceExternalFenceProperties}, - {"vkGetPhysicalDeviceExternalFencePropertiesKHR", vkGetPhysicalDeviceExternalFencePropertiesKHR}, - {"vkGetPhysicalDeviceExternalSemaphoreProperties", vkGetPhysicalDeviceExternalSemaphoreProperties}, - {"vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", vkGetPhysicalDeviceExternalSemaphorePropertiesKHR}, - {"vkGetPhysicalDeviceFeatures", vkGetPhysicalDeviceFeatures}, - {"vkGetPhysicalDeviceFeatures2", vkGetPhysicalDeviceFeatures2}, - {"vkGetPhysicalDeviceFeatures2KHR", vkGetPhysicalDeviceFeatures2KHR}, - {"vkGetPhysicalDeviceFormatProperties", vkGetPhysicalDeviceFormatProperties}, - {"vkGetPhysicalDeviceFormatProperties2", vkGetPhysicalDeviceFormatProperties2}, - {"vkGetPhysicalDeviceFormatProperties2KHR", vkGetPhysicalDeviceFormatProperties2KHR}, - {"vkGetPhysicalDeviceFragmentShadingRatesKHR", vkGetPhysicalDeviceFragmentShadingRatesKHR}, - {"vkGetPhysicalDeviceImageFormatProperties", vkGetPhysicalDeviceImageFormatProperties}, - {"vkGetPhysicalDeviceImageFormatProperties2", vkGetPhysicalDeviceImageFormatProperties2}, - {"vkGetPhysicalDeviceImageFormatProperties2KHR", vkGetPhysicalDeviceImageFormatProperties2KHR}, - {"vkGetPhysicalDeviceMemoryProperties", vkGetPhysicalDeviceMemoryProperties}, - {"vkGetPhysicalDeviceMemoryProperties2", vkGetPhysicalDeviceMemoryProperties2}, - {"vkGetPhysicalDeviceMemoryProperties2KHR", vkGetPhysicalDeviceMemoryProperties2KHR}, - {"vkGetPhysicalDeviceMultisamplePropertiesEXT", vkGetPhysicalDeviceMultisamplePropertiesEXT}, - {"vkGetPhysicalDeviceOpticalFlowImageFormatsNV", vkGetPhysicalDeviceOpticalFlowImageFormatsNV}, - {"vkGetPhysicalDevicePresentRectanglesKHR", vkGetPhysicalDevicePresentRectanglesKHR}, - {"vkGetPhysicalDeviceProperties", vkGetPhysicalDeviceProperties}, - {"vkGetPhysicalDeviceProperties2", vkGetPhysicalDeviceProperties2}, - {"vkGetPhysicalDeviceProperties2KHR", vkGetPhysicalDeviceProperties2KHR}, - {"vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR", vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR}, - {"vkGetPhysicalDeviceQueueFamilyProperties", vkGetPhysicalDeviceQueueFamilyProperties}, - {"vkGetPhysicalDeviceQueueFamilyProperties2", vkGetPhysicalDeviceQueueFamilyProperties2}, - {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", vkGetPhysicalDeviceQueueFamilyProperties2KHR}, - {"vkGetPhysicalDeviceSparseImageFormatProperties", vkGetPhysicalDeviceSparseImageFormatProperties}, - {"vkGetPhysicalDeviceSparseImageFormatProperties2", vkGetPhysicalDeviceSparseImageFormatProperties2}, - {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", vkGetPhysicalDeviceSparseImageFormatProperties2KHR}, - {"vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV", vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV}, - {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", vkGetPhysicalDeviceSurfaceCapabilities2KHR}, - {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", vkGetPhysicalDeviceSurfaceCapabilitiesKHR}, - {"vkGetPhysicalDeviceSurfaceFormats2KHR", vkGetPhysicalDeviceSurfaceFormats2KHR}, - {"vkGetPhysicalDeviceSurfaceFormatsKHR", vkGetPhysicalDeviceSurfaceFormatsKHR}, - {"vkGetPhysicalDeviceSurfacePresentModesKHR", vkGetPhysicalDeviceSurfacePresentModesKHR}, - {"vkGetPhysicalDeviceSurfaceSupportKHR", vkGetPhysicalDeviceSurfaceSupportKHR}, - {"vkGetPhysicalDeviceToolProperties", vkGetPhysicalDeviceToolProperties}, - {"vkGetPhysicalDeviceToolPropertiesEXT", vkGetPhysicalDeviceToolPropertiesEXT}, - {"vkGetPhysicalDeviceWin32PresentationSupportKHR", vkGetPhysicalDeviceWin32PresentationSupportKHR}, -}; - -static const struct vulkan_func vk_instance_dispatch_table[] = -{ - {"vkCreateDebugReportCallbackEXT", vkCreateDebugReportCallbackEXT}, - {"vkCreateDebugUtilsMessengerEXT", vkCreateDebugUtilsMessengerEXT}, - {"vkCreateWin32SurfaceKHR", vkCreateWin32SurfaceKHR}, - {"vkDebugReportMessageEXT", vkDebugReportMessageEXT}, - {"vkDestroyDebugReportCallbackEXT", vkDestroyDebugReportCallbackEXT}, - {"vkDestroyDebugUtilsMessengerEXT", vkDestroyDebugUtilsMessengerEXT}, - {"vkDestroyInstance", vkDestroyInstance}, - {"vkDestroySurfaceKHR", vkDestroySurfaceKHR}, - {"vkEnumeratePhysicalDeviceGroups", vkEnumeratePhysicalDeviceGroups}, - {"vkEnumeratePhysicalDeviceGroupsKHR", vkEnumeratePhysicalDeviceGroupsKHR}, - {"vkEnumeratePhysicalDevices", vkEnumeratePhysicalDevices}, - {"vkSubmitDebugUtilsMessageEXT", vkSubmitDebugUtilsMessageEXT}, -}; - -void *wine_vk_get_device_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_device_dispatch_table); i++) - { - if (strcmp(vk_device_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in device table\n", debugstr_a(name)); - return vk_device_dispatch_table[i].func; - } - } - return NULL; -} - -void *wine_vk_get_phys_dev_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_phys_dev_dispatch_table); i++) - { - if (strcmp(vk_phys_dev_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in physical device table\n", debugstr_a(name)); - return vk_phys_dev_dispatch_table[i].func; - } - } - return NULL; -} - -void *wine_vk_get_instance_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_instance_dispatch_table); i++) - { - if (strcmp(vk_instance_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in instance table\n", debugstr_a(name)); - return vk_instance_dispatch_table[i].func; - } - } - return NULL; -} diff --git a/dlls/winevulkan/loader_thunks.h b/dlls/winevulkan/loader_thunks.h deleted file mode 100644 index 2c54017e0c9..00000000000 --- a/dlls/winevulkan/loader_thunks.h +++ /dev/null @@ -1,4978 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_LOADER_THUNKS_H -#define __WINE_VULKAN_LOADER_THUNKS_H - -enum unix_call -{ - unix_init, - unix_is_available_instance_function, - unix_is_available_device_function, - unix_vkAcquireNextImage2KHR, - unix_vkAcquireNextImageKHR, - unix_vkAcquirePerformanceConfigurationINTEL, - unix_vkAcquireProfilingLockKHR, - unix_vkAllocateCommandBuffers, - unix_vkAllocateDescriptorSets, - unix_vkAllocateMemory, - unix_vkBeginCommandBuffer, - unix_vkBindAccelerationStructureMemoryNV, - unix_vkBindBufferMemory, - unix_vkBindBufferMemory2, - unix_vkBindBufferMemory2KHR, - unix_vkBindImageMemory, - unix_vkBindImageMemory2, - unix_vkBindImageMemory2KHR, - unix_vkBindOpticalFlowSessionImageNV, - unix_vkBuildAccelerationStructuresKHR, - unix_vkBuildMicromapsEXT, - unix_vkCmdBeginConditionalRenderingEXT, - unix_vkCmdBeginDebugUtilsLabelEXT, - unix_vkCmdBeginQuery, - unix_vkCmdBeginQueryIndexedEXT, - unix_vkCmdBeginRenderPass, - unix_vkCmdBeginRenderPass2, - unix_vkCmdBeginRenderPass2KHR, - unix_vkCmdBeginRendering, - unix_vkCmdBeginRenderingKHR, - unix_vkCmdBeginTransformFeedbackEXT, - unix_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - unix_vkCmdBindDescriptorBuffersEXT, - unix_vkCmdBindDescriptorSets, - unix_vkCmdBindIndexBuffer, - unix_vkCmdBindIndexBuffer2KHR, - unix_vkCmdBindInvocationMaskHUAWEI, - unix_vkCmdBindPipeline, - unix_vkCmdBindPipelineShaderGroupNV, - unix_vkCmdBindShadersEXT, - unix_vkCmdBindShadingRateImageNV, - unix_vkCmdBindTransformFeedbackBuffersEXT, - unix_vkCmdBindVertexBuffers, - unix_vkCmdBindVertexBuffers2, - unix_vkCmdBindVertexBuffers2EXT, - unix_vkCmdBlitImage, - unix_vkCmdBlitImage2, - unix_vkCmdBlitImage2KHR, - unix_vkCmdBuildAccelerationStructureNV, - unix_vkCmdBuildAccelerationStructuresIndirectKHR, - unix_vkCmdBuildAccelerationStructuresKHR, - unix_vkCmdBuildMicromapsEXT, - unix_vkCmdClearAttachments, - unix_vkCmdClearColorImage, - unix_vkCmdClearDepthStencilImage, - unix_vkCmdCopyAccelerationStructureKHR, - unix_vkCmdCopyAccelerationStructureNV, - unix_vkCmdCopyAccelerationStructureToMemoryKHR, - unix_vkCmdCopyBuffer, - unix_vkCmdCopyBuffer2, - unix_vkCmdCopyBuffer2KHR, - unix_vkCmdCopyBufferToImage, - unix_vkCmdCopyBufferToImage2, - unix_vkCmdCopyBufferToImage2KHR, - unix_vkCmdCopyImage, - unix_vkCmdCopyImage2, - unix_vkCmdCopyImage2KHR, - unix_vkCmdCopyImageToBuffer, - unix_vkCmdCopyImageToBuffer2, - unix_vkCmdCopyImageToBuffer2KHR, - unix_vkCmdCopyMemoryIndirectNV, - unix_vkCmdCopyMemoryToAccelerationStructureKHR, - unix_vkCmdCopyMemoryToImageIndirectNV, - unix_vkCmdCopyMemoryToMicromapEXT, - unix_vkCmdCopyMicromapEXT, - unix_vkCmdCopyMicromapToMemoryEXT, - unix_vkCmdCopyQueryPoolResults, - unix_vkCmdCuLaunchKernelNVX, - unix_vkCmdCudaLaunchKernelNV, - unix_vkCmdDebugMarkerBeginEXT, - unix_vkCmdDebugMarkerEndEXT, - unix_vkCmdDebugMarkerInsertEXT, - unix_vkCmdDecompressMemoryIndirectCountNV, - unix_vkCmdDecompressMemoryNV, - unix_vkCmdDispatch, - unix_vkCmdDispatchBase, - unix_vkCmdDispatchBaseKHR, - unix_vkCmdDispatchIndirect, - unix_vkCmdDraw, - unix_vkCmdDrawClusterHUAWEI, - unix_vkCmdDrawClusterIndirectHUAWEI, - unix_vkCmdDrawIndexed, - unix_vkCmdDrawIndexedIndirect, - unix_vkCmdDrawIndexedIndirectCount, - unix_vkCmdDrawIndexedIndirectCountAMD, - unix_vkCmdDrawIndexedIndirectCountKHR, - unix_vkCmdDrawIndirect, - unix_vkCmdDrawIndirectByteCountEXT, - unix_vkCmdDrawIndirectCount, - unix_vkCmdDrawIndirectCountAMD, - unix_vkCmdDrawIndirectCountKHR, - unix_vkCmdDrawMeshTasksEXT, - unix_vkCmdDrawMeshTasksIndirectCountEXT, - unix_vkCmdDrawMeshTasksIndirectCountNV, - unix_vkCmdDrawMeshTasksIndirectEXT, - unix_vkCmdDrawMeshTasksIndirectNV, - unix_vkCmdDrawMeshTasksNV, - unix_vkCmdDrawMultiEXT, - unix_vkCmdDrawMultiIndexedEXT, - unix_vkCmdEndConditionalRenderingEXT, - unix_vkCmdEndDebugUtilsLabelEXT, - unix_vkCmdEndQuery, - unix_vkCmdEndQueryIndexedEXT, - unix_vkCmdEndRenderPass, - unix_vkCmdEndRenderPass2, - unix_vkCmdEndRenderPass2KHR, - unix_vkCmdEndRendering, - unix_vkCmdEndRenderingKHR, - unix_vkCmdEndTransformFeedbackEXT, - unix_vkCmdExecuteCommands, - unix_vkCmdExecuteGeneratedCommandsNV, - unix_vkCmdFillBuffer, - unix_vkCmdInsertDebugUtilsLabelEXT, - unix_vkCmdNextSubpass, - unix_vkCmdNextSubpass2, - unix_vkCmdNextSubpass2KHR, - unix_vkCmdOpticalFlowExecuteNV, - unix_vkCmdPipelineBarrier, - unix_vkCmdPipelineBarrier2, - unix_vkCmdPipelineBarrier2KHR, - unix_vkCmdPreprocessGeneratedCommandsNV, - unix_vkCmdPushConstants, - unix_vkCmdPushDescriptorSetKHR, - unix_vkCmdPushDescriptorSetWithTemplateKHR, - unix_vkCmdResetEvent, - unix_vkCmdResetEvent2, - unix_vkCmdResetEvent2KHR, - unix_vkCmdResetQueryPool, - unix_vkCmdResolveImage, - unix_vkCmdResolveImage2, - unix_vkCmdResolveImage2KHR, - unix_vkCmdSetAlphaToCoverageEnableEXT, - unix_vkCmdSetAlphaToOneEnableEXT, - unix_vkCmdSetAttachmentFeedbackLoopEnableEXT, - unix_vkCmdSetBlendConstants, - unix_vkCmdSetCheckpointNV, - unix_vkCmdSetCoarseSampleOrderNV, - unix_vkCmdSetColorBlendAdvancedEXT, - unix_vkCmdSetColorBlendEnableEXT, - unix_vkCmdSetColorBlendEquationEXT, - unix_vkCmdSetColorWriteEnableEXT, - unix_vkCmdSetColorWriteMaskEXT, - unix_vkCmdSetConservativeRasterizationModeEXT, - unix_vkCmdSetCoverageModulationModeNV, - unix_vkCmdSetCoverageModulationTableEnableNV, - unix_vkCmdSetCoverageModulationTableNV, - unix_vkCmdSetCoverageReductionModeNV, - unix_vkCmdSetCoverageToColorEnableNV, - unix_vkCmdSetCoverageToColorLocationNV, - unix_vkCmdSetCullMode, - unix_vkCmdSetCullModeEXT, - unix_vkCmdSetDepthBias, - unix_vkCmdSetDepthBias2EXT, - unix_vkCmdSetDepthBiasEnable, - unix_vkCmdSetDepthBiasEnableEXT, - unix_vkCmdSetDepthBounds, - unix_vkCmdSetDepthBoundsTestEnable, - unix_vkCmdSetDepthBoundsTestEnableEXT, - unix_vkCmdSetDepthClampEnableEXT, - unix_vkCmdSetDepthClipEnableEXT, - unix_vkCmdSetDepthClipNegativeOneToOneEXT, - unix_vkCmdSetDepthCompareOp, - unix_vkCmdSetDepthCompareOpEXT, - unix_vkCmdSetDepthTestEnable, - unix_vkCmdSetDepthTestEnableEXT, - unix_vkCmdSetDepthWriteEnable, - unix_vkCmdSetDepthWriteEnableEXT, - unix_vkCmdSetDescriptorBufferOffsetsEXT, - unix_vkCmdSetDeviceMask, - unix_vkCmdSetDeviceMaskKHR, - unix_vkCmdSetDiscardRectangleEXT, - unix_vkCmdSetDiscardRectangleEnableEXT, - unix_vkCmdSetDiscardRectangleModeEXT, - unix_vkCmdSetEvent, - unix_vkCmdSetEvent2, - unix_vkCmdSetEvent2KHR, - unix_vkCmdSetExclusiveScissorEnableNV, - unix_vkCmdSetExclusiveScissorNV, - unix_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - unix_vkCmdSetFragmentShadingRateEnumNV, - unix_vkCmdSetFragmentShadingRateKHR, - unix_vkCmdSetFrontFace, - unix_vkCmdSetFrontFaceEXT, - unix_vkCmdSetLineRasterizationModeEXT, - unix_vkCmdSetLineStippleEXT, - unix_vkCmdSetLineStippleEnableEXT, - unix_vkCmdSetLineWidth, - unix_vkCmdSetLogicOpEXT, - unix_vkCmdSetLogicOpEnableEXT, - unix_vkCmdSetPatchControlPointsEXT, - unix_vkCmdSetPerformanceMarkerINTEL, - unix_vkCmdSetPerformanceOverrideINTEL, - unix_vkCmdSetPerformanceStreamMarkerINTEL, - unix_vkCmdSetPolygonModeEXT, - unix_vkCmdSetPrimitiveRestartEnable, - unix_vkCmdSetPrimitiveRestartEnableEXT, - unix_vkCmdSetPrimitiveTopology, - unix_vkCmdSetPrimitiveTopologyEXT, - unix_vkCmdSetProvokingVertexModeEXT, - unix_vkCmdSetRasterizationSamplesEXT, - unix_vkCmdSetRasterizationStreamEXT, - unix_vkCmdSetRasterizerDiscardEnable, - unix_vkCmdSetRasterizerDiscardEnableEXT, - unix_vkCmdSetRayTracingPipelineStackSizeKHR, - unix_vkCmdSetRepresentativeFragmentTestEnableNV, - unix_vkCmdSetSampleLocationsEXT, - unix_vkCmdSetSampleLocationsEnableEXT, - unix_vkCmdSetSampleMaskEXT, - unix_vkCmdSetScissor, - unix_vkCmdSetScissorWithCount, - unix_vkCmdSetScissorWithCountEXT, - unix_vkCmdSetShadingRateImageEnableNV, - unix_vkCmdSetStencilCompareMask, - unix_vkCmdSetStencilOp, - unix_vkCmdSetStencilOpEXT, - unix_vkCmdSetStencilReference, - unix_vkCmdSetStencilTestEnable, - unix_vkCmdSetStencilTestEnableEXT, - unix_vkCmdSetStencilWriteMask, - unix_vkCmdSetTessellationDomainOriginEXT, - unix_vkCmdSetVertexInputEXT, - unix_vkCmdSetViewport, - unix_vkCmdSetViewportShadingRatePaletteNV, - unix_vkCmdSetViewportSwizzleNV, - unix_vkCmdSetViewportWScalingEnableNV, - unix_vkCmdSetViewportWScalingNV, - unix_vkCmdSetViewportWithCount, - unix_vkCmdSetViewportWithCountEXT, - unix_vkCmdSubpassShadingHUAWEI, - unix_vkCmdTraceRaysIndirect2KHR, - unix_vkCmdTraceRaysIndirectKHR, - unix_vkCmdTraceRaysKHR, - unix_vkCmdTraceRaysNV, - unix_vkCmdUpdateBuffer, - unix_vkCmdUpdatePipelineIndirectBufferNV, - unix_vkCmdWaitEvents, - unix_vkCmdWaitEvents2, - unix_vkCmdWaitEvents2KHR, - unix_vkCmdWriteAccelerationStructuresPropertiesKHR, - unix_vkCmdWriteAccelerationStructuresPropertiesNV, - unix_vkCmdWriteBufferMarker2AMD, - unix_vkCmdWriteBufferMarkerAMD, - unix_vkCmdWriteMicromapsPropertiesEXT, - unix_vkCmdWriteTimestamp, - unix_vkCmdWriteTimestamp2, - unix_vkCmdWriteTimestamp2KHR, - unix_vkCompileDeferredNV, - unix_vkCopyAccelerationStructureKHR, - unix_vkCopyAccelerationStructureToMemoryKHR, - unix_vkCopyImageToImageEXT, - unix_vkCopyImageToMemoryEXT, - unix_vkCopyMemoryToAccelerationStructureKHR, - unix_vkCopyMemoryToImageEXT, - unix_vkCopyMemoryToMicromapEXT, - unix_vkCopyMicromapEXT, - unix_vkCopyMicromapToMemoryEXT, - unix_vkCreateAccelerationStructureKHR, - unix_vkCreateAccelerationStructureNV, - unix_vkCreateBuffer, - unix_vkCreateBufferView, - unix_vkCreateCommandPool, - unix_vkCreateComputePipelines, - unix_vkCreateCuFunctionNVX, - unix_vkCreateCuModuleNVX, - unix_vkCreateCudaFunctionNV, - unix_vkCreateCudaModuleNV, - unix_vkCreateDebugReportCallbackEXT, - unix_vkCreateDebugUtilsMessengerEXT, - unix_vkCreateDeferredOperationKHR, - unix_vkCreateDescriptorPool, - unix_vkCreateDescriptorSetLayout, - unix_vkCreateDescriptorUpdateTemplate, - unix_vkCreateDescriptorUpdateTemplateKHR, - unix_vkCreateDevice, - unix_vkCreateEvent, - unix_vkCreateFence, - unix_vkCreateFramebuffer, - unix_vkCreateGraphicsPipelines, - unix_vkCreateImage, - unix_vkCreateImageView, - unix_vkCreateIndirectCommandsLayoutNV, - unix_vkCreateInstance, - unix_vkCreateMicromapEXT, - unix_vkCreateOpticalFlowSessionNV, - unix_vkCreatePipelineCache, - unix_vkCreatePipelineLayout, - unix_vkCreatePrivateDataSlot, - unix_vkCreatePrivateDataSlotEXT, - unix_vkCreateQueryPool, - unix_vkCreateRayTracingPipelinesKHR, - unix_vkCreateRayTracingPipelinesNV, - unix_vkCreateRenderPass, - unix_vkCreateRenderPass2, - unix_vkCreateRenderPass2KHR, - unix_vkCreateSampler, - unix_vkCreateSamplerYcbcrConversion, - unix_vkCreateSamplerYcbcrConversionKHR, - unix_vkCreateSemaphore, - unix_vkCreateShaderModule, - unix_vkCreateShadersEXT, - unix_vkCreateSwapchainKHR, - unix_vkCreateValidationCacheEXT, - unix_vkCreateWin32SurfaceKHR, - unix_vkDebugMarkerSetObjectNameEXT, - unix_vkDebugMarkerSetObjectTagEXT, - unix_vkDebugReportMessageEXT, - unix_vkDeferredOperationJoinKHR, - unix_vkDestroyAccelerationStructureKHR, - unix_vkDestroyAccelerationStructureNV, - unix_vkDestroyBuffer, - unix_vkDestroyBufferView, - unix_vkDestroyCommandPool, - unix_vkDestroyCuFunctionNVX, - unix_vkDestroyCuModuleNVX, - unix_vkDestroyCudaFunctionNV, - unix_vkDestroyCudaModuleNV, - unix_vkDestroyDebugReportCallbackEXT, - unix_vkDestroyDebugUtilsMessengerEXT, - unix_vkDestroyDeferredOperationKHR, - unix_vkDestroyDescriptorPool, - unix_vkDestroyDescriptorSetLayout, - unix_vkDestroyDescriptorUpdateTemplate, - unix_vkDestroyDescriptorUpdateTemplateKHR, - unix_vkDestroyDevice, - unix_vkDestroyEvent, - unix_vkDestroyFence, - unix_vkDestroyFramebuffer, - unix_vkDestroyImage, - unix_vkDestroyImageView, - unix_vkDestroyIndirectCommandsLayoutNV, - unix_vkDestroyInstance, - unix_vkDestroyMicromapEXT, - unix_vkDestroyOpticalFlowSessionNV, - unix_vkDestroyPipeline, - unix_vkDestroyPipelineCache, - unix_vkDestroyPipelineLayout, - unix_vkDestroyPrivateDataSlot, - unix_vkDestroyPrivateDataSlotEXT, - unix_vkDestroyQueryPool, - unix_vkDestroyRenderPass, - unix_vkDestroySampler, - unix_vkDestroySamplerYcbcrConversion, - unix_vkDestroySamplerYcbcrConversionKHR, - unix_vkDestroySemaphore, - unix_vkDestroyShaderEXT, - unix_vkDestroyShaderModule, - unix_vkDestroySurfaceKHR, - unix_vkDestroySwapchainKHR, - unix_vkDestroyValidationCacheEXT, - unix_vkDeviceWaitIdle, - unix_vkEndCommandBuffer, - unix_vkEnumerateDeviceExtensionProperties, - unix_vkEnumerateDeviceLayerProperties, - unix_vkEnumerateInstanceExtensionProperties, - unix_vkEnumerateInstanceVersion, - unix_vkEnumeratePhysicalDeviceGroups, - unix_vkEnumeratePhysicalDeviceGroupsKHR, - unix_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - unix_vkEnumeratePhysicalDevices, - unix_vkFlushMappedMemoryRanges, - unix_vkFreeCommandBuffers, - unix_vkFreeDescriptorSets, - unix_vkFreeMemory, - unix_vkGetAccelerationStructureBuildSizesKHR, - unix_vkGetAccelerationStructureDeviceAddressKHR, - unix_vkGetAccelerationStructureHandleNV, - unix_vkGetAccelerationStructureMemoryRequirementsNV, - unix_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - unix_vkGetBufferDeviceAddress, - unix_vkGetBufferDeviceAddressEXT, - unix_vkGetBufferDeviceAddressKHR, - unix_vkGetBufferMemoryRequirements, - unix_vkGetBufferMemoryRequirements2, - unix_vkGetBufferMemoryRequirements2KHR, - unix_vkGetBufferOpaqueCaptureAddress, - unix_vkGetBufferOpaqueCaptureAddressKHR, - unix_vkGetBufferOpaqueCaptureDescriptorDataEXT, - unix_vkGetCalibratedTimestampsEXT, - unix_vkGetCudaModuleCacheNV, - unix_vkGetDeferredOperationMaxConcurrencyKHR, - unix_vkGetDeferredOperationResultKHR, - unix_vkGetDescriptorEXT, - unix_vkGetDescriptorSetHostMappingVALVE, - unix_vkGetDescriptorSetLayoutBindingOffsetEXT, - unix_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - unix_vkGetDescriptorSetLayoutSizeEXT, - unix_vkGetDescriptorSetLayoutSupport, - unix_vkGetDescriptorSetLayoutSupportKHR, - unix_vkGetDeviceAccelerationStructureCompatibilityKHR, - unix_vkGetDeviceBufferMemoryRequirements, - unix_vkGetDeviceBufferMemoryRequirementsKHR, - unix_vkGetDeviceFaultInfoEXT, - unix_vkGetDeviceGroupPeerMemoryFeatures, - unix_vkGetDeviceGroupPeerMemoryFeaturesKHR, - unix_vkGetDeviceGroupPresentCapabilitiesKHR, - unix_vkGetDeviceGroupSurfacePresentModesKHR, - unix_vkGetDeviceImageMemoryRequirements, - unix_vkGetDeviceImageMemoryRequirementsKHR, - unix_vkGetDeviceImageSparseMemoryRequirements, - unix_vkGetDeviceImageSparseMemoryRequirementsKHR, - unix_vkGetDeviceImageSubresourceLayoutKHR, - unix_vkGetDeviceMemoryCommitment, - unix_vkGetDeviceMemoryOpaqueCaptureAddress, - unix_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - unix_vkGetDeviceMicromapCompatibilityEXT, - unix_vkGetDeviceQueue, - unix_vkGetDeviceQueue2, - unix_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - unix_vkGetDynamicRenderingTilePropertiesQCOM, - unix_vkGetEventStatus, - unix_vkGetFenceStatus, - unix_vkGetFramebufferTilePropertiesQCOM, - unix_vkGetGeneratedCommandsMemoryRequirementsNV, - unix_vkGetImageMemoryRequirements, - unix_vkGetImageMemoryRequirements2, - unix_vkGetImageMemoryRequirements2KHR, - unix_vkGetImageOpaqueCaptureDescriptorDataEXT, - unix_vkGetImageSparseMemoryRequirements, - unix_vkGetImageSparseMemoryRequirements2, - unix_vkGetImageSparseMemoryRequirements2KHR, - unix_vkGetImageSubresourceLayout, - unix_vkGetImageSubresourceLayout2EXT, - unix_vkGetImageSubresourceLayout2KHR, - unix_vkGetImageViewAddressNVX, - unix_vkGetImageViewHandleNVX, - unix_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - unix_vkGetLatencyTimingsNV, - unix_vkGetMemoryHostPointerPropertiesEXT, - unix_vkGetMicromapBuildSizesEXT, - unix_vkGetPerformanceParameterINTEL, - unix_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - unix_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - unix_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - unix_vkGetPhysicalDeviceExternalBufferProperties, - unix_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - unix_vkGetPhysicalDeviceExternalFenceProperties, - unix_vkGetPhysicalDeviceExternalFencePropertiesKHR, - unix_vkGetPhysicalDeviceExternalSemaphoreProperties, - unix_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - unix_vkGetPhysicalDeviceFeatures, - unix_vkGetPhysicalDeviceFeatures2, - unix_vkGetPhysicalDeviceFeatures2KHR, - unix_vkGetPhysicalDeviceFormatProperties, - unix_vkGetPhysicalDeviceFormatProperties2, - unix_vkGetPhysicalDeviceFormatProperties2KHR, - unix_vkGetPhysicalDeviceFragmentShadingRatesKHR, - unix_vkGetPhysicalDeviceImageFormatProperties, - unix_vkGetPhysicalDeviceImageFormatProperties2, - unix_vkGetPhysicalDeviceImageFormatProperties2KHR, - unix_vkGetPhysicalDeviceMemoryProperties, - unix_vkGetPhysicalDeviceMemoryProperties2, - unix_vkGetPhysicalDeviceMemoryProperties2KHR, - unix_vkGetPhysicalDeviceMultisamplePropertiesEXT, - unix_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - unix_vkGetPhysicalDevicePresentRectanglesKHR, - unix_vkGetPhysicalDeviceProperties, - unix_vkGetPhysicalDeviceProperties2, - unix_vkGetPhysicalDeviceProperties2KHR, - unix_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - unix_vkGetPhysicalDeviceQueueFamilyProperties, - unix_vkGetPhysicalDeviceQueueFamilyProperties2, - unix_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - unix_vkGetPhysicalDeviceSparseImageFormatProperties, - unix_vkGetPhysicalDeviceSparseImageFormatProperties2, - unix_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - unix_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - unix_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - unix_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - unix_vkGetPhysicalDeviceSurfaceFormats2KHR, - unix_vkGetPhysicalDeviceSurfaceFormatsKHR, - unix_vkGetPhysicalDeviceSurfacePresentModesKHR, - unix_vkGetPhysicalDeviceSurfaceSupportKHR, - unix_vkGetPhysicalDeviceToolProperties, - unix_vkGetPhysicalDeviceToolPropertiesEXT, - unix_vkGetPhysicalDeviceWin32PresentationSupportKHR, - unix_vkGetPipelineCacheData, - unix_vkGetPipelineExecutableInternalRepresentationsKHR, - unix_vkGetPipelineExecutablePropertiesKHR, - unix_vkGetPipelineExecutableStatisticsKHR, - unix_vkGetPipelineIndirectDeviceAddressNV, - unix_vkGetPipelineIndirectMemoryRequirementsNV, - unix_vkGetPipelinePropertiesEXT, - unix_vkGetPrivateData, - unix_vkGetPrivateDataEXT, - unix_vkGetQueryPoolResults, - unix_vkGetQueueCheckpointData2NV, - unix_vkGetQueueCheckpointDataNV, - unix_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - unix_vkGetRayTracingShaderGroupHandlesKHR, - unix_vkGetRayTracingShaderGroupHandlesNV, - unix_vkGetRayTracingShaderGroupStackSizeKHR, - unix_vkGetRenderAreaGranularity, - unix_vkGetRenderingAreaGranularityKHR, - unix_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - unix_vkGetSemaphoreCounterValue, - unix_vkGetSemaphoreCounterValueKHR, - unix_vkGetShaderBinaryDataEXT, - unix_vkGetShaderInfoAMD, - unix_vkGetShaderModuleCreateInfoIdentifierEXT, - unix_vkGetShaderModuleIdentifierEXT, - unix_vkGetSwapchainImagesKHR, - unix_vkGetValidationCacheDataEXT, - unix_vkInitializePerformanceApiINTEL, - unix_vkInvalidateMappedMemoryRanges, - unix_vkLatencySleepNV, - unix_vkMapMemory, - unix_vkMapMemory2KHR, - unix_vkMergePipelineCaches, - unix_vkMergeValidationCachesEXT, - unix_vkQueueBeginDebugUtilsLabelEXT, - unix_vkQueueBindSparse, - unix_vkQueueEndDebugUtilsLabelEXT, - unix_vkQueueInsertDebugUtilsLabelEXT, - unix_vkQueueNotifyOutOfBandNV, - unix_vkQueuePresentKHR, - unix_vkQueueSetPerformanceConfigurationINTEL, - unix_vkQueueSubmit, - unix_vkQueueSubmit2, - unix_vkQueueSubmit2KHR, - unix_vkQueueWaitIdle, - unix_vkReleasePerformanceConfigurationINTEL, - unix_vkReleaseProfilingLockKHR, - unix_vkReleaseSwapchainImagesEXT, - unix_vkResetCommandBuffer, - unix_vkResetCommandPool, - unix_vkResetDescriptorPool, - unix_vkResetEvent, - unix_vkResetFences, - unix_vkResetQueryPool, - unix_vkResetQueryPoolEXT, - unix_vkSetDebugUtilsObjectNameEXT, - unix_vkSetDebugUtilsObjectTagEXT, - unix_vkSetDeviceMemoryPriorityEXT, - unix_vkSetEvent, - unix_vkSetHdrMetadataEXT, - unix_vkSetLatencyMarkerNV, - unix_vkSetLatencySleepModeNV, - unix_vkSetPrivateData, - unix_vkSetPrivateDataEXT, - unix_vkSignalSemaphore, - unix_vkSignalSemaphoreKHR, - unix_vkSubmitDebugUtilsMessageEXT, - unix_vkTransitionImageLayoutEXT, - unix_vkTrimCommandPool, - unix_vkTrimCommandPoolKHR, - unix_vkUninitializePerformanceApiINTEL, - unix_vkUnmapMemory, - unix_vkUnmapMemory2KHR, - unix_vkUpdateDescriptorSetWithTemplate, - unix_vkUpdateDescriptorSetWithTemplateKHR, - unix_vkUpdateDescriptorSets, - unix_vkWaitForFences, - unix_vkWaitForPresentKHR, - unix_vkWaitSemaphores, - unix_vkWaitSemaphoresKHR, - unix_vkWriteAccelerationStructuresPropertiesKHR, - unix_vkWriteMicromapsPropertiesEXT, - unix_count, -}; - -struct vkAcquireNextImage2KHR_params -{ - VkDevice device; - const VkAcquireNextImageInfoKHR *pAcquireInfo; - uint32_t *pImageIndex; - VkResult result; -}; - -struct vkAcquireNextImageKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - uint32_t *pImageIndex; - VkResult result; -}; - -struct vkAcquirePerformanceConfigurationINTEL_params -{ - VkDevice device; - const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo; - VkPerformanceConfigurationINTEL *pConfiguration; - VkResult result; -}; - -struct vkAcquireProfilingLockKHR_params -{ - VkDevice device; - const VkAcquireProfilingLockInfoKHR *pInfo; - VkResult result; -}; - -struct vkAllocateCommandBuffers_params -{ - VkDevice device; - const VkCommandBufferAllocateInfo *pAllocateInfo; - VkCommandBuffer *pCommandBuffers; - VkResult result; -}; - -struct vkAllocateDescriptorSets_params -{ - VkDevice device; - const VkDescriptorSetAllocateInfo *pAllocateInfo; - VkDescriptorSet *pDescriptorSets; - VkResult result; -}; - -struct vkAllocateMemory_params -{ - VkDevice device; - const VkMemoryAllocateInfo *pAllocateInfo; - const VkAllocationCallbacks *pAllocator; - VkDeviceMemory *pMemory; - VkResult result; -}; - -struct vkBeginCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - const VkCommandBufferBeginInfo *pBeginInfo; - VkResult result; -}; - -struct vkBindAccelerationStructureMemoryNV_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos; - VkResult result; -}; - -struct vkBindBufferMemory_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; -}; - -struct vkBindBufferMemory2_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindBufferMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindBufferMemory2KHR_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindBufferMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindImageMemory_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; -}; - -struct vkBindImageMemory2_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindImageMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindImageMemory2KHR_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindImageMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindOpticalFlowSessionImageNV_params -{ - VkDevice device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - VkOpticalFlowSessionBindingPointNV bindingPoint; - VkImageView DECLSPEC_ALIGN(8) view; - VkImageLayout layout; - VkResult result; -}; - -struct vkBuildAccelerationStructuresKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos; - VkResult result; -}; - -struct vkBuildMicromapsEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - const VkMicromapBuildInfoEXT *pInfos; - VkResult result; -}; - -struct vkCmdBeginConditionalRenderingEXT_params -{ - VkCommandBuffer commandBuffer; - const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin; -}; - -struct vkCmdBeginDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkCmdBeginQuery_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; -}; - -struct vkCmdBeginQueryIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - uint32_t index; -}; - -struct vkCmdBeginRenderPass_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - VkSubpassContents contents; -}; - -struct vkCmdBeginRenderPass2_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - const VkSubpassBeginInfo *pSubpassBeginInfo; -}; - -struct vkCmdBeginRenderPass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - const VkSubpassBeginInfo *pSubpassBeginInfo; -}; - -struct vkCmdBeginRendering_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInfo *pRenderingInfo; -}; - -struct vkCmdBeginRenderingKHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInfo *pRenderingInfo; -}; - -struct vkCmdBeginTransformFeedbackEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - const VkBuffer *pCounterBuffers; - const VkDeviceSize *pCounterBufferOffsets; -}; - -struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; -}; - -struct vkCmdBindDescriptorBuffersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t bufferCount; - const VkDescriptorBufferBindingInfoEXT *pBindingInfos; -}; - -struct vkCmdBindDescriptorSets_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - const VkDescriptorSet *pDescriptorSets; - uint32_t dynamicOffsetCount; - const uint32_t *pDynamicOffsets; -}; - -struct vkCmdBindIndexBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkIndexType indexType; -}; - -struct vkCmdBindIndexBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; -}; - -struct vkCmdBindInvocationMaskHUAWEI_params -{ - VkCommandBuffer commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -}; - -struct vkCmdBindPipeline_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -}; - -struct vkCmdBindPipelineShaderGroupNV_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t groupIndex; -}; - -struct vkCmdBindShadersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t stageCount; - const VkShaderStageFlagBits *pStages; - const VkShaderEXT *pShaders; -}; - -struct vkCmdBindShadingRateImageNV_params -{ - VkCommandBuffer commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -}; - -struct vkCmdBindTransformFeedbackBuffersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; -}; - -struct vkCmdBindVertexBuffers_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; -}; - -struct vkCmdBindVertexBuffers2_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; - const VkDeviceSize *pStrides; -}; - -struct vkCmdBindVertexBuffers2EXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; - const VkDeviceSize *pStrides; -}; - -struct vkCmdBlitImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageBlit *pRegions; - VkFilter filter; -}; - -struct vkCmdBlitImage2_params -{ - VkCommandBuffer commandBuffer; - const VkBlitImageInfo2 *pBlitImageInfo; -}; - -struct vkCmdBlitImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkBlitImageInfo2 *pBlitImageInfo; -}; - -struct vkCmdBuildAccelerationStructureNV_params -{ - VkCommandBuffer commandBuffer; - const VkAccelerationStructureInfoNV *pInfo; - VkBuffer DECLSPEC_ALIGN(8) instanceData; - VkDeviceSize DECLSPEC_ALIGN(8) instanceOffset; - VkBool32 update; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkBuffer DECLSPEC_ALIGN(8) scratch; - VkDeviceSize DECLSPEC_ALIGN(8) scratchOffset; -}; - -struct vkCmdBuildAccelerationStructuresIndirectKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkDeviceAddress *pIndirectDeviceAddresses; - const uint32_t *pIndirectStrides; - const uint32_t * const*ppMaxPrimitiveCounts; -}; - -struct vkCmdBuildAccelerationStructuresKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos; -}; - -struct vkCmdBuildMicromapsEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkMicromapBuildInfoEXT *pInfos; -}; - -struct vkCmdClearAttachments_params -{ - VkCommandBuffer commandBuffer; - uint32_t attachmentCount; - const VkClearAttachment *pAttachments; - uint32_t rectCount; - const VkClearRect *pRects; -}; - -struct vkCmdClearColorImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - const VkClearColorValue *pColor; - uint32_t rangeCount; - const VkImageSubresourceRange *pRanges; -}; - -struct vkCmdClearDepthStencilImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - const VkClearDepthStencilValue *pDepthStencil; - uint32_t rangeCount; - const VkImageSubresourceRange *pRanges; -}; - -struct vkCmdCopyAccelerationStructureKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyAccelerationStructureInfoKHR *pInfo; -}; - -struct vkCmdCopyAccelerationStructureNV_params -{ - VkCommandBuffer commandBuffer; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkCopyAccelerationStructureModeKHR mode; -}; - -struct vkCmdCopyAccelerationStructureToMemoryKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo; -}; - -struct vkCmdCopyBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferCopy *pRegions; -}; - -struct vkCmdCopyBuffer2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferInfo2 *pCopyBufferInfo; -}; - -struct vkCmdCopyBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferInfo2 *pCopyBufferInfo; -}; - -struct vkCmdCopyBufferToImage_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkBufferImageCopy *pRegions; -}; - -struct vkCmdCopyBufferToImage2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo; -}; - -struct vkCmdCopyBufferToImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo; -}; - -struct vkCmdCopyImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy *pRegions; -}; - -struct vkCmdCopyImage2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageInfo2 *pCopyImageInfo; -}; - -struct vkCmdCopyImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageInfo2 *pCopyImageInfo; -}; - -struct vkCmdCopyImageToBuffer_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferImageCopy *pRegions; -}; - -struct vkCmdCopyImageToBuffer2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo; -}; - -struct vkCmdCopyImageToBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo; -}; - -struct vkCmdCopyMemoryIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; -}; - -struct vkCmdCopyMemoryToAccelerationStructureKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo; -}; - -struct vkCmdCopyMemoryToImageIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - const VkImageSubresourceLayers *pImageSubresources; -}; - -struct vkCmdCopyMemoryToMicromapEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMemoryToMicromapInfoEXT *pInfo; -}; - -struct vkCmdCopyMicromapEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMicromapInfoEXT *pInfo; -}; - -struct vkCmdCopyMicromapToMemoryEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMicromapToMemoryInfoEXT *pInfo; -}; - -struct vkCmdCopyQueryPoolResults_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; -}; - -struct vkCmdCuLaunchKernelNVX_params -{ - VkCommandBuffer commandBuffer; - const VkCuLaunchInfoNVX *pLaunchInfo; -}; - -struct vkCmdCudaLaunchKernelNV_params -{ - VkCommandBuffer commandBuffer; - const VkCudaLaunchInfoNV *pLaunchInfo; -}; - -struct vkCmdDebugMarkerBeginEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugMarkerMarkerInfoEXT *pMarkerInfo; -}; - -struct vkCmdDebugMarkerEndEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdDebugMarkerInsertEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugMarkerMarkerInfoEXT *pMarkerInfo; -}; - -struct vkCmdDecompressMemoryIndirectCountNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsCountAddress; - uint32_t stride; -}; - -struct vkCmdDecompressMemoryNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t decompressRegionCount; - const VkDecompressMemoryRegionNV *pDecompressMemoryRegions; -}; - -struct vkCmdDispatch_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchBase_params -{ - VkCommandBuffer commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchBaseKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -}; - -struct vkCmdDraw_params -{ - VkCommandBuffer commandBuffer; - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -}; - -struct vkCmdDrawClusterHUAWEI_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDrawClusterIndirectHUAWEI_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -}; - -struct vkCmdDrawIndexed_params -{ - VkCommandBuffer commandBuffer; - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -}; - -struct vkCmdDrawIndexedIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCount_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCountAMD_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCountKHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectByteCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t instanceCount; - uint32_t firstInstance; - VkBuffer DECLSPEC_ALIGN(8) counterBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) counterBufferOffset; - uint32_t counterOffset; - uint32_t vertexStride; -}; - -struct vkCmdDrawIndirectCount_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectCountAMD_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectCountKHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDrawMeshTasksIndirectCountEXT_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectCountNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectEXT_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t taskCount; - uint32_t firstTask; -}; - -struct vkCmdDrawMultiEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t drawCount; - const VkMultiDrawInfoEXT *pVertexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; -}; - -struct vkCmdDrawMultiIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t drawCount; - const VkMultiDrawIndexedInfoEXT *pIndexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - const int32_t *pVertexOffset; -}; - -struct vkCmdEndConditionalRenderingEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndQuery_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdEndQueryIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - uint32_t index; -}; - -struct vkCmdEndRenderPass_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndRenderPass2_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdEndRenderPass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdEndRendering_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndRenderingKHR_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndTransformFeedbackEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - const VkBuffer *pCounterBuffers; - const VkDeviceSize *pCounterBufferOffsets; -}; - -struct vkCmdExecuteCommands_params -{ - VkCommandBuffer commandBuffer; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; -}; - -struct vkCmdExecuteGeneratedCommandsNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 isPreprocessed; - const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo; -}; - -struct vkCmdFillBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - uint32_t data; -}; - -struct vkCmdInsertDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkCmdNextSubpass_params -{ - VkCommandBuffer commandBuffer; - VkSubpassContents contents; -}; - -struct vkCmdNextSubpass2_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassBeginInfo *pSubpassBeginInfo; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdNextSubpass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassBeginInfo *pSubpassBeginInfo; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdOpticalFlowExecuteNV_params -{ - VkCommandBuffer commandBuffer; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - const VkOpticalFlowExecuteInfoNV *pExecuteInfo; -}; - -struct vkCmdPipelineBarrier_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - const VkMemoryBarrier *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier *pImageMemoryBarriers; -}; - -struct vkCmdPipelineBarrier2_params -{ - VkCommandBuffer commandBuffer; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdPipelineBarrier2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdPreprocessGeneratedCommandsNV_params -{ - VkCommandBuffer commandBuffer; - const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo; -}; - -struct vkCmdPushConstants_params -{ - VkCommandBuffer commandBuffer; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - const void *pValues; -}; - -struct vkCmdPushDescriptorSetKHR_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; -}; - -struct vkCmdPushDescriptorSetWithTemplateKHR_params -{ - VkCommandBuffer commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - const void *pData; -}; - -struct vkCmdResetEvent_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; -}; - -struct vkCmdResetEvent2_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; -}; - -struct vkCmdResetEvent2KHR_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; -}; - -struct vkCmdResetQueryPool_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkCmdResolveImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageResolve *pRegions; -}; - -struct vkCmdResolveImage2_params -{ - VkCommandBuffer commandBuffer; - const VkResolveImageInfo2 *pResolveImageInfo; -}; - -struct vkCmdResolveImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkResolveImageInfo2 *pResolveImageInfo; -}; - -struct vkCmdSetAlphaToCoverageEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 alphaToCoverageEnable; -}; - -struct vkCmdSetAlphaToOneEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 alphaToOneEnable; -}; - -struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkImageAspectFlags aspectMask; -}; - -struct vkCmdSetBlendConstants_params -{ - VkCommandBuffer commandBuffer; - const float *blendConstants; -}; - -struct vkCmdSetCheckpointNV_params -{ - VkCommandBuffer commandBuffer; - const void *pCheckpointMarker; -}; - -struct vkCmdSetCoarseSampleOrderNV_params -{ - VkCommandBuffer commandBuffer; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders; -}; - -struct vkCmdSetColorBlendAdvancedEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorBlendAdvancedEXT *pColorBlendAdvanced; -}; - -struct vkCmdSetColorBlendEnableEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkBool32 *pColorBlendEnables; -}; - -struct vkCmdSetColorBlendEquationEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorBlendEquationEXT *pColorBlendEquations; -}; - -struct vkCmdSetColorWriteEnableEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t attachmentCount; - const VkBool32 *pColorWriteEnables; -}; - -struct vkCmdSetColorWriteMaskEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorComponentFlags *pColorWriteMasks; -}; - -struct vkCmdSetConservativeRasterizationModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; -}; - -struct vkCmdSetCoverageModulationModeNV_params -{ - VkCommandBuffer commandBuffer; - VkCoverageModulationModeNV coverageModulationMode; -}; - -struct vkCmdSetCoverageModulationTableEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 coverageModulationTableEnable; -}; - -struct vkCmdSetCoverageModulationTableNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t coverageModulationTableCount; - const float *pCoverageModulationTable; -}; - -struct vkCmdSetCoverageReductionModeNV_params -{ - VkCommandBuffer commandBuffer; - VkCoverageReductionModeNV coverageReductionMode; -}; - -struct vkCmdSetCoverageToColorEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 coverageToColorEnable; -}; - -struct vkCmdSetCoverageToColorLocationNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t coverageToColorLocation; -}; - -struct vkCmdSetCullMode_params -{ - VkCommandBuffer commandBuffer; - VkCullModeFlags cullMode; -}; - -struct vkCmdSetCullModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkCullModeFlags cullMode; -}; - -struct vkCmdSetDepthBias_params -{ - VkCommandBuffer commandBuffer; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -}; - -struct vkCmdSetDepthBias2EXT_params -{ - VkCommandBuffer commandBuffer; - const VkDepthBiasInfoEXT *pDepthBiasInfo; -}; - -struct vkCmdSetDepthBiasEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBiasEnable; -}; - -struct vkCmdSetDepthBiasEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBiasEnable; -}; - -struct vkCmdSetDepthBounds_params -{ - VkCommandBuffer commandBuffer; - float minDepthBounds; - float maxDepthBounds; -}; - -struct vkCmdSetDepthBoundsTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBoundsTestEnable; -}; - -struct vkCmdSetDepthBoundsTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBoundsTestEnable; -}; - -struct vkCmdSetDepthClampEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthClampEnable; -}; - -struct vkCmdSetDepthClipEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthClipEnable; -}; - -struct vkCmdSetDepthClipNegativeOneToOneEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 negativeOneToOne; -}; - -struct vkCmdSetDepthCompareOp_params -{ - VkCommandBuffer commandBuffer; - VkCompareOp depthCompareOp; -}; - -struct vkCmdSetDepthCompareOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkCompareOp depthCompareOp; -}; - -struct vkCmdSetDepthTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthTestEnable; -}; - -struct vkCmdSetDepthTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthTestEnable; -}; - -struct vkCmdSetDepthWriteEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthWriteEnable; -}; - -struct vkCmdSetDepthWriteEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthWriteEnable; -}; - -struct vkCmdSetDescriptorBufferOffsetsEXT_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - const uint32_t *pBufferIndices; - const VkDeviceSize *pOffsets; -}; - -struct vkCmdSetDeviceMask_params -{ - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -}; - -struct vkCmdSetDeviceMaskKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -}; - -struct vkCmdSetDiscardRectangleEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstDiscardRectangle; - uint32_t discardRectangleCount; - const VkRect2D *pDiscardRectangles; -}; - -struct vkCmdSetDiscardRectangleEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 discardRectangleEnable; -}; - -struct vkCmdSetDiscardRectangleModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkDiscardRectangleModeEXT discardRectangleMode; -}; - -struct vkCmdSetEvent_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; -}; - -struct vkCmdSetEvent2_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdSetEvent2KHR_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdSetExclusiveScissorEnableNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - const VkBool32 *pExclusiveScissorEnables; -}; - -struct vkCmdSetExclusiveScissorNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - const VkRect2D *pExclusiveScissors; -}; - -struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params -{ - VkCommandBuffer commandBuffer; - float extraPrimitiveOverestimationSize; -}; - -struct vkCmdSetFragmentShadingRateEnumNV_params -{ - VkCommandBuffer commandBuffer; - VkFragmentShadingRateNV shadingRate; - const VkFragmentShadingRateCombinerOpKHR *combinerOps; -}; - -struct vkCmdSetFragmentShadingRateKHR_params -{ - VkCommandBuffer commandBuffer; - const VkExtent2D *pFragmentSize; - const VkFragmentShadingRateCombinerOpKHR *combinerOps; -}; - -struct vkCmdSetFrontFace_params -{ - VkCommandBuffer commandBuffer; - VkFrontFace frontFace; -}; - -struct vkCmdSetFrontFaceEXT_params -{ - VkCommandBuffer commandBuffer; - VkFrontFace frontFace; -}; - -struct vkCmdSetLineRasterizationModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkLineRasterizationModeEXT lineRasterizationMode; -}; - -struct vkCmdSetLineStippleEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -}; - -struct vkCmdSetLineStippleEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stippledLineEnable; -}; - -struct vkCmdSetLineWidth_params -{ - VkCommandBuffer commandBuffer; - float lineWidth; -}; - -struct vkCmdSetLogicOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkLogicOp logicOp; -}; - -struct vkCmdSetLogicOpEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 logicOpEnable; -}; - -struct vkCmdSetPatchControlPointsEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t patchControlPoints; -}; - -struct vkCmdSetPerformanceMarkerINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceMarkerInfoINTEL *pMarkerInfo; - VkResult result; -}; - -struct vkCmdSetPerformanceOverrideINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceOverrideInfoINTEL *pOverrideInfo; - VkResult result; -}; - -struct vkCmdSetPerformanceStreamMarkerINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo; - VkResult result; -}; - -struct vkCmdSetPolygonModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkPolygonMode polygonMode; -}; - -struct vkCmdSetPrimitiveRestartEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 primitiveRestartEnable; -}; - -struct vkCmdSetPrimitiveRestartEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 primitiveRestartEnable; -}; - -struct vkCmdSetPrimitiveTopology_params -{ - VkCommandBuffer commandBuffer; - VkPrimitiveTopology primitiveTopology; -}; - -struct vkCmdSetPrimitiveTopologyEXT_params -{ - VkCommandBuffer commandBuffer; - VkPrimitiveTopology primitiveTopology; -}; - -struct vkCmdSetProvokingVertexModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkProvokingVertexModeEXT provokingVertexMode; -}; - -struct vkCmdSetRasterizationSamplesEXT_params -{ - VkCommandBuffer commandBuffer; - VkSampleCountFlagBits rasterizationSamples; -}; - -struct vkCmdSetRasterizationStreamEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t rasterizationStream; -}; - -struct vkCmdSetRasterizerDiscardEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 rasterizerDiscardEnable; -}; - -struct vkCmdSetRasterizerDiscardEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 rasterizerDiscardEnable; -}; - -struct vkCmdSetRayTracingPipelineStackSizeKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t pipelineStackSize; -}; - -struct vkCmdSetRepresentativeFragmentTestEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 representativeFragmentTestEnable; -}; - -struct vkCmdSetSampleLocationsEXT_params -{ - VkCommandBuffer commandBuffer; - const VkSampleLocationsInfoEXT *pSampleLocationsInfo; -}; - -struct vkCmdSetSampleLocationsEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 sampleLocationsEnable; -}; - -struct vkCmdSetSampleMaskEXT_params -{ - VkCommandBuffer commandBuffer; - VkSampleCountFlagBits samples; - const VkSampleMask *pSampleMask; -}; - -struct vkCmdSetScissor_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstScissor; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetScissorWithCount_params -{ - VkCommandBuffer commandBuffer; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetScissorWithCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetShadingRateImageEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 shadingRateImageEnable; -}; - -struct vkCmdSetStencilCompareMask_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t compareMask; -}; - -struct vkCmdSetStencilOp_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; -}; - -struct vkCmdSetStencilOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; -}; - -struct vkCmdSetStencilReference_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t reference; -}; - -struct vkCmdSetStencilTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stencilTestEnable; -}; - -struct vkCmdSetStencilTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stencilTestEnable; -}; - -struct vkCmdSetStencilWriteMask_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t writeMask; -}; - -struct vkCmdSetTessellationDomainOriginEXT_params -{ - VkCommandBuffer commandBuffer; - VkTessellationDomainOrigin domainOrigin; -}; - -struct vkCmdSetVertexInputEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions; -}; - -struct vkCmdSetViewport_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSetViewportShadingRatePaletteNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkShadingRatePaletteNV *pShadingRatePalettes; -}; - -struct vkCmdSetViewportSwizzleNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewportSwizzleNV *pViewportSwizzles; -}; - -struct vkCmdSetViewportWScalingEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 viewportWScalingEnable; -}; - -struct vkCmdSetViewportWScalingNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewportWScalingNV *pViewportWScalings; -}; - -struct vkCmdSetViewportWithCount_params -{ - VkCommandBuffer commandBuffer; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSetViewportWithCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSubpassShadingHUAWEI_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdTraceRaysIndirect2KHR_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; -}; - -struct vkCmdTraceRaysIndirectKHR_params -{ - VkCommandBuffer commandBuffer; - const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; -}; - -struct vkCmdTraceRaysKHR_params -{ - VkCommandBuffer commandBuffer; - const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable; - uint32_t width; - uint32_t height; - uint32_t depth; -}; - -struct vkCmdTraceRaysNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) raygenShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) raygenShaderBindingOffset; - VkBuffer DECLSPEC_ALIGN(8) missShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) hitShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) callableShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingStride; - uint32_t width; - uint32_t height; - uint32_t depth; -}; - -struct vkCmdUpdateBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dataSize; - const void *pData; -}; - -struct vkCmdUpdatePipelineIndirectBufferNV_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -}; - -struct vkCmdWaitEvents_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - uint32_t memoryBarrierCount; - const VkMemoryBarrier *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier *pImageMemoryBarriers; -}; - -struct vkCmdWaitEvents2_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - const VkDependencyInfo *pDependencyInfos; -}; - -struct vkCmdWaitEvents2KHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - const VkDependencyInfo *pDependencyInfos; -}; - -struct vkCmdWriteAccelerationStructuresPropertiesKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteAccelerationStructuresPropertiesNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t accelerationStructureCount; - const VkAccelerationStructureNV *pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteBufferMarker2AMD_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; -}; - -struct vkCmdWriteBufferMarkerAMD_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; -}; - -struct vkCmdWriteMicromapsPropertiesEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t micromapCount; - const VkMicromapEXT *pMicromaps; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteTimestamp_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdWriteTimestamp2_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdWriteTimestamp2KHR_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCompileDeferredNV_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t shader; - VkResult result; -}; - -struct vkCopyAccelerationStructureKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyAccelerationStructureInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyAccelerationStructureToMemoryKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyImageToImageEXT_params -{ - VkDevice device; - const VkCopyImageToImageInfoEXT *pCopyImageToImageInfo; - VkResult result; -}; - -struct vkCopyImageToMemoryEXT_params -{ - VkDevice device; - const VkCopyImageToMemoryInfoEXT *pCopyImageToMemoryInfo; - VkResult result; -}; - -struct vkCopyMemoryToAccelerationStructureKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyMemoryToImageEXT_params -{ - VkDevice device; - const VkCopyMemoryToImageInfoEXT *pCopyMemoryToImageInfo; - VkResult result; -}; - -struct vkCopyMemoryToMicromapEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMemoryToMicromapInfoEXT *pInfo; - VkResult result; -}; - -struct vkCopyMicromapEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMicromapInfoEXT *pInfo; - VkResult result; -}; - -struct vkCopyMicromapToMemoryEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMicromapToMemoryInfoEXT *pInfo; - VkResult result; -}; - -struct vkCreateAccelerationStructureKHR_params -{ - VkDevice device; - const VkAccelerationStructureCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkAccelerationStructureKHR *pAccelerationStructure; - VkResult result; -}; - -struct vkCreateAccelerationStructureNV_params -{ - VkDevice device; - const VkAccelerationStructureCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkAccelerationStructureNV *pAccelerationStructure; - VkResult result; -}; - -struct vkCreateBuffer_params -{ - VkDevice device; - const VkBufferCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkBuffer *pBuffer; - VkResult result; -}; - -struct vkCreateBufferView_params -{ - VkDevice device; - const VkBufferViewCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkBufferView *pView; - VkResult result; -}; - -struct vkCreateCommandPool_params -{ - VkDevice device; - const VkCommandPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCommandPool *pCommandPool; - void *client_ptr; - VkResult result; -}; - -struct vkCreateComputePipelines_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkComputePipelineCreateInfo *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateCuFunctionNVX_params -{ - VkDevice device; - const VkCuFunctionCreateInfoNVX *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCuFunctionNVX *pFunction; - VkResult result; -}; - -struct vkCreateCuModuleNVX_params -{ - VkDevice device; - const VkCuModuleCreateInfoNVX *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCuModuleNVX *pModule; - VkResult result; -}; - -struct vkCreateCudaFunctionNV_params -{ - VkDevice device; - const VkCudaFunctionCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCudaFunctionNV *pFunction; - VkResult result; -}; - -struct vkCreateCudaModuleNV_params -{ - VkDevice device; - const VkCudaModuleCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCudaModuleNV *pModule; - VkResult result; -}; - -struct vkCreateDebugReportCallbackEXT_params -{ - VkInstance instance; - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDebugReportCallbackEXT *pCallback; - VkResult result; -}; - -struct vkCreateDebugUtilsMessengerEXT_params -{ - VkInstance instance; - const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDebugUtilsMessengerEXT *pMessenger; - VkResult result; -}; - -struct vkCreateDeferredOperationKHR_params -{ - VkDevice device; - const VkAllocationCallbacks *pAllocator; - VkDeferredOperationKHR *pDeferredOperation; - VkResult result; -}; - -struct vkCreateDescriptorPool_params -{ - VkDevice device; - const VkDescriptorPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorPool *pDescriptorPool; - VkResult result; -}; - -struct vkCreateDescriptorSetLayout_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorSetLayout *pSetLayout; - VkResult result; -}; - -struct vkCreateDescriptorUpdateTemplate_params -{ - VkDevice device; - const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate; - VkResult result; -}; - -struct vkCreateDescriptorUpdateTemplateKHR_params -{ - VkDevice device; - const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate; - VkResult result; -}; - -struct vkCreateDevice_params -{ - VkPhysicalDevice physicalDevice; - const VkDeviceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDevice *pDevice; - void *client_ptr; - VkResult result; -}; - -struct vkCreateEvent_params -{ - VkDevice device; - const VkEventCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkEvent *pEvent; - VkResult result; -}; - -struct vkCreateFence_params -{ - VkDevice device; - const VkFenceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkFence *pFence; - VkResult result; -}; - -struct vkCreateFramebuffer_params -{ - VkDevice device; - const VkFramebufferCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkFramebuffer *pFramebuffer; - VkResult result; -}; - -struct vkCreateGraphicsPipelines_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkGraphicsPipelineCreateInfo *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateImage_params -{ - VkDevice device; - const VkImageCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkImage *pImage; - VkResult result; -}; - -struct vkCreateImageView_params -{ - VkDevice device; - const VkImageViewCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkImageView *pView; - VkResult result; -}; - -struct vkCreateIndirectCommandsLayoutNV_params -{ - VkDevice device; - const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkIndirectCommandsLayoutNV *pIndirectCommandsLayout; - VkResult result; -}; - -struct vkCreateInstance_params -{ - const VkInstanceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkInstance *pInstance; - void *client_ptr; - VkResult result; -}; - -struct vkCreateMicromapEXT_params -{ - VkDevice device; - const VkMicromapCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkMicromapEXT *pMicromap; - VkResult result; -}; - -struct vkCreateOpticalFlowSessionNV_params -{ - VkDevice device; - const VkOpticalFlowSessionCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkOpticalFlowSessionNV *pSession; - VkResult result; -}; - -struct vkCreatePipelineCache_params -{ - VkDevice device; - const VkPipelineCacheCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPipelineCache *pPipelineCache; - VkResult result; -}; - -struct vkCreatePipelineLayout_params -{ - VkDevice device; - const VkPipelineLayoutCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPipelineLayout *pPipelineLayout; - VkResult result; -}; - -struct vkCreatePrivateDataSlot_params -{ - VkDevice device; - const VkPrivateDataSlotCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPrivateDataSlot *pPrivateDataSlot; - VkResult result; -}; - -struct vkCreatePrivateDataSlotEXT_params -{ - VkDevice device; - const VkPrivateDataSlotCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPrivateDataSlot *pPrivateDataSlot; - VkResult result; -}; - -struct vkCreateQueryPool_params -{ - VkDevice device; - const VkQueryPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkQueryPool *pQueryPool; - VkResult result; -}; - -struct vkCreateRayTracingPipelinesKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateRayTracingPipelinesNV_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateRenderPass_params -{ - VkDevice device; - const VkRenderPassCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateRenderPass2_params -{ - VkDevice device; - const VkRenderPassCreateInfo2 *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateRenderPass2KHR_params -{ - VkDevice device; - const VkRenderPassCreateInfo2 *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateSampler_params -{ - VkDevice device; - const VkSamplerCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSampler *pSampler; - VkResult result; -}; - -struct vkCreateSamplerYcbcrConversion_params -{ - VkDevice device; - const VkSamplerYcbcrConversionCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSamplerYcbcrConversion *pYcbcrConversion; - VkResult result; -}; - -struct vkCreateSamplerYcbcrConversionKHR_params -{ - VkDevice device; - const VkSamplerYcbcrConversionCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSamplerYcbcrConversion *pYcbcrConversion; - VkResult result; -}; - -struct vkCreateSemaphore_params -{ - VkDevice device; - const VkSemaphoreCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSemaphore *pSemaphore; - VkResult result; -}; - -struct vkCreateShaderModule_params -{ - VkDevice device; - const VkShaderModuleCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkShaderModule *pShaderModule; - VkResult result; -}; - -struct vkCreateShadersEXT_params -{ - VkDevice device; - uint32_t createInfoCount; - const VkShaderCreateInfoEXT *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkShaderEXT *pShaders; - VkResult result; -}; - -struct vkCreateSwapchainKHR_params -{ - VkDevice device; - const VkSwapchainCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSwapchainKHR *pSwapchain; - VkResult result; -}; - -struct vkCreateValidationCacheEXT_params -{ - VkDevice device; - const VkValidationCacheCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkValidationCacheEXT *pValidationCache; - VkResult result; -}; - -struct vkCreateWin32SurfaceKHR_params -{ - VkInstance instance; - const VkWin32SurfaceCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSurfaceKHR *pSurface; - VkResult result; -}; - -struct vkDebugMarkerSetObjectNameEXT_params -{ - VkDevice device; - const VkDebugMarkerObjectNameInfoEXT *pNameInfo; - VkResult result; -}; - -struct vkDebugMarkerSetObjectTagEXT_params -{ - VkDevice device; - const VkDebugMarkerObjectTagInfoEXT *pTagInfo; - VkResult result; -}; - -struct vkDebugReportMessageEXT_params -{ - VkInstance instance; - VkDebugReportFlagsEXT flags; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - size_t location; - int32_t messageCode; - const char *pLayerPrefix; - const char *pMessage; -}; - -struct vkDeferredOperationJoinKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; -}; - -struct vkDestroyAccelerationStructureKHR_params -{ - VkDevice device; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyAccelerationStructureNV_params -{ - VkDevice device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyBuffer_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyBufferView_params -{ - VkDevice device; - VkBufferView DECLSPEC_ALIGN(8) bufferView; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCuFunctionNVX_params -{ - VkDevice device; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCuModuleNVX_params -{ - VkDevice device; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCudaFunctionNV_params -{ - VkDevice device; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCudaModuleNV_params -{ - VkDevice device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDebugReportCallbackEXT_params -{ - VkInstance instance; - VkDebugReportCallbackEXT DECLSPEC_ALIGN(8) callback; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDebugUtilsMessengerEXT_params -{ - VkInstance instance; - VkDebugUtilsMessengerEXT DECLSPEC_ALIGN(8) messenger; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDeferredOperationKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorPool_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorSetLayout_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorUpdateTemplate_params -{ - VkDevice device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorUpdateTemplateKHR_params -{ - VkDevice device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDevice_params -{ - VkDevice device; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyFence_params -{ - VkDevice device; - VkFence DECLSPEC_ALIGN(8) fence; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyFramebuffer_params -{ - VkDevice device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyImage_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyImageView_params -{ - VkDevice device; - VkImageView DECLSPEC_ALIGN(8) imageView; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyIndirectCommandsLayoutNV_params -{ - VkDevice device; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyInstance_params -{ - VkInstance instance; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyMicromapEXT_params -{ - VkDevice device; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyOpticalFlowSessionNV_params -{ - VkDevice device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipeline_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipelineCache_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipelineLayout_params -{ - VkDevice device; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPrivateDataSlot_params -{ - VkDevice device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPrivateDataSlotEXT_params -{ - VkDevice device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyQueryPool_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyRenderPass_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySampler_params -{ - VkDevice device; - VkSampler DECLSPEC_ALIGN(8) sampler; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySamplerYcbcrConversion_params -{ - VkDevice device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySamplerYcbcrConversionKHR_params -{ - VkDevice device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySemaphore_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyShaderEXT_params -{ - VkDevice device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyShaderModule_params -{ - VkDevice device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySurfaceKHR_params -{ - VkInstance instance; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySwapchainKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyValidationCacheEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDeviceWaitIdle_params -{ - VkDevice device; - VkResult result; -}; - -struct vkEndCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - VkResult result; -}; - -struct vkEnumerateDeviceExtensionProperties_params -{ - VkPhysicalDevice physicalDevice; - const char *pLayerName; - uint32_t *pPropertyCount; - VkExtensionProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateDeviceLayerProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkLayerProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateInstanceExtensionProperties_params -{ - const char *pLayerName; - uint32_t *pPropertyCount; - VkExtensionProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateInstanceVersion_params -{ - uint32_t *pApiVersion; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceGroups_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceGroupCount; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceGroupsKHR_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceGroupCount; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - uint32_t *pCounterCount; - VkPerformanceCounterKHR *pCounters; - VkPerformanceCounterDescriptionKHR *pCounterDescriptions; - VkResult result; -}; - -struct vkEnumeratePhysicalDevices_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceCount; - VkPhysicalDevice *pPhysicalDevices; - VkResult result; -}; - -struct vkFlushMappedMemoryRanges_params -{ - VkDevice device; - uint32_t memoryRangeCount; - const VkMappedMemoryRange *pMemoryRanges; - VkResult result; -}; - -struct vkFreeCommandBuffers_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; -}; - -struct vkFreeDescriptorSets_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSet *pDescriptorSets; - VkResult result; -}; - -struct vkFreeMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkGetAccelerationStructureBuildSizesKHR_params -{ - VkDevice device; - VkAccelerationStructureBuildTypeKHR buildType; - const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo; - const uint32_t *pMaxPrimitiveCounts; - VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo; -}; - -struct vkGetAccelerationStructureDeviceAddressKHR_params -{ - VkDevice device; - const VkAccelerationStructureDeviceAddressInfoKHR *pInfo; - VkDeviceAddress result; -}; - -struct vkGetAccelerationStructureHandleNV_params -{ - VkDevice device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetAccelerationStructureMemoryRequirementsNV_params -{ - VkDevice device; - const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo; - VkMemoryRequirements2KHR *pMemoryRequirements; -}; - -struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetBufferDeviceAddress_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferDeviceAddressEXT_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferDeviceAddressKHR_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferMemoryRequirements_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkMemoryRequirements *pMemoryRequirements; -}; - -struct vkGetBufferMemoryRequirements2_params -{ - VkDevice device; - const VkBufferMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetBufferMemoryRequirements2KHR_params -{ - VkDevice device; - const VkBufferMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetBufferOpaqueCaptureAddress_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetBufferOpaqueCaptureAddressKHR_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkBufferCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetCalibratedTimestampsEXT_params -{ - VkDevice device; - uint32_t timestampCount; - const VkCalibratedTimestampInfoEXT *pTimestampInfos; - uint64_t *pTimestamps; - uint64_t *pMaxDeviation; - VkResult result; -}; - -struct vkGetCudaModuleCacheNV_params -{ - VkDevice device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - size_t *pCacheSize; - void *pCacheData; - VkResult result; -}; - -struct vkGetDeferredOperationMaxConcurrencyKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - uint32_t result; -}; - -struct vkGetDeferredOperationResultKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; -}; - -struct vkGetDescriptorEXT_params -{ - VkDevice device; - const VkDescriptorGetInfoEXT *pDescriptorInfo; - size_t dataSize; - void *pDescriptor; -}; - -struct vkGetDescriptorSetHostMappingVALVE_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - void **ppData; -}; - -struct vkGetDescriptorSetLayoutBindingOffsetEXT_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - uint32_t binding; - VkDeviceSize *pOffset; -}; - -struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params -{ - VkDevice device; - const VkDescriptorSetBindingReferenceVALVE *pBindingReference; - VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping; -}; - -struct vkGetDescriptorSetLayoutSizeEXT_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - VkDeviceSize *pLayoutSizeInBytes; -}; - -struct vkGetDescriptorSetLayoutSupport_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - VkDescriptorSetLayoutSupport *pSupport; -}; - -struct vkGetDescriptorSetLayoutSupportKHR_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - VkDescriptorSetLayoutSupport *pSupport; -}; - -struct vkGetDeviceAccelerationStructureCompatibilityKHR_params -{ - VkDevice device; - const VkAccelerationStructureVersionInfoKHR *pVersionInfo; - VkAccelerationStructureCompatibilityKHR *pCompatibility; -}; - -struct vkGetDeviceBufferMemoryRequirements_params -{ - VkDevice device; - const VkDeviceBufferMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceBufferMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceBufferMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceFaultInfoEXT_params -{ - VkDevice device; - VkDeviceFaultCountsEXT *pFaultCounts; - VkDeviceFaultInfoEXT *pFaultInfo; - VkResult result; -}; - -struct vkGetDeviceGroupPeerMemoryFeatures_params -{ - VkDevice device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - VkPeerMemoryFeatureFlags *pPeerMemoryFeatures; -}; - -struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params -{ - VkDevice device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - VkPeerMemoryFeatureFlags *pPeerMemoryFeatures; -}; - -struct vkGetDeviceGroupPresentCapabilitiesKHR_params -{ - VkDevice device; - VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities; - VkResult result; -}; - -struct vkGetDeviceGroupSurfacePresentModesKHR_params -{ - VkDevice device; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkDeviceGroupPresentModeFlagsKHR *pModes; - VkResult result; -}; - -struct vkGetDeviceImageMemoryRequirements_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceImageMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceImageSparseMemoryRequirements_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetDeviceImageSparseMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetDeviceImageSubresourceLayoutKHR_params -{ - VkDevice device; - const VkDeviceImageSubresourceInfoKHR *pInfo; - VkSubresourceLayout2KHR *pLayout; -}; - -struct vkGetDeviceMemoryCommitment_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize *pCommittedMemoryInBytes; -}; - -struct vkGetDeviceMemoryOpaqueCaptureAddress_params -{ - VkDevice device; - const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params -{ - VkDevice device; - const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetDeviceMicromapCompatibilityEXT_params -{ - VkDevice device; - const VkMicromapVersionInfoEXT *pVersionInfo; - VkAccelerationStructureCompatibilityKHR *pCompatibility; -}; - -struct vkGetDeviceQueue_params -{ - VkDevice device; - uint32_t queueFamilyIndex; - uint32_t queueIndex; - VkQueue *pQueue; -}; - -struct vkGetDeviceQueue2_params -{ - VkDevice device; - const VkDeviceQueueInfo2 *pQueueInfo; - VkQueue *pQueue; -}; - -struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderpass; - VkExtent2D *pMaxWorkgroupSize; - VkResult result; -}; - -struct vkGetDynamicRenderingTilePropertiesQCOM_params -{ - VkDevice device; - const VkRenderingInfo *pRenderingInfo; - VkTilePropertiesQCOM *pProperties; - VkResult result; -}; - -struct vkGetEventStatus_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkGetFenceStatus_params -{ - VkDevice device; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkGetFramebufferTilePropertiesQCOM_params -{ - VkDevice device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - uint32_t *pPropertiesCount; - VkTilePropertiesQCOM *pProperties; - VkResult result; -}; - -struct vkGetGeneratedCommandsMemoryRequirementsNV_params -{ - VkDevice device; - const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - VkMemoryRequirements *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements2_params -{ - VkDevice device; - const VkImageMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements2KHR_params -{ - VkDevice device; - const VkImageMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkImageCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetImageSparseMemoryRequirements_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements *pSparseMemoryRequirements; -}; - -struct vkGetImageSparseMemoryRequirements2_params -{ - VkDevice device; - const VkImageSparseMemoryRequirementsInfo2 *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetImageSparseMemoryRequirements2KHR_params -{ - VkDevice device; - const VkImageSparseMemoryRequirementsInfo2 *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetImageSubresourceLayout_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource *pSubresource; - VkSubresourceLayout *pLayout; -}; - -struct vkGetImageSubresourceLayout2EXT_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource2KHR *pSubresource; - VkSubresourceLayout2KHR *pLayout; -}; - -struct vkGetImageSubresourceLayout2KHR_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource2KHR *pSubresource; - VkSubresourceLayout2KHR *pLayout; -}; - -struct vkGetImageViewAddressNVX_params -{ - VkDevice device; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageViewAddressPropertiesNVX *pProperties; - VkResult result; -}; - -struct vkGetImageViewHandleNVX_params -{ - VkDevice device; - const VkImageViewHandleInfoNVX *pInfo; - uint32_t result; -}; - -struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkImageViewCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetLatencyTimingsNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo; -}; - -struct vkGetMemoryHostPointerPropertiesEXT_params -{ - VkDevice device; - VkExternalMemoryHandleTypeFlagBits handleType; - const void *pHostPointer; - VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties; - VkResult result; -}; - -struct vkGetMicromapBuildSizesEXT_params -{ - VkDevice device; - VkAccelerationStructureBuildTypeKHR buildType; - const VkMicromapBuildInfoEXT *pBuildInfo; - VkMicromapBuildSizesInfoEXT *pSizeInfo; -}; - -struct vkGetPerformanceParameterINTEL_params -{ - VkDevice device; - VkPerformanceParameterTypeINTEL parameter; - VkPerformanceValueINTEL *pValue; - VkResult result; -}; - -struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pTimeDomainCount; - VkTimeDomainEXT *pTimeDomains; - VkResult result; -}; - -struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkCooperativeMatrixPropertiesKHR *pProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkCooperativeMatrixPropertiesNV *pProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceExternalBufferProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo; - VkExternalBufferProperties *pExternalBufferProperties; -}; - -struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo; - VkExternalBufferProperties *pExternalBufferProperties; -}; - -struct vkGetPhysicalDeviceExternalFenceProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo; - VkExternalFenceProperties *pExternalFenceProperties; -}; - -struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo; - VkExternalFenceProperties *pExternalFenceProperties; -}; - -struct vkGetPhysicalDeviceExternalSemaphoreProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo; - VkExternalSemaphoreProperties *pExternalSemaphoreProperties; -}; - -struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo; - VkExternalSemaphoreProperties *pExternalSemaphoreProperties; -}; - -struct vkGetPhysicalDeviceFeatures_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures *pFeatures; -}; - -struct vkGetPhysicalDeviceFeatures2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures2 *pFeatures; -}; - -struct vkGetPhysicalDeviceFeatures2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures2 *pFeatures; -}; - -struct vkGetPhysicalDeviceFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties2 *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties2 *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pFragmentShadingRateCount; - VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; - VkImageFormatProperties *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo; - VkImageFormatProperties2 *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo; - VkImageFormatProperties2 *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceMemoryProperties_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMemoryProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties2 *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMemoryProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties2 *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params -{ - VkPhysicalDevice physicalDevice; - VkSampleCountFlagBits samples; - VkMultisamplePropertiesEXT *pMultisampleProperties; -}; - -struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params -{ - VkPhysicalDevice physicalDevice; - const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo; - uint32_t *pFormatCount; - VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDevicePresentRectanglesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pRectCount; - VkRect2D *pRects; - VkResult result; -}; - -struct vkGetPhysicalDeviceProperties_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties *pProperties; -}; - -struct vkGetPhysicalDeviceProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo; - uint32_t *pNumPasses; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties2_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties2 *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties2 *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties *pProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pCombinationCount; - VkFramebufferMixedSamplesCombinationNV *pCombinations; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo; - VkSurfaceCapabilities2KHR *pSurfaceCapabilities; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceFormats2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo; - uint32_t *pSurfaceFormatCount; - VkSurfaceFormat2KHR *pSurfaceFormats; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceFormatsKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pSurfaceFormatCount; - VkSurfaceFormatKHR *pSurfaceFormats; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfacePresentModesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pPresentModeCount; - VkPresentModeKHR *pPresentModes; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceSupportKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkBool32 *pSupported; - VkResult result; -}; - -struct vkGetPhysicalDeviceToolProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pToolCount; - VkPhysicalDeviceToolProperties *pToolProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceToolPropertiesEXT_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pToolCount; - VkPhysicalDeviceToolProperties *pToolProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - VkBool32 result; -}; - -struct vkGetPipelineCacheData_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetPipelineExecutableInternalRepresentationsKHR_params -{ - VkDevice device; - const VkPipelineExecutableInfoKHR *pExecutableInfo; - uint32_t *pInternalRepresentationCount; - VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations; - VkResult result; -}; - -struct vkGetPipelineExecutablePropertiesKHR_params -{ - VkDevice device; - const VkPipelineInfoKHR *pPipelineInfo; - uint32_t *pExecutableCount; - VkPipelineExecutablePropertiesKHR *pProperties; - VkResult result; -}; - -struct vkGetPipelineExecutableStatisticsKHR_params -{ - VkDevice device; - const VkPipelineExecutableInfoKHR *pExecutableInfo; - uint32_t *pStatisticCount; - VkPipelineExecutableStatisticKHR *pStatistics; - VkResult result; -}; - -struct vkGetPipelineIndirectDeviceAddressNV_params -{ - VkDevice device; - const VkPipelineIndirectDeviceAddressInfoNV *pInfo; - VkDeviceAddress result; -}; - -struct vkGetPipelineIndirectMemoryRequirementsNV_params -{ - VkDevice device; - const VkComputePipelineCreateInfo *pCreateInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetPipelinePropertiesEXT_params -{ - VkDevice device; - const VkPipelineInfoEXT *pPipelineInfo; - VkBaseOutStructure *pPipelineProperties; - VkResult result; -}; - -struct vkGetPrivateData_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t *pData; -}; - -struct vkGetPrivateDataEXT_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t *pData; -}; - -struct vkGetQueryPoolResults_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - size_t dataSize; - void *pData; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - VkResult result; -}; - -struct vkGetQueueCheckpointData2NV_params -{ - VkQueue queue; - uint32_t *pCheckpointDataCount; - VkCheckpointData2NV *pCheckpointData; -}; - -struct vkGetQueueCheckpointDataNV_params -{ - VkQueue queue; - uint32_t *pCheckpointDataCount; - VkCheckpointDataNV *pCheckpointData; -}; - -struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupHandlesKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupHandlesNV_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupStackSizeKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t group; - VkShaderGroupShaderKHR groupShader; - VkDeviceSize result; -}; - -struct vkGetRenderAreaGranularity_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - VkExtent2D *pGranularity; -}; - -struct vkGetRenderingAreaGranularityKHR_params -{ - VkDevice device; - const VkRenderingAreaInfoKHR *pRenderingAreaInfo; - VkExtent2D *pGranularity; -}; - -struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkSamplerCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetSemaphoreCounterValue_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t *pValue; - VkResult result; -}; - -struct vkGetSemaphoreCounterValueKHR_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t *pValue; - VkResult result; -}; - -struct vkGetShaderBinaryDataEXT_params -{ - VkDevice device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetShaderInfoAMD_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkShaderStageFlagBits shaderStage; - VkShaderInfoTypeAMD infoType; - size_t *pInfoSize; - void *pInfo; - VkResult result; -}; - -struct vkGetShaderModuleCreateInfoIdentifierEXT_params -{ - VkDevice device; - const VkShaderModuleCreateInfo *pCreateInfo; - VkShaderModuleIdentifierEXT *pIdentifier; -}; - -struct vkGetShaderModuleIdentifierEXT_params -{ - VkDevice device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - VkShaderModuleIdentifierEXT *pIdentifier; -}; - -struct vkGetSwapchainImagesKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t *pSwapchainImageCount; - VkImage *pSwapchainImages; - VkResult result; -}; - -struct vkGetValidationCacheDataEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkInitializePerformanceApiINTEL_params -{ - VkDevice device; - const VkInitializePerformanceApiInfoINTEL *pInitializeInfo; - VkResult result; -}; - -struct vkInvalidateMappedMemoryRanges_params -{ - VkDevice device; - uint32_t memoryRangeCount; - const VkMappedMemoryRange *pMemoryRanges; - VkResult result; -}; - -struct vkLatencySleepNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkLatencySleepInfoNV *pSleepInfo; - VkResult result; -}; - -struct vkMapMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryMapFlags flags; - void **ppData; - VkResult result; -}; - -struct vkMapMemory2KHR_params -{ - VkDevice device; - const VkMemoryMapInfoKHR *pMemoryMapInfo; - void **ppData; - VkResult result; -}; - -struct vkMergePipelineCaches_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - const VkPipelineCache *pSrcCaches; - VkResult result; -}; - -struct vkMergeValidationCachesEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - const VkValidationCacheEXT *pSrcCaches; - VkResult result; -}; - -struct vkQueueBeginDebugUtilsLabelEXT_params -{ - VkQueue queue; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkQueueBindSparse_params -{ - VkQueue queue; - uint32_t bindInfoCount; - const VkBindSparseInfo *pBindInfo; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueEndDebugUtilsLabelEXT_params -{ - VkQueue queue; -}; - -struct vkQueueInsertDebugUtilsLabelEXT_params -{ - VkQueue queue; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkQueueNotifyOutOfBandNV_params -{ - VkQueue queue; - const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo; -}; - -struct vkQueuePresentKHR_params -{ - VkQueue queue; - const VkPresentInfoKHR *pPresentInfo; - VkResult result; -}; - -struct vkQueueSetPerformanceConfigurationINTEL_params -{ - VkQueue queue; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; -}; - -struct vkQueueSubmit_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueSubmit2_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo2 *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueSubmit2KHR_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo2 *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueWaitIdle_params -{ - VkQueue queue; - VkResult result; -}; - -struct vkReleasePerformanceConfigurationINTEL_params -{ - VkDevice device; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; -}; - -struct vkReleaseProfilingLockKHR_params -{ - VkDevice device; -}; - -struct vkReleaseSwapchainImagesEXT_params -{ - VkDevice device; - const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo; - VkResult result; -}; - -struct vkResetCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - VkCommandBufferResetFlags flags; - VkResult result; -}; - -struct vkResetCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolResetFlags flags; - VkResult result; -}; - -struct vkResetDescriptorPool_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - VkDescriptorPoolResetFlags flags; - VkResult result; -}; - -struct vkResetEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkResetFences_params -{ - VkDevice device; - uint32_t fenceCount; - const VkFence *pFences; - VkResult result; -}; - -struct vkResetQueryPool_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkResetQueryPoolEXT_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkSetDebugUtilsObjectNameEXT_params -{ - VkDevice device; - const VkDebugUtilsObjectNameInfoEXT *pNameInfo; - VkResult result; -}; - -struct vkSetDebugUtilsObjectTagEXT_params -{ - VkDevice device; - const VkDebugUtilsObjectTagInfoEXT *pTagInfo; - VkResult result; -}; - -struct vkSetDeviceMemoryPriorityEXT_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - float priority; -}; - -struct vkSetEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkSetHdrMetadataEXT_params -{ - VkDevice device; - uint32_t swapchainCount; - const VkSwapchainKHR *pSwapchains; - const VkHdrMetadataEXT *pMetadata; -}; - -struct vkSetLatencyMarkerNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo; -}; - -struct vkSetLatencySleepModeNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkLatencySleepModeInfoNV *pSleepModeInfo; - VkResult result; -}; - -struct vkSetPrivateData_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; -}; - -struct vkSetPrivateDataEXT_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; -}; - -struct vkSignalSemaphore_params -{ - VkDevice device; - const VkSemaphoreSignalInfo *pSignalInfo; - VkResult result; -}; - -struct vkSignalSemaphoreKHR_params -{ - VkDevice device; - const VkSemaphoreSignalInfo *pSignalInfo; - VkResult result; -}; - -struct vkSubmitDebugUtilsMessageEXT_params -{ - VkInstance instance; - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageTypes; - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData; -}; - -struct vkTransitionImageLayoutEXT_params -{ - VkDevice device; - uint32_t transitionCount; - const VkHostImageLayoutTransitionInfoEXT *pTransitions; - VkResult result; -}; - -struct vkTrimCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; -}; - -struct vkTrimCommandPoolKHR_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; -}; - -struct vkUninitializePerformanceApiINTEL_params -{ - VkDevice device; -}; - -struct vkUnmapMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -}; - -struct vkUnmapMemory2KHR_params -{ - VkDevice device; - const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo; - VkResult result; -}; - -struct vkUpdateDescriptorSetWithTemplate_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const void *pData; -}; - -struct vkUpdateDescriptorSetWithTemplateKHR_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const void *pData; -}; - -struct vkUpdateDescriptorSets_params -{ - VkDevice device; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; - uint32_t descriptorCopyCount; - const VkCopyDescriptorSet *pDescriptorCopies; -}; - -struct vkWaitForFences_params -{ - VkDevice device; - uint32_t fenceCount; - const VkFence *pFences; - VkBool32 waitAll; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitForPresentKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) presentId; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitSemaphores_params -{ - VkDevice device; - const VkSemaphoreWaitInfo *pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitSemaphoresKHR_params -{ - VkDevice device; - const VkSemaphoreWaitInfo *pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWriteAccelerationStructuresPropertiesKHR_params -{ - VkDevice device; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; - VkQueryType queryType; - size_t dataSize; - void *pData; - size_t stride; - VkResult result; -}; - -struct vkWriteMicromapsPropertiesEXT_params -{ - VkDevice device; - uint32_t micromapCount; - const VkMicromapEXT *pMicromaps; - VkQueryType queryType; - size_t dataSize; - void *pData; - size_t stride; - VkResult result; -}; - -#endif /* __WINE_VULKAN_LOADER_THUNKS_H */ diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index ecc84b54a51..467eee61c2a 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -64,7 +64,7 @@ from enum import Enum LOGGER = logging.Logger("vulkan") LOGGER.addHandler(logging.StreamHandler()) -VK_XML_VERSION = "1.3.272" +VK_XML_VERSION = "1.3.279" WINE_VK_VERSION = (1, 3) # Filenames to create. @@ -99,11 +99,10 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_full_screen_exclusive", "VK_GOOGLE_display_timing", "VK_KHR_external_fence_win32", - "VK_KHR_external_semaphore_win32", # Relates to external_semaphore and needs type conversions in bitflags. "VK_KHR_shared_presentable_image", # Needs WSI work. + "VK_KHR_video_encode_queue", "VK_KHR_video_queue", # TODO Video extensions use separate headers + xml - "VK_KHR_win32_keyed_mutex", "VK_NV_external_memory_rdma", # Needs shared resources work. # Extensions for other platforms @@ -113,8 +112,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_physical_device_drm", "VK_GOOGLE_surfaceless_query", "VK_KHR_external_fence_fd", - "VK_KHR_external_memory_fd", - "VK_KHR_external_semaphore_fd", "VK_SEC_amigo_profiling", # Angle specific. # Extensions which require callback handling @@ -129,7 +126,7 @@ UNSUPPORTED_EXTENSIONS = [ # winevulkan may nonetheless use, or extensions we want to generate headers for # but not expose to applications (useful for test commits) UNEXPOSED_EXTENSIONS = { - "VK_KHR_external_memory_win32", + "VK_EXT_map_memory_placed", } # The Vulkan loader provides entry-points for core functionality and important @@ -174,26 +171,57 @@ FUNCTION_OVERRIDES = { # Instance functions "vkCreateDevice" : {"extra_param" : "client_ptr"}, "vkDestroyInstance" : {"dispatch" : False}, - "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : True}, "vkGetPhysicalDeviceExternalFenceProperties" : {"dispatch" : False}, - "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : True}, # Device functions "vkCreateCommandPool" : {"extra_param" : "client_ptr"}, "vkGetDeviceProcAddr" : {"dispatch" : False}, + "vkAllocateMemory" : {"extra_param" : "pAllocateInfo"}, + "vkGetSemaphoreCounterValue" : {"dispatch" : True}, + "vkSignalSemaphore" : {"dispatch" : True}, + "vkWaitSemaphores" : {"dispatch" : True}, + "vkQueueBindSparse" : {"dispatch" : True}, + "vkQueueSubmit" : {"dispatch" : True, "extra_param" : "pSubmits"}, + "vkQueueSubmit2" : {"dispatch" : True, "extra_param" : "pSubmits"}, + "vkDestroySemaphore" : {"dispatch" : True}, # VK_KHR_external_fence_capabilities "vkGetPhysicalDeviceExternalFencePropertiesKHR" : {"dispatch" : False}, # VK_KHR_external_memory_capabilities - "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : True}, # VK_KHR_external_semaphore_capabilities - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : True}, + + # VK_KHR_external_semaphore_win32 + "vkCreateSemaphore" : {"dispatch" : True, "extra_param" : "pCreateInfo"}, + "vkGetSemaphoreWin32HandleKHR" : {"dispatch" : True}, + "vkImportSemaphoreWin32HandleKHR" : {"dispatch" : True}, + + # VK_KHR_external_memory_win32 + "vkGetMemoryWin32HandleKHR" : {"dispatch" : True}, + "vkGetMemoryWin32HandlePropertiesKHR" : {"dispatch" : True}, + + # VK_KHR_timeline_semaphore + "vkGetSemaphoreCounterValueKHR" : {"dispatch" : True}, + "vkSignalSemaphoreKHR" : {"dispatch" : True}, + "vkWaitSemaphoresKHR" : {"dispatch" : True}, + + # VK_KHR_synchronization2 + "vkQueueSubmit2KHR" : {"dispatch" : True, "extra_param" : "pSubmits"}, + + # Custom functions + "wine_vkAcquireKeyedMutex" : {"dispatch": True}, + "wine_vkReleaseKeyedMutex" : {"dispatch": True}, } # functions for which a user driver entry must be generated USER_DRIVER_FUNCS = { + "vkAcquireNextImage2KHR", + "vkAcquireNextImageKHR", "vkCreateInstance", "vkCreateSwapchainKHR", "vkCreateWin32SurfaceKHR", @@ -228,6 +256,8 @@ MANUAL_UNIX_THUNKS = { "vkCreateDevice", "vkCreateImage", "vkCreateInstance", + "vkCreateSemaphore", + "vkCreateSwapchainKHR", "vkCreateWin32SurfaceKHR", "vkDestroyCommandPool", "vkDestroyDebugReportCallbackEXT", @@ -236,6 +266,9 @@ MANUAL_UNIX_THUNKS = { "vkDestroyDevice", "vkDestroyInstance", "vkDestroySurfaceKHR", + "vkDestroySwapchainKHR", + "vkGetSemaphoreWin32HandleKHR", + "vkImportSemaphoreWin32HandleKHR", "vkEnumerateDeviceExtensionProperties", "vkEnumerateDeviceLayerProperties", "vkEnumerateInstanceExtensionProperties", @@ -247,11 +280,15 @@ MANUAL_UNIX_THUNKS = { "vkFreeCommandBuffers", "vkFreeMemory", "vkGetCalibratedTimestampsEXT", + "vkGetCalibratedTimestampsKHR", "vkGetDeviceProcAddr", + "vkGetMemoryWin32HandleKHR", + "vkGetMemoryWin32HandlePropertiesKHR", "vkGetDeviceQueue", "vkGetDeviceQueue2", "vkGetInstanceProcAddr", "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", + "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", "vkGetPhysicalDeviceExternalBufferProperties", "vkGetPhysicalDeviceExternalBufferPropertiesKHR", "vkGetPhysicalDeviceExternalFenceProperties", @@ -262,10 +299,26 @@ MANUAL_UNIX_THUNKS = { "vkGetPhysicalDeviceImageFormatProperties2KHR", "vkGetPhysicalDeviceSurfaceCapabilities2KHR", "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", + "vkGetSwapchainImagesKHR", + "vkQueuePresentKHR", "vkMapMemory", "vkMapMemory2KHR", "vkUnmapMemory", "vkUnmapMemory2KHR", + "vkGetSemaphoreCounterValue", + "vkSignalSemaphore", + "vkWaitSemaphores", + "vkQueueBindSparse", + "vkQueueSubmit", + "vkQueueSubmit2", + "vkDestroySemaphore", + "vkGetSemaphoreCounterValueKHR", + "vkSignalSemaphoreKHR", + "vkWaitSemaphoresKHR", + "vkQueueSubmit2KHR", + # Custom functions + "wine_vkAcquireKeyedMutex", + "wine_vkReleaseKeyedMutex", } # loader functions which are entirely manually implemented @@ -287,6 +340,7 @@ MANUAL_LOADER_THUNKS = { "vkEnumerateInstanceExtensionProperties", "vkEnumerateInstanceVersion", "vkFreeCommandBuffers", + "vkGetPhysicalDeviceProperties", "vkGetPhysicalDeviceProperties2", "vkGetPhysicalDeviceProperties2KHR", } @@ -295,8 +349,24 @@ STRUCT_CHAIN_CONVERSIONS = { # Ignore to not confuse host loader. "VkDeviceCreateInfo": ["VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"], "VkInstanceCreateInfo": ["VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO"], + + # Structs which require pNext chain modification + "VkBufferCreateInfo": [], + "VkImageCreateInfo": [], + "VkMemoryAllocateInfo": ["VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR", "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"], + "VkPhysicalDeviceImageFormatInfo2": [], + "VkPhysicalDeviceExternalSemaphoreInfo": [], + "VkSemaphoreCreateInfo": ["VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"], + "VkSubmitInfo": ["VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR", "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], + "VkSubmitInfo2": ["VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], + "VkBindSparseInfo" : [], } +STRUCT_COPY = { + "VkSubmitInfo", + "VkSubmitInfo2", +}; + # Some struct members are conditionally ignored and callers are free to leave them uninitialized. # We can't deduce that from XML, so we allow expressing it here. MEMBER_LENGTH_EXPRESSIONS = { @@ -802,7 +872,14 @@ class VkFunction(object): proto += ", ".join([p.definition() for p in self.params]) if is_thunk and self.extra_param: - proto += ", void *" + self.extra_param + extra_param_is_new = True + for p in self.params: + if p.name == self.extra_param: + extra_param_is_new = False + if extra_param_is_new: + proto += ", void *" + self.extra_param + else: + proto += ", void *win_" + self.extra_param proto += ")" return proto @@ -886,7 +963,7 @@ class VkFunction(object): if conv: params += ", UlongToPtr({0}{1})".format(params_prefix, self.extra_param) else: - params += ", {0}{1}".format(params_prefix, self.extra_param) + params += ", (void *){0}{1}".format(params_prefix, self.extra_param) if self.name not in MANUAL_UNIX_THUNKS: func_prefix = "{0}.p_".format(self.params[0].dispatch_table(params_prefix, conv)) @@ -964,9 +1041,12 @@ class VkFunction(object): if conv: thunk += " struct\n" thunk += " {\n" + extra_param_is_new = True for p in self.params: thunk += " {0};\n".format(p.definition(conv=True, is_member=True)) - if self.extra_param: + if p.name == self.extra_param: + extra_param_is_new = False + if self.extra_param and extra_param_is_new: thunk += " PTR32 {0};\n".format(self.extra_param) if self.type != "void": thunk += " {0} result;\n".format(self.type) @@ -1180,12 +1260,16 @@ class VkHandle(object): return "wine_instance_from_handle({0})->host_instance".format(name) if self.name == "VkDeviceMemory": return "wine_device_memory_from_handle({0})->host_memory".format(name) + if self.name == "VkSemaphore": + return "wine_semaphore_host_handle( wine_semaphore_from_handle({0}) )".format(name) if self.name == "VkPhysicalDevice": return "wine_phys_dev_from_handle({0})->host_physical_device".format(name) if self.name == "VkQueue": return "wine_queue_from_handle({0})->host_queue".format(name) if self.name == "VkSurfaceKHR": return "wine_surface_from_handle({0})->host_surface".format(name) + if self.name == "VkSwapchainKHR": + return "wine_swapchain_from_handle({0})->host_swapchain".format(name) if self.is_dispatchable(): LOGGER.error("Unhandled host handle for: {0}".format(self.name)) return None @@ -1203,7 +1287,8 @@ class VkHandle(object): return self.driver_handle(name) if unwrap == Unwrap.HOST: return self.host_handle(name) - assert unwrap != Unwrap.NONE + if unwrap == Unwrap.NONE: + return name return None def is_wrapped(self): @@ -1315,7 +1400,7 @@ class VkVariable(object): Vulkan uses this for dynamically sized arrays for which there is a 'count' parameter. """ - return self.dyn_array_len is not None + return self.dyn_array_len is not None and self.array_len is None def is_static_array(self): """ Returns if the member is an array. @@ -1403,6 +1488,9 @@ class VkVariable(object): if struct.needs_conversion(conv, unwrap, Direction.OUTPUT, is_const): conversions.append(StructConversionFunction(struct, Direction.OUTPUT, conv, unwrap, is_const)) + if struct.name in STRUCT_COPY: + conversions.append(StructConversionFunction(struct, Direction.INPUT, False, unwrap, is_const, True)) + if self.is_static_array() or self.is_dynamic_array(): for conv in [False, True]: if self.needs_conversion(conv, unwrap, Direction.INPUT, parent_const): @@ -1532,7 +1620,7 @@ class VkMember(VkVariable): values=values, object_type=object_type, bit_width=bit_width, returnedonly=returnedonly, parent=parent, selection=selection, selector=selector) - def copy(self, input, output, direction, conv, unwrap): + def copy(self, input, output, direction, conv, unwrap, copy): """ Helper method for use by conversion logic to generate a C-code statement to copy this member. - `conv` indicates whether the statement is in a struct alignment conversion path. """ @@ -1567,8 +1655,9 @@ class VkMember(VkVariable): return "{0}{1} = {2} ? {3} : 0;\n".format(output, self.name, self.value(input, conv), handle.unwrap_handle(self.value(input, conv), unwrap)) else: - return "{0}{1} = {2};\n".format(output, self.name, - handle.unwrap_handle(self.value(input, conv), unwrap)) + input_name = "{0}{1}".format(input, self.name) + return "{0}{1} = {2} ? {3} : VK_NULL_HANDLE;\n".format(output, self.name, + input_name, handle.unwrap_handle(self.value(input, conv), unwrap)) elif self.is_generic_handle(): if direction == Direction.OUTPUT: LOGGER.err("OUTPUT parameter {0}.{1} cannot be unwrapped".format(self.type, self.name)) @@ -1587,6 +1676,11 @@ class VkMember(VkVariable): elif self.is_static_array(): bytes_count = "{0} * sizeof({1})".format(self.array_len, self.type) return "memcpy({0}{1}, {2}{1}, {3});\n".format(output, self.name, input, bytes_count) + elif self.is_dynamic_array() and copy: + if self.type == "void": + return "MEMDUP_VOID(ctx, {0}{1}, {2}{1}, {3});\n".format(output, self.name, input, self.get_dyn_array_len(input, conv)) + else: + return "MEMDUP(ctx, {0}{1}, {2}{1}, {3});\n".format(output, self.name, input, self.get_dyn_array_len(input, conv)) elif direction == Direction.INPUT: return "{0}{1} = {2};\n".format(output, self.name, self.value(input, conv)) elif conv and direction == Direction.OUTPUT and self.is_pointer(): @@ -2031,14 +2125,11 @@ class VkStruct(Sequence): # Those structs seem to be broken in spec, they are specified as # returned only, but documented as input structs. - if name in ["VkSubpassShadingPipelineCreateInfoHUAWEI", - "VkPipelineShaderStageRequiredSubgroupSizeCreateInfo"]: + if name in ["VkPipelineShaderStageRequiredSubgroupSizeCreateInfo"]: returnedonly = False # Those structs don't have returnedonly in spec, but they could (should?). - if name in ["VkSurfaceCapabilitiesPresentBarrierNV", - "VkCooperativeMatrixPropertiesNV", - "VkPerformanceValueINTEL"]: + if name in ["VkSurfaceCapabilitiesPresentBarrierNV"]: returnedonly = True structextends = struct.attrib.get("structextends") @@ -2310,17 +2401,21 @@ class VkStruct(Sequence): class StructConversionFunction(object): - def __init__(self, struct, direction, conv, unwrap, const): + def __init__(self, struct, direction, conv, unwrap, const, copy=False): self.direction = direction self.operand = struct self.type = struct.name self.conv = conv self.unwrap = unwrap self.const = const + self.copy = copy - name = "convert_{0}_".format(self.type) - win_type = "win32" if self.conv else "win64" - name += convert_suffix(direction, win_type, unwrap, struct.is_wrapped()) + if copy: + name = "copy_{0}".format(self.type) + else: + name = "convert_{0}_".format(self.type) + win_type = "win32" if self.conv else "win64" + name += convert_suffix(direction, win_type, unwrap, struct.is_wrapped()) self.name = name def __eq__(self, other): @@ -2352,7 +2447,7 @@ class StructConversionFunction(object): body = "" - if not self.conv: + if not self.conv and not self.copy: body += "#ifdef _WIN64\n" needs_alloc = self.direction != Direction.OUTPUT and self.operand.needs_alloc(self.conv, self.unwrap) @@ -2362,8 +2457,11 @@ class StructConversionFunction(object): if self.direction == Direction.OUTPUT and self.const: win_type = "const " + win_type - if self.conv: + if self.copy: + body += "void {0}(".format(self.name) + else: body += "static inline void {0}(".format(self.name) + if self.conv: if self.direction == Direction.OUTPUT: params = ["const {0} *in".format(self.type), "{0} *out".format(win_type)] @@ -2380,8 +2478,6 @@ class StructConversionFunction(object): body += ")\n" else: - body += "static inline void {0}(".format(self.name) - params = ["const {0} *in".format(self.type), "{0} *out".format(self.type)] # Generate parameter list @@ -2421,7 +2517,7 @@ class StructConversionFunction(object): body += " || ".join("selector == {}".format(s) for s in m.selection) body += ")\n " - body += " " + m.copy("in->", "out->", self.direction, self.conv, self.unwrap) + body += " " + m.copy("in->", "out->", self.direction, self.conv, self.unwrap, self.copy) if needs_extensions: if self.conv and self.direction == Direction.INPUT: @@ -2435,9 +2531,12 @@ class StructConversionFunction(object): ident = " " if self.direction == Direction.INPUT and self.type in STRUCT_CHAIN_CONVERSIONS: + has_any_chain_conversions = False for i in STRUCT_CHAIN_CONVERSIONS[self.type]: body += " case {0}:\n".format(i) - body += ident + "break;\n" + has_any_chain_conversions = True + if has_any_chain_conversions: + body += ident + "break;\n" for ext in self.operand.struct_extensions: if not ext.required: @@ -2447,6 +2546,8 @@ class StructConversionFunction(object): continue stype = next(x for x in ext.members if x.name == "sType").values + if self.type in STRUCT_CHAIN_CONVERSIONS and stype in STRUCT_CHAIN_CONVERSIONS[self.type]: + continue win_type = ext.name + "32" if self.conv and ext.needs_win32_type() else ext.name if self.direction == Direction.INPUT: in_type = "const " + win_type @@ -2475,7 +2576,7 @@ class StructConversionFunction(object): if m.name == "pNext": copy_body += ident + "out_ext->pNext = NULL;\n" continue - copy_body += ident + m.copy("in_ext->", "out_ext->", self.direction, self.conv, Unwrap.HOST) + copy_body += ident + m.copy("in_ext->", "out_ext->", self.direction, self.conv, Unwrap.HOST, self.copy) # Generate the definition of "in_ext" if we need it if "in_ext->" in copy_body: @@ -2490,7 +2591,18 @@ class StructConversionFunction(object): body += " default:\n" if self.direction == Direction.INPUT: - body += ident + "FIXME(\"Unhandled sType %u.\\n\", in_header->sType);\n" + body += ident + "if ((in_header->sType >> 16) == 0x7ead)\n" + body += ident + "{\n" + body += ident + " VkBaseOutStructure *out_ext = conversion_context_alloc(ctx, 32);\n"; + body += ident + " memcpy(out_ext, in_header, 32);\n"; + body += ident + " out_ext->pNext = NULL;\n"; + body += ident + " out_header->pNext = (void *)out_ext;\n"; + body += ident + " out_header = (void *)out_ext;\n"; + body += ident + "}\n" + body += ident + "else\n" + body += ident + "{\n" + body += ident + " FIXME(\"Unhandled sType %u.\\n\", in_header->sType);\n" + body += ident + "}\n" body += " break;\n" body += " }\n" body += " }\n" @@ -2499,7 +2611,7 @@ class StructConversionFunction(object): body += " FIXME(\"Unexpected pNext\\n\");\n" body += "}\n" - if not self.conv: + if not self.conv and not self.copy: body += "#endif /* _WIN64 */\n" body += "\n" @@ -3039,9 +3151,13 @@ class VkGenerator(object): f.write("struct {0}_params\n".format(vk_func.name)) f.write("{\n"); + extra_param_is_new = True for p in vk_func.params: f.write(" {0};\n".format(p.definition(is_member=True))) - if vk_func.extra_param: + if p.name == vk_func.extra_param: + extra_param_is_new = False + + if vk_func.extra_param and extra_param_is_new: f.write(" void *{0};\n".format(vk_func.extra_param)) if vk_func.type != "void": f.write(" {0} result;\n".format(vk_func.type)) @@ -3171,6 +3287,13 @@ class VkGenerator(object): f.write("\n") f.write(" /* winevulkan specific functions */\n") f.write(" VkSurfaceKHR (*p_wine_get_host_surface)(VkSurfaceKHR);\n") + f.write("\n") + f.write(" /* Optional. Returns TRUE if FS hack is active, otherwise returns FALSE. If\n") + f.write(" * it returns TRUE, then real_sz will contain the actual display\n") + f.write(" * resolution; user_sz will contain the app's requested mode; and dst_blit\n") + f.write(" * will contain the area to blit the user image to in real coordinates.\n") + f.write(" * All parameters are optional. */\n") + f.write(" VkBool32 (*query_fs_hack)(VkSurfaceKHR surface, VkExtent2D *real_sz, VkExtent2D *user_sz, VkRect2D *dst_blit, VkFilter *filter);\n") f.write("};\n\n") f.write("static inline void *get_vulkan_driver_device_proc_addr(\n") @@ -3202,6 +3325,28 @@ class VkGenerator(object): f.write(" name -= 2;\n\n") f.write(" return get_vulkan_driver_device_proc_addr(vulkan_funcs, name);\n}\n\n") + f.write("typedef VkResult (WINAPI *PFN_native_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *,\n") + f.write(" void * (*)(VkInstance, const char *), void *);\n"); + f.write("typedef VkResult (WINAPI *PFN_native_vkCreateDevice)(VkPhysicalDevice, const VkDeviceCreateInfo *, const VkAllocationCallbacks *, VkDevice *,\n"); + f.write(" void * (*)(VkInstance, const char *), void *);\n\n"); + f.write("typedef struct VkCreateInfoWineDeviceCallback {\n"); + f.write(" VkStructureType sType;\n"); + f.write(" const void* pNext;\n"); + f.write(" PFN_native_vkCreateDevice native_create_callback;\n"); + f.write(" void* context;\n"); + f.write("} VkCreateInfoWineDeviceCallback;\n"); + + f.write("#define VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK 2125312001\n"); + + f.write("typedef struct VkCreateInfoWineInstanceCallback {\n"); + f.write(" VkStructureType sType;\n"); + f.write(" const void* pNext;\n"); + f.write(" PFN_native_vkCreateInstance native_create_callback;\n"); + f.write(" void* context;\n"); + f.write("} VkCreateInfoWineInstanceCallback;\n"); + + f.write("#define VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK 2125312002\n"); + f.write("#endif /* __WINE_VULKAN_DRIVER_H */\n") def generate_vulkan_spec(self, f): @@ -3273,12 +3418,16 @@ class VkRegistry(object): # function call we want we set a member 'required' to True. tree = ET.parse(reg_filename) root = tree.getroot() + + tree_custom = ET.parse("vk_custom.xml") + root_custom = tree_custom.getroot() + self._parse_enums(root) self._parse_types(root) - self._parse_commands(root) + self._parse_commands(root, root_custom) # Pull in any required types and functions. - self._parse_features(root) + self._parse_features(root, root_custom) self._parse_extensions(root) for enum in self.enums.values(): @@ -3371,10 +3520,10 @@ class VkRegistry(object): if not handle.object_type: LOGGER.warning("No object type found for {}".format(handle.name)) - def _parse_commands(self, root): + def _parse_commands(self, root, root_custom): """ Parse command section containing the Vulkan function calls. """ funcs = {} - commands = root.findall("./commands/") + commands = root.findall("./commands/") + root_custom.findall("./commands/") # As of Vulkan 1.1, various extensions got promoted to Core. # The old commands (e.g. KHR) are available for backwards compatibility @@ -3390,6 +3539,7 @@ class VkRegistry(object): continue func = VkFunction.from_xml(command, self.types) + if func: funcs[func.name] = func @@ -3641,10 +3791,10 @@ class VkRegistry(object): # Sort in alphabetical order. self.extensions = sorted(extensions, key=lambda ext: ext["name"]) - def _parse_features(self, root): + def _parse_features(self, root, root_custom): """ Parse the feature section, which describes Core commands and types needed. """ - for feature in root.findall("./feature"): + for feature in (root.findall("./feature") + root_custom.findall("./feature")): if not api_is_vulkan(feature): continue feature_name = feature.attrib["name"] diff --git a/dlls/winevulkan/vk.xml b/dlls/winevulkan/vk.xml new file mode 100644 index 00000000000..ee9221e9eb3 --- /dev/null +++ b/dlls/winevulkan/vk.xml @@ -0,0 +1,26847 @@ + + + +Copyright 2015-2024 The Khronos Group Inc. + +SPDX-License-Identifier: Apache-2.0 OR MIT + + + +This file, vk.xml, is the Vulkan API Registry. It is a critically important +and normative part of the Vulkan Specification, including a canonical +machine-readable definition of the API, parameter and member validation +language incorporated into the Specification and reference pages, and other +material which is registered by Khronos, such as tags used by extension and +layer authors. The authoritative public version of vk.xml is maintained in +the default branch (currently named main) of the Khronos Vulkan GitHub +project. The authoritative private version is maintained in the default +branch of the member gitlab server. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #include "vk_platform.h" + + WSI extensions + + + + + + + + + + + + + + In the current header structure, each platform's interfaces + are confined to a platform-specific header (vulkan_xlib.h, + vulkan_win32.h, etc.). These headers are not self-contained, + and should not include native headers (X11/Xlib.h, + windows.h, etc.). Code should either include vulkan.h after + defining the appropriate VK_USE_PLATFORM_platform + macros, or include the required native headers prior to + explicitly including the corresponding platform header. + + To accomplish this, the dependencies of native types require + native headers, but the XML defines the content for those + native headers as empty. The actual native header includes + can be restored by modifying the native header tags above + to #include the header file in the 'name' attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. +#define VK_MAKE_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) + // DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) + + #define VK_MAKE_API_VERSION(variant, major, minor, patch) \ + ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + #define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) + #define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) + #define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) + #define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) + + // Vulkan SC variant number +#define VKSC_API_VARIANT 1 + + // DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. +//#define VK_API_VERSION VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0 + // Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 + // Vulkan 1.1 version number +#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0)// Patch version should always be set to 0 + // Vulkan 1.2 version number +#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0)// Patch version should always be set to 0 + // Vulkan 1.3 version number +#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)// Patch version should always be set to 0 + // Vulkan SC 1.0 version number +#define VKSC_API_VERSION_1_0 VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, 0)// Patch version should always be set to 0 + + // Version of this file +#define VK_HEADER_VERSION 279 + // Complete version of this file +#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) + // Version of this file +#define VK_HEADER_VERSION 14 + // Complete version of this file +#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, VK_HEADER_VERSION) + + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* (object); + + +#ifndef VK_USE_64_BIT_PTR_DEFINES + #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64) + #define VK_USE_64_BIT_PTR_DEFINES 1 + #else + #define VK_USE_64_BIT_PTR_DEFINES 0 + #endif +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)) + #define VK_NULL_HANDLE nullptr + #else + #define VK_NULL_HANDLE ((void*)0) + #endif + #else + #define VK_NULL_HANDLE 0ULL + #endif +#endif +#ifndef VK_NULL_HANDLE + #define VK_NULL_HANDLE 0 +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; + #else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; + #endif +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *(object); + #else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t (object); + #endif +#endif + + struct ANativeWindow; + struct AHardwareBuffer; + #ifdef __OBJC__ +@class CAMetalLayer; +#else +typedef void CAMetalLayer; +#endif + #ifdef __OBJC__ +@protocol MTLDevice; +typedef id<MTLDevice> MTLDevice_id; +#else +typedef void* MTLDevice_id; +#endif + #ifdef __OBJC__ +@protocol MTLCommandQueue; +typedef id<MTLCommandQueue> MTLCommandQueue_id; +#else +typedef void* MTLCommandQueue_id; +#endif + #ifdef __OBJC__ +@protocol MTLBuffer; +typedef id<MTLBuffer> MTLBuffer_id; +#else +typedef void* MTLBuffer_id; +#endif + #ifdef __OBJC__ +@protocol MTLTexture; +typedef id<MTLTexture> MTLTexture_id; +#else +typedef void* MTLTexture_id; +#endif + #ifdef __OBJC__ +@protocol MTLSharedEvent; +typedef id<MTLSharedEvent> MTLSharedEvent_id; +#else +typedef void* MTLSharedEvent_id; +#endif + typedef struct __IOSurface* IOSurfaceRef; + + typedef uint32_t VkSampleMask; + typedef uint32_t VkBool32; + typedef uint32_t VkFlags; + typedef uint64_t VkFlags64; + typedef uint64_t VkDeviceSize; + typedef uint64_t VkDeviceAddress; + + Basic C types, pulled in via vk_platform.h + + + + + + + + + + + + + + + + Bitmask types + typedef VkFlags VkFramebufferCreateFlags; + typedef VkFlags VkQueryPoolCreateFlags; + typedef VkFlags VkRenderPassCreateFlags; + typedef VkFlags VkSamplerCreateFlags; + typedef VkFlags VkPipelineLayoutCreateFlags; + typedef VkFlags VkPipelineCacheCreateFlags; + typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + typedef VkFlags VkPipelineDynamicStateCreateFlags; + typedef VkFlags VkPipelineColorBlendStateCreateFlags; + typedef VkFlags VkPipelineColorBlendStateCreateFlags; + typedef VkFlags VkPipelineMultisampleStateCreateFlags; + typedef VkFlags VkPipelineRasterizationStateCreateFlags; + typedef VkFlags VkPipelineViewportStateCreateFlags; + typedef VkFlags VkPipelineTessellationStateCreateFlags; + typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; + typedef VkFlags VkPipelineVertexInputStateCreateFlags; + typedef VkFlags VkPipelineShaderStageCreateFlags; + typedef VkFlags VkDescriptorSetLayoutCreateFlags; + typedef VkFlags VkBufferViewCreateFlags; + typedef VkFlags VkInstanceCreateFlags; + typedef VkFlags VkDeviceCreateFlags; + typedef VkFlags VkDeviceQueueCreateFlags; + typedef VkFlags VkQueueFlags; + typedef VkFlags VkMemoryPropertyFlags; + typedef VkFlags VkMemoryHeapFlags; + typedef VkFlags VkAccessFlags; + typedef VkFlags VkBufferUsageFlags; + typedef VkFlags VkBufferCreateFlags; + typedef VkFlags VkShaderStageFlags; + typedef VkFlags VkImageUsageFlags; + typedef VkFlags VkImageCreateFlags; + typedef VkFlags VkImageViewCreateFlags; + typedef VkFlags VkPipelineCreateFlags; + typedef VkFlags VkColorComponentFlags; + typedef VkFlags VkFenceCreateFlags; + typedef VkFlags VkSemaphoreCreateFlags; + typedef VkFlags VkFormatFeatureFlags; + typedef VkFlags VkQueryControlFlags; + typedef VkFlags VkQueryResultFlags; + typedef VkFlags VkShaderModuleCreateFlags; + typedef VkFlags VkEventCreateFlags; + typedef VkFlags VkCommandPoolCreateFlags; + typedef VkFlags VkCommandPoolResetFlags; + typedef VkFlags VkCommandBufferResetFlags; + typedef VkFlags VkCommandBufferUsageFlags; + typedef VkFlags VkQueryPipelineStatisticFlags; + typedef VkFlags VkMemoryMapFlags; + typedef VkFlags VkMemoryUnmapFlagsKHR; + typedef VkFlags VkImageAspectFlags; + typedef VkFlags VkSparseMemoryBindFlags; + typedef VkFlags VkSparseImageFormatFlags; + typedef VkFlags VkSubpassDescriptionFlags; + typedef VkFlags VkPipelineStageFlags; + typedef VkFlags VkSampleCountFlags; + typedef VkFlags VkAttachmentDescriptionFlags; + typedef VkFlags VkStencilFaceFlags; + typedef VkFlags VkCullModeFlags; + typedef VkFlags VkDescriptorPoolCreateFlags; + typedef VkFlags VkDescriptorPoolResetFlags; + typedef VkFlags VkDependencyFlags; + typedef VkFlags VkSubgroupFeatureFlags; + typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNV; + typedef VkFlags VkIndirectStateFlagsNV; + typedef VkFlags VkGeometryFlagsKHR; + + typedef VkFlags VkGeometryInstanceFlagsKHR; + + typedef VkFlags VkBuildAccelerationStructureFlagsKHR; + + typedef VkFlags VkPrivateDataSlotCreateFlags; + + typedef VkFlags VkAccelerationStructureCreateFlagsKHR; + typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; + + typedef VkFlags VkPipelineCreationFeedbackFlags; + + typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR; + typedef VkFlags VkAcquireProfilingLockFlagsKHR; + typedef VkFlags VkSemaphoreWaitFlags; + + typedef VkFlags VkPipelineCompilerControlFlagsAMD; + typedef VkFlags VkShaderCorePropertiesFlagsAMD; + typedef VkFlags VkDeviceDiagnosticsConfigFlagsNV; + typedef VkFlags VkRefreshObjectFlagsKHR; + typedef VkFlags64 VkAccessFlags2; + + typedef VkFlags64 VkPipelineStageFlags2; + + typedef VkFlags VkAccelerationStructureMotionInfoFlagsNV; + typedef VkFlags VkAccelerationStructureMotionInstanceFlagsNV; + typedef VkFlags64 VkFormatFeatureFlags2; + + typedef VkFlags VkRenderingFlags; + typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV; + + typedef VkFlags VkBuildMicromapFlagsEXT; + typedef VkFlags VkMicromapCreateFlagsEXT; + typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; + typedef VkFlags64 VkPipelineCreateFlags2KHR; + typedef VkFlags64 VkBufferUsageFlags2KHR; + + WSI extensions + typedef VkFlags VkCompositeAlphaFlagsKHR; + typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; + typedef VkFlags VkSurfaceTransformFlagsKHR; + typedef VkFlags VkSwapchainCreateFlagsKHR; + typedef VkFlags VkDisplayModeCreateFlagsKHR; + typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; + typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; + typedef VkFlags VkViSurfaceCreateFlagsNN; + typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; + typedef VkFlags VkWin32SurfaceCreateFlagsKHR; + typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + typedef VkFlags VkXcbSurfaceCreateFlagsKHR; + typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT; + typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + typedef VkFlags VkMetalSurfaceCreateFlagsEXT; + typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA; + typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP; + typedef VkFlags VkHeadlessSurfaceCreateFlagsEXT; + typedef VkFlags VkScreenSurfaceCreateFlagsQNX; + typedef VkFlags VkPeerMemoryFeatureFlags; + + typedef VkFlags VkMemoryAllocateFlags; + + typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; + + typedef VkFlags VkDebugReportFlagsEXT; + typedef VkFlags VkCommandPoolTrimFlags; + + typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; + typedef VkFlags VkExternalMemoryFeatureFlagsNV; + typedef VkFlags VkExternalMemoryHandleTypeFlags; + + typedef VkFlags VkExternalMemoryFeatureFlags; + + typedef VkFlags VkExternalSemaphoreHandleTypeFlags; + + typedef VkFlags VkExternalSemaphoreFeatureFlags; + + typedef VkFlags VkSemaphoreImportFlags; + + typedef VkFlags VkExternalFenceHandleTypeFlags; + + typedef VkFlags VkExternalFenceFeatureFlags; + + typedef VkFlags VkFenceImportFlags; + + typedef VkFlags VkSurfaceCounterFlagsEXT; + typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; + typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; + typedef VkFlags VkPipelineCoverageReductionStateCreateFlagsNV; + typedef VkFlags VkValidationCacheCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; + typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; + typedef VkFlags VkDeviceMemoryReportFlagsEXT; + typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + typedef VkFlags VkDescriptorBindingFlags; + + typedef VkFlags VkConditionalRenderingFlagsEXT; + typedef VkFlags VkResolveModeFlags; + + typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT; + typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT; + typedef VkFlags VkSwapchainImageUsageFlagsANDROID; + typedef VkFlags VkToolPurposeFlags; + + typedef VkFlags VkSubmitFlags; + + typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA; + typedef VkFlags VkHostImageCopyFlagsEXT; + typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA; + typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; + typedef VkFlags VkImageCompressionFlagsEXT; + typedef VkFlags VkImageCompressionFixedRateFlagsEXT; + typedef VkFlags VkExportMetalObjectTypeFlagsEXT; + typedef VkFlags VkDeviceAddressBindingFlagsEXT; + typedef VkFlags VkOpticalFlowGridSizeFlagsNV; + typedef VkFlags VkOpticalFlowUsageFlagsNV; + typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; + typedef VkFlags VkOpticalFlowExecuteFlagsNV; + typedef VkFlags VkFrameBoundaryFlagsEXT; + typedef VkFlags VkPresentScalingFlagsEXT; + typedef VkFlags VkPresentGravityFlagsEXT; + typedef VkFlags VkShaderCreateFlagsEXT; + typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; + + Video Core extension + typedef VkFlags VkVideoCodecOperationFlagsKHR; + typedef VkFlags VkVideoCapabilityFlagsKHR; + typedef VkFlags VkVideoSessionCreateFlagsKHR; + typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; + typedef VkFlags VkVideoBeginCodingFlagsKHR; + typedef VkFlags VkVideoEndCodingFlagsKHR; + typedef VkFlags VkVideoCodingControlFlagsKHR; + + Video Decode Core extension + typedef VkFlags VkVideoDecodeUsageFlagsKHR; + typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; + typedef VkFlags VkVideoDecodeFlagsKHR; + + Video Decode H.264 extension + typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; + + Video Encode Core extension + typedef VkFlags VkVideoEncodeFlagsKHR; + typedef VkFlags VkVideoEncodeUsageFlagsKHR; + typedef VkFlags VkVideoEncodeContentFlagsKHR; + typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; + typedef VkFlags VkVideoEncodeRateControlFlagsKHR; + typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; + typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; + typedef VkFlags VkVideoComponentBitDepthFlagsKHR; + + Video Encode H.264 extension + typedef VkFlags VkVideoEncodeH264CapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeH264StdFlagsKHR; + typedef VkFlags VkVideoEncodeH264RateControlFlagsKHR; + + Video Encode H.265 extension + typedef VkFlags VkVideoEncodeH265CapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeH265StdFlagsKHR; + typedef VkFlags VkVideoEncodeH265RateControlFlagsKHR; + typedef VkFlags VkVideoEncodeH265CtbSizeFlagsKHR; + typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsKHR; + + Types which can be void pointers or class pointers, selected at compile time + VK_DEFINE_HANDLE(VkInstance) + VK_DEFINE_HANDLE(VkPhysicalDevice) + VK_DEFINE_HANDLE(VkDevice) + VK_DEFINE_HANDLE(VkQueue) + VK_DEFINE_HANDLE(VkCommandBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPerformanceConfigurationINTEL) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeferredOperationKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) + + WSI extensions + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) + + Video extensions + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) + + VK_NV_external_sci_sync2 + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphoreSciSyncPoolNV) + + Types generated from corresponding enums tags below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSI extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enumerated types in the header, but not used by the API + + + + + + + + Video Core extensions + + + + + + + + + Video Decode extensions + + + + Video H.264 Decode extensions + + + Video H.265 Decode extensions + + Video Encode extensions + + + + + + + + + Video H.264 Encode extensions + + + + + Video H.265 Encode extensions + + + + + + + The PFN_vk*Function types are used by VkAllocationCallbacks below + typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + + The PFN_vkVoidFunction type are used by VkGet*ProcAddr below + typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); + + The PFN_vkDebugReportCallbackEXT type are used by the DEBUG_REPORT extension + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage, + void* pUserData); + + The PFN_vkDebugUtilsMessengerCallbackEXT type are used by the VK_EXT_debug_utils extension + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData); + + The PFN_vkFaultCallbackFunction type is used by VKSC_VERSION_1_0 + typedef void (VKAPI_PTR *PFN_vkFaultCallbackFunction)( + VkBool32 unrecordedFaults, + uint32_t faultCount, + const VkFaultData* pFaults); + + The PFN_vkDeviceMemoryReportCallbackEXT type is used by the VK_EXT_device_memory_report extension + typedef void (VKAPI_PTR *PFN_vkDeviceMemoryReportCallbackEXT)( + const VkDeviceMemoryReportCallbackDataEXT* pCallbackData, + void* pUserData); + + The PFN_vkGetInstanceProcAddrLUNARG type is used by the + VkDirectDriverLoadingInfoLUNARG structure. + We cannot introduce an explicit dependency on the + equivalent PFN_vkGetInstanceProcAddr type, even though + it is implicitly generated in the C header, because + that results in multiple definitions. + typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)( + VkInstance instance, const char* pName); + + Struct types + + VkStructureType sType + struct VkBaseOutStructure* pNext + + + VkStructureType sType + const struct VkBaseInStructure* pNext + + + int32_t x + int32_t y + + + int32_t x + int32_t y + int32_t z + + + uint32_t width + uint32_t height + + + uint32_t width + uint32_t height + uint32_t depth + + + float x + float y + float width + float height + float minDepth + float maxDepth + + + VkOffset2D offset + VkExtent2D extent + + + VkRect2D rect + uint32_t baseArrayLayer + uint32_t layerCount + + + VkComponentSwizzle r + VkComponentSwizzle g + VkComponentSwizzle b + VkComponentSwizzle a + + + uint32_t apiVersion + uint32_t driverVersion + uint32_t vendorID + uint32_t deviceID + VkPhysicalDeviceType deviceType + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + VkPhysicalDeviceLimits limits + VkPhysicalDeviceSparseProperties sparseProperties + + + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]extension name + uint32_t specVersionversion of the extension specification implemented + + + char layerName[VK_MAX_EXTENSION_NAME_SIZE]layer name + uint32_t specVersionversion of the layer specification implemented + uint32_t implementationVersionbuild or release version of the layer's library + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the layer + + + VkStructureType sType + const void* pNext + const char* pApplicationName + uint32_t applicationVersion + const char* pEngineName + uint32_t engineVersion + uint32_t apiVersion + + + void* pUserData + PFN_vkAllocationFunction pfnAllocation + PFN_vkReallocationFunction pfnReallocation + PFN_vkFreeFunction pfnFree + PFN_vkInternalAllocationNotification pfnInternalAllocation + PFN_vkInternalFreeNotification pfnInternalFree + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueCount + const float* pQueuePriorities + + + VkStructureType sType + const void* pNext + VkDeviceCreateFlags flags + uint32_t queueCreateInfoCount + const VkDeviceQueueCreateInfo* pQueueCreateInfos + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNamesOrdered list of layer names to be enabled + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNames + const VkPhysicalDeviceFeatures* pEnabledFeatures + + + VkStructureType sType + const void* pNext + VkInstanceCreateFlags flags + const VkApplicationInfo* pApplicationInfo + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNamesOrdered list of layer names to be enabled + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNamesExtension names to be enabled + + + VkQueueFlags queueFlagsQueue flags + uint32_t queueCount + uint32_t timestampValidBits + VkExtent3D minImageTransferGranularityMinimum alignment requirement for image transfers + + + uint32_t memoryTypeCount + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES] + uint32_t memoryHeapCount + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS] + + + VkStructureType sType + const void* pNext + VkDeviceSize allocationSizeSize of memory allocation + uint32_t memoryTypeIndexIndex of the of the memory type to allocate from + + + VkDeviceSize sizeSpecified in bytes + VkDeviceSize alignmentSpecified in bytes + uint32_t memoryTypeBitsBitmask of the allowed memory type indices into memoryTypes[] for this object + + + VkImageAspectFlags aspectMask + VkExtent3D imageGranularity + VkSparseImageFormatFlags flags + + + VkSparseImageFormatProperties formatProperties + uint32_t imageMipTailFirstLod + VkDeviceSize imageMipTailSizeSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + VkDeviceSize imageMipTailOffsetSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + VkDeviceSize imageMipTailStrideSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + + + VkMemoryPropertyFlags propertyFlagsMemory properties of this memory type + uint32_t heapIndexIndex of the memory heap allocations of this memory type are taken from + + + VkDeviceSize sizeAvailable memory in the heap + VkMemoryHeapFlags flagsFlags for the heap + + + VkStructureType sType + const void* pNext + VkDeviceMemory memoryMapped memory object + VkDeviceSize offsetOffset within the memory object where the range starts + VkDeviceSize sizeSize of the range within the memory object + + + VkFormatFeatureFlags linearTilingFeaturesFormat features in case of linear tiling + VkFormatFeatureFlags optimalTilingFeaturesFormat features in case of optimal tiling + VkFormatFeatureFlags bufferFeaturesFormat features supported by buffers + + + VkExtent3D maxExtentmax image dimensions for this resource type + uint32_t maxMipLevelsmax number of mipmap levels for this resource type + uint32_t maxArrayLayersmax array size for this resource type + VkSampleCountFlags sampleCountssupported sample counts for this resource type + VkDeviceSize maxResourceSizemax size (in bytes) of this resource type + + + VkBuffer bufferBuffer used for this descriptor slot. + VkDeviceSize offsetBase offset from buffer start in bytes to update in the descriptor set. + VkDeviceSize rangeSize in bytes of the buffer resource for this descriptor update. + + + VkSampler samplerSampler to write to the descriptor in case it is a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor. Ignored otherwise. + VkImageView imageViewImage view to write to the descriptor in case it is a SAMPLED_IMAGE, STORAGE_IMAGE, COMBINED_IMAGE_SAMPLER, or INPUT_ATTACHMENT descriptor. Ignored otherwise. + VkImageLayout imageLayoutLayout the image is expected to be in when accessed using this descriptor (only used if imageView is not VK_NULL_HANDLE). + + + VkStructureType sType + const void* pNext + VkDescriptorSet dstSetDestination descriptor set + uint32_t dstBindingBinding within the destination descriptor set to write + uint32_t dstArrayElementArray element within the destination binding to write + uint32_t descriptorCountNumber of descriptors to write (determines the size of the array pointed by pDescriptors) + VkDescriptorType descriptorTypeDescriptor type to write (determines which members of the array pointed by pDescriptors are going to be used) + const VkDescriptorImageInfo* pImageInfoSampler, image view, and layout for SAMPLER, COMBINED_IMAGE_SAMPLER, {SAMPLED,STORAGE}_IMAGE, and INPUT_ATTACHMENT descriptor types. + const VkDescriptorBufferInfo* pBufferInfoRaw buffer, size, and offset for {UNIFORM,STORAGE}_BUFFER[_DYNAMIC] descriptor types. + const VkBufferView* pTexelBufferViewBuffer view to write to the descriptor for {UNIFORM,STORAGE}_TEXEL_BUFFER descriptor types. + + + VkStructureType sType + const void* pNext + VkDescriptorSet srcSetSource descriptor set + uint32_t srcBindingBinding within the source descriptor set to copy from + uint32_t srcArrayElementArray element within the source binding to copy from + VkDescriptorSet dstSetDestination descriptor set + uint32_t dstBindingBinding within the destination descriptor set to copy to + uint32_t dstArrayElementArray element within the destination binding to copy to + uint32_t descriptorCountNumber of descriptors to write (determines the size of the array pointed by pDescriptors) + + + VkStructureType sType + const void* pNext + VkBufferUsageFlags2KHR usage + + + VkStructureType sType + const void* pNext + VkBufferCreateFlags flagsBuffer creation flags + VkDeviceSize sizeSpecified in bytes + VkBufferUsageFlags usageBuffer usage flags + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + + + VkStructureType sType + const void* pNext + VkBufferViewCreateFlags flags + VkBuffer buffer + VkFormat formatOptionally specifies format of elements + VkDeviceSize offsetSpecified in bytes + VkDeviceSize rangeView size specified in bytes + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t arrayLayer + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t baseArrayLayer + uint32_t layerCount + + + VkImageAspectFlags aspectMask + uint32_t baseMipLevel + uint32_t levelCount + uint32_t baseArrayLayer + uint32_t layerCount + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + uint32_t srcQueueFamilyIndexQueue family to transition ownership from + uint32_t dstQueueFamilyIndexQueue family to transition ownership to + VkBuffer bufferBuffer to sync + VkDeviceSize offsetOffset within the buffer to sync + VkDeviceSize sizeAmount of bytes to sync + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + VkImageLayout oldLayoutCurrent layout of the image + VkImageLayout newLayoutNew layout to transition the image to + uint32_t srcQueueFamilyIndexQueue family to transition ownership from + uint32_t dstQueueFamilyIndexQueue family to transition ownership to + VkImage imageImage to sync + VkImageSubresourceRange subresourceRangeSubresource range to sync + + + VkStructureType sType + const void* pNext + VkImageCreateFlags flagsImage creation flags + VkImageType imageType + VkFormat format + VkExtent3D extent + uint32_t mipLevels + uint32_t arrayLayers + VkSampleCountFlagBits samples + VkImageTiling tiling + VkImageUsageFlags usageImage usage flags + VkSharingMode sharingModeCross-queue-family sharing mode + uint32_t queueFamilyIndexCountNumber of queue families to share across + const uint32_t* pQueueFamilyIndicesArray of queue family indices to share across + VkImageLayout initialLayoutInitial image layout for all subresources + + + VkDeviceSize offsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + VkDeviceSize rowPitchSpecified in bytes + VkDeviceSize arrayPitchSpecified in bytes + VkDeviceSize depthPitchSpecified in bytes + + + VkStructureType sType + const void* pNext + VkImageViewCreateFlags flags + VkImage image + VkImageViewType viewType + VkFormat format + VkComponentMapping components + VkImageSubresourceRange subresourceRange + + + VkDeviceSize srcOffsetSpecified in bytes + VkDeviceSize dstOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + + + VkDeviceSize resourceOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + VkDeviceMemory memory + VkDeviceSize memoryOffsetSpecified in bytes + VkSparseMemoryBindFlags flags + + + VkImageSubresource subresource + VkOffset3D offset + VkExtent3D extent + VkDeviceMemory memory + VkDeviceSize memoryOffsetSpecified in bytes + VkSparseMemoryBindFlags flags + + + VkBuffer buffer + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + + VkImage image + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + + VkImage image + uint32_t bindCount + const VkSparseImageMemoryBind* pBinds + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + uint32_t bufferBindCount + const VkSparseBufferMemoryBindInfo* pBufferBinds + uint32_t imageOpaqueBindCount + const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds + uint32_t imageBindCount + const VkSparseImageMemoryBindInfo* pImageBinds + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsetSpecified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D extentSpecified in pixels for both compressed and uncompressed images + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsets[2]Specified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsets[2]Specified in pixels for both compressed and uncompressed images + + + VkDeviceSize bufferOffsetSpecified in bytes + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + VkDeviceAddress srcAddress + VkDeviceAddress dstAddress + VkDeviceSize sizeSpecified in bytes + + + VkDeviceAddress srcAddress + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + + VkStructureType sType + const void* pNextnoautovalidity because this structure can be either an explicit parameter, or passed in a pNext chain + VkShaderModuleCreateFlags flags + size_t codeSizeSpecified in bytes + const uint32_t* pCodeBinary code of size codeSize + + + uint32_t bindingBinding number for this entry + VkDescriptorType descriptorTypeType of the descriptors in this binding + uint32_t descriptorCountNumber of descriptors in this binding + VkShaderStageFlags stageFlagsShader stages this binding is visible to + const VkSampler* pImmutableSamplersImmutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains count number of elements) + + + VkStructureType sType + const void* pNext + VkDescriptorSetLayoutCreateFlags flags + uint32_t bindingCountNumber of bindings in the descriptor set layout + const VkDescriptorSetLayoutBinding* pBindingsArray of descriptor set layout bindings + + + VkDescriptorType type + uint32_t descriptorCount + + + VkStructureType sType + const void* pNext + VkDescriptorPoolCreateFlags flags + uint32_t maxSets + uint32_t poolSizeCount + const VkDescriptorPoolSize* pPoolSizes + + + VkStructureType sType + const void* pNext + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSetLayout* pSetLayouts + + + uint32_t constantIDThe SpecConstant ID specified in the BIL + uint32_t offsetOffset of the value in the data block + size_t sizeSize in bytes of the SpecConstant + + + uint32_t mapEntryCountNumber of entries in the map + const VkSpecializationMapEntry* pMapEntriesArray of map entries + size_t dataSizeSize in bytes of pData + const void* pDataPointer to SpecConstant data + + + VkStructureType sType + const void* pNext + VkPipelineShaderStageCreateFlags flags + VkShaderStageFlagBits stageShader stage + VkShaderModule moduleModule containing entry point + const char* pNameNull-terminated entry point name + const char* pNameNull-terminated entry point name + const VkSpecializationInfo* pSpecializationInfo + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + VkPipelineShaderStageCreateInfo stage + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkDeviceAddress deviceAddress + VkDeviceSize size + VkDeviceAddress pipelineDeviceAddressCaptureReplay + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags2KHR flags + + + uint32_t bindingVertex buffer binding id + uint32_t strideDistance between vertices in bytes (0 = no advancement) + VkVertexInputRate inputRateThe rate at which the vertex data is consumed + + + uint32_t locationlocation of the shader vertex attrib + uint32_t bindingVertex buffer binding id + VkFormat formatformat of source data + uint32_t offsetOffset of first element in bytes from base of vertex + + + VkStructureType sType + const void* pNext + VkPipelineVertexInputStateCreateFlags flags + uint32_t vertexBindingDescriptionCountnumber of bindings + const VkVertexInputBindingDescription* pVertexBindingDescriptions + uint32_t vertexAttributeDescriptionCountnumber of attributes + const VkVertexInputAttributeDescription* pVertexAttributeDescriptions + + + VkStructureType sType + const void* pNext + VkPipelineInputAssemblyStateCreateFlags flags + VkPrimitiveTopology topology + VkBool32 primitiveRestartEnable + + + VkStructureType sType + const void* pNext + VkPipelineTessellationStateCreateFlags flags + uint32_t patchControlPoints + + + VkStructureType sType + const void* pNext + VkPipelineViewportStateCreateFlags flags + uint32_t viewportCount + const VkViewport* pViewports + uint32_t scissorCount + const VkRect2D* pScissors + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationStateCreateFlags flags + VkBool32 depthClampEnable + VkBool32 rasterizerDiscardEnable + VkPolygonMode polygonModeoptional (GL45) + VkCullModeFlags cullMode + VkFrontFace frontFace + VkBool32 depthBiasEnable + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + float lineWidth + + + VkStructureType sType + const void* pNext + VkPipelineMultisampleStateCreateFlags flags + VkSampleCountFlagBits rasterizationSamplesNumber of samples used for rasterization + VkBool32 sampleShadingEnableoptional (GL45) + float minSampleShadingoptional (GL45) + const VkSampleMask* pSampleMaskArray of sampleMask words + VkBool32 alphaToCoverageEnable + VkBool32 alphaToOneEnable + + + VkBool32 blendEnable + VkBlendFactor srcColorBlendFactor + VkBlendFactor dstColorBlendFactor + VkBlendOp colorBlendOp + VkBlendFactor srcAlphaBlendFactor + VkBlendFactor dstAlphaBlendFactor + VkBlendOp alphaBlendOp + VkColorComponentFlags colorWriteMask + + + VkStructureType sType + const void* pNext + VkPipelineColorBlendStateCreateFlags flags + VkBool32 logicOpEnable + VkLogicOp logicOp + uint32_t attachmentCount# of pAttachments + const VkPipelineColorBlendAttachmentState* pAttachments + float blendConstants[4] + + + VkStructureType sType + const void* pNext + VkPipelineDynamicStateCreateFlags flags + uint32_t dynamicStateCount + const VkDynamicState* pDynamicStates + + + VkStencilOp failOp + VkStencilOp passOp + VkStencilOp depthFailOp + VkCompareOp compareOp + uint32_t compareMask + uint32_t writeMask + uint32_t reference + + + VkStructureType sType + const void* pNext + VkPipelineDepthStencilStateCreateFlags flags + VkBool32 depthTestEnable + VkBool32 depthWriteEnable + VkCompareOp depthCompareOp + VkBool32 depthBoundsTestEnableoptional (depth_bounds_test) + VkBool32 stencilTestEnable + VkStencilOpState front + VkStencilOpState back + float minDepthBounds + float maxDepthBounds + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + const VkPipelineVertexInputStateCreateInfo* pVertexInputState + const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState + const VkPipelineTessellationStateCreateInfo* pTessellationState + const VkPipelineViewportStateCreateInfo* pViewportState + const VkPipelineRasterizationStateCreateInfo* pRasterizationState + const VkPipelineMultisampleStateCreateInfo* pMultisampleState + const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState + const VkPipelineColorBlendStateCreateInfo* pColorBlendState + const VkPipelineDynamicStateCreateInfo* pDynamicState + VkPipelineLayout layoutInterface layout of the pipeline + VkRenderPass renderPass + uint32_t subpass + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkPipelineCacheCreateFlags flags + size_t initialDataSizeSize of initial data to populate cache, in bytes + size_t initialDataSizeSize of initial data to populate cache, in bytes + const void* pInitialDataInitial data to populate cache + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint32_t headerSize + VkPipelineCacheHeaderVersion headerVersion + uint32_t vendorID + uint32_t deviceID + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint64_t codeSize + uint64_t codeOffset + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint8_t pipelineIdentifier[VK_UUID_SIZE] + uint64_t pipelineMemorySize + uint64_t jsonSize + uint64_t jsonOffset + uint32_t stageIndexCount + uint32_t stageIndexStride + uint64_t stageIndexOffset + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + VkPipelineCacheHeaderVersionOne headerVersionOne + VkPipelineCacheValidationVersion validationVersion + uint32_t implementationData + uint32_t pipelineIndexCount + uint32_t pipelineIndexStride + uint64_t pipelineIndexOffset + + + VkShaderStageFlags stageFlagsWhich stages use the range + uint32_t offsetStart of the range, in bytes + uint32_t sizeSize of the range, in bytes + + + VkStructureType sType + const void* pNext + VkPipelineLayoutCreateFlags flags + uint32_t setLayoutCountNumber of descriptor sets interfaced by the pipeline + const VkDescriptorSetLayout* pSetLayoutsArray of setCount number of descriptor set layout objects defining the layout of the + uint32_t pushConstantRangeCountNumber of push-constant ranges used by the pipeline + const VkPushConstantRange* pPushConstantRangesArray of pushConstantRangeCount number of ranges used by various shader stages + + + VkStructureType sType + const void* pNext + VkSamplerCreateFlags flags + VkFilter magFilterFilter mode for magnification + VkFilter minFilterFilter mode for minifiation + VkSamplerMipmapMode mipmapModeMipmap selection mode + VkSamplerAddressMode addressModeU + VkSamplerAddressMode addressModeV + VkSamplerAddressMode addressModeW + float mipLodBias + VkBool32 anisotropyEnable + float maxAnisotropy + VkBool32 compareEnable + VkCompareOp compareOp + float minLod + float maxLod + VkBorderColor borderColor + VkBool32 unnormalizedCoordinates + + + VkStructureType sType + const void* pNext + VkCommandPoolCreateFlags flagsCommand pool creation flags + uint32_t queueFamilyIndex + + + VkStructureType sType + const void* pNext + VkCommandPool commandPool + VkCommandBufferLevel level + uint32_t commandBufferCount + + + VkStructureType sType + const void* pNext + VkRenderPass renderPassRender pass for secondary command buffers + uint32_t subpass + VkFramebuffer framebufferFramebuffer for secondary command buffers + VkBool32 occlusionQueryEnableWhether this secondary command buffer may be executed during an occlusion query + VkQueryControlFlags queryFlagsQuery flags used by this secondary command buffer, if executed during an occlusion query + VkQueryPipelineStatisticFlags pipelineStatisticsPipeline statistics that may be counted for this secondary command buffer + + + VkStructureType sType + const void* pNext + VkCommandBufferUsageFlags flagsCommand buffer usage flags + const VkCommandBufferInheritanceInfo* pInheritanceInfoPointer to inheritance info for secondary command buffers + + + VkStructureType sType + const void* pNext + VkRenderPass renderPass + VkFramebuffer framebuffer + VkRect2D renderArea + uint32_t clearValueCount + const VkClearValue* pClearValues + + + float float32[4] + int32_t int32[4] + uint32_t uint32[4] + + + float depth + uint32_t stencil + + + VkClearColorValue color + VkClearDepthStencilValue depthStencil + + + VkImageAspectFlags aspectMask + uint32_t colorAttachment + VkClearValue clearValue + + + VkAttachmentDescriptionFlags flags + VkFormat format + VkSampleCountFlagBits samples + VkAttachmentLoadOp loadOpLoad operation for color or depth data + VkAttachmentStoreOp storeOpStore operation for color or depth data + VkAttachmentLoadOp stencilLoadOpLoad operation for stencil data + VkAttachmentStoreOp stencilStoreOpStore operation for stencil data + VkImageLayout initialLayout + VkImageLayout finalLayout + + + uint32_t attachment + VkImageLayout layout + + + VkSubpassDescriptionFlags flags + VkPipelineBindPoint pipelineBindPointMust be VK_PIPELINE_BIND_POINT_GRAPHICS for now + uint32_t inputAttachmentCount + const VkAttachmentReference* pInputAttachments + uint32_t colorAttachmentCount + const VkAttachmentReference* pColorAttachments + const VkAttachmentReference* pResolveAttachments + const VkAttachmentReference* pDepthStencilAttachment + uint32_t preserveAttachmentCount + const uint32_t* pPreserveAttachments + + + uint32_t srcSubpass + uint32_t dstSubpass + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + VkDependencyFlags dependencyFlags + + + VkStructureType sType + const void* pNext + VkRenderPassCreateFlags flags + uint32_t attachmentCount + const VkAttachmentDescription* pAttachments + uint32_t subpassCount + const VkSubpassDescription* pSubpasses + uint32_t dependencyCount + const VkSubpassDependency* pDependencies + + + VkStructureType sType + const void* pNext + VkEventCreateFlags flagsEvent creation flags + + + VkStructureType sType + const void* pNext + VkFenceCreateFlags flagsFence creation flags + + + VkBool32 robustBufferAccessout of bounds buffer accesses are well defined + VkBool32 fullDrawIndexUint32full 32-bit range of indices for indexed draw calls + VkBool32 imageCubeArrayimage views which are arrays of cube maps + VkBool32 independentBlendblending operations are controlled per-attachment + VkBool32 geometryShadergeometry stage + VkBool32 tessellationShadertessellation control and evaluation stage + VkBool32 sampleRateShadingper-sample shading and interpolation + VkBool32 dualSrcBlendblend operations which take two sources + VkBool32 logicOplogic operations + VkBool32 multiDrawIndirectmulti draw indirect + VkBool32 drawIndirectFirstInstanceindirect drawing can use non-zero firstInstance + VkBool32 depthClampdepth clamping + VkBool32 depthBiasClampdepth bias clamping + VkBool32 fillModeNonSolidpoint and wireframe fill modes + VkBool32 depthBoundsdepth bounds test + VkBool32 wideLineslines with width greater than 1 + VkBool32 largePointspoints with size greater than 1 + VkBool32 alphaToOnethe fragment alpha component can be forced to maximum representable alpha value + VkBool32 multiViewportviewport arrays + VkBool32 samplerAnisotropyanisotropic sampler filtering + VkBool32 textureCompressionETC2ETC texture compression formats + VkBool32 textureCompressionASTC_LDRASTC LDR texture compression formats + VkBool32 textureCompressionBCBC1-7 texture compressed formats + VkBool32 occlusionQueryPreciseprecise occlusion queries returning actual sample counts + VkBool32 pipelineStatisticsQuerypipeline statistics query + VkBool32 vertexPipelineStoresAndAtomicsstores and atomic ops on storage buffers and images are supported in vertex, tessellation, and geometry stages + VkBool32 fragmentStoresAndAtomicsstores and atomic ops on storage buffers and images are supported in the fragment stage + VkBool32 shaderTessellationAndGeometryPointSizetessellation and geometry stages can export point size + VkBool32 shaderImageGatherExtendedimage gather with run-time values and independent offsets + VkBool32 shaderStorageImageExtendedFormatsthe extended set of formats can be used for storage images + VkBool32 shaderStorageImageMultisamplemultisample images can be used for storage images + VkBool32 shaderStorageImageReadWithoutFormatread from storage image does not require format qualifier + VkBool32 shaderStorageImageWriteWithoutFormatwrite to storage image does not require format qualifier + VkBool32 shaderUniformBufferArrayDynamicIndexingarrays of uniform buffers can be accessed with dynamically uniform indices + VkBool32 shaderSampledImageArrayDynamicIndexingarrays of sampled images can be accessed with dynamically uniform indices + VkBool32 shaderStorageBufferArrayDynamicIndexingarrays of storage buffers can be accessed with dynamically uniform indices + VkBool32 shaderStorageImageArrayDynamicIndexingarrays of storage images can be accessed with dynamically uniform indices + VkBool32 shaderClipDistanceclip distance in shaders + VkBool32 shaderCullDistancecull distance in shaders + VkBool32 shaderFloat6464-bit floats (doubles) in shaders + VkBool32 shaderInt6464-bit integers in shaders + VkBool32 shaderInt1616-bit integers in shaders + VkBool32 shaderResourceResidencyshader can use texture operations that return resource residency information (requires sparseNonResident support) + VkBool32 shaderResourceMinLodshader can use texture operations that specify minimum resource LOD + VkBool32 sparseBindingSparse resources support: Resource memory can be managed at opaque page level rather than object level + VkBool32 sparseResidencyBufferSparse resources support: GPU can access partially resident buffers + VkBool32 sparseResidencyImage2DSparse resources support: GPU can access partially resident 2D (non-MSAA non-depth/stencil) images + VkBool32 sparseResidencyImage3DSparse resources support: GPU can access partially resident 3D images + VkBool32 sparseResidency2SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 2 samples + VkBool32 sparseResidency4SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 4 samples + VkBool32 sparseResidency8SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 8 samples + VkBool32 sparseResidency16SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 16 samples + VkBool32 sparseResidencyAliasedSparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) + VkBool32 variableMultisampleRatemultisample rate must be the same for all pipelines in a subpass + VkBool32 inheritedQueriesQueries may be inherited from primary to secondary command buffers + + + VkBool32 residencyStandard2DBlockShapeSparse resources support: GPU will access all 2D (single sample) sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyStandard2DMultisampleBlockShapeSparse resources support: GPU will access all 2D (multisample) sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyStandard3DBlockShapeSparse resources support: GPU will access all 3D sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyAlignedMipSizeSparse resources support: Images with mip level dimensions that are NOT a multiple of the sparse image block dimensions will be placed in the mip tail + VkBool32 residencyNonResidentStrictSparse resources support: GPU can consistently access non-resident regions of a resource, all reads return as if data is 0, writes are discarded + + + resource maximum sizes + uint32_t maxImageDimension1Dmax 1D image dimension + uint32_t maxImageDimension2Dmax 2D image dimension + uint32_t maxImageDimension3Dmax 3D image dimension + uint32_t maxImageDimensionCubemax cubemap image dimension + uint32_t maxImageArrayLayersmax layers for image arrays + uint32_t maxTexelBufferElementsmax texel buffer size (fstexels) + uint32_t maxUniformBufferRangemax uniform buffer range (bytes) + uint32_t maxStorageBufferRangemax storage buffer range (bytes) + uint32_t maxPushConstantsSizemax size of the push constants pool (bytes) + memory limits + uint32_t maxMemoryAllocationCountmax number of device memory allocations supported + uint32_t maxSamplerAllocationCountmax number of samplers that can be allocated on a device + VkDeviceSize bufferImageGranularityGranularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage + VkDeviceSize sparseAddressSpaceSizeTotal address space available for sparse allocations (bytes) + descriptor set limits + uint32_t maxBoundDescriptorSetsmax number of descriptors sets that can be bound to a pipeline + uint32_t maxPerStageDescriptorSamplersmax number of samplers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorUniformBuffersmax number of uniform buffers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorStorageBuffersmax number of storage buffers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorSampledImagesmax number of sampled images allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorStorageImagesmax number of storage images allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorInputAttachmentsmax number of input attachments allowed per-stage in a descriptor set + uint32_t maxPerStageResourcesmax number of resources allowed by a single stage + uint32_t maxDescriptorSetSamplersmax number of samplers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetUniformBuffersmax number of uniform buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetUniformBuffersDynamicmax number of dynamic uniform buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageBuffersmax number of storage buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageBuffersDynamicmax number of dynamic storage buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetSampledImagesmax number of sampled images allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageImagesmax number of storage images allowed in all stages in a descriptor set + uint32_t maxDescriptorSetInputAttachmentsmax number of input attachments allowed in all stages in a descriptor set + vertex stage limits + uint32_t maxVertexInputAttributesmax number of vertex input attribute slots + uint32_t maxVertexInputBindingsmax number of vertex input binding slots + uint32_t maxVertexInputAttributeOffsetmax vertex input attribute offset added to vertex buffer offset + uint32_t maxVertexInputBindingStridemax vertex input binding stride + uint32_t maxVertexOutputComponentsmax number of output components written by vertex shader + tessellation control stage limits + uint32_t maxTessellationGenerationLevelmax level supported by tessellation primitive generator + uint32_t maxTessellationPatchSizemax patch size (vertices) + uint32_t maxTessellationControlPerVertexInputComponentsmax number of input components per-vertex in TCS + uint32_t maxTessellationControlPerVertexOutputComponentsmax number of output components per-vertex in TCS + uint32_t maxTessellationControlPerPatchOutputComponentsmax number of output components per-patch in TCS + uint32_t maxTessellationControlTotalOutputComponentsmax total number of per-vertex and per-patch output components in TCS + tessellation evaluation stage limits + uint32_t maxTessellationEvaluationInputComponentsmax number of input components per vertex in TES + uint32_t maxTessellationEvaluationOutputComponentsmax number of output components per vertex in TES + geometry stage limits + uint32_t maxGeometryShaderInvocationsmax invocation count supported in geometry shader + uint32_t maxGeometryInputComponentsmax number of input components read in geometry stage + uint32_t maxGeometryOutputComponentsmax number of output components written in geometry stage + uint32_t maxGeometryOutputVerticesmax number of vertices that can be emitted in geometry stage + uint32_t maxGeometryTotalOutputComponentsmax total number of components (all vertices) written in geometry stage + fragment stage limits + uint32_t maxFragmentInputComponentsmax number of input components read in fragment stage + uint32_t maxFragmentOutputAttachmentsmax number of output attachments written in fragment stage + uint32_t maxFragmentDualSrcAttachmentsmax number of output attachments written when using dual source blending + uint32_t maxFragmentCombinedOutputResourcesmax total number of storage buffers, storage images and output buffers + compute stage limits + uint32_t maxComputeSharedMemorySizemax total storage size of work group local storage (bytes) + uint32_t maxComputeWorkGroupCount[3]max num of compute work groups that may be dispatched by a single command (x,y,z) + uint32_t maxComputeWorkGroupInvocationsmax total compute invocations in a single local work group + uint32_t maxComputeWorkGroupSize[3]max local size of a compute work group (x,y,z) + uint32_t subPixelPrecisionBitsnumber bits of subpixel precision in screen x and y + uint32_t subTexelPrecisionBitsnumber bits of precision for selecting texel weights + uint32_t mipmapPrecisionBitsnumber bits of precision for selecting mipmap weights + uint32_t maxDrawIndexedIndexValuemax index value for indexed draw calls (for 32-bit indices) + uint32_t maxDrawIndirectCountmax draw count for indirect drawing calls + float maxSamplerLodBiasmax absolute sampler LOD bias + float maxSamplerAnisotropymax degree of sampler anisotropy + uint32_t maxViewportsmax number of active viewports + uint32_t maxViewportDimensions[2]max viewport dimensions (x,y) + float viewportBoundsRange[2]viewport bounds range (min,max) + uint32_t viewportSubPixelBitsnumber bits of subpixel precision for viewport + size_t minMemoryMapAlignmentmin required alignment of pointers returned by MapMemory (bytes) + VkDeviceSize minTexelBufferOffsetAlignmentmin required alignment for texel buffer offsets (bytes) + VkDeviceSize minUniformBufferOffsetAlignmentmin required alignment for uniform buffer sizes and offsets (bytes) + VkDeviceSize minStorageBufferOffsetAlignmentmin required alignment for storage buffer offsets (bytes) + int32_t minTexelOffsetmin texel offset for OpTextureSampleOffset + uint32_t maxTexelOffsetmax texel offset for OpTextureSampleOffset + int32_t minTexelGatherOffsetmin texel offset for OpTextureGatherOffset + uint32_t maxTexelGatherOffsetmax texel offset for OpTextureGatherOffset + float minInterpolationOffsetfurthest negative offset for interpolateAtOffset + float maxInterpolationOffsetfurthest positive offset for interpolateAtOffset + uint32_t subPixelInterpolationOffsetBitsnumber of subpixel bits for interpolateAtOffset + uint32_t maxFramebufferWidthmax width for a framebuffer + uint32_t maxFramebufferHeightmax height for a framebuffer + uint32_t maxFramebufferLayersmax layer count for a layered framebuffer + VkSampleCountFlags framebufferColorSampleCountssupported color sample counts for a framebuffer + VkSampleCountFlags framebufferDepthSampleCountssupported depth sample counts for a framebuffer + VkSampleCountFlags framebufferStencilSampleCountssupported stencil sample counts for a framebuffer + VkSampleCountFlags framebufferNoAttachmentsSampleCountssupported sample counts for a subpass which uses no attachments + uint32_t maxColorAttachmentsmax number of color attachments per subpass + VkSampleCountFlags sampledImageColorSampleCountssupported color sample counts for a non-integer sampled image + VkSampleCountFlags sampledImageIntegerSampleCountssupported sample counts for an integer image + VkSampleCountFlags sampledImageDepthSampleCountssupported depth sample counts for a sampled image + VkSampleCountFlags sampledImageStencilSampleCountssupported stencil sample counts for a sampled image + VkSampleCountFlags storageImageSampleCountssupported sample counts for a storage image + uint32_t maxSampleMaskWordsmax number of sample mask words + VkBool32 timestampComputeAndGraphicstimestamps on graphics and compute queues + float timestampPeriodnumber of nanoseconds it takes for timestamp query value to increment by 1 + uint32_t maxClipDistancesmax number of clip distances + uint32_t maxCullDistancesmax number of cull distances + uint32_t maxCombinedClipAndCullDistancesmax combined number of user clipping + uint32_t discreteQueuePrioritiesdistinct queue priorities available + float pointSizeRange[2]range (min,max) of supported point sizes + float lineWidthRange[2]range (min,max) of supported line widths + float pointSizeGranularitygranularity of supported point sizes + float lineWidthGranularitygranularity of supported line widths + VkBool32 strictLinesline rasterization follows preferred rules + VkBool32 standardSampleLocationssupports standard sample locations for all supported sample counts + VkDeviceSize optimalBufferCopyOffsetAlignmentoptimal offset of buffer copies + VkDeviceSize optimalBufferCopyRowPitchAlignmentoptimal pitch of buffer copies + VkDeviceSize nonCoherentAtomSizeminimum size and alignment for non-coherent host-mapped device memory access + + + VkStructureType sType + const void* pNext + VkSemaphoreCreateFlags flagsSemaphore creation flags + + + VkStructureType sType + const void* pNext + VkQueryPoolCreateFlags flags + VkQueryType queryType + uint32_t queryCount + VkQueryPipelineStatisticFlags pipelineStatisticsOptional + + + VkStructureType sType + const void* pNext + VkFramebufferCreateFlags flags + VkRenderPass renderPass + uint32_t attachmentCount + const VkImageView* pAttachments + uint32_t width + uint32_t height + uint32_t layers + + + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + + uint32_t x + uint32_t y + uint32_t z + + + uint32_t firstVertex + uint32_t vertexCount + + + uint32_t firstIndex + uint32_t indexCount + int32_t vertexOffset + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + const VkPipelineStageFlags* pWaitDstStageMask + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + WSI extensions + + VkDisplayKHR displayHandle of the display object + const char* displayNameName of the display + VkExtent2D physicalDimensionsIn millimeters? + VkExtent2D physicalResolutionMax resolution for CRT? + VkSurfaceTransformFlagsKHR supportedTransformsone or more bits from VkSurfaceTransformFlagsKHR + VkBool32 planeReorderPossibleVK_TRUE if the overlay plane's z-order can be changed on this display. + VkBool32 persistentContentVK_TRUE if this is a "smart" display that supports self-refresh/internal buffering. + + + VkDisplayKHR currentDisplayDisplay the plane is currently associated with. Will be VK_NULL_HANDLE if the plane is not in use. + uint32_t currentStackIndexCurrent z-order of the plane. + + + VkExtent2D visibleRegionVisible scanout region. + uint32_t refreshRateNumber of times per second the display is updated. + + + VkDisplayModeKHR displayModeHandle of this display mode. + VkDisplayModeParametersKHR parametersThe parameters this mode uses. + + + VkStructureType sType + const void* pNext + VkDisplayModeCreateFlagsKHR flags + VkDisplayModeParametersKHR parametersThe parameters this mode uses. + + + VkDisplayPlaneAlphaFlagsKHR supportedAlphaTypes of alpha blending supported, if any. + VkOffset2D minSrcPositionDoes the plane have any position and extent restrictions? + VkOffset2D maxSrcPosition + VkExtent2D minSrcExtent + VkExtent2D maxSrcExtent + VkOffset2D minDstPosition + VkOffset2D maxDstPosition + VkExtent2D minDstExtent + VkExtent2D maxDstExtent + + + VkStructureType sType + const void* pNext + VkDisplaySurfaceCreateFlagsKHR flags + VkDisplayModeKHR displayModeThe mode to use when displaying this surface + uint32_t planeIndexThe plane on which this surface appears. Must be between 0 and the value returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR() in pPropertyCount. + uint32_t planeStackIndexThe z-order of the plane. + VkSurfaceTransformFlagBitsKHR transformTransform to apply to the images as part of the scanout operation + float globalAlphaGlobal alpha value. Must be between 0 and 1, inclusive. Ignored if alphaMode is not VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR + VkDisplayPlaneAlphaFlagBitsKHR alphaModeWhat type of alpha blending to use. Must be a bit from vkGetDisplayPlanePropertiesKHR::supportedAlpha. + VkExtent2D imageExtentsize of the images to use with this surface + + + VkStructureType sType + const void* pNext + VkRect2D srcRectRectangle within the presentable image to read pixel data from when presenting to the display. + VkRect2D dstRectRectangle within the current display mode's visible region to display srcRectangle in. + VkBool32 persistentFor smart displays, use buffered mode. If the display properties member "persistentMode" is VK_FALSE, this member must always be VK_FALSE. + + + uint32_t minImageCountSupported minimum number of images for the surface + uint32_t maxImageCountSupported maximum number of images for the surface, 0 for unlimited + VkExtent2D currentExtentCurrent image width and height for the surface, (0, 0) if undefined + VkExtent2D minImageExtentSupported minimum image width and height for the surface + VkExtent2D maxImageExtentSupported maximum image width and height for the surface + uint32_t maxImageArrayLayersSupported maximum number of image layers for the surface + VkSurfaceTransformFlagsKHR supportedTransforms1 or more bits representing the transforms supported + VkSurfaceTransformFlagBitsKHR currentTransformThe surface's current transform relative to the device's natural orientation + VkCompositeAlphaFlagsKHR supportedCompositeAlpha1 or more bits representing the alpha compositing modes supported + VkImageUsageFlags supportedUsageFlagsSupported image usage flags for the surface + + + VkStructureType sType + const void* pNext + VkAndroidSurfaceCreateFlagsKHR flags + struct ANativeWindow* window + + + VkStructureType sType + const void* pNext + VkViSurfaceCreateFlagsNN flags + void* window + + + VkStructureType sType + const void* pNext + VkWaylandSurfaceCreateFlagsKHR flags + struct wl_display* display + struct wl_surface* surface + + + VkStructureType sType + const void* pNext + VkWin32SurfaceCreateFlagsKHR flags + HINSTANCE hinstance + HWND hwnd + + + VkStructureType sType + const void* pNext + VkXlibSurfaceCreateFlagsKHR flags + Display* dpy + Window window + + + VkStructureType sType + const void* pNext + VkXcbSurfaceCreateFlagsKHR flags + xcb_connection_t* connection + xcb_window_t window + + + VkStructureType sType + const void* pNext + VkDirectFBSurfaceCreateFlagsEXT flags + IDirectFB* dfb + IDirectFBSurface* surface + + + VkStructureType sType + const void* pNext + VkImagePipeSurfaceCreateFlagsFUCHSIA flags + zx_handle_t imagePipeHandle + + + VkStructureType sType + const void* pNext + VkStreamDescriptorSurfaceCreateFlagsGGP flags + GgpStreamDescriptor streamDescriptor + + + VkStructureType sType + const void* pNext + VkScreenSurfaceCreateFlagsQNX flags + struct _screen_context* context + struct _screen_window* window + + + VkFormat formatSupported pair of rendering format + VkColorSpaceKHR colorSpaceand color space for the surface + + + VkStructureType sType + const void* pNext + VkSwapchainCreateFlagsKHR flags + VkSurfaceKHR surfaceThe swapchain's target surface + uint32_t minImageCountMinimum number of presentation images the application needs + VkFormat imageFormatFormat of the presentation images + VkColorSpaceKHR imageColorSpaceColorspace of the presentation images + VkExtent2D imageExtentDimensions of the presentation images + uint32_t imageArrayLayersDetermines the number of views for multiview/stereo presentation + VkImageUsageFlags imageUsageBits indicating how the presentation images will be used + VkSharingMode imageSharingModeSharing mode used for the presentation images + uint32_t queueFamilyIndexCountNumber of queue families having access to the images in case of concurrent sharing mode + const uint32_t* pQueueFamilyIndicesArray of queue family indices having access to the images in case of concurrent sharing mode + VkSurfaceTransformFlagBitsKHR preTransformThe transform, relative to the device's natural orientation, applied to the image content prior to presentation + VkCompositeAlphaFlagBitsKHR compositeAlphaThe alpha blending mode used when compositing this surface with other surfaces in the window system + VkPresentModeKHR presentModeWhich presentation mode to use for presents on this swap chain + VkBool32 clippedSpecifies whether presentable images may be affected by window clip regions + VkSwapchainKHR oldSwapchainExisting swap chain to replace, if any + VkSwapchainKHR oldSwapchainExisting swap chain to replace, if any + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCountNumber of semaphores to wait for before presenting + const VkSemaphore* pWaitSemaphoresSemaphores to wait for before presenting + uint32_t swapchainCountNumber of swapchains to present in this call + const VkSwapchainKHR* pSwapchainsSwapchains to present an image from + const uint32_t* pImageIndicesIndices of which presentable images to present + VkResult* pResultsOptional (i.e. if non-NULL) VkResult for each swapchain + + + VkStructureType sType + const void* pNext + VkDebugReportFlagsEXT flagsIndicates which events call this callback + PFN_vkDebugReportCallbackEXT pfnCallbackFunction pointer of a callback function + void* pUserDataUser data provided to callback function + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT + const void* pNext + uint32_t disabledValidationCheckCountNumber of validation checks to disable + const VkValidationCheckEXT* pDisabledValidationChecksValidation checks to disable + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT + const void* pNext + uint32_t enabledValidationFeatureCountNumber of validation features to enable + const VkValidationFeatureEnableEXT* pEnabledValidationFeaturesValidation features to enable + uint32_t disabledValidationFeatureCountNumber of validation features to disable + const VkValidationFeatureDisableEXT* pDisabledValidationFeaturesValidation features to disable + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT + const void* pNext + uint32_t settingCountNumber of settings to configure + const VkLayerSettingEXT* pSettingsValidation features to enable + + + const char* pLayerName + const char* pSettingName + VkLayerSettingTypeEXT typeThe type of the object + uint32_t valueCountNumber of values of the setting + const void* pValuesValues to pass for a setting + + + VkStructureType sType + const void* pNext + uint32_t vendorID + uint32_t deviceID + uint32_t key + uint64_t value + + + VkStructureType sType + const void* pNext + VkRasterizationOrderAMD rasterizationOrderRasterization order to use for the pipeline + + + VkStructureType sType + const void* pNext + VkDebugReportObjectTypeEXT objectTypeThe type of the object + uint64_t objectThe handle of the object, cast to uint64_t + const char* pObjectNameName to apply to the object + + + VkStructureType sType + const void* pNext + VkDebugReportObjectTypeEXT objectTypeThe type of the object + uint64_t objectThe handle of the object, cast to uint64_t + uint64_t tagNameThe name of the tag to set on the object + size_t tagSizeThe length in bytes of the tag data + const void* pTagTag data to attach to the object + + + VkStructureType sType + const void* pNext + const char* pMarkerNameName of the debug marker + float color[4]Optional color for debug marker + + + VkStructureType sType + const void* pNext + VkBool32 dedicatedAllocationWhether this image uses a dedicated allocation + + + VkStructureType sType + const void* pNext + VkBool32 dedicatedAllocationWhether this buffer uses a dedicated allocation + + + VkStructureType sType + const void* pNext + VkImage imageImage that this allocation will be bound to + VkBuffer bufferBuffer that this allocation will be bound to + + + VkImageFormatProperties imageFormatProperties + VkExternalMemoryFeatureFlagsNV externalMemoryFeatures + VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes + VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleType + HANDLE handle + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + + + VkStructureType sType + const void* pNext + NvSciBufAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + NvSciBufObj handle + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkBool32 sciBufImport + VkBool32 sciBufExport + + + + VkStructureType sType + const void* pNext + uint32_t acquireCount + const VkDeviceMemory* pAcquireSyncs + const uint64_t* pAcquireKeys + const uint32_t* pAcquireTimeoutMilliseconds + uint32_t releaseCount + const VkDeviceMemory* pReleaseSyncs + const uint64_t* pReleaseKeys + + + VkStructureType sType + void* pNext + VkBool32 deviceGeneratedCommands + + + VkStructureType sType + void* pNext + VkBool32 deviceGeneratedCompute + VkBool32 deviceGeneratedComputePipelines + VkBool32 deviceGeneratedComputeCaptureReplay + + + VkStructureType sType + const void* pNext + uint32_t privateDataSlotRequestCount + + + + VkStructureType sType + const void* pNext + VkPrivateDataSlotCreateFlags flags + + + + VkStructureType sType + void* pNext + VkBool32 privateData + + + + VkStructureType sType + void* pNext + uint32_t maxGraphicsShaderGroupCount + uint32_t maxIndirectSequenceCount + uint32_t maxIndirectCommandsTokenCount + uint32_t maxIndirectCommandsStreamCount + uint32_t maxIndirectCommandsTokenOffset + uint32_t maxIndirectCommandsStreamStride + uint32_t minSequencesCountBufferOffsetAlignment + uint32_t minSequencesIndexBufferOffsetAlignment + uint32_t minIndirectCommandsBufferOffsetAlignment + + + VkStructureType sType + void* pNext + uint32_t maxMultiDrawCount + + + VkStructureType sType + const void* pNext + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStages + const VkPipelineVertexInputStateCreateInfo* pVertexInputState + const VkPipelineTessellationStateCreateInfo* pTessellationState + + + VkStructureType sType + const void* pNext + uint32_t groupCount + const VkGraphicsShaderGroupCreateInfoNV* pGroups + uint32_t pipelineCount + const VkPipeline* pPipelines + + + uint32_t groupIndex + + + VkDeviceAddress bufferAddress + uint32_t size + VkIndexType indexType + + + VkDeviceAddress bufferAddress + uint32_t size + uint32_t stride + + + uint32_t data + + + VkBuffer buffer + VkDeviceSize offset + + + VkStructureType sType + const void* pNext + VkIndirectCommandsTokenTypeNV tokenType + uint32_t stream + uint32_t offset + uint32_t vertexBindingUnit + VkBool32 vertexDynamicStride + VkPipelineLayout pushconstantPipelineLayout + VkShaderStageFlags pushconstantShaderStageFlags + uint32_t pushconstantOffset + uint32_t pushconstantSize + VkIndirectStateFlagsNV indirectStateFlags + uint32_t indexTypeCount + const VkIndexType* pIndexTypes + const uint32_t* pIndexTypeValues + + + VkStructureType sType + const void* pNext + VkIndirectCommandsLayoutUsageFlagsNV flags + VkPipelineBindPoint pipelineBindPoint + uint32_t tokenCount + const VkIndirectCommandsLayoutTokenNV* pTokens + uint32_t streamCount + const uint32_t* pStreamStrides + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + VkIndirectCommandsLayoutNV indirectCommandsLayout + uint32_t streamCount + const VkIndirectCommandsStreamNV* pStreams + uint32_t sequencesCount + VkBuffer preprocessBuffer + VkDeviceSize preprocessOffset + VkDeviceSize preprocessSize + VkBuffer sequencesCountBuffer + VkDeviceSize sequencesCountOffset + VkBuffer sequencesIndexBuffer + VkDeviceSize sequencesIndexOffset + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + VkIndirectCommandsLayoutNV indirectCommandsLayout + uint32_t maxSequencesCount + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + VkDeviceAddress pipelineAddress + + + VkStructureType sType + void* pNext + VkPhysicalDeviceFeatures features + + + + VkStructureType sType + void* pNext + VkPhysicalDeviceProperties properties + + + + VkStructureType sType + void* pNext + VkFormatProperties formatProperties + + + + VkStructureType sType + void* pNext + VkImageFormatProperties imageFormatProperties + + + + VkStructureType sType + const void* pNext + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + + + + VkStructureType sType + void* pNext + VkQueueFamilyProperties queueFamilyProperties + + + + VkStructureType sType + void* pNext + VkPhysicalDeviceMemoryProperties memoryProperties + + + + VkStructureType sType + void* pNext + VkSparseImageFormatProperties properties + + + + VkStructureType sType + const void* pNext + VkFormat format + VkImageType type + VkSampleCountFlagBits samples + VkImageUsageFlags usage + VkImageTiling tiling + + + + VkStructureType sType + void* pNext + uint32_t maxPushDescriptors + + + uint8_t major + uint8_t minor + uint8_t subminor + uint8_t patch + + + + VkStructureType sType + void* pNext + VkDriverId driverID + char driverName[VK_MAX_DRIVER_NAME_SIZE] + char driverInfo[VK_MAX_DRIVER_INFO_SIZE] + VkConformanceVersion conformanceVersion + + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentRegionKHR* pRegionsThe regions that have changed + + + uint32_t rectangleCountNumber of rectangles in pRectangles + const VkRectLayerKHR* pRectanglesArray of rectangles that have changed in a swapchain's image(s) + + + VkOffset2D offsetupper-left corner of a rectangle that has not changed, in pixels of a presentation images + VkExtent2D extentDimensions of a rectangle that has not changed, in pixels of a presentation images + uint32_t layerLayer of a swapchain's image(s), for stereoscopic-3D images + + + VkStructureType sType + void* pNext + VkBool32 variablePointersStorageBuffer + VkBool32 variablePointers + + + + + + VkExternalMemoryFeatureFlags externalMemoryFeatures + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes + VkExternalMemoryHandleTypeFlags compatibleHandleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalMemoryProperties externalMemoryProperties + + + + VkStructureType sType + const void* pNext + VkBufferCreateFlags flags + VkBufferUsageFlags usage + VkExternalMemoryHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalMemoryProperties externalMemoryProperties + + + + VkStructureType sType + void* pNext + uint8_t deviceUUID[VK_UUID_SIZE] + uint8_t driverUUID[VK_UUID_SIZE] + uint8_t deviceLUID[VK_LUID_SIZE] + uint32_t deviceNodeMask + VkBool32 deviceLUIDValid + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + zx_handle_t handle + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + uint32_t acquireCount + const VkDeviceMemory* pAcquireSyncs + const uint64_t* pAcquireKeys + const uint32_t* pAcquireTimeouts + uint32_t releaseCount + const VkDeviceMemory* pReleaseSyncs + const uint64_t* pReleaseKeys + + + VkStructureType sType + const void* pNext + VkExternalSemaphoreHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes + VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes + VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures + + + + VkStructureType sType + const void* pNext + VkExternalSemaphoreHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreValuesCount + const uint64_t* pWaitSemaphoreValues + uint32_t signalSemaphoreValuesCount + const uint64_t* pSignalSemaphoreValues + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + zx_handle_t zirconHandle + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkExternalFenceHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes + VkExternalFenceHandleTypeFlags compatibleHandleTypes + VkExternalFenceFeatureFlags externalFenceFeatures + + + + VkStructureType sType + const void* pNext + VkExternalFenceHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkFence fence + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkFence fence + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + NvSciSyncAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + void* handle + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + NvSciSyncAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + void* handle + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSciSyncClientTypeNV clientType + VkSciSyncPrimitiveTypeNV primitiveType + + + VkStructureType sType + void* pNext + VkBool32 sciSyncFence + VkBool32 sciSyncSemaphore + VkBool32 sciSyncImport + VkBool32 sciSyncExport + + + VkStructureType sType + void* pNext + VkBool32 sciSyncFence + VkBool32 sciSyncSemaphore2 + VkBool32 sciSyncImport + VkBool32 sciSyncExport + + + VkStructureType sType + const void* pNext + NvSciSyncObj handle + + + VkStructureType sType + const void* pNext + VkSemaphoreSciSyncPoolNV semaphorePool + const NvSciSyncFence* pFence + + + VkStructureType sType + const void* pNext + uint32_t semaphoreSciSyncPoolRequestCount + + + VkStructureType sType + void* pNext + VkBool32 multiviewMultiple views in a renderpass + VkBool32 multiviewGeometryShaderMultiple views in a renderpass w/ geometry shader + VkBool32 multiviewTessellationShaderMultiple views in a renderpass w/ tessellation shader + + + + VkStructureType sType + void* pNext + uint32_t maxMultiviewViewCountmax number of views in a subpass + uint32_t maxMultiviewInstanceIndexmax instance index for a draw in a multiview subpass + + + + VkStructureType sType + const void* pNext + uint32_t subpassCount + const uint32_t* pViewMasks + uint32_t dependencyCount + const int32_t* pViewOffsets + uint32_t correlationMaskCount + const uint32_t* pCorrelationMasks + + + + VkStructureType sType + void* pNext + uint32_t minImageCountSupported minimum number of images for the surface + uint32_t maxImageCountSupported maximum number of images for the surface, 0 for unlimited + VkExtent2D currentExtentCurrent image width and height for the surface, (0, 0) if undefined + VkExtent2D minImageExtentSupported minimum image width and height for the surface + VkExtent2D maxImageExtentSupported maximum image width and height for the surface + uint32_t maxImageArrayLayersSupported maximum number of image layers for the surface + VkSurfaceTransformFlagsKHR supportedTransforms1 or more bits representing the transforms supported + VkSurfaceTransformFlagBitsKHR currentTransformThe surface's current transform relative to the device's natural orientation + VkCompositeAlphaFlagsKHR supportedCompositeAlpha1 or more bits representing the alpha compositing modes supported + VkImageUsageFlags supportedUsageFlagsSupported image usage flags for the surface + VkSurfaceCounterFlagsEXT supportedSurfaceCounters + + + VkStructureType sType + const void* pNext + VkDisplayPowerStateEXT powerState + + + VkStructureType sType + const void* pNext + VkDeviceEventTypeEXT deviceEvent + + + VkStructureType sType + const void* pNext + VkDisplayEventTypeEXT displayEvent + + + VkStructureType sType + const void* pNext + VkSurfaceCounterFlagsEXT surfaceCounters + + + VkStructureType sType + void* pNext + uint32_t physicalDeviceCount + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE] + VkBool32 subsetAllocation + + + + VkStructureType sType + const void* pNext + VkMemoryAllocateFlags flags + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + + VkStructureType sType + const void* pNext + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + + + + VkStructureType sType + const void* pNext + VkImage image + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + + VkStructureType sType + const void* pNext + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + uint32_t splitInstanceBindRegionCount + const VkRect2D* pSplitInstanceBindRegions + + + + VkStructureType sType + const void* pNext + uint32_t deviceMask + uint32_t deviceRenderAreaCount + const VkRect2D* pDeviceRenderAreas + + + + VkStructureType sType + const void* pNext + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const uint32_t* pWaitSemaphoreDeviceIndices + uint32_t commandBufferCount + const uint32_t* pCommandBufferDeviceMasks + uint32_t signalSemaphoreCount + const uint32_t* pSignalSemaphoreDeviceIndices + + + + VkStructureType sType + const void* pNext + uint32_t resourceDeviceIndex + uint32_t memoryDeviceIndex + + + + VkStructureType sType + void* pNext + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE] + VkDeviceGroupPresentModeFlagsKHR modes + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + uint32_t imageIndex + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + uint64_t timeout + VkSemaphore semaphore + VkFence fence + uint32_t deviceMask + + + VkStructureType sType + const void* pNext + uint32_t swapchainCount + const uint32_t* pDeviceMasks + VkDeviceGroupPresentModeFlagBitsKHR mode + + + VkStructureType sType + const void* pNext + uint32_t physicalDeviceCount + const VkPhysicalDevice* pPhysicalDevices + + + + VkStructureType sType + const void* pNext + VkDeviceGroupPresentModeFlagsKHR modes + + + uint32_t dstBindingBinding within the destination descriptor set to write + uint32_t dstArrayElementArray element within the destination binding to write + uint32_t descriptorCountNumber of descriptors to write + VkDescriptorType descriptorTypeDescriptor type to write + size_t offsetOffset into pData where the descriptors to update are stored + size_t strideStride between two descriptors in pData when writing more than one descriptor + + + + VkStructureType sType + const void* pNext + VkDescriptorUpdateTemplateCreateFlags flags + uint32_t descriptorUpdateEntryCountNumber of descriptor update entries to use for the update template + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntriesDescriptor update entries for the template + VkDescriptorUpdateTemplateType templateType + VkDescriptorSetLayout descriptorSetLayout + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout pipelineLayoutIf used for push descriptors, this is the only allowed layout + uint32_t set + + + + float x + float y + + + VkStructureType sType + void* pNext + VkBool32 presentIdPresent ID in VkPresentInfoKHR + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const uint64_t* pPresentIdsPresent ID values for each swapchain + + + VkStructureType sType + void* pNext + VkBool32 presentWaitvkWaitForPresentKHR is supported + + + Display primary in chromaticity coordinates + VkStructureType sType + const void* pNext + From SMPTE 2086 + VkXYColorEXT displayPrimaryRedDisplay primary's Red + VkXYColorEXT displayPrimaryGreenDisplay primary's Green + VkXYColorEXT displayPrimaryBlueDisplay primary's Blue + VkXYColorEXT whitePointDisplay primary's Blue + float maxLuminanceDisplay maximum luminance + float minLuminanceDisplay minimum luminance + From CTA 861.3 + float maxContentLightLevelContent maximum luminance + float maxFrameAverageLightLevel + + + VkStructureType sType + void* pNext + VkBool32 localDimmingSupport + + + VkStructureType sType + const void* pNext + VkBool32 localDimmingEnable + + + uint64_t refreshDurationNumber of nanoseconds from the start of one refresh cycle to the next + + + uint32_t presentIDApplication-provided identifier, previously given to vkQueuePresentKHR + uint64_t desiredPresentTimeEarliest time an image should have been presented, previously given to vkQueuePresentKHR + uint64_t actualPresentTimeTime the image was actually displayed + uint64_t earliestPresentTimeEarliest time the image could have been displayed + uint64_t presentMarginHow early vkQueuePresentKHR was processed vs. how soon it needed to be and make earliestPresentTime + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentTimeGOOGLE* pTimesThe earliest times to present images + + + uint32_t presentIDApplication-provided identifier + uint64_t desiredPresentTimeEarliest time an image should be presented + + + VkStructureType sType + const void* pNext + VkIOSSurfaceCreateFlagsMVK flags + const void* pView + + + VkStructureType sType + const void* pNext + VkMacOSSurfaceCreateFlagsMVK flags + const void* pView + + + VkStructureType sType + const void* pNext + VkMetalSurfaceCreateFlagsEXT flags + const CAMetalLayer* pLayer + + + float xcoeff + float ycoeff + + + VkStructureType sType + const void* pNext + VkBool32 viewportWScalingEnable + uint32_t viewportCount + const VkViewportWScalingNV* pViewportWScalings + + + VkViewportCoordinateSwizzleNV x + VkViewportCoordinateSwizzleNV y + VkViewportCoordinateSwizzleNV z + VkViewportCoordinateSwizzleNV w + + + VkStructureType sType + const void* pNext + VkPipelineViewportSwizzleStateCreateFlagsNV flags + uint32_t viewportCount + const VkViewportSwizzleNV* pViewportSwizzles + + + VkStructureType sType + void* pNext + uint32_t maxDiscardRectanglesmax number of active discard rectangles + + + VkStructureType sType + const void* pNext + VkPipelineDiscardRectangleStateCreateFlagsEXT flags + VkDiscardRectangleModeEXT discardRectangleMode + uint32_t discardRectangleCount + const VkRect2D* pDiscardRectangles + + + VkStructureType sType + void* pNext + VkBool32 perViewPositionAllComponents + + + uint32_t subpass + uint32_t inputAttachmentIndex + VkImageAspectFlags aspectMask + + + + VkStructureType sType + const void* pNext + uint32_t aspectReferenceCount + const VkInputAttachmentAspectReference* pAspectReferences + + + + VkStructureType sType + const void* pNext + VkSurfaceKHR surface + + + VkStructureType sType + void* pNext + VkSurfaceCapabilitiesKHR surfaceCapabilities + + + VkStructureType sType + void* pNext + VkSurfaceFormatKHR surfaceFormat + + + VkStructureType sType + void* pNext + VkDisplayPropertiesKHR displayProperties + + + VkStructureType sType + void* pNext + VkDisplayPlanePropertiesKHR displayPlaneProperties + + + VkStructureType sType + void* pNext + VkDisplayModePropertiesKHR displayModeProperties + + + VkStructureType sType + const void* pNext + VkDisplayModeKHR mode + uint32_t planeIndex + + + VkStructureType sType + void* pNext + VkDisplayPlaneCapabilitiesKHR capabilities + + + VkStructureType sType + void* pNext + VkImageUsageFlags sharedPresentSupportedUsageFlagsSupported image usage flags if swapchain created using a shared present mode + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock + VkBool32 uniformAndStorageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock and Block + VkBool32 storagePushConstant1616-bit integer/floating-point variables supported in PushConstant + VkBool32 storageInputOutput1616-bit integer/floating-point variables supported in shader inputs and outputs + + + + VkStructureType sType + void* pNext + uint32_t subgroupSizeThe size of a subgroup for this queue. + VkShaderStageFlags supportedStagesBitfield of what shader stages support subgroup operations + VkSubgroupFeatureFlags supportedOperationsBitfield of what subgroup operations are supported. + VkBool32 quadOperationsInAllStagesFlag to specify whether quad operations are available in all stages. + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupExtendedTypesFlag to specify whether subgroup operations with extended types are supported + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + + VkStructureType sType + const void* pNext + const VkBufferCreateInfo* pCreateInfo + + + + VkStructureType sType + const void* pNext + VkImage image + + + + VkStructureType sType + const void* pNext + VkImage image + + + + VkStructureType sType + const void* pNext + const VkImageCreateInfo* pCreateInfo + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + void* pNext + VkMemoryRequirements memoryRequirements + + + + VkStructureType sType + void* pNext + VkSparseImageMemoryRequirements memoryRequirements + + + + VkStructureType sType + void* pNext + VkPointClippingBehavior pointClippingBehavior + + + + VkStructureType sType + void* pNext + VkBool32 prefersDedicatedAllocation + VkBool32 requiresDedicatedAllocation + + + + VkStructureType sType + const void* pNext + VkImage imageImage that this allocation will be bound to + VkBuffer bufferBuffer that this allocation will be bound to + + + + VkStructureType sType + const void* pNext + VkImageUsageFlags usage + + + VkStructureType sType + const void* pNext + uint32_t sliceOffset + uint32_t sliceCount + + + + VkStructureType sType + const void* pNext + VkTessellationDomainOrigin domainOrigin + + + + VkStructureType sType + const void* pNext + VkSamplerYcbcrConversion conversion + + + + VkStructureType sType + const void* pNext + VkFormat format + VkSamplerYcbcrModelConversion ycbcrModel + VkSamplerYcbcrRange ycbcrRange + VkComponentMapping components + VkChromaLocation xChromaOffset + VkChromaLocation yChromaOffset + VkFilter chromaFilter + VkBool32 forceExplicitReconstruction + + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + void* pNext + VkBool32 samplerYcbcrConversionSampler color conversion supported + + + + VkStructureType sType + void* pNext + uint32_t combinedImageSamplerDescriptorCount + + + + VkStructureType sType + void* pNext + VkBool32 supportsTextureGatherLODBiasAMD + + + VkStructureType sType + const void* pNext + VkBuffer buffer + VkDeviceSize offset + VkConditionalRenderingFlagsEXT flags + + + VkStructureType sType + const void* pNext + VkBool32 protectedSubmitSubmit protected command buffers + + + VkStructureType sType + void* pNext + VkBool32 protectedMemory + + + VkStructureType sType + void* pNext + VkBool32 protectedNoFault + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueIndex + + + VkStructureType sType + const void* pNext + VkPipelineCoverageToColorStateCreateFlagsNV flags + VkBool32 coverageToColorEnable + uint32_t coverageToColorLocation + + + VkStructureType sType + void* pNext + VkBool32 filterMinmaxSingleComponentFormats + VkBool32 filterMinmaxImageComponentMapping + + + + float x + float y + + + VkStructureType sType + const void* pNext + VkSampleCountFlagBits sampleLocationsPerPixel + VkExtent2D sampleLocationGridSize + uint32_t sampleLocationsCount + const VkSampleLocationEXT* pSampleLocations + + + uint32_t attachmentIndex + VkSampleLocationsInfoEXT sampleLocationsInfo + + + uint32_t subpassIndex + VkSampleLocationsInfoEXT sampleLocationsInfo + + + VkStructureType sType + const void* pNext + uint32_t attachmentInitialSampleLocationsCount + const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations + uint32_t postSubpassSampleLocationsCount + const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations + + + VkStructureType sType + const void* pNext + VkBool32 sampleLocationsEnable + VkSampleLocationsInfoEXT sampleLocationsInfo + + + VkStructureType sType + void* pNext + VkSampleCountFlags sampleLocationSampleCounts + VkExtent2D maxSampleLocationGridSize + float sampleLocationCoordinateRange[2] + uint32_t sampleLocationSubPixelBits + VkBool32 variableSampleLocations + + + VkStructureType sType + void* pNext + VkExtent2D maxSampleLocationGridSize + + + VkStructureType sType + const void* pNext + VkSamplerReductionMode reductionMode + + + + VkStructureType sType + void* pNext + VkBool32 advancedBlendCoherentOperations + + + VkStructureType sType + void* pNext + VkBool32 multiDraw + + + VkStructureType sType + void* pNext + uint32_t advancedBlendMaxColorAttachments + VkBool32 advancedBlendIndependentBlend + VkBool32 advancedBlendNonPremultipliedSrcColor + VkBool32 advancedBlendNonPremultipliedDstColor + VkBool32 advancedBlendCorrelatedOverlap + VkBool32 advancedBlendAllOperations + + + VkStructureType sType + const void* pNext + VkBool32 srcPremultiplied + VkBool32 dstPremultiplied + VkBlendOverlapEXT blendOverlap + + + VkStructureType sType + void* pNext + VkBool32 inlineUniformBlock + VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind + + + + VkStructureType sType + void* pNext + uint32_t maxInlineUniformBlockSize + uint32_t maxPerStageDescriptorInlineUniformBlocks + uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks + uint32_t maxDescriptorSetInlineUniformBlocks + uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks + + + + VkStructureType sType + const void* pNext + uint32_t dataSize + const void* pData + + + + VkStructureType sType + const void* pNext + uint32_t maxInlineUniformBlockBindings + + + + VkStructureType sType + const void* pNext + VkPipelineCoverageModulationStateCreateFlagsNV flags + VkCoverageModulationModeNV coverageModulationMode + VkBool32 coverageModulationTableEnable + uint32_t coverageModulationTableCount + const float* pCoverageModulationTable + + + VkStructureType sType + const void* pNext + uint32_t viewFormatCount + const VkFormat* pViewFormats + + + + VkStructureType sType + const void* pNext + VkValidationCacheCreateFlagsEXT flags + size_t initialDataSize + const void* pInitialData + + + VkStructureType sType + const void* pNext + VkValidationCacheEXT validationCache + + + VkStructureType sType + void* pNext + uint32_t maxPerSetDescriptors + VkDeviceSize maxMemoryAllocationSize + + + + VkStructureType sType + void* pNext + VkBool32 maintenance4 + + + + VkStructureType sType + void* pNext + VkDeviceSize maxBufferSize + + + + VkStructureType sType + void* pNext + VkBool32 maintenance5 + + + VkStructureType sType + void* pNext + VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting + VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting + VkBool32 depthStencilSwizzleOneSupport + VkBool32 polygonModePointSize + VkBool32 nonStrictSinglePixelWideLinesUseParallelogram + VkBool32 nonStrictWideLinesUseParallelogram + + + VkStructureType sType + void* pNext + VkBool32 maintenance6 + + + VkStructureType sType + void* pNext + VkBool32 blockTexelViewCompatibleMultipleLayers + uint32_t maxCombinedImageSamplerDescriptorCount + VkBool32 fragmentShadingRateClampCombinerInputs + + + VkStructureType sType + const void* pNext + uint32_t viewMask + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + + + VkStructureType sType + void* pNext + VkBool32 supported + + + + VkStructureType sType + void* pNext + VkBool32 shaderDrawParameters + + + + VkStructureType sType + void* pNext + VkBool32 shaderFloat1616-bit floats (halfs) in shaders + VkBool32 shaderInt88-bit integers in shaders + + + + + VkStructureType sType + void* pNext + VkShaderFloatControlsIndependence denormBehaviorIndependence + VkShaderFloatControlsIndependence roundingModeIndependence + VkBool32 shaderSignedZeroInfNanPreserveFloat16An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat32An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat64An implementation can preserve signed zero, nan, inf + VkBool32 shaderDenormPreserveFloat16An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat32An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat64An implementation can preserve denormals + VkBool32 shaderDenormFlushToZeroFloat16An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat32An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat64An implementation can flush to zero denormals + VkBool32 shaderRoundingModeRTEFloat16An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat32An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat64An implementation can support RTE + VkBool32 shaderRoundingModeRTZFloat16An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat32An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat64An implementation can support RTZ + + + + VkStructureType sType + void* pNext + VkBool32 hostQueryReset + + + + uint64_t consumer + uint64_t producer + + + VkStructureType sType + const void* pNext + const void* handle + int stride + int format + int usage + VkNativeBufferUsage2ANDROID usage2 + + + VkStructureType sType + const void* pNext + VkSwapchainImageUsageFlagsANDROID usage + + + VkStructureType sType + const void* pNext + VkBool32 sharedImage + + + uint32_t numUsedVgprs + uint32_t numUsedSgprs + uint32_t ldsSizePerLocalWorkGroup + size_t ldsUsageSizeInBytes + size_t scratchMemUsageInBytes + + + VkShaderStageFlags shaderStageMask + VkShaderResourceUsageAMD resourceUsage + uint32_t numPhysicalVgprs + uint32_t numPhysicalSgprs + uint32_t numAvailableVgprs + uint32_t numAvailableSgprs + uint32_t computeWorkGroupSize[3] + + + VkStructureType sType + const void* pNext + VkQueueGlobalPriorityKHR globalPriority + + + + VkStructureType sType + void* pNext + VkBool32 globalPriorityQuery + + + + VkStructureType sType + void* pNext + uint32_t priorityCount + VkQueueGlobalPriorityKHR priorities[VK_MAX_GLOBAL_PRIORITY_SIZE_KHR] + + + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + const char* pObjectName + + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + uint64_t tagName + size_t tagSize + const void* pTag + + + VkStructureType sType + const void* pNext + const char* pLabelName + float color[4] + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCreateFlagsEXT flags + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageType + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback + void* pUserData + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCallbackDataFlagsEXT flags + const char* pMessageIdName + int32_t messageIdNumber + const char* pMessage + uint32_t queueLabelCount + const VkDebugUtilsLabelEXT* pQueueLabels + uint32_t cmdBufLabelCount + const VkDebugUtilsLabelEXT* pCmdBufLabels + uint32_t objectCount + const VkDebugUtilsObjectNameInfoEXT* pObjects + + + VkStructureType sType + void* pNext + VkBool32 deviceMemoryReport + + + VkStructureType sType + const void* pNext + VkDeviceMemoryReportFlagsEXT flags + PFN_vkDeviceMemoryReportCallbackEXT pfnUserCallback + void* pUserData + + + VkStructureType sType + void* pNext + VkDeviceMemoryReportFlagsEXT flags + VkDeviceMemoryReportEventTypeEXT type + uint64_t memoryObjectId + VkDeviceSize size + VkObjectType objectType + uint64_t objectHandle + uint32_t heapIndex + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + void* pHostPointer + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkDeviceSize minImportedHostPointerAlignment + + + VkStructureType sType + void* pNext + float primitiveOverestimationSizeThe size in pixels the primitive is enlarged at each edge during conservative rasterization + float maxExtraPrimitiveOverestimationSizeThe maximum additional overestimation the client can specify in the pipeline state + float extraPrimitiveOverestimationSizeGranularityThe granularity of extra overestimation sizes the implementations supports between 0 and maxExtraOverestimationSize + VkBool32 primitiveUnderestimationtrue if the implementation supports conservative rasterization underestimation mode + VkBool32 conservativePointAndLineRasterizationtrue if conservative rasterization also applies to points and lines + VkBool32 degenerateTrianglesRasterizedtrue if degenerate triangles (those with zero area after snap) are rasterized + VkBool32 degenerateLinesRasterizedtrue if degenerate lines (those with zero length after snap) are rasterized + VkBool32 fullyCoveredFragmentShaderInputVariabletrue if the implementation supports the FullyCoveredEXT SPIR-V builtin fragment shader input variable + VkBool32 conservativeRasterizationPostDepthCoveragetrue if the implementation supports both conservative rasterization and post depth coverage sample coverage mask + + + VkStructureType sType + const void* pNext + VkTimeDomainKHR timeDomain + + + + VkStructureType sType + void* pNext + uint32_t shaderEngineCountnumber of shader engines + uint32_t shaderArraysPerEngineCountnumber of shader arrays + uint32_t computeUnitsPerShaderArraynumber of physical CUs per shader array + uint32_t simdPerComputeUnitnumber of SIMDs per compute unit + uint32_t wavefrontsPerSimdnumber of wavefront slots in each SIMD + uint32_t wavefrontSizemaximum number of threads per wavefront + uint32_t sgprsPerSimdnumber of physical SGPRs per SIMD + uint32_t minSgprAllocationminimum number of SGPRs that can be allocated by a wave + uint32_t maxSgprAllocationnumber of available SGPRs + uint32_t sgprAllocationGranularitySGPRs are allocated in groups of this size + uint32_t vgprsPerSimdnumber of physical VGPRs per SIMD + uint32_t minVgprAllocationminimum number of VGPRs that can be allocated by a wave + uint32_t maxVgprAllocationnumber of available VGPRs + uint32_t vgprAllocationGranularityVGPRs are allocated in groups of this size + + + VkStructureType sType + void* pNextPointer to next structure + VkShaderCorePropertiesFlagsAMD shaderCoreFeaturesfeatures supported by the shader core + uint32_t activeComputeUnitCountnumber of active compute units across all shader engines/arrays + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationConservativeStateCreateFlagsEXT flagsReserved + VkConservativeRasterizationModeEXT conservativeRasterizationModeConservative rasterization mode + float extraPrimitiveOverestimationSizeExtra overestimation to add to the primitive + + + VkStructureType sType + void* pNext + VkBool32 shaderInputAttachmentArrayDynamicIndexing + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing + VkBool32 shaderUniformBufferArrayNonUniformIndexing + VkBool32 shaderSampledImageArrayNonUniformIndexing + VkBool32 shaderStorageBufferArrayNonUniformIndexing + VkBool32 shaderStorageImageArrayNonUniformIndexing + VkBool32 shaderInputAttachmentArrayNonUniformIndexing + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing + VkBool32 descriptorBindingUniformBufferUpdateAfterBind + VkBool32 descriptorBindingSampledImageUpdateAfterBind + VkBool32 descriptorBindingStorageImageUpdateAfterBind + VkBool32 descriptorBindingStorageBufferUpdateAfterBind + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind + VkBool32 descriptorBindingUpdateUnusedWhilePending + VkBool32 descriptorBindingPartiallyBound + VkBool32 descriptorBindingVariableDescriptorCount + VkBool32 runtimeDescriptorArray + + + + VkStructureType sType + void* pNext + uint32_t maxUpdateAfterBindDescriptorsInAllPools + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative + VkBool32 shaderSampledImageArrayNonUniformIndexingNative + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative + VkBool32 shaderStorageImageArrayNonUniformIndexingNative + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative + VkBool32 robustBufferAccessUpdateAfterBind + VkBool32 quadDivergentImplicitLod + uint32_t maxPerStageDescriptorUpdateAfterBindSamplers + uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages + uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages + uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments + uint32_t maxPerStageUpdateAfterBindResources + uint32_t maxDescriptorSetUpdateAfterBindSamplers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindSampledImages + uint32_t maxDescriptorSetUpdateAfterBindStorageImages + uint32_t maxDescriptorSetUpdateAfterBindInputAttachments + + + + VkStructureType sType + const void* pNext + uint32_t bindingCount + const VkDescriptorBindingFlags* pBindingFlags + + + + VkStructureType sType + const void* pNext + uint32_t descriptorSetCount + const uint32_t* pDescriptorCounts + + + + VkStructureType sType + void* pNext + uint32_t maxVariableDescriptorCount + + + + VkStructureType sType + const void* pNext + VkAttachmentDescriptionFlags flags + VkFormat format + VkSampleCountFlagBits samples + VkAttachmentLoadOp loadOpLoad operation for color or depth data + VkAttachmentStoreOp storeOpStore operation for color or depth data + VkAttachmentLoadOp stencilLoadOpLoad operation for stencil data + VkAttachmentStoreOp stencilStoreOpStore operation for stencil data + VkImageLayout initialLayout + VkImageLayout finalLayout + + + + VkStructureType sType + const void* pNext + uint32_t attachment + VkImageLayout layout + VkImageAspectFlags aspectMask + + + + VkStructureType sType + const void* pNext + VkSubpassDescriptionFlags flags + VkPipelineBindPoint pipelineBindPoint + uint32_t viewMask + uint32_t inputAttachmentCount + const VkAttachmentReference2* pInputAttachments + uint32_t colorAttachmentCount + const VkAttachmentReference2* pColorAttachments + const VkAttachmentReference2* pResolveAttachments + const VkAttachmentReference2* pDepthStencilAttachment + uint32_t preserveAttachmentCount + const uint32_t* pPreserveAttachments + + + + VkStructureType sType + const void* pNext + uint32_t srcSubpass + uint32_t dstSubpass + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + VkDependencyFlags dependencyFlags + int32_t viewOffset + + + + VkStructureType sType + const void* pNext + VkRenderPassCreateFlags flags + uint32_t attachmentCount + const VkAttachmentDescription2* pAttachments + uint32_t subpassCount + const VkSubpassDescription2* pSubpasses + uint32_t dependencyCount + const VkSubpassDependency2* pDependencies + uint32_t correlatedViewMaskCount + const uint32_t* pCorrelatedViewMasks + + + + VkStructureType sType + const void* pNext + VkSubpassContents contents + + + + VkStructureType sType + const void* pNext + + + + VkStructureType sType + void* pNext + VkBool32 timelineSemaphore + + + + VkStructureType sType + void* pNext + uint64_t maxTimelineSemaphoreValueDifference + + + + VkStructureType sType + const void* pNext + VkSemaphoreType semaphoreType + uint64_t initialValue + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreValueCount + const uint64_t* pWaitSemaphoreValues + uint32_t signalSemaphoreValueCount + const uint64_t* pSignalSemaphoreValues + + + + VkStructureType sType + const void* pNext + VkSemaphoreWaitFlags flags + uint32_t semaphoreCount + const VkSemaphore* pSemaphores + const uint64_t* pValues + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + uint64_t value + + + + uint32_t binding + uint32_t divisor + + + + VkStructureType sType + const void* pNext + uint32_t vertexBindingDivisorCount + const VkVertexInputBindingDivisorDescriptionKHR* pVertexBindingDivisors + + + + VkStructureType sType + void* pNext + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + + + VkStructureType sType + void* pNext + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + VkBool32 supportsNonZeroFirstInstance + + + VkStructureType sType + void* pNext + uint32_t pciDomain + uint32_t pciBus + uint32_t pciDevice + uint32_t pciFunction + + + VkStructureType sType + const void* pNext + struct AHardwareBuffer* buffer + + + VkStructureType sType + void* pNext + uint64_t androidHardwareBufferUsage + + + VkStructureType sType + void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + VkFormatFeatureFlags formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + VkBool32 conditionalRenderingEnableWhether this secondary command buffer may be executed during an active conditional rendering + + + VkStructureType sType + void* pNext + uint64_t externalFormat + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer8BitAccess8-bit integer variables supported in StorageBuffer + VkBool32 uniformAndStorageBuffer8BitAccess8-bit integer variables supported in StorageBuffer and Uniform + VkBool32 storagePushConstant88-bit integer variables supported in PushConstant + + + + VkStructureType sType + void* pNext + VkBool32 conditionalRendering + VkBool32 inheritedConditionalRendering + + + VkStructureType sType + void* pNext + VkBool32 vulkanMemoryModel + VkBool32 vulkanMemoryModelDeviceScope + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains + + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferInt64Atomics + VkBool32 shaderSharedInt64Atomics + + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferFloat32Atomics + VkBool32 shaderBufferFloat32AtomicAdd + VkBool32 shaderBufferFloat64Atomics + VkBool32 shaderBufferFloat64AtomicAdd + VkBool32 shaderSharedFloat32Atomics + VkBool32 shaderSharedFloat32AtomicAdd + VkBool32 shaderSharedFloat64Atomics + VkBool32 shaderSharedFloat64AtomicAdd + VkBool32 shaderImageFloat32Atomics + VkBool32 shaderImageFloat32AtomicAdd + VkBool32 sparseImageFloat32Atomics + VkBool32 sparseImageFloat32AtomicAdd + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferFloat16Atomics + VkBool32 shaderBufferFloat16AtomicAdd + VkBool32 shaderBufferFloat16AtomicMinMax + VkBool32 shaderBufferFloat32AtomicMinMax + VkBool32 shaderBufferFloat64AtomicMinMax + VkBool32 shaderSharedFloat16Atomics + VkBool32 shaderSharedFloat16AtomicAdd + VkBool32 shaderSharedFloat16AtomicMinMax + VkBool32 shaderSharedFloat32AtomicMinMax + VkBool32 shaderSharedFloat64AtomicMinMax + VkBool32 shaderImageFloat32AtomicMinMax + VkBool32 sparseImageFloat32AtomicMinMax + + + VkStructureType sType + void* pNext + VkBool32 vertexAttributeInstanceRateDivisor + VkBool32 vertexAttributeInstanceRateZeroDivisor + + + + VkStructureType sType + void* pNext + VkPipelineStageFlags checkpointExecutionStageMask + + + VkStructureType sType + void* pNext + VkPipelineStageFlagBits stage + void* pCheckpointMarker + + + VkStructureType sType + void* pNext + VkResolveModeFlags supportedDepthResolveModessupported depth resolve modes + VkResolveModeFlags supportedStencilResolveModessupported stencil resolve modes + VkBool32 independentResolveNonedepth and stencil resolve modes can be set independently if one of them is none + VkBool32 independentResolvedepth and stencil resolve modes can be set independently + + + + VkStructureType sType + const void* pNext + VkResolveModeFlagBits depthResolveModedepth resolve mode + VkResolveModeFlagBits stencilResolveModestencil resolve mode + const VkAttachmentReference2* pDepthStencilResolveAttachmentdepth/stencil resolve attachment + + + + VkStructureType sType + const void* pNext + VkFormat decodeMode + + + VkStructureType sType + void* pNext + VkBool32 decodeModeSharedExponent + + + VkStructureType sType + void* pNext + VkBool32 transformFeedback + VkBool32 geometryStreams + + + VkStructureType sType + void* pNext + uint32_t maxTransformFeedbackStreams + uint32_t maxTransformFeedbackBuffers + VkDeviceSize maxTransformFeedbackBufferSize + uint32_t maxTransformFeedbackStreamDataSize + uint32_t maxTransformFeedbackBufferDataSize + uint32_t maxTransformFeedbackBufferDataStride + VkBool32 transformFeedbackQueries + VkBool32 transformFeedbackStreamsLinesTriangles + VkBool32 transformFeedbackRasterizationStreamSelect + VkBool32 transformFeedbackDraw + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationStateStreamCreateFlagsEXT flags + uint32_t rasterizationStream + + + VkStructureType sType + void* pNext + VkBool32 representativeFragmentTest + + + VkStructureType sType + const void* pNext + VkBool32 representativeFragmentTestEnable + + + VkStructureType sType + void* pNext + VkBool32 exclusiveScissor + + + VkStructureType sType + const void* pNext + uint32_t exclusiveScissorCount + const VkRect2D* pExclusiveScissors + + + VkStructureType sType + void* pNext + VkBool32 cornerSampledImage + + + VkStructureType sType + void* pNext + VkBool32 computeDerivativeGroupQuads + VkBool32 computeDerivativeGroupLinear + + + + VkStructureType sType + void* pNext + VkBool32 imageFootprint + + + VkStructureType sType + void* pNext + VkBool32 dedicatedAllocationImageAliasing + + + VkStructureType sType + void* pNext + VkBool32 indirectCopy + + + VkStructureType sType + void* pNext + VkQueueFlags supportedQueuesBitfield of which queues are supported for indirect copy + + + VkStructureType sType + void* pNext + VkBool32 memoryDecompression + + + VkStructureType sType + void* pNext + VkMemoryDecompressionMethodFlagsNV decompressionMethods + uint64_t maxDecompressionIndirectCount + + + uint32_t shadingRatePaletteEntryCount + const VkShadingRatePaletteEntryNV* pShadingRatePaletteEntries + + + VkStructureType sType + const void* pNext + VkBool32 shadingRateImageEnable + uint32_t viewportCount + const VkShadingRatePaletteNV* pShadingRatePalettes + + + VkStructureType sType + void* pNext + VkBool32 shadingRateImage + VkBool32 shadingRateCoarseSampleOrder + + + VkStructureType sType + void* pNext + VkExtent2D shadingRateTexelSize + uint32_t shadingRatePaletteSize + uint32_t shadingRateMaxCoarseSamples + + + VkStructureType sType + void* pNext + VkBool32 invocationMask + + + uint32_t pixelX + uint32_t pixelY + uint32_t sample + + + VkShadingRatePaletteEntryNV shadingRate + uint32_t sampleCount + uint32_t sampleLocationCount + const VkCoarseSampleLocationNV* pSampleLocations + + + VkStructureType sType + const void* pNext + VkCoarseSampleOrderTypeNV sampleOrderType + uint32_t customSampleOrderCount + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders + + + VkStructureType sType + void* pNext + VkBool32 taskShader + VkBool32 meshShader + + + VkStructureType sType + void* pNext + uint32_t maxDrawMeshTasksCount + uint32_t maxTaskWorkGroupInvocations + uint32_t maxTaskWorkGroupSize[3] + uint32_t maxTaskTotalMemorySize + uint32_t maxTaskOutputCount + uint32_t maxMeshWorkGroupInvocations + uint32_t maxMeshWorkGroupSize[3] + uint32_t maxMeshTotalMemorySize + uint32_t maxMeshOutputVertices + uint32_t maxMeshOutputPrimitives + uint32_t maxMeshMultiviewViewCount + uint32_t meshOutputPerVertexGranularity + uint32_t meshOutputPerPrimitiveGranularity + + + uint32_t taskCount + uint32_t firstTask + + + VkStructureType sType + void* pNext + VkBool32 taskShader + VkBool32 meshShader + VkBool32 multiviewMeshShader + VkBool32 primitiveFragmentShadingRateMeshShader + VkBool32 meshShaderQueries + + + VkStructureType sType + void* pNext + uint32_t maxTaskWorkGroupTotalCount + uint32_t maxTaskWorkGroupCount[3] + uint32_t maxTaskWorkGroupInvocations + uint32_t maxTaskWorkGroupSize[3] + uint32_t maxTaskPayloadSize + uint32_t maxTaskSharedMemorySize + uint32_t maxTaskPayloadAndSharedMemorySize + uint32_t maxMeshWorkGroupTotalCount + uint32_t maxMeshWorkGroupCount[3] + uint32_t maxMeshWorkGroupInvocations + uint32_t maxMeshWorkGroupSize[3] + uint32_t maxMeshSharedMemorySize + uint32_t maxMeshPayloadAndSharedMemorySize + uint32_t maxMeshOutputMemorySize + uint32_t maxMeshPayloadAndOutputMemorySize + uint32_t maxMeshOutputComponents + uint32_t maxMeshOutputVertices + uint32_t maxMeshOutputPrimitives + uint32_t maxMeshOutputLayers + uint32_t maxMeshMultiviewViewCount + uint32_t meshOutputPerVertexGranularity + uint32_t meshOutputPerPrimitiveGranularity + uint32_t maxPreferredTaskWorkGroupInvocations + uint32_t maxPreferredMeshWorkGroupInvocations + VkBool32 prefersLocalInvocationVertexOutput + VkBool32 prefersLocalInvocationPrimitiveOutput + VkBool32 prefersCompactVertexOutput + VkBool32 prefersCompactPrimitiveOutput + + + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + VkStructureType sType + const void* pNext + VkRayTracingShaderGroupTypeKHR type + uint32_t generalShader + uint32_t closestHitShader + uint32_t anyHitShader + uint32_t intersectionShader + + + VkStructureType sType + const void* pNext + VkRayTracingShaderGroupTypeKHR type + uint32_t generalShader + uint32_t closestHitShader + uint32_t anyHitShader + uint32_t intersectionShader + const void* pShaderGroupCaptureReplayHandle + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + uint32_t groupCount + const VkRayTracingShaderGroupCreateInfoNV* pGroups + uint32_t maxRecursionDepth + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + uint32_t groupCount + const VkRayTracingShaderGroupCreateInfoKHR* pGroups + uint32_t maxPipelineRayRecursionDepth + const VkPipelineLibraryCreateInfoKHR* pLibraryInfo + const VkRayTracingPipelineInterfaceCreateInfoKHR* pLibraryInterface + const VkPipelineDynamicStateCreateInfo* pDynamicState + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkBuffer vertexData + VkDeviceSize vertexOffset + uint32_t vertexCount + VkDeviceSize vertexStride + VkFormat vertexFormat + VkBuffer indexData + VkDeviceSize indexOffset + uint32_t indexCount + VkIndexType indexType + VkBuffer transformDataOptional reference to array of floats representing a 3x4 row major affine transformation matrix. + VkDeviceSize transformOffset + + + VkStructureType sType + const void* pNext + VkBuffer aabbData + uint32_t numAABBs + uint32_t strideStride in bytes between AABBs + VkDeviceSize offsetOffset in bytes of the first AABB in aabbData + + + VkGeometryTrianglesNV triangles + VkGeometryAABBNV aabbs + + + VkStructureType sType + const void* pNext + VkGeometryTypeKHR geometryType + VkGeometryDataNV geometry + VkGeometryFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkAccelerationStructureTypeNV type + VkBuildAccelerationStructureFlagsNV flags + uint32_t instanceCount + uint32_t geometryCount + const VkGeometryNV* pGeometries + + + VkStructureType sType + const void* pNext + VkDeviceSize compactedSize + VkAccelerationStructureInfoNV info + + + VkStructureType sType + const void* pNext + VkAccelerationStructureNV accelerationStructure + VkDeviceMemory memory + VkDeviceSize memoryOffset + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + + + VkStructureType sType + const void* pNext + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + + + VkStructureType sType + const void* pNext + uint32_t accelerationStructureCount + const VkAccelerationStructureNV* pAccelerationStructures + + + VkStructureType sType + const void* pNext + VkAccelerationStructureMemoryRequirementsTypeNV type + VkAccelerationStructureNV accelerationStructure + + + VkStructureType sType + void* pNext + VkBool32 accelerationStructure + VkBool32 accelerationStructureCaptureReplay + VkBool32 accelerationStructureIndirectBuild + VkBool32 accelerationStructureHostCommands + VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind + + + VkStructureType sType + void* pNext + VkBool32 rayTracingPipeline + VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay + VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed + VkBool32 rayTracingPipelineTraceRaysIndirect + VkBool32 rayTraversalPrimitiveCulling + + + VkStructureType sType + void* pNext + VkBool32 rayQuery + + + VkStructureType sType + void* pNext + uint64_t maxGeometryCount + uint64_t maxInstanceCount + uint64_t maxPrimitiveCount + uint32_t maxPerStageDescriptorAccelerationStructures + uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures + uint32_t maxDescriptorSetAccelerationStructures + uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures + uint32_t minAccelerationStructureScratchOffsetAlignment + + + VkStructureType sType + void* pNext + uint32_t shaderGroupHandleSize + uint32_t maxRayRecursionDepth + uint32_t maxShaderGroupStride + uint32_t shaderGroupBaseAlignment + uint32_t shaderGroupHandleCaptureReplaySize + uint32_t maxRayDispatchInvocationCount + uint32_t shaderGroupHandleAlignment + uint32_t maxRayHitAttributeSize + + + VkStructureType sType + void* pNext + uint32_t shaderGroupHandleSize + uint32_t maxRecursionDepth + uint32_t maxShaderGroupStride + uint32_t shaderGroupBaseAlignment + uint64_t maxGeometryCount + uint64_t maxInstanceCount + uint64_t maxTriangleCount + uint32_t maxDescriptorSetAccelerationStructures + + + VkDeviceAddress deviceAddress + VkDeviceSize stride + VkDeviceSize size + + + uint32_t width + uint32_t height + uint32_t depth + + + VkDeviceAddress raygenShaderRecordAddress + VkDeviceSize raygenShaderRecordSize + VkDeviceAddress missShaderBindingTableAddress + VkDeviceSize missShaderBindingTableSize + VkDeviceSize missShaderBindingTableStride + VkDeviceAddress hitShaderBindingTableAddress + VkDeviceSize hitShaderBindingTableSize + VkDeviceSize hitShaderBindingTableStride + VkDeviceAddress callableShaderBindingTableAddress + VkDeviceSize callableShaderBindingTableSize + VkDeviceSize callableShaderBindingTableStride + uint32_t width + uint32_t height + uint32_t depth + + + VkStructureType sType + void* pNext + VkBool32 rayTracingMaintenance1 + VkBool32 rayTracingPipelineTraceRaysIndirect2 + + + VkStructureType sType + void* pNext + uint32_t drmFormatModifierCount + VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties + + + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + VkFormatFeatureFlags drmFormatModifierTilingFeatures + + + VkStructureType sType + const void* pNext + uint64_t drmFormatModifier + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + + + VkStructureType sType + const void* pNext + uint32_t drmFormatModifierCount + const uint64_t* pDrmFormatModifiers + + + VkStructureType sType + const void* pNext + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + const VkSubresourceLayout* pPlaneLayouts + + + VkStructureType sType + void* pNext + uint64_t drmFormatModifier + + + VkStructureType sType + const void* pNext + VkImageUsageFlags stencilUsage + + + + VkStructureType sType + const void* pNext + VkMemoryOverallocationBehaviorAMD overallocationBehavior + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMap + VkBool32 fragmentDensityMapDynamic + VkBool32 fragmentDensityMapNonSubsampledImages + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMapDeferred + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMapOffset + + + VkStructureType sType + void* pNext + VkExtent2D minFragmentDensityTexelSize + VkExtent2D maxFragmentDensityTexelSize + VkBool32 fragmentDensityInvocations + + + VkStructureType sType + void* pNext + VkBool32 subsampledLoads + VkBool32 subsampledCoarseReconstructionEarlyAccess + uint32_t maxSubsampledArrayLayers + uint32_t maxDescriptorSetSubsampledSamplers + + + VkStructureType sType + void* pNext + VkExtent2D fragmentDensityOffsetGranularity + + + VkStructureType sType + const void* pNext + VkAttachmentReference fragmentDensityMapAttachment + + + VkStructureType sType + const void* pNext + uint32_t fragmentDensityOffsetCount + const VkOffset2D* pFragmentDensityOffsets + + + VkStructureType sType + void* pNext + VkBool32 scalarBlockLayout + + + + VkStructureType sType + const void* pNext + VkBool32 supportsProtectedRepresents if surface can be protected + + + VkStructureType sType + void* pNext + VkBool32 uniformBufferStandardLayout + + + + VkStructureType sType + void* pNext + VkBool32 depthClipEnable + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationDepthClipStateCreateFlagsEXT flagsReserved + VkBool32 depthClipEnable + + + VkStructureType sType + void* pNext + VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS] + VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS] + + + VkStructureType sType + void* pNext + VkBool32 memoryPriority + + + VkStructureType sType + const void* pNext + float priority + + + VkStructureType sType + void* pNext + VkBool32 pageableDeviceLocalMemory + + + VkStructureType sType + void* pNext + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + + + + VkStructureType sType + void* pNext + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + + + VkStructureType sType + const void* pNext + uint64_t opaqueCaptureAddress + + + + VkStructureType sType + const void* pNext + VkDeviceAddress deviceAddress + + + VkStructureType sType + void* pNext + VkImageViewType imageViewType + + + VkStructureType sType + void* pNext + VkBool32 filterCubicThe combinations of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT + VkBool32 filterCubicMinmaxThe combination of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT and ReductionMode of Min or Max + + + VkStructureType sType + void* pNext + VkBool32 imagelessFramebuffer + + + + VkStructureType sType + const void* pNext + uint32_t attachmentImageInfoCount + const VkFramebufferAttachmentImageInfo* pAttachmentImageInfos + + + + VkStructureType sType + const void* pNext + VkImageCreateFlags flagsImage creation flags + VkImageUsageFlags usageImage usage flags + uint32_t width + uint32_t height + uint32_t layerCount + uint32_t viewFormatCount + const VkFormat* pViewFormats + + + + VkStructureType sType + const void* pNext + uint32_t attachmentCount + const VkImageView* pAttachments + + + + VkStructureType sType + void* pNext + VkBool32 textureCompressionASTC_HDR + + + + VkStructureType sType + void* pNext + VkBool32 cooperativeMatrix + VkBool32 cooperativeMatrixRobustBufferAccess + + + VkStructureType sType + void* pNext + VkShaderStageFlags cooperativeMatrixSupportedStages + + + VkStructureType sType + void* pNext + uint32_t MSize + uint32_t NSize + uint32_t KSize + VkComponentTypeNV AType + VkComponentTypeNV BType + VkComponentTypeNV CType + VkComponentTypeNV DType + VkScopeNV scope + + + VkStructureType sType + void* pNext + VkBool32 ycbcrImageArrays + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkDescriptorType descriptorType + VkSampler sampler + + + VkStructureType sType + void* pNext + VkDeviceAddress deviceAddress + VkDeviceSize size + + + VkStructureType sType + const void* pNext + GgpFrameToken frameToken + + + VkPipelineCreationFeedbackFlags flags + uint64_t duration + + + + VkStructureType sType + const void* pNext + VkPipelineCreationFeedback* pPipelineCreationFeedbackOutput pipeline creation feedback. + uint32_t pipelineStageCreationFeedbackCount + VkPipelineCreationFeedback* pPipelineStageCreationFeedbacksOne entry for each shader stage specified in the parent Vk*PipelineCreateInfo struct + + + + VkStructureType sType + void* pNext + VkFullScreenExclusiveEXT fullScreenExclusive + + + VkStructureType sType + const void* pNext + HMONITOR hmonitor + + + VkStructureType sType + void* pNext + VkBool32 fullScreenExclusiveSupported + + + VkStructureType sType + void* pNext + VkBool32 presentBarrier + + + VkStructureType sType + void* pNext + VkBool32 presentBarrierSupported + + + VkStructureType sType + void* pNext + VkBool32 presentBarrierEnable + + + VkStructureType sType + void* pNext + VkBool32 performanceCounterQueryPoolsperformance counters supported in query pools + VkBool32 performanceCounterMultipleQueryPoolsperformance counters from multiple query pools can be accessed in the same primary command buffer + + + VkStructureType sType + void* pNext + VkBool32 allowCommandBufferQueryCopiesFlag to specify whether performance queries are allowed to be used in vkCmdCopyQueryPoolResults + + + VkStructureType sType + void* pNext + VkPerformanceCounterUnitKHR unit + VkPerformanceCounterScopeKHR scope + VkPerformanceCounterStorageKHR storage + uint8_t uuid[VK_UUID_SIZE] + + + VkStructureType sType + void* pNext + VkPerformanceCounterDescriptionFlagsKHR flags + char name[VK_MAX_DESCRIPTION_SIZE] + char category[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + + + VkStructureType sType + const void* pNext + uint32_t queueFamilyIndex + uint32_t counterIndexCount + const uint32_t* pCounterIndices + + + int32_t int32 + int64_t int64 + uint32_t uint32 + uint64_t uint64 + float float32 + double float64 + + + VkStructureType sType + const void* pNext + VkAcquireProfilingLockFlagsKHR flagsAcquire profiling lock flags + uint64_t timeout + + + VkStructureType sType + const void* pNext + uint32_t counterPassIndexIndex for which counter pass to submit + + + VkStructureType sType + const void* pNext + uint32_t maxPerformanceQueriesPerPoolMaximum number of VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR queries in a query pool + + + VkStructureType sType + const void* pNext + VkHeadlessSurfaceCreateFlagsEXT flags + + + VkStructureType sType + void* pNext + VkBool32 coverageReductionMode + + + VkStructureType sType + const void* pNext + VkPipelineCoverageReductionStateCreateFlagsNV flags + VkCoverageReductionModeNV coverageReductionMode + + + VkStructureType sType + void* pNext + VkCoverageReductionModeNV coverageReductionMode + VkSampleCountFlagBits rasterizationSamples + VkSampleCountFlags depthStencilSamples + VkSampleCountFlags colorSamples + + + VkStructureType sType + void* pNext + VkBool32 shaderIntegerFunctions2 + + + uint32_t value32 + uint64_t value64 + float valueFloat + VkBool32 valueBool + const char* valueString + + + VkPerformanceValueTypeINTEL type + VkPerformanceValueDataINTEL data + + + VkStructureType sType + const void* pNext + void* pUserData + + + VkStructureType sType + const void* pNext + VkQueryPoolSamplingModeINTEL performanceCountersSampling + + + + VkStructureType sType + const void* pNext + uint64_t marker + + + VkStructureType sType + const void* pNext + uint32_t marker + + + VkStructureType sType + const void* pNext + VkPerformanceOverrideTypeINTEL type + VkBool32 enable + uint64_t parameter + + + VkStructureType sType + const void* pNext + VkPerformanceConfigurationTypeINTEL type + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupClock + VkBool32 shaderDeviceClock + + + VkStructureType sType + void* pNext + VkBool32 indexTypeUint8 + + + + VkStructureType sType + void* pNext + uint32_t shaderSMCount + uint32_t shaderWarpsPerSM + + + VkStructureType sType + void* pNext + VkBool32 shaderSMBuiltins + + + VkStructureType sType + void* pNextPointer to next structure + VkBool32 fragmentShaderSampleInterlock + VkBool32 fragmentShaderPixelInterlock + VkBool32 fragmentShaderShadingRateInterlock + + + VkStructureType sType + void* pNext + VkBool32 separateDepthStencilLayouts + + + + VkStructureType sType + void* pNext + VkImageLayout stencilLayout + + + VkStructureType sType + void* pNext + VkBool32 primitiveTopologyListRestart + VkBool32 primitiveTopologyPatchListRestart + + + + VkStructureType sType + void* pNext + VkImageLayout stencilInitialLayout + VkImageLayout stencilFinalLayout + + + + VkStructureType sType + void* pNext + VkBool32 pipelineExecutableInfo + + + VkStructureType sType + const void* pNext + VkPipeline pipeline + + + + VkStructureType sType + void* pNext + VkShaderStageFlags stages + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + uint32_t subgroupSize + + + VkStructureType sType + const void* pNext + VkPipeline pipeline + uint32_t executableIndex + + + VkBool32 b32 + int64_t i64 + uint64_t u64 + double f64 + + + VkStructureType sType + void* pNext + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + VkPipelineExecutableStatisticFormatKHR format + VkPipelineExecutableStatisticValueKHR value + + + VkStructureType sType + void* pNext + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + VkBool32 isText + size_t dataSize + void* pData + + + VkStructureType sType + void* pNext + VkBool32 shaderDemoteToHelperInvocation + + + + VkStructureType sType + void* pNext + VkBool32 texelBufferAlignment + + + VkStructureType sType + void* pNext + VkDeviceSize storageTexelBufferOffsetAlignmentBytes + VkBool32 storageTexelBufferOffsetSingleTexelAlignment + VkDeviceSize uniformTexelBufferOffsetAlignmentBytes + VkBool32 uniformTexelBufferOffsetSingleTexelAlignment + + + + VkStructureType sType + void* pNext + VkBool32 subgroupSizeControl + VkBool32 computeFullSubgroups + + + + VkStructureType sType + void* pNext + uint32_t minSubgroupSizeThe minimum subgroup size supported by this device + uint32_t maxSubgroupSizeThe maximum subgroup size supported by this device + uint32_t maxComputeWorkgroupSubgroupsThe maximum number of subgroups supported in a workgroup + VkShaderStageFlags requiredSubgroupSizeStagesThe shader stages that support specifying a subgroup size + + + + VkStructureType sType + void* pNext + uint32_t requiredSubgroupSize + + + + + VkStructureType sType + void* pNext + VkRenderPass renderPass + uint32_t subpass + + + VkStructureType sType + void* pNext + uint32_t maxSubpassShadingWorkgroupSizeAspectRatio + + + VkStructureType sType + void* pNext + uint32_t maxWorkGroupCount[3] + uint32_t maxWorkGroupSize[3] + uint32_t maxOutputClusterCount + VkDeviceSize indirectBufferOffsetAlignment + + + VkStructureType sType + const void* pNext + uint64_t opaqueCaptureAddress + + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + + + + VkStructureType sType + void* pNext + VkBool32 rectangularLines + VkBool32 bresenhamLines + VkBool32 smoothLines + VkBool32 stippledRectangularLines + VkBool32 stippledBresenhamLines + VkBool32 stippledSmoothLines + + + + VkStructureType sType + void* pNext + uint32_t lineSubPixelPrecisionBits + + + + VkStructureType sType + const void* pNext + VkLineRasterizationModeKHR lineRasterizationMode + VkBool32 stippledLineEnable + uint32_t lineStippleFactor + uint16_t lineStipplePattern + + + + VkStructureType sType + void* pNext + VkBool32 pipelineCreationCacheControl + + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock + VkBool32 uniformAndStorageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock and Block + VkBool32 storagePushConstant1616-bit integer/floating-point variables supported in PushConstant + VkBool32 storageInputOutput1616-bit integer/floating-point variables supported in shader inputs and outputs + VkBool32 multiviewMultiple views in a renderpass + VkBool32 multiviewGeometryShaderMultiple views in a renderpass w/ geometry shader + VkBool32 multiviewTessellationShaderMultiple views in a renderpass w/ tessellation shader + VkBool32 variablePointersStorageBuffer + VkBool32 variablePointers + VkBool32 protectedMemory + VkBool32 samplerYcbcrConversionSampler color conversion supported + VkBool32 shaderDrawParameters + + + VkStructureType sType + void* pNext + uint8_t deviceUUID[VK_UUID_SIZE] + uint8_t driverUUID[VK_UUID_SIZE] + uint8_t deviceLUID[VK_LUID_SIZE] + uint32_t deviceNodeMask + VkBool32 deviceLUIDValid + uint32_t subgroupSizeThe size of a subgroup for this queue. + VkShaderStageFlags subgroupSupportedStagesBitfield of what shader stages support subgroup operations + VkSubgroupFeatureFlags subgroupSupportedOperationsBitfield of what subgroup operations are supported. + VkBool32 subgroupQuadOperationsInAllStagesFlag to specify whether quad operations are available in all stages. + VkPointClippingBehavior pointClippingBehavior + uint32_t maxMultiviewViewCountmax number of views in a subpass + uint32_t maxMultiviewInstanceIndexmax instance index for a draw in a multiview subpass + VkBool32 protectedNoFault + uint32_t maxPerSetDescriptors + VkDeviceSize maxMemoryAllocationSize + + + VkStructureType sType + void* pNext + VkBool32 samplerMirrorClampToEdge + VkBool32 drawIndirectCount + VkBool32 storageBuffer8BitAccess8-bit integer variables supported in StorageBuffer + VkBool32 uniformAndStorageBuffer8BitAccess8-bit integer variables supported in StorageBuffer and Uniform + VkBool32 storagePushConstant88-bit integer variables supported in PushConstant + VkBool32 shaderBufferInt64Atomics + VkBool32 shaderSharedInt64Atomics + VkBool32 shaderFloat1616-bit floats (halfs) in shaders + VkBool32 shaderInt88-bit integers in shaders + VkBool32 descriptorIndexing + VkBool32 shaderInputAttachmentArrayDynamicIndexing + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing + VkBool32 shaderUniformBufferArrayNonUniformIndexing + VkBool32 shaderSampledImageArrayNonUniformIndexing + VkBool32 shaderStorageBufferArrayNonUniformIndexing + VkBool32 shaderStorageImageArrayNonUniformIndexing + VkBool32 shaderInputAttachmentArrayNonUniformIndexing + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing + VkBool32 descriptorBindingUniformBufferUpdateAfterBind + VkBool32 descriptorBindingSampledImageUpdateAfterBind + VkBool32 descriptorBindingStorageImageUpdateAfterBind + VkBool32 descriptorBindingStorageBufferUpdateAfterBind + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind + VkBool32 descriptorBindingUpdateUnusedWhilePending + VkBool32 descriptorBindingPartiallyBound + VkBool32 descriptorBindingVariableDescriptorCount + VkBool32 runtimeDescriptorArray + VkBool32 samplerFilterMinmax + VkBool32 scalarBlockLayout + VkBool32 imagelessFramebuffer + VkBool32 uniformBufferStandardLayout + VkBool32 shaderSubgroupExtendedTypes + VkBool32 separateDepthStencilLayouts + VkBool32 hostQueryReset + VkBool32 timelineSemaphore + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + VkBool32 vulkanMemoryModel + VkBool32 vulkanMemoryModelDeviceScope + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains + VkBool32 shaderOutputViewportIndex + VkBool32 shaderOutputLayer + VkBool32 subgroupBroadcastDynamicId + + + VkStructureType sType + void* pNext + VkDriverId driverID + char driverName[VK_MAX_DRIVER_NAME_SIZE] + char driverInfo[VK_MAX_DRIVER_INFO_SIZE] + VkConformanceVersion conformanceVersion + VkShaderFloatControlsIndependence denormBehaviorIndependence + VkShaderFloatControlsIndependence roundingModeIndependence + VkBool32 shaderSignedZeroInfNanPreserveFloat16An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat32An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat64An implementation can preserve signed zero, nan, inf + VkBool32 shaderDenormPreserveFloat16An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat32An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat64An implementation can preserve denormals + VkBool32 shaderDenormFlushToZeroFloat16An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat32An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat64An implementation can flush to zero denormals + VkBool32 shaderRoundingModeRTEFloat16An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat32An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat64An implementation can support RTE + VkBool32 shaderRoundingModeRTZFloat16An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat32An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat64An implementation can support RTZ + uint32_t maxUpdateAfterBindDescriptorsInAllPools + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative + VkBool32 shaderSampledImageArrayNonUniformIndexingNative + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative + VkBool32 shaderStorageImageArrayNonUniformIndexingNative + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative + VkBool32 robustBufferAccessUpdateAfterBind + VkBool32 quadDivergentImplicitLod + uint32_t maxPerStageDescriptorUpdateAfterBindSamplers + uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages + uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages + uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments + uint32_t maxPerStageUpdateAfterBindResources + uint32_t maxDescriptorSetUpdateAfterBindSamplers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindSampledImages + uint32_t maxDescriptorSetUpdateAfterBindStorageImages + uint32_t maxDescriptorSetUpdateAfterBindInputAttachments + VkResolveModeFlags supportedDepthResolveModessupported depth resolve modes + VkResolveModeFlags supportedStencilResolveModessupported stencil resolve modes + VkBool32 independentResolveNonedepth and stencil resolve modes can be set independently if one of them is none + VkBool32 independentResolvedepth and stencil resolve modes can be set independently + VkBool32 filterMinmaxSingleComponentFormats + VkBool32 filterMinmaxImageComponentMapping + uint64_t maxTimelineSemaphoreValueDifference + VkSampleCountFlags framebufferIntegerColorSampleCounts + + + VkStructureType sType + void* pNext + VkBool32 robustImageAccess + VkBool32 inlineUniformBlock + VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind + VkBool32 pipelineCreationCacheControl + VkBool32 privateData + VkBool32 shaderDemoteToHelperInvocation + VkBool32 shaderTerminateInvocation + VkBool32 subgroupSizeControl + VkBool32 computeFullSubgroups + VkBool32 synchronization2 + VkBool32 textureCompressionASTC_HDR + VkBool32 shaderZeroInitializeWorkgroupMemory + VkBool32 dynamicRendering + VkBool32 shaderIntegerDotProduct + VkBool32 maintenance4 + + + VkStructureType sType + void* pNext + uint32_t minSubgroupSizeThe minimum subgroup size supported by this device + uint32_t maxSubgroupSizeThe maximum subgroup size supported by this device + uint32_t maxComputeWorkgroupSubgroupsThe maximum number of subgroups supported in a workgroup + VkShaderStageFlags requiredSubgroupSizeStagesThe shader stages that support specifying a subgroup size + uint32_t maxInlineUniformBlockSize + uint32_t maxPerStageDescriptorInlineUniformBlocks + uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks + uint32_t maxDescriptorSetInlineUniformBlocks + uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks + uint32_t maxInlineUniformTotalSize + VkBool32 integerDotProduct8BitUnsignedAccelerated + VkBool32 integerDotProduct8BitSignedAccelerated + VkBool32 integerDotProduct8BitMixedSignednessAccelerated + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProduct16BitUnsignedAccelerated + VkBool32 integerDotProduct16BitSignedAccelerated + VkBool32 integerDotProduct16BitMixedSignednessAccelerated + VkBool32 integerDotProduct32BitUnsignedAccelerated + VkBool32 integerDotProduct32BitSignedAccelerated + VkBool32 integerDotProduct32BitMixedSignednessAccelerated + VkBool32 integerDotProduct64BitUnsignedAccelerated + VkBool32 integerDotProduct64BitSignedAccelerated + VkBool32 integerDotProduct64BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated + VkDeviceSize storageTexelBufferOffsetAlignmentBytes + VkBool32 storageTexelBufferOffsetSingleTexelAlignment + VkDeviceSize uniformTexelBufferOffsetAlignmentBytes + VkBool32 uniformTexelBufferOffsetSingleTexelAlignment + VkDeviceSize maxBufferSize + + + VkStructureType sType + const void* pNext + VkPipelineCompilerControlFlagsAMD compilerControlFlags + + + VkStructureType sType + void* pNext + VkBool32 deviceCoherentMemory + + + VkStructureType sType + void* pNext + VkFaultLevel faultLevel + VkFaultType faultType + + + VkStructureType sType + const void* pNext + uint32_t faultCount + VkFaultData*pFaults + PFN_vkFaultCallbackFunction pfnFaultCallback + + + VkStructureType sType + void* pNext + char name[VK_MAX_EXTENSION_NAME_SIZE] + char version[VK_MAX_EXTENSION_NAME_SIZE] + VkToolPurposeFlags purposes + char description[VK_MAX_DESCRIPTION_SIZE] + char layer[VK_MAX_EXTENSION_NAME_SIZE] + + + + VkStructureType sType + const void* pNext + VkClearColorValue customBorderColor + VkFormat format + + + VkStructureType sType + void* pNext + uint32_t maxCustomBorderColorSamplers + + + VkStructureType sType + void* pNext + VkBool32 customBorderColors + VkBool32 customBorderColorWithoutFormat + + + VkStructureType sType + const void* pNext + VkComponentMapping components + VkBool32 srgb + + + VkStructureType sType + void* pNext + VkBool32 borderColorSwizzle + VkBool32 borderColorSwizzleFromImage + + + VkDeviceAddress deviceAddress + void* hostAddress + + + VkDeviceAddress deviceAddress + const void* hostAddress + + + VkDeviceAddress deviceAddress + const void* hostAddress + + + VkStructureType sType + const void* pNext + VkFormat vertexFormat + VkDeviceOrHostAddressConstKHR vertexData + VkDeviceSize vertexStride + uint32_t maxVertex + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexData + VkDeviceOrHostAddressConstKHR transformData + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR data + VkDeviceSize stride + + + VkStructureType sType + const void* pNext + VkBool32 arrayOfPointers + VkDeviceOrHostAddressConstKHR data + + + VkAccelerationStructureGeometryTrianglesDataKHR triangles + VkAccelerationStructureGeometryAabbsDataKHR aabbs + VkAccelerationStructureGeometryInstancesDataKHR instances + + + VkStructureType sType + const void* pNext + VkGeometryTypeKHR geometryType + VkAccelerationStructureGeometryDataKHR geometry + VkGeometryFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkAccelerationStructureTypeKHR type + VkBuildAccelerationStructureFlagsKHR flags + VkBuildAccelerationStructureModeKHR mode + VkAccelerationStructureKHR srcAccelerationStructure + VkAccelerationStructureKHR dstAccelerationStructure + uint32_t geometryCount + const VkAccelerationStructureGeometryKHR* pGeometries + const VkAccelerationStructureGeometryKHR* const* ppGeometries + VkDeviceOrHostAddressKHR scratchData + + + uint32_t primitiveCount + uint32_t primitiveOffset + uint32_t firstVertex + uint32_t transformOffset + + + VkStructureType sType + const void* pNext + VkAccelerationStructureCreateFlagsKHR createFlags + VkBuffer buffer + VkDeviceSize offsetSpecified in bytes + VkDeviceSize size + VkAccelerationStructureTypeKHR type + VkDeviceAddress deviceAddress + + + float minX + float minY + float minZ + float maxX + float maxY + float maxZ + + + + float matrix[3][4] + + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkTransformMatrixKHR transform + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR accelerationStructure + + + VkStructureType sType + const void* pNext + const uint8_t* pVersionData + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR src + VkAccelerationStructureKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR src + VkDeviceOrHostAddressKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR src + VkAccelerationStructureKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + uint32_t maxPipelineRayPayloadSize + uint32_t maxPipelineRayHitAttributeSize + + + VkStructureType sType + const void* pNext + uint32_t libraryCount + const VkPipeline* pLibraries + + + VkObjectType objectType + uint64_t objectHandle + VkRefreshObjectFlagsKHR flags + + + VkStructureType sType + const void* pNext + uint32_t objectCount + const VkRefreshObjectKHR* pObjects + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState2 + VkBool32 extendedDynamicState2LogicOp + VkBool32 extendedDynamicState2PatchControlPoints + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState3TessellationDomainOrigin + VkBool32 extendedDynamicState3DepthClampEnable + VkBool32 extendedDynamicState3PolygonMode + VkBool32 extendedDynamicState3RasterizationSamples + VkBool32 extendedDynamicState3SampleMask + VkBool32 extendedDynamicState3AlphaToCoverageEnable + VkBool32 extendedDynamicState3AlphaToOneEnable + VkBool32 extendedDynamicState3LogicOpEnable + VkBool32 extendedDynamicState3ColorBlendEnable + VkBool32 extendedDynamicState3ColorBlendEquation + VkBool32 extendedDynamicState3ColorWriteMask + VkBool32 extendedDynamicState3RasterizationStream + VkBool32 extendedDynamicState3ConservativeRasterizationMode + VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize + VkBool32 extendedDynamicState3DepthClipEnable + VkBool32 extendedDynamicState3SampleLocationsEnable + VkBool32 extendedDynamicState3ColorBlendAdvanced + VkBool32 extendedDynamicState3ProvokingVertexMode + VkBool32 extendedDynamicState3LineRasterizationMode + VkBool32 extendedDynamicState3LineStippleEnable + VkBool32 extendedDynamicState3DepthClipNegativeOneToOne + VkBool32 extendedDynamicState3ViewportWScalingEnable + VkBool32 extendedDynamicState3ViewportSwizzle + VkBool32 extendedDynamicState3CoverageToColorEnable + VkBool32 extendedDynamicState3CoverageToColorLocation + VkBool32 extendedDynamicState3CoverageModulationMode + VkBool32 extendedDynamicState3CoverageModulationTableEnable + VkBool32 extendedDynamicState3CoverageModulationTable + VkBool32 extendedDynamicState3CoverageReductionMode + VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable + VkBool32 extendedDynamicState3ShadingRateImageEnable + + + VkStructureType sType + void* pNext + VkBool32 dynamicPrimitiveTopologyUnrestricted + + + VkBlendFactor srcColorBlendFactor + VkBlendFactor dstColorBlendFactor + VkBlendOp colorBlendOp + VkBlendFactor srcAlphaBlendFactor + VkBlendFactor dstAlphaBlendFactor + VkBlendOp alphaBlendOp + + + VkBlendOp advancedBlendOp + VkBool32 srcPremultiplied + VkBool32 dstPremultiplied + VkBlendOverlapEXT blendOverlap + VkBool32 clampResults + + + VkStructureType sType + void* pNextPointer to next structure + VkSurfaceTransformFlagBitsKHR transform + + + VkStructureType sType + const void* pNext + VkSurfaceTransformFlagBitsKHR transform + + + VkStructureType sType + void* pNextPointer to next structure + VkSurfaceTransformFlagBitsKHR transform + VkRect2D renderArea + + + VkStructureType sType + void* pNext + VkBool32 diagnosticsConfig + + + VkStructureType sType + const void* pNext + VkDeviceDiagnosticsConfigFlagsNV flags + + + VkStructureType sType + const void* pNext + uint8_t pipelineIdentifier[VK_UUID_SIZE] + VkPipelineMatchControl matchControl + VkDeviceSize poolEntrySize + + + VkStructureType sType + void* pNext + VkBool32 shaderZeroInitializeWorkgroupMemory + + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupUniformControlFlow + + + VkStructureType sType + void* pNext + VkBool32 robustBufferAccess2 + VkBool32 robustImageAccess2 + VkBool32 nullDescriptor + + + VkStructureType sType + void* pNext + VkDeviceSize robustStorageBufferAccessSizeAlignment + VkDeviceSize robustUniformBufferAccessSizeAlignment + + + VkStructureType sType + void* pNext + VkBool32 robustImageAccess + + + + VkStructureType sType + void* pNext + VkBool32 workgroupMemoryExplicitLayout + VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout + VkBool32 workgroupMemoryExplicitLayout8BitAccess + VkBool32 workgroupMemoryExplicitLayout16BitAccess + + + VkStructureType sType + void* pNext + VkBool32 constantAlphaColorBlendFactors + VkBool32 events + VkBool32 imageViewFormatReinterpretation + VkBool32 imageViewFormatSwizzle + VkBool32 imageView2DOn3DImage + VkBool32 multisampleArrayImage + VkBool32 mutableComparisonSamplers + VkBool32 pointPolygons + VkBool32 samplerMipLodBias + VkBool32 separateStencilMaskRef + VkBool32 shaderSampleRateInterpolationFunctions + VkBool32 tessellationIsolines + VkBool32 tessellationPointMode + VkBool32 triangleFans + VkBool32 vertexAttributeAccessBeyondStride + + + VkStructureType sType + void* pNext + uint32_t minVertexInputBindingStrideAlignment + + + VkStructureType sType + void* pNext + VkBool32 formatA4R4G4B4 + VkBool32 formatA4B4G4R4 + + + VkStructureType sType + void* pNext + VkBool32 subpassShading + + + VkStructureType sType + void*pNext + VkBool32 clustercullingShader + VkBool32 multiviewClusterCullingShader + + + VkStructureType sType + void*pNext + VkBool32 clusterShadingRate + + + VkStructureType sType + const void* pNext + VkDeviceSize srcOffsetSpecified in bytes + VkDeviceSize dstOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsetSpecified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D extentSpecified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsets[2]Specified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsets[2]Specified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkDeviceSize bufferOffsetSpecified in bytes + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + + + VkStructureType sType + const void* pNext + VkBuffer srcBuffer + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageBlit2* pRegions + VkFilter filter + + + + VkStructureType sType + const void* pNext + VkBuffer srcBuffer + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkBufferImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageResolve2* pRegions + + + + VkStructureType sType + void* pNext + VkBool32 shaderImageInt64Atomics + VkBool32 sparseImageInt64Atomics + + + VkStructureType sType + const void* pNext + const VkAttachmentReference2* pFragmentShadingRateAttachment + VkExtent2D shadingRateAttachmentTexelSize + + + VkStructureType sType + const void* pNext + VkExtent2D fragmentSize + VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkStructureType sType + void* pNext + VkBool32 pipelineFragmentShadingRate + VkBool32 primitiveFragmentShadingRate + VkBool32 attachmentFragmentShadingRate + + + VkStructureType sType + void* pNext + VkExtent2D minFragmentShadingRateAttachmentTexelSize + VkExtent2D maxFragmentShadingRateAttachmentTexelSize + uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio + VkBool32 primitiveFragmentShadingRateWithMultipleViewports + VkBool32 layeredShadingRateAttachments + VkBool32 fragmentShadingRateNonTrivialCombinerOps + VkExtent2D maxFragmentSize + uint32_t maxFragmentSizeAspectRatio + uint32_t maxFragmentShadingRateCoverageSamples + VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples + VkBool32 fragmentShadingRateWithShaderDepthStencilWrites + VkBool32 fragmentShadingRateWithSampleMask + VkBool32 fragmentShadingRateWithShaderSampleMask + VkBool32 fragmentShadingRateWithConservativeRasterization + VkBool32 fragmentShadingRateWithFragmentShaderInterlock + VkBool32 fragmentShadingRateWithCustomSampleLocations + VkBool32 fragmentShadingRateStrictMultiplyCombiner + + + VkStructureType sType + void* pNext + VkSampleCountFlags sampleCounts + VkExtent2D fragmentSize + + + VkStructureType sType + void* pNext + VkBool32 shaderTerminateInvocation + + + + VkStructureType sType + void* pNext + VkBool32 fragmentShadingRateEnums + VkBool32 supersampleFragmentShadingRates + VkBool32 noInvocationFragmentShadingRates + + + VkStructureType sType + void* pNext + VkSampleCountFlagBits maxFragmentShadingRateInvocationCount + + + VkStructureType sType + const void* pNext + VkFragmentShadingRateTypeNV shadingRateType + VkFragmentShadingRateNV shadingRate + VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkStructureType sType + const void* pNext + VkDeviceSize accelerationStructureSize + VkDeviceSize updateScratchSize + VkDeviceSize buildScratchSize + + + VkStructureType sType + void* pNext + VkBool32 image2DViewOf3D + VkBool32 sampler2DViewOf3D + + + VkStructureType sType + void* pNext + VkBool32 imageSlicedViewOf3D + + + VkStructureType sType + void* pNext + VkBool32 attachmentFeedbackLoopDynamicState + + + VkStructureType sType + void* pNext + VkBool32 mutableDescriptorType + + + + uint32_t descriptorTypeCount + const VkDescriptorType* pDescriptorTypes + + + + VkStructureType sType + const void* pNext + uint32_t mutableDescriptorTypeListCount + const VkMutableDescriptorTypeListEXT* pMutableDescriptorTypeLists + + + + VkStructureType sType + void* pNext + VkBool32 depthClipControl + + + VkStructureType sType + const void* pNext + VkBool32 negativeOneToOne + + + VkStructureType sType + void* pNext + VkBool32 vertexInputDynamicState + + + VkStructureType sType + void* pNext + VkBool32 externalMemoryRDMA + + + VkStructureType sType + void* pNext + uint32_t binding + uint32_t stride + VkVertexInputRate inputRate + uint32_t divisor + + + VkStructureType sType + void* pNext + uint32_t locationlocation of the shader vertex attrib + uint32_t bindingVertex buffer binding id + VkFormat formatformat of source data + uint32_t offsetOffset of first element in bytes from base of vertex + + + VkStructureType sType + void* pNext + VkBool32 colorWriteEnable + + + VkStructureType sType + const void* pNext + uint32_t attachmentCount# of pAttachments + const VkBool32* pColorWriteEnables + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + VkImageLayout oldLayout + VkImageLayout newLayout + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkImage image + VkImageSubresourceRange subresourceRange + + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize size + + + + VkStructureType sType + const void* pNext + VkDependencyFlags dependencyFlags + uint32_t memoryBarrierCount + const VkMemoryBarrier2* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier2* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier2* pImageMemoryBarriers + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + uint64_t value + VkPipelineStageFlags2 stageMask + uint32_t deviceIndex + + + + VkStructureType sType + const void* pNext + VkCommandBuffer commandBuffer + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + VkSubmitFlags flags + uint32_t waitSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pWaitSemaphoreInfos + uint32_t commandBufferInfoCount + const VkCommandBufferSubmitInfo* pCommandBufferInfos + uint32_t signalSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pSignalSemaphoreInfos + + + + VkStructureType sType + void* pNext + VkPipelineStageFlags2 checkpointExecutionStageMask + + + VkStructureType sType + void* pNext + VkPipelineStageFlags2 stage + void* pCheckpointMarker + + + VkStructureType sType + void* pNext + VkBool32 synchronization2 + + + + VkStructureType sType + void* pNext + VkBool32 hostImageCopy + + + VkStructureType sType + void* pNext + uint32_t copySrcLayoutCount + VkImageLayout* pCopySrcLayouts + uint32_t copyDstLayoutCount + VkImageLayout* pCopyDstLayouts + uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE] + VkBool32 identicalMemoryTypeRequirements + + + VkStructureType sType + const void* pNext + const void* pHostPointer + uint32_t memoryRowLengthSpecified in texels + uint32_t memoryImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffset + VkExtent3D imageExtent + + + VkStructureType sType + const void* pNext + void* pHostPointer + uint32_t memoryRowLengthSpecified in texels + uint32_t memoryImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffset + VkExtent3D imageExtent + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlagsEXT flags + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkMemoryToImageCopyEXT* pRegions + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlagsEXT flags + VkImage srcImage + VkImageLayout srcImageLayout + uint32_t regionCount + const VkImageToMemoryCopyEXT* pRegions + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlagsEXT flags + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy2* pRegions + + + VkStructureType sType + const void* pNext + VkImage image + VkImageLayout oldLayout + VkImageLayout newLayout + VkImageSubresourceRange subresourceRange + + + VkStructureType sType + void* pNext + VkDeviceSize sizeSpecified in bytes + + + VkStructureType sType + void* pNext + VkBool32 optimalDeviceAccessSpecifies if device access is optimal + VkBool32 identicalMemoryLayoutSpecifies if memory layout is identical + + + VkStructureType sType + void* pNext + VkBool32 deviceNoDynamicHostAllocations + VkBool32 deviceDestroyFreesMemory + VkBool32 commandPoolMultipleCommandBuffersRecording + VkBool32 commandPoolResetCommandBuffer + VkBool32 commandBufferSimultaneousUse + VkBool32 secondaryCommandBufferNullOrImagelessFramebuffer + VkBool32 recycleDescriptorSetMemory + VkBool32 recyclePipelineMemory + uint32_t maxRenderPassSubpasses + uint32_t maxRenderPassDependencies + uint32_t maxSubpassInputAttachments + uint32_t maxSubpassPreserveAttachments + uint32_t maxFramebufferAttachments + uint32_t maxDescriptorSetLayoutBindings + uint32_t maxQueryFaultCount + uint32_t maxCallbackFaultCount + uint32_t maxCommandPoolCommandBuffers + VkDeviceSize maxCommandBufferSize + + + VkStructureType sType + const void* pNext + VkDeviceSize poolEntrySize + uint32_t poolEntryCount + + + VkStructureType sType + const void* pNext + uint32_t pipelineCacheCreateInfoCount + const VkPipelineCacheCreateInfo* pPipelineCacheCreateInfos + uint32_t pipelinePoolSizeCount + const VkPipelinePoolSize* pPipelinePoolSizes + uint32_t semaphoreRequestCount + uint32_t commandBufferRequestCount + uint32_t fenceRequestCount + uint32_t deviceMemoryRequestCount + uint32_t bufferRequestCount + uint32_t imageRequestCount + uint32_t eventRequestCount + uint32_t queryPoolRequestCount + uint32_t bufferViewRequestCount + uint32_t imageViewRequestCount + uint32_t layeredImageViewRequestCount + uint32_t pipelineCacheRequestCount + uint32_t pipelineLayoutRequestCount + uint32_t renderPassRequestCount + uint32_t graphicsPipelineRequestCount + uint32_t computePipelineRequestCount + uint32_t descriptorSetLayoutRequestCount + uint32_t samplerRequestCount + uint32_t descriptorPoolRequestCount + uint32_t descriptorSetRequestCount + uint32_t framebufferRequestCount + uint32_t commandPoolRequestCount + uint32_t samplerYcbcrConversionRequestCount + uint32_t surfaceRequestCount + uint32_t swapchainRequestCount + uint32_t displayModeRequestCount + uint32_t subpassDescriptionRequestCount + uint32_t attachmentDescriptionRequestCount + uint32_t descriptorSetLayoutBindingRequestCount + uint32_t descriptorSetLayoutBindingLimit + uint32_t maxImageViewMipLevels + uint32_t maxImageViewArrayLayers + uint32_t maxLayeredImageViewMipLevels + uint32_t maxOcclusionQueriesPerPool + uint32_t maxPipelineStatisticsQueriesPerPool + uint32_t maxTimestampQueriesPerPool + uint32_t maxImmutableSamplersPerDescriptorSetLayout + + + VkStructureType sType + const void* pNext + VkDeviceSize commandPoolReservedSize + uint32_t commandPoolMaxCommandBuffers + + + VkStructureType sType + void* pNext + VkDeviceSize commandPoolAllocated + VkDeviceSize commandPoolReservedSize + VkDeviceSize commandBufferAllocated + + + VkStructureType sType + void* pNext + VkBool32 shaderAtomicInstructions + + + VkStructureType sType + void* pNext + VkBool32 primitivesGeneratedQuery + VkBool32 primitivesGeneratedQueryWithRasterizerDiscard + VkBool32 primitivesGeneratedQueryWithNonZeroStreams + + + VkStructureType sType + void* pNext + VkBool32 legacyDithering + + + VkStructureType sType + void* pNext + VkBool32 multisampledRenderToSingleSampled + + + VkStructureType sType + void* pNext + VkBool32 optimal + + + VkStructureType sType + const void* pNext + VkBool32 multisampledRenderToSingleSampledEnable + VkSampleCountFlagBits rasterizationSamples + + + VkStructureType sType + void* pNext + VkBool32 pipelineProtectedAccess + + + VkStructureType sType + void* pNext + VkVideoCodecOperationFlagsKHR videoCodecOperations + + + VkStructureType sType + void* pNext + VkBool32 queryResultStatusSupport + + + VkStructureType sType + const void* pNext + uint32_t profileCount + const VkVideoProfileInfoKHR* pProfiles + + + VkStructureType sType + const void* pNext + VkImageUsageFlags imageUsage + + + VkStructureType sType + void* pNext + VkFormat format + VkComponentMapping componentMapping + VkImageCreateFlags imageCreateFlags + VkImageType imageType + VkImageTiling imageTiling + VkImageUsageFlags imageUsageFlags + + + VkStructureType sType + const void* pNext + VkVideoCodecOperationFlagBitsKHR videoCodecOperation + VkVideoChromaSubsamplingFlagsKHR chromaSubsampling + VkVideoComponentBitDepthFlagsKHR lumaBitDepth + VkVideoComponentBitDepthFlagsKHR chromaBitDepth + + + VkStructureType sType + void* pNext + VkVideoCapabilityFlagsKHR flags + VkDeviceSize minBitstreamBufferOffsetAlignment + VkDeviceSize minBitstreamBufferSizeAlignment + VkExtent2D pictureAccessGranularity + VkExtent2D minCodedExtent + VkExtent2D maxCodedExtent + uint32_t maxDpbSlots + uint32_t maxActiveReferencePictures + VkExtensionProperties stdHeaderVersion + + + VkStructureType sType + void* pNext + uint32_t memoryBindIndex + VkMemoryRequirements memoryRequirements + + + VkStructureType sType + const void* pNext + uint32_t memoryBindIndex + VkDeviceMemory memory + VkDeviceSize memoryOffset + VkDeviceSize memorySize + + + VkStructureType sType + const void* pNext + VkOffset2D codedOffsetThe offset to be used for the picture resource, currently only used in field mode + VkExtent2D codedExtentThe extent to be used for the picture resource + uint32_t baseArrayLayerThe first array layer to be accessed for the Decode or Encode Operations + VkImageView imageViewBindingThe ImageView binding of the resource + + + VkStructureType sType + const void* pNext + int32_t slotIndexThe reference slot index + const VkVideoPictureResourceInfoKHR* pPictureResourceThe reference picture resource + + + VkStructureType sType + void* pNext + VkVideoDecodeCapabilityFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoDecodeUsageFlagsKHR videoUsageHints + + + VkStructureType sType + const void* pNext + VkVideoDecodeFlagsKHR flags + VkBuffer srcBuffer + VkDeviceSize srcBufferOffset + VkDeviceSize srcBufferRange + VkVideoPictureResourceInfoKHR dstPictureResource + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + + + VkStructureType sType + void* pNext + VkBool32 videoMaintenance1 + + + VkStructureType sType + const void* pNext + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + Video Decode Codec Standard specific structures + #include "vk_video/vulkan_video_codec_h264std.h" + + + + + + + + + + + + + + + + + + + #include "vk_video/vulkan_video_codec_h264std_decode.h" + + + + + + VkStructureType sType + const void* pNext + StdVideoH264ProfileIdc stdProfileIdc + VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout + + + VkStructureType sType + void* pNext + StdVideoH264LevelIdc maxLevelIdc + VkOffset2D fieldOffsetGranularity + + + + + VkStructureType sType + const void* pNext + uint32_t stdSPSCount + const StdVideoH264SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH264PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoDecodeH264SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH264PictureInfo* pStdPictureInfo + uint32_t sliceCount + const uint32_t* pSliceOffsets + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo + + #include "vk_video/vulkan_video_codec_h265std.h" + + + + + + + + + + + + + + + + + + + #include "vk_video/vulkan_video_codec_h265std_decode.h" + + + + + + VkStructureType sType + const void* pNext + StdVideoH265ProfileIdc stdProfileIdc + + + VkStructureType sType + void* pNext + StdVideoH265LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdVPSCount + const StdVideoH265VideoParameterSet* pStdVPSs + uint32_t stdSPSCount + const StdVideoH265SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH265PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdVPSCount + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoDecodeH265SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH265PictureInfo* pStdPictureInfo + uint32_t sliceSegmentCount + const uint32_t* pSliceSegmentOffsets + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo + + #include "vk_video/vulkan_video_codec_av1std.h" + + + + #include "vk_video/vulkan_video_codec_av1std_decode.h" + + + + VkStructureType sType + const void* pNext + StdVideoAV1Profile stdProfile + VkBool32 filmGrainSupport + + + VkStructureType sType + void* pNext + StdVideoAV1Level maxLevel + + + VkStructureType sType + const void* pNext + const StdVideoAV1SequenceHeader* pStdSequenceHeader + + + VkStructureType sType + const void* pNext + const StdVideoDecodeAV1PictureInfo* pStdPictureInfo + int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR] + uint32_t frameHeaderOffset + uint32_t tileCount + const uint32_t* pTileOffsets + const uint32_t* pTileSizes + + + VkStructureType sType + const void* pNext + const StdVideoDecodeAV1ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + const void* pNext + uint32_t queueFamilyIndex + VkVideoSessionCreateFlagsKHR flags + const VkVideoProfileInfoKHR* pVideoProfile + VkFormat pictureFormat + VkExtent2D maxCodedExtent + VkFormat referencePictureFormat + uint32_t maxDpbSlots + uint32_t maxActiveReferencePictures + const VkExtensionProperties* pStdHeaderVersion + + + VkStructureType sType + const void* pNext + VkVideoSessionParametersCreateFlagsKHR flags + VkVideoSessionParametersKHR videoSessionParametersTemplate + VkVideoSessionKHR videoSession + + + VkStructureType sType + const void* pNext + uint32_t updateSequenceCount + + + VkStructureType sType + const void* pNext + VkVideoSessionParametersKHR videoSessionParameters + + + VkStructureType sType + void* pNext + VkBool32 hasOverrides + + + VkStructureType sType + const void* pNext + VkVideoBeginCodingFlagsKHR flags + VkVideoSessionKHR videoSession + VkVideoSessionParametersKHR videoSessionParameters + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + + + VkStructureType sType + const void* pNext + VkVideoEndCodingFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoCodingControlFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoEncodeUsageFlagsKHR videoUsageHints + VkVideoEncodeContentFlagsKHR videoContentHints + VkVideoEncodeTuningModeKHR tuningMode + + + VkStructureType sType + const void* pNext + VkVideoEncodeFlagsKHR flags + VkBuffer dstBuffer + VkDeviceSize dstBufferOffset + VkDeviceSize dstBufferRange + VkVideoPictureResourceInfoKHR srcPictureResource + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + uint32_t precedingExternallyEncodedBytes + + + VkStructureType sType + const void* pNext + VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags + + + VkStructureType sType + const void* pNext + uint32_t qualityLevel + + + VkStructureType sType + const void* pNext + const VkVideoProfileInfoKHR* pVideoProfile + uint32_t qualityLevel + + + VkStructureType sType + void* pNext + VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode + uint32_t preferredRateControlLayerCount + + + VkStructureType sType + const void* pNext + VkVideoEncodeRateControlFlagsKHR flags + VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode + uint32_t layerCount + const VkVideoEncodeRateControlLayerInfoKHR* pLayers + uint32_t virtualBufferSizeInMs + uint32_t initialVirtualBufferSizeInMs + + + VkStructureType sType + const void* pNext + uint64_t averageBitrate + uint64_t maxBitrate + uint32_t frameRateNumerator + uint32_t frameRateDenominator + + + VkStructureType sType + void* pNext + VkVideoEncodeCapabilityFlagsKHR flags + VkVideoEncodeRateControlModeFlagsKHR rateControlModes + uint32_t maxRateControlLayers + uint64_t maxBitrate + uint32_t maxQualityLevels + VkExtent2D encodeInputPictureGranularity + VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH264CapabilityFlagsKHR flags + StdVideoH264LevelIdc maxLevelIdc + uint32_t maxSliceCount + uint32_t maxPPictureL0ReferenceCount + uint32_t maxBPictureL0ReferenceCount + uint32_t maxL1ReferenceCount + uint32_t maxTemporalLayerCount + VkBool32 expectDyadicTemporalLayerPattern + int32_t minQp + int32_t maxQp + VkBool32 prefersGopRemainingFrames + VkBool32 requiresGopRemainingFrames + VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags + uint32_t preferredGopFrameCount + uint32_t preferredIdrPeriod + uint32_t preferredConsecutiveBFrameCount + uint32_t preferredTemporalLayerCount + VkVideoEncodeH264QpKHR preferredConstantQp + uint32_t preferredMaxL0ReferenceCount + uint32_t preferredMaxL1ReferenceCount + VkBool32 preferredStdEntropyCodingModeFlag + + #include "vk_video/vulkan_video_codec_h264std_encode.h" + + + + + + + + + + + + VkStructureType sType + const void* pNext + VkBool32 useMaxLevelIdc + StdVideoH264LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdSPSCount + const StdVideoH264SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH264PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoEncodeH264SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + VkBool32 writeStdSPS + VkBool32 writeStdPPS + uint32_t stdSPSId + uint32_t stdPPSId + + + VkStructureType sType + void* pNext + VkBool32 hasStdSPSOverrides + VkBool32 hasStdPPSOverrides + + + VkStructureType sType + const void* pNext + const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + const void* pNext + uint32_t naluSliceEntryCount + const VkVideoEncodeH264NaluSliceInfoKHR* pNaluSliceEntries + const StdVideoEncodeH264PictureInfo* pStdPictureInfo + VkBool32 generatePrefixNalu + + + VkStructureType sType + const void* pNext + StdVideoH264ProfileIdc stdProfileIdc + + + VkStructureType sType + const void* pNext + int32_t constantQp + const StdVideoEncodeH264SliceHeader* pStdSliceHeader + + + VkStructureType sType + const void* pNext + VkVideoEncodeH264RateControlFlagsKHR flags + uint32_t gopFrameCount + uint32_t idrPeriod + uint32_t consecutiveBFrameCount + uint32_t temporalLayerCount + + + int32_t qpI + int32_t qpP + int32_t qpB + + + uint32_t frameISize + uint32_t framePSize + uint32_t frameBSize + + + VkStructureType sType + const void* pNext + VkBool32 useGopRemainingFrames + uint32_t gopRemainingI + uint32_t gopRemainingP + uint32_t gopRemainingB + + + VkStructureType sType + const void* pNext + VkBool32 useMinQp + VkVideoEncodeH264QpKHR minQp + VkBool32 useMaxQp + VkVideoEncodeH264QpKHR maxQp + VkBool32 useMaxFrameSize + VkVideoEncodeH264FrameSizeKHR maxFrameSize + + + VkStructureType sType + void* pNext + VkVideoEncodeH265CapabilityFlagsKHR flags + StdVideoH265LevelIdc maxLevelIdc + uint32_t maxSliceSegmentCount + VkExtent2D maxTiles + VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes + VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes + uint32_t maxPPictureL0ReferenceCount + uint32_t maxBPictureL0ReferenceCount + uint32_t maxL1ReferenceCount + uint32_t maxSubLayerCount + VkBool32 expectDyadicTemporalSubLayerPattern + int32_t minQp + int32_t maxQp + VkBool32 prefersGopRemainingFrames + VkBool32 requiresGopRemainingFrames + VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags + uint32_t preferredGopFrameCount + uint32_t preferredIdrPeriod + uint32_t preferredConsecutiveBFrameCount + uint32_t preferredSubLayerCount + VkVideoEncodeH265QpKHR preferredConstantQp + uint32_t preferredMaxL0ReferenceCount + uint32_t preferredMaxL1ReferenceCount + + #include "vk_video/vulkan_video_codec_h265std_encode.h" + + + + + + + + + + VkStructureType sType + const void* pNext + VkBool32 useMaxLevelIdc + StdVideoH265LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdVPSCount + const StdVideoH265VideoParameterSet* pStdVPSs + uint32_t stdSPSCount + const StdVideoH265SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH265PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdVPSCount + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoEncodeH265SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + VkBool32 writeStdVPS + VkBool32 writeStdSPS + VkBool32 writeStdPPS + uint32_t stdVPSId + uint32_t stdSPSId + uint32_t stdPPSId + + + VkStructureType sType + void* pNext + VkBool32 hasStdVPSOverrides + VkBool32 hasStdSPSOverrides + VkBool32 hasStdPPSOverrides + + + VkStructureType sType + const void* pNext + uint32_t naluSliceSegmentEntryCount + const VkVideoEncodeH265NaluSliceSegmentInfoKHR* pNaluSliceSegmentEntries + const StdVideoEncodeH265PictureInfo* pStdPictureInfo + + + VkStructureType sType + const void* pNext + int32_t constantQp + const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader + + + VkStructureType sType + const void* pNext + VkVideoEncodeH265RateControlFlagsKHR flags + uint32_t gopFrameCount + uint32_t idrPeriod + uint32_t consecutiveBFrameCount + uint32_t subLayerCount + + + int32_t qpI + int32_t qpP + int32_t qpB + + + uint32_t frameISize + uint32_t framePSize + uint32_t frameBSize + + + VkStructureType sType + const void* pNext + VkBool32 useGopRemainingFrames + uint32_t gopRemainingI + uint32_t gopRemainingP + uint32_t gopRemainingB + + + VkStructureType sType + const void* pNext + VkBool32 useMinQp + VkVideoEncodeH265QpKHR minQp + VkBool32 useMaxQp + VkVideoEncodeH265QpKHR maxQp + VkBool32 useMaxFrameSize + VkVideoEncodeH265FrameSizeKHR maxFrameSize + + + VkStructureType sType + const void* pNext + StdVideoH265ProfileIdc stdProfileIdc + + + VkStructureType sType + const void* pNext + const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + void* pNext + VkBool32 inheritedViewportScissor2D + + + VkStructureType sType + const void* pNext + VkBool32 viewportScissor2D + uint32_t viewportDepthCount + const VkViewport* pViewportDepths + + + VkStructureType sType + void* pNext + VkBool32 ycbcr2plane444Formats + + + VkStructureType sType + void* pNext + VkBool32 provokingVertexLast + VkBool32 transformFeedbackPreservesProvokingVertex + + + VkStructureType sType + void* pNext + VkBool32 provokingVertexModePerPipeline + VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex + + + VkStructureType sType + const void* pNext + VkProvokingVertexModeEXT provokingVertexMode + + + VkStructureType sType + const void* pNext + size_t dataSize + const void* pData + + + VkStructureType sType + const void* pNext + VkCuModuleNVX module + const char* pName + + + VkStructureType sType + const void* pNext + VkCuFunctionNVX function + uint32_t gridDimX + uint32_t gridDimY + uint32_t gridDimZ + uint32_t blockDimX + uint32_t blockDimY + uint32_t blockDimZ + uint32_t sharedMemBytes + size_t paramCount + const void* const * pParams + size_t extraCount + const void* const * pExtras + + + VkStructureType sType + void* pNext + VkBool32 descriptorBuffer + VkBool32 descriptorBufferCaptureReplay + VkBool32 descriptorBufferImageLayoutIgnored + VkBool32 descriptorBufferPushDescriptors + + + VkStructureType sType + void* pNext + VkBool32 combinedImageSamplerDescriptorSingleArray + VkBool32 bufferlessPushDescriptors + VkBool32 allowSamplerImageViewPostSubmitCreation + VkDeviceSize descriptorBufferOffsetAlignment + uint32_t maxDescriptorBufferBindings + uint32_t maxResourceDescriptorBufferBindings + uint32_t maxSamplerDescriptorBufferBindings + uint32_t maxEmbeddedImmutableSamplerBindings + uint32_t maxEmbeddedImmutableSamplers + size_t bufferCaptureReplayDescriptorDataSize + size_t imageCaptureReplayDescriptorDataSize + size_t imageViewCaptureReplayDescriptorDataSize + size_t samplerCaptureReplayDescriptorDataSize + size_t accelerationStructureCaptureReplayDescriptorDataSize + size_t samplerDescriptorSize + size_t combinedImageSamplerDescriptorSize + size_t sampledImageDescriptorSize + size_t storageImageDescriptorSize + size_t uniformTexelBufferDescriptorSize + size_t robustUniformTexelBufferDescriptorSize + size_t storageTexelBufferDescriptorSize + size_t robustStorageTexelBufferDescriptorSize + size_t uniformBufferDescriptorSize + size_t robustUniformBufferDescriptorSize + size_t storageBufferDescriptorSize + size_t robustStorageBufferDescriptorSize + size_t inputAttachmentDescriptorSize + size_t accelerationStructureDescriptorSize + VkDeviceSize maxSamplerDescriptorBufferRange + VkDeviceSize maxResourceDescriptorBufferRange + VkDeviceSize samplerDescriptorBufferAddressSpaceSize + VkDeviceSize resourceDescriptorBufferAddressSpaceSize + VkDeviceSize descriptorBufferAddressSpaceSize + + + VkStructureType sType + void* pNext + size_t combinedImageSamplerDensityMapDescriptorSize + + + VkStructureType sType + void* pNext + VkDeviceAddress address + VkDeviceSize range + VkFormat format + + + VkStructureType sType + void* pNext + VkDeviceAddress address + VkBufferUsageFlags usage + + + VkStructureType sType + void* pNext + VkBuffer buffer + + + const VkSampler* pSampler + const VkDescriptorImageInfo* pCombinedImageSampler + const VkDescriptorImageInfo* pInputAttachmentImage + const VkDescriptorImageInfo* pSampledImage + const VkDescriptorImageInfo* pStorageImage + const VkDescriptorAddressInfoEXT* pUniformTexelBuffer + const VkDescriptorAddressInfoEXT* pStorageTexelBuffer + const VkDescriptorAddressInfoEXT* pUniformBuffer + const VkDescriptorAddressInfoEXT* pStorageBuffer + VkDeviceAddress accelerationStructure + + + VkStructureType sType + const void* pNext + VkDescriptorType type + VkDescriptorDataEXT data + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + VkStructureType sType + const void* pNext + VkImage image + + + VkStructureType sType + const void* pNext + VkImageView imageView + + + VkStructureType sType + const void* pNext + VkSampler sampler + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR accelerationStructure + VkAccelerationStructureNV accelerationStructureNV + + + VkStructureType sType + const void* pNext + const void* opaqueCaptureDescriptorData + + + VkStructureType sType + void* pNext + VkBool32 shaderIntegerDotProduct + + + + VkStructureType sType + void* pNext + VkBool32 integerDotProduct8BitUnsignedAccelerated + VkBool32 integerDotProduct8BitSignedAccelerated + VkBool32 integerDotProduct8BitMixedSignednessAccelerated + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProduct16BitUnsignedAccelerated + VkBool32 integerDotProduct16BitSignedAccelerated + VkBool32 integerDotProduct16BitMixedSignednessAccelerated + VkBool32 integerDotProduct32BitUnsignedAccelerated + VkBool32 integerDotProduct32BitSignedAccelerated + VkBool32 integerDotProduct32BitMixedSignednessAccelerated + VkBool32 integerDotProduct64BitUnsignedAccelerated + VkBool32 integerDotProduct64BitSignedAccelerated + VkBool32 integerDotProduct64BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated + + + + VkStructureType sType + void* pNext + VkBool32 hasPrimary + VkBool32 hasRender + int64_t primaryMajor + int64_t primaryMinor + int64_t renderMajor + int64_t renderMinor + + + VkStructureType sType + void* pNext + VkBool32 fragmentShaderBarycentric + + + VkStructureType sType + void* pNext + VkBool32 triStripVertexOrderIndependentOfProvokingVertex + + + VkStructureType sType + void* pNext + VkBool32 rayTracingMotionBlur + VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect + + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR vertexData + + + VkStructureType sType + const void* pNext + uint32_t maxInstances + VkAccelerationStructureMotionInfoFlagsNV flags + + + float sx + float a + float b + float pvx + float sy + float c + float pvy + float sz + float pvz + float qx + float qy + float qz + float qw + float tx + float ty + float tz + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkSRTDataNV transformT0 + VkSRTDataNV transformT1 + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkTransformMatrixKHR transformT0 + VkTransformMatrixKHR transformT1 + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + VkAccelerationStructureInstanceKHR staticInstance + VkAccelerationStructureMatrixMotionInstanceNV matrixMotionInstance + VkAccelerationStructureSRTMotionInstanceNV srtMotionInstance + + + VkAccelerationStructureMotionInstanceTypeNV type + VkAccelerationStructureMotionInstanceFlagsNV flags + VkAccelerationStructureMotionInstanceDataNV data + + typedef void* VkRemoteAddressNV; + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + zx_handle_t collectionToken + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + uint32_t bufferCount + uint32_t createInfoIndex + uint64_t sysmemPixelFormat + VkFormatFeatureFlags formatFeatures + VkSysmemColorSpaceFUCHSIA sysmemColorSpaceIndex + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + VkBufferCreateInfo createInfo + VkFormatFeatureFlags requiredFormatFeatures + VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints + + + VkStructureType sType + const void* pNext + uint32_t colorSpace + + + VkStructureType sType + const void* pNext + VkImageCreateInfo imageCreateInfo + VkFormatFeatureFlags requiredFormatFeatures + VkImageFormatConstraintsFlagsFUCHSIA flags + uint64_t sysmemPixelFormat + uint32_t colorSpaceCount + const VkSysmemColorSpaceFUCHSIA* pColorSpaces + + + VkStructureType sType + const void* pNext + uint32_t formatConstraintsCount + const VkImageFormatConstraintsInfoFUCHSIA* pFormatConstraints + VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints + VkImageConstraintsInfoFlagsFUCHSIA flags + + + VkStructureType sType + const void* pNext + uint32_t minBufferCount + uint32_t maxBufferCount + uint32_t minBufferCountForCamping + uint32_t minBufferCountForDedicatedSlack + uint32_t minBufferCountForSharedSlack + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) + + VkStructureType sType + const void* pNext + size_t dataSize + const void* pData + + + VkStructureType sType + const void* pNext + VkCudaModuleNV module + const char* pName + + + VkStructureType sType + const void* pNext + VkCudaFunctionNV function + uint32_t gridDimX + uint32_t gridDimY + uint32_t gridDimZ + uint32_t blockDimX + uint32_t blockDimY + uint32_t blockDimZ + uint32_t sharedMemBytes + size_t paramCount + const void* const * pParams + size_t extraCount + const void* const * pExtras + + + VkStructureType sType + void* pNext + VkBool32 formatRgba10x6WithoutYCbCrSampler + + + VkStructureType sType + void* pNext + VkFormatFeatureFlags2 linearTilingFeatures + VkFormatFeatureFlags2 optimalTilingFeatures + VkFormatFeatureFlags2 bufferFeatures + + + + VkStructureType sType + void* pNext + uint32_t drmFormatModifierCount + VkDrmFormatModifierProperties2EXT* pDrmFormatModifierProperties + + + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + VkFormatFeatureFlags2 drmFormatModifierTilingFeatures + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + VkFormatFeatureFlags2 formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + uint32_t viewMask + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + + + + VkStructureType sType + const void* pNext + VkRenderingFlags flags + VkRect2D renderArea + uint32_t layerCount + uint32_t viewMask + uint32_t colorAttachmentCount + const VkRenderingAttachmentInfo* pColorAttachments + const VkRenderingAttachmentInfo* pDepthAttachment + const VkRenderingAttachmentInfo* pStencilAttachment + + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + VkResolveModeFlagBits resolveMode + VkImageView resolveImageView + VkImageLayout resolveImageLayout + VkAttachmentLoadOp loadOp + VkAttachmentStoreOp storeOp + VkClearValue clearValue + + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + VkExtent2D shadingRateAttachmentTexelSize + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + + + VkStructureType sType + void* pNext + VkBool32 dynamicRendering + + + + VkStructureType sType + const void* pNext + VkRenderingFlags flags + uint32_t viewMask + uint32_t colorAttachmentCount + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + VkSampleCountFlagBits rasterizationSamples + + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const VkSampleCountFlagBits* pColorAttachmentSamples + VkSampleCountFlagBits depthStencilAttachmentSamples + + + + VkStructureType sType + const void* pNext + VkBool32 perViewAttributes + VkBool32 perViewAttributesPositionXOnly + + + VkStructureType sType + void* pNext + VkBool32 minLod + + + VkStructureType sType + const void* pNext + float minLod + + + VkStructureType sType + void* pNext + VkBool32 rasterizationOrderColorAttachmentAccess + VkBool32 rasterizationOrderDepthAttachmentAccess + VkBool32 rasterizationOrderStencilAttachmentAccess + + + + VkStructureType sType + void* pNext + VkBool32 linearColorAttachment + + + VkStructureType sType + void* pNext + VkBool32 graphicsPipelineLibrary + + + VkStructureType sType + void* pNext + VkBool32 graphicsPipelineLibraryFastLinking + VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration + + + VkStructureType sType + const void* pNext + VkGraphicsPipelineLibraryFlagsEXT flags + + + VkStructureType sType + void* pNext + VkBool32 descriptorSetHostMapping + + + VkStructureType sType + const void* pNext + VkDescriptorSetLayout descriptorSetLayout + uint32_t binding + + + VkStructureType sType + void* pNext + size_t descriptorOffset + uint32_t descriptorSize + + + VkStructureType sType + void* pNext + VkBool32 nestedCommandBuffer + VkBool32 nestedCommandBufferRendering + VkBool32 nestedCommandBufferSimultaneousUse + + + VkStructureType sType + void* pNext + uint32_t maxCommandBufferNestingLevel + + + VkStructureType sType + void* pNext + VkBool32 shaderModuleIdentifier + + + VkStructureType sType + void* pNext + uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE] + + + VkStructureType sType + const void* pNext + uint32_t identifierSize + const uint8_t* pIdentifier + + + VkStructureType sType + void* pNext + uint32_t identifierSize + uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT] + + + VkStructureType sType + const void* pNext + VkImageCompressionFlagsEXT flags + uint32_t compressionControlPlaneCount + VkImageCompressionFixedRateFlagsEXT* pFixedRateFlags + + + VkStructureType sType + void* pNext + VkBool32 imageCompressionControl + + + VkStructureType sType + void* pNext + VkImageCompressionFlagsEXT imageCompressionFlags + VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags + + + VkStructureType sType + void* pNext + VkBool32 imageCompressionControlSwapchain + + + VkStructureType sType + void* pNext + VkImageSubresource imageSubresource + + + + VkStructureType sType + void* pNext + VkSubresourceLayout subresourceLayout + + + + VkStructureType sType + const void* pNext + VkBool32 disallowMerging + + + uint32_t postMergeSubpassCount + + + VkStructureType sType + const void* pNext + VkRenderPassCreationFeedbackInfoEXT* pRenderPassFeedback + + + VkSubpassMergeStatusEXT subpassMergeStatus + char description[VK_MAX_DESCRIPTION_SIZE] + uint32_t postMergeIndex + + + VkStructureType sType + const void* pNext + VkRenderPassSubpassFeedbackInfoEXT* pSubpassFeedback + + + VkStructureType sType + void* pNext + VkBool32 subpassMergeFeedback + + + VkStructureType sType + const void* pNext + VkMicromapTypeEXT type + VkBuildMicromapFlagsEXT flags + VkBuildMicromapModeEXT mode + VkMicromapEXT dstMicromap + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + VkDeviceOrHostAddressConstKHR data + VkDeviceOrHostAddressKHR scratchData + VkDeviceOrHostAddressConstKHR triangleArray + VkDeviceSize triangleArrayStride + + + VkStructureType sType + const void* pNext + VkMicromapCreateFlagsEXT createFlags + VkBuffer buffer + VkDeviceSize offsetSpecified in bytes + VkDeviceSize size + VkMicromapTypeEXT type + VkDeviceAddress deviceAddress + + + VkStructureType sType + const void* pNext + const uint8_t* pVersionData + + + VkStructureType sType + const void* pNext + VkMicromapEXT src + VkMicromapEXT dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkMicromapEXT src + VkDeviceOrHostAddressKHR dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR src + VkMicromapEXT dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkDeviceSize micromapSize + VkDeviceSize buildScratchSize + VkBool32 discardable + + + uint32_t count + uint32_t subdivisionLevel + uint32_t formatInterpretation depends on parent type + + + uint32_t dataOffsetSpecified in bytes + uint16_t subdivisionLevel + uint16_t format + + + VkStructureType sType + void* pNext + VkBool32 micromap + VkBool32 micromapCaptureReplay + VkBool32 micromapHostCommands + + + VkStructureType sType + void* pNext + uint32_t maxOpacity2StateSubdivisionLevel + uint32_t maxOpacity4StateSubdivisionLevel + + + VkStructureType sType + void* pNext + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexBuffer + VkDeviceSize indexStride + uint32_t baseTriangle + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + VkMicromapEXT micromap + + + VkStructureType sType + void* pNext + VkBool32 displacementMicromap + + + VkStructureType sType + void* pNext + uint32_t maxDisplacementMicromapSubdivisionLevel + + + VkStructureType sType + void* pNext + + VkFormat displacementBiasAndScaleFormat + VkFormat displacementVectorFormat + + VkDeviceOrHostAddressConstKHR displacementBiasAndScaleBuffer + VkDeviceSize displacementBiasAndScaleStride + VkDeviceOrHostAddressConstKHR displacementVectorBuffer + VkDeviceSize displacementVectorStride + VkDeviceOrHostAddressConstKHR displacedMicromapPrimitiveFlags + VkDeviceSize displacedMicromapPrimitiveFlagsStride + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexBuffer + VkDeviceSize indexStride + + uint32_t baseTriangle + + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + + VkMicromapEXT micromap + + + VkStructureType sType + void* pNext + uint8_t pipelineIdentifier[VK_UUID_SIZE] + + + VkStructureType sType + void* pNext + VkBool32 pipelinePropertiesIdentifier + + + VkStructureType sType + void* pNext + VkBool32 shaderEarlyAndLateFragmentTests + + + VkStructureType sType + const void* pNext + VkBool32 acquireUnmodifiedMemory + + + VkStructureType sType + const void* pNext + VkExportMetalObjectTypeFlagBitsEXT exportObjectType + + + VkStructureType sType + const void* pNext + + + VkStructureType sType + const void* pNext + MTLDevice_id mtlDevice + + + VkStructureType sType + const void* pNext + VkQueue queue + MTLCommandQueue_id mtlCommandQueue + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + MTLBuffer_id mtlBuffer + + + VkStructureType sType + const void* pNext + MTLBuffer_id mtlBuffer + + + VkStructureType sType + const void* pNext + VkImage image + VkImageView imageView + VkBufferView bufferView + VkImageAspectFlagBits plane + MTLTexture_id mtlTexture + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits plane + MTLTexture_id mtlTexture + + + VkStructureType sType + const void* pNext + VkImage image + IOSurfaceRef ioSurface + + + VkStructureType sType + const void* pNext + IOSurfaceRef ioSurface + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkEvent event + MTLSharedEvent_id mtlSharedEvent + + + VkStructureType sType + const void* pNext + MTLSharedEvent_id mtlSharedEvent + + + VkStructureType sType + void* pNext + VkBool32 nonSeamlessCubeMap + + + VkStructureType sType + void* pNext + VkBool32 pipelineRobustness + + + VkStructureType sType + const void* pNext + VkPipelineRobustnessBufferBehaviorEXT storageBuffers + VkPipelineRobustnessBufferBehaviorEXT uniformBuffers + VkPipelineRobustnessBufferBehaviorEXT vertexInputs + VkPipelineRobustnessImageBehaviorEXT images + + + VkStructureType sType + void* pNext + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs + VkPipelineRobustnessImageBehaviorEXT defaultRobustnessImages + + + VkStructureType sType + const void* pNext + VkOffset2D filterCenter + VkExtent2D filterSize + uint32_t numPhases + + + VkStructureType sType + void* pNext + VkBool32 textureSampleWeighted + VkBool32 textureBoxFilter + VkBool32 textureBlockMatch + + + VkStructureType sType + void* pNext + uint32_t maxWeightFilterPhases + VkExtent2D maxWeightFilterDimension + VkExtent2D maxBlockMatchRegion + VkExtent2D maxBoxFilterBlockSize + + + VkStructureType sType + void* pNext + VkBool32 tileProperties + + + VkStructureType sType + void* pNext + VkExtent3D tileSize + VkExtent2D apronSize + VkOffset2D origin + + + VkStructureType sType + void* pNext + VkBool32 amigoProfiling + + + VkStructureType sType + const void* pNext + uint64_t firstDrawTimestamp + uint64_t swapBufferTimestamp + + + VkStructureType sType + void* pNext + VkBool32 attachmentFeedbackLoopLayout + + + VkStructureType sType + void* pNext + VkBool32 depthClampZeroOne + + + VkStructureType sType + void* pNext + VkBool32 reportAddressBinding + + + VkStructureType sType + void* pNext + VkDeviceAddressBindingFlagsEXT flags + VkDeviceAddress baseAddress + VkDeviceSize size + VkDeviceAddressBindingTypeEXT bindingType + + + VkStructureType sType + void* pNext + VkBool32 opticalFlow + + + VkStructureType sType + void* pNext + VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes + VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes + VkBool32 hintSupported + VkBool32 costSupported + VkBool32 bidirectionalFlowSupported + VkBool32 globalFlowSupported + uint32_t minWidth + uint32_t minHeight + uint32_t maxWidth + uint32_t maxHeight + uint32_t maxNumRegionsOfInterest + + + VkStructureType sType + const void* pNext + VkOpticalFlowUsageFlagsNV usage + + + VkStructureType sType + const void* pNext + VkFormat format + + + VkStructureType sType + void* pNext + uint32_t width + uint32_t height + VkFormat imageFormat + VkFormat flowVectorFormat + VkFormat costFormat + VkOpticalFlowGridSizeFlagsNV outputGridSize + VkOpticalFlowGridSizeFlagsNV hintGridSize + VkOpticalFlowPerformanceLevelNV performanceLevel + VkOpticalFlowSessionCreateFlagsNV flags + + NV internal use only + VkStructureType sType + void* pNext + uint32_t id + uint32_t size + const void* pPrivateData + + + VkStructureType sType + void* pNext + VkOpticalFlowExecuteFlagsNV flags + uint32_t regionCount + const VkRect2D* pRegions + + + VkStructureType sType + void* pNext + VkBool32 deviceFault + VkBool32 deviceFaultVendorBinary + + + VkDeviceFaultAddressTypeEXT addressType + VkDeviceAddress reportedAddress + VkDeviceSize addressPrecision + + + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the fault + uint64_t vendorFaultCode + uint64_t vendorFaultData + + + VkStructureType sType + void* pNext + uint32_t addressInfoCount + uint32_t vendorInfoCount + VkDeviceSize vendorBinarySizeSpecified in bytes + + + VkStructureType sType + void* pNext + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the fault + VkDeviceFaultAddressInfoEXT* pAddressInfos + VkDeviceFaultVendorInfoEXT* pVendorInfos + void* pVendorBinaryData + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint32_t headerSize + VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion + uint32_t vendorID + uint32_t deviceID + uint32_t driverVersion + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + uint32_t applicationNameOffset + uint32_t applicationVersion + uint32_t engineNameOffset + uint32_t engineVersion + uint32_t apiVersion + + + VkStructureType sType + void* pNext + VkBool32 pipelineLibraryGroupHandles + + + VkStructureType sType + const void* pNext + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + + + VkStructureType sType + const void* pNext + VkDepthBiasRepresentationEXT depthBiasRepresentation + VkBool32 depthBiasExact + + + VkDeviceAddress srcAddress + VkDeviceAddress dstAddress + VkDeviceSize compressedSizeSpecified in bytes + VkDeviceSize decompressedSizeSpecified in bytes + VkMemoryDecompressionMethodFlagsNV decompressionMethod + + + VkStructureType sType + void* pNext + uint64_t shaderCoreMask + uint32_t shaderCoreCount + uint32_t shaderWarpsPerCore + + + VkStructureType sType + void* pNext + VkBool32 shaderCoreBuiltins + + + VkStructureType sType + const void* pNext + VkFrameBoundaryFlagsEXT flags + uint64_t frameID + uint32_t imageCount + const VkImage* pImages + uint32_t bufferCount + const VkBuffer* pBuffers + uint64_t tagName + size_t tagSize + const void* pTag + + + VkStructureType sType + void* pNext + VkBool32 frameBoundary + + + VkStructureType sType + void* pNext + VkBool32 dynamicRenderingUnusedAttachments + + + VkStructureType sType + void* pNext + VkPresentModeKHR presentMode + + + VkStructureType sType + void* pNext + VkPresentScalingFlagsEXT supportedPresentScaling + VkPresentGravityFlagsEXT supportedPresentGravityX + VkPresentGravityFlagsEXT supportedPresentGravityY + VkExtent2D minScaledImageExtentSupported minimum image width and height for the surface when scaling is used + VkExtent2D maxScaledImageExtentSupported maximum image width and height for the surface when scaling is used + + + VkStructureType sType + void* pNext + uint32_t presentModeCount + VkPresentModeKHR* pPresentModesOutput list of present modes compatible with the one specified in VkSurfacePresentModeEXT + + + VkStructureType sType + void* pNext + VkBool32 swapchainMaintenance1 + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkFence* pFencesFence to signal for each swapchain + + + VkStructureType sType + const void* pNext + uint32_t presentModeCountLength of the pPresentModes array + const VkPresentModeKHR* pPresentModesPresentation modes which will be usable with this swapchain + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentModeKHR* pPresentModesPresentation mode for each swapchain + + + VkStructureType sType + const void* pNext + VkPresentScalingFlagsEXT scalingBehavior + VkPresentGravityFlagsEXT presentGravityX + VkPresentGravityFlagsEXT presentGravityY + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchainSwapchain for which images are being released + uint32_t imageIndexCountNumber of indices to release + const uint32_t* pImageIndicesIndices of which presentable images to release + + + VkStructureType sType + void* pNext + VkBool32 depthBiasControl + VkBool32 leastRepresentableValueForceUnormRepresentation + VkBool32 floatRepresentation + VkBool32 depthBiasExact + + + VkStructureType sType + void* pNext + VkBool32 rayTracingInvocationReorder + + + VkStructureType sType + void* pNext + VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint + + + VkStructureType sType + void* pNext + VkBool32 extendedSparseAddressSpace + + + VkStructureType sType + void* pNext + VkDeviceSize extendedSparseAddressSpaceSizeTotal address space available for extended sparse allocations (bytes) + VkImageUsageFlags extendedSparseImageUsageFlagsBitfield of which image usages are supported for extended sparse allocations + VkBufferUsageFlags extendedSparseBufferUsageFlagsBitfield of which buffer usages are supported for extended sparse allocations + + + VkStructureType sType + void* pNext + VkDirectDriverLoadingFlagsLUNARG flags + PFN_vkGetInstanceProcAddrLUNARG pfnGetInstanceProcAddr + + + VkStructureType sType + const void* pNext + VkDirectDriverLoadingModeLUNARG mode + uint32_t driverCount + const VkDirectDriverLoadingInfoLUNARG* pDrivers + + + VkStructureType sType + void* pNext + VkBool32 multiviewPerViewViewports + + + VkStructureType sType + void* pNext + VkBool32 rayTracingPositionFetch + + + VkStructureType sType + const void* pNext + const VkImageCreateInfo* pCreateInfo + const VkImageSubresource2KHR* pSubresource + + + VkStructureType sType + void* pNext + uint32_t pixelRate + uint32_t texelRate + uint32_t fmaRate + + + VkStructureType sType + void* pNext + VkBool32 multiviewPerViewRenderAreas + + + VkStructureType sType + const void* pNext + uint32_t perViewRenderAreaCount + const VkRect2D* pPerViewRenderAreas + + + VkStructureType sType + const void* pNext + void* pQueriedLowLatencyData + + + VkStructureType sType + const void* pNext + VkMemoryMapFlags flags + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + + + VkStructureType sType + const void* pNext + VkMemoryUnmapFlagsKHR flags + VkDeviceMemory memory + + + VkStructureType sType + void* pNext + VkBool32 shaderObject + + + VkStructureType sType + void* pNext + uint8_t shaderBinaryUUID[VK_UUID_SIZE] + uint32_t shaderBinaryVersion + + + VkStructureType sType + const void* pNext + VkShaderCreateFlagsEXT flags + VkShaderStageFlagBits stage + VkShaderStageFlags nextStage + VkShaderCodeTypeEXT codeType + size_t codeSize + const void* pCode + const char* pName + uint32_t setLayoutCount + const VkDescriptorSetLayout* pSetLayouts + uint32_t pushConstantRangeCount + const VkPushConstantRange* pPushConstantRanges + const VkSpecializationInfo* pSpecializationInfo + + + VkStructureType sType + void* pNext + VkBool32 shaderTileImageColorReadAccess + VkBool32 shaderTileImageDepthReadAccess + VkBool32 shaderTileImageStencilReadAccess + + + VkStructureType sType + void* pNext + VkBool32 shaderTileImageCoherentReadAccelerated + VkBool32 shaderTileImageReadSampleFromPixelRateInvocation + VkBool32 shaderTileImageReadFromHelperInvocation + + + VkStructureType sType + const void* pNext + struct _screen_buffer* buffer + + + VkStructureType sType + void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + uint64_t screenUsage + VkFormatFeatureFlags formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + void* pNext + uint64_t externalFormat + + + VkStructureType sType + void* pNext + VkBool32 screenBufferImport + + + VkStructureType sType + void* pNext + VkBool32 cooperativeMatrix + VkBool32 cooperativeMatrixRobustBufferAccess + + + VkStructureType sType + void* pNext + uint32_t MSize + uint32_t NSize + uint32_t KSize + VkComponentTypeKHR AType + VkComponentTypeKHR BType + VkComponentTypeKHR CType + VkComponentTypeKHR ResultType + VkBool32 saturatingAccumulation + VkScopeKHR scope + + + VkStructureType sType + void* pNext + VkShaderStageFlags cooperativeMatrixSupportedStages + + + VkStructureType sType + void* pNext + uint32_t maxExecutionGraphDepth + uint32_t maxExecutionGraphShaderOutputNodes + uint32_t maxExecutionGraphShaderPayloadSize + uint32_t maxExecutionGraphShaderPayloadCount + uint32_t executionGraphDispatchAddressAlignment + + + VkStructureType sType + void* pNext + VkBool32 shaderEnqueue + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStages + const VkPipelineLibraryCreateInfoKHR* pLibraryInfo + VkPipelineLayout layout + VkPipeline basePipelineHandle + int32_t basePipelineIndex + + + VkStructureType sType + const void* pNext + const char* pName + uint32_t index + + + VkStructureType sType + void* pNext + VkDeviceSize size + + + uint32_t nodeIndex + uint32_t payloadCount + VkDeviceOrHostAddressConstAMDX payloads + uint64_t payloadStride + + + uint32_t count + VkDeviceOrHostAddressConstAMDX infos + uint64_t stride + + + VkStructureType sType + const void* pNext + VkResult* pResult + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t firstSet + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + uint32_t dynamicOffsetCount + const uint32_t* pDynamicOffsets + + + VkStructureType sType + const void* pNext + VkPipelineLayout layout + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + const void* pValues + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t set + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + + + VkStructureType sType + const void* pNext + VkDescriptorUpdateTemplate descriptorUpdateTemplate + VkPipelineLayout layout + uint32_t set + const void* pData + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t firstSet + uint32_t setCount + const uint32_t* pBufferIndices + const VkDeviceSize* pOffsets + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t set + + + VkStructureType sType + void* pNext + VkBool32 cubicRangeClamp + + + VkStructureType sType + void* pNext + VkBool32 ycbcrDegamma + + + VkStructureType sType + void* pNext + VkBool32 enableYDegamma + VkBool32 enableCbCrDegamma + + + VkStructureType sType + void* pNext + VkBool32 selectableCubicWeights + + + VkStructureType sType + const void* pNext + VkCubicFilterWeightsQCOM cubicWeights + + + VkStructureType sType + const void* pNext + VkCubicFilterWeightsQCOM cubicWeights + + + VkStructureType sType + void* pNext + VkBool32 textureBlockMatch2 + + + VkStructureType sType + void* pNext + VkExtent2D maxBlockMatchWindow + + + VkStructureType sType + const void* pNext + VkExtent2D windowExtent + VkBlockMatchWindowCompareModeQCOM windowCompareMode + + + VkStructureType sType + void* pNext + VkBool32 descriptorPoolOverallocation + + + VkStructureType sType + void* pNext + VkLayeredDriverUnderlyingApiMSFT underlyingAPI + + + VkStructureType sType + void* pNext + VkBool32 perStageDescriptorSet + VkBool32 dynamicPipelineLayout + + + VkStructureType sType + void* pNext + VkBool32 externalFormatResolve + + + VkStructureType sType + void* pNext + VkBool32 nullColorAttachmentWithExternalFormatResolve + VkChromaLocation externalFormatResolveChromaOffsetX + VkChromaLocation externalFormatResolveChromaOffsetY + + + VkStructureType sType + void* pNext + VkFormat colorAttachmentFormat + + + VkStructureType sType + const void* pNext + VkBool32 lowLatencyMode + VkBool32 lowLatencyBoost + uint32_t minimumIntervalUs + + + VkStructureType sType + const void* pNext + VkSemaphore signalSemaphore + uint64_t value + + + VkStructureType sType + const void* pNext + uint64_t presentID + VkLatencyMarkerNV marker + + + VkStructureType sType + const void* pNext + uint32_t timingCount + VkLatencyTimingsFrameReportNV* pTimings + + + VkStructureType sType + const void* pNext + uint64_t presentID + uint64_t inputSampleTimeUs + uint64_t simStartTimeUs + uint64_t simEndTimeUs + uint64_t renderSubmitStartTimeUs + uint64_t renderSubmitEndTimeUs + uint64_t presentStartTimeUs + uint64_t presentEndTimeUs + uint64_t driverStartTimeUs + uint64_t driverEndTimeUs + uint64_t osRenderQueueStartTimeUs + uint64_t osRenderQueueEndTimeUs + uint64_t gpuRenderStartTimeUs + uint64_t gpuRenderEndTimeUs + + + VkStructureType sType + const void* pNext + VkOutOfBandQueueTypeNV queueType + + + VkStructureType sType + const void* pNext + uint64_t presentID + + + VkStructureType sType + const void* pNext + VkBool32 latencyModeEnable + + + VkStructureType sType + const void* pNext + uint32_t presentModeCount + VkPresentModeKHR* pPresentModes + + + VkStructureType sType + void* pNext + VkBool32 cudaKernelLaunchFeatures + + + VkStructureType sType + void* pNext + uint32_t computeCapabilityMinor + uint32_t computeCapabilityMajor + + + VkStructureType sType + void* pNext + uint32_t shaderCoreCount + + + VkStructureType sType + void* pNext + VkBool32 schedulingControls + + + VkStructureType sType + void* pNext + VkPhysicalDeviceSchedulingControlsFlagsARM schedulingControlsFlags + + + VkStructureType sType + void* pNext + VkBool32 relaxedLineRasterization + + + VkStructureType sType + void* pNext + VkBool32 renderPassStriped + + + VkStructureType sType + void* pNext + VkExtent2D renderPassStripeGranularity + uint32_t maxRenderPassStripes + + + VkStructureType sType + const void* pNext + VkRect2D stripeArea + + + VkStructureType sType + const void* pNext + uint32_t stripeInfoCount + const VkRenderPassStripeInfoARM* pStripeInfos + + + VkStructureType sType + const void* pNext + uint32_t stripeSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pStripeSemaphoreInfos + + + VkStructureType sType + void* pNext + VkBool32 shaderMaximalReconvergence + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupRotate + VkBool32 shaderSubgroupRotateClustered + + + VkStructureType sType + void* pNext + VkBool32 shaderExpectAssume + + + VkStructureType sType + void* pNext + VkBool32 shaderFloatControls2 + + + VkStructureType sType + void* pNext + VkBool32 dynamicRenderingLocalRead + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const uint32_t* pColorAttachmentLocations + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const uint32_t* pColorAttachmentInputIndices + const uint32_t* pDepthInputAttachmentIndex + const uint32_t* pStencilInputAttachmentIndex + + + VkStructureType sType + void* pNext + VkBool32 shaderQuadControl + + + VkStructureType sType + void* pNext + VkBool32 shaderFloat16VectorAtomics + + + VkStructureType sType + void* pNext + VkBool32 memoryMapPlaced + VkBool32 memoryMapRangePlaced + VkBool32 memoryUnmapReserve + + + VkStructureType sType + void* pNext + VkDeviceSize minPlacedMemoryMapAlignment + + + VkStructureType sType + const void* pNext + void* pPlacedAddress + + + VkStructureType sType + void* pNext + VkBool32 shaderRawAccessChains + + + + + Vulkan enumerant (token) definitions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in + their own numeric namespaces. The "name" attribute is the C enum + type name, and is pulled in from a type tag definition above + (slightly clunky, but retains the type / enum distinction). "type" + attributes of "enum" or "bitmask" indicate that these values should + be generated inside an appropriate definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + value="4" reserved for VK_KHR_sampler_mirror_clamp_to_edge + enum VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; do not + alias! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Return codes (positive values) + + + + + + + Error codes (negative values) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flags + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSI Extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NVX_device_generated_commands formerly used these enum values, but that extension has been removed + value 31 / name VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT + value 32 / name VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vendor IDs are now represented as enums instead of the old + <vendorids> tag, allowing them to be included in the + API headers. + + + + + + + + + + + Driver IDs are now represented as enums instead of the old + <driverids> tag, allowing them to be included in the + API headers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bitpos 17-31 are specified by extensions to the original VkAccessFlagBits enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bitpos 17-31 are specified by extensions to the original VkPipelineStageFlagBits enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkResult vkCreateInstance + const VkInstanceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkInstance* pInstance + + + void vkDestroyInstance + VkInstance instance + const VkAllocationCallbacks* pAllocator + + all sname:VkPhysicalDevice objects enumerated from pname:instance + + + + VkResult vkEnumeratePhysicalDevices + VkInstance instance + uint32_t* pPhysicalDeviceCount + VkPhysicalDevice* pPhysicalDevices + + + PFN_vkVoidFunction vkGetDeviceProcAddr + VkDevice device + const char* pName + + + PFN_vkVoidFunction vkGetInstanceProcAddr + VkInstance instance + const char* pName + + + void vkGetPhysicalDeviceProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceProperties* pProperties + + + void vkGetPhysicalDeviceQueueFamilyProperties + VkPhysicalDevice physicalDevice + uint32_t* pQueueFamilyPropertyCount + VkQueueFamilyProperties* pQueueFamilyProperties + + + void vkGetPhysicalDeviceMemoryProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceMemoryProperties* pMemoryProperties + + + void vkGetPhysicalDeviceFeatures + VkPhysicalDevice physicalDevice + VkPhysicalDeviceFeatures* pFeatures + + + void vkGetPhysicalDeviceFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkFormatProperties* pFormatProperties + + + VkResult vkGetPhysicalDeviceImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + VkImageFormatProperties* pImageFormatProperties + + + VkResult vkCreateDevice + VkPhysicalDevice physicalDevice + const VkDeviceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDevice* pDevice + + + VkResult vkCreateDevice + VkPhysicalDevice physicalDevice + const VkDeviceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDevice* pDevice + + + void vkDestroyDevice + VkDevice device + const VkAllocationCallbacks* pAllocator + + all sname:VkQueue objects created from pname:device + + + + VkResult vkEnumerateInstanceVersion + uint32_t* pApiVersion + + + VkResult vkEnumerateInstanceLayerProperties + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateInstanceExtensionProperties + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + + VkResult vkEnumerateDeviceLayerProperties + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateDeviceLayerProperties + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + + VkResult vkEnumerateDeviceExtensionProperties + VkPhysicalDevice physicalDevice + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + + void vkGetDeviceQueue + VkDevice device + uint32_t queueFamilyIndex + uint32_t queueIndex + VkQueue* pQueue + + + VkResult vkQueueSubmit + VkQueue queue + uint32_t submitCount + const VkSubmitInfo* pSubmits + VkFence fence + + + VkResult vkQueueWaitIdle + VkQueue queue + + + VkResult vkDeviceWaitIdle + VkDevice device + + all sname:VkQueue objects created from pname:device + + + + VkResult vkAllocateMemory + VkDevice device + const VkMemoryAllocateInfo* pAllocateInfo + const VkAllocationCallbacks* pAllocator + VkDeviceMemory* pMemory + + + void vkFreeMemory + VkDevice device + VkDeviceMemory memory + const VkAllocationCallbacks* pAllocator + + + VkResult vkMapMemory + VkDevice device + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + VkMemoryMapFlags flags + void** ppData + + + void vkUnmapMemory + VkDevice device + VkDeviceMemory memory + + + VkResult vkFlushMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + + VkResult vkInvalidateMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + + void vkGetDeviceMemoryCommitment + VkDevice device + VkDeviceMemory memory + VkDeviceSize* pCommittedMemoryInBytes + + + void vkGetBufferMemoryRequirements + VkDevice device + VkBuffer buffer + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindBufferMemory + VkDevice device + VkBuffer buffer + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + void vkGetImageMemoryRequirements + VkDevice device + VkImage image + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindImageMemory + VkDevice device + VkImage image + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + void vkGetImageSparseMemoryRequirements + VkDevice device + VkImage image + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements* pSparseMemoryRequirements + + + void vkGetPhysicalDeviceSparseImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkSampleCountFlagBits samples + VkImageUsageFlags usage + VkImageTiling tiling + uint32_t* pPropertyCount + VkSparseImageFormatProperties* pProperties + + + VkResult vkQueueBindSparse + VkQueue queue + uint32_t bindInfoCount + const VkBindSparseInfo* pBindInfo + VkFence fence + + + VkResult vkCreateFence + VkDevice device + const VkFenceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + void vkDestroyFence + VkDevice device + VkFence fence + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + + + VkResult vkGetFenceStatus + VkDevice device + VkFence fence + + + VkResult vkWaitForFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + VkBool32 waitAll + uint64_t timeout + + + VkResult vkCreateSemaphore + VkDevice device + const VkSemaphoreCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSemaphore* pSemaphore + + + void vkDestroySemaphore + VkDevice device + VkSemaphore semaphore + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateEvent + VkDevice device + const VkEventCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkEvent* pEvent + + + void vkDestroyEvent + VkDevice device + VkEvent event + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetEventStatus + VkDevice device + VkEvent event + + + VkResult vkSetEvent + VkDevice device + VkEvent event + + + VkResult vkResetEvent + VkDevice device + VkEvent event + + + VkResult vkCreateQueryPool + VkDevice device + const VkQueryPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkQueryPool* pQueryPool + + + void vkDestroyQueryPool + VkDevice device + VkQueryPool queryPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetQueryPoolResults + VkDevice device + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + size_t dataSize + void* pData + VkDeviceSize stride + VkQueryResultFlags flags + + + void vkResetQueryPool + VkDevice device + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + + + VkResult vkCreateBuffer + VkDevice device + const VkBufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBuffer* pBuffer + + + void vkDestroyBuffer + VkDevice device + VkBuffer buffer + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateBufferView + VkDevice device + const VkBufferViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBufferView* pView + + + void vkDestroyBufferView + VkDevice device + VkBufferView bufferView + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateImage + VkDevice device + const VkImageCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImage* pImage + + + void vkDestroyImage + VkDevice device + VkImage image + const VkAllocationCallbacks* pAllocator + + + void vkGetImageSubresourceLayout + VkDevice device + VkImage image + const VkImageSubresource* pSubresource + VkSubresourceLayout* pLayout + + + VkResult vkCreateImageView + VkDevice device + const VkImageViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImageView* pView + + + void vkDestroyImageView + VkDevice device + VkImageView imageView + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateShaderModule + VkDevice device + const VkShaderModuleCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkShaderModule* pShaderModule + + + void vkDestroyShaderModule + VkDevice device + VkShaderModule shaderModule + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreatePipelineCache + VkDevice device + const VkPipelineCacheCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineCache* pPipelineCache + + + VkResult vkCreatePipelineCache + VkDevice device + const VkPipelineCacheCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineCache* pPipelineCache + + + void vkDestroyPipelineCache + VkDevice device + VkPipelineCache pipelineCache + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetPipelineCacheData + VkDevice device + VkPipelineCache pipelineCache + size_t* pDataSize + void* pData + + + VkResult vkMergePipelineCaches + VkDevice device + VkPipelineCache dstCache + uint32_t srcCacheCount + const VkPipelineCache* pSrcCaches + + + VkResult vkCreateGraphicsPipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkGraphicsPipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateGraphicsPipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkGraphicsPipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateComputePipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkComputePipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateComputePipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkComputePipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI + VkDevice device + VkRenderPass renderpass + VkExtent2D* pMaxWorkgroupSize + + + void vkDestroyPipeline + VkDevice device + VkPipeline pipeline + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreatePipelineLayout + VkDevice device + const VkPipelineLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineLayout* pPipelineLayout + + + void vkDestroyPipelineLayout + VkDevice device + VkPipelineLayout pipelineLayout + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateSampler + VkDevice device + const VkSamplerCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSampler* pSampler + + + void vkDestroySampler + VkDevice device + VkSampler sampler + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateDescriptorSetLayout + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorSetLayout* pSetLayout + + + void vkDestroyDescriptorSetLayout + VkDevice device + VkDescriptorSetLayout descriptorSetLayout + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateDescriptorPool + VkDevice device + const VkDescriptorPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorPool* pDescriptorPool + + + void vkDestroyDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + VkDescriptorPoolResetFlags flags + + any sname:VkDescriptorSet objects allocated from pname:descriptorPool + + + + VkResult vkAllocateDescriptorSets + VkDevice device + const VkDescriptorSetAllocateInfo* pAllocateInfo + VkDescriptorSet* pDescriptorSets + + + VkResult vkFreeDescriptorSets + VkDevice device + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + + + void vkUpdateDescriptorSets + VkDevice device + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + uint32_t descriptorCopyCount + const VkCopyDescriptorSet* pDescriptorCopies + + + VkResult vkCreateFramebuffer + VkDevice device + const VkFramebufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFramebuffer* pFramebuffer + + + void vkDestroyFramebuffer + VkDevice device + VkFramebuffer framebuffer + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateRenderPass + VkDevice device + const VkRenderPassCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkRenderPass* pRenderPass + + + void vkDestroyRenderPass + VkDevice device + VkRenderPass renderPass + const VkAllocationCallbacks* pAllocator + + + void vkGetRenderAreaGranularity + VkDevice device + VkRenderPass renderPass + VkExtent2D* pGranularity + + + void vkGetRenderingAreaGranularityKHR + VkDevice device + const VkRenderingAreaInfoKHR* pRenderingAreaInfo + VkExtent2D* pGranularity + + + VkResult vkCreateCommandPool + VkDevice device + const VkCommandPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCommandPool* pCommandPool + + + void vkDestroyCommandPool + VkDevice device + VkCommandPool commandPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetCommandPool + VkDevice device + VkCommandPool commandPool + VkCommandPoolResetFlags flags + + + VkResult vkAllocateCommandBuffers + VkDevice device + const VkCommandBufferAllocateInfo* pAllocateInfo + VkCommandBuffer* pCommandBuffers + + + void vkFreeCommandBuffers + VkDevice device + VkCommandPool commandPool + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + + VkResult vkBeginCommandBuffer + VkCommandBuffer commandBuffer + const VkCommandBufferBeginInfo* pBeginInfo + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + VkResult vkEndCommandBuffer + VkCommandBuffer commandBuffer + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + VkResult vkResetCommandBuffer + VkCommandBuffer commandBuffer + VkCommandBufferResetFlags flags + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + void vkCmdBindPipeline + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + void vkCmdSetAttachmentFeedbackLoopEnableEXT + VkCommandBuffer commandBuffer + VkImageAspectFlags aspectMask + + + void vkCmdSetViewport + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewport* pViewports + + + void vkCmdSetScissor + VkCommandBuffer commandBuffer + uint32_t firstScissor + uint32_t scissorCount + const VkRect2D* pScissors + + + void vkCmdSetLineWidth + VkCommandBuffer commandBuffer + float lineWidth + + + void vkCmdSetDepthBias + VkCommandBuffer commandBuffer + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + + + void vkCmdSetBlendConstants + VkCommandBuffer commandBuffer + const float blendConstants[4] + + + void vkCmdSetDepthBounds + VkCommandBuffer commandBuffer + float minDepthBounds + float maxDepthBounds + + + void vkCmdSetStencilCompareMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t compareMask + + + void vkCmdSetStencilWriteMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t writeMask + + + void vkCmdSetStencilReference + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t reference + + + void vkCmdBindDescriptorSets + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t firstSet + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + uint32_t dynamicOffsetCount + const uint32_t* pDynamicOffsets + + + void vkCmdBindIndexBuffer + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkIndexType indexType + + + void vkCmdBindVertexBuffers + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + + + void vkCmdDraw + VkCommandBuffer commandBuffer + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + + void vkCmdDrawIndexed + VkCommandBuffer commandBuffer + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + + void vkCmdDrawMultiEXT + VkCommandBuffer commandBuffer + uint32_t drawCount + const VkMultiDrawInfoEXT* pVertexInfo + uint32_t instanceCount + uint32_t firstInstance + uint32_t stride + + + void vkCmdDrawMultiIndexedEXT + VkCommandBuffer commandBuffer + uint32_t drawCount + const VkMultiDrawIndexedInfoEXT* pIndexInfo + uint32_t instanceCount + uint32_t firstInstance + uint32_t stride + const int32_t* pVertexOffset + + + void vkCmdDrawIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawIndexedIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDispatch + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDispatchIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + + + void vkCmdSubpassShadingHUAWEI + VkCommandBuffer commandBuffer + + + void vkCmdDrawClusterHUAWEI + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDrawClusterIndirectHUAWEI + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + + + void vkCmdUpdatePipelineIndirectBufferNV + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + void vkCmdCopyBuffer + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferCopy* pRegions + + + void vkCmdCopyImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy* pRegions + + + void vkCmdBlitImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageBlit* pRegions + VkFilter filter + + + void vkCmdCopyBufferToImage + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkBufferImageCopy* pRegions + + + void vkCmdCopyImageToBuffer + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferImageCopy* pRegions + + + void vkCmdCopyMemoryIndirectNV + VkCommandBuffer commandBuffer + VkDeviceAddress copyBufferAddress + uint32_t copyCount + uint32_t stride + + + void vkCmdCopyMemoryToImageIndirectNV + VkCommandBuffer commandBuffer + VkDeviceAddress copyBufferAddress + uint32_t copyCount + uint32_t stride + VkImage dstImage + VkImageLayout dstImageLayout + const VkImageSubresourceLayers* pImageSubresources + + + void vkCmdUpdateBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize dataSize + const void* pData + + + void vkCmdFillBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize size + uint32_t data + + + void vkCmdClearColorImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearColorValue* pColor + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + + void vkCmdClearDepthStencilImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearDepthStencilValue* pDepthStencil + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + + void vkCmdClearAttachments + VkCommandBuffer commandBuffer + uint32_t attachmentCount + const VkClearAttachment* pAttachments + uint32_t rectCount + const VkClearRect* pRects + + + void vkCmdResolveImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageResolve* pRegions + + + void vkCmdSetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + + void vkCmdResetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + + void vkCmdWaitEvents + VkCommandBuffer commandBuffer + uint32_t eventCount + const VkEvent* pEvents + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + + void vkCmdPipelineBarrier + VkCommandBuffer commandBuffer + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkDependencyFlags dependencyFlags + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + + void vkCmdBeginQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + VkQueryControlFlags flags + + + void vkCmdEndQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + + + void vkCmdBeginConditionalRenderingEXT + VkCommandBuffer commandBuffer + const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin + + + void vkCmdEndConditionalRenderingEXT + VkCommandBuffer commandBuffer + + + void vkCmdResetQueryPool + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + + void vkCmdWriteTimestamp + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkQueryPool queryPool + uint32_t query + + + void vkCmdCopyQueryPoolResults + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize stride + VkQueryResultFlags flags + + + void vkCmdPushConstants + VkCommandBuffer commandBuffer + VkPipelineLayout layout + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + const void* pValues + + + void vkCmdBeginRenderPass + VkCommandBuffer commandBuffer + const VkRenderPassBeginInfo* pRenderPassBegin + VkSubpassContents contents + + + void vkCmdNextSubpass + VkCommandBuffer commandBuffer + VkSubpassContents contents + + + void vkCmdEndRenderPass + VkCommandBuffer commandBuffer + + + void vkCmdExecuteCommands + VkCommandBuffer commandBuffer + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + + VkResult vkCreateAndroidSurfaceKHR + VkInstance instance + const VkAndroidSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkGetPhysicalDeviceDisplayPropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPropertiesKHR* pProperties + + + VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPlanePropertiesKHR* pProperties + + + VkResult vkGetDisplayPlaneSupportedDisplaysKHR + VkPhysicalDevice physicalDevice + uint32_t planeIndex + uint32_t* pDisplayCount + VkDisplayKHR* pDisplays + + + VkResult vkGetDisplayModePropertiesKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + uint32_t* pPropertyCount + VkDisplayModePropertiesKHR* pProperties + + + VkResult vkCreateDisplayModeKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + const VkDisplayModeCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDisplayModeKHR* pMode + + + VkResult vkGetDisplayPlaneCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkDisplayModeKHR mode + uint32_t planeIndex + VkDisplayPlaneCapabilitiesKHR* pCapabilities + + + VkResult vkCreateDisplayPlaneSurfaceKHR + VkInstance instance + const VkDisplaySurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateSharedSwapchainsKHR + VkDevice device + uint32_t swapchainCount + const VkSwapchainCreateInfoKHR* pCreateInfos + const VkSwapchainCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchains + + + void vkDestroySurfaceKHR + VkInstance instance + VkSurfaceKHR surface + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetPhysicalDeviceSurfaceSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + VkSurfaceKHR surface + VkBool32* pSupported + + + VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + VkSurfaceCapabilitiesKHR* pSurfaceCapabilities + + + VkResult vkGetPhysicalDeviceSurfaceFormatsKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pSurfaceFormatCount + VkSurfaceFormatKHR* pSurfaceFormats + + + VkResult vkGetPhysicalDeviceSurfacePresentModesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pPresentModeCount + VkPresentModeKHR* pPresentModes + + + VkResult vkCreateSwapchainKHR + VkDevice device + const VkSwapchainCreateInfoKHR* pCreateInfo + const VkSwapchainCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchain + + + void vkDestroySwapchainKHR + VkDevice device + VkSwapchainKHR swapchain + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetSwapchainImagesKHR + VkDevice device + VkSwapchainKHR swapchain + uint32_t* pSwapchainImageCount + VkImage* pSwapchainImages + + + VkResult vkAcquireNextImageKHR + VkDevice device + VkSwapchainKHR swapchain + uint64_t timeout + VkSemaphore semaphore + VkFence fence + uint32_t* pImageIndex + + + VkResult vkQueuePresentKHR + VkQueue queue + const VkPresentInfoKHR* pPresentInfo + + + VkResult vkCreateViSurfaceNN + VkInstance instance + const VkViSurfaceCreateInfoNN* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateWaylandSurfaceKHR + VkInstance instance + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + struct wl_display* display + + + VkResult vkCreateWin32SurfaceKHR + VkInstance instance + const VkWin32SurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + + + VkResult vkCreateXlibSurfaceKHR + VkInstance instance + const VkXlibSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + Display* dpy + VisualID visualID + + + VkResult vkCreateXcbSurfaceKHR + VkInstance instance + const VkXcbSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + xcb_connection_t* connection + xcb_visualid_t visual_id + + + VkResult vkCreateDirectFBSurfaceEXT + VkInstance instance + const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceDirectFBPresentationSupportEXT + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + IDirectFB* dfb + + + VkResult vkCreateImagePipeSurfaceFUCHSIA + VkInstance instance + const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateStreamDescriptorSurfaceGGP + VkInstance instance + const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateScreenSurfaceQNX + VkInstance instance + const VkScreenSurfaceCreateInfoQNX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + struct _screen_window* window + + + VkResult vkCreateDebugReportCallbackEXT + VkInstance instance + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugReportCallbackEXT* pCallback + + + void vkDestroyDebugReportCallbackEXT + VkInstance instance + VkDebugReportCallbackEXT callback + const VkAllocationCallbacks* pAllocator + + + void vkDebugReportMessageEXT + VkInstance instance + VkDebugReportFlagsEXT flags + VkDebugReportObjectTypeEXT objectType + uint64_t object + size_t location + int32_t messageCode + const char* pLayerPrefix + const char* pMessage + + + VkResult vkDebugMarkerSetObjectNameEXT + VkDevice device + const VkDebugMarkerObjectNameInfoEXT* pNameInfo + + + VkResult vkDebugMarkerSetObjectTagEXT + VkDevice device + const VkDebugMarkerObjectTagInfoEXT* pTagInfo + + + void vkCmdDebugMarkerBeginEXT + VkCommandBuffer commandBuffer + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo + + + void vkCmdDebugMarkerEndEXT + VkCommandBuffer commandBuffer + + + void vkCmdDebugMarkerInsertEXT + VkCommandBuffer commandBuffer + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo + + + VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + VkExternalMemoryHandleTypeFlagsNV externalHandleType + VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties + + + VkResult vkGetMemoryWin32HandleNV + VkDevice device + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagsNV handleType + HANDLE* pHandle + + + void vkCmdExecuteGeneratedCommandsNV + VkCommandBuffer commandBuffer + VkBool32 isPreprocessed + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo + + + void vkCmdPreprocessGeneratedCommandsNV + VkCommandBuffer commandBuffer + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo + + + void vkCmdBindPipelineShaderGroupNV + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + uint32_t groupIndex + + + void vkGetGeneratedCommandsMemoryRequirementsNV + VkDevice device + const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + VkResult vkCreateIndirectCommandsLayoutNV + VkDevice device + const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkIndirectCommandsLayoutNV* pIndirectCommandsLayout + + + void vkDestroyIndirectCommandsLayoutNV + VkDevice device + VkIndirectCommandsLayoutNV indirectCommandsLayout + const VkAllocationCallbacks* pAllocator + + + void vkGetPhysicalDeviceFeatures2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceFeatures2* pFeatures + + + + void vkGetPhysicalDeviceProperties2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceProperties2* pProperties + + + + void vkGetPhysicalDeviceFormatProperties2 + VkPhysicalDevice physicalDevice + VkFormat format + VkFormatProperties2* pFormatProperties + + + + VkResult vkGetPhysicalDeviceImageFormatProperties2 + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo + VkImageFormatProperties2* pImageFormatProperties + + + + void vkGetPhysicalDeviceQueueFamilyProperties2 + VkPhysicalDevice physicalDevice + uint32_t* pQueueFamilyPropertyCount + VkQueueFamilyProperties2* pQueueFamilyProperties + + + + void vkGetPhysicalDeviceMemoryProperties2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceMemoryProperties2* pMemoryProperties + + + + void vkGetPhysicalDeviceSparseImageFormatProperties2 + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo + uint32_t* pPropertyCount + VkSparseImageFormatProperties2* pProperties + + + + void vkCmdPushDescriptorSetKHR + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t set + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + + + void vkTrimCommandPool + VkDevice device + VkCommandPool commandPool + VkCommandPoolTrimFlags flags + + + + void vkGetPhysicalDeviceExternalBufferProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo + VkExternalBufferProperties* pExternalBufferProperties + + + + VkResult vkGetMemoryWin32HandleKHR + VkDevice device + const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkGetMemoryWin32HandlePropertiesKHR + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + HANDLE handle + VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties + + + VkResult vkGetMemoryFdKHR + VkDevice device + const VkMemoryGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkGetMemoryFdPropertiesKHR + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + int fd + VkMemoryFdPropertiesKHR* pMemoryFdProperties + + + VkResult vkGetMemoryZirconHandleFUCHSIA + VkDevice device + const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo + zx_handle_t* pZirconHandle + + + VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + zx_handle_t zirconHandle + VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties + + + VkResult vkGetMemoryRemoteAddressNV + VkDevice device + const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo + VkRemoteAddressNV* pAddress + + + VkResult vkGetMemorySciBufNV + VkDevice device + const VkMemoryGetSciBufInfoNV* pGetSciBufInfo + NvSciBufObj* pHandle + + + VkResult vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV + VkPhysicalDevice physicalDevice + VkExternalMemoryHandleTypeFlagBits handleType + NvSciBufObj handle + VkMemorySciBufPropertiesNV* pMemorySciBufProperties + + + VkResult vkGetPhysicalDeviceSciBufAttributesNV + VkPhysicalDevice physicalDevice + NvSciBufAttrList pAttributes + + + void vkGetPhysicalDeviceExternalSemaphoreProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo + VkExternalSemaphoreProperties* pExternalSemaphoreProperties + + + + VkResult vkGetSemaphoreWin32HandleKHR + VkDevice device + const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkImportSemaphoreWin32HandleKHR + VkDevice device + const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo + + + VkResult vkGetSemaphoreFdKHR + VkDevice device + const VkSemaphoreGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkImportSemaphoreFdKHR + VkDevice device + const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo + + + VkResult vkGetSemaphoreZirconHandleFUCHSIA + VkDevice device + const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo + zx_handle_t* pZirconHandle + + + VkResult vkImportSemaphoreZirconHandleFUCHSIA + VkDevice device + const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo + + + void vkGetPhysicalDeviceExternalFenceProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo + VkExternalFenceProperties* pExternalFenceProperties + + + + VkResult vkGetFenceWin32HandleKHR + VkDevice device + const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkImportFenceWin32HandleKHR + VkDevice device + const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo + + + VkResult vkGetFenceFdKHR + VkDevice device + const VkFenceGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkImportFenceFdKHR + VkDevice device + const VkImportFenceFdInfoKHR* pImportFenceFdInfo + + + VkResult vkGetFenceSciSyncFenceNV + VkDevice device + const VkFenceGetSciSyncInfoNV* pGetSciSyncHandleInfo + void* pHandle + + + VkResult vkGetFenceSciSyncObjNV + VkDevice device + const VkFenceGetSciSyncInfoNV* pGetSciSyncHandleInfo + void* pHandle + + + VkResult vkImportFenceSciSyncFenceNV + VkDevice device + const VkImportFenceSciSyncInfoNV* pImportFenceSciSyncInfo + + + VkResult vkImportFenceSciSyncObjNV + VkDevice device + const VkImportFenceSciSyncInfoNV* pImportFenceSciSyncInfo + + + VkResult vkGetSemaphoreSciSyncObjNV + VkDevice device + const VkSemaphoreGetSciSyncInfoNV* pGetSciSyncInfo + void* pHandle + + + VkResult vkImportSemaphoreSciSyncObjNV + VkDevice device + const VkImportSemaphoreSciSyncInfoNV* pImportSemaphoreSciSyncInfo + + + VkResult vkGetPhysicalDeviceSciSyncAttributesNV + VkPhysicalDevice physicalDevice + const VkSciSyncAttributesInfoNV* pSciSyncAttributesInfo + NvSciSyncAttrList pAttributes + + + VkResult vkCreateSemaphoreSciSyncPoolNV + VkDevice device + const VkSemaphoreSciSyncPoolCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSemaphoreSciSyncPoolNV* pSemaphorePool + + + void vkDestroySemaphoreSciSyncPoolNV + VkDevice device + VkSemaphoreSciSyncPoolNV semaphorePool + const VkAllocationCallbacks* pAllocator + + + VkResult vkReleaseDisplayEXT + VkPhysicalDevice physicalDevice + VkDisplayKHR display + + + VkResult vkAcquireXlibDisplayEXT + VkPhysicalDevice physicalDevice + Display* dpy + VkDisplayKHR display + + + VkResult vkGetRandROutputDisplayEXT + VkPhysicalDevice physicalDevice + Display* dpy + RROutput rrOutput + VkDisplayKHR* pDisplay + + + VkResult vkAcquireWinrtDisplayNV + VkPhysicalDevice physicalDevice + VkDisplayKHR display + + + VkResult vkGetWinrtDisplayNV + VkPhysicalDevice physicalDevice + uint32_t deviceRelativeId + VkDisplayKHR* pDisplay + + + VkResult vkDisplayPowerControlEXT + VkDevice device + VkDisplayKHR display + const VkDisplayPowerInfoEXT* pDisplayPowerInfo + + + VkResult vkRegisterDeviceEventEXT + VkDevice device + const VkDeviceEventInfoEXT* pDeviceEventInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + VkResult vkRegisterDisplayEventEXT + VkDevice device + VkDisplayKHR display + const VkDisplayEventInfoEXT* pDisplayEventInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + VkResult vkGetSwapchainCounterEXT + VkDevice device + VkSwapchainKHR swapchain + VkSurfaceCounterFlagBitsEXT counter + uint64_t* pCounterValue + + + VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + VkSurfaceCapabilities2EXT* pSurfaceCapabilities + + + VkResult vkEnumeratePhysicalDeviceGroups + VkInstance instance + uint32_t* pPhysicalDeviceGroupCount + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties + + + + void vkGetDeviceGroupPeerMemoryFeatures + VkDevice device + uint32_t heapIndex + uint32_t localDeviceIndex + uint32_t remoteDeviceIndex + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures + + + + VkResult vkBindBufferMemory2 + VkDevice device + uint32_t bindInfoCount + const VkBindBufferMemoryInfo* pBindInfos + + + + VkResult vkBindImageMemory2 + VkDevice device + uint32_t bindInfoCount + const VkBindImageMemoryInfo* pBindInfos + + + + void vkCmdSetDeviceMask + VkCommandBuffer commandBuffer + uint32_t deviceMask + + + + VkResult vkGetDeviceGroupPresentCapabilitiesKHR + VkDevice device + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities + + + VkResult vkGetDeviceGroupSurfacePresentModesKHR + VkDevice device + VkSurfaceKHR surface + VkDeviceGroupPresentModeFlagsKHR* pModes + + + VkResult vkAcquireNextImage2KHR + VkDevice device + const VkAcquireNextImageInfoKHR* pAcquireInfo + uint32_t* pImageIndex + + + void vkCmdDispatchBase + VkCommandBuffer commandBuffer + uint32_t baseGroupX + uint32_t baseGroupY + uint32_t baseGroupZ + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + + VkResult vkGetPhysicalDevicePresentRectanglesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pRectCount + VkRect2D* pRects + + + VkResult vkCreateDescriptorUpdateTemplate + VkDevice device + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate + + + + void vkDestroyDescriptorUpdateTemplate + VkDevice device + VkDescriptorUpdateTemplate descriptorUpdateTemplate + const VkAllocationCallbacks* pAllocator + + + + void vkUpdateDescriptorSetWithTemplate + VkDevice device + VkDescriptorSet descriptorSet + VkDescriptorUpdateTemplate descriptorUpdateTemplate + const void* pData + + + + void vkCmdPushDescriptorSetWithTemplateKHR + VkCommandBuffer commandBuffer + VkDescriptorUpdateTemplate descriptorUpdateTemplate + VkPipelineLayout layout + uint32_t set + const void* pData + + + void vkSetHdrMetadataEXT + VkDevice device + uint32_t swapchainCount + const VkSwapchainKHR* pSwapchains + const VkHdrMetadataEXT* pMetadata + + + VkResult vkGetSwapchainStatusKHR + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkGetRefreshCycleDurationGOOGLE + VkDevice device + VkSwapchainKHR swapchain + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties + + + VkResult vkGetPastPresentationTimingGOOGLE + VkDevice device + VkSwapchainKHR swapchain + uint32_t* pPresentationTimingCount + VkPastPresentationTimingGOOGLE* pPresentationTimings + + + VkResult vkCreateIOSSurfaceMVK + VkInstance instance + const VkIOSSurfaceCreateInfoMVK* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateMacOSSurfaceMVK + VkInstance instance + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateMetalSurfaceEXT + VkInstance instance + const VkMetalSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + void vkCmdSetViewportWScalingNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewportWScalingNV* pViewportWScalings + + + void vkCmdSetDiscardRectangleEXT + VkCommandBuffer commandBuffer + uint32_t firstDiscardRectangle + uint32_t discardRectangleCount + const VkRect2D* pDiscardRectangles + + + void vkCmdSetDiscardRectangleEnableEXT + VkCommandBuffer commandBuffer + VkBool32 discardRectangleEnable + + + void vkCmdSetDiscardRectangleModeEXT + VkCommandBuffer commandBuffer + VkDiscardRectangleModeEXT discardRectangleMode + + + void vkCmdSetSampleLocationsEXT + VkCommandBuffer commandBuffer + const VkSampleLocationsInfoEXT* pSampleLocationsInfo + + + void vkGetPhysicalDeviceMultisamplePropertiesEXT + VkPhysicalDevice physicalDevice + VkSampleCountFlagBits samples + VkMultisamplePropertiesEXT* pMultisampleProperties + + + VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + VkSurfaceCapabilities2KHR* pSurfaceCapabilities + + + VkResult vkGetPhysicalDeviceSurfaceFormats2KHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + uint32_t* pSurfaceFormatCount + VkSurfaceFormat2KHR* pSurfaceFormats + + + VkResult vkGetPhysicalDeviceDisplayProperties2KHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayProperties2KHR* pProperties + + + VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPlaneProperties2KHR* pProperties + + + VkResult vkGetDisplayModeProperties2KHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + uint32_t* pPropertyCount + VkDisplayModeProperties2KHR* pProperties + + + VkResult vkGetDisplayPlaneCapabilities2KHR + VkPhysicalDevice physicalDevice + const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo + VkDisplayPlaneCapabilities2KHR* pCapabilities + + + void vkGetBufferMemoryRequirements2 + VkDevice device + const VkBufferMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetImageMemoryRequirements2 + VkDevice device + const VkImageMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetImageSparseMemoryRequirements2 + VkDevice device + const VkImageSparseMemoryRequirementsInfo2* pInfo + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements + + + + void vkGetDeviceBufferMemoryRequirements + VkDevice device + const VkDeviceBufferMemoryRequirements* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetDeviceImageMemoryRequirements + VkDevice device + const VkDeviceImageMemoryRequirements* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetDeviceImageSparseMemoryRequirements + VkDevice device + const VkDeviceImageMemoryRequirements* pInfo + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements + + + + VkResult vkCreateSamplerYcbcrConversion + VkDevice device + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSamplerYcbcrConversion* pYcbcrConversion + + + + void vkDestroySamplerYcbcrConversion + VkDevice device + VkSamplerYcbcrConversion ycbcrConversion + const VkAllocationCallbacks* pAllocator + + + + void vkGetDeviceQueue2 + VkDevice device + const VkDeviceQueueInfo2* pQueueInfo + VkQueue* pQueue + + + VkResult vkCreateValidationCacheEXT + VkDevice device + const VkValidationCacheCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkValidationCacheEXT* pValidationCache + + + void vkDestroyValidationCacheEXT + VkDevice device + VkValidationCacheEXT validationCache + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetValidationCacheDataEXT + VkDevice device + VkValidationCacheEXT validationCache + size_t* pDataSize + void* pData + + + VkResult vkMergeValidationCachesEXT + VkDevice device + VkValidationCacheEXT dstCache + uint32_t srcCacheCount + const VkValidationCacheEXT* pSrcCaches + + + void vkGetDescriptorSetLayoutSupport + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + VkDescriptorSetLayoutSupport* pSupport + + + + VkResult vkGetSwapchainGrallocUsageANDROID + VkDevice device + VkFormat format + VkImageUsageFlags imageUsage + int* grallocUsage + + + VkResult vkGetSwapchainGrallocUsage2ANDROID + VkDevice device + VkFormat format + VkImageUsageFlags imageUsage + VkSwapchainImageUsageFlagsANDROID swapchainImageUsage + uint64_t* grallocConsumerUsage + uint64_t* grallocProducerUsage + + + VkResult vkAcquireImageANDROID + VkDevice device + VkImage image + int nativeFenceFd + VkSemaphore semaphore + VkFence fence + + + VkResult vkQueueSignalReleaseImageANDROID + VkQueue queue + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + VkImage image + int* pNativeFenceFd + + + VkResult vkGetShaderInfoAMD + VkDevice device + VkPipeline pipeline + VkShaderStageFlagBits shaderStage + VkShaderInfoTypeAMD infoType + size_t* pInfoSize + void* pInfo + + + void vkSetLocalDimmingAMD + VkDevice device + VkSwapchainKHR swapChain + VkBool32 localDimmingEnable + + + VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsKHR + VkPhysicalDevice physicalDevice + uint32_t* pTimeDomainCount + VkTimeDomainKHR* pTimeDomains + + + + VkResult vkGetCalibratedTimestampsKHR + VkDevice device + uint32_t timestampCount + const VkCalibratedTimestampInfoKHR* pTimestampInfos + uint64_t* pTimestamps + uint64_t* pMaxDeviation + + + + VkResult vkSetDebugUtilsObjectNameEXT + VkDevice device + const VkDebugUtilsObjectNameInfoEXT* pNameInfo + + + VkResult vkSetDebugUtilsObjectTagEXT + VkDevice device + const VkDebugUtilsObjectTagInfoEXT* pTagInfo + + + void vkQueueBeginDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkQueueEndDebugUtilsLabelEXT + VkQueue queue + + + void vkQueueInsertDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdBeginDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdEndDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + + + void vkCmdInsertDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + VkResult vkCreateDebugUtilsMessengerEXT + VkInstance instance + const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugUtilsMessengerEXT* pMessenger + + + void vkDestroyDebugUtilsMessengerEXT + VkInstance instance + VkDebugUtilsMessengerEXT messenger + const VkAllocationCallbacks* pAllocator + + + void vkSubmitDebugUtilsMessageEXT + VkInstance instance + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageTypes + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData + + + VkResult vkGetMemoryHostPointerPropertiesEXT + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + const void* pHostPointer + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties + + + void vkCmdWriteBufferMarkerAMD + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkBuffer dstBuffer + VkDeviceSize dstOffset + uint32_t marker + + + VkResult vkCreateRenderPass2 + VkDevice device + const VkRenderPassCreateInfo2* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkRenderPass* pRenderPass + + + + void vkCmdBeginRenderPass2 + VkCommandBuffer commandBuffer + const VkRenderPassBeginInfo* pRenderPassBegin + const VkSubpassBeginInfo* pSubpassBeginInfo + + + + void vkCmdNextSubpass2 + VkCommandBuffer commandBuffer + const VkSubpassBeginInfo* pSubpassBeginInfo + const VkSubpassEndInfo* pSubpassEndInfo + + + + void vkCmdEndRenderPass2 + VkCommandBuffer commandBuffer + const VkSubpassEndInfo* pSubpassEndInfo + + + + VkResult vkGetSemaphoreCounterValue + VkDevice device + VkSemaphore semaphore + uint64_t* pValue + + + + VkResult vkWaitSemaphores + VkDevice device + const VkSemaphoreWaitInfo* pWaitInfo + uint64_t timeout + + + + VkResult vkSignalSemaphore + VkDevice device + const VkSemaphoreSignalInfo* pSignalInfo + + + + VkResult vkGetAndroidHardwareBufferPropertiesANDROID + VkDevice device + const struct AHardwareBuffer* buffer + VkAndroidHardwareBufferPropertiesANDROID* pProperties + + + VkResult vkGetMemoryAndroidHardwareBufferANDROID + VkDevice device + const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo + struct AHardwareBuffer** pBuffer + + + void vkCmdDrawIndirectCount + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + + + void vkCmdDrawIndexedIndirectCount + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + + + void vkCmdSetCheckpointNV + VkCommandBuffer commandBuffer + const void* pCheckpointMarker + + + void vkGetQueueCheckpointDataNV + VkQueue queue + uint32_t* pCheckpointDataCount + VkCheckpointDataNV* pCheckpointData + + + void vkCmdBindTransformFeedbackBuffersEXT + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + const VkDeviceSize* pSizes + + + void vkCmdBeginTransformFeedbackEXT + VkCommandBuffer commandBuffer + uint32_t firstCounterBuffer + uint32_t counterBufferCount + const VkBuffer* pCounterBuffers + const VkDeviceSize* pCounterBufferOffsets + + + void vkCmdEndTransformFeedbackEXT + VkCommandBuffer commandBuffer + uint32_t firstCounterBuffer + uint32_t counterBufferCount + const VkBuffer* pCounterBuffers + const VkDeviceSize* pCounterBufferOffsets + + + void vkCmdBeginQueryIndexedEXT + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + VkQueryControlFlags flags + uint32_t index + + + void vkCmdEndQueryIndexedEXT + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + uint32_t index + + + void vkCmdDrawIndirectByteCountEXT + VkCommandBuffer commandBuffer + uint32_t instanceCount + uint32_t firstInstance + VkBuffer counterBuffer + VkDeviceSize counterBufferOffset + uint32_t counterOffset + uint32_t vertexStride + + + void vkCmdSetExclusiveScissorNV + VkCommandBuffer commandBuffer + uint32_t firstExclusiveScissor + uint32_t exclusiveScissorCount + const VkRect2D* pExclusiveScissors + + + void vkCmdSetExclusiveScissorEnableNV + VkCommandBuffer commandBuffer + uint32_t firstExclusiveScissor + uint32_t exclusiveScissorCount + const VkBool32* pExclusiveScissorEnables + + + void vkCmdBindShadingRateImageNV + VkCommandBuffer commandBuffer + VkImageView imageView + VkImageLayout imageLayout + + + void vkCmdSetViewportShadingRatePaletteNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkShadingRatePaletteNV* pShadingRatePalettes + + + void vkCmdSetCoarseSampleOrderNV + VkCommandBuffer commandBuffer + VkCoarseSampleOrderTypeNV sampleOrderType + uint32_t customSampleOrderCount + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders + + + void vkCmdDrawMeshTasksNV + VkCommandBuffer commandBuffer + uint32_t taskCount + uint32_t firstTask + + + void vkCmdDrawMeshTasksIndirectNV + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawMeshTasksIndirectCountNV + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + void vkCmdDrawMeshTasksEXT + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDrawMeshTasksIndirectEXT + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawMeshTasksIndirectCountEXT + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + VkResult vkCompileDeferredNV + VkDevice device + VkPipeline pipeline + uint32_t shader + + + VkResult vkCreateAccelerationStructureNV + VkDevice device + const VkAccelerationStructureCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkAccelerationStructureNV* pAccelerationStructure + + + void vkCmdBindInvocationMaskHUAWEI + VkCommandBuffer commandBuffer + VkImageView imageView + VkImageLayout imageLayout + + + void vkDestroyAccelerationStructureKHR + VkDevice device + VkAccelerationStructureKHR accelerationStructure + const VkAllocationCallbacks* pAllocator + + + void vkDestroyAccelerationStructureNV + VkDevice device + VkAccelerationStructureNV accelerationStructure + const VkAllocationCallbacks* pAllocator + + + void vkGetAccelerationStructureMemoryRequirementsNV + VkDevice device + const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo + VkMemoryRequirements2KHR* pMemoryRequirements + + + VkResult vkBindAccelerationStructureMemoryNV + VkDevice device + uint32_t bindInfoCount + const VkBindAccelerationStructureMemoryInfoNV* pBindInfos + + + void vkCmdCopyAccelerationStructureNV + VkCommandBuffer commandBuffer + VkAccelerationStructureNV dst + VkAccelerationStructureNV src + VkCopyAccelerationStructureModeKHR mode + + + void vkCmdCopyAccelerationStructureKHR + VkCommandBuffer commandBuffer + const VkCopyAccelerationStructureInfoKHR* pInfo + + + VkResult vkCopyAccelerationStructureKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyAccelerationStructureInfoKHR* pInfo + + + void vkCmdCopyAccelerationStructureToMemoryKHR + VkCommandBuffer commandBuffer + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo + + + VkResult vkCopyAccelerationStructureToMemoryKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo + + + void vkCmdCopyMemoryToAccelerationStructureKHR + VkCommandBuffer commandBuffer + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo + + + VkResult vkCopyMemoryToAccelerationStructureKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo + + + void vkCmdWriteAccelerationStructuresPropertiesKHR + VkCommandBuffer commandBuffer + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + void vkCmdWriteAccelerationStructuresPropertiesNV + VkCommandBuffer commandBuffer + uint32_t accelerationStructureCount + const VkAccelerationStructureNV* pAccelerationStructures + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + void vkCmdBuildAccelerationStructureNV + VkCommandBuffer commandBuffer + const VkAccelerationStructureInfoNV* pInfo + VkBuffer instanceData + VkDeviceSize instanceOffset + VkBool32 update + VkAccelerationStructureNV dst + VkAccelerationStructureNV src + VkBuffer scratch + VkDeviceSize scratchOffset + + + VkResult vkWriteAccelerationStructuresPropertiesKHR + VkDevice device + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + VkQueryType queryType + size_t dataSize + void* pData + size_t stride + + + void vkCmdTraceRaysKHR + VkCommandBuffer commandBuffer + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable + uint32_t width + uint32_t height + uint32_t depth + + + void vkCmdTraceRaysNV + VkCommandBuffer commandBuffer + VkBuffer raygenShaderBindingTableBuffer + VkDeviceSize raygenShaderBindingOffset + VkBuffer missShaderBindingTableBuffer + VkDeviceSize missShaderBindingOffset + VkDeviceSize missShaderBindingStride + VkBuffer hitShaderBindingTableBuffer + VkDeviceSize hitShaderBindingOffset + VkDeviceSize hitShaderBindingStride + VkBuffer callableShaderBindingTableBuffer + VkDeviceSize callableShaderBindingOffset + VkDeviceSize callableShaderBindingStride + uint32_t width + uint32_t height + uint32_t depth + + + VkResult vkGetRayTracingShaderGroupHandlesKHR + VkDevice device + VkPipeline pipeline + uint32_t firstGroup + uint32_t groupCount + size_t dataSize + void* pData + + + + VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR + VkDevice device + VkPipeline pipeline + uint32_t firstGroup + uint32_t groupCount + size_t dataSize + void* pData + + + VkResult vkGetAccelerationStructureHandleNV + VkDevice device + VkAccelerationStructureNV accelerationStructure + size_t dataSize + void* pData + + + VkResult vkCreateRayTracingPipelinesNV + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoNV* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesNV + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoNV* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkCooperativeMatrixPropertiesNV* pProperties + + + void vkCmdTraceRaysIndirectKHR + VkCommandBuffer commandBuffer + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable + VkDeviceAddress indirectDeviceAddress + + + void vkCmdTraceRaysIndirect2KHR + VkCommandBuffer commandBuffer + VkDeviceAddress indirectDeviceAddress + + + void vkGetDeviceAccelerationStructureCompatibilityKHR + VkDevice device + const VkAccelerationStructureVersionInfoKHR* pVersionInfo + VkAccelerationStructureCompatibilityKHR* pCompatibility + + + VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR + VkDevice device + VkPipeline pipeline + uint32_t group + VkShaderGroupShaderKHR groupShader + + + void vkCmdSetRayTracingPipelineStackSizeKHR + VkCommandBuffer commandBuffer + uint32_t pipelineStackSize + + + uint32_t vkGetImageViewHandleNVX + VkDevice device + const VkImageViewHandleInfoNVX* pInfo + + + VkResult vkGetImageViewAddressNVX + VkDevice device + VkImageView imageView + VkImageViewAddressPropertiesNVX* pProperties + + + VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + uint32_t* pPresentModeCount + VkPresentModeKHR* pPresentModes + + + VkResult vkGetDeviceGroupSurfacePresentModes2EXT + VkDevice device + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + VkDeviceGroupPresentModeFlagsKHR* pModes + + + VkResult vkAcquireFullScreenExclusiveModeEXT + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkReleaseFullScreenExclusiveModeEXT + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + uint32_t* pCounterCount + VkPerformanceCounterKHR* pCounters + VkPerformanceCounterDescriptionKHR* pCounterDescriptions + + + void vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR + VkPhysicalDevice physicalDevice + const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo + uint32_t* pNumPasses + + + VkResult vkAcquireProfilingLockKHR + VkDevice device + const VkAcquireProfilingLockInfoKHR* pInfo + + + void vkReleaseProfilingLockKHR + VkDevice device + + + VkResult vkGetImageDrmFormatModifierPropertiesEXT + VkDevice device + VkImage image + VkImageDrmFormatModifierPropertiesEXT* pProperties + + + uint64_t vkGetBufferOpaqueCaptureAddress + VkDevice device + const VkBufferDeviceAddressInfo* pInfo + + + + VkDeviceAddress vkGetBufferDeviceAddress + VkDevice device + const VkBufferDeviceAddressInfo* pInfo + + + + + VkResult vkCreateHeadlessSurfaceEXT + VkInstance instance + const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV + VkPhysicalDevice physicalDevice + uint32_t* pCombinationCount + VkFramebufferMixedSamplesCombinationNV* pCombinations + + + VkResult vkInitializePerformanceApiINTEL + VkDevice device + const VkInitializePerformanceApiInfoINTEL* pInitializeInfo + + + void vkUninitializePerformanceApiINTEL + VkDevice device + + + VkResult vkCmdSetPerformanceMarkerINTEL + VkCommandBuffer commandBuffer + const VkPerformanceMarkerInfoINTEL* pMarkerInfo + + + VkResult vkCmdSetPerformanceStreamMarkerINTEL + VkCommandBuffer commandBuffer + const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo + + + VkResult vkCmdSetPerformanceOverrideINTEL + VkCommandBuffer commandBuffer + const VkPerformanceOverrideInfoINTEL* pOverrideInfo + + + VkResult vkAcquirePerformanceConfigurationINTEL + VkDevice device + const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo + VkPerformanceConfigurationINTEL* pConfiguration + + + VkResult vkReleasePerformanceConfigurationINTEL + VkDevice device + VkPerformanceConfigurationINTEL configuration + + + VkResult vkQueueSetPerformanceConfigurationINTEL + VkQueue queue + VkPerformanceConfigurationINTEL configuration + + + VkResult vkGetPerformanceParameterINTEL + VkDevice device + VkPerformanceParameterTypeINTEL parameter + VkPerformanceValueINTEL* pValue + + + uint64_t vkGetDeviceMemoryOpaqueCaptureAddress + VkDevice device + const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo + + + + VkResult vkGetPipelineExecutablePropertiesKHR + VkDevice device + const VkPipelineInfoKHR* pPipelineInfo + uint32_t* pExecutableCount + VkPipelineExecutablePropertiesKHR* pProperties + + + VkResult vkGetPipelineExecutableStatisticsKHR + VkDevice device + const VkPipelineExecutableInfoKHR* pExecutableInfo + uint32_t* pStatisticCount + VkPipelineExecutableStatisticKHR* pStatistics + + + VkResult vkGetPipelineExecutableInternalRepresentationsKHR + VkDevice device + const VkPipelineExecutableInfoKHR* pExecutableInfo + uint32_t* pInternalRepresentationCount + VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations + + + void vkCmdSetLineStippleKHR + VkCommandBuffer commandBuffer + uint32_t lineStippleFactor + uint16_t lineStipplePattern + + + + VkResult vkGetFaultData + VkDevice device + VkFaultQueryBehavior faultQueryBehavior + VkBool32* pUnrecordedFaults + uint32_t* pFaultCount + VkFaultData* pFaults + + + VkResult vkGetPhysicalDeviceToolProperties + VkPhysicalDevice physicalDevice + uint32_t* pToolCount + VkPhysicalDeviceToolProperties* pToolProperties + + + + VkResult vkCreateAccelerationStructureKHR + VkDevice device + const VkAccelerationStructureCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkAccelerationStructureKHR* pAccelerationStructure + + + void vkCmdBuildAccelerationStructuresKHR + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos + + + void vkCmdBuildAccelerationStructuresIndirectKHR + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkDeviceAddress* pIndirectDeviceAddresses + const uint32_t* pIndirectStrides + const uint32_t* const* ppMaxPrimitiveCounts + + + VkResult vkBuildAccelerationStructuresKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos + + + VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR + VkDevice device + const VkAccelerationStructureDeviceAddressInfoKHR* pInfo + + + VkResult vkCreateDeferredOperationKHR + VkDevice device + const VkAllocationCallbacks* pAllocator + VkDeferredOperationKHR* pDeferredOperation + + + void vkDestroyDeferredOperationKHR + VkDevice device + VkDeferredOperationKHR operation + const VkAllocationCallbacks* pAllocator + + + uint32_t vkGetDeferredOperationMaxConcurrencyKHR + VkDevice device + VkDeferredOperationKHR operation + + + VkResult vkGetDeferredOperationResultKHR + VkDevice device + VkDeferredOperationKHR operation + + + VkResult vkDeferredOperationJoinKHR + VkDevice device + VkDeferredOperationKHR operation + + + void vkGetPipelineIndirectMemoryRequirementsNV + VkDevice device + const VkComputePipelineCreateInfo* pCreateInfo + VkMemoryRequirements2* pMemoryRequirements + + + VkDeviceAddress vkGetPipelineIndirectDeviceAddressNV + VkDevice device + const VkPipelineIndirectDeviceAddressInfoNV* pInfo + + + void vkCmdSetCullMode + VkCommandBuffer commandBuffer + VkCullModeFlags cullMode + + + + void vkCmdSetFrontFace + VkCommandBuffer commandBuffer + VkFrontFace frontFace + + + + void vkCmdSetPrimitiveTopology + VkCommandBuffer commandBuffer + VkPrimitiveTopology primitiveTopology + + + + void vkCmdSetViewportWithCount + VkCommandBuffer commandBuffer + uint32_t viewportCount + const VkViewport* pViewports + + + + void vkCmdSetScissorWithCount + VkCommandBuffer commandBuffer + uint32_t scissorCount + const VkRect2D* pScissors + + + + void vkCmdBindIndexBuffer2KHR + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize size + VkIndexType indexType + + + void vkCmdBindVertexBuffers2 + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + const VkDeviceSize* pSizes + const VkDeviceSize* pStrides + + + + void vkCmdSetDepthTestEnable + VkCommandBuffer commandBuffer + VkBool32 depthTestEnable + + + + void vkCmdSetDepthWriteEnable + VkCommandBuffer commandBuffer + VkBool32 depthWriteEnable + + + + void vkCmdSetDepthCompareOp + VkCommandBuffer commandBuffer + VkCompareOp depthCompareOp + + + + void vkCmdSetDepthBoundsTestEnable + VkCommandBuffer commandBuffer + VkBool32 depthBoundsTestEnable + + + + void vkCmdSetStencilTestEnable + VkCommandBuffer commandBuffer + VkBool32 stencilTestEnable + + + + void vkCmdSetStencilOp + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + VkStencilOp failOp + VkStencilOp passOp + VkStencilOp depthFailOp + VkCompareOp compareOp + + + + void vkCmdSetPatchControlPointsEXT + VkCommandBuffer commandBuffer + uint32_t patchControlPoints + + + void vkCmdSetRasterizerDiscardEnable + VkCommandBuffer commandBuffer + VkBool32 rasterizerDiscardEnable + + + + void vkCmdSetDepthBiasEnable + VkCommandBuffer commandBuffer + VkBool32 depthBiasEnable + + + + void vkCmdSetLogicOpEXT + VkCommandBuffer commandBuffer + VkLogicOp logicOp + + + void vkCmdSetPrimitiveRestartEnable + VkCommandBuffer commandBuffer + VkBool32 primitiveRestartEnable + + + + void vkCmdSetTessellationDomainOriginEXT + VkCommandBuffer commandBuffer + VkTessellationDomainOrigin domainOrigin + + + void vkCmdSetDepthClampEnableEXT + VkCommandBuffer commandBuffer + VkBool32 depthClampEnable + + + void vkCmdSetPolygonModeEXT + VkCommandBuffer commandBuffer + VkPolygonMode polygonMode + + + void vkCmdSetRasterizationSamplesEXT + VkCommandBuffer commandBuffer + VkSampleCountFlagBits rasterizationSamples + + + void vkCmdSetSampleMaskEXT + VkCommandBuffer commandBuffer + VkSampleCountFlagBits samples + const VkSampleMask* pSampleMask + + + void vkCmdSetAlphaToCoverageEnableEXT + VkCommandBuffer commandBuffer + VkBool32 alphaToCoverageEnable + + + void vkCmdSetAlphaToOneEnableEXT + VkCommandBuffer commandBuffer + VkBool32 alphaToOneEnable + + + void vkCmdSetLogicOpEnableEXT + VkCommandBuffer commandBuffer + VkBool32 logicOpEnable + + + void vkCmdSetColorBlendEnableEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkBool32* pColorBlendEnables + + + void vkCmdSetColorBlendEquationEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorBlendEquationEXT* pColorBlendEquations + + + void vkCmdSetColorWriteMaskEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorComponentFlags* pColorWriteMasks + + + void vkCmdSetRasterizationStreamEXT + VkCommandBuffer commandBuffer + uint32_t rasterizationStream + + + void vkCmdSetConservativeRasterizationModeEXT + VkCommandBuffer commandBuffer + VkConservativeRasterizationModeEXT conservativeRasterizationMode + + + void vkCmdSetExtraPrimitiveOverestimationSizeEXT + VkCommandBuffer commandBuffer + float extraPrimitiveOverestimationSize + + + void vkCmdSetDepthClipEnableEXT + VkCommandBuffer commandBuffer + VkBool32 depthClipEnable + + + void vkCmdSetSampleLocationsEnableEXT + VkCommandBuffer commandBuffer + VkBool32 sampleLocationsEnable + + + void vkCmdSetColorBlendAdvancedEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorBlendAdvancedEXT* pColorBlendAdvanced + + + void vkCmdSetProvokingVertexModeEXT + VkCommandBuffer commandBuffer + VkProvokingVertexModeEXT provokingVertexMode + + + void vkCmdSetLineRasterizationModeEXT + VkCommandBuffer commandBuffer + VkLineRasterizationModeEXT lineRasterizationMode + + + void vkCmdSetLineStippleEnableEXT + VkCommandBuffer commandBuffer + VkBool32 stippledLineEnable + + + void vkCmdSetDepthClipNegativeOneToOneEXT + VkCommandBuffer commandBuffer + VkBool32 negativeOneToOne + + + void vkCmdSetViewportWScalingEnableNV + VkCommandBuffer commandBuffer + VkBool32 viewportWScalingEnable + + + void vkCmdSetViewportSwizzleNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewportSwizzleNV* pViewportSwizzles + + + void vkCmdSetCoverageToColorEnableNV + VkCommandBuffer commandBuffer + VkBool32 coverageToColorEnable + + + void vkCmdSetCoverageToColorLocationNV + VkCommandBuffer commandBuffer + uint32_t coverageToColorLocation + + + void vkCmdSetCoverageModulationModeNV + VkCommandBuffer commandBuffer + VkCoverageModulationModeNV coverageModulationMode + + + void vkCmdSetCoverageModulationTableEnableNV + VkCommandBuffer commandBuffer + VkBool32 coverageModulationTableEnable + + + void vkCmdSetCoverageModulationTableNV + VkCommandBuffer commandBuffer + uint32_t coverageModulationTableCount + const float* pCoverageModulationTable + + + void vkCmdSetShadingRateImageEnableNV + VkCommandBuffer commandBuffer + VkBool32 shadingRateImageEnable + + + void vkCmdSetCoverageReductionModeNV + VkCommandBuffer commandBuffer + VkCoverageReductionModeNV coverageReductionMode + + + void vkCmdSetRepresentativeFragmentTestEnableNV + VkCommandBuffer commandBuffer + VkBool32 representativeFragmentTestEnable + + + VkResult vkCreatePrivateDataSlot + VkDevice device + const VkPrivateDataSlotCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPrivateDataSlot* pPrivateDataSlot + + + + void vkDestroyPrivateDataSlot + VkDevice device + VkPrivateDataSlot privateDataSlot + const VkAllocationCallbacks* pAllocator + + + + VkResult vkSetPrivateData + VkDevice device + VkObjectType objectType + uint64_t objectHandle + VkPrivateDataSlot privateDataSlot + uint64_t data + + + + void vkGetPrivateData + VkDevice device + VkObjectType objectType + uint64_t objectHandle + VkPrivateDataSlot privateDataSlot + uint64_t* pData + + + + void vkCmdCopyBuffer2 + VkCommandBuffer commandBuffer + const VkCopyBufferInfo2* pCopyBufferInfo + + + + void vkCmdCopyImage2 + VkCommandBuffer commandBuffer + const VkCopyImageInfo2* pCopyImageInfo + + + + void vkCmdBlitImage2 + VkCommandBuffer commandBuffer + const VkBlitImageInfo2* pBlitImageInfo + + + + void vkCmdCopyBufferToImage2 + VkCommandBuffer commandBuffer + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo + + + + void vkCmdCopyImageToBuffer2 + VkCommandBuffer commandBuffer + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo + + + + void vkCmdResolveImage2 + VkCommandBuffer commandBuffer + const VkResolveImageInfo2* pResolveImageInfo + + + + void vkCmdRefreshObjectsKHR + VkCommandBuffer commandBuffer + const VkRefreshObjectListKHR* pRefreshObjects + + + VkResult vkGetPhysicalDeviceRefreshableObjectTypesKHR + VkPhysicalDevice physicalDevice + uint32_t* pRefreshableObjectTypeCount + VkObjectType* pRefreshableObjectTypes + + + void vkCmdSetFragmentShadingRateKHR + VkCommandBuffer commandBuffer + const VkExtent2D* pFragmentSize + const VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR + VkPhysicalDevice physicalDevice + uint32_t* pFragmentShadingRateCount + VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates + + + void vkCmdSetFragmentShadingRateEnumNV + VkCommandBuffer commandBuffer + VkFragmentShadingRateNV shadingRate + const VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + void vkGetAccelerationStructureBuildSizesKHR + VkDevice device + VkAccelerationStructureBuildTypeKHR buildType + const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo + const uint32_t* pMaxPrimitiveCounts + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo + + + void vkCmdSetVertexInputEXT + VkCommandBuffer commandBuffer + uint32_t vertexBindingDescriptionCount + const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions + uint32_t vertexAttributeDescriptionCount + const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions + + + void vkCmdSetColorWriteEnableEXT + VkCommandBuffer commandBuffer + uint32_t attachmentCount + const VkBool32* pColorWriteEnables + + + void vkCmdSetEvent2 + VkCommandBuffer commandBuffer + VkEvent event + const VkDependencyInfo* pDependencyInfo + + + + void vkCmdResetEvent2 + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags2 stageMask + + + + void vkCmdWaitEvents2 + VkCommandBuffer commandBuffer + uint32_t eventCount + const VkEvent* pEvents + const VkDependencyInfo* pDependencyInfos + + + + void vkCmdPipelineBarrier2 + VkCommandBuffer commandBuffer + const VkDependencyInfo* pDependencyInfo + + + + VkResult vkQueueSubmit2 + VkQueue queue + uint32_t submitCount + const VkSubmitInfo2* pSubmits + VkFence fence + + + + void vkCmdWriteTimestamp2 + VkCommandBuffer commandBuffer + VkPipelineStageFlags2 stage + VkQueryPool queryPool + uint32_t query + + + + void vkCmdWriteBufferMarker2AMD + VkCommandBuffer commandBuffer + VkPipelineStageFlags2 stage + VkBuffer dstBuffer + VkDeviceSize dstOffset + uint32_t marker + + + void vkGetQueueCheckpointData2NV + VkQueue queue + uint32_t* pCheckpointDataCount + VkCheckpointData2NV* pCheckpointData + + + VkResult vkCopyMemoryToImageEXT + VkDevice device + const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo + + + VkResult vkCopyImageToMemoryEXT + VkDevice device + const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo + + + VkResult vkCopyImageToImageEXT + VkDevice device + const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo + + + VkResult vkTransitionImageLayoutEXT + VkDevice device + uint32_t transitionCount + const VkHostImageLayoutTransitionInfoEXT* pTransitions + + + void vkGetCommandPoolMemoryConsumption + VkDevice device + VkCommandPool commandPool + VkCommandBuffer commandBuffer + VkCommandPoolMemoryConsumption* pConsumption + + + VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR + VkPhysicalDevice physicalDevice + const VkVideoProfileInfoKHR* pVideoProfile + VkVideoCapabilitiesKHR* pCapabilities + + + VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo + uint32_t* pVideoFormatPropertyCount + VkVideoFormatPropertiesKHR* pVideoFormatProperties + + + VkResult vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo + VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties + + + VkResult vkCreateVideoSessionKHR + VkDevice device + const VkVideoSessionCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkVideoSessionKHR* pVideoSession + + + void vkDestroyVideoSessionKHR + VkDevice device + VkVideoSessionKHR videoSession + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateVideoSessionParametersKHR + VkDevice device + const VkVideoSessionParametersCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkVideoSessionParametersKHR* pVideoSessionParameters + + + VkResult vkUpdateVideoSessionParametersKHR + VkDevice device + VkVideoSessionParametersKHR videoSessionParameters + const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo + + + VkResult vkGetEncodedVideoSessionParametersKHR + VkDevice device + const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo + VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo + size_t* pDataSize + void* pData + + + void vkDestroyVideoSessionParametersKHR + VkDevice device + VkVideoSessionParametersKHR videoSessionParameters + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetVideoSessionMemoryRequirementsKHR + VkDevice device + VkVideoSessionKHR videoSession + uint32_t* pMemoryRequirementsCount + VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements + + + VkResult vkBindVideoSessionMemoryKHR + VkDevice device + VkVideoSessionKHR videoSession + uint32_t bindSessionMemoryInfoCount + const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos + + + void vkCmdDecodeVideoKHR + VkCommandBuffer commandBuffer + const VkVideoDecodeInfoKHR* pDecodeInfo + + + void vkCmdBeginVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoBeginCodingInfoKHR* pBeginInfo + + + void vkCmdControlVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoCodingControlInfoKHR* pCodingControlInfo + + + void vkCmdEndVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoEndCodingInfoKHR* pEndCodingInfo + + + void vkCmdEncodeVideoKHR + VkCommandBuffer commandBuffer + const VkVideoEncodeInfoKHR* pEncodeInfo + + + void vkCmdDecompressMemoryNV + VkCommandBuffer commandBuffer + uint32_t decompressRegionCount + const VkDecompressMemoryRegionNV* pDecompressMemoryRegions + + + void vkCmdDecompressMemoryIndirectCountNV + VkCommandBuffer commandBuffer + VkDeviceAddress indirectCommandsAddress + VkDeviceAddress indirectCommandsCountAddress + uint32_t stride + + + VkResult vkCreateCuModuleNVX + VkDevice device + const VkCuModuleCreateInfoNVX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCuModuleNVX* pModule + + + VkResult vkCreateCuFunctionNVX + VkDevice device + const VkCuFunctionCreateInfoNVX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCuFunctionNVX* pFunction + + + void vkDestroyCuModuleNVX + VkDevice device + VkCuModuleNVX module + const VkAllocationCallbacks* pAllocator + + + void vkDestroyCuFunctionNVX + VkDevice device + VkCuFunctionNVX function + const VkAllocationCallbacks* pAllocator + + + void vkCmdCuLaunchKernelNVX + VkCommandBuffer commandBuffer + const VkCuLaunchInfoNVX* pLaunchInfo + + + void vkGetDescriptorSetLayoutSizeEXT + VkDevice device + VkDescriptorSetLayout layout + VkDeviceSize* pLayoutSizeInBytes + + + void vkGetDescriptorSetLayoutBindingOffsetEXT + VkDevice device + VkDescriptorSetLayout layout + uint32_t binding + VkDeviceSize* pOffset + + + void vkGetDescriptorEXT + VkDevice device + const VkDescriptorGetInfoEXT* pDescriptorInfo + size_t dataSize + void* pDescriptor + + + void vkCmdBindDescriptorBuffersEXT + VkCommandBuffer commandBuffer + uint32_t bufferCount + const VkDescriptorBufferBindingInfoEXT* pBindingInfos + + + void vkCmdSetDescriptorBufferOffsetsEXT + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t firstSet + uint32_t setCount + const uint32_t* pBufferIndices + const VkDeviceSize* pOffsets + + + void vkCmdBindDescriptorBufferEmbeddedSamplersEXT + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t set + + + VkResult vkGetBufferOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkBufferCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetImageOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkImageCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetImageViewOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkImageViewCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetSamplerOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkSamplerCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + void vkSetDeviceMemoryPriorityEXT + VkDevice device + VkDeviceMemory memory + float priority + + + VkResult vkAcquireDrmDisplayEXT + VkPhysicalDevice physicalDevice + int32_t drmFd + VkDisplayKHR display + + + VkResult vkGetDrmDisplayEXT + VkPhysicalDevice physicalDevice + int32_t drmFd + uint32_t connectorId + VkDisplayKHR* display + + + VkResult vkWaitForPresentKHR + VkDevice device + VkSwapchainKHR swapchain + uint64_t presentId + uint64_t timeout + + + VkResult vkCreateBufferCollectionFUCHSIA + VkDevice device + const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBufferCollectionFUCHSIA* pCollection + + + VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo + + + VkResult vkSetBufferCollectionImageConstraintsFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo + + + void vkDestroyBufferCollectionFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetBufferCollectionPropertiesFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + VkBufferCollectionPropertiesFUCHSIA* pProperties + + + VkResult vkCreateCudaModuleNV + VkDevice device + const VkCudaModuleCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCudaModuleNV* pModule + + + VkResult vkGetCudaModuleCacheNV + VkDevice device + VkCudaModuleNV module + size_t* pCacheSize + void* pCacheData + + + VkResult vkCreateCudaFunctionNV + VkDevice device + const VkCudaFunctionCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCudaFunctionNV* pFunction + + + void vkDestroyCudaModuleNV + VkDevice device + VkCudaModuleNV module + const VkAllocationCallbacks* pAllocator + + + void vkDestroyCudaFunctionNV + VkDevice device + VkCudaFunctionNV function + const VkAllocationCallbacks* pAllocator + + + void vkCmdCudaLaunchKernelNV + VkCommandBuffer commandBuffer + const VkCudaLaunchInfoNV* pLaunchInfo + + + void vkCmdBeginRendering + VkCommandBuffer commandBuffer + const VkRenderingInfo* pRenderingInfo + + + + void vkCmdEndRendering + VkCommandBuffer commandBuffer + + + + + void vkGetDescriptorSetLayoutHostMappingInfoVALVE + VkDevice device + const VkDescriptorSetBindingReferenceVALVE* pBindingReference + VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping + + + void vkGetDescriptorSetHostMappingVALVE + VkDevice device + VkDescriptorSet descriptorSet + void** ppData + + + VkResult vkCreateMicromapEXT + VkDevice device + const VkMicromapCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkMicromapEXT* pMicromap + + + void vkCmdBuildMicromapsEXT + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkMicromapBuildInfoEXT* pInfos + + + VkResult vkBuildMicromapsEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + uint32_t infoCount + const VkMicromapBuildInfoEXT* pInfos + + + void vkDestroyMicromapEXT + VkDevice device + VkMicromapEXT micromap + const VkAllocationCallbacks* pAllocator + + + void vkCmdCopyMicromapEXT + VkCommandBuffer commandBuffer + const VkCopyMicromapInfoEXT* pInfo + + + VkResult vkCopyMicromapEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMicromapInfoEXT* pInfo + + + void vkCmdCopyMicromapToMemoryEXT + VkCommandBuffer commandBuffer + const VkCopyMicromapToMemoryInfoEXT* pInfo + + + VkResult vkCopyMicromapToMemoryEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMicromapToMemoryInfoEXT* pInfo + + + void vkCmdCopyMemoryToMicromapEXT + VkCommandBuffer commandBuffer + const VkCopyMemoryToMicromapInfoEXT* pInfo + + + VkResult vkCopyMemoryToMicromapEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMemoryToMicromapInfoEXT* pInfo + + + void vkCmdWriteMicromapsPropertiesEXT + VkCommandBuffer commandBuffer + uint32_t micromapCount + const VkMicromapEXT* pMicromaps + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + VkResult vkWriteMicromapsPropertiesEXT + VkDevice device + uint32_t micromapCount + const VkMicromapEXT* pMicromaps + VkQueryType queryType + size_t dataSize + void* pData + size_t stride + + + void vkGetDeviceMicromapCompatibilityEXT + VkDevice device + const VkMicromapVersionInfoEXT* pVersionInfo + VkAccelerationStructureCompatibilityKHR* pCompatibility + + + void vkGetMicromapBuildSizesEXT + VkDevice device + VkAccelerationStructureBuildTypeKHR buildType + const VkMicromapBuildInfoEXT* pBuildInfo + VkMicromapBuildSizesInfoEXT* pSizeInfo + + + void vkGetShaderModuleIdentifierEXT + VkDevice device + VkShaderModule shaderModule + VkShaderModuleIdentifierEXT* pIdentifier + + + void vkGetShaderModuleCreateInfoIdentifierEXT + VkDevice device + const VkShaderModuleCreateInfo* pCreateInfo + VkShaderModuleIdentifierEXT* pIdentifier + + + void vkGetImageSubresourceLayout2KHR + VkDevice device + VkImage image + const VkImageSubresource2KHR* pSubresource + VkSubresourceLayout2KHR* pLayout + + + + VkResult vkGetPipelinePropertiesEXT + VkDevice device + const VkPipelineInfoEXT* pPipelineInfo + VkBaseOutStructure* pPipelineProperties + + + void vkExportMetalObjectsEXT + VkDevice device + VkExportMetalObjectsInfoEXT* pMetalObjectsInfo + + + VkResult vkGetFramebufferTilePropertiesQCOM + VkDevice device + VkFramebuffer framebuffer + uint32_t* pPropertiesCount + VkTilePropertiesQCOM* pProperties + + + VkResult vkGetDynamicRenderingTilePropertiesQCOM + VkDevice device + const VkRenderingInfo* pRenderingInfo + VkTilePropertiesQCOM* pProperties + + + VkResult vkGetPhysicalDeviceOpticalFlowImageFormatsNV + VkPhysicalDevice physicalDevice + const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo + uint32_t* pFormatCount + VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties + + + VkResult vkCreateOpticalFlowSessionNV + VkDevice device + const VkOpticalFlowSessionCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkOpticalFlowSessionNV* pSession + + + void vkDestroyOpticalFlowSessionNV + VkDevice device + VkOpticalFlowSessionNV session + const VkAllocationCallbacks* pAllocator + + + VkResult vkBindOpticalFlowSessionImageNV + VkDevice device + VkOpticalFlowSessionNV session + VkOpticalFlowSessionBindingPointNV bindingPoint + VkImageView view + VkImageLayout layout + + + void vkCmdOpticalFlowExecuteNV + VkCommandBuffer commandBuffer + VkOpticalFlowSessionNV session + const VkOpticalFlowExecuteInfoNV* pExecuteInfo + + + VkResult vkGetDeviceFaultInfoEXT + VkDevice device + VkDeviceFaultCountsEXT* pFaultCounts + VkDeviceFaultInfoEXT* pFaultInfo + + + void vkCmdSetDepthBias2EXT + VkCommandBuffer commandBuffer + const VkDepthBiasInfoEXT* pDepthBiasInfo + + + VkResult vkReleaseSwapchainImagesEXT + VkDevice device + const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo + + + void vkGetDeviceImageSubresourceLayoutKHR + VkDevice device + const VkDeviceImageSubresourceInfoKHR* pInfo + VkSubresourceLayout2KHR* pLayout + + + VkResult vkMapMemory2KHR + VkDevice device + const VkMemoryMapInfoKHR* pMemoryMapInfo + void** ppData + + + VkResult vkUnmapMemory2KHR + VkDevice device + const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo + + + VkResult vkCreateShadersEXT + VkDevice device + uint32_t createInfoCount + const VkShaderCreateInfoEXT* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkShaderEXT* pShaders + + + void vkDestroyShaderEXT + VkDevice device + VkShaderEXT shader + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetShaderBinaryDataEXT + VkDevice device + VkShaderEXT shader + size_t* pDataSize + void* pData + + + void vkCmdBindShadersEXT + VkCommandBuffer commandBuffer + uint32_t stageCount + const VkShaderStageFlagBits* pStages + const VkShaderEXT* pShaders + + + VkResult vkGetScreenBufferPropertiesQNX + VkDevice device + const struct _screen_buffer* buffer + VkScreenBufferPropertiesQNX* pProperties + + + VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkCooperativeMatrixPropertiesKHR* pProperties + + + VkResult vkGetExecutionGraphPipelineScratchSizeAMDX + VkDevice device + VkPipeline executionGraph + VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo + + + VkResult vkGetExecutionGraphPipelineNodeIndexAMDX + VkDevice device + VkPipeline executionGraph + const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo + uint32_t* pNodeIndex + + + VkResult vkCreateExecutionGraphPipelinesAMDX + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + void vkCmdInitializeGraphScratchMemoryAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + + + void vkCmdDispatchGraphAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + const VkDispatchGraphCountInfoAMDX* pCountInfo + + + void vkCmdDispatchGraphIndirectAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + const VkDispatchGraphCountInfoAMDX* pCountInfo + + + void vkCmdDispatchGraphIndirectCountAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + VkDeviceAddress countInfo + + + void vkCmdBindDescriptorSets2KHR + VkCommandBuffer commandBuffer + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo + + + void vkCmdPushConstants2KHR + VkCommandBuffer commandBuffer + const VkPushConstantsInfoKHR* pPushConstantsInfo + + + void vkCmdPushDescriptorSet2KHR + VkCommandBuffer commandBuffer + const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo + + + void vkCmdPushDescriptorSetWithTemplate2KHR + VkCommandBuffer commandBuffer + const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo + + + void vkCmdSetDescriptorBufferOffsets2EXT + VkCommandBuffer commandBuffer + const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo + + + void vkCmdBindDescriptorBufferEmbeddedSamplers2EXT + VkCommandBuffer commandBuffer + const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo + + + VkResult vkSetLatencySleepModeNV + VkDevice device + VkSwapchainKHR swapchain + const VkLatencySleepModeInfoNV* pSleepModeInfo + + + VkResult vkLatencySleepNV + VkDevice device + VkSwapchainKHR swapchain + const VkLatencySleepInfoNV* pSleepInfo + + + void vkSetLatencyMarkerNV + VkDevice device + VkSwapchainKHR swapchain + const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo + + + void vkGetLatencyTimingsNV + VkDevice device + VkSwapchainKHR swapchain + VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo + + + void vkQueueNotifyOutOfBandNV + VkQueue queue + const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo + + + void vkCmdSetRenderingAttachmentLocationsKHR + VkCommandBuffer commandBuffer + const VkRenderingAttachmentLocationInfoKHR* pLocationInfo + + + void vkCmdSetRenderingInputAttachmentIndicesKHR + VkCommandBuffer commandBuffer + const VkRenderingInputAttachmentIndexInfoKHR* pLocationInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + offset 1 reserved for the old VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX enum + offset 2 reserved for the old VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This duplicates definitions in VK_KHR_device_group below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VK_ANDROID_native_buffer is used between the Android Vulkan loader and drivers to implement the WSI extensions. It is not exposed to applications and uses types that are not part of Android's stable public API, so it is left disabled to keep it out of the standard Vulkan headers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This duplicates definitions in other extensions, below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enum offset=0 was mistakenly used for the 1.1 core enum + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES + (value=1000094000). Fortunately, no conflict resulted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This extension requires buffer_device_address functionality. + VK_EXT_buffer_device_address is also acceptable, but since it is deprecated the KHR version is preferred. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These enums are present only to inform downstream + consumers like KTX2. There is no actual Vulkan extension + corresponding to the enums. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT and + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT + were not promoted to Vulkan 1.3. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkPhysicalDevice4444FormatsFeaturesEXT and + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT + were not promoted to Vulkan 1.3. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NV internal use only + + + + + + + + + + + + + + + + + + + + + + + + + + NV internal use only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fragment shader stage is added by the VK_EXT_shader_tile_image extension + + + + + + + Fragment shader stage is added by the VK_EXT_shader_tile_image extension + + + + + + + + + + + + + + + + + + + TODO/Suggestion. Introduce 'synclist' (could be a different name) element + that specifies the list of stages, accesses, etc. This list can be used by + 'syncaccess' or 'syncstage' elements. For example, 'syncsupport' in addition to the + 'stage' attribute can support 'list' attribute to reference 'synclist'. + We can have the lists defined for ALL stages and it can be shared between MEMORY_READ + and MEMORY_WRITE accesses. Similarly, ALL shader stages list is often used. This proposal + is a way to fix duplication problem. When new stage is added multiple places needs to be + updated. It is potential source of bugs. The expectation such setup will produce more + robust system and also more simple structure to review and validate. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT + VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT + VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT + VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT + VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT + VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT + VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR + VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT + VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR + VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_TRANSFER_BIT + + + VK_PIPELINE_STAGE_2_HOST_BIT + + + VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI + + + VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV + + + VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR + + + VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR + + + VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR + + + VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR + + + VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR + + + VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV + + + diff --git a/dlls/winevulkan/vk_custom.xml b/dlls/winevulkan/vk_custom.xml new file mode 100644 index 00000000000..a9fd68548c4 --- /dev/null +++ b/dlls/winevulkan/vk_custom.xml @@ -0,0 +1,24 @@ + + + + + VkResult wine_vkAcquireKeyedMutex + VkDevice device + VkDeviceMemory memory + uint64_t key + uint32_t timeout_ms + + + VkResult wine_vkReleaseKeyedMutex + VkDevice device + VkDeviceMemory memory + uint64_t key + + + + + + + + + diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 2691624db66..c40309ee468 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -22,7 +22,25 @@ #endif #include "config.h" +#include #include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winnt.h" +#include "winioctl.h" +#include "wine/server.h" +#include "wine/list.h" #include "vulkan_private.h" #include "wine/vulkan_driver.h" @@ -31,6 +49,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); +static void set_memory_being_allocated(struct wine_instance *instance, struct wine_device_memory *memory) +{ + struct ntuser_thread_info *thread_info; + if (!instance->enable_wrapper_list) return; + thread_info = NtUserGetThreadInfo(); + thread_info->vulkan_data = (uintptr_t) memory; +} + +static uint64_t get_memory_being_allocated(uint64_t host_handle) +{ + struct ntuser_thread_info *thread_info; + struct wine_device_memory *memory; + + thread_info = NtUserGetThreadInfo(); + if (!thread_info->vulkan_data) return 0; + + memory = (struct wine_device_memory*) (uintptr_t) thread_info->vulkan_data; + memory->host_memory = host_handle; + + return (uintptr_t) memory; +} + +static int debug_level; static BOOL is_wow64(void) { @@ -108,6 +149,38 @@ static uint64_t wine_vk_get_wrapper(struct wine_instance *instance, uint64_t hos return result; } +static void signal_timeline_sem(struct wine_device *device, VkSemaphore sem, uint64_t *value) +{ + /* May be called from native thread. */ + struct VkSemaphoreSignalInfo info = { 0 }; + VkResult res; + + info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO; + info.semaphore = sem; + info.value = *value + 1; + __atomic_store_n(value, info.value, __ATOMIC_RELEASE); + if (device->phys_dev->api_version < VK_API_VERSION_1_2 || device->phys_dev->instance->api_version < VK_API_VERSION_1_2) + res = device->funcs.p_vkSignalSemaphoreKHR(device->host_device, &info); + else + res = device->funcs.p_vkSignalSemaphore(device->host_device, &info); + if (res != VK_SUCCESS) + fprintf(stderr, "err:winevulkan:signal_timeline_sem vkSignalSemaphore failed, res=%d.\n", res); +} + +static VkResult wait_semaphores(struct wine_device *device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) +{ + if (device->phys_dev->api_version < VK_API_VERSION_1_2 || device->phys_dev->instance->api_version < VK_API_VERSION_1_2) + return device->funcs.p_vkWaitSemaphoresKHR(device->host_device, wait_info, timeout); + return device->funcs.p_vkWaitSemaphores(device->host_device, wait_info, timeout); +} + +static VkResult get_semaphore_value(struct wine_device *device, VkSemaphore sem, uint64_t *value) +{ + if (device->phys_dev->api_version < VK_API_VERSION_1_2 || device->phys_dev->instance->api_version < VK_API_VERSION_1_2) + return device->funcs.p_vkGetSemaphoreCounterValueKHR(device->host_device, sem, value); + return device->funcs.p_vkGetSemaphoreCounterValue(device->host_device, sem, value); +} + static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT message_types, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, @@ -118,7 +191,6 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB struct wine_debug_utils_messenger *object; void *ret_ptr; ULONG ret_len; - VkBool32 result; unsigned int i; TRACE("%i, %u, %p, %p\n", severity, message_types, callback_data, user_data); @@ -150,6 +222,8 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB if (wine_vk_is_type_wrapped(callback_data->pObjects[i].objectType)) { object_name_infos[i].objectHandle = wine_vk_get_wrapper(object->instance, callback_data->pObjects[i].objectHandle); + if (!object_name_infos[i].objectHandle && object_name_infos[i].objectType == VK_OBJECT_TYPE_DEVICE_MEMORY) + object_name_infos[i].objectHandle = get_memory_being_allocated(callback_data->pObjects[i].objectHandle); if (!object_name_infos[i].objectHandle) { WARN("handle conversion failed 0x%s\n", wine_dbgstr_longlong(callback_data->pObjects[i].objectHandle)); @@ -166,12 +240,11 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB params.data.pObjects = object_name_infos; /* applications should always return VK_FALSE */ - result = KeUserModeCallback( NtUserCallVulkanDebugUtilsCallback, ¶ms, sizeof(params), - &ret_ptr, &ret_len ); + KeUserModeCallback( NtUserCallVulkanDebugUtilsCallback, ¶ms, sizeof(params), &ret_ptr, &ret_len ); free(object_name_infos); - - return result; + if (ret_len == sizeof(VkBool32)) return *(VkBool32 *)ret_ptr; + return VK_FALSE; } static VkBool32 debug_report_callback_conversion(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT object_type, @@ -207,8 +280,9 @@ static VkBool32 debug_report_callback_conversion(VkDebugReportFlagsEXT flags, Vk if (!params.object_handle) params.object_type = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT; - return KeUserModeCallback( NtUserCallVulkanDebugReportCallback, ¶ms, sizeof(params), - &ret_ptr, &ret_len ); + KeUserModeCallback( NtUserCallVulkanDebugReportCallback, ¶ms, sizeof(params), &ret_ptr, &ret_len ); + if (ret_len == sizeof(VkBool32)) return *(VkBool32 *)ret_ptr; + return VK_FALSE; } static void wine_vk_physical_device_free(struct wine_phys_dev *phys_dev) @@ -227,7 +301,8 @@ static struct wine_phys_dev *wine_vk_physical_device_alloc(struct wine_instance struct wine_phys_dev *object; uint32_t num_host_properties, num_properties = 0; VkExtensionProperties *host_properties = NULL; - BOOL have_external_memory_host = FALSE; + VkPhysicalDeviceProperties physdev_properties; + BOOL have_external_memory_host = FALSE, have_external_memory_fd = FALSE, have_external_semaphore_fd = FALSE; VkResult res; unsigned int i, j; @@ -238,6 +313,9 @@ static struct wine_phys_dev *wine_vk_physical_device_alloc(struct wine_instance object->handle = handle; object->host_physical_device = phys_dev; + instance->funcs.p_vkGetPhysicalDeviceProperties(phys_dev, &physdev_properties); + object->api_version = physdev_properties.apiVersion; + handle->base.unix_handle = (uintptr_t)object; WINE_VK_ADD_DISPATCHABLE_MAPPING(instance, handle, phys_dev, object); @@ -271,6 +349,25 @@ static struct wine_phys_dev *wine_vk_physical_device_alloc(struct wine_instance */ for (i = 0; i < num_host_properties; i++) { + if (!strcmp(host_properties[i].extensionName, "VK_KHR_external_memory_fd")) + { + TRACE("Substituting VK_KHR_external_memory_fd for VK_KHR_external_memory_win32\n"); + + snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), + VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); + host_properties[i].specVersion = VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION; + have_external_memory_fd = TRUE; + } + if (!strcmp(host_properties[i].extensionName, "VK_KHR_external_semaphore_fd")) + { + TRACE("Substituting VK_KHR_external_semaphore_fd for VK_KHR_external_semaphore_win32\n"); + + snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), + VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); + host_properties[i].specVersion = VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION; + have_external_semaphore_fd = TRUE; + } + if (wine_vk_device_extension_supported(host_properties[i].extensionName)) { TRACE("Enabling extension '%s' for physical device %p\n", host_properties[i].extensionName, object); @@ -284,7 +381,8 @@ static struct wine_phys_dev *wine_vk_physical_device_alloc(struct wine_instance have_external_memory_host = TRUE; } - TRACE("Host supported extensions %u, Wine supported extensions %u\n", num_host_properties, num_properties); + if (have_external_memory_fd && have_external_semaphore_fd) + ++num_properties; /* VK_KHR_win32_keyed_mutex */ if (!(object->extensions = calloc(num_properties, sizeof(*object->extensions)))) { @@ -300,7 +398,15 @@ static struct wine_phys_dev *wine_vk_physical_device_alloc(struct wine_instance j++; } } + if (have_external_memory_fd && have_external_semaphore_fd) + { + strcpy(object->extensions[j].extensionName, VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME); + object->extensions[j].specVersion = VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION; + TRACE("Enabling extension '%s' for physical device %p\n", object->extensions[j].extensionName, object); + ++j; + } object->extension_count = num_properties; + TRACE("Host supported extensions %u, Wine supported extensions %u\n", num_host_properties, num_properties); if (use_external_memory() && have_external_memory_host) { @@ -392,12 +498,74 @@ static void wine_vk_device_get_queues(struct wine_device *device, } } +static char **parse_xr_extensions(unsigned int *len) +{ + char *xr_str, *iter, *start, **list; + unsigned int extension_count = 0, o = 0; + + xr_str = getenv("__WINE_OPENXR_VK_DEVICE_EXTENSIONS"); + if (!xr_str) + { + *len = 0; + return NULL; + } + xr_str = strdup(xr_str); + + TRACE("got var: %s\n", xr_str); + + iter = xr_str; + while(*iter){ + if(*iter++ == ' ') + extension_count++; + } + /* count the one ending in NUL */ + if(iter != xr_str) + extension_count++; + if(!extension_count){ + *len = 0; + return NULL; + } + + TRACE("counted %u extensions\n", extension_count); + + list = malloc(extension_count * sizeof(char *)); + + start = iter = xr_str; + do{ + if(*iter == ' '){ + *iter = 0; + list[o++] = strdup(start); + TRACE("added %s to list\n", list[o-1]); + iter++; + start = iter; + }else if(*iter == 0){ + list[o++] = strdup(start); + TRACE("added %s to list\n", list[o-1]); + break; + }else{ + iter++; + } + }while(1); + + free(xr_str); + + *len = extension_count; + + return list; +} + static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_dev, - struct conversion_context *ctx, const VkDeviceCreateInfo *src, VkDeviceCreateInfo *dst) + struct conversion_context *ctx, const VkDeviceCreateInfo *src, VkDeviceCreateInfo *dst, + struct wine_device *device) { - unsigned int i; + static const char *wine_xr_extension_name = "VK_WINE_openxr_device_extensions"; + unsigned int i, append_xr = 0, have_ext_mem32 = 0, have_ext_sem32 = 0, have_keyed_mutex = 0, append_timeline = 1; + VkBaseOutStructure *header; + char **xr_extensions_list; *dst = *src; + if ((header = (VkBaseOutStructure *)dst->pNext) && header->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK) + dst->pNext = header->pNext; /* Should be filtered out by loader as ICDs don't support layers. */ dst->enabledLayerCount = 0; @@ -408,23 +576,86 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de { const char *extension_name = dst->ppEnabledExtensionNames[i]; TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name)); - if (!wine_vk_device_extension_supported(extension_name)) + + if (!strcmp(extension_name, wine_xr_extension_name)) + append_xr = 1; + else if (!strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_external_memory_win32")) + have_ext_mem32 = 1; + else if (!strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_external_semaphore_win32")) + have_ext_sem32 = 1; + else if (!strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_win32_keyed_mutex")) + have_keyed_mutex = 1; + else if (!strcmp(extension_name, "VK_KHR_timeline_semaphore")) + append_timeline = 0; + } + if (append_timeline) + append_timeline = phys_dev->api_version < VK_API_VERSION_1_2 || phys_dev->instance->api_version < VK_API_VERSION_1_2; + if (append_timeline) + { + append_timeline = 0; + for (i = 0; i < phys_dev->extension_count; ++i) { - WARN("Extension %s is not supported.\n", debugstr_a(extension_name)); - return VK_ERROR_EXTENSION_NOT_PRESENT; + if (!strcmp(phys_dev->extensions[i].extensionName, "VK_KHR_timeline_semaphore")) + { + append_timeline = 1; + break; + } } } - if (phys_dev->external_memory_align) + if (append_xr) + xr_extensions_list = parse_xr_extensions(&append_xr); + + if (phys_dev->external_memory_align || append_xr || have_ext_mem32 || have_ext_sem32 || have_keyed_mutex || append_timeline) { const char **new_extensions; - - new_extensions = conversion_context_alloc(ctx, (dst->enabledExtensionCount + 2) * - sizeof(*dst->ppEnabledExtensionNames)); - memcpy(new_extensions, src->ppEnabledExtensionNames, - dst->enabledExtensionCount * sizeof(*dst->ppEnabledExtensionNames)); - new_extensions[dst->enabledExtensionCount++] = "VK_KHR_external_memory"; - new_extensions[dst->enabledExtensionCount++] = "VK_EXT_external_memory_host"; + unsigned int o = 0, count; + + count = dst->enabledExtensionCount; + if (phys_dev->external_memory_align) + count += 2; + if (append_xr) + count += append_xr - 1; + if (append_timeline) + ++count; + if (have_keyed_mutex) + count += !have_ext_mem32 + !have_ext_sem32; + + new_extensions = conversion_context_alloc(ctx, count * sizeof(*dst->ppEnabledExtensionNames)); + for (i = 0; i < dst->enabledExtensionCount; ++i) + { + if (append_xr && !strcmp(src->ppEnabledExtensionNames[i], wine_xr_extension_name)) + continue; + if (have_ext_mem32 && !strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_external_memory_win32")) + new_extensions[o++] = "VK_KHR_external_memory_fd"; + else if (have_ext_sem32 && !strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_external_semaphore_win32")) + new_extensions[o++] = "VK_KHR_external_semaphore_fd"; + else if (have_keyed_mutex && !strcmp(src->ppEnabledExtensionNames[i], "VK_KHR_win32_keyed_mutex")) + continue; + else + new_extensions[o++] = src->ppEnabledExtensionNames[i]; + } + if (have_keyed_mutex) + { + if (!have_ext_mem32) + new_extensions[o++] = "VK_KHR_external_memory_fd"; + if (!have_ext_sem32) + new_extensions[o++] = "VK_KHR_external_semaphore_fd"; + device->keyed_mutexes_enabled = TRUE; + } + if (phys_dev->external_memory_align) + { + new_extensions[o++] = "VK_KHR_external_memory"; + new_extensions[o++] = "VK_EXT_external_memory_host"; + } + for (i = 0; i < append_xr; ++i) + { + TRACE("\t%s\n", xr_extensions_list[i]); + new_extensions[o++] = xr_extensions_list[i]; + } + if (append_timeline) + new_extensions[o++] = "VK_KHR_timeline_semaphore"; + dst->enabledExtensionCount = o; dst->ppEnabledExtensionNames = new_extensions; } @@ -436,11 +667,32 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de */ static void wine_vk_device_free(struct wine_device *device) { + struct pending_d3d12_fence_op *op; struct wine_queue *queue; if (!device) return; + if (device->signaller_thread) + { + TRACE("Shutting down signaller thread.\n"); + pthread_mutex_lock(&device->signaller_mutex); + device->stop = 1; + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + pthread_mutex_unlock(&device->signaller_mutex); + pthread_join(device->signaller_thread, NULL); + device->funcs.p_vkDestroySemaphore(device->host_device, device->sem_poll_update.sem, NULL); + pthread_cond_destroy(&device->sem_poll_updated_cond); + TRACE("Signaller thread shut down.\n"); + } + pthread_mutex_destroy(&device->signaller_mutex); + + LIST_FOR_EACH_ENTRY(op, &device->free_fence_ops_list, struct pending_d3d12_fence_op, entry) + { + device->funcs.p_vkDestroySemaphore(device->host_device, op->local_sem.sem, NULL); + free(op); + } + if (device->queues) { unsigned int i; @@ -456,8 +708,8 @@ static void wine_vk_device_free(struct wine_device *device) if (device->host_device && device->funcs.p_vkDestroyDevice) { - WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, device); device->funcs.p_vkDestroyDevice(device->host_device, NULL /* pAllocator */); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, device); } free(device); @@ -540,11 +792,6 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context * { const char *extension_name = dst->ppEnabledExtensionNames[i]; TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name)); - if (!wine_vk_instance_extension_supported(extension_name)) - { - WARN("Extension %s is not supported.\n", debugstr_a(extension_name)); - return VK_ERROR_EXTENSION_NOT_PRESENT; - } if (!strcmp(extension_name, "VK_EXT_debug_utils") || !strcmp(extension_name, "VK_EXT_debug_report")) { object->enable_wrapper_list = VK_TRUE; @@ -741,6 +988,10 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice phys_dev_handle, const VkDeviceCre unsigned int i; VkResult res; + PFN_native_vkCreateDevice native_create_device = NULL; + void *native_create_device_context = NULL; + VkCreateInfoWineDeviceCallback *callback; + if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); @@ -758,13 +1009,52 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice phys_dev_handle, const VkDeviceCre if (!(object = calloc(1, sizeof(*object)))) return VK_ERROR_OUT_OF_HOST_MEMORY; + pthread_mutex_init(&object->signaller_mutex, NULL); + list_init(&object->sem_poll_list); + list_init(&object->free_fence_ops_list); object->phys_dev = phys_dev; + if ((callback = (VkCreateInfoWineDeviceCallback *)create_info->pNext) + && callback->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK) + { + native_create_device = callback->native_create_callback; + native_create_device_context = callback->context; + } + init_conversion_context(&ctx); - res = wine_vk_device_convert_create_info(phys_dev, &ctx, create_info, &create_info_host); + res = wine_vk_device_convert_create_info(phys_dev, &ctx, create_info, &create_info_host, object); if (res == VK_SUCCESS) - res = instance->funcs.p_vkCreateDevice(phys_dev->host_physical_device, &create_info_host, - NULL /* allocator */, &object->host_device); + { + VkPhysicalDeviceFeatures features = {0}; + VkPhysicalDeviceFeatures2 *features2; + + /* Enable shaderStorageImageWriteWithoutFormat for fshack + * This is available on all hardware and driver combinations we care about. + */ + if (create_info_host.pEnabledFeatures) + { + features = *create_info_host.pEnabledFeatures; + features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + create_info_host.pEnabledFeatures = &features; + } + if ((features2 = wine_vk_find_struct(&create_info_host, PHYSICAL_DEVICE_FEATURES_2))) + { + features2->features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + } + else if (!create_info_host.pEnabledFeatures) + { + features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + create_info_host.pEnabledFeatures = &features; + } + + if (native_create_device) + res = native_create_device(phys_dev->host_physical_device, + &create_info_host, NULL /* allocator */, &object->host_device, + vk_funcs->p_vkGetInstanceProcAddr, native_create_device_context); + else + res = instance->funcs.p_vkCreateDevice(phys_dev->host_physical_device, + &create_info_host, NULL /* allocator */, &object->host_device); + } free_conversion_context(&ctx); WINE_VK_ADD_DISPATCHABLE_MAPPING(instance, device_handle, object->host_device, object); if (res != VK_SUCCESS) @@ -890,6 +1180,8 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, app_info->engineVersion); TRACE("API version %#x.\n", app_info->apiVersion); + object->api_version = app_info->apiVersion; + if (app_info->pEngineName && !strcmp(app_info->pEngineName, "idTech")) object->quirks |= WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR; } @@ -1151,9 +1443,8 @@ void wine_vkDestroyCommandPool(VkDevice device_handle, VkCommandPool handle, if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); - WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, pool); - device->funcs.p_vkDestroyCommandPool(device->host_device, pool->host_command_pool, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, pool); free(pool); } @@ -1220,64 +1511,142 @@ void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice phys_de properties->externalFenceFeatures = 0; } -void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice phys_dev, +static inline void wine_vk_normalize_handle_types_win(VkExternalMemoryHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT; +} + +static inline void wine_vk_normalize_handle_types_host(VkExternalMemoryHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT | +/* predicated on VK_KHR_external_memory_dma_buf + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT | */ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT; +} + +static const VkExternalMemoryHandleTypeFlagBits wine_vk_handle_over_fd_types = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT; + +static void wine_vk_get_physical_device_external_buffer_properties(struct wine_phys_dev *phys_dev, + void (*p_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *), + const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) +{ + VkPhysicalDeviceExternalBufferInfo buffer_info_dup = *buffer_info; + + wine_vk_normalize_handle_types_win(&buffer_info_dup.handleType); + if (buffer_info_dup.handleType & wine_vk_handle_over_fd_types) + buffer_info_dup.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&buffer_info_dup.handleType); + + if (buffer_info->handleType && !buffer_info_dup.handleType) + { + memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + return; + } + + p_vkGetPhysicalDeviceExternalBufferProperties(phys_dev->host_physical_device, &buffer_info_dup, properties); + + if (properties->externalMemoryProperties.exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->externalMemoryProperties.exportFromImportedHandleTypes |= wine_vk_handle_over_fd_types; + wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.exportFromImportedHandleTypes); + + if (properties->externalMemoryProperties.compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->externalMemoryProperties.compatibleHandleTypes |= wine_vk_handle_over_fd_types; + wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.compatibleHandleTypes); +} + +void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice phys_dev_handle, const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) { - memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + wine_vk_get_physical_device_external_buffer_properties(phys_dev, phys_dev->instance->funcs.p_vkGetPhysicalDeviceExternalBufferProperties, buffer_info, properties); } -void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice phys_dev, +void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice phys_dev_handle, const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) { - memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + wine_vk_get_physical_device_external_buffer_properties(phys_dev, phys_dev->instance->funcs.p_vkGetPhysicalDeviceExternalBufferPropertiesKHR, buffer_info, properties); } -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice phys_dev_handle, - const VkPhysicalDeviceImageFormatInfo2 *format_info, - VkImageFormatProperties2 *properties) +static VkResult wine_vk_get_physical_device_image_format_properties_2(struct wine_phys_dev *phys_dev, + VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *), + const VkPhysicalDeviceImageFormatInfo2 *format_info, VkImageFormatProperties2 *properties) { - struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + VkPhysicalDeviceExternalImageFormatInfo *external_image_info; VkExternalImageFormatProperties *external_image_properties; VkResult res; - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2(phys_dev->host_physical_device, - format_info, properties); + if ((external_image_info = find_next_struct(format_info, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO)) + && external_image_info->handleType) + { + wine_vk_normalize_handle_types_win(&external_image_info->handleType); + + if (external_image_info->handleType & wine_vk_handle_over_fd_types) + external_image_info->handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + + wine_vk_normalize_handle_types_host(&external_image_info->handleType); + if (!external_image_info->handleType) + { + FIXME("Unsupported handle type %#x.\n", external_image_info->handleType); + return VK_ERROR_FORMAT_NOT_SUPPORTED; + } + } + + res = p_vkGetPhysicalDeviceImageFormatProperties2(phys_dev->host_physical_device, + format_info, properties); if ((external_image_properties = find_next_struct(properties, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))) { VkExternalMemoryProperties *p = &external_image_properties->externalMemoryProperties; - p->externalMemoryFeatures = 0; - p->exportFromImportedHandleTypes = 0; - p->compatibleHandleTypes = 0; - } + if (p->exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + p->exportFromImportedHandleTypes |= wine_vk_handle_over_fd_types; + wine_vk_normalize_handle_types_win(&p->exportFromImportedHandleTypes); + + if (p->compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + p->compatibleHandleTypes |= wine_vk_handle_over_fd_types; + wine_vk_normalize_handle_types_win(&p->compatibleHandleTypes); + } return res; } +VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice phys_dev_handle, + const VkPhysicalDeviceImageFormatInfo2 *format_info, + VkImageFormatProperties2 *properties) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + + return wine_vk_get_physical_device_image_format_properties_2(phys_dev, + phys_dev->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2, + format_info, properties); +} + VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice phys_dev_handle, const VkPhysicalDeviceImageFormatInfo2 *format_info, VkImageFormatProperties2 *properties) { struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); - VkExternalImageFormatProperties *external_image_properties; - VkResult res; - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2KHR(phys_dev->host_physical_device, - format_info, properties); - - if ((external_image_properties = find_next_struct(properties, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))) - { - VkExternalMemoryProperties *p = &external_image_properties->externalMemoryProperties; - p->externalMemoryFeatures = 0; - p->exportFromImportedHandleTypes = 0; - p->compatibleHandleTypes = 0; - } - - return res; + return wine_vk_get_physical_device_image_format_properties_2(phys_dev, + phys_dev->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2KHR, + format_info, properties); } /* From ntdll/unix/sync.c */ @@ -1326,17 +1695,19 @@ static inline uint64_t convert_timestamp(VkTimeDomainEXT host_domain, VkTimeDoma return value; } -VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice handle, uint32_t timestamp_count, - const VkCalibratedTimestampInfoEXT *timestamp_infos, - uint64_t *timestamps, uint64_t *max_deviation) +static VkResult wine_vk_get_timestamps(struct wine_device *device, uint32_t timestamp_count, + const VkCalibratedTimestampInfoEXT *timestamp_infos, + uint64_t *timestamps, uint64_t *max_deviation, + VkResult (*get_timestamps)(VkDevice, uint32_t, const VkCalibratedTimestampInfoEXT *, uint64_t *, uint64_t *)) { - struct wine_device *device = wine_device_from_handle(handle); VkCalibratedTimestampInfoEXT* host_timestamp_infos; unsigned int i; VkResult res; - TRACE("%p, %u, %p, %p, %p\n", device, timestamp_count, timestamp_infos, timestamps, max_deviation); - if (!(host_timestamp_infos = malloc(sizeof(VkCalibratedTimestampInfoEXT) * timestamp_count))) + if (timestamp_count == 0) + return VK_SUCCESS; + + if (!(host_timestamp_infos = calloc(sizeof(VkCalibratedTimestampInfoEXT), timestamp_count))) return VK_ERROR_OUT_OF_HOST_MEMORY; for (i = 0; i < timestamp_count; i++) @@ -1346,24 +1717,23 @@ VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice handle, uint32_t timestamp_c host_timestamp_infos[i].timeDomain = map_to_host_time_domain(timestamp_infos[i].timeDomain); } - res = device->funcs.p_vkGetCalibratedTimestampsEXT(device->host_device, timestamp_count, host_timestamp_infos, - timestamps, max_deviation); - if (res != VK_SUCCESS) - return res; - - for (i = 0; i < timestamp_count; i++) - timestamps[i] = convert_timestamp(host_timestamp_infos[i].timeDomain, timestamp_infos[i].timeDomain, timestamps[i]); + res = get_timestamps(device->host_device, timestamp_count, host_timestamp_infos, timestamps, max_deviation); + if (res == VK_SUCCESS) + { + for (i = 0; i < timestamp_count; i++) + timestamps[i] = convert_timestamp(host_timestamp_infos[i].timeDomain, timestamp_infos[i].timeDomain, timestamps[i]); + } free(host_timestamp_infos); return res; } -VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice handle, - uint32_t *time_domain_count, - VkTimeDomainEXT *time_domains) +static VkResult wine_vk_get_time_domains(struct wine_phys_dev *phys_dev, + uint32_t *time_domain_count, + VkTimeDomainEXT *time_domains, + VkResult (*get_domains)(VkPhysicalDevice, uint32_t *, VkTimeDomainEXT *)) { - struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); BOOL supports_device = FALSE, supports_monotonic = FALSE, supports_monotonic_raw = FALSE; const VkTimeDomainEXT performance_counter_domain = get_performance_counter_time_domain(); VkTimeDomainEXT *host_time_domains; @@ -1374,16 +1744,14 @@ VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice ha VkResult res; /* Find out the time domains supported on the host */ - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(phys_dev->host_physical_device, - &host_time_domain_count, NULL); + res = get_domains(phys_dev->host_physical_device, &host_time_domain_count, NULL); if (res != VK_SUCCESS) return res; if (!(host_time_domains = malloc(sizeof(VkTimeDomainEXT) * host_time_domain_count))) return VK_ERROR_OUT_OF_HOST_MEMORY; - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(phys_dev->host_physical_device, - &host_time_domain_count, host_time_domains); + res = get_domains(phys_dev->host_physical_device, &host_time_domain_count, host_time_domains); if (res != VK_SUCCESS) { free(host_time_domains); @@ -1433,558 +1801,3753 @@ VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice ha return res; } -void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice phys_dev, - const VkPhysicalDeviceExternalSemaphoreInfo *info, - VkExternalSemaphoreProperties *properties) +VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice handle, uint32_t timestamp_count, + const VkCalibratedTimestampInfoEXT *timestamp_infos, + uint64_t *timestamps, uint64_t *max_deviation) { - properties->exportFromImportedHandleTypes = 0; - properties->compatibleHandleTypes = 0; - properties->externalSemaphoreFeatures = 0; -} + struct wine_device *device = wine_device_from_handle(handle); -void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice phys_dev, - const VkPhysicalDeviceExternalSemaphoreInfo *info, - VkExternalSemaphoreProperties *properties) -{ - properties->exportFromImportedHandleTypes = 0; - properties->compatibleHandleTypes = 0; - properties->externalSemaphoreFeatures = 0; + TRACE("%p, %u, %p, %p, %p\n", device, timestamp_count, timestamp_infos, timestamps, max_deviation); + + return wine_vk_get_timestamps(device, timestamp_count, timestamp_infos, timestamps, max_deviation, + device->funcs.p_vkGetCalibratedTimestampsEXT); } -VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *createInfo, - const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) +VkResult wine_vkGetCalibratedTimestampsKHR(VkDevice handle, uint32_t timestamp_count, + const VkCalibratedTimestampInfoKHR *timestamp_infos, + uint64_t *timestamps, uint64_t *max_deviation) { - struct wine_instance *instance = wine_instance_from_handle(handle); - struct wine_surface *object; - VkResult res; + struct wine_device *device = wine_device_from_handle(handle); - if (allocator) - FIXME("Support for allocation callbacks not implemented yet\n"); + TRACE("%p, %u, %p, %p, %p\n", device, timestamp_count, timestamp_infos, timestamps, max_deviation); - object = calloc(1, sizeof(*object)); + return wine_vk_get_timestamps(device, timestamp_count, timestamp_infos, timestamps, max_deviation, + device->funcs.p_vkGetCalibratedTimestampsKHR); +} - if (!object) - return VK_ERROR_OUT_OF_HOST_MEMORY; +VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice handle, + uint32_t *time_domain_count, + VkTimeDomainEXT *time_domains) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); - res = instance->funcs.p_vkCreateWin32SurfaceKHR(instance->host_instance, createInfo, NULL, - &object->driver_surface); + TRACE("%p, %p, %p\n", phys_dev, time_domain_count, time_domains); - if (res != VK_SUCCESS) - { - free(object); - return res; - } + return wine_vk_get_time_domains(phys_dev, time_domain_count, time_domains, + phys_dev->instance->funcs.p_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT); +} - object->host_surface = vk_funcs->p_wine_get_host_surface(object->driver_surface); - WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_surface, object); +VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice handle, + uint32_t *time_domain_count, + VkTimeDomainKHR *time_domains) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); - *surface = wine_surface_to_handle(object); + TRACE("%p, %p, %p\n", phys_dev, time_domain_count, time_domains); - return VK_SUCCESS; + return wine_vk_get_time_domains(phys_dev, time_domain_count, time_domains, + phys_dev->instance->funcs.p_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR); } -void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface, - const VkAllocationCallbacks *allocator) +static inline void wine_vk_normalize_semaphore_handle_types_win(VkExternalSemaphoreHandleTypeFlags *types) { - struct wine_instance *instance = wine_instance_from_handle(handle); - struct wine_surface *object = wine_surface_from_handle(surface); - - if (!object) - return; - - instance->funcs.p_vkDestroySurfaceKHR(instance->host_instance, object->driver_surface, NULL); - WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); + *types &= + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; +} - free(object); +static inline void wine_vk_normalize_semaphore_handle_types_host(VkExternalSemaphoreHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT; } -VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *alloc_info, - const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) +static void wine_vk_get_physical_device_external_semaphore_properties(struct wine_phys_dev *phys_dev, + void (*p_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *), + const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, VkExternalSemaphoreProperties *properties) { - struct wine_device *device = wine_device_from_handle(handle); - struct wine_device_memory *memory; - VkMemoryAllocateInfo info = *alloc_info; - VkImportMemoryHostPointerInfoEXT host_pointer_info; - uint32_t mem_flags; - void *mapping = NULL; - VkResult result; + VkPhysicalDeviceExternalSemaphoreInfo semaphore_info_dup = *semaphore_info; + VkSemaphoreTypeCreateInfo semaphore_type_info, *p_semaphore_type_info; - /* For host visible memory, we try to use VK_EXT_external_memory_host on wow64 - * to ensure that mapped pointer is 32-bit. */ - mem_flags = device->phys_dev->memory_properties.memoryTypes[alloc_info->memoryTypeIndex].propertyFlags; - if (device->phys_dev->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && - !find_next_struct(alloc_info->pNext, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)) + switch(semaphore_info->handleType) { - VkMemoryHostPointerPropertiesEXT props = + case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT: + semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + break; + case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT: { - .sType = VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, - }; - uint32_t i, align = device->phys_dev->external_memory_align - 1; - SIZE_T alloc_size = info.allocationSize; - static int once; + unsigned int i; - if (!once++) - FIXME("Using VK_EXT_external_memory_host\n"); + if (phys_dev->api_version < VK_API_VERSION_1_2 || + phys_dev->instance->api_version < VK_API_VERSION_1_2) + { + for (i = 0; i < phys_dev->extension_count; i++) + { + if (!strcmp(phys_dev->extensions[i].extensionName, "VK_KHR_timeline_semaphore")) + break; + } + if (i == phys_dev->extension_count) + { + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; + return; + } + } + + if ((p_semaphore_type_info = wine_vk_find_struct(&semaphore_info_dup, SEMAPHORE_TYPE_CREATE_INFO))) + { + p_semaphore_type_info->semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + p_semaphore_type_info->initialValue = 0; + } + else + { + semaphore_type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + semaphore_type_info.pNext = semaphore_info_dup.pNext; + semaphore_type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + semaphore_type_info.initialValue = 0; + + semaphore_info_dup.pNext = &semaphore_type_info; + } + + semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + break; + } + default: + semaphore_info_dup.handleType = 0; + break; + } + + if (semaphore_info->handleType && !semaphore_info_dup.handleType) + { + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; + return; + } + + p_vkGetPhysicalDeviceExternalSemaphoreProperties(phys_dev->host_physical_device, &semaphore_info_dup, properties); + + if (properties->exportFromImportedHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->exportFromImportedHandleTypes = semaphore_info->handleType; + wine_vk_normalize_semaphore_handle_types_win(&properties->exportFromImportedHandleTypes); + + if (properties->compatibleHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->compatibleHandleTypes = semaphore_info->handleType; + wine_vk_normalize_semaphore_handle_types_win(&properties->compatibleHandleTypes); +} + +void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice phys_dev_handle, + const VkPhysicalDeviceExternalSemaphoreInfo *info, + VkExternalSemaphoreProperties *properties) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + + TRACE("%p, %p, %p\n", phys_dev, info, properties); + wine_vk_get_physical_device_external_semaphore_properties(phys_dev, phys_dev->instance->funcs.p_vkGetPhysicalDeviceExternalSemaphoreProperties, info, properties); +} + +void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice phys_dev_handle, + const VkPhysicalDeviceExternalSemaphoreInfo *info, + VkExternalSemaphoreProperties *properties) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(phys_dev_handle); + + TRACE("%p, %p, %p\n", phys_dev, info, properties); + wine_vk_get_physical_device_external_semaphore_properties(phys_dev, phys_dev->instance->funcs.p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, info, properties); +} + +/* +#version 460 + +layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) uniform sampler2D texSampler; +layout(binding = 1) uniform writeonly image2D outImage; +layout(push_constant) uniform pushConstants { + //both in real image coords + vec2 offset; + vec2 extents; +} constants; + +void main() +{ + vec2 texcoord = (vec2(gl_GlobalInvocationID.xy) - constants.offset) / constants.extents; + vec4 c = texture(texSampler, texcoord); + + // Convert linear -> srgb + bvec3 isLo = lessThanEqual(c.rgb, vec3(0.0031308f)); + vec3 loPart = c.rgb * 12.92f; + vec3 hiPart = pow(c.rgb, vec3(5.0f / 12.0f)) * 1.055f - 0.055f; + c.rgb = mix(hiPart, loPart, isLo); + + imageStore(outImage, ivec2(gl_GlobalInvocationID.xy), c); +} + +*/ +const uint32_t blit_comp_spv[] = { + 0x07230203,0x00010000,0x0008000a,0x0000005e,0x00000000,0x00020011,0x00000001,0x00020011, + 0x00000038,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e, + 0x00000000,0x00000001,0x0006000f,0x00000005,0x00000004,0x6e69616d,0x00000000,0x0000000d, + 0x00060010,0x00000004,0x00000011,0x00000008,0x00000008,0x00000001,0x00030003,0x00000002, + 0x000001cc,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x63786574, + 0x64726f6f,0x00000000,0x00080005,0x0000000d,0x475f6c67,0x61626f6c,0x766e496c,0x7461636f, + 0x496e6f69,0x00000044,0x00060005,0x00000012,0x68737570,0x736e6f43,0x746e6174,0x00000073, + 0x00050006,0x00000012,0x00000000,0x7366666f,0x00007465,0x00050006,0x00000012,0x00000001, + 0x65747865,0x0073746e,0x00050005,0x00000014,0x736e6f63,0x746e6174,0x00000073,0x00030005, + 0x00000021,0x00000063,0x00050005,0x00000025,0x53786574,0x6c706d61,0x00007265,0x00040005, + 0x0000002d,0x6f4c7369,0x00000000,0x00040005,0x00000035,0x61506f6c,0x00007472,0x00040005, + 0x0000003a,0x61506968,0x00007472,0x00050005,0x00000055,0x4974756f,0x6567616d,0x00000000, + 0x00040047,0x0000000d,0x0000000b,0x0000001c,0x00050048,0x00000012,0x00000000,0x00000023, + 0x00000000,0x00050048,0x00000012,0x00000001,0x00000023,0x00000008,0x00030047,0x00000012, + 0x00000002,0x00040047,0x00000025,0x00000022,0x00000000,0x00040047,0x00000025,0x00000021, + 0x00000000,0x00040047,0x00000055,0x00000022,0x00000000,0x00040047,0x00000055,0x00000021, + 0x00000001,0x00030047,0x00000055,0x00000019,0x00040047,0x0000005d,0x0000000b,0x00000019, + 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, + 0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007, + 0x00040015,0x0000000a,0x00000020,0x00000000,0x00040017,0x0000000b,0x0000000a,0x00000003, + 0x00040020,0x0000000c,0x00000001,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000001, + 0x00040017,0x0000000e,0x0000000a,0x00000002,0x0004001e,0x00000012,0x00000007,0x00000007, + 0x00040020,0x00000013,0x00000009,0x00000012,0x0004003b,0x00000013,0x00000014,0x00000009, + 0x00040015,0x00000015,0x00000020,0x00000001,0x0004002b,0x00000015,0x00000016,0x00000000, + 0x00040020,0x00000017,0x00000009,0x00000007,0x0004002b,0x00000015,0x0000001b,0x00000001, + 0x00040017,0x0000001f,0x00000006,0x00000004,0x00040020,0x00000020,0x00000007,0x0000001f, + 0x00090019,0x00000022,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001, + 0x00000000,0x0003001b,0x00000023,0x00000022,0x00040020,0x00000024,0x00000000,0x00000023, + 0x0004003b,0x00000024,0x00000025,0x00000000,0x0004002b,0x00000006,0x00000028,0x00000000, + 0x00020014,0x0000002a,0x00040017,0x0000002b,0x0000002a,0x00000003,0x00040020,0x0000002c, + 0x00000007,0x0000002b,0x00040017,0x0000002e,0x00000006,0x00000003,0x0004002b,0x00000006, + 0x00000031,0x3b4d2e1c,0x0006002c,0x0000002e,0x00000032,0x00000031,0x00000031,0x00000031, + 0x00040020,0x00000034,0x00000007,0x0000002e,0x0004002b,0x00000006,0x00000038,0x414eb852, + 0x0004002b,0x00000006,0x0000003d,0x3ed55555,0x0006002c,0x0000002e,0x0000003e,0x0000003d, + 0x0000003d,0x0000003d,0x0004002b,0x00000006,0x00000040,0x3f870a3d,0x0004002b,0x00000006, + 0x00000042,0x3d6147ae,0x0004002b,0x0000000a,0x00000049,0x00000000,0x00040020,0x0000004a, + 0x00000007,0x00000006,0x0004002b,0x0000000a,0x0000004d,0x00000001,0x0004002b,0x0000000a, + 0x00000050,0x00000002,0x00090019,0x00000053,0x00000006,0x00000001,0x00000000,0x00000000, + 0x00000000,0x00000002,0x00000000,0x00040020,0x00000054,0x00000000,0x00000053,0x0004003b, + 0x00000054,0x00000055,0x00000000,0x00040017,0x00000059,0x00000015,0x00000002,0x0004002b, + 0x0000000a,0x0000005c,0x00000008,0x0006002c,0x0000000b,0x0000005d,0x0000005c,0x0000005c, + 0x0000004d,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005, + 0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003b,0x00000020,0x00000021,0x00000007, + 0x0004003b,0x0000002c,0x0000002d,0x00000007,0x0004003b,0x00000034,0x00000035,0x00000007, + 0x0004003b,0x00000034,0x0000003a,0x00000007,0x0004003d,0x0000000b,0x0000000f,0x0000000d, + 0x0007004f,0x0000000e,0x00000010,0x0000000f,0x0000000f,0x00000000,0x00000001,0x00040070, + 0x00000007,0x00000011,0x00000010,0x00050041,0x00000017,0x00000018,0x00000014,0x00000016, + 0x0004003d,0x00000007,0x00000019,0x00000018,0x00050083,0x00000007,0x0000001a,0x00000011, + 0x00000019,0x00050041,0x00000017,0x0000001c,0x00000014,0x0000001b,0x0004003d,0x00000007, + 0x0000001d,0x0000001c,0x00050088,0x00000007,0x0000001e,0x0000001a,0x0000001d,0x0003003e, + 0x00000009,0x0000001e,0x0004003d,0x00000023,0x00000026,0x00000025,0x0004003d,0x00000007, + 0x00000027,0x00000009,0x00070058,0x0000001f,0x00000029,0x00000026,0x00000027,0x00000002, + 0x00000028,0x0003003e,0x00000021,0x00000029,0x0004003d,0x0000001f,0x0000002f,0x00000021, + 0x0008004f,0x0000002e,0x00000030,0x0000002f,0x0000002f,0x00000000,0x00000001,0x00000002, + 0x000500bc,0x0000002b,0x00000033,0x00000030,0x00000032,0x0003003e,0x0000002d,0x00000033, + 0x0004003d,0x0000001f,0x00000036,0x00000021,0x0008004f,0x0000002e,0x00000037,0x00000036, + 0x00000036,0x00000000,0x00000001,0x00000002,0x0005008e,0x0000002e,0x00000039,0x00000037, + 0x00000038,0x0003003e,0x00000035,0x00000039,0x0004003d,0x0000001f,0x0000003b,0x00000021, + 0x0008004f,0x0000002e,0x0000003c,0x0000003b,0x0000003b,0x00000000,0x00000001,0x00000002, + 0x0007000c,0x0000002e,0x0000003f,0x00000001,0x0000001a,0x0000003c,0x0000003e,0x0005008e, + 0x0000002e,0x00000041,0x0000003f,0x00000040,0x00060050,0x0000002e,0x00000043,0x00000042, + 0x00000042,0x00000042,0x00050083,0x0000002e,0x00000044,0x00000041,0x00000043,0x0003003e, + 0x0000003a,0x00000044,0x0004003d,0x0000002e,0x00000045,0x0000003a,0x0004003d,0x0000002e, + 0x00000046,0x00000035,0x0004003d,0x0000002b,0x00000047,0x0000002d,0x000600a9,0x0000002e, + 0x00000048,0x00000047,0x00000046,0x00000045,0x00050041,0x0000004a,0x0000004b,0x00000021, + 0x00000049,0x00050051,0x00000006,0x0000004c,0x00000048,0x00000000,0x0003003e,0x0000004b, + 0x0000004c,0x00050041,0x0000004a,0x0000004e,0x00000021,0x0000004d,0x00050051,0x00000006, + 0x0000004f,0x00000048,0x00000001,0x0003003e,0x0000004e,0x0000004f,0x00050041,0x0000004a, + 0x00000051,0x00000021,0x00000050,0x00050051,0x00000006,0x00000052,0x00000048,0x00000002, + 0x0003003e,0x00000051,0x00000052,0x0004003d,0x00000053,0x00000056,0x00000055,0x0004003d, + 0x0000000b,0x00000057,0x0000000d,0x0007004f,0x0000000e,0x00000058,0x00000057,0x00000057, + 0x00000000,0x00000001,0x0004007c,0x00000059,0x0000005a,0x00000058,0x0004003d,0x0000001f, + 0x0000005b,0x00000021,0x00040063,0x00000056,0x0000005a,0x0000005b,0x000100fd,0x00010038 +}; + +static VkResult create_pipeline(struct wine_device *device, struct wine_swapchain *swapchain, VkShaderModule shaderModule) +{ + VkComputePipelineCreateInfo pipelineInfo = {0}; + VkResult res; + + pipelineInfo.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; + pipelineInfo.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + pipelineInfo.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; + pipelineInfo.stage.module = shaderModule; + pipelineInfo.stage.pName = "main"; + pipelineInfo.layout = swapchain->pipeline_layout; + pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; + pipelineInfo.basePipelineIndex = -1; + + res = device->funcs.p_vkCreateComputePipelines(device->host_device, VK_NULL_HANDLE, 1, &pipelineInfo, + NULL, &swapchain->pipeline); + if (res != VK_SUCCESS) + { + ERR("vkCreateComputePipelines: %d\n", res); + return res; + } + + return VK_SUCCESS; +} + +static VkResult create_descriptor_set(struct wine_device *device, struct wine_swapchain *swapchain, + struct fs_hack_image *hack) +{ + VkDescriptorImageInfo userDescriptorImageInfo = {0}, realDescriptorImageInfo = {0}; + VkDescriptorSetAllocateInfo descriptorAllocInfo = {0}; + VkWriteDescriptorSet descriptorWrites[2] = {{0}, {0}}; + VkResult res; + + descriptorAllocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; + descriptorAllocInfo.descriptorPool = swapchain->descriptor_pool; + descriptorAllocInfo.descriptorSetCount = 1; + descriptorAllocInfo.pSetLayouts = &swapchain->descriptor_set_layout; + + res = device->funcs.p_vkAllocateDescriptorSets(device->host_device, &descriptorAllocInfo, &hack->descriptor_set); + if (res != VK_SUCCESS) + { + ERR("vkAllocateDescriptorSets: %d\n", res); + return res; + } + + userDescriptorImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + userDescriptorImageInfo.imageView = hack->user_view; + userDescriptorImageInfo.sampler = swapchain->sampler; + + realDescriptorImageInfo.imageLayout = VK_IMAGE_LAYOUT_GENERAL; + realDescriptorImageInfo.imageView = hack->blit_view; + + descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descriptorWrites[0].dstSet = hack->descriptor_set; + descriptorWrites[0].dstBinding = 0; + descriptorWrites[0].dstArrayElement = 0; + descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptorWrites[0].descriptorCount = 1; + descriptorWrites[0].pImageInfo = &userDescriptorImageInfo; + + descriptorWrites[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descriptorWrites[1].dstSet = hack->descriptor_set; + descriptorWrites[1].dstBinding = 1; + descriptorWrites[1].dstArrayElement = 0; + descriptorWrites[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + descriptorWrites[1].descriptorCount = 1; + descriptorWrites[1].pImageInfo = &realDescriptorImageInfo; + + device->funcs.p_vkUpdateDescriptorSets(device->host_device, 2, descriptorWrites, 0, NULL); + + return VK_SUCCESS; +} + +static VkResult init_blit_images(struct wine_device *device, struct wine_swapchain *swapchain) +{ + VkResult res; + VkSamplerCreateInfo samplerInfo = {0}; + VkDescriptorPoolSize poolSizes[2] = {{0}, {0}}; + VkDescriptorPoolCreateInfo poolInfo = {0}; + VkDescriptorSetLayoutBinding layoutBindings[2] = {{0}, {0}}; + VkDescriptorSetLayoutCreateInfo descriptorLayoutInfo = {0}; + VkPipelineLayoutCreateInfo pipelineLayoutInfo = {0}; + VkPushConstantRange pushConstants; + VkShaderModuleCreateInfo shaderInfo = {0}; + VkShaderModule shaderModule = 0; + VkImageViewCreateInfo viewInfo = {0}; + uint32_t i; + + samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; + samplerInfo.magFilter = swapchain->fs_hack_filter; + samplerInfo.minFilter = swapchain->fs_hack_filter; + samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.anisotropyEnable = VK_FALSE; + samplerInfo.maxAnisotropy = 1; + samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK; + samplerInfo.unnormalizedCoordinates = VK_FALSE; + samplerInfo.compareEnable = VK_FALSE; + samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS; + samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; + samplerInfo.mipLodBias = 0.0f; + samplerInfo.minLod = 0.0f; + samplerInfo.maxLod = 0.0f; + + res = device->funcs.p_vkCreateSampler(device->host_device, &samplerInfo, NULL, &swapchain->sampler); + if (res != VK_SUCCESS) + { + WARN("vkCreateSampler failed, res=%d\n", res); + return res; + } + + poolSizes[0].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + poolSizes[0].descriptorCount = swapchain->n_images; + poolSizes[1].type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + poolSizes[1].descriptorCount = swapchain->n_images; + + poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; + poolInfo.poolSizeCount = 2; + poolInfo.pPoolSizes = poolSizes; + poolInfo.maxSets = swapchain->n_images; + + res = device->funcs.p_vkCreateDescriptorPool(device->host_device, &poolInfo, NULL, &swapchain->descriptor_pool); + if (res != VK_SUCCESS) + { + ERR("vkCreateDescriptorPool: %d\n", res); + goto fail; + } + + layoutBindings[0].binding = 0; + layoutBindings[0].descriptorCount = 1; + layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + layoutBindings[0].pImmutableSamplers = NULL; + layoutBindings[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + + layoutBindings[1].binding = 1; + layoutBindings[1].descriptorCount = 1; + layoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + layoutBindings[1].pImmutableSamplers = NULL; + layoutBindings[1].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + + descriptorLayoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + descriptorLayoutInfo.bindingCount = 2; + descriptorLayoutInfo.pBindings = layoutBindings; + + res = device->funcs.p_vkCreateDescriptorSetLayout(device->host_device, &descriptorLayoutInfo, NULL, + &swapchain->descriptor_set_layout); + if (res != VK_SUCCESS) + { + ERR("vkCreateDescriptorSetLayout: %d\n", res); + goto fail; + } + + pushConstants.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + pushConstants.offset = 0; + pushConstants.size = 4 * sizeof(float); /* 2 * vec2 */ + + pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; + pipelineLayoutInfo.setLayoutCount = 1; + pipelineLayoutInfo.pSetLayouts = &swapchain->descriptor_set_layout; + pipelineLayoutInfo.pushConstantRangeCount = 1; + pipelineLayoutInfo.pPushConstantRanges = &pushConstants; + + res = device->funcs.p_vkCreatePipelineLayout(device->host_device, &pipelineLayoutInfo, NULL, + &swapchain->pipeline_layout); + if (res != VK_SUCCESS) + { + ERR("vkCreatePipelineLayout: %d\n", res); + goto fail; + } + + shaderInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; + shaderInfo.codeSize = sizeof(blit_comp_spv); + shaderInfo.pCode = blit_comp_spv; + + res = device->funcs.p_vkCreateShaderModule(device->host_device, &shaderInfo, NULL, &shaderModule); + if (res != VK_SUCCESS) + { + ERR("vkCreateShaderModule: %d\n", res); + goto fail; + } + + res = create_pipeline(device, swapchain, shaderModule); + if (res != VK_SUCCESS) + goto fail; + + device->funcs.p_vkDestroyShaderModule(device->host_device, shaderModule, NULL); + + /* create imageviews */ + for (i = 0; i < swapchain->n_images; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + viewInfo.image = hack->swapchain_image; + viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + viewInfo.format = VK_FORMAT_B8G8R8A8_UNORM; + viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + viewInfo.subresourceRange.baseMipLevel = 0; + viewInfo.subresourceRange.levelCount = 1; + viewInfo.subresourceRange.baseArrayLayer = 0; + viewInfo.subresourceRange.layerCount = 1; + + res = device->funcs.p_vkCreateImageView(device->host_device, &viewInfo, NULL, &hack->blit_view); + if (res != VK_SUCCESS) + { + ERR("vkCreateImageView(blit): %d\n", res); + goto fail; + } + + res = create_descriptor_set(device, swapchain, hack); + if (res != VK_SUCCESS) + goto fail; + } + + return VK_SUCCESS; + +fail: + for (i = 0; i < swapchain->n_images; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + device->funcs.p_vkDestroyImageView(device->host_device, hack->blit_view, NULL); + hack->blit_view = VK_NULL_HANDLE; + } + + device->funcs.p_vkDestroyShaderModule(device->host_device, shaderModule, NULL); + + device->funcs.p_vkDestroyPipeline(device->host_device, swapchain->pipeline, NULL); + swapchain->pipeline = VK_NULL_HANDLE; + + device->funcs.p_vkDestroyPipelineLayout(device->host_device, swapchain->pipeline_layout, NULL); + swapchain->pipeline_layout = VK_NULL_HANDLE; + + device->funcs.p_vkDestroyDescriptorSetLayout(device->host_device, swapchain->descriptor_set_layout, NULL); + swapchain->descriptor_set_layout = VK_NULL_HANDLE; + + device->funcs.p_vkDestroyDescriptorPool(device->host_device, swapchain->descriptor_pool, NULL); + swapchain->descriptor_pool = VK_NULL_HANDLE; + + device->funcs.p_vkDestroySampler(device->host_device, swapchain->sampler, NULL); + swapchain->sampler = VK_NULL_HANDLE; + + return res; +} + +static void destroy_fs_hack_image(struct wine_device *device, struct wine_swapchain *swapchain, + struct fs_hack_image *hack) +{ + device->funcs.p_vkDestroyImageView(device->host_device, hack->user_view, NULL); + device->funcs.p_vkDestroyImageView(device->host_device, hack->blit_view, NULL); + device->funcs.p_vkDestroyImage(device->host_device, hack->user_image, NULL); + if (hack->cmd) + device->funcs.p_vkFreeCommandBuffers(device->host_device, swapchain->cmd_pools[hack->cmd_queue_idx], + 1, &hack->cmd); + device->funcs.p_vkDestroySemaphore(device->host_device, hack->blit_finished, NULL); +} + +static VkResult init_fs_hack_images(struct wine_device *device, struct wine_swapchain *swapchain, + const VkSwapchainCreateInfoKHR *createinfo) +{ + VkResult res; + VkImage *real_images = NULL; + VkDeviceSize userMemTotal = 0, offs; + VkImageCreateInfo imageInfo = {0}; + VkSemaphoreCreateInfo semaphoreInfo = {0}; + VkMemoryRequirements userMemReq; + VkMemoryAllocateInfo allocInfo = {0}; + VkPhysicalDeviceMemoryProperties memProperties; + VkImageViewCreateInfo viewInfo = {0}; + uint32_t count, i = 0, user_memory_type = -1; + + res = device->funcs.p_vkGetSwapchainImagesKHR(device->host_device, swapchain->host_swapchain, &count, NULL); + if (res != VK_SUCCESS) + { + WARN("vkGetSwapchainImagesKHR failed, res=%d\n", res); + return res; + } + + real_images = malloc(count * sizeof(VkImage)); + swapchain->cmd_pools = calloc(device->queue_count, sizeof(VkCommandPool)); + swapchain->fs_hack_images = calloc(count, sizeof(struct fs_hack_image)); + if (!real_images || !swapchain->cmd_pools || !swapchain->fs_hack_images) + goto fail; + + res = device->funcs.p_vkGetSwapchainImagesKHR(device->host_device, swapchain->host_swapchain, &count, real_images); + if (res != VK_SUCCESS) + { + WARN("vkGetSwapchainImagesKHR failed, res=%d\n", res); + goto fail; + } + + /* create user images */ + for (i = 0; i < count; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + hack->swapchain_image = real_images[i]; + + semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + res = device->funcs.p_vkCreateSemaphore(device->host_device, &semaphoreInfo, NULL, &hack->blit_finished); + if (res != VK_SUCCESS) + { + WARN("vkCreateSemaphore failed, res=%d\n", res); + goto fail; + } + + imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.width = swapchain->user_extent.width; + imageInfo.extent.height = swapchain->user_extent.height; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = createinfo->imageArrayLayers; + imageInfo.format = createinfo->imageFormat; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imageInfo.usage = createinfo->imageUsage | VK_IMAGE_USAGE_SAMPLED_BIT; + imageInfo.sharingMode = createinfo->imageSharingMode; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.queueFamilyIndexCount = createinfo->queueFamilyIndexCount; + imageInfo.pQueueFamilyIndices = createinfo->pQueueFamilyIndices; + + if (createinfo->flags & VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR) + imageInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT; + else if (createinfo->imageFormat != VK_FORMAT_B8G8R8A8_SRGB) + imageInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; + + res = device->funcs.p_vkCreateImage(device->host_device, &imageInfo, NULL, &hack->user_image); + if (res != VK_SUCCESS) + { + ERR("vkCreateImage failed: %d\n", res); + goto fail; + } + + device->funcs.p_vkGetImageMemoryRequirements(device->host_device, hack->user_image, &userMemReq); + + offs = userMemTotal % userMemReq.alignment; + if (offs) + userMemTotal += userMemReq.alignment - offs; + + userMemTotal += userMemReq.size; + + swapchain->n_images++; + } + + /* allocate backing memory */ + device->phys_dev->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties(device->phys_dev->host_physical_device, &memProperties); + + for (i = 0; i < memProperties.memoryTypeCount; i++) + { + UINT flag = memProperties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + if (flag == VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + { + if (userMemReq.memoryTypeBits & (1 << i)) + { + user_memory_type = i; + break; + } + } + } + + if (user_memory_type == -1) + { + ERR("unable to find suitable memory type\n"); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto fail; + } + + allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; + allocInfo.allocationSize = userMemTotal; + allocInfo.memoryTypeIndex = user_memory_type; + + res = device->funcs.p_vkAllocateMemory(device->host_device, &allocInfo, NULL, &swapchain->user_image_memory); + if (res != VK_SUCCESS) + { + ERR("vkAllocateMemory: %d\n", res); + goto fail; + } + + /* bind backing memory and create imageviews */ + userMemTotal = 0; + for (i = 0; i < count; ++i) + { + device->funcs.p_vkGetImageMemoryRequirements(device->host_device, swapchain->fs_hack_images[i].user_image, &userMemReq); + + offs = userMemTotal % userMemReq.alignment; + if (offs) + userMemTotal += userMemReq.alignment - offs; + + res = device->funcs.p_vkBindImageMemory(device->host_device, swapchain->fs_hack_images[i].user_image, + swapchain->user_image_memory, userMemTotal); + if (res != VK_SUCCESS) + { + ERR("vkBindImageMemory: %d\n", res); + goto fail; + } + + userMemTotal += userMemReq.size; + + viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + viewInfo.image = swapchain->fs_hack_images[i].user_image; + viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + viewInfo.format = VK_FORMAT_B8G8R8A8_SRGB; + viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + viewInfo.subresourceRange.baseMipLevel = 0; + viewInfo.subresourceRange.levelCount = 1; + viewInfo.subresourceRange.baseArrayLayer = 0; + viewInfo.subresourceRange.layerCount = 1; + + res = device->funcs.p_vkCreateImageView(device->host_device, &viewInfo, NULL, + &swapchain->fs_hack_images[i].user_view); + if (res != VK_SUCCESS) + { + ERR("vkCreateImageView(user): %d\n", res); + goto fail; + } + } + + free(real_images); + + return VK_SUCCESS; + +fail: + for (i = 0; i < swapchain->n_images; ++i) destroy_fs_hack_image(device, swapchain, &swapchain->fs_hack_images[i]); + free(real_images); + free(swapchain->cmd_pools); + free(swapchain->fs_hack_images); + return res; +} + +VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCreateInfoKHR *info, const VkAllocationCallbacks *allocator, + VkSwapchainKHR *swapchain) +{ + struct wine_device *device = wine_device_from_handle(device_handle); + VkSwapchainCreateInfoKHR create_info_host = *info; + struct wine_swapchain *object; + VkExtent2D user_sz; + VkResult res; + + if (!(object = calloc(1, sizeof(*object)))) + { + ERR("Failed to allocate memory for swapchain\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + if (create_info_host.surface) + create_info_host.surface = wine_surface_from_handle(create_info_host.surface)->driver_surface; + if (create_info_host.oldSwapchain) + create_info_host.oldSwapchain = wine_swapchain_from_handle(create_info_host.oldSwapchain)->host_swapchain; + + if (vk_funcs->query_fs_hack && + vk_funcs->query_fs_hack(create_info_host.surface, &object->real_extent, &user_sz, + &object->blit_dst, &object->fs_hack_filter) && + create_info_host.imageExtent.width == user_sz.width && + create_info_host.imageExtent.height == user_sz.height) + { + uint32_t count; + VkSurfaceCapabilitiesKHR caps = {0}; + + device->phys_dev->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties(device->phys_dev->host_physical_device, &count, NULL); + + device->queue_props = malloc(sizeof(VkQueueFamilyProperties) * count); + + device->phys_dev->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties(device->phys_dev->host_physical_device, &count, device->queue_props); + + res = device->phys_dev->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(device->phys_dev->host_physical_device, create_info_host.surface, &caps); + if (res != VK_SUCCESS) + { + TRACE("vkGetPhysicalDeviceSurfaceCapabilities failed, res=%d\n", res); + free(object); + return res; + } + + if (!(caps.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT)) + FIXME("Swapchain does not support required VK_IMAGE_USAGE_STORAGE_BIT\n"); + + create_info_host.imageExtent = object->real_extent; + create_info_host.imageFormat = VK_FORMAT_B8G8R8A8_UNORM; + create_info_host.imageUsage = VK_IMAGE_USAGE_STORAGE_BIT; + + if (info->imageFormat != VK_FORMAT_B8G8R8A8_UNORM && info->imageFormat != VK_FORMAT_B8G8R8A8_SRGB) + FIXME("swapchain image format is not BGRA8 UNORM/SRGB. Things may go badly. %d\n", create_info_host.imageFormat); + + object->fs_hack_enabled = TRUE; + } + + res = device->funcs.p_vkCreateSwapchainKHR(device->host_device, &create_info_host, NULL, &object->host_swapchain); + + if (res != VK_SUCCESS) + { + free(object); + return res; + } + + if (object->fs_hack_enabled) + { + object->user_extent = info->imageExtent; + + res = init_fs_hack_images(device, object, info); + if (res != VK_SUCCESS) + { + ERR("creating fs hack images failed: %d\n", res); + device->funcs.p_vkDestroySwapchainKHR(device->host_device, object->host_swapchain, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, object); + free(object); + return res; + } + + res = init_blit_images(device, object); + if (res != VK_SUCCESS) + { + ERR("creating blit images failed: %d\n", res); + device->funcs.p_vkDestroySwapchainKHR(device->host_device, object->host_swapchain, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, object); + free(object); + return res; + } + } + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, object, object->host_swapchain, object); + *swapchain = wine_swapchain_to_handle(object); + + return res; +} + +VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *create_info, + const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + struct wine_surface *object; + VkResult res; + + if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) return VK_ERROR_OUT_OF_HOST_MEMORY; + object->hwnd = create_info->hwnd; + + res = instance->funcs.p_vkCreateWin32SurfaceKHR(instance->host_instance, create_info, + NULL /* allocator */, &object->driver_surface); + if (res != VK_SUCCESS) + { + free(object); + return res; + } + + object->host_surface = vk_funcs->p_wine_get_host_surface(object->driver_surface); + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_surface, object); + + *surface = wine_surface_to_handle(object); + + return VK_SUCCESS; +} + +void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface, + const VkAllocationCallbacks *allocator) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + struct wine_surface *object = wine_surface_from_handle(surface); + + if (!object) + return; + + instance->funcs.p_vkDestroySurfaceKHR(instance->host_instance, object->driver_surface, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); + + free(object); +} + +#define IOCTL_SHARED_GPU_RESOURCE_CREATE CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_create +{ + UINT64 resource_size; + obj_handle_t unix_handle; + WCHAR name[1]; +}; + +static HANDLE create_gpu_resource(int fd, LPCWSTR name, UINT64 resource_size) +{ + static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; + HANDLE unix_resource = INVALID_HANDLE_VALUE; + struct shared_resource_create *inbuff; + UNICODE_STRING shared_gpu_resource_us; + HANDLE shared_resource; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + DWORD in_size; + + TRACE("Creating shared vulkan resource fd %d name %s.\n", fd, debugstr_w(name)); + + if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &unix_resource) != STATUS_SUCCESS) + return INVALID_HANDLE_VALUE; + + init_unicode_string(&shared_gpu_resource_us, shared_gpu_resourceW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = 0; + attr.ObjectName = &shared_gpu_resource_us; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if ((status = NtCreateFile(&shared_resource, GENERIC_READ | GENERIC_WRITE, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0))) + { + ERR("Failed to load open a shared resource handle, status %#lx.\n", (long int)status); + NtClose(unix_resource); + return INVALID_HANDLE_VALUE; + } + + in_size = sizeof(*inbuff) + (name ? lstrlenW(name) * sizeof(WCHAR) : 0); + inbuff = calloc(1, in_size); + inbuff->unix_handle = wine_server_obj_handle(unix_resource); + inbuff->resource_size = resource_size; + if (name) + lstrcpyW(&inbuff->name[0], name); + + if ((status = NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_CREATE, + inbuff, in_size, NULL, 0))) + + free(inbuff); + NtClose(unix_resource); + + if (status) + { + ERR("Failed to create video resource, status %#lx.\n", (long int)status); + NtClose(shared_resource); + return INVALID_HANDLE_VALUE; + } + + return shared_resource; +} + +#define IOCTL_SHARED_GPU_RESOURCE_OPEN CTL_CODE(FILE_DEVICE_VIDEO, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_open +{ + obj_handle_t kmt_handle; + WCHAR name[1]; +}; + +struct shared_resource_info +{ + UINT64 resource_size; +}; + +static HANDLE open_shared_resource(HANDLE kmt_handle, LPCWSTR name) +{ + static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; + UNICODE_STRING shared_gpu_resource_us; + struct shared_resource_open *inbuff; + HANDLE shared_resource; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + DWORD in_size; + + init_unicode_string(&shared_gpu_resource_us, shared_gpu_resourceW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = 0; + attr.ObjectName = &shared_gpu_resource_us; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if ((status = NtCreateFile(&shared_resource, GENERIC_READ | GENERIC_WRITE, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0))) + { + ERR("Failed to load open a shared resource handle, status %#lx.\n", (long int)status); + return INVALID_HANDLE_VALUE; + } + + in_size = sizeof(*inbuff) + (name ? lstrlenW(name) * sizeof(WCHAR) : 0); + inbuff = calloc(1, in_size); + inbuff->kmt_handle = wine_server_obj_handle(kmt_handle); + if (name) + lstrcpyW(&inbuff->name[0], name); + + status = NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_OPEN, + inbuff, in_size, NULL, 0); + + free(inbuff); + + if (status) + { + ERR("Failed to open video resource, status %#lx.\n", (long int)status); + NtClose(shared_resource); + return INVALID_HANDLE_VALUE; + } + + return shared_resource; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_INFO CTL_CODE(FILE_DEVICE_VIDEO, 7, METHOD_BUFFERED, FILE_READ_ACCESS) + +static BOOL shared_resource_get_info(HANDLE handle, struct shared_resource_info *info) +{ + IO_STATUS_BLOCK iosb; + unsigned int status; + + status = NtDeviceIoControlFile(handle, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_INFO, + NULL, 0, info, sizeof(*info)); + if (status) + ERR("Failed to get shared resource info, status %#x.\n", status); + + return !status; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_READ_ACCESS) + +static int get_shared_resource_fd(HANDLE shared_resource) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t unix_resource; + NTSTATUS status; + int ret; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE, + NULL, 0, &unix_resource, sizeof(unix_resource))) + return -1; + + status = wine_server_handle_to_fd(wine_server_ptr_handle(unix_resource), FILE_READ_DATA, &ret, NULL); + NtClose(wine_server_ptr_handle(unix_resource)); + return status == STATUS_SUCCESS ? ret : -1; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GETKMT CTL_CODE(FILE_DEVICE_VIDEO, 2, METHOD_BUFFERED, FILE_READ_ACCESS) + +static HANDLE get_shared_resource_kmt_handle(HANDLE shared_resource) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t kmt_handle; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GETKMT, + NULL, 0, &kmt_handle, sizeof(kmt_handle))) + return INVALID_HANDLE_VALUE; + + return wine_server_ptr_handle(kmt_handle); +} + +static bool set_shared_resource_object(HANDLE shared_resource, unsigned int index, HANDLE handle); +static HANDLE get_shared_resource_object(HANDLE shared_resource, unsigned int index); + +static void destroy_keyed_mutex(struct wine_device *device, struct wine_device_memory *memory) +{ + if (memory->keyed_mutex_shm) + { + NtUnmapViewOfSection(GetCurrentProcess(), memory->keyed_mutex_shm); + memory->keyed_mutex_shm = NULL; + } + if (memory->keyed_mutex_sem) + { + device->funcs.p_vkDestroySemaphore(device->host_device, memory->keyed_mutex_sem, NULL); + memory->keyed_mutex_sem = VK_NULL_HANDLE; + } +} + +static void create_keyed_mutex(struct wine_device *device, struct wine_device_memory *memory) +{ + VkExportSemaphoreCreateInfo timeline_export_info; + VkSemaphoreTypeCreateInfo type_info; + VkSemaphoreCreateInfo create_info; + VkSemaphoreGetFdInfoKHR fd_info; + pthread_mutexattr_t mutex_attr; + OBJECT_ATTRIBUTES attr; + HANDLE section_handle; + LARGE_INTEGER li; + HANDLE handle; + SIZE_T size; + VkResult vr; + int fd; + + InitializeObjectAttributes(&attr, NULL, 0, NULL, NULL); + size = li.QuadPart = sizeof(*memory->keyed_mutex_shm); + if (NtCreateSection(§ion_handle, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE, &attr, &li, PAGE_READWRITE, SEC_COMMIT, NULL)) + { + ERR("NtCreateSection failed.\n"); + return; + } + + if (!set_shared_resource_object(memory->handle, 0, section_handle)) + { + NtClose(section_handle); + ERR("set_shared_resource_object failed.\n"); + return; + } + + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &memory->keyed_mutex_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) + { + NtClose(section_handle); + ERR("NtMapViewOfSection failed.\n"); + return; + } + + NtClose(section_handle); + + timeline_export_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; + timeline_export_info.pNext = NULL; + timeline_export_info.handleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = &timeline_export_info; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; + + if ((vr = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info, NULL, &memory->keyed_mutex_sem)) != VK_SUCCESS) + { + ERR("Failed to create semaphore, vr %d.\n", vr); + goto error; + } + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = memory->keyed_mutex_sem; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((vr = device->funcs.p_vkGetSemaphoreFdKHR(device->host_device, &fd_info, &fd)) != VK_SUCCESS) + { + ERR("Failed to export semaphore fd, vr %d.\n", vr); + goto error; + } + if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &handle) != STATUS_SUCCESS) + { + ERR("wine_server_fd_to_handle failed.\n"); + close(fd); + goto error; + } + close(fd); + if (!set_shared_resource_object(memory->handle, 1, handle)) + { + ERR("set_shared_resource_object failed.\n"); + NtClose(handle); + goto error; + } + NtClose(handle); + + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED); + if (pthread_mutex_init(&memory->keyed_mutex_shm->mutex, &mutex_attr)) + memory->keyed_mutex_shm->instance_id_counter = 1; + memory->keyed_mutex_instance_id = ++memory->keyed_mutex_shm->instance_id_counter; + TRACE("memory %p, created keyed mutex.\n", memory); + return; + +error: + destroy_keyed_mutex(device, memory); +} + +static void import_keyed_mutex(struct wine_device *device, struct wine_device_memory *memory) +{ + VkSemaphoreTypeCreateInfo type_info; + VkImportSemaphoreFdInfoKHR fd_info; + VkSemaphoreCreateInfo create_info; + HANDLE section_handle, sem_handle; + SIZE_T size; + + VkResult vr; + + if (!(section_handle = get_shared_resource_object(memory->handle, 0))) + { + TRACE("No section handle.\n"); + return; + } + if (!(sem_handle = get_shared_resource_object(memory->handle, 1))) + { + ERR("No smeaphore handle.\n"); + NtClose(section_handle); + return; + } + + size = sizeof(*memory->keyed_mutex_shm); + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &memory->keyed_mutex_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) + { + ERR("NtMapViewOfSection failed.\n"); + goto error; + } + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = NULL; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; + + if ((vr = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info, NULL, &memory->keyed_mutex_sem)) != VK_SUCCESS) + { + ERR("Failed to create semaphore, vr %d.\n", vr); + goto error; + } + + fd_info.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = memory->keyed_mutex_sem; + fd_info.flags = 0; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if (wine_server_handle_to_fd(sem_handle, FILE_READ_DATA, &fd_info.fd, NULL)) + { + ERR("wine_server_handle_to_fd failed.\n"); + goto error; + } + + vr = device->funcs.p_vkImportSemaphoreFdKHR(device->host_device, &fd_info); + close(fd_info.fd); + if (vr != VK_SUCCESS) + { + ERR("vkImportSemaphoreFdKHR failed, vr %d.\n", vr); + goto error; + } + + memory->keyed_mutex_instance_id = InterlockedIncrement64((LONGLONG *)&memory->keyed_mutex_shm->instance_id_counter); + TRACE("memory %p, imported keyed mutex.\n", memory); + return; +error: + NtClose(section_handle); + NtClose(sem_handle); + destroy_keyed_mutex(device, memory); +} + +static VkResult acquire_keyed_mutex(struct wine_device *device, struct wine_device_memory *memory, uint64_t key, + uint32_t timeout_ms) +{ + ULONG end_wait, curr_tick, remaining_wait; + VkSemaphoreWaitInfo wait_info = { 0 }; + uint64_t timeline; + VkResult vr; + + if (!memory->keyed_mutex_shm) + return VK_ERROR_UNKNOWN; + + wait_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO; + wait_info.semaphoreCount = 1; + wait_info.pSemaphores = &memory->keyed_mutex_sem; + wait_info.pValues = &timeline; + + end_wait = NtGetTickCount() + timeout_ms; + + while (1) + { + pthread_mutex_lock(&memory->keyed_mutex_shm->mutex); + + if (memory->keyed_mutex_shm->acquired_to_instance) + { + if ((vr = get_semaphore_value(device, memory->keyed_mutex_sem, &timeline)) != VK_SUCCESS) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + assert(timeline == memory->keyed_mutex_shm->timeline_value + || timeline == memory->keyed_mutex_shm->timeline_value + 1); + if (timeline == memory->keyed_mutex_shm->timeline_value + 1) + { + /* released from queue. */ + assert(memory->keyed_mutex_shm->timeline_queued_release == timeline); + memory->keyed_mutex_shm->timeline_queued_release = 0; + ++memory->keyed_mutex_shm->timeline_value; + memory->keyed_mutex_shm->acquired_to_instance = 0; + } + } + + if (memory->keyed_mutex_shm->acquired_to_instance == memory->keyed_mutex_instance_id + && !memory->keyed_mutex_shm->timeline_queued_release) + { + /* Already acquired to this device. */ + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + if (!memory->keyed_mutex_shm->acquired_to_instance && memory->keyed_mutex_shm->key == key) + { + /* Can acquire. */ + memory->keyed_mutex_shm->acquired_to_instance = memory->keyed_mutex_instance_id; + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_SUCCESS; + } + curr_tick = NtGetTickCount(); + if (!timeout_ms || curr_tick >= end_wait) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_TIMEOUT; + } + remaining_wait = timeout_ms == INFINITE ? INFINITE : end_wait - curr_tick; + timeline = memory->keyed_mutex_shm->timeline_value + 1; + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + + vr = wait_semaphores(device, &wait_info, remaining_wait * 1000000ull); + if (vr != VK_SUCCESS && vr != VK_TIMEOUT) + { + ERR("vkWaitSemaphores failed, vr %d.\n", vr); + return VK_ERROR_UNKNOWN; + } + } +} + +static VkResult release_keyed_mutex(struct wine_device *device, struct wine_device_memory *memory, uint64_t key, + uint64_t *timeline_value) +{ + if (!memory->keyed_mutex_shm) + return VK_ERROR_UNKNOWN; + + pthread_mutex_lock(&memory->keyed_mutex_shm->mutex); + if (memory->keyed_mutex_shm->acquired_to_instance != memory->keyed_mutex_instance_id + || memory->keyed_mutex_shm->timeline_queued_release) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + memory->keyed_mutex_shm->key = key; + if (timeline_value) + { + /* Return timeline value to signal from queue. */ + *timeline_value = memory->keyed_mutex_shm->timeline_value + 1; + memory->keyed_mutex_shm->timeline_queued_release = *timeline_value; + } + else + { + /* Release immediately. */ + memory->keyed_mutex_shm->acquired_to_instance = 0; + signal_timeline_sem(device, memory->keyed_mutex_sem, &memory->keyed_mutex_shm->timeline_value); + } + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + + return VK_SUCCESS; +} + +VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *alloc_info, + const VkAllocationCallbacks *allocator, VkDeviceMemory *ret, + void *win_pAllocateInfo) +{ + struct wine_device *device = wine_device_from_handle(handle); + const VkMemoryAllocateInfo *win_alloc_info = win_pAllocateInfo; + struct wine_device_memory *memory; + VkMemoryAllocateInfo info = *alloc_info; + VkImportMemoryHostPointerInfoEXT host_pointer_info; + uint32_t mem_flags; + void *mapping = NULL; + VkResult result; + + const VkImportMemoryWin32HandleInfoKHR *handle_import_info; + const VkExportMemoryWin32HandleInfoKHR *handle_export_info; + VkExportMemoryAllocateInfo *export_info; + VkImportMemoryFdInfoKHR fd_import_info; + VkMemoryGetFdInfoKHR get_fd_info; + int fd; + + if (!(memory = calloc(sizeof(*memory), 1))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + memory->handle = INVALID_HANDLE_VALUE; + fd_import_info.fd = -1; + fd_import_info.pNext = NULL; + + /* find and process handle import/export info and grab it */ + handle_import_info = wine_vk_find_struct(win_alloc_info, IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + handle_export_info = wine_vk_find_struct(win_alloc_info, EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + if (handle_export_info && handle_export_info->pAttributes && handle_export_info->pAttributes->lpSecurityDescriptor) + FIXME("Support for custom security descriptor not implemented.\n"); + + if ((export_info = wine_vk_find_struct(alloc_info, EXPORT_MEMORY_ALLOCATE_INFO))) + { + memory->handle_types = export_info->handleTypes; + if (export_info->handleTypes & wine_vk_handle_over_fd_types) + export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&export_info->handleTypes); + } + + mem_flags = device->phys_dev->memory_properties.memoryTypes[alloc_info->memoryTypeIndex].propertyFlags; + + /* Vulkan consumes imported FDs, but not imported HANDLEs */ + if (handle_import_info) + { + struct shared_resource_info res_info; + + fd_import_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; + fd_import_info.pNext = info.pNext; + fd_import_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + info.pNext = &fd_import_info; + + TRACE("import handle type %#x.\n", handle_import_info->handleType); + + switch (handle_import_info->handleType) + { + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT: + if (handle_import_info->handle) + NtDuplicateObject( NtCurrentProcess(), handle_import_info->handle, NtCurrentProcess(), &memory->handle, 0, 0, DUPLICATE_SAME_ACCESS ); + else if (handle_import_info->name) + memory->handle = open_shared_resource( 0, handle_import_info->name ); + break; + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT: + /* FIXME: the spec says that device memory imported from a KMT handle doesn't keep a reference to the underyling payload. + This means that in cases where on windows an application leaks VkDeviceMemory objects, we leak the full payload. To + fix this, we would need wine_dev_mem objects to store no reference to the payload, that means no host VkDeviceMemory + object (as objects imported from FDs hold a reference to the payload), and no win32 handle to the object. We would then + extend make_vulkan to have the thunks converting wine_dev_mem to native handles open the VkDeviceMemory from the KMT + handle, use it in the host function, then close it again. */ + memory->handle = open_shared_resource( handle_import_info->handle, NULL ); + break; + default: + WARN("Invalid handle type %08x passed in.\n", handle_import_info->handleType); + result = VK_ERROR_INVALID_EXTERNAL_HANDLE; + goto done; + } + + if (memory->handle != INVALID_HANDLE_VALUE) + fd_import_info.fd = get_shared_resource_fd(memory->handle); + + if (fd_import_info.fd == -1) + { + TRACE("Couldn't access resource handle or name. type=%08x handle=%p name=%s\n", handle_import_info->handleType, handle_import_info->handle, + handle_import_info->name ? debugstr_w(handle_import_info->name) : ""); + result = VK_ERROR_INVALID_EXTERNAL_HANDLE; + goto done; + } + + /* From VkMemoryAllocateInfo spec: "if the parameters define an import operation and the external handle type is + * VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + * or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, allocationSize is ignored.". Although test suggests + * that it is also true for opaque Win32 handles. */ + if (shared_resource_get_info(memory->handle, &res_info)) + { + if (res_info.resource_size) + { + TRACE("Shared resource size %llu.\n", (long long)res_info.resource_size); + if (info.allocationSize && info.allocationSize != res_info.resource_size) + FIXME("Shared resource allocationSize %llu, resource_size %llu.\n", + (long long)info.allocationSize, (long long)res_info.resource_size); + info.allocationSize = res_info.resource_size; + } + else + { + ERR("Zero shared resource size.\n"); + } + } + if (device->keyed_mutexes_enabled) + import_keyed_mutex(device, memory); + } + else if (device->phys_dev->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && + !find_next_struct(alloc_info->pNext, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)) + { + /* For host visible memory, we try to use VK_EXT_external_memory_host on wow64 + * to ensure that mapped pointer is 32-bit. */ + VkMemoryHostPointerPropertiesEXT props = + { + .sType = VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, + }; + uint32_t i, align = device->phys_dev->external_memory_align - 1; + SIZE_T alloc_size = info.allocationSize; + static int once; + + if (!once++) + FIXME("Using VK_EXT_external_memory_host\n"); + + if (NtAllocateVirtualMemory(GetCurrentProcess(), &mapping, zero_bits, &alloc_size, + MEM_COMMIT, PAGE_READWRITE)) + { + ERR("NtAllocateVirtualMemory failed\n"); + free(memory); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + result = device->funcs.p_vkGetMemoryHostPointerPropertiesEXT(device->host_device, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, mapping, &props); + if (result != VK_SUCCESS) + { + ERR("vkGetMemoryHostPointerPropertiesEXT failed: %d\n", result); + free(memory); + return result; + } + + if (!(props.memoryTypeBits & (1u << info.memoryTypeIndex))) + { + /* If requested memory type is not allowed to use external memory, + * try to find a supported compatible type. */ + uint32_t mask = mem_flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + for (i = 0; i < device->phys_dev->memory_properties.memoryTypeCount; i++) + { + if (!(props.memoryTypeBits & (1u << i))) + continue; + if ((device->phys_dev->memory_properties.memoryTypes[i].propertyFlags & mask) != mask) + continue; + + TRACE("Memory type not compatible with host memory, using %u instead\n", i); + info.memoryTypeIndex = i; + break; + } + if (i == device->phys_dev->memory_properties.memoryTypeCount) + { + FIXME("Not found compatible memory type\n"); + alloc_size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), &mapping, &alloc_size, MEM_RELEASE); + } + } + + if (props.memoryTypeBits & (1u << info.memoryTypeIndex)) + { + host_pointer_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; + host_pointer_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; + host_pointer_info.pHostPointer = mapping; + host_pointer_info.pNext = info.pNext; + info.pNext = &host_pointer_info; + + info.allocationSize = (info.allocationSize + align) & ~align; + } + } + + set_memory_being_allocated(device->phys_dev->instance, memory); + result = device->funcs.p_vkAllocateMemory(device->host_device, &info, NULL, &memory->host_memory); + set_memory_being_allocated(device->phys_dev->instance, NULL); + + if (result == VK_SUCCESS && memory->handle == INVALID_HANDLE_VALUE && export_info && export_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + { + get_fd_info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR; + get_fd_info.pNext = NULL; + get_fd_info.memory = memory->host_memory; + get_fd_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + + if (device->funcs.p_vkGetMemoryFdKHR(device->host_device, &get_fd_info, &fd) == VK_SUCCESS) + { + memory->handle = create_gpu_resource(fd, handle_export_info ? handle_export_info->name : NULL, alloc_info->allocationSize); + memory->access = handle_export_info ? handle_export_info->dwAccess : GENERIC_ALL; + if (handle_export_info && handle_export_info->pAttributes) + memory->inherit = handle_export_info->pAttributes->bInheritHandle; + else + memory->inherit = FALSE; + close(fd); + if (device->keyed_mutexes_enabled) + create_keyed_mutex(device, memory); + } + + if (memory->handle == INVALID_HANDLE_VALUE) + { + device->funcs.p_vkFreeMemory(device->host_device, memory->host_memory, NULL); + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + } +done: + if (result != VK_SUCCESS) + { + if (fd_import_info.fd != -1) + close(fd_import_info.fd); + if (memory->handle != INVALID_HANDLE_VALUE) + NtClose(memory->handle); + free(memory); + return result; + } + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, memory, memory->host_memory, memory); + memory->vm_map = mapping; + *ret = wine_device_memory_to_handle(memory); + return VK_SUCCESS; +} + +void wine_vkFreeMemory(VkDevice handle, VkDeviceMemory memory_handle, const VkAllocationCallbacks *allocator) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory; + + if (!memory_handle) + return; + memory = wine_device_memory_from_handle(memory_handle); + + destroy_keyed_mutex(device, memory); + device->funcs.p_vkFreeMemory(device->host_device, memory->host_memory, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, memory); + + if (memory->vm_map) + { + SIZE_T alloc_size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), &memory->vm_map, &alloc_size, MEM_RELEASE); + } + + if (memory->handle != INVALID_HANDLE_VALUE) + NtClose(memory->handle); + + free(memory); +} + +VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, + VkDeviceSize size, VkMemoryMapFlags flags, void **data) +{ + const VkMemoryMapInfoKHR info = + { + .sType = VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR, + .flags = flags, + .memory = memory, + .offset = offset, + .size = size, + }; + + return wine_vkMapMemory2KHR(device, &info, data); +} + +VkResult wine_vkMapMemory2KHR(VkDevice handle, const VkMemoryMapInfoKHR *map_info, void **data) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory = wine_device_memory_from_handle(map_info->memory); + VkMemoryMapInfoKHR info = *map_info; + VkResult result; + + info.memory = memory->host_memory; + if (memory->vm_map) + { + *data = (char *)memory->vm_map + info.offset; + TRACE("returning %p\n", *data); + return VK_SUCCESS; + } + + if (device->funcs.p_vkMapMemory2KHR) + { + result = device->funcs.p_vkMapMemory2KHR(device->host_device, &info, data); + } + else + { + assert(!info.pNext); + result = device->funcs.p_vkMapMemory(device->host_device, info.memory, info.offset, + info.size, info.flags, data); + } + +#ifdef _WIN64 + if (NtCurrentTeb()->WowTebOffset && result == VK_SUCCESS && (UINT_PTR)*data >> 32) + { + FIXME("returned mapping %p does not fit 32-bit pointer\n", *data); + device->funcs.p_vkUnmapMemory(device->host_device, memory->host_memory); + *data = NULL; + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } +#endif + + return result; +} + +void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) +{ + const VkMemoryUnmapInfoKHR info = + { + .sType = VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR, + .memory = memory, + }; + + wine_vkUnmapMemory2KHR(device, &info); +} + +VkResult wine_vkUnmapMemory2KHR(VkDevice handle, const VkMemoryUnmapInfoKHR *unmap_info) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory = wine_device_memory_from_handle(unmap_info->memory); + VkMemoryUnmapInfoKHR info; + + if (memory->vm_map) + return VK_SUCCESS; + + if (!device->funcs.p_vkUnmapMemory2KHR) + { + assert(!unmap_info->pNext); + device->funcs.p_vkUnmapMemory(device->host_device, memory->host_memory); + return VK_SUCCESS; + } + + info = *unmap_info; + info.memory = memory->host_memory; + return device->funcs.p_vkUnmapMemory2KHR(device->host_device, &info); +} + +VkResult wine_vkCreateBuffer(VkDevice handle, const VkBufferCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkBuffer *buffer) +{ + struct wine_device *device = wine_device_from_handle(handle); + VkExternalMemoryBufferCreateInfo external_memory_info, *ext_info; + VkBufferCreateInfo info = *create_info; + + if ((ext_info = wine_vk_find_struct(create_info, EXTERNAL_MEMORY_BUFFER_CREATE_INFO))) + { + if (ext_info->handleTypes & wine_vk_handle_over_fd_types) + ext_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&ext_info->handleTypes); + } + else if (device->phys_dev->external_memory_align && + !find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO)) + { + external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO; + external_memory_info.pNext = info.pNext; + external_memory_info.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; + info.pNext = &external_memory_info; + } + + return device->funcs.p_vkCreateBuffer(device->host_device, &info, NULL, buffer); +} + +VkResult wine_vkCreateImage(VkDevice handle, const VkImageCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkImage *image) +{ + struct wine_device *device = wine_device_from_handle(handle); + VkExternalMemoryImageCreateInfo external_memory_info, *update_info; + VkImageCreateInfo info = *create_info; + + if ((update_info = find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO))) + { + if (update_info->handleTypes & wine_vk_handle_over_fd_types) + update_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; + wine_vk_normalize_handle_types_host(&update_info->handleTypes); + } + else if (device->phys_dev->external_memory_align) + { + external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; + external_memory_info.pNext = info.pNext; + external_memory_info.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; + info.pNext = &external_memory_info; + } + + return device->funcs.p_vkCreateImage(device->host_device, &info, NULL, image); +} + +static inline void adjust_max_image_count(struct wine_phys_dev *phys_dev, VkSurfaceCapabilitiesKHR* capabilities) +{ + /* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile + * and World War Z, do not expect that maxImageCount can be set to 0. + * A value of 0 means that there is no limit on the number of images. + * Nvidia reports 8 on Windows, AMD 16. + * https://vulkan.gpuinfo.org/displayreport.php?id=9122#surface + * https://vulkan.gpuinfo.org/displayreport.php?id=9121#surface + */ + if ((phys_dev->instance->quirks & WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT) && !capabilities->maxImageCount) + { + capabilities->maxImageCount = max(capabilities->minImageCount, 16); + } +} + +VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice handle, VkSurfaceKHR surface_handle, + VkSurfaceCapabilitiesKHR *capabilities) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); + struct wine_surface *surface = wine_surface_from_handle(surface_handle); + VkResult res; + VkExtent2D user_res; + + res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev->host_physical_device, + surface->driver_surface, capabilities); + + if (res == VK_SUCCESS) + adjust_max_image_count(phys_dev, capabilities); + + if (res == VK_SUCCESS && vk_funcs->query_fs_hack && + vk_funcs->query_fs_hack(surface->driver_surface, NULL, &user_res, NULL, NULL)) + { + capabilities->currentExtent = user_res; + capabilities->minImageExtent = user_res; + capabilities->maxImageExtent = user_res; + } + + return res; +} + +VkResult wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice handle, + const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, + VkSurfaceCapabilities2KHR *capabilities) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); + struct wine_surface *surface = wine_surface_from_handle(surface_info->surface); + VkPhysicalDeviceSurfaceInfo2KHR host_info; + VkResult res; + VkExtent2D user_res; + + host_info.sType = surface_info->sType; + host_info.pNext = surface_info->pNext; + host_info.surface = surface->driver_surface; + res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev->host_physical_device, + &host_info, capabilities); + + if (res == VK_SUCCESS) + adjust_max_image_count(phys_dev, &capabilities->surfaceCapabilities); + + if (res == VK_SUCCESS && vk_funcs->query_fs_hack && + vk_funcs->query_fs_hack(wine_surface_from_handle(surface_info->surface)->driver_surface, NULL, &user_res, NULL, NULL)) + { + capabilities->surfaceCapabilities.currentExtent = user_res; + capabilities->surfaceCapabilities.minImageExtent = user_res; + capabilities->surfaceCapabilities.maxImageExtent = user_res; + } + + return res; +} + +VkResult wine_vkCreateDebugUtilsMessengerEXT(VkInstance handle, + const VkDebugUtilsMessengerCreateInfoEXT *create_info, + const VkAllocationCallbacks *allocator, + VkDebugUtilsMessengerEXT *messenger) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + VkDebugUtilsMessengerCreateInfoEXT wine_create_info; + struct wine_debug_utils_messenger *object; + VkResult res; + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + object->instance = instance; + object->user_callback = create_info->pfnUserCallback; + object->user_data = create_info->pUserData; + + wine_create_info = *create_info; + + wine_create_info.pfnUserCallback = (void *) &debug_utils_callback_conversion; + wine_create_info.pUserData = object; + + res = instance->funcs.p_vkCreateDebugUtilsMessengerEXT(instance->host_instance, &wine_create_info, + NULL, &object->host_debug_messenger); + if (res != VK_SUCCESS) + { + free(object); + return res; + } + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_debug_messenger, object); + *messenger = wine_debug_utils_messenger_to_handle(object); + + return VK_SUCCESS; +} + +void wine_vkDestroyDebugUtilsMessengerEXT(VkInstance handle, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *allocator) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + struct wine_debug_utils_messenger *object; + + object = wine_debug_utils_messenger_from_handle(messenger); + + if (!object) + return; + + instance->funcs.p_vkDestroyDebugUtilsMessengerEXT(instance->host_instance, object->host_debug_messenger, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); + + free(object); +} + +VkResult wine_vkCreateDebugReportCallbackEXT(VkInstance handle, + const VkDebugReportCallbackCreateInfoEXT *create_info, + const VkAllocationCallbacks *allocator, + VkDebugReportCallbackEXT *callback) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + VkDebugReportCallbackCreateInfoEXT wine_create_info; + struct wine_debug_report_callback *object; + VkResult res; + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + object->instance = instance; + object->user_callback = create_info->pfnCallback; + object->user_data = create_info->pUserData; + + wine_create_info = *create_info; + + wine_create_info.pfnCallback = (void *) debug_report_callback_conversion; + wine_create_info.pUserData = object; + + res = instance->funcs.p_vkCreateDebugReportCallbackEXT(instance->host_instance, &wine_create_info, + NULL, &object->host_debug_callback); + if (res != VK_SUCCESS) + { + free(object); + return res; + } + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_debug_callback, object); + *callback = wine_debug_report_callback_to_handle(object); + + return VK_SUCCESS; +} + +void wine_vkDestroyDebugReportCallbackEXT(VkInstance handle, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *allocator) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + struct wine_debug_report_callback *object; + + object = wine_debug_report_callback_from_handle(callback); + + if (!object) + return; + + instance->funcs.p_vkDestroyDebugReportCallbackEXT(instance->host_instance, object->host_debug_callback, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); + + free(object); +} + +void wine_vkDestroySwapchainKHR(VkDevice device_handle, VkSwapchainKHR handle, const VkAllocationCallbacks *allocator) +{ + struct wine_device *device = wine_device_from_handle(device_handle); + struct wine_swapchain *swapchain; + uint32_t i; + + if (!handle) + return; + + swapchain = wine_swapchain_from_handle(handle); + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (swapchain->fs_hack_enabled) + { + for (i = 0; i < swapchain->n_images; ++i) destroy_fs_hack_image(device, swapchain, &swapchain->fs_hack_images[i]); + + for (i = 0; i < device->queue_count; ++i) + if (swapchain->cmd_pools[i]) + device->funcs.p_vkDestroyCommandPool(device->host_device, swapchain->cmd_pools[i], NULL); + + device->funcs.p_vkDestroyPipeline(device->host_device, swapchain->pipeline, NULL); + device->funcs.p_vkDestroyPipelineLayout(device->host_device, swapchain->pipeline_layout, NULL); + device->funcs.p_vkDestroyDescriptorSetLayout(device->host_device, swapchain->descriptor_set_layout, NULL); + device->funcs.p_vkDestroyDescriptorPool(device->host_device, swapchain->descriptor_pool, NULL); + device->funcs.p_vkDestroySampler(device->host_device, swapchain->sampler, NULL); + device->funcs.p_vkFreeMemory(device->host_device, swapchain->user_image_memory, NULL); + free(swapchain->cmd_pools); + free(swapchain->fs_hack_images); + } + + + device->funcs.p_vkDestroySwapchainKHR(device->host_device, swapchain->host_swapchain, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, swapchain); + free(swapchain); +} + +VkResult wine_vkGetSwapchainImagesKHR(VkDevice device_handle, VkSwapchainKHR handle, + uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) +{ + struct wine_device *device = wine_device_from_handle(device_handle); + struct wine_swapchain *swapchain = wine_swapchain_from_handle(handle); + uint32_t i; + + if (pSwapchainImages && swapchain->fs_hack_enabled) + { + if (*pSwapchainImageCount > swapchain->n_images) + *pSwapchainImageCount = swapchain->n_images; + for (i = 0; i < *pSwapchainImageCount; ++i) pSwapchainImages[i] = swapchain->fs_hack_images[i].user_image; + return *pSwapchainImageCount == swapchain->n_images ? VK_SUCCESS : VK_INCOMPLETE; + } + + return device->funcs.p_vkGetSwapchainImagesKHR(device->host_device, swapchain->host_swapchain, + pSwapchainImageCount, pSwapchainImages); +} + +static VkCommandBuffer create_hack_cmd(struct wine_queue *queue, struct wine_swapchain *swapchain, uint32_t queue_idx) +{ + VkCommandBufferAllocateInfo allocInfo = {0}; + VkCommandBuffer cmd; + VkResult result; + + if (!swapchain->cmd_pools[queue_idx]) + { + VkCommandPoolCreateInfo poolInfo = {0}; + + poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; + poolInfo.queueFamilyIndex = queue_idx; + + result = queue->device->funcs.p_vkCreateCommandPool(queue->device->host_device, &poolInfo, NULL, + &swapchain->cmd_pools[queue_idx]); + if (result != VK_SUCCESS) + { + ERR("vkCreateCommandPool failed, res=%d\n", result); + return NULL; + } + } + + allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; + allocInfo.commandPool = swapchain->cmd_pools[queue_idx]; + allocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; + allocInfo.commandBufferCount = 1; + + result = queue->device->funcs.p_vkAllocateCommandBuffers(queue->device->host_device, &allocInfo, &cmd); + if (result != VK_SUCCESS) + { + ERR("vkAllocateCommandBuffers failed, res=%d\n", result); + return NULL; + } + + return cmd; +} + +static VkResult record_compute_cmd(struct wine_device *device, struct wine_swapchain *swapchain, + struct fs_hack_image *hack) +{ + VkResult result; + VkImageMemoryBarrier barriers[3] = {{0}}; + VkCommandBufferBeginInfo beginInfo = {0}; + float constants[4]; + + TRACE("recording compute command\n"); + + beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; + beginInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; + + device->funcs.p_vkBeginCommandBuffer(hack->cmd, &beginInfo); + + /* for the cs we run... */ + /* transition user image from PRESENT_SRC to SHADER_READ */ + barriers[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[0].oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[0].newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + barriers[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].image = hack->user_image; + barriers[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[0].subresourceRange.baseMipLevel = 0; + barriers[0].subresourceRange.levelCount = 1; + barriers[0].subresourceRange.baseArrayLayer = 0; + barriers[0].subresourceRange.layerCount = 1; + barriers[0].srcAccessMask = 0; + barriers[0].dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + + /* storage image... */ + /* transition swapchain image from whatever to GENERAL */ + barriers[1].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[1].oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + barriers[1].newLayout = VK_IMAGE_LAYOUT_GENERAL; + barriers[1].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].image = hack->swapchain_image; + barriers[1].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[1].subresourceRange.baseMipLevel = 0; + barriers[1].subresourceRange.levelCount = 1; + barriers[1].subresourceRange.baseArrayLayer = 0; + barriers[1].subresourceRange.layerCount = 1; + barriers[1].srcAccessMask = 0; + barriers[1].dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT; + + device->funcs.p_vkCmdPipelineBarrier(hack->cmd, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, NULL, 0, NULL, 2, barriers); + + /* perform blit shader */ + device->funcs.p_vkCmdBindPipeline(hack->cmd, VK_PIPELINE_BIND_POINT_COMPUTE, swapchain->pipeline); + + device->funcs.p_vkCmdBindDescriptorSets(hack->cmd, VK_PIPELINE_BIND_POINT_COMPUTE, + swapchain->pipeline_layout, 0, 1, &hack->descriptor_set, 0, NULL); + + /* vec2: blit dst offset in real coords */ + constants[0] = swapchain->blit_dst.offset.x; + constants[1] = swapchain->blit_dst.offset.y; + + /* offset by 0.5f because sampling is relative to pixel center */ + constants[0] -= 0.5f * swapchain->blit_dst.extent.width / swapchain->user_extent.width; + constants[1] -= 0.5f * swapchain->blit_dst.extent.height / swapchain->user_extent.height; + + /* vec2: blit dst extents in real coords */ + constants[2] = swapchain->blit_dst.extent.width; + constants[3] = swapchain->blit_dst.extent.height; + device->funcs.p_vkCmdPushConstants(hack->cmd, swapchain->pipeline_layout, + VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(constants), constants); + + /* local sizes in shader are 8 */ + device->funcs.p_vkCmdDispatch(hack->cmd, ceil(swapchain->real_extent.width / 8.), + ceil(swapchain->real_extent.height / 8.), 1); + + /* transition user image from SHADER_READ back to PRESENT_SRC */ + barriers[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[0].oldLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + barriers[0].newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].image = hack->user_image; + barriers[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[0].subresourceRange.baseMipLevel = 0; + barriers[0].subresourceRange.levelCount = 1; + barriers[0].subresourceRange.baseArrayLayer = 0; + barriers[0].subresourceRange.layerCount = 1; + barriers[0].srcAccessMask = VK_ACCESS_SHADER_READ_BIT; + barriers[0].dstAccessMask = 0; + + /* transition swapchain image from GENERAL to PRESENT_SRC */ + barriers[1].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[1].oldLayout = VK_IMAGE_LAYOUT_GENERAL; + barriers[1].newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[1].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].image = hack->swapchain_image; + barriers[1].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[1].subresourceRange.baseMipLevel = 0; + barriers[1].subresourceRange.levelCount = 1; + barriers[1].subresourceRange.baseArrayLayer = 0; + barriers[1].subresourceRange.layerCount = 1; + barriers[1].srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; + barriers[1].dstAccessMask = 0; + + device->funcs.p_vkCmdPipelineBarrier(hack->cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, NULL, 2, barriers); + + result = device->funcs.p_vkEndCommandBuffer(hack->cmd); + if (result != VK_SUCCESS) + { + ERR("vkEndCommandBuffer: %d\n", result); + return result; + } + + return VK_SUCCESS; +} + +VkResult fshack_vk_queue_present(VkQueue queue_handle, const VkPresentInfoKHR *pPresentInfo) +{ + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + VkCommandBuffer *blit_cmds = NULL; + struct wine_swapchain *swapchain; + VkPresentInfoKHR our_presentInfo; + VkSubmitInfo submitInfo = {0}; + uint32_t i, n_hacks = 0; + VkSemaphore blit_sema; + VkSwapchainKHR *arr; + uint32_t queue_idx; + VkResult res; + + TRACE("%p, %p\n", queue, pPresentInfo); + + our_presentInfo = *pPresentInfo; + + for (i = 0; i < our_presentInfo.swapchainCount; ++i) + { + swapchain = wine_swapchain_from_handle(our_presentInfo.pSwapchains[i]); + + if (swapchain->fs_hack_enabled) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[our_presentInfo.pImageIndices[i]]; + + if (!blit_cmds) + { + queue_idx = queue->family_index; + blit_cmds = malloc(our_presentInfo.swapchainCount * sizeof(VkCommandBuffer)); + blit_sema = hack->blit_finished; + } + + if (!hack->cmd || hack->cmd_queue_idx != queue_idx) + { + if (hack->cmd) + queue->device->funcs.p_vkFreeCommandBuffers(queue->device->host_device, + swapchain->cmd_pools[hack->cmd_queue_idx], 1, &hack->cmd); + + hack->cmd_queue_idx = queue_idx; + hack->cmd = create_hack_cmd(queue, swapchain, queue_idx); + + if (!hack->cmd) + { + free(blit_cmds); + return VK_ERROR_DEVICE_LOST; + } + + if (queue->device->queue_props[queue_idx].queueFlags & VK_QUEUE_COMPUTE_BIT) /* TODO */ + res = record_compute_cmd(queue->device, swapchain, hack); + else + { + ERR("Present queue does not support compute!\n"); + res = VK_ERROR_DEVICE_LOST; + } + + if (res != VK_SUCCESS) + { + queue->device->funcs.p_vkFreeCommandBuffers(queue->device->host_device, + swapchain->cmd_pools[hack->cmd_queue_idx], 1, &hack->cmd); + hack->cmd = NULL; + free(blit_cmds); + return res; + } + } + + blit_cmds[n_hacks] = hack->cmd; + + ++n_hacks; + } + } + + if (n_hacks > 0) + { + VkPipelineStageFlags waitStage, *waitStages, *waitStages_arr = NULL; + + if (pPresentInfo->waitSemaphoreCount > 1) + { + waitStages_arr = malloc(sizeof(VkPipelineStageFlags) * pPresentInfo->waitSemaphoreCount); + for (i = 0; i < pPresentInfo->waitSemaphoreCount; ++i) waitStages_arr[i] = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + waitStages = waitStages_arr; + } + else + { + waitStage = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + waitStages = &waitStage; + } + + /* blit user image to real image */ + submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; + submitInfo.waitSemaphoreCount = pPresentInfo->waitSemaphoreCount; + submitInfo.pWaitSemaphores = pPresentInfo->pWaitSemaphores; + submitInfo.pWaitDstStageMask = waitStages; + submitInfo.commandBufferCount = n_hacks; + submitInfo.pCommandBuffers = blit_cmds; + submitInfo.signalSemaphoreCount = 1; + submitInfo.pSignalSemaphores = &blit_sema; + + res = queue->device->funcs.p_vkQueueSubmit(queue->host_queue, 1, &submitInfo, VK_NULL_HANDLE); + if (res != VK_SUCCESS) + ERR("vkQueueSubmit: %d\n", res); + + free(waitStages_arr); + free(blit_cmds); + + our_presentInfo.waitSemaphoreCount = 1; + our_presentInfo.pWaitSemaphores = &blit_sema; + } + + arr = malloc(our_presentInfo.swapchainCount * sizeof(VkSwapchainKHR)); + if (!arr) + { + ERR("Failed to allocate memory for swapchain array\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + for (i = 0; i < our_presentInfo.swapchainCount; ++i) + arr[i] = wine_swapchain_from_handle(our_presentInfo.pSwapchains[i])->host_swapchain; + + our_presentInfo.pSwapchains = arr; + + res = queue->device->funcs.p_vkQueuePresentKHR(queue->host_queue, &our_presentInfo); + + free(arr); + + return res; +} + +VkResult wine_vkCreateDeferredOperationKHR(VkDevice handle, + const VkAllocationCallbacks* allocator, + VkDeferredOperationKHR* deferredOperation) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_deferred_operation *object; + VkResult res; + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + res = device->funcs.p_vkCreateDeferredOperationKHR(device->host_device, NULL, &object->host_deferred_operation); + + if (res != VK_SUCCESS) + { + free(object); + return res; + } + + init_conversion_context(&object->ctx); + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, object, object->host_deferred_operation, object); + *deferredOperation = wine_deferred_operation_to_handle(object); + + return VK_SUCCESS; +} + +void wine_vkDestroyDeferredOperationKHR(VkDevice handle, + VkDeferredOperationKHR operation, + const VkAllocationCallbacks* allocator) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_deferred_operation *object; + + object = wine_deferred_operation_from_handle(operation); + + if (!object) + return; + + device->funcs.p_vkDestroyDeferredOperationKHR(device->host_device, object->host_deferred_operation, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, object); + + free_conversion_context(&object->ctx); + free(object); +} + +static void substitute_function_name(const char **name) +{ + if (!strcmp(*name, "vkGetMemoryWin32HandleKHR") || !strcmp(*name, "vkGetMemoryWin32HandlePropertiesKHR")) + *name = "vkGetMemoryFdKHR"; + else if (!strcmp(*name, "vkGetSemaphoreWin32HandleKHR")) + *name = "vkGetSemaphoreFdKHR"; + else if (!strcmp(*name, "vkImportSemaphoreWin32HandleKHR")) + *name = "vkImportSemaphoreFdKHR"; + else if (!strcmp(*name, "wine_vkAcquireKeyedMutex") || !strcmp(*name, "wine_vkReleaseKeyedMutex")) + *name = "vkImportSemaphoreFdKHR"; +} + +#ifdef _WIN64 + +NTSTATUS vk_is_available_instance_function(void *arg) +{ + struct is_available_instance_function_params *params = arg; + struct wine_instance *instance = wine_instance_from_handle(params->instance); + substitute_function_name(¶ms->name); + return !!vk_funcs->p_vkGetInstanceProcAddr(instance->host_instance, params->name); +} + +NTSTATUS vk_is_available_device_function(void *arg) +{ + struct is_available_device_function_params *params = arg; + struct wine_device *device = wine_device_from_handle(params->device); + substitute_function_name(¶ms->name); + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host_device, params->name); +} + +#endif /* _WIN64 */ + +NTSTATUS vk_is_available_instance_function32(void *arg) +{ + struct + { + UINT32 instance; + UINT32 name; + } *params = arg; + struct wine_instance *instance = wine_instance_from_handle(UlongToPtr(params->instance)); + const char *name = UlongToPtr(params->name); + substitute_function_name(&name); + return !!vk_funcs->p_vkGetInstanceProcAddr(instance->host_instance, name); +} + +NTSTATUS vk_is_available_device_function32(void *arg) +{ + struct + { + UINT32 device; + UINT32 name; + } *params = arg; + struct wine_device *device = wine_device_from_handle(UlongToPtr(params->device)); + const char *name = UlongToPtr(params->name); + substitute_function_name(&name); + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host_device, name); +} + +DECLSPEC_EXPORT VkDevice __wine_get_native_VkDevice(VkDevice handle) +{ + struct wine_device *device = wine_device_from_handle(handle); + + return device->host_device; +} + +DECLSPEC_EXPORT VkInstance __wine_get_native_VkInstance(VkInstance handle) +{ + struct wine_instance *instance = wine_instance_from_handle(handle);; + + return instance->host_instance; +} + +DECLSPEC_EXPORT VkPhysicalDevice __wine_get_native_VkPhysicalDevice(VkPhysicalDevice handle) +{ + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); + + return phys_dev->host_physical_device; +} + +DECLSPEC_EXPORT VkQueue __wine_get_native_VkQueue(VkQueue handle) +{ + struct wine_queue *queue = wine_queue_from_handle(handle); + + return queue->host_queue; +} + +DECLSPEC_EXPORT VkPhysicalDevice __wine_get_wrapped_VkPhysicalDevice(VkInstance handle, VkPhysicalDevice native_phys_dev) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + uint32_t i; + for(i = 0; i < instance->phys_dev_count; ++i){ + if(instance->phys_devs[i]->host_physical_device == native_phys_dev) + return instance->phys_devs[i]->handle; + } + WARN("Unknown native physical device: %p\n", native_phys_dev); + return NULL; +} + +VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *handle_info, HANDLE *handle) +{ + struct wine_device_memory *dev_mem = wine_device_memory_from_handle(handle_info->memory); + const VkBaseInStructure *chain; + HANDLE ret; + + TRACE("%p, %p %p\n", device, handle_info, handle); + + if (!(dev_mem->handle_types & handle_info->handleType)) + return VK_ERROR_UNKNOWN; + + if ((chain = handle_info->pNext)) + FIXME("Ignoring a linked structure of type %u.\n", chain->sType); + + switch(handle_info->handleType) + { + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT: + return !NtDuplicateObject( NtCurrentProcess(), dev_mem->handle, NtCurrentProcess(), handle, dev_mem->access, dev_mem->inherit ? OBJ_INHERIT : 0, 0) ? + VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY; + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT: + { + if ((ret = get_shared_resource_kmt_handle(dev_mem->handle)) == INVALID_HANDLE_VALUE) + return VK_ERROR_OUT_OF_HOST_MEMORY; + *handle = ret; + return VK_SUCCESS; + } + default: + FIXME("Unable to get handle of type %x, did the application ignore the capabilities?\n", handle_info->handleType); + return VK_ERROR_UNKNOWN; + } +} + +VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device_handle, VkExternalMemoryHandleTypeFlagBits type, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *properties) +{ + struct wine_device *device = wine_device_from_handle(device_handle); + unsigned int i; + + TRACE("%p %u %p %p\n", device, type, handle, properties); + + if (!(type & wine_vk_handle_over_fd_types)) + { + FIXME("type %#x.\n", type); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + properties->memoryTypeBits = 0; + for (i = 0; i < device->phys_dev->memory_properties.memoryTypeCount; ++i) + if (device->phys_dev->memory_properties.memoryTypes[i].propertyFlags == VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + properties->memoryTypeBits |= 1u << i; + + return VK_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +static bool set_shared_resource_object(HANDLE shared_resource, unsigned int index, HANDLE handle) +{ + IO_STATUS_BLOCK iosb; + struct shared_resource_set_object + { + unsigned int index; + obj_handle_t handle; + } params; + + params.index = index; + params.handle = wine_server_obj_handle(handle); + + return NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT, + ¶ms, sizeof(params), NULL, 0) == STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_READ_ACCESS) + +static HANDLE get_shared_resource_object(HANDLE shared_resource, unsigned int index) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t handle; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT, + &index, sizeof(index), &handle, sizeof(handle))) + return NULL; + + return wine_server_ptr_handle(handle); +} + +static void d3d12_semaphore_lock(struct wine_semaphore *semaphore) +{ + assert( semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT ); + pthread_mutex_lock(&semaphore->d3d12_fence_shm->mutex); +} + +static void d3d12_semaphore_unlock(struct wine_semaphore *semaphore) +{ + assert( semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT ); + pthread_mutex_unlock(&semaphore->d3d12_fence_shm->mutex); +} + +static VkSemaphore create_timeline_semaphore(struct wine_device *device) +{ + VkSemaphoreTypeCreateInfo timeline_info = { 0 }; + VkSemaphoreCreateInfo create_info = { 0 }; + VkSemaphore sem = 0; + VkResult res; + + timeline_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + timeline_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &timeline_info; + + res = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info, NULL, &sem); + if (res != VK_SUCCESS) + ERR("vkCreateSemaphore failed, res=%d\n", res); + return sem; +} + +static void release_fence_op(struct wine_device *device, struct pending_d3d12_fence_op *op) +{ + list_remove(&op->entry); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, op); + list_add_head(&device->free_fence_ops_list, &op->entry); +} + +static int wait_info_realloc(VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count) +{ + VkSemaphore *new_sem; + uint64_t *new_values; + + if (wait_info->semaphoreCount + 1 <= *wait_alloc_count) + return 1; + new_sem = realloc((void *)wait_info->pSemaphores, *wait_alloc_count * 2 * sizeof(*new_sem)); + if (!new_sem) + { + fprintf(stderr, "err:winevulkan:wait_info_realloc no memory.\n"); + return 0; + } + new_values = realloc((void *)wait_info->pValues, *wait_alloc_count * 2 * sizeof(*new_values)); + if (!new_values) + { + fprintf(stderr, "err:winevulkan:wait_info_realloc no memory.\n"); + return 0; + } + *wait_alloc_count *= 2; + wait_info->pSemaphores = new_sem; + wait_info->pValues = new_values; + return 1; +} + +static int add_sem_wait(VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count, VkSemaphore sem, uint64_t value) +{ + if (!wait_info_realloc(wait_info, wait_alloc_count)) + return 0; + ((VkSemaphore *)wait_info->pSemaphores)[wait_info->semaphoreCount] = sem; + ((uint64_t *)wait_info->pValues)[wait_info->semaphoreCount] = value; + ++wait_info->semaphoreCount; + return 1; +} + +static int semaphore_process(struct wine_device *device, struct wine_semaphore *sem, + VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count) +{ + /* Called from native thread. */ + struct pending_d3d12_fence_op *op, *op2; + uint64_t global_sem_wait_value; + int virtual_value_updated = 0; + uint64_t value, virtual_value; + VkResult res; + uint32_t i; + + /* Check local pending signal ops completion, update shared semaphore. */ + d3d12_semaphore_lock( sem ); + virtual_value = sem->d3d12_fence_shm->virtual_value; + LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_signals, struct pending_d3d12_fence_op, entry) + { + res = get_semaphore_value(device, op->local_sem.sem, &value); + if (res != VK_SUCCESS) + { + fprintf(stderr, "err:winevulkan:semaphore_process vkGetSemaphoreCounterValue failed, res=%d.\n", res); + goto signal_op_complete; + } + if (value <= op->local_sem.value) + { + if (!add_sem_wait(wait_info, wait_alloc_count, op->local_sem.sem, op->local_sem.value + 1)) + { + d3d12_semaphore_unlock(sem); + return 0; + } + continue; + } + + virtual_value = max( sem->d3d12_fence_shm->virtual_value, op->virtual_value ); + sem->d3d12_fence_shm->virtual_value = op->virtual_value; + virtual_value_updated = 1; +signal_op_complete: + op->local_sem.value = value; + release_fence_op(device, op); + } + + if (sem->d3d12_fence_shm->virtual_value < virtual_value) + { + uint32_t idx = sem->d3d12_fence_shm->reset_backlog_count; + + if (debug_level >= 3) + fprintf(stderr, "warn:winevulkan:semaphore_process resetting semaphore %p virtual value.\n", sem); + if (idx == ARRAY_SIZE(sem->d3d12_fence_shm->reset_backlog)) + { + sem->d3d12_fence_shm->last_dropped_reset_physical = sem->d3d12_fence_shm->reset_backlog[0].physical_at_reset; + --idx; + memmove(&sem->d3d12_fence_shm->reset_backlog[0], &sem->d3d12_fence_shm->reset_backlog[1], + sizeof(*sem->d3d12_fence_shm->reset_backlog) * sem->d3d12_fence_shm->reset_backlog_count); + } + else + { + ++sem->d3d12_fence_shm->reset_backlog_count; + } + sem->d3d12_fence_shm->last_reset_physical = sem->d3d12_fence_shm->physical_value + 1; + sem->d3d12_fence_shm->reset_backlog[idx].physical_at_reset = sem->d3d12_fence_shm->last_reset_physical; + sem->d3d12_fence_shm->reset_backlog[idx].virtual_before_reset = virtual_value; + } + if (virtual_value_updated) + signal_timeline_sem(device, sem->fence_timeline_semaphore, &sem->d3d12_fence_shm->physical_value); + global_sem_wait_value = sem->d3d12_fence_shm->physical_value + 1; + + /* Complete satisfied local waits. */ + LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_waits, struct pending_d3d12_fence_op, entry) + { + if (op->virtual_value > virtual_value) + { + if (op->shared_physical_value > sem->d3d12_fence_shm->last_reset_physical) + continue; + for (i = 0; i < sem->d3d12_fence_shm->reset_backlog_count; ++i) + { + if (sem->d3d12_fence_shm->reset_backlog[i].physical_at_reset >= op->shared_physical_value + && sem->d3d12_fence_shm->reset_backlog[i].virtual_before_reset >= op->virtual_value) + break; + } + if (i == sem->d3d12_fence_shm->reset_backlog_count) + { + if (sem->d3d12_fence_shm->last_dropped_reset_physical < op->shared_physical_value) + continue; + fprintf(stderr, "err:winevulkan:semaphore_process wait needs reset backlog beyond cut off.\n"); + } + } + + signal_timeline_sem(device, op->local_sem.sem, &op->local_sem.value); + release_fence_op(device, op); + } + d3d12_semaphore_unlock(sem); + + /* Only poll shared semaphore if there are waits pending. */ + if (list_empty(&sem->pending_waits)) + return 1; + return add_sem_wait(wait_info, wait_alloc_count, sem->fence_timeline_semaphore, global_sem_wait_value); +} + +#define SIGNALLER_INITIAL_WAIT_COUNT 256 + +void *signaller_worker(void *arg) +{ +#ifdef HAVE_SYS_SYSCALL_H + int unix_tid = syscall( __NR_gettid ); +#else + int unix_tid = -1; +#endif + struct wine_device *device = arg; + struct wine_semaphore *sem; + VkSemaphoreWaitInfo wait_info = { 0 }; + uint32_t wait_alloc_count = 0; + VkResult res; + + if (debug_level) + fprintf(stderr, "[%d] msg:winevulkan:signaller_worker started.\n", unix_tid); + + wait_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO; + wait_info.flags = VK_SEMAPHORE_WAIT_ANY_BIT; + wait_alloc_count = SIGNALLER_INITIAL_WAIT_COUNT; + if (!(wait_info.pSemaphores = malloc(sizeof(*wait_info.pSemaphores) * wait_alloc_count))) + { + fprintf(stderr, "err:winevulkan:signaller_worker no memory.\n"); + return NULL; + } + if (!(wait_info.pValues = malloc(sizeof(*wait_info.pValues) * wait_alloc_count))) + { + fprintf(stderr, "err:winevulkan:signaller_worker no memory.\n"); + free((void *)wait_info.pSemaphores); + return NULL; + } + + for (;;) + { + pthread_mutex_lock(&device->signaller_mutex); + if (device->stop) + { + pthread_mutex_unlock(&device->signaller_mutex); + break; + } + wait_info.semaphoreCount = 1; + *(VkSemaphore *)wait_info.pSemaphores = device->sem_poll_update.sem; + *(uint64_t *)wait_info.pValues = device->sem_poll_update.value + 1; + LIST_FOR_EACH_ENTRY(sem, &device->sem_poll_list, struct wine_semaphore, poll_entry) + { + if (!semaphore_process(device, sem, &wait_info, &wait_alloc_count)) + { + pthread_mutex_unlock(&device->signaller_mutex); + break; + } + } + device->sem_poll_update_value = device->sem_poll_update.value; + pthread_cond_signal(&device->sem_poll_updated_cond); + pthread_mutex_unlock(&device->signaller_mutex); + while ((res = wait_semaphores(device, &wait_info, 3000000000ull)) == VK_TIMEOUT) + { + if (wait_info.semaphoreCount > 1) + fprintf(stderr, "err:winevulkan:signaller_worker wait timed out with non-empty poll list.\n"); + } + if (res != VK_SUCCESS) + { + fprintf(stderr, "err:winevulkan:signaller_worker error waiting for semaphores, vr %d.\n", res); + break; + } + } + + free((void *)wait_info.pSemaphores); + free((void *)wait_info.pValues); + if (debug_level) + fprintf(stderr, "[%d] msg:winevulkan:signaller_worker exiting.\n", unix_tid); + + return NULL; +} + +static void register_sem_poll(struct wine_device *device, struct wine_semaphore *semaphore) +{ + pthread_mutex_lock(&device->signaller_mutex); + if (!device->signaller_thread) + { + device->sem_poll_update.sem = create_timeline_semaphore(device); + device->sem_poll_update.value = 0; + pthread_cond_init(&device->sem_poll_updated_cond, NULL); + if (TRACE_ON(vulkan)) + debug_level = 4; + else if (WARN_ON(vulkan)) + debug_level = 3; + else if (FIXME_ON(vulkan)) + debug_level = 2; + else if (ERR_ON(vulkan)) + debug_level = 1; + else + debug_level = 0; + if (pthread_create(&device->signaller_thread, NULL, signaller_worker, device)) + ERR("Failed to create signaller_worker.\n"); + WARN("d3d12 fence used, created signaller worker.\n"); + } + assert(!semaphore->poll_entry.next); + list_add_head(&device->sem_poll_list, &semaphore->poll_entry); + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + pthread_mutex_unlock(&device->signaller_mutex); +} + +static void update_sem_poll_wait_processed(struct wine_device *device) +{ + uint64_t update_value; + + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + update_value = device->sem_poll_update.value; + while (device->sem_poll_update_value < update_value) + pthread_cond_wait(&device->sem_poll_updated_cond, &device->signaller_mutex); +} + +static void unregister_sem_poll(struct wine_device *device, struct wine_semaphore *semaphore) +{ + struct list *entry; + + pthread_mutex_lock(&device->signaller_mutex); + list_remove(&semaphore->poll_entry); + semaphore->poll_entry.next = semaphore->poll_entry.prev = NULL; + update_sem_poll_wait_processed(device); + pthread_mutex_unlock(&device->signaller_mutex); + + while ((entry = list_head(&semaphore->pending_waits))) + release_fence_op(device, CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry)); + while ((entry = list_head(&semaphore->pending_signals))) + release_fence_op(device, CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry)); +} + +static struct pending_d3d12_fence_op *get_free_fence_op(struct wine_device *device) +{ + struct pending_d3d12_fence_op *op; + struct list *entry; + + if ((entry = list_head(&device->free_fence_ops_list))) + { + list_remove(entry); + return CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry); + } + + if (!(op = malloc(sizeof(*op)))) + { + ERR("No memory.\n"); + return NULL; + } + op->local_sem.sem = create_timeline_semaphore(device); + op->local_sem.value = 0; + ++device->allocated_fence_ops_count; + TRACE("Total allocated fence ops %u.\n", device->allocated_fence_ops_count); + return op; +} + +static void add_sem_wait_op(struct wine_device *device, struct wine_semaphore *semaphore, uint64_t virtual_value, + VkSemaphore *phys_semaphore, uint64_t *phys_wait_value) +{ + struct pending_d3d12_fence_op *op; + + pthread_mutex_lock(&device->signaller_mutex); + LIST_FOR_EACH_ENTRY(op, &semaphore->pending_waits, struct pending_d3d12_fence_op, entry) + { + if (op->virtual_value == virtual_value) + { + *phys_semaphore = op->local_sem.sem; + *phys_wait_value = op->local_sem.value + 1; + pthread_mutex_unlock(&device->signaller_mutex); + return; + } + } + if ((op = get_free_fence_op(device))) + { + op->virtual_value = virtual_value; + op->shared_physical_value = __atomic_load_n(&semaphore->d3d12_fence_shm->physical_value, __ATOMIC_ACQUIRE) + 1; + *phys_semaphore = op->local_sem.sem; + *phys_wait_value = op->local_sem.value + 1; + list_add_tail(&semaphore->pending_waits, &op->entry); + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, semaphore, op->local_sem.sem, op); + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + TRACE("added wait op, semaphore %p, %s, temp sem %s, %s.\n", semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + else + { + *phys_semaphore = 0; + *phys_wait_value = 0; + } + pthread_mutex_unlock(&device->signaller_mutex); +} + +static void add_sem_signal_op(struct wine_device *device, struct wine_semaphore *semaphore, uint64_t virtual_value, + VkSemaphore *phys_semaphore, uint64_t *phys_signal_value, BOOL signal_immediate) +{ + struct pending_d3d12_fence_op *op; + uint64_t value; + + pthread_mutex_lock(&device->signaller_mutex); + if ((op = get_free_fence_op(device))) + { + op->virtual_value = virtual_value; + *phys_semaphore = op->local_sem.sem; + *phys_signal_value = op->local_sem.value + 1; + list_add_tail(&semaphore->pending_signals, &op->entry); + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, semaphore, op->local_sem.sem, op); + if (signal_immediate) + { + value = op->local_sem.value; + signal_timeline_sem(device, op->local_sem.sem, &value); + update_sem_poll_wait_processed(device); + TRACE("signal op %p, semaphore %p, %s, temp sem %s, %s.\n", op, semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + else + { + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + TRACE("added signal op, semaphore %p, %s, temp sem %s, %s.\n", semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + } + else + { + *phys_semaphore = 0; + *phys_signal_value = 0; + } + pthread_mutex_unlock(&device->signaller_mutex); +} + +VkResult wine_vkCreateSemaphore(VkDevice device_handle, const VkSemaphoreCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkSemaphore *semaphore, void *win_create_info) +{ + struct wine_device *device = wine_device_from_handle(device_handle); + + VkExportSemaphoreWin32HandleInfoKHR *export_handle_info = wine_vk_find_struct(win_create_info, EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR); + VkExportSemaphoreCreateInfo *export_semaphore_info, timeline_export_info; + VkSemaphoreCreateInfo create_info_dup = *create_info; + VkSemaphoreTypeCreateInfo *found_type_info, type_info; + VkSemaphoreGetFdInfoKHR fd_info; + pthread_mutexattr_t mutex_attr; + struct wine_semaphore *object; + OBJECT_ATTRIBUTES attr; + HANDLE section_handle; + LARGE_INTEGER li; + VkResult res; + SIZE_T size; + int fd; + + TRACE("(%p, %p, %p, %p)\n", device, create_info, allocator, semaphore); + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + list_init(&object->pending_signals); + list_init(&object->pending_waits); + + object->handle = INVALID_HANDLE_VALUE; + + if ((export_semaphore_info = wine_vk_find_struct(&create_info_dup, EXPORT_SEMAPHORE_CREATE_INFO))) + { + object->export_types = export_semaphore_info->handleTypes; + if (export_semaphore_info->handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + export_semaphore_info->handleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_semaphore_handle_types_host(&export_semaphore_info->handleTypes); + } + + if ((res = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info_dup, NULL, &object->semaphore)) != VK_SUCCESS) + goto done; + + if (export_semaphore_info && export_semaphore_info->handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + { + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = object->semaphore; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((res = device->funcs.p_vkGetSemaphoreFdKHR(device->host_device, &fd_info, &fd)) == VK_SUCCESS) + { + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL, 0); + close(fd); + } + + if (object->handle == INVALID_HANDLE_VALUE) + { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + } + else if (object->export_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + /* compatibleHandleTypes doesn't include any other types */ + assert(object->export_types == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT); + object->handle_type = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; - if (NtAllocateVirtualMemory(GetCurrentProcess(), &mapping, zero_bits, &alloc_size, - MEM_COMMIT, PAGE_READWRITE)) + timeline_export_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; + timeline_export_info.pNext = NULL; + timeline_export_info.handleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = &timeline_export_info; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info_dup.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info_dup.pNext = &type_info; + create_info_dup.flags = 0; + + if ((res = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info_dup, NULL, &object->fence_timeline_semaphore)) != VK_SUCCESS) + goto done; + + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = object->fence_timeline_semaphore; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((res = device->funcs.p_vkGetSemaphoreFdKHR(device->host_device, &fd_info, &fd)) == VK_SUCCESS) { - ERR("NtAllocateVirtualMemory failed\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL, 0); + close(fd); } - result = device->funcs.p_vkGetMemoryHostPointerPropertiesEXT(device->host_device, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, mapping, &props); - if (result != VK_SUCCESS) + if (object->handle == INVALID_HANDLE_VALUE) { - ERR("vkGetMemoryHostPointerPropertiesEXT failed: %d\n", result); - return result; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; } - if (!(props.memoryTypeBits & (1u << info.memoryTypeIndex))) + /* Shared Fence Memory */ + InitializeObjectAttributes(&attr, NULL, 0, NULL, NULL); + size = li.QuadPart = sizeof(*object->d3d12_fence_shm); + if (NtCreateSection(§ion_handle, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE, &attr, &li, PAGE_READWRITE, SEC_COMMIT, NULL)) { - /* If requested memory type is not allowed to use external memory, - * try to find a supported compatible type. */ - uint32_t mask = mem_flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - for (i = 0; i < device->phys_dev->memory_properties.memoryTypeCount; i++) - { - if (!(props.memoryTypeBits & (1u << i))) - continue; - if ((device->phys_dev->memory_properties.memoryTypes[i].propertyFlags & mask) != mask) - continue; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } - TRACE("Memory type not compatible with host memory, using %u instead\n", i); - info.memoryTypeIndex = i; - break; - } - if (i == device->phys_dev->memory_properties.memoryTypeCount) - { - FIXME("Not found compatible memory type\n"); - alloc_size = 0; - NtFreeVirtualMemory(GetCurrentProcess(), &mapping, &alloc_size, MEM_RELEASE); - } + if (!set_shared_resource_object(object->handle, 0, section_handle)) + { + NtClose(section_handle); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; } - if (props.memoryTypeBits & (1u << info.memoryTypeIndex)) + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &object->d3d12_fence_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) { - host_pointer_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; - host_pointer_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; - host_pointer_info.pHostPointer = mapping; - host_pointer_info.pNext = info.pNext; - info.pNext = &host_pointer_info; + NtClose(section_handle); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } - info.allocationSize = (info.allocationSize + align) & ~align; + NtClose(section_handle); + + if ((found_type_info = wine_vk_find_struct(create_info, SEMAPHORE_TYPE_CREATE_INFO))) + object->d3d12_fence_shm->virtual_value = found_type_info->initialValue; + + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED); + if (pthread_mutex_init(&object->d3d12_fence_shm->mutex, &mutex_attr)) + { + pthread_mutexattr_destroy(&mutex_attr); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; } + pthread_mutexattr_destroy(&mutex_attr); + + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, object, object->fence_timeline_semaphore, object); } + if (object->fence_timeline_semaphore == VK_NULL_HANDLE) + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, object, object->semaphore, object); + *semaphore = wine_semaphore_to_handle(object); - if (!(memory = malloc(sizeof(*memory)))) - return VK_ERROR_OUT_OF_HOST_MEMORY; + done: - result = device->funcs.p_vkAllocateMemory(device->host_device, &info, NULL, &memory->host_memory); - if (result != VK_SUCCESS) + if (res != VK_SUCCESS) { - free(memory); - return result; + if (object->d3d12_fence_shm) + { + pthread_mutex_destroy(&object->d3d12_fence_shm->mutex); + NtUnmapViewOfSection(GetCurrentProcess(), object->d3d12_fence_shm); + } + if (object->handle != INVALID_HANDLE_VALUE) + NtClose(object->handle); + if (object->semaphore != VK_NULL_HANDLE) + device->funcs.p_vkDestroySemaphore(device->host_device, object->semaphore, NULL); + if (object->fence_timeline_semaphore != VK_NULL_HANDLE) + device->funcs.p_vkDestroySemaphore(device->host_device, object->fence_timeline_semaphore, NULL); + free(object); + } + else if (object->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + register_sem_poll(device, object); + if (res == VK_SUCCESS) + { + TRACE("-> %p (native %#llx, shared %#llx).\n", object, (long long)object->semaphore, (long long)object->fence_timeline_semaphore); } - memory->mapping = mapping; - *ret = (VkDeviceMemory)(uintptr_t)memory; + return res; +} + +VkResult wine_vkGetSemaphoreWin32HandleKHR(VkDevice device_handle, const VkSemaphoreGetWin32HandleInfoKHR *handle_info, + HANDLE *handle) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(handle_info->semaphore); + + if (!(semaphore->export_types & handle_info->handleType)) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + + if (NtDuplicateObject( NtCurrentProcess(), semaphore->handle, NtCurrentProcess(), handle, 0, 0, DUPLICATE_SAME_ACCESS )) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + return VK_SUCCESS; } -void wine_vkFreeMemory(VkDevice handle, VkDeviceMemory memory_handle, const VkAllocationCallbacks *allocator) +void wine_vkDestroySemaphore(VkDevice device_handle, VkSemaphore semaphore_handle, const VkAllocationCallbacks *allocator) { - struct wine_device *device = wine_device_from_handle(handle); - struct wine_device_memory *memory; + struct wine_device *device = wine_device_from_handle(device_handle); + struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); - if (!memory_handle) + TRACE("%p, %p, %p\n", device, semaphore, allocator); + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!semaphore) return; - memory = wine_device_memory_from_handle(memory_handle); - device->funcs.p_vkFreeMemory(device->host_device, memory->host_memory, NULL); + if (semaphore->poll_entry.next) + unregister_sem_poll(device, semaphore); - if (memory->mapping) - { - SIZE_T alloc_size = 0; - NtFreeVirtualMemory(GetCurrentProcess(), &memory->mapping, &alloc_size, MEM_RELEASE); - } + if (semaphore->handle != INVALID_HANDLE_VALUE) + NtClose(semaphore->handle); - free(memory); + if (semaphore->d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), semaphore->d3d12_fence_shm); + + device->funcs.p_vkDestroySemaphore(device->host_device, semaphore->semaphore, NULL); + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, semaphore); + + if (semaphore->fence_timeline_semaphore) + device->funcs.p_vkDestroySemaphore(device->host_device, semaphore->fence_timeline_semaphore, NULL); + + free(semaphore); } -VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, - VkDeviceSize size, VkMemoryMapFlags flags, void **data) +VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice device_handle, + const VkImportSemaphoreWin32HandleInfoKHR *handle_info) { - const VkMemoryMapInfoKHR info = + struct wine_device *device = wine_device_from_handle(device_handle); + struct wine_semaphore *semaphore = wine_semaphore_from_handle(handle_info->semaphore); + struct wine_semaphore output_semaphore; + VkSemaphoreTypeCreateInfo type_info; + VkImportSemaphoreFdInfoKHR fd_info; + VkSemaphoreCreateInfo create_info; + HANDLE d3d12_fence_shm; + NTSTATUS stat; + VkResult res; + SIZE_T size; + + TRACE("(%p, %p). semaphore = %p handle = %p\n", device, handle_info, semaphore, handle_info->handle); + + if (semaphore->poll_entry.next) + unregister_sem_poll(device, semaphore); + + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT && !semaphore->fence_timeline_semaphore) { - .sType = VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR, - .flags = flags, - .memory = memory, - .offset = offset, - .size = size, - }; + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = NULL; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; - return wine_vkMapMemory2KHR(device, &info, data); -} + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; -VkResult wine_vkMapMemory2KHR(VkDevice handle, const VkMemoryMapInfoKHR *map_info, void **data) -{ - struct wine_device *device = wine_device_from_handle(handle); - struct wine_device_memory *memory = wine_device_memory_from_handle(map_info->memory); - VkMemoryMapInfoKHR info = *map_info; - VkResult result; + if ((res = device->funcs.p_vkCreateSemaphore(device->host_device, &create_info, NULL, &semaphore->fence_timeline_semaphore)) != VK_SUCCESS) + { + ERR("Failed to create timeline semaphore backing D3D12 semaphore. vr %d.\n", res); + return res; + }; - info.memory = memory->host_memory; - if (memory->mapping) + WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, semaphore); + WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, semaphore, semaphore->fence_timeline_semaphore, semaphore); + } + + output_semaphore = *semaphore; + output_semaphore.handle = NULL; + output_semaphore.handle_type = handle_info->handleType; + output_semaphore.d3d12_fence_shm = NULL; + + fd_info.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; + fd_info.pNext = handle_info->pNext; + fd_info.semaphore = wine_semaphore_host_handle(&output_semaphore); + fd_info.flags = handle_info->flags; + fd_info.handleType = handle_info->handleType; + + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT || + handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { - *data = (char *)memory->mapping + info.offset; - TRACE("returning %p\n", *data); - return VK_SUCCESS; + if (handle_info->name) + { + FIXME("Importing win32 semaphore by name not supported.\n"); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if (NtDuplicateObject( NtCurrentProcess(), handle_info->handle, NtCurrentProcess(), &output_semaphore.handle, 0, 0, DUPLICATE_SAME_ACCESS )) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + if ((fd_info.fd = get_shared_resource_fd(output_semaphore.handle)) == -1) + { + WARN("Invalid handle %p.\n", handle_info->handle); + NtClose(output_semaphore.handle); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + if (handle_info->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) + { + FIXME("Temporarily importing d3d12 fences unsupported.\n"); + close(fd_info.fd); + NtClose(output_semaphore.handle); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if (!(d3d12_fence_shm = get_shared_resource_object(output_semaphore.handle, 0))) + { + ERR("Failed to get D3D12 semaphore memory.\n"); + close(fd_info.fd); + NtClose(output_semaphore.handle); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + size = sizeof(*output_semaphore.d3d12_fence_shm); + if ((stat = NtMapViewOfSection(d3d12_fence_shm, GetCurrentProcess(), (void**) &output_semaphore.d3d12_fence_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE))) + { + ERR("Failed to map D3D12 semaphore memory. stat %#x.\n", (int)stat); + close(fd_info.fd); + NtClose(d3d12_fence_shm); + NtClose(output_semaphore.handle); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + NtClose(d3d12_fence_shm); + } } - if (device->funcs.p_vkMapMemory2KHR) + wine_vk_normalize_semaphore_handle_types_host(&fd_info.handleType); + + if (!fd_info.handleType) { - result = device->funcs.p_vkMapMemory2KHR(device->host_device, &info, data); + FIXME("Importing win32 semaphore with handle type %#x not supported.\n", handle_info->handleType); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if ((res = device->funcs.p_vkImportSemaphoreFdKHR(device->host_device, &fd_info)) == VK_SUCCESS) + { + if (semaphore->handle) + NtClose(semaphore->handle); + if (semaphore->d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), semaphore->d3d12_fence_shm); + + *semaphore = output_semaphore; + assert(!semaphore->poll_entry.next); + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + register_sem_poll(device, semaphore); } else { - assert(!info.pNext); - result = device->funcs.p_vkMapMemory(device->host_device, info.memory, info.offset, - info.size, info.flags, data); + if (output_semaphore.handle) + NtClose(output_semaphore.handle); + if (output_semaphore.d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), output_semaphore.d3d12_fence_shm); + + /* importing FDs transfers ownership, importing NT handles does not */ + close(fd_info.fd); } -#ifdef _WIN64 - if (NtCurrentTeb()->WowTebOffset && result == VK_SUCCESS && (UINT_PTR)*data >> 32) + return res; +} + +static VkResult wine_vk_get_semaphore_counter_value(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value, bool khr) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); + struct wine_device *device = wine_device_from_handle(device_handle); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { - FIXME("returned mapping %p does not fit 32-bit pointer\n", *data); - device->funcs.p_vkUnmapMemory(device->host_device, memory->host_memory); - *data = NULL; - result = VK_ERROR_OUT_OF_HOST_MEMORY; + d3d12_semaphore_lock(semaphore); + *value = semaphore->d3d12_fence_shm->virtual_value; + d3d12_semaphore_unlock(semaphore); + return VK_SUCCESS; } -#endif - return result; + if (khr) + return device->funcs.p_vkGetSemaphoreCounterValueKHR(device->host_device, wine_semaphore_host_handle(semaphore), value); + else + return device->funcs.p_vkGetSemaphoreCounterValue(device->host_device, wine_semaphore_host_handle(semaphore), value); } -void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) +VkResult wine_vkGetSemaphoreCounterValue(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value) { - const VkMemoryUnmapInfoKHR info = - { - .sType = VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR, - .memory = memory, - }; + return wine_vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, false); +} - wine_vkUnmapMemory2KHR(device, &info); +VkResult wine_vkGetSemaphoreCounterValueKHR(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value) +{ + return wine_vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, true); } -VkResult wine_vkUnmapMemory2KHR(VkDevice handle, const VkMemoryUnmapInfoKHR *unmap_info) +static NTSTATUS wine_vk_signal_semaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info, bool khr) { - struct wine_device *device = wine_device_from_handle(handle); - struct wine_device_memory *memory = wine_device_memory_from_handle(unmap_info->memory); - VkMemoryUnmapInfoKHR info; + struct wine_semaphore *semaphore = wine_semaphore_from_handle(signal_info->semaphore); + struct wine_device *device = wine_device_from_handle(device_handle); + VkSemaphoreSignalInfo dup_signal_info = *signal_info; - if (memory->mapping) - return VK_SUCCESS; + TRACE("(%p, %p)\n", device, signal_info); - if (!device->funcs.p_vkUnmapMemory2KHR) + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { - assert(!unmap_info->pNext); - device->funcs.p_vkUnmapMemory(device->host_device, memory->host_memory); + add_sem_signal_op(device, semaphore, signal_info->value, &dup_signal_info.semaphore, &dup_signal_info.value, TRUE); return VK_SUCCESS; } + else + dup_signal_info.semaphore = wine_semaphore_host_handle(semaphore); - info = *unmap_info; - info.memory = memory->host_memory; - return device->funcs.p_vkUnmapMemory2KHR(device->host_device, &info); + if (khr) + return device->funcs.p_vkSignalSemaphoreKHR(device->host_device, &dup_signal_info); + else + return device->funcs.p_vkSignalSemaphore(device->host_device, &dup_signal_info); } -VkResult wine_vkCreateBuffer(VkDevice handle, const VkBufferCreateInfo *create_info, - const VkAllocationCallbacks *allocator, VkBuffer *buffer) +VkResult wine_vkSignalSemaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info) { - struct wine_device *device = wine_device_from_handle(handle); - VkExternalMemoryBufferCreateInfo external_memory_info; - VkBufferCreateInfo info = *create_info; - - if (device->phys_dev->external_memory_align && - !find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO)) - { - external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO; - external_memory_info.pNext = info.pNext; - external_memory_info.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; - info.pNext = &external_memory_info; - } - - return device->funcs.p_vkCreateBuffer(device->host_device, &info, NULL, buffer); + return wine_vk_signal_semaphore(device_handle, signal_info, false); } -VkResult wine_vkCreateImage(VkDevice handle, const VkImageCreateInfo *create_info, - const VkAllocationCallbacks *allocator, VkImage *image) +VkResult wine_vkSignalSemaphoreKHR(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info) { - struct wine_device *device = wine_device_from_handle(handle); - VkExternalMemoryImageCreateInfo external_memory_info; - VkImageCreateInfo info = *create_info; - - if (device->phys_dev->external_memory_align && - !find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO)) - { - external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; - external_memory_info.pNext = info.pNext; - external_memory_info.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT; - info.pNext = &external_memory_info; - } - - return device->funcs.p_vkCreateImage(device->host_device, &info, NULL, image); + return wine_vk_signal_semaphore(device_handle, signal_info, true); } -static inline void adjust_max_image_count(struct wine_phys_dev *phys_dev, VkSurfaceCapabilitiesKHR* capabilities) +static void unwrap_semaphore(struct wine_device *device, VkSemaphore *sem_handle, uint64_t *value, BOOL signal) { - /* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile - * and World War Z, do not expect that maxImageCount can be set to 0. - * A value of 0 means that there is no limit on the number of images. - * Nvidia reports 8 on Windows, AMD 16. - * https://vulkan.gpuinfo.org/displayreport.php?id=9122#surface - * https://vulkan.gpuinfo.org/displayreport.php?id=9121#surface - */ - if ((phys_dev->instance->quirks & WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT) && !capabilities->maxImageCount) + struct wine_semaphore *sem = wine_semaphore_from_handle(*sem_handle); + + if (!sem) + return; + + if (sem->handle_type != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { - capabilities->maxImageCount = max(capabilities->minImageCount, 16); + *sem_handle = wine_semaphore_host_handle(sem); + return; } + if (signal) + add_sem_signal_op(device, sem, *value, sem_handle, value, FALSE); + else + add_sem_wait_op(device, sem, *value, sem_handle, value); } -VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice handle, VkSurfaceKHR surface_handle, - VkSurfaceCapabilitiesKHR *capabilities) +static VkResult unwrap_semaphore_array(const VkSemaphore **sems, const uint64_t **values_out, + uint32_t count, struct conversion_context *ctx, BOOL signal, struct wine_device *device) { - struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); - struct wine_surface *surface = wine_surface_from_handle(surface_handle); - VkResult res; + const uint64_t *values = NULL; + const VkSemaphore *in; + VkSemaphore *out; + unsigned int i; - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev->host_physical_device, - surface->driver_surface, capabilities); + in = *sems; + *sems = NULL; - if (res == VK_SUCCESS) - adjust_max_image_count(phys_dev, capabilities); + if (!in || !count) + return VK_SUCCESS; - return res; + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; ++i) + { + struct wine_semaphore *sem; + if (!in[i]) + { + out[i] = VK_NULL_HANDLE; + continue; + } + sem = wine_semaphore_from_handle(in[i]); + if (sem->handle_type != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + out[i] = wine_semaphore_host_handle(sem); + continue; + } + if (!values_out) + { + ERR("D3D12 fence without values specified.\n"); + return VK_ERROR_UNKNOWN; + } + if (!values) + { + values = *values_out; + *values_out = conversion_context_alloc(ctx, count * sizeof(*values_out)); + memcpy((void *)*values_out, values, count * sizeof(*values)); + } + if (signal) + add_sem_signal_op(device, sem, values[i], &out[i], (uint64_t *)&(*values_out)[i], FALSE); + else + add_sem_wait_op(device, sem, values[i], &out[i], (uint64_t *)&(*values_out)[i]); + } + *sems = out; + return VK_SUCCESS; } -VkResult wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice handle, - const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, - VkSurfaceCapabilities2KHR *capabilities) +static VkResult wine_vk_wait_semaphores(VkDevice device_handle, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) { - struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(handle); - struct wine_surface *surface = wine_surface_from_handle(surface_info->surface); - VkPhysicalDeviceSurfaceInfo2KHR host_info; - VkResult res; - - host_info.sType = surface_info->sType; - host_info.pNext = surface_info->pNext; - host_info.surface = surface->driver_surface; - res = phys_dev->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev->host_physical_device, - &host_info, capabilities); + struct wine_device *device = wine_device_from_handle(device_handle); + VkSemaphoreWaitInfo wait_info_dup = *wait_info; + struct conversion_context ctx; + VkResult ret; - if (res == VK_SUCCESS) - adjust_max_image_count(phys_dev, &capabilities->surfaceCapabilities); + init_conversion_context(&ctx); + if ((ret = unwrap_semaphore_array(&wait_info_dup.pSemaphores, &wait_info_dup.pValues, + wait_info->semaphoreCount, &ctx, FALSE, device))) + goto done; - return res; + if (khr) + ret = device->funcs.p_vkWaitSemaphoresKHR(device->host_device, &wait_info_dup, timeout); + else + ret = device->funcs.p_vkWaitSemaphores(device->host_device, &wait_info_dup, timeout); +done: + free_conversion_context(&ctx); + return ret; } -VkResult wine_vkCreateDebugUtilsMessengerEXT(VkInstance handle, - const VkDebugUtilsMessengerCreateInfoEXT *create_info, - const VkAllocationCallbacks *allocator, - VkDebugUtilsMessengerEXT *messenger) +VkResult wine_vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) { - struct wine_instance *instance = wine_instance_from_handle(handle); - VkDebugUtilsMessengerCreateInfoEXT wine_create_info; - struct wine_debug_utils_messenger *object; - VkResult res; + TRACE("%p %p %s.\n", device, wait_info, wine_dbgstr_longlong(timeout)); - if (allocator) - FIXME("Support for allocation callbacks not implemented yet\n"); + return wine_vk_wait_semaphores(device, wait_info, timeout, false); +} - if (!(object = calloc(1, sizeof(*object)))) - return VK_ERROR_OUT_OF_HOST_MEMORY; +VkResult wine_vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) +{ + TRACE("%p %p %s.\n", device, wait_info, wine_dbgstr_longlong(timeout)); - object->instance = instance; - object->user_callback = create_info->pfnUserCallback; - object->user_data = create_info->pUserData; + return wine_vk_wait_semaphores(device, wait_info, timeout, true); +} - wine_create_info = *create_info; +struct struct_chain_def +{ + VkStructureType sType; + unsigned int size; +}; - wine_create_info.pfnUserCallback = (void *) &debug_utils_callback_conversion; - wine_create_info.pUserData = object; +static VkResult process_keyed_mutexes(struct conversion_context *ctx, struct wine_device *device, + uint32_t submit_count, const void *submits_win, size_t submit_size, uint32_t **signal_counts, + VkSemaphoreSubmitInfo ***signal_infos) +{ + VkWin32KeyedMutexAcquireReleaseInfoKHR *keyed_mutex_info; + struct wine_device_memory *memory; + VkResult ret = VK_ERROR_UNKNOWN; + uint32_t i, j, signal_count = 0; + void *ptr; - res = instance->funcs.p_vkCreateDebugUtilsMessengerEXT(instance->host_instance, &wine_create_info, - NULL, &object->host_debug_messenger); - if (res != VK_SUCCESS) + for (i = 0; i < submit_count; ++i) { - free(object); - return res; + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = wine_vk_find_struct(ptr, WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + continue; + for (j = 0; j < keyed_mutex_info->acquireCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + if ((ret = acquire_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], + keyed_mutex_info->pAcquireTimeouts[j])) == VK_SUCCESS) + continue; + while (j) + { + --j; + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + release_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], NULL); + } + goto error; + } + /* Pre-check release error conditions. */ + for (j = 0; j < keyed_mutex_info->releaseCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pReleaseSyncs[j]); + if (!memory->keyed_mutex_shm) + goto error; + if (memory->keyed_mutex_shm->acquired_to_instance != memory->keyed_mutex_instance_id) + goto error; + } + signal_count += keyed_mutex_info->releaseCount; } - WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_debug_messenger, object); - *messenger = wine_debug_utils_messenger_to_handle(object); + if (!signal_count) + { + *signal_counts = NULL; + return VK_SUCCESS; + } + *signal_counts = conversion_context_alloc(ctx, sizeof(**signal_counts) * submit_count); + *signal_infos = conversion_context_alloc(ctx, sizeof(**signal_infos) * submit_count); + for (i = 0; i < submit_count; ++i) + { + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = wine_vk_find_struct(ptr, WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + { + (*signal_counts)[i] = 0; + continue; + } + (*signal_counts)[i] = keyed_mutex_info->releaseCount; + (*signal_infos)[i] = conversion_context_alloc(ctx, sizeof(***signal_infos) * keyed_mutex_info->releaseCount); + for (j = 0; j < keyed_mutex_info->releaseCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pReleaseSyncs[j]); + (*signal_infos)[i][j].sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO; + (*signal_infos)[i][j].pNext = NULL; + (*signal_infos)[i][j].semaphore = memory->keyed_mutex_sem; + (*signal_infos)[i][j].stageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + (*signal_infos)[i][j].deviceIndex = 0; + ret = release_keyed_mutex(device, memory, keyed_mutex_info->pReleaseKeys[j], &(*signal_infos)[i][j].value); + if (ret != VK_SUCCESS) + { + /* This should only be possible if a racing submit queued release before us, currently not handled. */ + ERR("release_keyed_mutex failed, ret %d.\n", ret); + (*signal_infos)[i][j].value = 0; + } + } + } return VK_SUCCESS; + +error: + while (i) + { + --i; + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = wine_vk_find_struct(ptr, WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + continue; + for (j = 0; j < keyed_mutex_info->acquireCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + release_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], NULL); + } + } + return ret; } -void wine_vkDestroyDebugUtilsMessengerEXT(VkInstance handle, VkDebugUtilsMessengerEXT messenger, - const VkAllocationCallbacks *allocator) +static void duplicate_array_for_unwrapping_copy_size(struct conversion_context *ctx, void **ptr, unsigned int size, + unsigned int copy_size) { - struct wine_instance *instance = wine_instance_from_handle(handle); - struct wine_debug_utils_messenger *object; - - object = wine_debug_utils_messenger_from_handle(messenger); + void *out; - if (!object) + if (!size) return; - instance->funcs.p_vkDestroyDebugUtilsMessengerEXT(instance->host_instance, object->host_debug_messenger, NULL); - WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); - - free(object); + out = conversion_context_alloc(ctx, size); + if (*ptr) + memcpy(out, *ptr, copy_size); + *ptr = out; } -VkResult wine_vkCreateDebugReportCallbackEXT(VkInstance handle, - const VkDebugReportCallbackCreateInfoEXT *create_info, - const VkAllocationCallbacks *allocator, - VkDebugReportCallbackEXT *callback) +VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence, + void *submits_win_ptr) { - struct wine_instance *instance = wine_instance_from_handle(handle); - VkDebugReportCallbackCreateInfoEXT wine_create_info; - struct wine_debug_report_callback *object; - VkResult res; - - if (allocator) - FIXME("Support for allocation callbacks not implemented yet\n"); + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + struct wine_device *device = queue->device; + VkTimelineSemaphoreSubmitInfo *timeline_submit_info, ts_info_copy; + const VkSubmitInfo *submits_win = submits_win_ptr; + VkD3D12FenceSubmitInfoKHR *d3d12_submit_info; + const uint64_t **values; + struct conversion_context ctx; + VkSubmitInfo *submits; + VkSemaphoreSubmitInfo **km_infos; + uint32_t *km_counts; + unsigned int i, j; + VkResult ret; - if (!(object = calloc(1, sizeof(*object)))) - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("(%p %u %p 0x%s)\n", queue_handle, submit_count, submits_orig, wine_dbgstr_longlong(fence)); - object->instance = instance; - object->user_callback = create_info->pfnCallback; - object->user_data = create_info->pUserData; + init_conversion_context(&ctx); + MEMDUP(&ctx, submits, submits_orig, submit_count); + if ((ret = process_keyed_mutexes(&ctx, device, submit_count, submits_win_ptr, sizeof(*submits), &km_counts, &km_infos))) + return ret; - wine_create_info = *create_info; + for (i = 0; i < submit_count; ++i) + { + timeline_submit_info = wine_vk_find_struct(&submits[i], TIMELINE_SEMAPHORE_SUBMIT_INFO); + d3d12_submit_info = wine_vk_find_struct(&submits_win[i], D3D12_FENCE_SUBMIT_INFO_KHR); + if (d3d12_submit_info && timeline_submit_info) + WARN("Both TIMELINE_SEMAPHORE_SUBMIT_INFO and D3D12_FENCE_SUBMIT_INFO_KHR specified.\n"); + if (d3d12_submit_info && !timeline_submit_info) + { + timeline_submit_info = conversion_context_alloc(&ctx, sizeof(*timeline_submit_info)); + timeline_submit_info->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; + timeline_submit_info->pNext = submits[i].pNext; + timeline_submit_info->waitSemaphoreValueCount = d3d12_submit_info->waitSemaphoreValuesCount; + MEMDUP(&ctx, timeline_submit_info->pWaitSemaphoreValues, d3d12_submit_info->pWaitSemaphoreValues, d3d12_submit_info->waitSemaphoreValuesCount); + timeline_submit_info->signalSemaphoreValueCount = d3d12_submit_info->signalSemaphoreValuesCount; + MEMDUP(&ctx, timeline_submit_info->pSignalSemaphoreValues, d3d12_submit_info->pSignalSemaphoreValues, d3d12_submit_info->signalSemaphoreValuesCount); + submits[i].pNext = timeline_submit_info; + } - wine_create_info.pfnCallback = (void *) debug_report_callback_conversion; - wine_create_info.pUserData = object; + if (timeline_submit_info) + values = &timeline_submit_info->pWaitSemaphoreValues; + else + values = NULL; + unwrap_semaphore_array(&submits[i].pWaitSemaphores, values, submits[i].waitSemaphoreCount, &ctx, FALSE, device); - res = instance->funcs.p_vkCreateDebugReportCallbackEXT(instance->host_instance, &wine_create_info, - NULL, &object->host_debug_callback); - if (res != VK_SUCCESS) - { - free(object); - return res; - } + if (timeline_submit_info) + values = &timeline_submit_info->pSignalSemaphoreValues; + else + values = NULL; + unwrap_semaphore_array(&submits[i].pSignalSemaphores, values, submits[i].signalSemaphoreCount, &ctx, TRUE, device); + if (km_counts && km_counts[i]) + { + if (timeline_submit_info) + { + ts_info_copy = *timeline_submit_info; + timeline_submit_info = &ts_info_copy; + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&timeline_submit_info->pSignalSemaphoreValues, + (timeline_submit_info->signalSemaphoreValueCount + km_counts[i]) * sizeof(*timeline_submit_info->pSignalSemaphoreValues), + timeline_submit_info->signalSemaphoreValueCount * sizeof(*timeline_submit_info->pSignalSemaphoreValues)); + } + else + { + timeline_submit_info = &ts_info_copy; + timeline_submit_info->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; + timeline_submit_info->pNext = submits[i].pNext; + timeline_submit_info->waitSemaphoreValueCount = 0; + timeline_submit_info->signalSemaphoreValueCount = 0; + timeline_submit_info->pSignalSemaphoreValues = conversion_context_alloc(&ctx, km_counts[i] * sizeof(*timeline_submit_info->pSignalSemaphoreValues)); + submits[i].pNext = timeline_submit_info; + } + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&submits[i].pSignalSemaphores, + (submits[i].signalSemaphoreCount + km_counts[i]) * sizeof(*submits[i].pSignalSemaphores), + submits[i].signalSemaphoreCount * sizeof(*submits[i].pSignalSemaphores)); + for (j = 0; j < km_counts[i]; ++j) + { + ((uint64_t *)timeline_submit_info->pSignalSemaphoreValues)[j + timeline_submit_info->signalSemaphoreValueCount++] + = km_infos[i][j].value; + ((VkSemaphore *)submits[i].pSignalSemaphores)[j + submits[i].signalSemaphoreCount++] = km_infos[i][j].semaphore; + } + } - WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance, object, object->host_debug_callback, object); - *callback = wine_debug_report_callback_to_handle(object); + if (submits[i].pCommandBuffers && submits[i].commandBufferCount) + { + VkCommandBuffer *out; - return VK_SUCCESS; + out = conversion_context_alloc(&ctx, submits[i].commandBufferCount * sizeof(*out)); + for (j = 0; j < submits[i].commandBufferCount; ++j) + out[j] = wine_cmd_buffer_from_handle(submits[i].pCommandBuffers[j])->host_command_buffer; + submits[i].pCommandBuffers = out; + } + } + ret = queue->device->funcs.p_vkQueueSubmit(queue->host_queue, submit_count, submits, fence); + free_conversion_context(&ctx); + return ret; } -void wine_vkDestroyDebugReportCallbackEXT(VkInstance handle, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *allocator) +static void duplicate_array_for_unwrapping(struct conversion_context *ctx, void **ptr, unsigned int size) { - struct wine_instance *instance = wine_instance_from_handle(handle); - struct wine_debug_report_callback *object; + duplicate_array_for_unwrapping_copy_size(ctx, ptr, size, size); +} - object = wine_debug_report_callback_from_handle(callback); +static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, + VkFence fence, bool khr, void *submits_win_ptr) +{ + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + struct wine_device *device = queue->device; + struct conversion_context ctx; + VkSemaphoreSubmitInfo **km_infos; + uint32_t *km_counts, count; + VkSubmitInfo2 *submits; + unsigned int i, j; + VkResult ret; - if (!object) - return; + TRACE("(%p, %u, %p, %s)\n", queue_handle, submit_count, submits_orig, wine_dbgstr_longlong(fence)); - instance->funcs.p_vkDestroyDebugReportCallbackEXT(instance->host_instance, object->host_debug_callback, NULL); - WINE_VK_REMOVE_HANDLE_MAPPING(instance, object); + init_conversion_context(&ctx); + MEMDUP(&ctx, submits, submits_orig, submit_count); + if ((ret = process_keyed_mutexes(&ctx, device, submit_count, submits_win_ptr, sizeof(*submits), &km_counts, &km_infos))) + return ret; + for (i = 0; i < submit_count; ++i) + { + duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pWaitSemaphoreInfos, + submits[i].waitSemaphoreInfoCount * sizeof(*submits[i].pWaitSemaphoreInfos)); + for (j = 0; j < submits[i].waitSemaphoreInfoCount; ++j) + unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].semaphore, + &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].value, FALSE); + + count = submits[i].signalSemaphoreInfoCount + (km_counts ? km_counts[i] : 0); + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&submits[i].pSignalSemaphoreInfos, + count * sizeof(*submits[i].pSignalSemaphoreInfos), + submits[i].signalSemaphoreInfoCount * sizeof(*submits[i].pSignalSemaphoreInfos)); + for (j = 0; j < submits[i].signalSemaphoreInfoCount; ++j) + unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].semaphore, + &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].value, TRUE); + for (; j < count; ++j) + ((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j] = km_infos[i][j - submits[i].signalSemaphoreInfoCount]; + submits[i].signalSemaphoreInfoCount = count; + + if (submits[i].pCommandBufferInfos && submits[i].commandBufferInfoCount) + { + duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pCommandBufferInfos, + submits[i].commandBufferInfoCount * sizeof(*submits[i].pCommandBufferInfos)); + for (j = 0; j < submits[i].commandBufferInfoCount; ++j) + ((VkCommandBufferSubmitInfo *)submits[i].pCommandBufferInfos)[j].commandBuffer + = wine_cmd_buffer_from_handle(submits[i].pCommandBufferInfos[j].commandBuffer)->host_command_buffer; + } + } - free(object); + if (khr) + ret = queue->device->funcs.p_vkQueueSubmit2KHR(queue->host_queue, submit_count, submits, fence); + else + ret = queue->device->funcs.p_vkQueueSubmit2(queue->host_queue, submit_count, submits, fence); + free_conversion_context(&ctx); + return ret; } -VkResult wine_vkCreateDeferredOperationKHR(VkDevice handle, - const VkAllocationCallbacks* allocator, - VkDeferredOperationKHR* deferredOperation) +VkResult wine_vkQueueSubmit2(VkQueue queue, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence, + void *submits_win) { - struct wine_device *device = wine_device_from_handle(handle); - struct wine_deferred_operation *object; - VkResult res; + return vk_queue_submit_2(queue, submit_count, submits, fence, false, submits_win); +} - if (allocator) - FIXME("Support for allocation callbacks not implemented yet\n"); +VkResult wine_vkQueueSubmit2KHR(VkQueue queue, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence, + void *submits_win) +{ + return vk_queue_submit_2(queue, submit_count, submits, fence, true, submits_win); +} - if (!(object = calloc(1, sizeof(*object)))) - return VK_ERROR_OUT_OF_HOST_MEMORY; +VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *present_info) +{ + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + VkPresentInfoKHR host_present_info = *present_info; + struct wine_semaphore *semaphore; + struct conversion_context ctx; + unsigned int i; + VkResult ret; - res = device->funcs.p_vkCreateDeferredOperationKHR(device->host_device, NULL, &object->host_deferred_operation); + TRACE("%p %p\n", queue_handle, present_info); - if (res != VK_SUCCESS) + for (i = 0; i < present_info->waitSemaphoreCount; ++i) { - free(object); - return res; - } + semaphore = wine_semaphore_from_handle(present_info->pWaitSemaphores[i]); - init_conversion_context(&object->ctx); - - WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, object, object->host_deferred_operation, object); - *deferredOperation = wine_deferred_operation_to_handle(object); + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Waiting on D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } - return VK_SUCCESS; + init_conversion_context(&ctx); + unwrap_semaphore_array(&host_present_info.pWaitSemaphores, NULL, present_info->waitSemaphoreCount, &ctx, + FALSE, queue->device); + ret = fshack_vk_queue_present(queue_handle, &host_present_info); + free_conversion_context(&ctx); + return ret; } -void wine_vkDestroyDeferredOperationKHR(VkDevice handle, - VkDeferredOperationKHR operation, - const VkAllocationCallbacks* allocator) +VkResult wine_vkQueueBindSparse(VkQueue queue_handle, uint32_t bind_info_count, const VkBindSparseInfo *bind_info, VkFence fence) { - struct wine_device *device = wine_device_from_handle(handle); - struct wine_deferred_operation *object; + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + struct wine_semaphore *semaphore; + struct conversion_context ctx; + VkBindSparseInfo *batch; + unsigned int i, j, k; + VkResult ret; - object = wine_deferred_operation_from_handle(operation); + TRACE("(%p, %u, %p, 0x%s)\n", queue, bind_info_count, bind_info, wine_dbgstr_longlong(fence)); - if (!object) - return; + for (i = 0; i < bind_info_count; i++) + { + batch = (VkBindSparseInfo *)&bind_info[i]; - device->funcs.p_vkDestroyDeferredOperationKHR(device->host_device, object->host_deferred_operation, NULL); - WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, object); + for (k = 0; k < batch->waitSemaphoreCount; k++) + { + semaphore = wine_semaphore_from_handle(batch->pWaitSemaphores[k]); - free_conversion_context(&object->ctx); - free(object); -} + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Waiting on D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } -#ifdef _WIN64 + for(k = 0; k < batch->signalSemaphoreCount; k++) + { + semaphore = wine_semaphore_from_handle(batch->pSignalSemaphores[k]); -NTSTATUS vk_is_available_instance_function(void *arg) -{ - struct is_available_instance_function_params *params = arg; - struct wine_instance *instance = wine_instance_from_handle(params->instance); - return !!vk_funcs->p_vkGetInstanceProcAddr(instance->host_instance, params->name); -} + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Signalling D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + } -NTSTATUS vk_is_available_device_function(void *arg) -{ - struct is_available_device_function_params *params = arg; - struct wine_device *device = wine_device_from_handle(params->device); - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host_device, params->name); -} + init_conversion_context(&ctx); + for (i = 0; i < bind_info_count; ++i) + { + batch = (VkBindSparseInfo *)&bind_info[i]; + unwrap_semaphore_array(&batch->pWaitSemaphores, NULL, batch->waitSemaphoreCount, &ctx, FALSE, queue->device); + unwrap_semaphore_array(&batch->pSignalSemaphores, NULL, batch->signalSemaphoreCount, &ctx, TRUE, queue->device); -#endif /* _WIN64 */ + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pBufferBinds, batch->bufferBindCount * sizeof(*batch->pBufferBinds)); + for (j = 0; j < batch->bufferBindCount; ++j) + { + VkSparseBufferMemoryBindInfo *bind = (VkSparseBufferMemoryBindInfo *)&batch->pBufferBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host_memory; + } -NTSTATUS vk_is_available_instance_function32(void *arg) + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pImageOpaqueBinds, batch->imageOpaqueBindCount * sizeof(*batch->pImageOpaqueBinds)); + for (j = 0; j < batch->imageOpaqueBindCount; ++j) + { + VkSparseImageOpaqueMemoryBindInfo *bind = (VkSparseImageOpaqueMemoryBindInfo *)&batch->pImageOpaqueBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host_memory; + } + + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pImageBinds, batch->imageBindCount * sizeof(*batch->pImageBinds)); + for (j = 0; j < batch->imageBindCount; ++j) + { + VkSparseImageMemoryBindInfo *bind = (VkSparseImageMemoryBindInfo *)&batch->pImageBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseImageMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host_memory; + } + } + ret = queue->device->funcs.p_vkQueueBindSparse(queue->host_queue, bind_info_count, bind_info, fence); + free_conversion_context(&ctx); + return ret; +} + +VkResult wine_wine_vkAcquireKeyedMutex(VkDevice device, VkDeviceMemory memory, uint64_t key, uint32_t timeout_ms) { - struct - { - UINT32 instance; - UINT32 name; - } *params = arg; - struct wine_instance *instance = wine_instance_from_handle(UlongToPtr(params->instance)); - return !!vk_funcs->p_vkGetInstanceProcAddr(instance->host_instance, UlongToPtr(params->name)); + return acquire_keyed_mutex(wine_device_from_handle(device), wine_device_memory_from_handle(memory), key, timeout_ms); } -NTSTATUS vk_is_available_device_function32(void *arg) +VkResult wine_wine_vkReleaseKeyedMutex(VkDevice device, VkDeviceMemory memory, uint64_t key) { - struct - { - UINT32 device; - UINT32 name; - } *params = arg; - struct wine_device *device = wine_device_from_handle(UlongToPtr(params->device)); - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host_device, UlongToPtr(params->name)); + return release_keyed_mutex(wine_device_from_handle(device), wine_device_memory_from_handle(memory), key, NULL); } diff --git a/dlls/winevulkan/vulkan_loader.h b/dlls/winevulkan/vulkan_loader.h index 6f62201f503..70efc2bfa73 100644 --- a/dlls/winevulkan/vulkan_loader.h +++ b/dlls/winevulkan/vulkan_loader.h @@ -20,6 +20,9 @@ #ifndef __WINE_VULKAN_LOADER_H #define __WINE_VULKAN_LOADER_H +#include +#include + #include "ntstatus.h" #define WIN32_NO_STATUS #include @@ -144,6 +147,20 @@ struct is_available_device_function_params const char *name; }; +#define wine_vk_find_struct(s, t) wine_vk_find_struct_((void *)s, VK_STRUCTURE_TYPE_##t) +static inline void *wine_vk_find_struct_(void *s, VkStructureType t) +{ + VkBaseOutStructure *header; + + for (header = s; header; header = header->pNext) + { + if (header->sType == t) + return header; + } + + return NULL; +} + #define UNIX_CALL(code, params) WINE_UNIX_CALL(unix_ ## code, params) #endif /* __WINE_VULKAN_LOADER_H */ diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 12664d361c0..ecd148ea48a 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -24,6 +24,7 @@ #define VK_NO_PROTOTYPES #include +#include #include "vulkan_loader.h" #include "vulkan_thunks.h" @@ -53,6 +54,26 @@ static inline struct wine_cmd_buffer *wine_cmd_buffer_from_handle(VkCommandBuffe return (struct wine_cmd_buffer *)(uintptr_t)handle->base.unix_handle; } +struct wine_semaphore; + +struct local_timeline_semaphore +{ + VkSemaphore sem; + uint64_t value; +}; + +struct pending_d3d12_fence_op +{ + /* Vulkan native local semaphore. */ + struct local_timeline_semaphore local_sem; + + /* Operation values. */ + struct wine_vk_mapping mapping; + struct list entry; + uint64_t virtual_value; + uint64_t shared_physical_value; +}; + struct wine_device { struct vulkan_device_funcs funcs; @@ -64,7 +85,20 @@ struct wine_device struct wine_queue *queues; uint32_t queue_count; + VkQueueFamilyProperties *queue_props; + struct wine_vk_mapping mapping; + + pthread_t signaller_thread; + pthread_mutex_t signaller_mutex; + bool stop; + struct list free_fence_ops_list; + struct list sem_poll_list; + struct local_timeline_semaphore sem_poll_update; + pthread_cond_t sem_poll_updated_cond; + uint64_t sem_poll_update_value; /* set to sem_poll_update.value by signaller thread once update is processed. */ + unsigned int allocated_fence_ops_count; + BOOL keyed_mutexes_enabled; }; static inline struct wine_device *wine_device_from_handle(VkDevice handle) @@ -72,6 +106,50 @@ static inline struct wine_device *wine_device_from_handle(VkDevice handle) return (struct wine_device *)(uintptr_t)handle->base.unix_handle; } +struct fs_hack_image +{ + uint32_t cmd_queue_idx; + VkCommandBuffer cmd; + VkImage swapchain_image; + VkImage user_image; + VkSemaphore blit_finished; + VkImageView user_view, blit_view; + VkDescriptorSet descriptor_set; +}; + +struct wine_swapchain +{ + VkSwapchainKHR host_swapchain; + + /* fs hack data below */ + BOOL fs_hack_enabled; + VkExtent2D user_extent; + VkExtent2D real_extent; + VkRect2D blit_dst; + VkCommandPool *cmd_pools; /* VkCommandPool[device->queue_count] */ + VkDeviceMemory user_image_memory; + uint32_t n_images; + struct fs_hack_image *fs_hack_images; /* struct fs_hack_image[n_images] */ + VkFilter fs_hack_filter; + VkSampler sampler; + VkDescriptorPool descriptor_pool; + VkDescriptorSetLayout descriptor_set_layout; + VkPipelineLayout pipeline_layout; + VkPipeline pipeline; + + struct wine_vk_mapping mapping; +}; + +static inline struct wine_swapchain *wine_swapchain_from_handle(VkSwapchainKHR handle) +{ + return (struct wine_swapchain *)(uintptr_t)handle; +} + +static inline VkSwapchainKHR wine_swapchain_to_handle(struct wine_swapchain *swapchain) +{ + return (VkSwapchainKHR)(uintptr_t)swapchain; +} + struct wine_debug_utils_messenger; struct wine_debug_report_callback @@ -98,6 +176,7 @@ struct wine_instance */ struct wine_phys_dev **phys_devs; uint32_t phys_dev_count; + uint32_t api_version; VkBool32 enable_wrapper_list; struct list wrappers; @@ -128,6 +207,7 @@ struct wine_phys_dev VkPhysicalDeviceMemoryProperties memory_properties; VkExtensionProperties *extensions; uint32_t extension_count; + uint32_t api_version; uint32_t external_memory_align; @@ -172,12 +252,36 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand return (struct wine_cmd_pool *)(uintptr_t)client_ptr->unix_handle; } +struct keyed_mutex_shm +{ + pthread_mutex_t mutex; + uint64_t instance_id_counter; + uint64_t acquired_to_instance; + uint64_t key; + uint64_t timeline_value; + uint64_t timeline_queued_release; +}; + struct wine_device_memory { VkDeviceMemory host_memory; - void *mapping; + VkExternalMemoryHandleTypeFlagBits handle_types; + BOOL inherit; + DWORD access; + HANDLE handle; + void *vm_map; + struct keyed_mutex_shm *keyed_mutex_shm; + VkSemaphore keyed_mutex_sem; + uint64_t keyed_mutex_instance_id; + + struct wine_vk_mapping mapping; }; +static inline VkDeviceMemory wine_device_memory_to_handle(struct wine_device_memory *device_memory) +{ + return (VkDeviceMemory)(uintptr_t)device_memory; +} + static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle) { return (struct wine_device_memory *)(uintptr_t)handle; @@ -222,7 +326,8 @@ static inline VkDebugReportCallbackEXT wine_debug_report_callback_to_handle( struct wine_surface { VkSurfaceKHR host_surface; - VkSurfaceKHR driver_surface; /* wine driver surface */ + VkSurfaceKHR driver_surface; + HWND hwnd; struct wine_vk_mapping mapping; }; @@ -269,6 +374,56 @@ static inline void free_conversion_context(struct conversion_context *pool) free(entry); } +struct wine_semaphore +{ + VkSemaphore semaphore; + + VkExternalSemaphoreHandleTypeFlagBits export_types; + + struct wine_vk_mapping mapping; + + /* mutable members */ + VkExternalSemaphoreHandleTypeFlagBits handle_type; + struct list poll_entry; + struct list pending_waits; + struct list pending_signals; + HANDLE handle; + struct + { + /* Shared mem access mutex. The non-shared parts access is guarded with device global signaller_mutex. */ + pthread_mutex_t mutex; + uint64_t virtual_value, physical_value; + uint64_t last_reset_physical; + uint64_t last_dropped_reset_physical; + struct + { + uint64_t physical_at_reset; + uint64_t virtual_before_reset; + } + reset_backlog[16]; + uint32_t reset_backlog_count; + } *d3d12_fence_shm; + /* The Vulkan shared semaphore is only waited or signaled in signaller_worker(). */ + VkSemaphore fence_timeline_semaphore; +}; + +static inline struct wine_semaphore *wine_semaphore_from_handle(VkSemaphore handle) +{ + return (struct wine_semaphore *)(uintptr_t)handle; +} + +static inline VkSemaphore wine_semaphore_to_handle(struct wine_semaphore *semaphore) +{ + return (VkSemaphore)(uintptr_t)semaphore; +} + +static inline VkSemaphore wine_semaphore_host_handle(struct wine_semaphore *semaphore) +{ + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + return semaphore->fence_timeline_semaphore; + return semaphore->semaphore; +} + static inline void *conversion_context_alloc(struct conversion_context *pool, size_t size) { if (pool->used + size <= sizeof(pool->buffer)) @@ -346,4 +501,16 @@ static inline void *find_next_struct(const void *s, VkStructureType t) return NULL; } +static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data ) +{ + str->Length = lstrlenW(data) * sizeof(WCHAR); + str->MaximumLength = str->Length + sizeof(WCHAR); + str->Buffer = (WCHAR *)data; +} + +#define MEMDUP(ctx, dst, src, count) dst = conversion_context_alloc((ctx), sizeof(*(dst)) * (count)); \ + memcpy((void *)(dst), (src), sizeof(*(dst)) * (count)); +#define MEMDUP_VOID(ctx, dst, src, size) dst = conversion_context_alloc((ctx), size); \ + memcpy((void *)(dst), (src), size); + #endif /* __WINE_VULKAN_PRIVATE_H */ diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c deleted file mode 100644 index 166ce23ad03..00000000000 --- a/dlls/winevulkan/vulkan_thunks.c +++ /dev/null @@ -1,46008 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#if 0 -#pragma makedep unix -#endif - -#include "config.h" - -#include - -#include "vulkan_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vulkan); - -typedef struct VkAcquireNextImageInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHR32; - -typedef struct VkPerformanceConfigurationAcquireInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceConfigurationTypeINTEL type; -} VkPerformanceConfigurationAcquireInfoINTEL32; - -typedef struct VkAcquireProfilingLockInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAcquireProfilingLockFlagsKHR flags; - uint64_t DECLSPEC_ALIGN(8) timeout; -} VkAcquireProfilingLockInfoKHR32; - -typedef struct VkCommandBufferAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo32; - -typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t descriptorSetCount; - PTR32 pDescriptorCounts; -} VkDescriptorSetVariableDescriptorCountAllocateInfo32; -typedef VkDescriptorSetVariableDescriptorCountAllocateInfo32 VkDescriptorSetVariableDescriptorCountAllocateInfoEXT32; - -typedef struct VkDescriptorSetAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - PTR32 pSetLayouts; -} VkDescriptorSetAllocateInfo32; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV32; - -typedef struct VkExportMemoryAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExportMemoryAllocateInfo32; -typedef VkExportMemoryAllocateInfo32 VkExportMemoryAllocateInfoKHR32; - -typedef struct VkImportMemoryWin32HandleInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR32; - -typedef struct VkExportMemoryWin32HandleInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR32; - -typedef struct VkMemoryAllocateFlagsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryAllocateFlags flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfo32; -typedef VkMemoryAllocateFlagsInfo32 VkMemoryAllocateFlagsInfoKHR32; - -typedef struct VkMemoryDedicatedAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkMemoryDedicatedAllocateInfo32; -typedef VkMemoryDedicatedAllocateInfo32 VkMemoryDedicatedAllocateInfoKHR32; - -typedef struct VkImportMemoryHostPointerInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - PTR32 pHostPointer; -} VkImportMemoryHostPointerInfoEXT32; - -typedef struct VkMemoryPriorityAllocateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float priority; -} VkMemoryPriorityAllocateInfoEXT32; - -typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) opaqueCaptureAddress; -} VkMemoryOpaqueCaptureAddressAllocateInfo32; -typedef VkMemoryOpaqueCaptureAddressAllocateInfo32 VkMemoryOpaqueCaptureAddressAllocateInfoKHR32; - -typedef struct VkMemoryAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo32; - -typedef struct VkCommandBufferInheritanceConditionalRenderingInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 conditionalRenderingEnable; -} VkCommandBufferInheritanceConditionalRenderingInfoEXT32; - -typedef struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; - VkRect2D renderArea; -} VkCommandBufferInheritanceRenderPassTransformInfoQCOM32; - -typedef struct VkCommandBufferInheritanceViewportScissorInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 viewportScissor2D; - uint32_t viewportDepthCount; - PTR32 pViewportDepths; -} VkCommandBufferInheritanceViewportScissorInfoNV32; - -typedef struct VkCommandBufferInheritanceRenderingInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderingFlags flags; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; - VkSampleCountFlagBits rasterizationSamples; -} VkCommandBufferInheritanceRenderingInfo32; -typedef VkCommandBufferInheritanceRenderingInfo32 VkCommandBufferInheritanceRenderingInfoKHR32; - -typedef struct VkAttachmentSampleCountInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentSamples; - VkSampleCountFlagBits depthStencilAttachmentSamples; -} VkAttachmentSampleCountInfoAMD32; -typedef VkAttachmentSampleCountInfoAMD32 VkAttachmentSampleCountInfoNV32; - -typedef struct VkMultiviewPerViewAttributesInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 perViewAttributes; - VkBool32 perViewAttributesPositionXOnly; -} VkMultiviewPerViewAttributesInfoNVX32; - -typedef struct VkCommandBufferInheritanceInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo32; - -typedef struct VkDeviceGroupCommandBufferBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfo32; -typedef VkDeviceGroupCommandBufferBeginInfo32 VkDeviceGroupCommandBufferBeginInfoKHR32; - -typedef struct VkCommandBufferBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandBufferUsageFlags flags; - PTR32 pInheritanceInfo; -} VkCommandBufferBeginInfo32; - -typedef struct VkBindAccelerationStructureMemoryInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; -} VkBindAccelerationStructureMemoryInfoNV32; - -typedef struct VkBindBufferMemoryDeviceGroupInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfo32; -typedef VkBindBufferMemoryDeviceGroupInfo32 VkBindBufferMemoryDeviceGroupInfoKHR32; - -typedef struct VkBindBufferMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; -} VkBindBufferMemoryInfo32; -typedef VkBindBufferMemoryInfo32 VkBindBufferMemoryInfoKHR32; - -typedef struct VkBindImageMemoryDeviceGroupInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; - uint32_t splitInstanceBindRegionCount; - PTR32 pSplitInstanceBindRegions; -} VkBindImageMemoryDeviceGroupInfo32; -typedef VkBindImageMemoryDeviceGroupInfo32 VkBindImageMemoryDeviceGroupInfoKHR32; - -typedef struct VkBindImageMemorySwapchainInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHR32; - -typedef struct VkBindImagePlaneMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfo32; -typedef VkBindImagePlaneMemoryInfo32 VkBindImagePlaneMemoryInfoKHR32; - -typedef struct VkBindImageMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; -} VkBindImageMemoryInfo32; -typedef VkBindImageMemoryInfo32 VkBindImageMemoryInfoKHR32; - -typedef struct VkAccelerationStructureGeometryMotionTrianglesDataNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) vertexData; -} VkAccelerationStructureGeometryMotionTrianglesDataNV32; - -typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) indexBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) indexStride; - uint32_t baseTriangle; - uint32_t usageCountsCount; - PTR32 pUsageCounts; - PTR32 ppUsageCounts; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; -} VkAccelerationStructureTrianglesOpacityMicromapEXT32; - -typedef struct VkAccelerationStructureGeometryTrianglesDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat vertexFormat; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) vertexData; - VkDeviceSize DECLSPEC_ALIGN(8) vertexStride; - uint32_t maxVertex; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) indexData; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) transformData; -} VkAccelerationStructureGeometryTrianglesDataKHR32; - -typedef struct VkAccelerationStructureGeometryAabbsDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; - VkDeviceSize DECLSPEC_ALIGN(8) stride; -} VkAccelerationStructureGeometryAabbsDataKHR32; - -typedef struct VkAccelerationStructureGeometryInstancesDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 arrayOfPointers; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; -} VkAccelerationStructureGeometryInstancesDataKHR32; - -typedef union VkAccelerationStructureGeometryDataKHR32 -{ - VkAccelerationStructureGeometryTrianglesDataKHR32 DECLSPEC_ALIGN(8) triangles; - VkAccelerationStructureGeometryAabbsDataKHR32 DECLSPEC_ALIGN(8) aabbs; - VkAccelerationStructureGeometryInstancesDataKHR32 DECLSPEC_ALIGN(8) instances; -} VkAccelerationStructureGeometryDataKHR32; - -typedef struct VkAccelerationStructureGeometryKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkGeometryTypeKHR geometryType; - VkAccelerationStructureGeometryDataKHR32 DECLSPEC_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkAccelerationStructureGeometryKHR32; - -typedef struct VkAccelerationStructureBuildGeometryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureTypeKHR type; - VkBuildAccelerationStructureFlagsKHR flags; - VkBuildAccelerationStructureModeKHR mode; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) srcAccelerationStructure; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dstAccelerationStructure; - uint32_t geometryCount; - PTR32 pGeometries; - PTR32 ppGeometries; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) scratchData; -} VkAccelerationStructureBuildGeometryInfoKHR32; - -typedef struct VkMicromapBuildInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapTypeEXT type; - VkBuildMicromapFlagsEXT flags; - VkBuildMicromapModeEXT mode; - VkMicromapEXT DECLSPEC_ALIGN(8) dstMicromap; - uint32_t usageCountsCount; - PTR32 pUsageCounts; - PTR32 ppUsageCounts; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) scratchData; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) triangleArray; - VkDeviceSize DECLSPEC_ALIGN(8) triangleArrayStride; -} VkMicromapBuildInfoEXT32; - -typedef struct VkConditionalRenderingBeginInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkConditionalRenderingFlagsEXT flags; -} VkConditionalRenderingBeginInfoEXT32; - -typedef struct VkDebugUtilsLabelEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pLabelName; - float color[4]; -} VkDebugUtilsLabelEXT32; - -typedef struct VkSampleLocationsInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - PTR32 pSampleLocations; -} VkSampleLocationsInfoEXT32; - -typedef struct VkAttachmentSampleLocationsEXT32 -{ - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT32; - -typedef struct VkSubpassSampleLocationsEXT32 -{ - uint32_t subpassIndex; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkSubpassSampleLocationsEXT32; - -typedef struct VkDeviceGroupRenderPassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - PTR32 pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfo32; -typedef VkDeviceGroupRenderPassBeginInfo32 VkDeviceGroupRenderPassBeginInfoKHR32; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentInitialSampleLocationsCount; - PTR32 pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - PTR32 pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT32; - -typedef struct VkRenderPassAttachmentBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentCount; - PTR32 pAttachments; -} VkRenderPassAttachmentBeginInfo32; -typedef VkRenderPassAttachmentBeginInfo32 VkRenderPassAttachmentBeginInfoKHR32; - -typedef struct VkRenderPassTransformBeginInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkRenderPassTransformBeginInfoQCOM32; - -typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t perViewRenderAreaCount; - PTR32 pPerViewRenderAreas; -} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32; - -typedef struct VkRenderPassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - PTR32 pClearValues; -} VkRenderPassBeginInfo32; - -typedef struct VkSubpassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSubpassContents contents; -} VkSubpassBeginInfo32; -typedef VkSubpassBeginInfo32 VkSubpassBeginInfoKHR32; - -typedef struct VkRenderingAttachmentInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkResolveModeFlagBits resolveMode; - VkImageView DECLSPEC_ALIGN(8) resolveImageView; - VkImageLayout resolveImageLayout; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkClearValue clearValue; -} VkRenderingAttachmentInfo32; -typedef VkRenderingAttachmentInfo32 VkRenderingAttachmentInfoKHR32; - -typedef struct VkMultisampledRenderToSingleSampledInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multisampledRenderToSingleSampledEnable; - VkSampleCountFlagBits rasterizationSamples; -} VkMultisampledRenderToSingleSampledInfoEXT32; - -typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkExtent2D shadingRateAttachmentTexelSize; -} VkRenderingFragmentShadingRateAttachmentInfoKHR32; - -typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkRenderingFragmentDensityMapAttachmentInfoEXT32; - -typedef struct VkRenderingInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderingFlags flags; - VkRect2D renderArea; - uint32_t layerCount; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pDepthAttachment; - PTR32 pStencilAttachment; -} VkRenderingInfo32; -typedef VkRenderingInfo32 VkRenderingInfoKHR32; - -typedef struct VkBufferUsageFlags2CreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferUsageFlags2KHR DECLSPEC_ALIGN(8) usage; -} VkBufferUsageFlags2CreateInfoKHR32; - -typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32; - -typedef struct VkDescriptorBufferBindingInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) address; - VkBufferUsageFlags usage; -} VkDescriptorBufferBindingInfoEXT32; - -typedef struct VkCopyCommandTransformInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkCopyCommandTransformInfoQCOM32; - -typedef struct VkImageBlit232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit232; -typedef VkImageBlit232 VkImageBlit2KHR32; - -typedef struct VkBlitImageCubicWeightsInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkBlitImageCubicWeightsInfoQCOM32; - -typedef struct VkBlitImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - VkFilter filter; -} VkBlitImageInfo232; -typedef VkBlitImageInfo232 VkBlitImageInfo2KHR32; - -typedef struct VkGeometryTrianglesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) vertexData; - VkDeviceSize DECLSPEC_ALIGN(8) vertexOffset; - uint32_t vertexCount; - VkDeviceSize DECLSPEC_ALIGN(8) vertexStride; - VkFormat vertexFormat; - VkBuffer DECLSPEC_ALIGN(8) indexData; - VkDeviceSize DECLSPEC_ALIGN(8) indexOffset; - uint32_t indexCount; - VkIndexType indexType; - VkBuffer DECLSPEC_ALIGN(8) transformData; - VkDeviceSize DECLSPEC_ALIGN(8) transformOffset; -} VkGeometryTrianglesNV32; - -typedef struct VkGeometryAABBNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) aabbData; - uint32_t numAABBs; - uint32_t stride; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -} VkGeometryAABBNV32; - -typedef struct VkGeometryDataNV32 -{ - VkGeometryTrianglesNV32 DECLSPEC_ALIGN(8) triangles; - VkGeometryAABBNV32 DECLSPEC_ALIGN(8) aabbs; -} VkGeometryDataNV32; - -typedef struct VkGeometryNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkGeometryTypeKHR geometryType; - VkGeometryDataNV32 DECLSPEC_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkGeometryNV32; - -typedef struct VkAccelerationStructureInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureTypeNV type; - VkBuildAccelerationStructureFlagsNV flags; - uint32_t instanceCount; - uint32_t geometryCount; - PTR32 pGeometries; -} VkAccelerationStructureInfoNV32; - -typedef struct VkCopyAccelerationStructureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) src; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureInfoKHR32; - -typedef struct VkCopyAccelerationStructureToMemoryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) src; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureToMemoryInfoKHR32; - -typedef struct VkBufferCopy32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) srcOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferCopy32; - -typedef struct VkBufferCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) srcOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferCopy232; -typedef VkBufferCopy232 VkBufferCopy2KHR32; - -typedef struct VkCopyBufferInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyBufferInfo232; -typedef VkCopyBufferInfo232 VkCopyBufferInfo2KHR32; - -typedef struct VkBufferImageCopy32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy32; - -typedef struct VkBufferImageCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy232; -typedef VkBufferImageCopy232 VkBufferImageCopy2KHR32; - -typedef struct VkCopyBufferToImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyBufferToImageInfo232; -typedef VkCopyBufferToImageInfo232 VkCopyBufferToImageInfo2KHR32; - -typedef struct VkImageCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy232; -typedef VkImageCopy232 VkImageCopy2KHR32; - -typedef struct VkCopyImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageInfo232; -typedef VkCopyImageInfo232 VkCopyImageInfo2KHR32; - -typedef struct VkCopyImageToBufferInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToBufferInfo232; -typedef VkCopyImageToBufferInfo232 VkCopyImageToBufferInfo2KHR32; - -typedef struct VkCopyMemoryToAccelerationStructureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) src; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyMemoryToAccelerationStructureInfoKHR32; - -typedef struct VkCopyMemoryToMicromapInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) src; - VkMicromapEXT DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMemoryToMicromapInfoEXT32; - -typedef struct VkCopyMicromapInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapEXT DECLSPEC_ALIGN(8) src; - VkMicromapEXT DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapInfoEXT32; - -typedef struct VkCopyMicromapToMemoryInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapEXT DECLSPEC_ALIGN(8) src; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapToMemoryInfoEXT32; - -typedef struct VkCuLaunchInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - PTR32 paramCount; - PTR32 pParams; - PTR32 extraCount; - PTR32 pExtras; -} VkCuLaunchInfoNVX32; - -typedef struct VkCudaLaunchInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - PTR32 paramCount; - PTR32 pParams; - PTR32 extraCount; - PTR32 pExtras; -} VkCudaLaunchInfoNV32; - -typedef struct VkDebugMarkerMarkerInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT32; - -typedef struct VkDecompressMemoryRegionNV32 -{ - VkDeviceAddress DECLSPEC_ALIGN(8) srcAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) dstAddress; - VkDeviceSize DECLSPEC_ALIGN(8) compressedSize; - VkDeviceSize DECLSPEC_ALIGN(8) decompressedSize; - VkMemoryDecompressionMethodFlagsNV DECLSPEC_ALIGN(8) decompressionMethod; -} VkDecompressMemoryRegionNV32; - -typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t fragmentDensityOffsetCount; - PTR32 pFragmentDensityOffsets; -} VkSubpassFragmentDensityMapOffsetEndInfoQCOM32; - -typedef struct VkSubpassEndInfo32 -{ - VkStructureType sType; - PTR32 pNext; -} VkSubpassEndInfo32; -typedef VkSubpassEndInfo32 VkSubpassEndInfoKHR32; - -typedef struct VkIndirectCommandsStreamNV32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -} VkIndirectCommandsStreamNV32; - -typedef struct VkGeneratedCommandsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - uint32_t streamCount; - PTR32 pStreams; - uint32_t sequencesCount; - VkBuffer DECLSPEC_ALIGN(8) preprocessBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) preprocessOffset; - VkDeviceSize DECLSPEC_ALIGN(8) preprocessSize; - VkBuffer DECLSPEC_ALIGN(8) sequencesCountBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) sequencesCountOffset; - VkBuffer DECLSPEC_ALIGN(8) sequencesIndexBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) sequencesIndexOffset; -} VkGeneratedCommandsInfoNV32; - -typedef struct VkOpticalFlowExecuteInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowExecuteFlagsNV flags; - uint32_t regionCount; - PTR32 pRegions; -} VkOpticalFlowExecuteInfoNV32; - -typedef struct VkMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier32; - -typedef struct VkExternalMemoryAcquireUnmodifiedEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 acquireUnmodifiedMemory; -} VkExternalMemoryAcquireUnmodifiedEXT32; - -typedef struct VkBufferMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferMemoryBarrier32; - -typedef struct VkImageMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage DECLSPEC_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier32; - -typedef struct VkMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; -} VkMemoryBarrier232; -typedef VkMemoryBarrier232 VkMemoryBarrier2KHR32; - -typedef struct VkBufferMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferMemoryBarrier232; -typedef VkBufferMemoryBarrier232 VkBufferMemoryBarrier2KHR32; - -typedef struct VkImageMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage DECLSPEC_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier232; -typedef VkImageMemoryBarrier232 VkImageMemoryBarrier2KHR32; - -typedef struct VkDependencyInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; -} VkDependencyInfo32; -typedef VkDependencyInfo32 VkDependencyInfoKHR32; - -typedef struct VkDescriptorImageInfo32 -{ - VkSampler DECLSPEC_ALIGN(8) sampler; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo32; - -typedef struct VkDescriptorBufferInfo32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) range; -} VkDescriptorBufferInfo32; - -typedef struct VkWriteDescriptorSetInlineUniformBlock32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t dataSize; - PTR32 pData; -} VkWriteDescriptorSetInlineUniformBlock32; -typedef VkWriteDescriptorSetInlineUniformBlock32 VkWriteDescriptorSetInlineUniformBlockEXT32; - -typedef struct VkWriteDescriptorSetAccelerationStructureKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureKHR32; - -typedef struct VkWriteDescriptorSetAccelerationStructureNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureNV32; - -typedef struct VkWriteDescriptorSet32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSet DECLSPEC_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - PTR32 pImageInfo; - PTR32 pBufferInfo; - PTR32 pTexelBufferView; -} VkWriteDescriptorSet32; - -typedef struct VkImageResolve232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve232; -typedef VkImageResolve232 VkImageResolve2KHR32; - -typedef struct VkResolveImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkResolveImageInfo232; -typedef VkResolveImageInfo232 VkResolveImageInfo2KHR32; - -typedef struct VkCoarseSampleOrderCustomNV32 -{ - VkShadingRatePaletteEntryNV shadingRate; - uint32_t sampleCount; - uint32_t sampleLocationCount; - PTR32 pSampleLocations; -} VkCoarseSampleOrderCustomNV32; - -typedef struct VkDepthBiasRepresentationInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDepthBiasRepresentationEXT depthBiasRepresentation; - VkBool32 depthBiasExact; -} VkDepthBiasRepresentationInfoEXT32; - -typedef struct VkDepthBiasInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -} VkDepthBiasInfoEXT32; - -typedef struct VkPerformanceMarkerInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) marker; -} VkPerformanceMarkerInfoINTEL32; - -typedef struct VkPerformanceOverrideInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceOverrideTypeINTEL type; - VkBool32 enable; - uint64_t DECLSPEC_ALIGN(8) parameter; -} VkPerformanceOverrideInfoINTEL32; - -typedef struct VkPerformanceStreamMarkerInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t marker; -} VkPerformanceStreamMarkerInfoINTEL32; - -typedef struct VkVertexInputBindingDescription2EXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; - uint32_t divisor; -} VkVertexInputBindingDescription2EXT32; - -typedef struct VkVertexInputAttributeDescription2EXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription2EXT32; - -typedef struct VkShadingRatePaletteNV32 -{ - uint32_t shadingRatePaletteEntryCount; - PTR32 pShadingRatePaletteEntries; -} VkShadingRatePaletteNV32; - -typedef struct VkStridedDeviceAddressRegionKHR32 -{ - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkStridedDeviceAddressRegionKHR32; - -typedef struct VkCopyImageToImageInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlagsEXT flags; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToImageInfoEXT32; - -typedef struct VkImageToMemoryCopyEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkImageToMemoryCopyEXT32; - -typedef struct VkCopyImageToMemoryInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlagsEXT flags; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToMemoryInfoEXT32; - -typedef struct VkMemoryToImageCopyEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkMemoryToImageCopyEXT32; - -typedef struct VkCopyMemoryToImageInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlagsEXT flags; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyMemoryToImageInfoEXT32; - -typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 opaqueCaptureDescriptorData; -} VkOpaqueCaptureDescriptorDataCreateInfoEXT32; - -typedef struct VkAccelerationStructureMotionInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInstances; - VkAccelerationStructureMotionInfoFlagsNV flags; -} VkAccelerationStructureMotionInfoNV32; - -typedef struct VkAccelerationStructureCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureCreateFlagsKHR createFlags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkAccelerationStructureTypeKHR type; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkAccelerationStructureCreateInfoKHR32; - -typedef struct VkAccelerationStructureCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) compactedSize; - VkAccelerationStructureInfoNV32 info; -} VkAccelerationStructureCreateInfoNV32; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV32; - -typedef struct VkExternalMemoryBufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryBufferCreateInfo32; -typedef VkExternalMemoryBufferCreateInfo32 VkExternalMemoryBufferCreateInfoKHR32; - -typedef struct VkBufferOpaqueCaptureAddressCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) opaqueCaptureAddress; -} VkBufferOpaqueCaptureAddressCreateInfo32; -typedef VkBufferOpaqueCaptureAddressCreateInfo32 VkBufferOpaqueCaptureAddressCreateInfoKHR32; - -typedef struct VkBufferDeviceAddressCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkBufferDeviceAddressCreateInfoEXT32; - -typedef struct VkBufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferCreateFlags flags; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; -} VkBufferCreateInfo32; - -typedef struct VkBufferViewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferViewCreateFlags flags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkFormat format; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) range; -} VkBufferViewCreateInfo32; - -typedef struct VkCommandPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo32; - -typedef struct VkPipelineCreationFeedback32 -{ - VkPipelineCreationFeedbackFlags flags; - uint64_t DECLSPEC_ALIGN(8) duration; -} VkPipelineCreationFeedback32; -typedef VkPipelineCreationFeedback32 VkPipelineCreationFeedbackEXT32; - -typedef struct VkSpecializationMapEntry32 -{ - uint32_t constantID; - uint32_t offset; - PTR32 size; -} VkSpecializationMapEntry32; - -typedef struct VkSpecializationInfo32 -{ - uint32_t mapEntryCount; - PTR32 pMapEntries; - PTR32 dataSize; - PTR32 pData; -} VkSpecializationInfo32; - -typedef struct VkShaderModuleCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderModuleCreateFlags flags; - PTR32 codeSize; - PTR32 pCode; -} VkShaderModuleCreateInfo32; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT32; - -typedef struct VkDebugUtilsObjectNameInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - PTR32 pObjectName; -} VkDebugUtilsObjectNameInfoEXT32; - -typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t requiredSubgroupSize; -} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT32; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 VkShaderRequiredSubgroupSizeCreateInfoEXT32; - -typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t identifierSize; - PTR32 pIdentifier; -} VkPipelineShaderStageModuleIdentifierCreateInfoEXT32; - -typedef struct VkPipelineRobustnessCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRobustnessBufferBehaviorEXT storageBuffers; - VkPipelineRobustnessBufferBehaviorEXT uniformBuffers; - VkPipelineRobustnessBufferBehaviorEXT vertexInputs; - VkPipelineRobustnessImageBehaviorEXT images; -} VkPipelineRobustnessCreateInfoEXT32; - -typedef struct VkPipelineShaderStageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule DECLSPEC_ALIGN(8) module; - PTR32 pName; - PTR32 pSpecializationInfo; -} VkPipelineShaderStageCreateInfo32; - -typedef struct VkPipelineCreateFlags2CreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags2KHR DECLSPEC_ALIGN(8) flags; -} VkPipelineCreateFlags2CreateInfoKHR32; - -typedef struct VkPipelineCreationFeedbackCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pPipelineCreationFeedback; - uint32_t pipelineStageCreationFeedbackCount; - PTR32 pPipelineStageCreationFeedbacks; -} VkPipelineCreationFeedbackCreateInfo32; -typedef VkPipelineCreationFeedbackCreateInfo32 VkPipelineCreationFeedbackCreateInfoEXT32; - -typedef struct VkSubpassShadingPipelineCreateInfoHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; -} VkSubpassShadingPipelineCreateInfoHUAWEI32; - -typedef struct VkPipelineCompilerControlCreateInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCompilerControlFlagsAMD compilerControlFlags; -} VkPipelineCompilerControlCreateInfoAMD32; - -typedef struct VkComputePipelineCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo32 DECLSPEC_ALIGN(8) stage; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo32; - -typedef struct VkCuFunctionCreateInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - PTR32 pName; -} VkCuFunctionCreateInfoNVX32; - -typedef struct VkCuModuleCreateInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 dataSize; - PTR32 pData; -} VkCuModuleCreateInfoNVX32; - -typedef struct VkCudaFunctionCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pName; -} VkCudaFunctionCreateInfoNV32; - -typedef struct VkCudaModuleCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 dataSize; - PTR32 pData; -} VkCudaModuleCreateInfoNV32; - -typedef struct VkDebugReportCallbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - PTR32 pUserData; -} VkDebugReportCallbackCreateInfoEXT32; - -typedef struct VkDebugUtilsMessengerCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugUtilsMessengerCreateFlagsEXT flags; - VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageType; - PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; - PTR32 pUserData; -} VkDebugUtilsMessengerCreateInfoEXT32; - -typedef struct VkMutableDescriptorTypeListEXT32 -{ - uint32_t descriptorTypeCount; - PTR32 pDescriptorTypes; -} VkMutableDescriptorTypeListEXT32; -typedef VkMutableDescriptorTypeListEXT32 VkMutableDescriptorTypeListVALVE32; - -typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInlineUniformBlockBindings; -} VkDescriptorPoolInlineUniformBlockCreateInfo32; -typedef VkDescriptorPoolInlineUniformBlockCreateInfo32 VkDescriptorPoolInlineUniformBlockCreateInfoEXT32; - -typedef struct VkMutableDescriptorTypeCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t mutableDescriptorTypeListCount; - PTR32 pMutableDescriptorTypeLists; -} VkMutableDescriptorTypeCreateInfoEXT32; -typedef VkMutableDescriptorTypeCreateInfoEXT32 VkMutableDescriptorTypeCreateInfoVALVE32; - -typedef struct VkDescriptorPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - PTR32 pPoolSizes; -} VkDescriptorPoolCreateInfo32; - -typedef struct VkDescriptorSetLayoutBinding32 -{ - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - PTR32 pImmutableSamplers; -} VkDescriptorSetLayoutBinding32; - -typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t bindingCount; - PTR32 pBindingFlags; -} VkDescriptorSetLayoutBindingFlagsCreateInfo32; -typedef VkDescriptorSetLayoutBindingFlagsCreateInfo32 VkDescriptorSetLayoutBindingFlagsCreateInfoEXT32; - -typedef struct VkDescriptorSetLayoutCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - PTR32 pBindings; -} VkDescriptorSetLayoutCreateInfo32; - -typedef struct VkDescriptorUpdateTemplateEntry32 -{ - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - PTR32 offset; - PTR32 stride; -} VkDescriptorUpdateTemplateEntry32; -typedef VkDescriptorUpdateTemplateEntry32 VkDescriptorUpdateTemplateEntryKHR32; - -typedef struct VkDescriptorUpdateTemplateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorUpdateTemplateCreateFlags flags; - uint32_t descriptorUpdateEntryCount; - PTR32 pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateType templateType; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfo32; -typedef VkDescriptorUpdateTemplateCreateInfo32 VkDescriptorUpdateTemplateCreateInfoKHR32; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueGlobalPriorityKHR globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfoKHR32; -typedef VkDeviceQueueGlobalPriorityCreateInfoKHR32 VkDeviceQueueGlobalPriorityCreateInfoEXT32; - -typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderCoreCount; -} VkDeviceQueueShaderCoreControlCreateInfoARM32; - -typedef struct VkDeviceQueueCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - PTR32 pQueuePriorities; -} VkDeviceQueueCreateInfo32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceGeneratedCommands; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceGeneratedCompute; - VkBool32 deviceGeneratedComputePipelines; - VkBool32 deviceGeneratedComputeCaptureReplay; -} VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32; - -typedef struct VkDevicePrivateDataCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t privateDataSlotRequestCount; -} VkDevicePrivateDataCreateInfo32; -typedef VkDevicePrivateDataCreateInfo32 VkDevicePrivateDataCreateInfoEXT32; - -typedef struct VkPhysicalDevicePrivateDataFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 privateData; -} VkPhysicalDevicePrivateDataFeatures32; -typedef VkPhysicalDevicePrivateDataFeatures32 VkPhysicalDevicePrivateDataFeaturesEXT32; - -typedef struct VkPhysicalDeviceFeatures232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures232; -typedef VkPhysicalDeviceFeatures232 VkPhysicalDeviceFeatures2KHR32; - -typedef struct VkPhysicalDeviceVariablePointersFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointersFeatures32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointersFeaturesKHR32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointerFeaturesKHR32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointerFeatures32; - -typedef struct VkPhysicalDeviceMultiviewFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeatures32; -typedef VkPhysicalDeviceMultiviewFeatures32 VkPhysicalDeviceMultiviewFeaturesKHR32; - -typedef struct VkDeviceGroupDeviceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t physicalDeviceCount; - PTR32 pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfo32; -typedef VkDeviceGroupDeviceCreateInfo32 VkDeviceGroupDeviceCreateInfoKHR32; - -typedef struct VkPhysicalDevicePresentIdFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentId; -} VkPhysicalDevicePresentIdFeaturesKHR32; - -typedef struct VkPhysicalDevicePresentWaitFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentWait; -} VkPhysicalDevicePresentWaitFeaturesKHR32; - -typedef struct VkPhysicalDevice16BitStorageFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeatures32; -typedef VkPhysicalDevice16BitStorageFeatures32 VkPhysicalDevice16BitStorageFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupExtendedTypes; -} VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32; -typedef VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR32; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeatures32; -typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures32 VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR32; - -typedef struct VkPhysicalDeviceProtectedMemoryFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeatures32; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32; - -typedef struct VkPhysicalDeviceMultiDrawFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiDraw; -} VkPhysicalDeviceMultiDrawFeaturesEXT32; - -typedef struct VkPhysicalDeviceInlineUniformBlockFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; -} VkPhysicalDeviceInlineUniformBlockFeatures32; -typedef VkPhysicalDeviceInlineUniformBlockFeatures32 VkPhysicalDeviceInlineUniformBlockFeaturesEXT32; - -typedef struct VkPhysicalDeviceMaintenance4Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 maintenance4; -} VkPhysicalDeviceMaintenance4Features32; -typedef VkPhysicalDeviceMaintenance4Features32 VkPhysicalDeviceMaintenance4FeaturesKHR32; - -typedef struct VkPhysicalDeviceMaintenance5FeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 maintenance5; -} VkPhysicalDeviceMaintenance5FeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceShaderDrawParametersFeatures32; -typedef VkPhysicalDeviceShaderDrawParametersFeatures32 VkPhysicalDeviceShaderDrawParameterFeatures32; - -typedef struct VkPhysicalDeviceShaderFloat16Int8Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; -} VkPhysicalDeviceShaderFloat16Int8Features32; -typedef VkPhysicalDeviceShaderFloat16Int8Features32 VkPhysicalDeviceShaderFloat16Int8FeaturesKHR32; -typedef VkPhysicalDeviceShaderFloat16Int8Features32 VkPhysicalDeviceFloat16Int8FeaturesKHR32; - -typedef struct VkPhysicalDeviceHostQueryResetFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hostQueryReset; -} VkPhysicalDeviceHostQueryResetFeatures32; -typedef VkPhysicalDeviceHostQueryResetFeatures32 VkPhysicalDeviceHostQueryResetFeaturesEXT32; - -typedef struct VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 globalPriorityQuery; -} VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32; -typedef VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT32; - -typedef struct VkPhysicalDeviceDescriptorIndexingFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; -} VkPhysicalDeviceDescriptorIndexingFeatures32; -typedef VkPhysicalDeviceDescriptorIndexingFeatures32 VkPhysicalDeviceDescriptorIndexingFeaturesEXT32; - -typedef struct VkPhysicalDeviceTimelineSemaphoreFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 timelineSemaphore; -} VkPhysicalDeviceTimelineSemaphoreFeatures32; -typedef VkPhysicalDeviceTimelineSemaphoreFeatures32 VkPhysicalDeviceTimelineSemaphoreFeaturesKHR32; - -typedef struct VkPhysicalDevice8BitStorageFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; -} VkPhysicalDevice8BitStorageFeatures32; -typedef VkPhysicalDevice8BitStorageFeatures32 VkPhysicalDevice8BitStorageFeaturesKHR32; - -typedef struct VkPhysicalDeviceConditionalRenderingFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 conditionalRendering; - VkBool32 inheritedConditionalRendering; -} VkPhysicalDeviceConditionalRenderingFeaturesEXT32; - -typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; -} VkPhysicalDeviceVulkanMemoryModelFeatures32; -typedef VkPhysicalDeviceVulkanMemoryModelFeatures32 VkPhysicalDeviceVulkanMemoryModelFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderAtomicInt64Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; -} VkPhysicalDeviceShaderAtomicInt64Features32; -typedef VkPhysicalDeviceShaderAtomicInt64Features32 VkPhysicalDeviceShaderAtomicInt64FeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferFloat32Atomics; - VkBool32 shaderBufferFloat32AtomicAdd; - VkBool32 shaderBufferFloat64Atomics; - VkBool32 shaderBufferFloat64AtomicAdd; - VkBool32 shaderSharedFloat32Atomics; - VkBool32 shaderSharedFloat32AtomicAdd; - VkBool32 shaderSharedFloat64Atomics; - VkBool32 shaderSharedFloat64AtomicAdd; - VkBool32 shaderImageFloat32Atomics; - VkBool32 shaderImageFloat32AtomicAdd; - VkBool32 sparseImageFloat32Atomics; - VkBool32 sparseImageFloat32AtomicAdd; -} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferFloat16Atomics; - VkBool32 shaderBufferFloat16AtomicAdd; - VkBool32 shaderBufferFloat16AtomicMinMax; - VkBool32 shaderBufferFloat32AtomicMinMax; - VkBool32 shaderBufferFloat64AtomicMinMax; - VkBool32 shaderSharedFloat16Atomics; - VkBool32 shaderSharedFloat16AtomicAdd; - VkBool32 shaderSharedFloat16AtomicMinMax; - VkBool32 shaderSharedFloat32AtomicMinMax; - VkBool32 shaderSharedFloat64AtomicMinMax; - VkBool32 shaderImageFloat32AtomicMinMax; - VkBool32 sparseImageFloat32AtomicMinMax; -} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32; - -typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 decodeModeSharedExponent; -} VkPhysicalDeviceASTCDecodeFeaturesEXT32; - -typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 transformFeedback; - VkBool32 geometryStreams; -} VkPhysicalDeviceTransformFeedbackFeaturesEXT32; - -typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 representativeFragmentTest; -} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32; - -typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 exclusiveScissor; -} VkPhysicalDeviceExclusiveScissorFeaturesNV32; - -typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cornerSampledImage; -} VkPhysicalDeviceCornerSampledImageFeaturesNV32; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 computeDerivativeGroupQuads; - VkBool32 computeDerivativeGroupLinear; -} VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32; - -typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageFootprint; -} VkPhysicalDeviceShaderImageFootprintFeaturesNV32; - -typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocationImageAliasing; -} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 indirectCopy; -} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32; - -typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 memoryDecompression; -} VkPhysicalDeviceMemoryDecompressionFeaturesNV32; - -typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shadingRateImage; - VkBool32 shadingRateCoarseSampleOrder; -} VkPhysicalDeviceShadingRateImageFeaturesNV32; - -typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 invocationMask; -} VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 taskShader; - VkBool32 meshShader; -} VkPhysicalDeviceMeshShaderFeaturesNV32; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 taskShader; - VkBool32 meshShader; - VkBool32 multiviewMeshShader; - VkBool32 primitiveFragmentShadingRateMeshShader; - VkBool32 meshShaderQueries; -} VkPhysicalDeviceMeshShaderFeaturesEXT32; - -typedef struct VkPhysicalDeviceAccelerationStructureFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 accelerationStructure; - VkBool32 accelerationStructureCaptureReplay; - VkBool32 accelerationStructureIndirectBuild; - VkBool32 accelerationStructureHostCommands; - VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind; -} VkPhysicalDeviceAccelerationStructureFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingPipeline; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - VkBool32 rayTracingPipelineTraceRaysIndirect; - VkBool32 rayTraversalPrimitiveCulling; -} VkPhysicalDeviceRayTracingPipelineFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayQueryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayQuery; -} VkPhysicalDeviceRayQueryFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingMaintenance1; - VkBool32 rayTracingPipelineTraceRaysIndirect2; -} VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32; - -typedef struct VkDeviceMemoryOverallocationCreateInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryOverallocationBehaviorAMD overallocationBehavior; -} VkDeviceMemoryOverallocationCreateInfoAMD32; - -typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMap; - VkBool32 fragmentDensityMapDynamic; - VkBool32 fragmentDensityMapNonSubsampledImages; -} VkPhysicalDeviceFragmentDensityMapFeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMapDeferred; -} VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMapOffset; -} VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32; - -typedef struct VkPhysicalDeviceScalarBlockLayoutFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 scalarBlockLayout; -} VkPhysicalDeviceScalarBlockLayoutFeatures32; -typedef VkPhysicalDeviceScalarBlockLayoutFeatures32 VkPhysicalDeviceScalarBlockLayoutFeaturesEXT32; - -typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 uniformBufferStandardLayout; -} VkPhysicalDeviceUniformBufferStandardLayoutFeatures32; -typedef VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR32; - -typedef struct VkPhysicalDeviceDepthClipEnableFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClipEnable; -} VkPhysicalDeviceDepthClipEnableFeaturesEXT32; - -typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 memoryPriority; -} VkPhysicalDeviceMemoryPriorityFeaturesEXT32; - -typedef struct VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pageableDeviceLocalMemory; -} VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeatures32; -typedef VkPhysicalDeviceBufferDeviceAddressFeatures32 VkPhysicalDeviceBufferDeviceAddressFeaturesKHR32; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32; -typedef VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 VkPhysicalDeviceBufferAddressFeaturesEXT32; - -typedef struct VkPhysicalDeviceImagelessFramebufferFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imagelessFramebuffer; -} VkPhysicalDeviceImagelessFramebufferFeatures32; -typedef VkPhysicalDeviceImagelessFramebufferFeatures32 VkPhysicalDeviceImagelessFramebufferFeaturesKHR32; - -typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureCompressionASTC_HDR; -} VkPhysicalDeviceTextureCompressionASTCHDRFeatures32; -typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesNV32; - -typedef struct VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcrImageArrays; -} VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32; - -typedef struct VkPhysicalDevicePresentBarrierFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrier; -} VkPhysicalDevicePresentBarrierFeaturesNV32; - -typedef struct VkPhysicalDevicePerformanceQueryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 performanceCounterQueryPools; - VkBool32 performanceCounterMultipleQueryPools; -} VkPhysicalDevicePerformanceQueryFeaturesKHR32; - -typedef struct VkPerformanceQueryReservationInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPerformanceQueriesPerPool; -} VkPerformanceQueryReservationInfoKHR32; - -typedef struct VkPhysicalDeviceCoverageReductionModeFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 coverageReductionMode; -} VkPhysicalDeviceCoverageReductionModeFeaturesNV32; - -typedef struct VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderIntegerFunctions2; -} VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32; - -typedef struct VkPhysicalDeviceShaderClockFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupClock; - VkBool32 shaderDeviceClock; -} VkPhysicalDeviceShaderClockFeaturesKHR32; - -typedef struct VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 indexTypeUint8; -} VkPhysicalDeviceIndexTypeUint8FeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSMBuiltins; -} VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32; - -typedef struct VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShaderSampleInterlock; - VkBool32 fragmentShaderPixelInterlock; - VkBool32 fragmentShaderShadingRateInterlock; -} VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32; - -typedef struct VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 separateDepthStencilLayouts; -} VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32; -typedef VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR32; - -typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 primitiveTopologyListRestart; - VkBool32 primitiveTopologyPatchListRestart; -} VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineExecutableInfo; -} VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderDemoteToHelperInvocation; -} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32; -typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT32; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 texelBufferAlignment; -} VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; -} VkPhysicalDeviceSubgroupSizeControlFeatures32; -typedef VkPhysicalDeviceSubgroupSizeControlFeatures32 VkPhysicalDeviceSubgroupSizeControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceLineRasterizationFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; -} VkPhysicalDeviceLineRasterizationFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineCreationCacheControl; -} VkPhysicalDevicePipelineCreationCacheControlFeatures32; -typedef VkPhysicalDevicePipelineCreationCacheControlFeatures32 VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceVulkan11Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; - VkBool32 protectedMemory; - VkBool32 samplerYcbcrConversion; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceVulkan11Features32; - -typedef struct VkPhysicalDeviceVulkan12Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 samplerMirrorClampToEdge; - VkBool32 drawIndirectCount; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; - VkBool32 descriptorIndexing; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; - VkBool32 samplerFilterMinmax; - VkBool32 scalarBlockLayout; - VkBool32 imagelessFramebuffer; - VkBool32 uniformBufferStandardLayout; - VkBool32 shaderSubgroupExtendedTypes; - VkBool32 separateDepthStencilLayouts; - VkBool32 hostQueryReset; - VkBool32 timelineSemaphore; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; - VkBool32 shaderOutputViewportIndex; - VkBool32 shaderOutputLayer; - VkBool32 subgroupBroadcastDynamicId; -} VkPhysicalDeviceVulkan12Features32; - -typedef struct VkPhysicalDeviceVulkan13Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustImageAccess; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; - VkBool32 pipelineCreationCacheControl; - VkBool32 privateData; - VkBool32 shaderDemoteToHelperInvocation; - VkBool32 shaderTerminateInvocation; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; - VkBool32 synchronization2; - VkBool32 textureCompressionASTC_HDR; - VkBool32 shaderZeroInitializeWorkgroupMemory; - VkBool32 dynamicRendering; - VkBool32 shaderIntegerDotProduct; - VkBool32 maintenance4; -} VkPhysicalDeviceVulkan13Features32; - -typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceCoherentMemory; -} VkPhysicalDeviceCoherentMemoryFeaturesAMD32; - -typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 customBorderColors; - VkBool32 customBorderColorWithoutFormat; -} VkPhysicalDeviceCustomBorderColorFeaturesEXT32; - -typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 borderColorSwizzle; - VkBool32 borderColorSwizzleFromImage; -} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState; -} VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState2; - VkBool32 extendedDynamicState2LogicOp; - VkBool32 extendedDynamicState2PatchControlPoints; -} VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState3TessellationDomainOrigin; - VkBool32 extendedDynamicState3DepthClampEnable; - VkBool32 extendedDynamicState3PolygonMode; - VkBool32 extendedDynamicState3RasterizationSamples; - VkBool32 extendedDynamicState3SampleMask; - VkBool32 extendedDynamicState3AlphaToCoverageEnable; - VkBool32 extendedDynamicState3AlphaToOneEnable; - VkBool32 extendedDynamicState3LogicOpEnable; - VkBool32 extendedDynamicState3ColorBlendEnable; - VkBool32 extendedDynamicState3ColorBlendEquation; - VkBool32 extendedDynamicState3ColorWriteMask; - VkBool32 extendedDynamicState3RasterizationStream; - VkBool32 extendedDynamicState3ConservativeRasterizationMode; - VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize; - VkBool32 extendedDynamicState3DepthClipEnable; - VkBool32 extendedDynamicState3SampleLocationsEnable; - VkBool32 extendedDynamicState3ColorBlendAdvanced; - VkBool32 extendedDynamicState3ProvokingVertexMode; - VkBool32 extendedDynamicState3LineRasterizationMode; - VkBool32 extendedDynamicState3LineStippleEnable; - VkBool32 extendedDynamicState3DepthClipNegativeOneToOne; - VkBool32 extendedDynamicState3ViewportWScalingEnable; - VkBool32 extendedDynamicState3ViewportSwizzle; - VkBool32 extendedDynamicState3CoverageToColorEnable; - VkBool32 extendedDynamicState3CoverageToColorLocation; - VkBool32 extendedDynamicState3CoverageModulationMode; - VkBool32 extendedDynamicState3CoverageModulationTableEnable; - VkBool32 extendedDynamicState3CoverageModulationTable; - VkBool32 extendedDynamicState3CoverageReductionMode; - VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable; - VkBool32 extendedDynamicState3ShadingRateImageEnable; -} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32; - -typedef struct VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 diagnosticsConfig; -} VkPhysicalDeviceDiagnosticsConfigFeaturesNV32; - -typedef struct VkDeviceDiagnosticsConfigCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceDiagnosticsConfigFlagsNV flags; -} VkDeviceDiagnosticsConfigCreateInfoNV32; - -typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderZeroInitializeWorkgroupMemory; -} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32; -typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupUniformControlFlow; -} VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32; - -typedef struct VkPhysicalDeviceRobustness2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustBufferAccess2; - VkBool32 robustImageAccess2; - VkBool32 nullDescriptor; -} VkPhysicalDeviceRobustness2FeaturesEXT32; - -typedef struct VkPhysicalDeviceImageRobustnessFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustImageAccess; -} VkPhysicalDeviceImageRobustnessFeatures32; -typedef VkPhysicalDeviceImageRobustnessFeatures32 VkPhysicalDeviceImageRobustnessFeaturesEXT32; - -typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 workgroupMemoryExplicitLayout; - VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout; - VkBool32 workgroupMemoryExplicitLayout8BitAccess; - VkBool32 workgroupMemoryExplicitLayout16BitAccess; -} VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32; - -typedef struct VkPhysicalDevice4444FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 formatA4R4G4B4; - VkBool32 formatA4B4G4R4; -} VkPhysicalDevice4444FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subpassShading; -} VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 clustercullingShader; - VkBool32 multiviewClusterCullingShader; -} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderImageInt64Atomics; - VkBool32 sparseImageInt64Atomics; -} VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineFragmentShadingRate; - VkBool32 primitiveFragmentShadingRate; - VkBool32 attachmentFragmentShadingRate; -} VkPhysicalDeviceFragmentShadingRateFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTerminateInvocation; -} VkPhysicalDeviceShaderTerminateInvocationFeatures32; -typedef VkPhysicalDeviceShaderTerminateInvocationFeatures32 VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShadingRateEnums; - VkBool32 supersampleFragmentShadingRates; - VkBool32 noInvocationFragmentShadingRates; -} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32; - -typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 image2DViewOf3D; - VkBool32 sampler2DViewOf3D; -} VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageSlicedViewOf3D; -} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 attachmentFeedbackLoopDynamicState; -} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 mutableDescriptorType; -} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32; -typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE32; - -typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClipControl; -} VkPhysicalDeviceDepthClipControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vertexInputDynamicState; -} VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceColorWriteEnableFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 colorWriteEnable; -} VkPhysicalDeviceColorWriteEnableFeaturesEXT32; - -typedef struct VkPhysicalDeviceSynchronization2Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 synchronization2; -} VkPhysicalDeviceSynchronization2Features32; -typedef VkPhysicalDeviceSynchronization2Features32 VkPhysicalDeviceSynchronization2FeaturesKHR32; - -typedef struct VkPhysicalDeviceHostImageCopyFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hostImageCopy; -} VkPhysicalDeviceHostImageCopyFeaturesEXT32; - -typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 primitivesGeneratedQuery; - VkBool32 primitivesGeneratedQueryWithRasterizerDiscard; - VkBool32 primitivesGeneratedQueryWithNonZeroStreams; -} VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32; - -typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 legacyDithering; -} VkPhysicalDeviceLegacyDitheringFeaturesEXT32; - -typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multisampledRenderToSingleSampled; -} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineProtectedAccess; -} VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32; - -typedef struct VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 inheritedViewportScissor2D; -} VkPhysicalDeviceInheritedViewportScissorFeaturesNV32; - -typedef struct VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcr2plane444Formats; -} VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceProvokingVertexFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 provokingVertexLast; - VkBool32 transformFeedbackPreservesProvokingVertex; -} VkPhysicalDeviceProvokingVertexFeaturesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorBuffer; - VkBool32 descriptorBufferCaptureReplay; - VkBool32 descriptorBufferImageLayoutIgnored; - VkBool32 descriptorBufferPushDescriptors; -} VkPhysicalDeviceDescriptorBufferFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderIntegerDotProduct; -} VkPhysicalDeviceShaderIntegerDotProductFeatures32; -typedef VkPhysicalDeviceShaderIntegerDotProductFeatures32 VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR32; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShaderBarycentric; -} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32; -typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV32; - -typedef struct VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingMotionBlur; - VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect; -} VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32; - -typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 formatRgba10x6WithoutYCbCrSampler; -} VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceDynamicRenderingFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicRendering; -} VkPhysicalDeviceDynamicRenderingFeatures32; -typedef VkPhysicalDeviceDynamicRenderingFeatures32 VkPhysicalDeviceDynamicRenderingFeaturesKHR32; - -typedef struct VkPhysicalDeviceImageViewMinLodFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 minLod; -} VkPhysicalDeviceImageViewMinLodFeaturesEXT32; - -typedef struct VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rasterizationOrderColorAttachmentAccess; - VkBool32 rasterizationOrderDepthAttachmentAccess; - VkBool32 rasterizationOrderStencilAttachmentAccess; -} VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32; -typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM32; - -typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 linearColorAttachment; -} VkPhysicalDeviceLinearColorAttachmentFeaturesNV32; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 graphicsPipelineLibrary; -} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32; - -typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorSetHostMapping; -} VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32; - -typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 nestedCommandBuffer; - VkBool32 nestedCommandBufferRendering; - VkBool32 nestedCommandBufferSimultaneousUse; -} VkPhysicalDeviceNestedCommandBufferFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderModuleIdentifier; -} VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageCompressionControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageCompressionControl; -} VkPhysicalDeviceImageCompressionControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageCompressionControlSwapchain; -} VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subpassMergeFeedback; -} VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32; - -typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 micromap; - VkBool32 micromapCaptureReplay; - VkBool32 micromapHostCommands; -} VkPhysicalDeviceOpacityMicromapFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelinePropertiesIdentifier; -} VkPhysicalDevicePipelinePropertiesFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderEarlyAndLateFragmentTests; -} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32; - -typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 nonSeamlessCubeMap; -} VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineRobustnessFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineRobustness; -} VkPhysicalDevicePipelineRobustnessFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageProcessingFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureSampleWeighted; - VkBool32 textureBoxFilter; - VkBool32 textureBlockMatch; -} VkPhysicalDeviceImageProcessingFeaturesQCOM32; - -typedef struct VkPhysicalDeviceTilePropertiesFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 tileProperties; -} VkPhysicalDeviceTilePropertiesFeaturesQCOM32; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 attachmentFeedbackLoopLayout; -} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32; - -typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClampZeroOne; -} VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32; - -typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 reportAddressBinding; -} VkPhysicalDeviceAddressBindingReportFeaturesEXT32; - -typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 opticalFlow; -} VkPhysicalDeviceOpticalFlowFeaturesNV32; - -typedef struct VkPhysicalDeviceFaultFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceFault; - VkBool32 deviceFaultVendorBinary; -} VkPhysicalDeviceFaultFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineLibraryGroupHandles; -} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderCoreBuiltins; -} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32; - -typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 frameBoundary; -} VkPhysicalDeviceFrameBoundaryFeaturesEXT32; - -typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicRenderingUnusedAttachments; -} VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32; - -typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 swapchainMaintenance1; -} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32; - -typedef struct VkPhysicalDeviceDepthBiasControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthBiasControl; - VkBool32 leastRepresentableValueForceUnormRepresentation; - VkBool32 floatRepresentation; - VkBool32 depthBiasExact; -} VkPhysicalDeviceDepthBiasControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingInvocationReorder; -} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedSparseAddressSpace; -} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32; - -typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiviewPerViewViewports; -} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32; - -typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingPositionFetch; -} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32; - -typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiviewPerViewRenderAreas; -} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32; - -typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderObject; -} VkPhysicalDeviceShaderObjectFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTileImageColorReadAccess; - VkBool32 shaderTileImageDepthReadAccess; - VkBool32 shaderTileImageStencilReadAccess; -} VkPhysicalDeviceShaderTileImageFeaturesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesKHR32; - -typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cubicRangeClamp; -} VkPhysicalDeviceCubicClampFeaturesQCOM32; - -typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcrDegamma; -} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32; - -typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 selectableCubicWeights; -} VkPhysicalDeviceCubicWeightsFeaturesQCOM32; - -typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureBlockMatch2; -} VkPhysicalDeviceImageProcessing2FeaturesQCOM32; - -typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorPoolOverallocation; -} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32; - -typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cudaKernelLaunchFeatures; -} VkPhysicalDeviceCudaKernelLaunchFeaturesNV32; - -typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 schedulingControls; -} VkPhysicalDeviceSchedulingControlsFeaturesARM32; - -typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 relaxedLineRasterization; -} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32; - -typedef struct VkDeviceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - PTR32 pQueueCreateInfos; - uint32_t enabledLayerCount; - PTR32 ppEnabledLayerNames; - uint32_t enabledExtensionCount; - PTR32 ppEnabledExtensionNames; - PTR32 pEnabledFeatures; -} VkDeviceCreateInfo32; - -typedef struct VkEventCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo32; - -typedef struct VkExportFenceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlags handleTypes; -} VkExportFenceCreateInfo32; -typedef VkExportFenceCreateInfo32 VkExportFenceCreateInfoKHR32; - -typedef struct VkFenceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo32; - -typedef struct VkFramebufferAttachmentImageInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCreateFlags flags; - VkImageUsageFlags usage; - uint32_t width; - uint32_t height; - uint32_t layerCount; - uint32_t viewFormatCount; - PTR32 pViewFormats; -} VkFramebufferAttachmentImageInfo32; -typedef VkFramebufferAttachmentImageInfo32 VkFramebufferAttachmentImageInfoKHR32; - -typedef struct VkFramebufferAttachmentsCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentImageInfoCount; - PTR32 pAttachmentImageInfos; -} VkFramebufferAttachmentsCreateInfo32; -typedef VkFramebufferAttachmentsCreateInfo32 VkFramebufferAttachmentsCreateInfoKHR32; - -typedef struct VkFramebufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFramebufferCreateFlags flags; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo32; - -typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t vertexBindingDivisorCount; - PTR32 pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfoEXT32; - -typedef struct VkPipelineVertexInputStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - PTR32 pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - PTR32 pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo32; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkTessellationDomainOrigin domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfo32; -typedef VkPipelineTessellationDomainOriginStateCreateInfo32 VkPipelineTessellationDomainOriginStateCreateInfoKHR32; - -typedef struct VkPipelineTessellationStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo32; - -typedef struct VkGraphicsShaderGroupCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stageCount; - PTR32 pStages; - PTR32 pVertexInputState; - PTR32 pTessellationState; -} VkGraphicsShaderGroupCreateInfoNV32; - -typedef struct VkPipelineInputAssemblyStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo32; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - PTR32 pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV32; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - PTR32 pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV32; - -typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissors; -} VkPipelineViewportExclusiveScissorStateCreateInfoNV32; - -typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shadingRateImageEnable; - uint32_t viewportCount; - PTR32 pShadingRatePalettes; -} VkPipelineViewportShadingRateImageStateCreateInfoNV32; - -typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - PTR32 pCustomSampleOrders; -} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32; - -typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 negativeOneToOne; -} VkPipelineViewportDepthClipControlCreateInfoEXT32; - -typedef struct VkPipelineViewportStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - PTR32 pViewports; - uint32_t scissorCount; - PTR32 pScissors; -} VkPipelineViewportStateCreateInfo32; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD32; - -typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - float extraPrimitiveOverestimationSize; -} VkPipelineRasterizationConservativeStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationStateStreamCreateFlagsEXT flags; - uint32_t rasterizationStream; -} VkPipelineRasterizationStateStreamCreateInfoEXT32; - -typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationDepthClipStateCreateFlagsEXT flags; - VkBool32 depthClipEnable; -} VkPipelineRasterizationDepthClipStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationLineStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkLineRasterizationModeEXT lineRasterizationMode; - VkBool32 stippledLineEnable; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -} VkPipelineRasterizationLineStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkProvokingVertexModeEXT provokingVertexMode; -} VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo32; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV32; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT32; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - PTR32 pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV32; - -typedef struct VkPipelineCoverageReductionStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageReductionStateCreateFlagsNV flags; - VkCoverageReductionModeNV coverageReductionMode; -} VkPipelineCoverageReductionStateCreateInfoNV32; - -typedef struct VkPipelineMultisampleStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - PTR32 pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo32; - -typedef struct VkPipelineDepthStencilStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo32; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT32; - -typedef struct VkPipelineColorWriteCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentCount; - PTR32 pColorWriteEnables; -} VkPipelineColorWriteCreateInfoEXT32; - -typedef struct VkPipelineColorBlendStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - PTR32 pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo32; - -typedef struct VkPipelineDynamicStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - PTR32 pDynamicStates; -} VkPipelineDynamicStateCreateInfo32; - -typedef struct VkGraphicsPipelineShaderGroupsCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t groupCount; - PTR32 pGroups; - uint32_t pipelineCount; - PTR32 pPipelines; -} VkGraphicsPipelineShaderGroupsCreateInfoNV32; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - PTR32 pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT32; - -typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 representativeFragmentTestEnable; -} VkPipelineRepresentativeFragmentTestStateCreateInfoNV32; - -typedef struct VkPipelineLibraryCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t libraryCount; - PTR32 pLibraries; -} VkPipelineLibraryCreateInfoKHR32; - -typedef struct VkPipelineFragmentShadingRateStateCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D fragmentSize; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateStateCreateInfoKHR32; - -typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkFragmentShadingRateTypeNV shadingRateType; - VkFragmentShadingRateNV shadingRate; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateEnumStateCreateInfoNV32; - -typedef struct VkPipelineRenderingCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkPipelineRenderingCreateInfo32; -typedef VkPipelineRenderingCreateInfo32 VkPipelineRenderingCreateInfoKHR32; - -typedef struct VkGraphicsPipelineLibraryCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkGraphicsPipelineLibraryFlagsEXT flags; -} VkGraphicsPipelineLibraryCreateInfoEXT32; - -typedef struct VkGraphicsPipelineCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - PTR32 pVertexInputState; - PTR32 pInputAssemblyState; - PTR32 pTessellationState; - PTR32 pViewportState; - PTR32 pRasterizationState; - PTR32 pMultisampleState; - PTR32 pDepthStencilState; - PTR32 pColorBlendState; - PTR32 pDynamicState; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo32; - -typedef struct VkDedicatedAllocationImageCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV32; - -typedef struct VkExternalMemoryImageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryImageCreateInfo32; -typedef VkExternalMemoryImageCreateInfo32 VkExternalMemoryImageCreateInfoKHR32; - -typedef struct VkImageSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; -} VkImageSwapchainCreateInfoKHR32; - -typedef struct VkImageFormatListCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewFormatCount; - PTR32 pViewFormats; -} VkImageFormatListCreateInfo32; -typedef VkImageFormatListCreateInfo32 VkImageFormatListCreateInfoKHR32; - -typedef struct VkImageStencilUsageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageUsageFlags stencilUsage; -} VkImageStencilUsageCreateInfo32; -typedef VkImageStencilUsageCreateInfo32 VkImageStencilUsageCreateInfoEXT32; - -typedef struct VkImageCompressionControlEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCompressionFlagsEXT flags; - uint32_t compressionControlPlaneCount; - PTR32 pFixedRateFlags; -} VkImageCompressionControlEXT32; - -typedef struct VkOpticalFlowImageFormatInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowUsageFlagsNV usage; -} VkOpticalFlowImageFormatInfoNV32; - -typedef struct VkImageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo32; - -typedef struct VkImageViewUsageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfo32; -typedef VkImageViewUsageCreateInfo32 VkImageViewUsageCreateInfoKHR32; - -typedef struct VkImageViewSlicedCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t sliceOffset; - uint32_t sliceCount; -} VkImageViewSlicedCreateInfoEXT32; - -typedef struct VkSamplerYcbcrConversionInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) conversion; -} VkSamplerYcbcrConversionInfo32; -typedef VkSamplerYcbcrConversionInfo32 VkSamplerYcbcrConversionInfoKHR32; - -typedef struct VkImageViewASTCDecodeModeEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat decodeMode; -} VkImageViewASTCDecodeModeEXT32; - -typedef struct VkImageViewMinLodCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float minLod; -} VkImageViewMinLodCreateInfoEXT32; - -typedef struct VkImageViewSampleWeightCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkOffset2D filterCenter; - VkExtent2D filterSize; - uint32_t numPhases; -} VkImageViewSampleWeightCreateInfoQCOM32; - -typedef struct VkImageViewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageViewCreateFlags flags; - VkImage DECLSPEC_ALIGN(8) image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo32; - -typedef struct VkIndirectCommandsLayoutTokenNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsTokenTypeNV tokenType; - uint32_t stream; - uint32_t offset; - uint32_t vertexBindingUnit; - VkBool32 vertexDynamicStride; - VkPipelineLayout DECLSPEC_ALIGN(8) pushconstantPipelineLayout; - VkShaderStageFlags pushconstantShaderStageFlags; - uint32_t pushconstantOffset; - uint32_t pushconstantSize; - VkIndirectStateFlagsNV indirectStateFlags; - uint32_t indexTypeCount; - PTR32 pIndexTypes; - PTR32 pIndexTypeValues; -} VkIndirectCommandsLayoutTokenNV32; - -typedef struct VkIndirectCommandsLayoutCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsLayoutUsageFlagsNV flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t tokenCount; - PTR32 pTokens; - uint32_t streamCount; - PTR32 pStreamStrides; -} VkIndirectCommandsLayoutCreateInfoNV32; - -typedef struct VkLayerSettingEXT32 -{ - PTR32 pLayerName; - PTR32 pSettingName; - VkLayerSettingTypeEXT type; - uint32_t valueCount; - PTR32 pValues; -} VkLayerSettingEXT32; - -typedef struct VkApplicationInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pApplicationName; - uint32_t applicationVersion; - PTR32 pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo32; - -typedef struct VkValidationFlagsEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t disabledValidationCheckCount; - PTR32 pDisabledValidationChecks; -} VkValidationFlagsEXT32; - -typedef struct VkValidationFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t enabledValidationFeatureCount; - PTR32 pEnabledValidationFeatures; - uint32_t disabledValidationFeatureCount; - PTR32 pDisabledValidationFeatures; -} VkValidationFeaturesEXT32; - -typedef struct VkLayerSettingsCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t settingCount; - PTR32 pSettings; -} VkLayerSettingsCreateInfoEXT32; - -typedef struct VkInstanceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkInstanceCreateFlags flags; - PTR32 pApplicationInfo; - uint32_t enabledLayerCount; - PTR32 ppEnabledLayerNames; - uint32_t enabledExtensionCount; - PTR32 ppEnabledExtensionNames; -} VkInstanceCreateInfo32; - -typedef struct VkMicromapCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapCreateFlagsEXT createFlags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMicromapTypeEXT type; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkMicromapCreateInfoEXT32; - -typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t id; - uint32_t size; - PTR32 pPrivateData; -} VkOpticalFlowSessionCreatePrivateDataInfoNV32; - -typedef struct VkOpticalFlowSessionCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t width; - uint32_t height; - VkFormat imageFormat; - VkFormat flowVectorFormat; - VkFormat costFormat; - VkOpticalFlowGridSizeFlagsNV outputGridSize; - VkOpticalFlowGridSizeFlagsNV hintGridSize; - VkOpticalFlowPerformanceLevelNV performanceLevel; - VkOpticalFlowSessionCreateFlagsNV flags; -} VkOpticalFlowSessionCreateInfoNV32; - -typedef struct VkPipelineCacheCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCacheCreateFlags flags; - PTR32 initialDataSize; - PTR32 pInitialData; -} VkPipelineCacheCreateInfo32; - -typedef struct VkPipelineLayoutCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - PTR32 pSetLayouts; - uint32_t pushConstantRangeCount; - PTR32 pPushConstantRanges; -} VkPipelineLayoutCreateInfo32; - -typedef struct VkPrivateDataSlotCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPrivateDataSlotCreateFlags flags; -} VkPrivateDataSlotCreateInfo32; -typedef VkPrivateDataSlotCreateInfo32 VkPrivateDataSlotCreateInfoEXT32; - -typedef struct VkQueryPoolPerformanceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t queueFamilyIndex; - uint32_t counterIndexCount; - PTR32 pCounterIndices; -} VkQueryPoolPerformanceCreateInfoKHR32; - -typedef struct VkQueryPoolPerformanceQueryCreateInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueryPoolSamplingModeINTEL performanceCountersSampling; -} VkQueryPoolPerformanceQueryCreateInfoINTEL32; -typedef VkQueryPoolPerformanceQueryCreateInfoINTEL32 VkQueryPoolCreateInfoINTEL32; - -typedef struct VkQueryPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo32; - -typedef struct VkRayTracingShaderGroupCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; - PTR32 pShaderGroupCaptureReplayHandle; -} VkRayTracingShaderGroupCreateInfoKHR32; - -typedef struct VkRayTracingPipelineInterfaceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPipelineRayPayloadSize; - uint32_t maxPipelineRayHitAttributeSize; -} VkRayTracingPipelineInterfaceCreateInfoKHR32; - -typedef struct VkRayTracingPipelineCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - uint32_t groupCount; - PTR32 pGroups; - uint32_t maxPipelineRayRecursionDepth; - PTR32 pLibraryInfo; - PTR32 pLibraryInterface; - PTR32 pDynamicState; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoKHR32; - -typedef struct VkRayTracingShaderGroupCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; -} VkRayTracingShaderGroupCreateInfoNV32; - -typedef struct VkRayTracingPipelineCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - uint32_t groupCount; - PTR32 pGroups; - uint32_t maxRecursionDepth; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoNV32; - -typedef struct VkSubpassDescription32 -{ - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - PTR32 pInputAttachments; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pResolveAttachments; - PTR32 pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - PTR32 pPreserveAttachments; -} VkSubpassDescription32; - -typedef struct VkRenderPassMultiviewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t subpassCount; - PTR32 pViewMasks; - uint32_t dependencyCount; - PTR32 pViewOffsets; - uint32_t correlationMaskCount; - PTR32 pCorrelationMasks; -} VkRenderPassMultiviewCreateInfo32; -typedef VkRenderPassMultiviewCreateInfo32 VkRenderPassMultiviewCreateInfoKHR32; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t aspectReferenceCount; - PTR32 pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfo32; -typedef VkRenderPassInputAttachmentAspectCreateInfo32 VkRenderPassInputAttachmentAspectCreateInfoKHR32; - -typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkAttachmentReference fragmentDensityMapAttachment; -} VkRenderPassFragmentDensityMapCreateInfoEXT32; - -typedef struct VkRenderPassCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t subpassCount; - PTR32 pSubpasses; - uint32_t dependencyCount; - PTR32 pDependencies; -} VkRenderPassCreateInfo32; - -typedef struct VkAttachmentDescriptionStencilLayout32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageLayout stencilInitialLayout; - VkImageLayout stencilFinalLayout; -} VkAttachmentDescriptionStencilLayout32; -typedef VkAttachmentDescriptionStencilLayout32 VkAttachmentDescriptionStencilLayoutKHR32; - -typedef struct VkAttachmentDescription232 -{ - VkStructureType sType; - PTR32 pNext; - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription232; -typedef VkAttachmentDescription232 VkAttachmentDescription2KHR32; - -typedef struct VkAttachmentReferenceStencilLayout32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageLayout stencilLayout; -} VkAttachmentReferenceStencilLayout32; -typedef VkAttachmentReferenceStencilLayout32 VkAttachmentReferenceStencilLayoutKHR32; - -typedef struct VkAttachmentReference232 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachment; - VkImageLayout layout; - VkImageAspectFlags aspectMask; -} VkAttachmentReference232; -typedef VkAttachmentReference232 VkAttachmentReference2KHR32; - -typedef struct VkSubpassDescriptionDepthStencilResolve32 -{ - VkStructureType sType; - PTR32 pNext; - VkResolveModeFlagBits depthResolveMode; - VkResolveModeFlagBits stencilResolveMode; - PTR32 pDepthStencilResolveAttachment; -} VkSubpassDescriptionDepthStencilResolve32; -typedef VkSubpassDescriptionDepthStencilResolve32 VkSubpassDescriptionDepthStencilResolveKHR32; - -typedef struct VkFragmentShadingRateAttachmentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pFragmentShadingRateAttachment; - VkExtent2D shadingRateAttachmentTexelSize; -} VkFragmentShadingRateAttachmentInfoKHR32; - -typedef struct VkRenderPassCreationControlEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 disallowMerging; -} VkRenderPassCreationControlEXT32; - -typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pSubpassFeedback; -} VkRenderPassSubpassFeedbackCreateInfoEXT32; - -typedef struct VkSubpassDescription232 -{ - VkStructureType sType; - PTR32 pNext; - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t viewMask; - uint32_t inputAttachmentCount; - PTR32 pInputAttachments; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pResolveAttachments; - PTR32 pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - PTR32 pPreserveAttachments; -} VkSubpassDescription232; -typedef VkSubpassDescription232 VkSubpassDescription2KHR32; - -typedef struct VkSubpassDependency232 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; - int32_t viewOffset; -} VkSubpassDependency232; -typedef VkSubpassDependency232 VkSubpassDependency2KHR32; - -typedef struct VkRenderPassCreationFeedbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pRenderPassFeedback; -} VkRenderPassCreationFeedbackCreateInfoEXT32; - -typedef struct VkRenderPassCreateInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t subpassCount; - PTR32 pSubpasses; - uint32_t dependencyCount; - PTR32 pDependencies; - uint32_t correlatedViewMaskCount; - PTR32 pCorrelatedViewMasks; -} VkRenderPassCreateInfo232; -typedef VkRenderPassCreateInfo232 VkRenderPassCreateInfo2KHR32; - -typedef struct VkSamplerReductionModeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerReductionMode reductionMode; -} VkSamplerReductionModeCreateInfo32; -typedef VkSamplerReductionModeCreateInfo32 VkSamplerReductionModeCreateInfoEXT32; - -typedef struct VkSamplerCustomBorderColorCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkClearColorValue customBorderColor; - VkFormat format; -} VkSamplerCustomBorderColorCreateInfoEXT32; - -typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkComponentMapping components; - VkBool32 srgb; -} VkSamplerBorderColorComponentMappingCreateInfoEXT32; - -typedef struct VkSamplerCubicWeightsCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkSamplerCubicWeightsCreateInfoQCOM32; - -typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D windowExtent; - VkBlockMatchWindowCompareModeQCOM windowCompareMode; -} VkSamplerBlockMatchWindowCreateInfoQCOM32; - -typedef struct VkSamplerCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo32; - -typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 enableYDegamma; - VkBool32 enableCbCrDegamma; -} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32; - -typedef struct VkSamplerYcbcrConversionCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkSamplerYcbcrModelConversion ycbcrModel; - VkSamplerYcbcrRange ycbcrRange; - VkComponentMapping components; - VkChromaLocation xChromaOffset; - VkChromaLocation yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfo32; -typedef VkSamplerYcbcrConversionCreateInfo32 VkSamplerYcbcrConversionCreateInfoKHR32; - -typedef struct VkExportSemaphoreCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlags handleTypes; -} VkExportSemaphoreCreateInfo32; -typedef VkExportSemaphoreCreateInfo32 VkExportSemaphoreCreateInfoKHR32; - -typedef struct VkSemaphoreTypeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreType semaphoreType; - uint64_t DECLSPEC_ALIGN(8) initialValue; -} VkSemaphoreTypeCreateInfo32; -typedef VkSemaphoreTypeCreateInfo32 VkSemaphoreTypeCreateInfoKHR32; - -typedef struct VkQueryLowLatencySupportNV32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pQueriedLowLatencyData; -} VkQueryLowLatencySupportNV32; - -typedef struct VkSemaphoreCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo32; - -typedef struct VkShaderCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderCreateFlagsEXT flags; - VkShaderStageFlagBits stage; - VkShaderStageFlags nextStage; - VkShaderCodeTypeEXT codeType; - PTR32 codeSize; - PTR32 pCode; - PTR32 pName; - uint32_t setLayoutCount; - PTR32 pSetLayouts; - uint32_t pushConstantRangeCount; - PTR32 pPushConstantRanges; - PTR32 pSpecializationInfo; -} VkShaderCreateInfoEXT32; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupSwapchainCreateInfoKHR32; - -typedef struct VkSwapchainPresentBarrierCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrierEnable; -} VkSwapchainPresentBarrierCreateInfoNV32; - -typedef struct VkSwapchainPresentModesCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkSwapchainPresentModesCreateInfoEXT32; - -typedef struct VkSwapchainPresentScalingCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentScalingFlagsEXT scalingBehavior; - VkPresentGravityFlagsEXT presentGravityX; - VkPresentGravityFlagsEXT presentGravityY; -} VkSwapchainPresentScalingCreateInfoEXT32; - -typedef struct VkSwapchainLatencyCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 latencyModeEnable; -} VkSwapchainLatencyCreateInfoNV32; - -typedef struct VkSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR DECLSPEC_ALIGN(8) oldSwapchain; -} VkSwapchainCreateInfoKHR32; - -typedef struct VkValidationCacheCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkValidationCacheCreateFlagsEXT flags; - PTR32 initialDataSize; - PTR32 pInitialData; -} VkValidationCacheCreateInfoEXT32; - -typedef struct VkWin32SurfaceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkWin32SurfaceCreateFlagsKHR flags; - PTR32 hinstance; - PTR32 hwnd; -} VkWin32SurfaceCreateInfoKHR32; - -typedef struct VkDebugMarkerObjectNameInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - PTR32 pObjectName; -} VkDebugMarkerObjectNameInfoEXT32; - -typedef struct VkDebugMarkerObjectTagInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkDebugMarkerObjectTagInfoEXT32; - -typedef struct VkPhysicalDeviceGroupProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t physicalDeviceCount; - PTR32 physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupProperties32; -typedef VkPhysicalDeviceGroupProperties32 VkPhysicalDeviceGroupPropertiesKHR32; - -typedef struct VkPerformanceCounterKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceCounterUnitKHR unit; - VkPerformanceCounterScopeKHR scope; - VkPerformanceCounterStorageKHR storage; - uint8_t uuid[VK_UUID_SIZE]; -} VkPerformanceCounterKHR32; - -typedef struct VkPerformanceCounterDescriptionKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceCounterDescriptionFlagsKHR flags; - char name[VK_MAX_DESCRIPTION_SIZE]; - char category[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkPerformanceCounterDescriptionKHR32; - -typedef struct VkMappedMemoryRange32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkMappedMemoryRange32; - -typedef struct VkAccelerationStructureBuildSizesInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) accelerationStructureSize; - VkDeviceSize DECLSPEC_ALIGN(8) updateScratchSize; - VkDeviceSize DECLSPEC_ALIGN(8) buildScratchSize; -} VkAccelerationStructureBuildSizesInfoKHR32; - -typedef struct VkAccelerationStructureDeviceAddressInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; -} VkAccelerationStructureDeviceAddressInfoKHR32; - -typedef struct VkAccelerationStructureMemoryRequirementsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureMemoryRequirementsTypeNV type; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; -} VkAccelerationStructureMemoryRequirementsInfoNV32; - -typedef struct VkMemoryRequirements32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceSize DECLSPEC_ALIGN(8) alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements32; - - -typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructureNV; -} VkAccelerationStructureCaptureDescriptorDataInfoEXT32; - -typedef struct VkBufferDeviceAddressInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferDeviceAddressInfo32; -typedef VkBufferDeviceAddressInfo32 VkBufferDeviceAddressInfoKHR32; -typedef VkBufferDeviceAddressInfo32 VkBufferDeviceAddressInfoEXT32; - -typedef struct VkBufferMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferMemoryRequirementsInfo232; -typedef VkBufferMemoryRequirementsInfo232 VkBufferMemoryRequirementsInfo2KHR32; - -typedef struct VkMemoryDedicatedRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirements32; -typedef VkMemoryDedicatedRequirements32 VkMemoryDedicatedRequirementsKHR32; - -typedef struct VkMemoryRequirements232 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryRequirements32 DECLSPEC_ALIGN(8) memoryRequirements; -} VkMemoryRequirements232; -typedef VkMemoryRequirements232 VkMemoryRequirements2KHR32; - -typedef struct VkBufferCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferCaptureDescriptorDataInfoEXT32; - -typedef struct VkCalibratedTimestampInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkTimeDomainEXT timeDomain; -} VkCalibratedTimestampInfoEXT32; - -typedef struct VkDescriptorAddressInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) address; - VkDeviceSize DECLSPEC_ALIGN(8) range; - VkFormat format; -} VkDescriptorAddressInfoEXT32; - -typedef union VkDescriptorDataEXT32 -{ - PTR32 pSampler; - PTR32 pCombinedImageSampler; - PTR32 pInputAttachmentImage; - PTR32 pSampledImage; - PTR32 pStorageImage; - PTR32 pUniformTexelBuffer; - PTR32 pStorageTexelBuffer; - PTR32 pUniformBuffer; - PTR32 pStorageBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) accelerationStructure; -} VkDescriptorDataEXT32; - -typedef struct VkDescriptorGetInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorType type; - VkDescriptorDataEXT32 DECLSPEC_ALIGN(8) data; -} VkDescriptorGetInfoEXT32; - -typedef struct VkDescriptorSetBindingReferenceVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - uint32_t binding; -} VkDescriptorSetBindingReferenceVALVE32; - -typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 descriptorOffset; - uint32_t descriptorSize; -} VkDescriptorSetLayoutHostMappingInfoVALVE32; - -typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupport32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxVariableDescriptorCount; -} VkDescriptorSetVariableDescriptorCountLayoutSupport32; -typedef VkDescriptorSetVariableDescriptorCountLayoutSupport32 VkDescriptorSetVariableDescriptorCountLayoutSupportEXT32; - -typedef struct VkDescriptorSetLayoutSupport32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 supported; -} VkDescriptorSetLayoutSupport32; -typedef VkDescriptorSetLayoutSupport32 VkDescriptorSetLayoutSupportKHR32; - -typedef struct VkAccelerationStructureVersionInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pVersionData; -} VkAccelerationStructureVersionInfoKHR32; - -typedef struct VkDeviceBufferMemoryRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; -} VkDeviceBufferMemoryRequirements32; -typedef VkDeviceBufferMemoryRequirements32 VkDeviceBufferMemoryRequirementsKHR32; - -typedef struct VkDeviceFaultCountsEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t addressInfoCount; - uint32_t vendorInfoCount; - VkDeviceSize DECLSPEC_ALIGN(8) vendorBinarySize; -} VkDeviceFaultCountsEXT32; - -typedef struct VkDeviceFaultAddressInfoEXT32 -{ - VkDeviceFaultAddressTypeEXT addressType; - VkDeviceAddress DECLSPEC_ALIGN(8) reportedAddress; - VkDeviceSize DECLSPEC_ALIGN(8) addressPrecision; -} VkDeviceFaultAddressInfoEXT32; - -typedef struct VkDeviceFaultVendorInfoEXT32 -{ - char description[VK_MAX_DESCRIPTION_SIZE]; - uint64_t DECLSPEC_ALIGN(8) vendorFaultCode; - uint64_t DECLSPEC_ALIGN(8) vendorFaultData; -} VkDeviceFaultVendorInfoEXT32; - -typedef struct VkDeviceFaultInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - char description[VK_MAX_DESCRIPTION_SIZE]; - PTR32 pAddressInfos; - PTR32 pVendorInfos; - PTR32 pVendorBinaryData; -} VkDeviceFaultInfoEXT32; - -typedef struct VkDeviceGroupPresentCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupPresentCapabilitiesKHR32; - -typedef struct VkDeviceImageMemoryRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; - VkImageAspectFlagBits planeAspect; -} VkDeviceImageMemoryRequirements32; -typedef VkDeviceImageMemoryRequirements32 VkDeviceImageMemoryRequirementsKHR32; - -typedef struct VkSparseImageMemoryRequirements32 -{ - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailSize; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailOffset; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailStride; -} VkSparseImageMemoryRequirements32; - -typedef struct VkSparseImageMemoryRequirements232 -{ - VkStructureType sType; - PTR32 pNext; - VkSparseImageMemoryRequirements32 DECLSPEC_ALIGN(8) memoryRequirements; -} VkSparseImageMemoryRequirements232; -typedef VkSparseImageMemoryRequirements232 VkSparseImageMemoryRequirements2KHR32; - -typedef struct VkImageSubresource2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresource imageSubresource; -} VkImageSubresource2KHR32; -typedef VkImageSubresource2KHR32 VkImageSubresource2EXT32; - -typedef struct VkDeviceImageSubresourceInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; - PTR32 pSubresource; -} VkDeviceImageSubresourceInfoKHR32; - -typedef struct VkSubresourceLayout32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceSize DECLSPEC_ALIGN(8) rowPitch; - VkDeviceSize DECLSPEC_ALIGN(8) arrayPitch; - VkDeviceSize DECLSPEC_ALIGN(8) depthPitch; -} VkSubresourceLayout32; - -typedef struct VkSubresourceHostMemcpySizeEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkSubresourceHostMemcpySizeEXT32; - -typedef struct VkImageCompressionPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCompressionFlagsEXT imageCompressionFlags; - VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags; -} VkImageCompressionPropertiesEXT32; - -typedef struct VkSubresourceLayout2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSubresourceLayout32 DECLSPEC_ALIGN(8) subresourceLayout; -} VkSubresourceLayout2KHR32; -typedef VkSubresourceLayout2KHR32 VkSubresourceLayout2EXT32; - -typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -} VkDeviceMemoryOpaqueCaptureAddressInfo32; -typedef VkDeviceMemoryOpaqueCaptureAddressInfo32 VkDeviceMemoryOpaqueCaptureAddressInfoKHR32; - -typedef struct VkMicromapVersionInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pVersionData; -} VkMicromapVersionInfoEXT32; - -typedef struct VkDeviceQueueInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueIndex; -} VkDeviceQueueInfo232; - -typedef struct VkTilePropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent3D tileSize; - VkExtent2D apronSize; - VkOffset2D origin; -} VkTilePropertiesQCOM32; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkGeneratedCommandsMemoryRequirementsInfoNV32; - -typedef struct VkImagePlaneMemoryRequirementsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfo32; -typedef VkImagePlaneMemoryRequirementsInfo32 VkImagePlaneMemoryRequirementsInfoKHR32; - -typedef struct VkImageMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageMemoryRequirementsInfo232; -typedef VkImageMemoryRequirementsInfo232 VkImageMemoryRequirementsInfo2KHR32; - -typedef struct VkImageCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageCaptureDescriptorDataInfoEXT32; - -typedef struct VkImageSparseMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageSparseMemoryRequirementsInfo232; -typedef VkImageSparseMemoryRequirementsInfo232 VkImageSparseMemoryRequirementsInfo2KHR32; - -typedef struct VkImageViewAddressPropertiesNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkImageViewAddressPropertiesNVX32; - -typedef struct VkImageViewHandleInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkDescriptorType descriptorType; - VkSampler DECLSPEC_ALIGN(8) sampler; -} VkImageViewHandleInfoNVX32; - -typedef struct VkImageViewCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; -} VkImageViewCaptureDescriptorDataInfoEXT32; - -typedef struct VkLatencyTimingsFrameReportNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; - uint64_t DECLSPEC_ALIGN(8) inputSampleTimeUs; - uint64_t DECLSPEC_ALIGN(8) simStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) simEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) renderSubmitStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) renderSubmitEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) presentStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) presentEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) driverStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) driverEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) osRenderQueueStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) osRenderQueueEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) gpuRenderStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) gpuRenderEndTimeUs; -} VkLatencyTimingsFrameReportNV32; - -typedef struct VkGetLatencyMarkerInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t timingCount; - PTR32 pTimings; -} VkGetLatencyMarkerInfoNV32; - -typedef struct VkMemoryHostPointerPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t memoryTypeBits; -} VkMemoryHostPointerPropertiesEXT32; - -typedef struct VkMicromapBuildSizesInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) micromapSize; - VkDeviceSize DECLSPEC_ALIGN(8) buildScratchSize; - VkBool32 discardable; -} VkMicromapBuildSizesInfoEXT32; - -typedef union VkPerformanceValueDataINTEL32 -{ - uint32_t value32; - uint64_t DECLSPEC_ALIGN(8) value64; - float valueFloat; - VkBool32 valueBool; - PTR32 valueString; -} VkPerformanceValueDataINTEL32; - -typedef struct VkPerformanceValueINTEL32 -{ - VkPerformanceValueTypeINTEL type; - VkPerformanceValueDataINTEL32 DECLSPEC_ALIGN(8) data; -} VkPerformanceValueINTEL32; - -typedef struct VkCooperativeMatrixPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; -} VkCooperativeMatrixPropertiesKHR32; - -typedef struct VkCooperativeMatrixPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeNV AType; - VkComponentTypeNV BType; - VkComponentTypeNV CType; - VkComponentTypeNV DType; - VkScopeNV scope; -} VkCooperativeMatrixPropertiesNV32; - -typedef struct VkPhysicalDeviceExternalBufferInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalBufferInfo32; -typedef VkPhysicalDeviceExternalBufferInfo32 VkPhysicalDeviceExternalBufferInfoKHR32; - -typedef struct VkExternalBufferProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalBufferProperties32; -typedef VkExternalBufferProperties32 VkExternalBufferPropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalFenceInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalFenceInfo32; -typedef VkPhysicalDeviceExternalFenceInfo32 VkPhysicalDeviceExternalFenceInfoKHR32; - -typedef struct VkExternalFenceProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlags compatibleHandleTypes; - VkExternalFenceFeatureFlags externalFenceFeatures; -} VkExternalFenceProperties32; -typedef VkExternalFenceProperties32 VkExternalFencePropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalSemaphoreInfo32; -typedef VkPhysicalDeviceExternalSemaphoreInfo32 VkPhysicalDeviceExternalSemaphoreInfoKHR32; - -typedef struct VkExternalSemaphoreProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; - VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; -} VkExternalSemaphoreProperties32; -typedef VkExternalSemaphoreProperties32 VkExternalSemaphorePropertiesKHR32; - -typedef struct VkSubpassResolvePerformanceQueryEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 optimal; -} VkSubpassResolvePerformanceQueryEXT32; - -typedef struct VkFormatProperties332 -{ - VkStructureType sType; - PTR32 pNext; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) linearTilingFeatures; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) optimalTilingFeatures; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) bufferFeatures; -} VkFormatProperties332; -typedef VkFormatProperties332 VkFormatProperties3KHR32; - -typedef struct VkFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormatProperties formatProperties; -} VkFormatProperties232; -typedef VkFormatProperties232 VkFormatProperties2KHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlags sampleCounts; - VkExtent2D fragmentSize; -} VkPhysicalDeviceFragmentShadingRateKHR32; - -typedef struct VkImageFormatProperties32 -{ - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize DECLSPEC_ALIGN(8) maxResourceSize; -} VkImageFormatProperties32; - -typedef struct VkPhysicalDeviceExternalImageFormatInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalImageFormatInfo32; -typedef VkPhysicalDeviceExternalImageFormatInfo32 VkPhysicalDeviceExternalImageFormatInfoKHR32; - -typedef struct VkPhysicalDeviceImageViewImageFormatInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageViewType imageViewType; -} VkPhysicalDeviceImageViewImageFormatInfoEXT32; - -typedef struct VkPhysicalDeviceImageFormatInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo232; -typedef VkPhysicalDeviceImageFormatInfo232 VkPhysicalDeviceImageFormatInfo2KHR32; - -typedef struct VkExternalImageFormatProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalImageFormatProperties32; -typedef VkExternalImageFormatProperties32 VkExternalImageFormatPropertiesKHR32; - -typedef struct VkSamplerYcbcrConversionImageFormatProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatProperties32; -typedef VkSamplerYcbcrConversionImageFormatProperties32 VkSamplerYcbcrConversionImageFormatPropertiesKHR32; - -typedef struct VkTextureLODGatherFormatPropertiesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD32; - -typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 filterCubic; - VkBool32 filterCubicMinmax; -} VkFilterCubicImageViewImageFormatPropertiesEXT32; - -typedef struct VkHostImageCopyDevicePerformanceQueryEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 optimalDeviceAccess; - VkBool32 identicalMemoryLayout; -} VkHostImageCopyDevicePerformanceQueryEXT32; - -typedef struct VkImageFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageFormatProperties32 DECLSPEC_ALIGN(8) imageFormatProperties; -} VkImageFormatProperties232; -typedef VkImageFormatProperties232 VkImageFormatProperties2KHR32; - -typedef struct VkMemoryHeap32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryHeapFlags flags; -} VkMemoryHeap32; - -typedef struct VkPhysicalDeviceMemoryProperties32 -{ - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap32 DECLSPEC_ALIGN(8) memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties32; - -typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) heapBudget[VK_MAX_MEMORY_HEAPS]; - VkDeviceSize DECLSPEC_ALIGN(8) heapUsage[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryBudgetPropertiesEXT32; - -typedef struct VkPhysicalDeviceMemoryProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceMemoryProperties32 DECLSPEC_ALIGN(8) memoryProperties; -} VkPhysicalDeviceMemoryProperties232; -typedef VkPhysicalDeviceMemoryProperties232 VkPhysicalDeviceMemoryProperties2KHR32; - -typedef struct VkMultisamplePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT32; - -typedef struct VkOpticalFlowImageFormatPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; -} VkOpticalFlowImageFormatPropertiesNV32; - -typedef struct VkPhysicalDeviceLimits32 -{ - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize DECLSPEC_ALIGN(8) bufferImageGranularity; - VkDeviceSize DECLSPEC_ALIGN(8) sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - PTR32 minMemoryMapAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minTexelBufferOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minUniformBufferOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize DECLSPEC_ALIGN(8) optimalBufferCopyOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) optimalBufferCopyRowPitchAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) nonCoherentAtomSize; -} VkPhysicalDeviceLimits32; - -typedef struct VkPhysicalDeviceProperties32 -{ - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits32 DECLSPEC_ALIGN(8) limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxGraphicsShaderGroupCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsStreamCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsStreamStride; - uint32_t minSequencesCountBufferOffsetAlignment; - uint32_t minSequencesIndexBufferOffsetAlignment; - uint32_t minIndirectCommandsBufferOffsetAlignment; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32; - -typedef struct VkPhysicalDeviceMultiDrawPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxMultiDrawCount; -} VkPhysicalDeviceMultiDrawPropertiesEXT32; - -typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorPropertiesKHR32; - -typedef struct VkPhysicalDeviceDriverProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; -} VkPhysicalDeviceDriverProperties32; -typedef VkPhysicalDeviceDriverProperties32 VkPhysicalDeviceDriverPropertiesKHR32; - -typedef struct VkPhysicalDeviceIDProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDProperties32; -typedef VkPhysicalDeviceIDProperties32 VkPhysicalDeviceIDPropertiesKHR32; - -typedef struct VkPhysicalDeviceMultiviewProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewProperties32; -typedef VkPhysicalDeviceMultiviewProperties32 VkPhysicalDeviceMultiviewPropertiesKHR32; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT32; - -typedef struct VkPhysicalDeviceSubgroupProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlags supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupProperties32; - -typedef struct VkPhysicalDevicePointClippingProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkPointClippingBehavior pointClippingBehavior; -} VkPhysicalDevicePointClippingProperties32; -typedef VkPhysicalDevicePointClippingProperties32 VkPhysicalDevicePointClippingPropertiesKHR32; - -typedef struct VkPhysicalDeviceProtectedMemoryProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryProperties32; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxProperties32; -typedef VkPhysicalDeviceSamplerFilterMinmaxProperties32 VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT32; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT32; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32; - -typedef struct VkPhysicalDeviceInlineUniformBlockProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; -} VkPhysicalDeviceInlineUniformBlockProperties32; -typedef VkPhysicalDeviceInlineUniformBlockProperties32 VkPhysicalDeviceInlineUniformBlockPropertiesEXT32; - -typedef struct VkPhysicalDeviceMaintenance3Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPerSetDescriptors; - VkDeviceSize DECLSPEC_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceMaintenance3Properties32; -typedef VkPhysicalDeviceMaintenance3Properties32 VkPhysicalDeviceMaintenance3PropertiesKHR32; - -typedef struct VkPhysicalDeviceMaintenance4Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceMaintenance4Properties32; -typedef VkPhysicalDeviceMaintenance4Properties32 VkPhysicalDeviceMaintenance4PropertiesKHR32; - -typedef struct VkPhysicalDeviceMaintenance5PropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; -} VkPhysicalDeviceMaintenance5PropertiesKHR32; - -typedef struct VkPhysicalDeviceFloatControlsProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; -} VkPhysicalDeviceFloatControlsProperties32; -typedef VkPhysicalDeviceFloatControlsProperties32 VkPhysicalDeviceFloatControlsPropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) minImportedHostPointerAlignment; -} VkPhysicalDeviceExternalMemoryHostPropertiesEXT32; - -typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float primitiveOverestimationSize; - float maxExtraPrimitiveOverestimationSize; - float extraPrimitiveOverestimationSizeGranularity; - VkBool32 primitiveUnderestimation; - VkBool32 conservativePointAndLineRasterization; - VkBool32 degenerateTrianglesRasterized; - VkBool32 degenerateLinesRasterized; - VkBool32 fullyCoveredFragmentShaderInputVariable; - VkBool32 conservativeRasterizationPostDepthCoverage; -} VkPhysicalDeviceConservativeRasterizationPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderCorePropertiesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderEngineCount; - uint32_t shaderArraysPerEngineCount; - uint32_t computeUnitsPerShaderArray; - uint32_t simdPerComputeUnit; - uint32_t wavefrontsPerSimd; - uint32_t wavefrontSize; - uint32_t sgprsPerSimd; - uint32_t minSgprAllocation; - uint32_t maxSgprAllocation; - uint32_t sgprAllocationGranularity; - uint32_t vgprsPerSimd; - uint32_t minVgprAllocation; - uint32_t maxVgprAllocation; - uint32_t vgprAllocationGranularity; -} VkPhysicalDeviceShaderCorePropertiesAMD32; - -typedef struct VkPhysicalDeviceShaderCoreProperties2AMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderCorePropertiesFlagsAMD shaderCoreFeatures; - uint32_t activeComputeUnitCount; -} VkPhysicalDeviceShaderCoreProperties2AMD32; - -typedef struct VkPhysicalDeviceDescriptorIndexingProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; -} VkPhysicalDeviceDescriptorIndexingProperties32; -typedef VkPhysicalDeviceDescriptorIndexingProperties32 VkPhysicalDeviceDescriptorIndexingPropertiesEXT32; - -typedef struct VkPhysicalDeviceTimelineSemaphoreProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) maxTimelineSemaphoreValueDifference; -} VkPhysicalDeviceTimelineSemaphoreProperties32; -typedef VkPhysicalDeviceTimelineSemaphoreProperties32 VkPhysicalDeviceTimelineSemaphorePropertiesKHR32; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxVertexAttribDivisor; -} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32; - -typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t pciDomain; - uint32_t pciBus; - uint32_t pciDevice; - uint32_t pciFunction; -} VkPhysicalDevicePCIBusInfoPropertiesEXT32; - -typedef struct VkPhysicalDeviceDepthStencilResolveProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; -} VkPhysicalDeviceDepthStencilResolveProperties32; -typedef VkPhysicalDeviceDepthStencilResolveProperties32 VkPhysicalDeviceDepthStencilResolvePropertiesKHR32; - -typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxTransformFeedbackStreams; - uint32_t maxTransformFeedbackBuffers; - VkDeviceSize DECLSPEC_ALIGN(8) maxTransformFeedbackBufferSize; - uint32_t maxTransformFeedbackStreamDataSize; - uint32_t maxTransformFeedbackBufferDataSize; - uint32_t maxTransformFeedbackBufferDataStride; - VkBool32 transformFeedbackQueries; - VkBool32 transformFeedbackStreamsLinesTriangles; - VkBool32 transformFeedbackRasterizationStreamSelect; - VkBool32 transformFeedbackDraw; -} VkPhysicalDeviceTransformFeedbackPropertiesEXT32; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueFlags supportedQueues; -} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32; - -typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryDecompressionMethodFlagsNV DECLSPEC_ALIGN(8) decompressionMethods; - uint64_t DECLSPEC_ALIGN(8) maxDecompressionIndirectCount; -} VkPhysicalDeviceMemoryDecompressionPropertiesNV32; - -typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D shadingRateTexelSize; - uint32_t shadingRatePaletteSize; - uint32_t shadingRateMaxCoarseSamples; -} VkPhysicalDeviceShadingRateImagePropertiesNV32; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxDrawMeshTasksCount; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskTotalMemorySize; - uint32_t maxTaskOutputCount; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshTotalMemorySize; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; -} VkPhysicalDeviceMeshShaderPropertiesNV32; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxTaskWorkGroupTotalCount; - uint32_t maxTaskWorkGroupCount[3]; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskPayloadSize; - uint32_t maxTaskSharedMemorySize; - uint32_t maxTaskPayloadAndSharedMemorySize; - uint32_t maxMeshWorkGroupTotalCount; - uint32_t maxMeshWorkGroupCount[3]; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshSharedMemorySize; - uint32_t maxMeshPayloadAndSharedMemorySize; - uint32_t maxMeshOutputMemorySize; - uint32_t maxMeshPayloadAndOutputMemorySize; - uint32_t maxMeshOutputComponents; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshOutputLayers; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; - uint32_t maxPreferredTaskWorkGroupInvocations; - uint32_t maxPreferredMeshWorkGroupInvocations; - VkBool32 prefersLocalInvocationVertexOutput; - VkBool32 prefersLocalInvocationPrimitiveOutput; - VkBool32 prefersCompactVertexOutput; - VkBool32 prefersCompactPrimitiveOutput; -} VkPhysicalDeviceMeshShaderPropertiesEXT32; - -typedef struct VkPhysicalDeviceAccelerationStructurePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) maxGeometryCount; - uint64_t DECLSPEC_ALIGN(8) maxInstanceCount; - uint64_t DECLSPEC_ALIGN(8) maxPrimitiveCount; - uint32_t maxPerStageDescriptorAccelerationStructures; - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - uint32_t maxDescriptorSetAccelerationStructures; - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures; - uint32_t minAccelerationStructureScratchOffsetAlignment; -} VkPhysicalDeviceAccelerationStructurePropertiesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPipelinePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRayRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint32_t shaderGroupHandleCaptureReplaySize; - uint32_t maxRayDispatchInvocationCount; - uint32_t shaderGroupHandleAlignment; - uint32_t maxRayHitAttributeSize; -} VkPhysicalDeviceRayTracingPipelinePropertiesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint64_t DECLSPEC_ALIGN(8) maxGeometryCount; - uint64_t DECLSPEC_ALIGN(8) maxInstanceCount; - uint64_t DECLSPEC_ALIGN(8) maxTriangleCount; - uint32_t maxDescriptorSetAccelerationStructures; -} VkPhysicalDeviceRayTracingPropertiesNV32; - -typedef struct VkPhysicalDeviceFragmentDensityMapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D minFragmentDensityTexelSize; - VkExtent2D maxFragmentDensityTexelSize; - VkBool32 fragmentDensityInvocations; -} VkPhysicalDeviceFragmentDensityMapPropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subsampledLoads; - VkBool32 subsampledCoarseReconstructionEarlyAccess; - uint32_t maxSubsampledArrayLayers; - uint32_t maxDescriptorSetSubsampledSamplers; -} VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D fragmentDensityOffsetGranularity; -} VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesNV32; - -typedef struct VkPhysicalDevicePerformanceQueryPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 allowCommandBufferQueryCopies; -} VkPhysicalDevicePerformanceQueryPropertiesKHR32; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderSMCount; - uint32_t shaderWarpsPerSM; -} VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; -} VkPhysicalDeviceTexelBufferAlignmentProperties32; -typedef VkPhysicalDeviceTexelBufferAlignmentProperties32 VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT32; - -typedef struct VkPhysicalDeviceSubgroupSizeControlProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; -} VkPhysicalDeviceSubgroupSizeControlProperties32; -typedef VkPhysicalDeviceSubgroupSizeControlProperties32 VkPhysicalDeviceSubgroupSizeControlPropertiesEXT32; - -typedef struct VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxSubpassShadingWorkgroupSizeAspectRatio; -} VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32; - -typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxWorkGroupCount[3]; - uint32_t maxWorkGroupSize[3]; - uint32_t maxOutputClusterCount; - VkDeviceSize DECLSPEC_ALIGN(8) indirectBufferOffsetAlignment; -} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32; - -typedef struct VkPhysicalDeviceLineRasterizationPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t lineSubPixelPrecisionBits; -} VkPhysicalDeviceLineRasterizationPropertiesEXT32; - -typedef struct VkPhysicalDeviceVulkan11Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; - uint32_t subgroupSize; - VkShaderStageFlags subgroupSupportedStages; - VkSubgroupFeatureFlags subgroupSupportedOperations; - VkBool32 subgroupQuadOperationsInAllStages; - VkPointClippingBehavior pointClippingBehavior; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; - VkBool32 protectedNoFault; - uint32_t maxPerSetDescriptors; - VkDeviceSize DECLSPEC_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceVulkan11Properties32; - -typedef struct VkPhysicalDeviceVulkan12Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; - uint64_t DECLSPEC_ALIGN(8) maxTimelineSemaphoreValueDifference; - VkSampleCountFlags framebufferIntegerColorSampleCounts; -} VkPhysicalDeviceVulkan12Properties32; - -typedef struct VkPhysicalDeviceVulkan13Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - uint32_t maxInlineUniformTotalSize; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - VkDeviceSize DECLSPEC_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceVulkan13Properties32; - -typedef struct VkPhysicalDeviceCustomBorderColorPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxCustomBorderColorSamplers; -} VkPhysicalDeviceCustomBorderColorPropertiesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicPrimitiveTopologyUnrestricted; -} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32; - -typedef struct VkPhysicalDeviceRobustness2PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) robustStorageBufferAccessSizeAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) robustUniformBufferAccessSizeAlignment; -} VkPhysicalDeviceRobustness2PropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentShadingRatePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D minFragmentShadingRateAttachmentTexelSize; - VkExtent2D maxFragmentShadingRateAttachmentTexelSize; - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - VkBool32 primitiveFragmentShadingRateWithMultipleViewports; - VkBool32 layeredShadingRateAttachments; - VkBool32 fragmentShadingRateNonTrivialCombinerOps; - VkExtent2D maxFragmentSize; - uint32_t maxFragmentSizeAspectRatio; - uint32_t maxFragmentShadingRateCoverageSamples; - VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples; - VkBool32 fragmentShadingRateWithShaderDepthStencilWrites; - VkBool32 fragmentShadingRateWithSampleMask; - VkBool32 fragmentShadingRateWithShaderSampleMask; - VkBool32 fragmentShadingRateWithConservativeRasterization; - VkBool32 fragmentShadingRateWithFragmentShaderInterlock; - VkBool32 fragmentShadingRateWithCustomSampleLocations; - VkBool32 fragmentShadingRateStrictMultiplyCombiner; -} VkPhysicalDeviceFragmentShadingRatePropertiesKHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; -} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32; - -typedef struct VkPhysicalDeviceHostImageCopyPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t copySrcLayoutCount; - PTR32 pCopySrcLayouts; - uint32_t copyDstLayoutCount; - PTR32 pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceHostImageCopyPropertiesEXT32; - -typedef struct VkPhysicalDeviceProvokingVertexPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 provokingVertexModePerPipeline; - VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex; -} VkPhysicalDeviceProvokingVertexPropertiesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 combinedImageSamplerDescriptorSingleArray; - VkBool32 bufferlessPushDescriptors; - VkBool32 allowSamplerImageViewPostSubmitCreation; - VkDeviceSize DECLSPEC_ALIGN(8) descriptorBufferOffsetAlignment; - uint32_t maxDescriptorBufferBindings; - uint32_t maxResourceDescriptorBufferBindings; - uint32_t maxSamplerDescriptorBufferBindings; - uint32_t maxEmbeddedImmutableSamplerBindings; - uint32_t maxEmbeddedImmutableSamplers; - PTR32 bufferCaptureReplayDescriptorDataSize; - PTR32 imageCaptureReplayDescriptorDataSize; - PTR32 imageViewCaptureReplayDescriptorDataSize; - PTR32 samplerCaptureReplayDescriptorDataSize; - PTR32 accelerationStructureCaptureReplayDescriptorDataSize; - PTR32 samplerDescriptorSize; - PTR32 combinedImageSamplerDescriptorSize; - PTR32 sampledImageDescriptorSize; - PTR32 storageImageDescriptorSize; - PTR32 uniformTexelBufferDescriptorSize; - PTR32 robustUniformTexelBufferDescriptorSize; - PTR32 storageTexelBufferDescriptorSize; - PTR32 robustStorageTexelBufferDescriptorSize; - PTR32 uniformBufferDescriptorSize; - PTR32 robustUniformBufferDescriptorSize; - PTR32 storageBufferDescriptorSize; - PTR32 robustStorageBufferDescriptorSize; - PTR32 inputAttachmentDescriptorSize; - PTR32 accelerationStructureDescriptorSize; - VkDeviceSize DECLSPEC_ALIGN(8) maxSamplerDescriptorBufferRange; - VkDeviceSize DECLSPEC_ALIGN(8) maxResourceDescriptorBufferRange; - VkDeviceSize DECLSPEC_ALIGN(8) samplerDescriptorBufferAddressSpaceSize; - VkDeviceSize DECLSPEC_ALIGN(8) resourceDescriptorBufferAddressSpaceSize; - VkDeviceSize DECLSPEC_ALIGN(8) descriptorBufferAddressSpaceSize; -} VkPhysicalDeviceDescriptorBufferPropertiesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 combinedImageSamplerDensityMapDescriptorSize; -} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; -} VkPhysicalDeviceShaderIntegerDotProductProperties32; -typedef VkPhysicalDeviceShaderIntegerDotProductProperties32 VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR32; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 triStripVertexOrderIndependentOfProvokingVertex; -} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 graphicsPipelineLibraryFastLinking; - VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; -} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32; - -typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxCommandBufferNestingLevel; -} VkPhysicalDeviceNestedCommandBufferPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE]; -} VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32; - -typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxOpacity2StateSubdivisionLevel; - uint32_t maxOpacity4StateSubdivisionLevel; -} VkPhysicalDeviceOpacityMicromapPropertiesEXT32; - -typedef struct VkPhysicalDevicePipelineRobustnessPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehaviorEXT defaultRobustnessImages; -} VkPhysicalDevicePipelineRobustnessPropertiesEXT32; - -typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxWeightFilterPhases; - VkExtent2D maxWeightFilterDimension; - VkExtent2D maxBlockMatchRegion; - VkExtent2D maxBoxFilterBlockSize; -} VkPhysicalDeviceImageProcessingPropertiesQCOM32; - -typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes; - VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes; - VkBool32 hintSupported; - VkBool32 costSupported; - VkBool32 bidirectionalFlowSupported; - VkBool32 globalFlowSupported; - uint32_t minWidth; - uint32_t minHeight; - uint32_t maxWidth; - uint32_t maxHeight; - uint32_t maxNumRegionsOfInterest; -} VkPhysicalDeviceOpticalFlowPropertiesNV32; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) shaderCoreMask; - uint32_t shaderCoreCount; - uint32_t shaderWarpsPerCore; -} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint; -} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) extendedSparseAddressSpaceSize; - VkImageUsageFlags extendedSparseImageUsageFlags; - VkBufferUsageFlags extendedSparseBufferUsageFlags; -} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32; - -typedef struct VkPhysicalDeviceShaderCorePropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t pixelRate; - uint32_t texelRate; - uint32_t fmaRate; -} VkPhysicalDeviceShaderCorePropertiesARM32; - -typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t shaderBinaryUUID[VK_UUID_SIZE]; - uint32_t shaderBinaryVersion; -} VkPhysicalDeviceShaderObjectPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTileImageCoherentReadAccelerated; - VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; - VkBool32 shaderTileImageReadFromHelperInvocation; -} VkPhysicalDeviceShaderTileImagePropertiesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesKHR32; - -typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D maxBlockMatchWindow; -} VkPhysicalDeviceImageProcessing2PropertiesQCOM32; - -typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT32 -{ - VkStructureType sType; - PTR32 pNext; - VkLayeredDriverUnderlyingApiMSFT underlyingAPI; -} VkPhysicalDeviceLayeredDriverPropertiesMSFT32; - -typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t computeCapabilityMinor; - uint32_t computeCapabilityMajor; -} VkPhysicalDeviceCudaKernelLaunchPropertiesNV32; - -typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceSchedulingControlsFlagsARM DECLSPEC_ALIGN(8) schedulingControlsFlags; -} VkPhysicalDeviceSchedulingControlsPropertiesARM32; - -typedef struct VkPhysicalDeviceProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceProperties32 DECLSPEC_ALIGN(8) properties; -} VkPhysicalDeviceProperties232; -typedef VkPhysicalDeviceProperties232 VkPhysicalDeviceProperties2KHR32; - -typedef struct VkQueueFamilyGlobalPriorityPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t priorityCount; - VkQueueGlobalPriorityKHR priorities[VK_MAX_GLOBAL_PRIORITY_SIZE_KHR]; -} VkQueueFamilyGlobalPriorityPropertiesKHR32; -typedef VkQueueFamilyGlobalPriorityPropertiesKHR32 VkQueueFamilyGlobalPriorityPropertiesEXT32; - -typedef struct VkQueueFamilyCheckpointPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags checkpointExecutionStageMask; -} VkQueueFamilyCheckpointPropertiesNV32; - -typedef struct VkQueueFamilyCheckpointProperties2NV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) checkpointExecutionStageMask; -} VkQueueFamilyCheckpointProperties2NV32; - -typedef struct VkQueueFamilyProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties232; -typedef VkQueueFamilyProperties232 VkQueueFamilyProperties2KHR32; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo232; -typedef VkPhysicalDeviceSparseImageFormatInfo232 VkPhysicalDeviceSparseImageFormatInfo2KHR32; - -typedef struct VkSparseImageFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties232; -typedef VkSparseImageFormatProperties232 VkSparseImageFormatProperties2KHR32; - -typedef struct VkFramebufferMixedSamplesCombinationNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCoverageReductionModeNV coverageReductionMode; - VkSampleCountFlagBits rasterizationSamples; - VkSampleCountFlags depthStencilSamples; - VkSampleCountFlags colorSamples; -} VkFramebufferMixedSamplesCombinationNV32; - -typedef struct VkSurfacePresentModeEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentModeKHR presentMode; -} VkSurfacePresentModeEXT32; - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; -} VkPhysicalDeviceSurfaceInfo2KHR32; - -typedef struct VkSurfaceCapabilitiesPresentBarrierNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrierSupported; -} VkSurfaceCapabilitiesPresentBarrierNV32; - -typedef struct VkSurfacePresentScalingCapabilitiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentScalingFlagsEXT supportedPresentScaling; - VkPresentGravityFlagsEXT supportedPresentGravityX; - VkPresentGravityFlagsEXT supportedPresentGravityY; - VkExtent2D minScaledImageExtent; - VkExtent2D maxScaledImageExtent; -} VkSurfacePresentScalingCapabilitiesEXT32; - -typedef struct VkSurfacePresentModeCompatibilityEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkSurfacePresentModeCompatibilityEXT32; - -typedef struct VkLatencySurfaceCapabilitiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkLatencySurfaceCapabilitiesNV32; - -typedef struct VkSurfaceCapabilities2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR32; - -typedef struct VkSurfaceFormat2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR32; - -typedef struct VkPhysicalDeviceToolProperties32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_EXTENSION_NAME_SIZE]; - char version[VK_MAX_EXTENSION_NAME_SIZE]; - VkToolPurposeFlags purposes; - char description[VK_MAX_DESCRIPTION_SIZE]; - char layer[VK_MAX_EXTENSION_NAME_SIZE]; -} VkPhysicalDeviceToolProperties32; -typedef VkPhysicalDeviceToolProperties32 VkPhysicalDeviceToolPropertiesEXT32; - -typedef struct VkPipelineExecutableInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t executableIndex; -} VkPipelineExecutableInfoKHR32; - -typedef struct VkPipelineExecutableInternalRepresentationKHR32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkBool32 isText; - PTR32 dataSize; - PTR32 pData; -} VkPipelineExecutableInternalRepresentationKHR32; - -typedef struct VkPipelineInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkPipelineInfoKHR32; -typedef VkPipelineInfoKHR32 VkPipelineInfoEXT32; - -typedef struct VkPipelineExecutablePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stages; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t subgroupSize; -} VkPipelineExecutablePropertiesKHR32; - -typedef union VkPipelineExecutableStatisticValueKHR32 -{ - VkBool32 b32; - int64_t i64; - uint64_t DECLSPEC_ALIGN(8) u64; - double f64; -} VkPipelineExecutableStatisticValueKHR32; - -typedef struct VkPipelineExecutableStatisticKHR32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkPipelineExecutableStatisticFormatKHR format; - VkPipelineExecutableStatisticValueKHR32 DECLSPEC_ALIGN(8) value; -} VkPipelineExecutableStatisticKHR32; - -typedef struct VkPipelineIndirectDeviceAddressInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkPipelineIndirectDeviceAddressInfoNV32; - - -typedef struct VkCheckpointData2NV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - PTR32 pCheckpointMarker; -} VkCheckpointData2NV32; - -typedef struct VkCheckpointDataNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlagBits stage; - PTR32 pCheckpointMarker; -} VkCheckpointDataNV32; - -typedef struct VkRenderingAreaInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkRenderingAreaInfoKHR32; - -typedef struct VkSamplerCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampler DECLSPEC_ALIGN(8) sampler; -} VkSamplerCaptureDescriptorDataInfoEXT32; - -typedef struct VkShaderModuleIdentifierEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t identifierSize; - uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT]; -} VkShaderModuleIdentifierEXT32; - -typedef struct VkInitializePerformanceApiInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pUserData; -} VkInitializePerformanceApiInfoINTEL32; - -typedef struct VkLatencySleepInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) signalSemaphore; - uint64_t DECLSPEC_ALIGN(8) value; -} VkLatencySleepInfoNV32; - -typedef struct VkMemoryMapInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryMapFlags flags; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkMemoryMapInfoKHR32; - -typedef struct VkSparseMemoryBind32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) resourceOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind32; - -typedef struct VkSparseBufferMemoryBindInfo32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseBufferMemoryBindInfo32; - -typedef struct VkSparseImageOpaqueMemoryBindInfo32 -{ - VkImage DECLSPEC_ALIGN(8) image; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseImageOpaqueMemoryBindInfo32; - -typedef struct VkSparseImageMemoryBind32 -{ - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind32; - -typedef struct VkSparseImageMemoryBindInfo32 -{ - VkImage DECLSPEC_ALIGN(8) image; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseImageMemoryBindInfo32; - -typedef struct VkDeviceGroupBindSparseInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfo32; -typedef VkDeviceGroupBindSparseInfo32 VkDeviceGroupBindSparseInfoKHR32; - -typedef struct VkTimelineSemaphoreSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreValueCount; - PTR32 pWaitSemaphoreValues; - uint32_t signalSemaphoreValueCount; - PTR32 pSignalSemaphoreValues; -} VkTimelineSemaphoreSubmitInfo32; -typedef VkTimelineSemaphoreSubmitInfo32 VkTimelineSemaphoreSubmitInfoKHR32; - -typedef struct VkFrameBoundaryEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkFrameBoundaryFlagsEXT flags; - uint64_t DECLSPEC_ALIGN(8) frameID; - uint32_t imageCount; - PTR32 pImages; - uint32_t bufferCount; - PTR32 pBuffers; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkFrameBoundaryEXT32; - -typedef struct VkBindSparseInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - uint32_t bufferBindCount; - PTR32 pBufferBinds; - uint32_t imageOpaqueBindCount; - PTR32 pImageOpaqueBinds; - uint32_t imageBindCount; - PTR32 pImageBinds; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphores; -} VkBindSparseInfo32; - -typedef struct VkOutOfBandQueueTypeInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOutOfBandQueueTypeNV queueType; -} VkOutOfBandQueueTypeInfoNV32; - -typedef struct VkPresentRegionKHR32 -{ - uint32_t rectangleCount; - PTR32 pRectangles; -} VkPresentRegionKHR32; - -typedef struct VkPresentRegionsKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pRegions; -} VkPresentRegionsKHR32; - -typedef struct VkDeviceGroupPresentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHR mode; -} VkDeviceGroupPresentInfoKHR32; - -typedef struct VkPresentIdKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pPresentIds; -} VkPresentIdKHR32; - -typedef struct VkSwapchainPresentFenceInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pFences; -} VkSwapchainPresentFenceInfoEXT32; - -typedef struct VkSwapchainPresentModeInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pPresentModes; -} VkSwapchainPresentModeInfoEXT32; - -typedef struct VkPresentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - uint32_t swapchainCount; - PTR32 pSwapchains; - PTR32 pImageIndices; - PTR32 pResults; -} VkPresentInfoKHR32; - -typedef struct VkDeviceGroupSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - PTR32 pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfo32; -typedef VkDeviceGroupSubmitInfo32 VkDeviceGroupSubmitInfoKHR32; - -typedef struct VkProtectedSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfo32; - -typedef struct VkPerformanceQuerySubmitInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t counterPassIndex; -} VkPerformanceQuerySubmitInfoKHR32; - -typedef struct VkLatencySubmissionPresentIdNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; -} VkLatencySubmissionPresentIdNV32; - -typedef struct VkSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - PTR32 pWaitDstStageMask; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphores; -} VkSubmitInfo32; - -typedef struct VkSemaphoreSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t DECLSPEC_ALIGN(8) value; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - uint32_t deviceIndex; -} VkSemaphoreSubmitInfo32; -typedef VkSemaphoreSubmitInfo32 VkSemaphoreSubmitInfoKHR32; - -typedef struct VkCommandBufferSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 commandBuffer; - uint32_t deviceMask; -} VkCommandBufferSubmitInfo32; -typedef VkCommandBufferSubmitInfo32 VkCommandBufferSubmitInfoKHR32; - -typedef struct VkSubmitInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkSubmitFlags flags; - uint32_t waitSemaphoreInfoCount; - PTR32 pWaitSemaphoreInfos; - uint32_t commandBufferInfoCount; - PTR32 pCommandBufferInfos; - uint32_t signalSemaphoreInfoCount; - PTR32 pSignalSemaphoreInfos; -} VkSubmitInfo232; -typedef VkSubmitInfo232 VkSubmitInfo2KHR32; - -typedef struct VkReleaseSwapchainImagesInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t imageIndexCount; - PTR32 pImageIndices; -} VkReleaseSwapchainImagesInfoEXT32; - -typedef struct VkDebugUtilsObjectTagInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkDebugUtilsObjectTagInfoEXT32; - -typedef struct VkHdrMetadataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT32; - -typedef struct VkSetLatencyMarkerInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; - VkLatencyMarkerNV marker; -} VkSetLatencyMarkerInfoNV32; - -typedef struct VkLatencySleepModeInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 lowLatencyMode; - VkBool32 lowLatencyBoost; - uint32_t minimumIntervalUs; -} VkLatencySleepModeInfoNV32; - -typedef struct VkSemaphoreSignalInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t DECLSPEC_ALIGN(8) value; -} VkSemaphoreSignalInfo32; -typedef VkSemaphoreSignalInfo32 VkSemaphoreSignalInfoKHR32; - -typedef struct VkDeviceAddressBindingCallbackDataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddressBindingFlagsEXT flags; - VkDeviceAddress DECLSPEC_ALIGN(8) baseAddress; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceAddressBindingTypeEXT bindingType; -} VkDeviceAddressBindingCallbackDataEXT32; - -typedef struct VkDebugUtilsMessengerCallbackDataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugUtilsMessengerCallbackDataFlagsEXT flags; - PTR32 pMessageIdName; - int32_t messageIdNumber; - PTR32 pMessage; - uint32_t queueLabelCount; - PTR32 pQueueLabels; - uint32_t cmdBufLabelCount; - PTR32 pCmdBufLabels; - uint32_t objectCount; - PTR32 pObjects; -} VkDebugUtilsMessengerCallbackDataEXT32; - -typedef struct VkHostImageLayoutTransitionInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout oldLayout; - VkImageLayout newLayout; - VkImageSubresourceRange subresourceRange; -} VkHostImageLayoutTransitionInfoEXT32; - -typedef struct VkMemoryUnmapInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryUnmapFlagsKHR flags; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -} VkMemoryUnmapInfoKHR32; - -typedef struct VkCopyDescriptorSet32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSet DECLSPEC_ALIGN(8) srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet DECLSPEC_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet32; - -typedef struct VkSemaphoreWaitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreWaitFlags flags; - uint32_t semaphoreCount; - PTR32 pSemaphores; - PTR32 pValues; -} VkSemaphoreWaitInfo32; -typedef VkSemaphoreWaitInfo32 VkSemaphoreWaitInfoKHR32; - -static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle) -{ - switch(type) - { - case VK_OBJECT_TYPE_COMMAND_BUFFER: - return (uint64_t) (uintptr_t) wine_cmd_buffer_from_handle(((VkCommandBuffer) (uintptr_t) handle))->host_command_buffer; - case VK_OBJECT_TYPE_COMMAND_POOL: - return (uint64_t) wine_cmd_pool_from_handle(handle)->host_command_pool; - case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: - return (uint64_t) wine_debug_report_callback_from_handle(handle)->host_debug_callback; - case VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT: - return (uint64_t) wine_debug_utils_messenger_from_handle(handle)->host_debug_messenger; - case VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR: - return (uint64_t) wine_deferred_operation_from_handle(handle)->host_deferred_operation; - case VK_OBJECT_TYPE_DEVICE: - return (uint64_t) (uintptr_t) wine_device_from_handle(((VkDevice) (uintptr_t) handle))->host_device; - case VK_OBJECT_TYPE_DEVICE_MEMORY: - return (uint64_t) wine_device_memory_from_handle(handle)->host_memory; - case VK_OBJECT_TYPE_INSTANCE: - return (uint64_t) (uintptr_t) wine_instance_from_handle(((VkInstance) (uintptr_t) handle))->host_instance; - case VK_OBJECT_TYPE_PHYSICAL_DEVICE: - return (uint64_t) (uintptr_t) wine_phys_dev_from_handle(((VkPhysicalDevice) (uintptr_t) handle))->host_physical_device; - case VK_OBJECT_TYPE_QUEUE: - return (uint64_t) (uintptr_t) wine_queue_from_handle(((VkQueue) (uintptr_t) handle))->host_queue; - case VK_OBJECT_TYPE_SURFACE_KHR: - return (uint64_t) wine_surface_from_handle(handle)->host_surface; - default: - return handle; - } -} - -static inline void convert_VkAcquireNextImageInfoKHR_win32_to_host(const VkAcquireNextImageInfoKHR32 *in, VkAcquireNextImageInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->swapchain = in->swapchain; - out->timeout = in->timeout; - out->semaphore = in->semaphore; - out->fence = in->fence; - out->deviceMask = in->deviceMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceConfigurationAcquireInfoINTEL_win32_to_host(const VkPerformanceConfigurationAcquireInfoINTEL32 *in, VkPerformanceConfigurationAcquireInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAcquireProfilingLockInfoKHR_win32_to_host(const VkAcquireProfilingLockInfoKHR32 *in, VkAcquireProfilingLockInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->timeout = in->timeout; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCommandBufferAllocateInfo_win32_to_unwrapped_host(const VkCommandBufferAllocateInfo32 *in, VkCommandBufferAllocateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->commandPool = in->commandPool; - out->level = in->level; - out->commandBufferCount = in->commandBufferCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline VkCommandBuffer *convert_VkCommandBuffer_array_win32_to_unwrapped_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return out; -} - -static inline void convert_VkDescriptorSetAllocateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetAllocateInfo32 *in, VkDescriptorSetAllocateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorPool = in->descriptorPool; - out->descriptorSetCount = in->descriptorSetCount; - out->pSetLayouts = (const VkDescriptorSetLayout *)UlongToPtr(in->pSetLayouts); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: - { - VkDescriptorSetVariableDescriptorCountAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorSetVariableDescriptorCountAllocateInfo32 *in_ext = (const VkDescriptorSetVariableDescriptorCountAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->descriptorSetCount = in_ext->descriptorSetCount; - out_ext->pDescriptorCounts = (const uint32_t *)UlongToPtr(in_ext->pDescriptorCounts); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMemoryAllocateInfo_win32_to_host(struct conversion_context *ctx, const VkMemoryAllocateInfo32 *in, VkMemoryAllocateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->allocationSize = in->allocationSize; - out->memoryTypeIndex = in->memoryTypeIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: - { - VkDedicatedAllocationMemoryAllocateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationMemoryAllocateInfoNV32 *in_ext = (const VkDedicatedAllocationMemoryAllocateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->image = in_ext->image; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: - { - VkExportMemoryAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportMemoryAllocateInfo32 *in_ext = (const VkExportMemoryAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: - { - VkImportMemoryWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImportMemoryWin32HandleInfoKHR32 *in_ext = (const VkImportMemoryWin32HandleInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_ext->handle = in_ext->handle; - out_ext->name = in_ext->name; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: - { - VkExportMemoryWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportMemoryWin32HandleInfoKHR32 *in_ext = (const VkExportMemoryWin32HandleInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pAttributes = (const SECURITY_ATTRIBUTES *)UlongToPtr(in_ext->pAttributes); - out_ext->dwAccess = in_ext->dwAccess; - out_ext->name = in_ext->name; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: - { - VkMemoryAllocateFlagsInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryAllocateFlagsInfo32 *in_ext = (const VkMemoryAllocateFlagsInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->deviceMask = in_ext->deviceMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: - { - VkMemoryDedicatedAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryDedicatedAllocateInfo32 *in_ext = (const VkMemoryDedicatedAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->image = in_ext->image; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: - { - VkImportMemoryHostPointerInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImportMemoryHostPointerInfoEXT32 *in_ext = (const VkImportMemoryHostPointerInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_ext->pHostPointer = (void *)UlongToPtr(in_ext->pHostPointer); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: - { - VkMemoryPriorityAllocateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryPriorityAllocateInfoEXT32 *in_ext = (const VkMemoryPriorityAllocateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->priority = in_ext->priority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: - { - VkMemoryOpaqueCaptureAddressAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryOpaqueCaptureAddressAllocateInfo32 *in_ext = (const VkMemoryOpaqueCaptureAddressAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->opaqueCaptureAddress = in_ext->opaqueCaptureAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkCommandBufferInheritanceInfo_win32_to_host(struct conversion_context *ctx, const VkCommandBufferInheritanceInfo32 *in, VkCommandBufferInheritanceInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->framebuffer = in->framebuffer; - out->occlusionQueryEnable = in->occlusionQueryEnable; - out->queryFlags = in->queryFlags; - out->pipelineStatistics = in->pipelineStatistics; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: - { - VkCommandBufferInheritanceConditionalRenderingInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceConditionalRenderingInfoEXT32 *in_ext = (const VkCommandBufferInheritanceConditionalRenderingInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRenderingEnable = in_ext->conditionalRenderingEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: - { - VkCommandBufferInheritanceRenderPassTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 *in_ext = (const VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_ext->renderArea = in_ext->renderArea; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: - { - VkCommandBufferInheritanceViewportScissorInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceViewportScissorInfoNV32 *in_ext = (const VkCommandBufferInheritanceViewportScissorInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV; - out_ext->pNext = NULL; - out_ext->viewportScissor2D = in_ext->viewportScissor2D; - out_ext->viewportDepthCount = in_ext->viewportDepthCount; - out_ext->pViewportDepths = (const VkViewport *)UlongToPtr(in_ext->pViewportDepths); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO: - { - VkCommandBufferInheritanceRenderingInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceRenderingInfo32 *in_ext = (const VkCommandBufferInheritanceRenderingInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = (const VkFormat *)UlongToPtr(in_ext->pColorAttachmentFormats); - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD32 *in_ext = (const VkAttachmentSampleCountInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = (const VkSampleCountFlagBits *)UlongToPtr(in_ext->pColorAttachmentSamples); - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: - { - VkMultiviewPerViewAttributesInfoNVX *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewAttributesInfoNVX32 *in_ext = (const VkMultiviewPerViewAttributesInfoNVX32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; - out_ext->pNext = NULL; - out_ext->perViewAttributes = in_ext->perViewAttributes; - out_ext->perViewAttributesPositionXOnly = in_ext->perViewAttributesPositionXOnly; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkCommandBufferInheritanceInfo *convert_VkCommandBufferInheritanceInfo_array_win32_to_host(struct conversion_context *ctx, const VkCommandBufferInheritanceInfo32 *in, uint32_t count) -{ - VkCommandBufferInheritanceInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferInheritanceInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCommandBufferBeginInfo_win32_to_host(struct conversion_context *ctx, const VkCommandBufferBeginInfo32 *in, VkCommandBufferBeginInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pInheritanceInfo = convert_VkCommandBufferInheritanceInfo_array_win32_to_host(ctx, (const VkCommandBufferInheritanceInfo32 *)UlongToPtr(in->pInheritanceInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: - { - VkDeviceGroupCommandBufferBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupCommandBufferBeginInfo32 *in_ext = (const VkDeviceGroupCommandBufferBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(const VkBindAccelerationStructureMemoryInfoNV *in, VkBindAccelerationStructureMemoryInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->accelerationStructure = in->accelerationStructure; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; - out->deviceIndexCount = in->deviceIndexCount; - out->pDeviceIndices = in->pDeviceIndices; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host(const VkBindAccelerationStructureMemoryInfoNV32 *in, VkBindAccelerationStructureMemoryInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; - out->deviceIndexCount = in->deviceIndexCount; - out->pDeviceIndices = (const uint32_t *)UlongToPtr(in->pDeviceIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV *in, uint32_t count) -{ - VkBindAccelerationStructureMemoryInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV32 *in, uint32_t count) -{ - VkBindAccelerationStructureMemoryInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindBufferMemoryInfo_win64_to_host(const VkBindBufferMemoryInfo *in, VkBindBufferMemoryInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->buffer = in->buffer; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindBufferMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, VkBindBufferMemoryInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: - { - VkBindBufferMemoryDeviceGroupInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindBufferMemoryDeviceGroupInfo32 *in_ext = (const VkBindBufferMemoryDeviceGroupInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO; - out_ext->pNext = NULL; - out_ext->deviceIndexCount = in_ext->deviceIndexCount; - out_ext->pDeviceIndices = (const uint32_t *)UlongToPtr(in_ext->pDeviceIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo *in, uint32_t count) -{ - VkBindBufferMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindBufferMemoryInfo_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, uint32_t count) -{ - VkBindBufferMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindBufferMemoryInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindImageMemoryInfo_win64_to_host(const VkBindImageMemoryInfo *in, VkBindImageMemoryInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->image = in->image; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, VkBindImageMemoryInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->memoryOffset = in->memoryOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: - { - VkBindImageMemoryDeviceGroupInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemoryDeviceGroupInfo32 *in_ext = (const VkBindImageMemoryDeviceGroupInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO; - out_ext->pNext = NULL; - out_ext->deviceIndexCount = in_ext->deviceIndexCount; - out_ext->pDeviceIndices = (const uint32_t *)UlongToPtr(in_ext->pDeviceIndices); - out_ext->splitInstanceBindRegionCount = in_ext->splitInstanceBindRegionCount; - out_ext->pSplitInstanceBindRegions = (const VkRect2D *)UlongToPtr(in_ext->pSplitInstanceBindRegions); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: - { - VkBindImageMemorySwapchainInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemorySwapchainInfoKHR32 *in_ext = (const VkBindImageMemorySwapchainInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain; - out_ext->imageIndex = in_ext->imageIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: - { - VkBindImagePlaneMemoryInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImagePlaneMemoryInfo32 *in_ext = (const VkBindImagePlaneMemoryInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO; - out_ext->pNext = NULL; - out_ext->planeAspect = in_ext->planeAspect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo *in, uint32_t count) -{ - VkBindImageMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindImageMemoryInfo_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, uint32_t count) -{ - VkBindImageMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindImageMemoryInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const VkMicromapUsageEXT * const*convert_VkMicromapUsageEXT_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkMicromapUsageEXT **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -static inline void convert_VkAccelerationStructureGeometryTrianglesDataKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryTrianglesDataKHR32 *in, VkAccelerationStructureGeometryTrianglesDataKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->vertexFormat = in->vertexFormat; - out->vertexData = in->vertexData; - out->vertexStride = in->vertexStride; - out->maxVertex = in->maxVertex; - out->indexType = in->indexType; - out->indexData = in->indexData; - out->transformData = in->transformData; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: - { - VkAccelerationStructureGeometryMotionTrianglesDataNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureGeometryMotionTrianglesDataNV32 *in_ext = (const VkAccelerationStructureGeometryMotionTrianglesDataNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV; - out_ext->pNext = NULL; - out_ext->vertexData = in_ext->vertexData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT: - { - VkAccelerationStructureTrianglesOpacityMicromapEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureTrianglesOpacityMicromapEXT32 *in_ext = (const VkAccelerationStructureTrianglesOpacityMicromapEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT; - out_ext->pNext = NULL; - out_ext->indexType = in_ext->indexType; - out_ext->indexBuffer = in_ext->indexBuffer; - out_ext->indexStride = in_ext->indexStride; - out_ext->baseTriangle = in_ext->baseTriangle; - out_ext->usageCountsCount = in_ext->usageCountsCount; - out_ext->pUsageCounts = (const VkMicromapUsageEXT *)UlongToPtr(in_ext->pUsageCounts); - out_ext->ppUsageCounts = convert_VkMicromapUsageEXT_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in_ext->ppUsageCounts), in_ext->usageCountsCount); - out_ext->micromap = in_ext->micromap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAccelerationStructureGeometryAabbsDataKHR_win32_to_host(const VkAccelerationStructureGeometryAabbsDataKHR32 *in, VkAccelerationStructureGeometryAabbsDataKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->data = in->data; - out->stride = in->stride; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureGeometryInstancesDataKHR_win32_to_host(const VkAccelerationStructureGeometryInstancesDataKHR32 *in, VkAccelerationStructureGeometryInstancesDataKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->arrayOfPointers = in->arrayOfPointers; - out->data = in->data; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureGeometryDataKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryDataKHR32 *in, VkAccelerationStructureGeometryDataKHR *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_GEOMETRY_TYPE_TRIANGLES_KHR) - convert_VkAccelerationStructureGeometryTrianglesDataKHR_win32_to_host(ctx, &in->triangles, &out->triangles); - if (selector == VK_GEOMETRY_TYPE_AABBS_KHR) - convert_VkAccelerationStructureGeometryAabbsDataKHR_win32_to_host(&in->aabbs, &out->aabbs); - if (selector == VK_GEOMETRY_TYPE_INSTANCES_KHR) - convert_VkAccelerationStructureGeometryInstancesDataKHR_win32_to_host(&in->instances, &out->instances); -} - -static inline void convert_VkAccelerationStructureGeometryKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryKHR32 *in, VkAccelerationStructureGeometryKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->geometryType = in->geometryType; - convert_VkAccelerationStructureGeometryDataKHR_win32_to_host(ctx, &in->geometry, &out->geometry, in->geometryType); - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkAccelerationStructureGeometryKHR *convert_VkAccelerationStructureGeometryKHR_array_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryKHR32 *in, uint32_t count) -{ - VkAccelerationStructureGeometryKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAccelerationStructureGeometryKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const VkAccelerationStructureGeometryKHR * const*convert_VkAccelerationStructureGeometryKHR_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkAccelerationStructureGeometryKHR **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - if (in[i]) - { - out[i] = conversion_context_alloc(ctx, sizeof(*out[i])); - convert_VkAccelerationStructureGeometryKHR_win32_to_host(ctx, (VkAccelerationStructureGeometryKHR32 *)UlongToPtr(in[i]), out[i]); - } - else - out[i] = NULL; - } - - return (void *)out; -} - -static inline void convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureBuildGeometryInfoKHR32 *in, VkAccelerationStructureBuildGeometryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->mode = in->mode; - out->srcAccelerationStructure = in->srcAccelerationStructure; - out->dstAccelerationStructure = in->dstAccelerationStructure; - out->geometryCount = in->geometryCount; - out->pGeometries = convert_VkAccelerationStructureGeometryKHR_array_win32_to_host(ctx, (const VkAccelerationStructureGeometryKHR32 *)UlongToPtr(in->pGeometries), in->geometryCount); - out->ppGeometries = convert_VkAccelerationStructureGeometryKHR_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppGeometries), in->geometryCount); - out->scratchData = in->scratchData; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkAccelerationStructureBuildGeometryInfoKHR *convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureBuildGeometryInfoKHR32 *in, uint32_t count) -{ - VkAccelerationStructureBuildGeometryInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkMicromapBuildInfoEXT_win32_to_host(struct conversion_context *ctx, const VkMicromapBuildInfoEXT32 *in, VkMicromapBuildInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->mode = in->mode; - out->dstMicromap = in->dstMicromap; - out->usageCountsCount = in->usageCountsCount; - out->pUsageCounts = (const VkMicromapUsageEXT *)UlongToPtr(in->pUsageCounts); - out->ppUsageCounts = convert_VkMicromapUsageEXT_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppUsageCounts), in->usageCountsCount); - out->data = in->data; - out->scratchData = in->scratchData; - out->triangleArray = in->triangleArray; - out->triangleArrayStride = in->triangleArrayStride; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMicromapBuildInfoEXT *convert_VkMicromapBuildInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkMicromapBuildInfoEXT32 *in, uint32_t count) -{ - VkMicromapBuildInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMicromapBuildInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkConditionalRenderingBeginInfoEXT_win32_to_host(const VkConditionalRenderingBeginInfoEXT32 *in, VkConditionalRenderingBeginInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - out->offset = in->offset; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugUtilsLabelEXT_win32_to_host(const VkDebugUtilsLabelEXT32 *in, VkDebugUtilsLabelEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pLabelName = (const char *)UlongToPtr(in->pLabelName); - memcpy(out->color, in->color, 4 * sizeof(float)); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSampleLocationsInfoEXT_win32_to_host(const VkSampleLocationsInfoEXT32 *in, VkSampleLocationsInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->sampleLocationsPerPixel = in->sampleLocationsPerPixel; - out->sampleLocationGridSize = in->sampleLocationGridSize; - out->sampleLocationsCount = in->sampleLocationsCount; - out->pSampleLocations = (const VkSampleLocationEXT *)UlongToPtr(in->pSampleLocations); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAttachmentSampleLocationsEXT_win32_to_host(const VkAttachmentSampleLocationsEXT32 *in, VkAttachmentSampleLocationsEXT *out) -{ - if (!in) return; - - out->attachmentIndex = in->attachmentIndex; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in->sampleLocationsInfo, &out->sampleLocationsInfo); -} - -static inline const VkAttachmentSampleLocationsEXT *convert_VkAttachmentSampleLocationsEXT_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentSampleLocationsEXT32 *in, uint32_t count) -{ - VkAttachmentSampleLocationsEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentSampleLocationsEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassSampleLocationsEXT_win32_to_host(const VkSubpassSampleLocationsEXT32 *in, VkSubpassSampleLocationsEXT *out) -{ - if (!in) return; - - out->subpassIndex = in->subpassIndex; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in->sampleLocationsInfo, &out->sampleLocationsInfo); -} - -static inline const VkSubpassSampleLocationsEXT *convert_VkSubpassSampleLocationsEXT_array_win32_to_host(struct conversion_context *ctx, const VkSubpassSampleLocationsEXT32 *in, uint32_t count) -{ - VkSubpassSampleLocationsEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassSampleLocationsEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassBeginInfo_win32_to_host(struct conversion_context *ctx, const VkRenderPassBeginInfo32 *in, VkRenderPassBeginInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->renderPass = in->renderPass; - out->framebuffer = in->framebuffer; - out->renderArea = in->renderArea; - out->clearValueCount = in->clearValueCount; - out->pClearValues = (const VkClearValue *)UlongToPtr(in->pClearValues); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: - { - VkDeviceGroupRenderPassBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupRenderPassBeginInfo32 *in_ext = (const VkDeviceGroupRenderPassBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_ext->deviceRenderAreaCount = in_ext->deviceRenderAreaCount; - out_ext->pDeviceRenderAreas = (const VkRect2D *)UlongToPtr(in_ext->pDeviceRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: - { - VkRenderPassSampleLocationsBeginInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassSampleLocationsBeginInfoEXT32 *in_ext = (const VkRenderPassSampleLocationsBeginInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT; - out_ext->pNext = NULL; - out_ext->attachmentInitialSampleLocationsCount = in_ext->attachmentInitialSampleLocationsCount; - out_ext->pAttachmentInitialSampleLocations = convert_VkAttachmentSampleLocationsEXT_array_win32_to_host(ctx, (const VkAttachmentSampleLocationsEXT32 *)UlongToPtr(in_ext->pAttachmentInitialSampleLocations), in_ext->attachmentInitialSampleLocationsCount); - out_ext->postSubpassSampleLocationsCount = in_ext->postSubpassSampleLocationsCount; - out_ext->pPostSubpassSampleLocations = convert_VkSubpassSampleLocationsEXT_array_win32_to_host(ctx, (const VkSubpassSampleLocationsEXT32 *)UlongToPtr(in_ext->pPostSubpassSampleLocations), in_ext->postSubpassSampleLocationsCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: - { - VkRenderPassAttachmentBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassAttachmentBeginInfo32 *in_ext = (const VkRenderPassAttachmentBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->attachmentCount = in_ext->attachmentCount; - out_ext->pAttachments = (const VkImageView *)UlongToPtr(in_ext->pAttachments); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: - { - VkRenderPassTransformBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassTransformBeginInfoQCOM32 *in_ext = (const VkRenderPassTransformBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: - { - VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *in_ext = (const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->perViewRenderAreaCount = in_ext->perViewRenderAreaCount; - out_ext->pPerViewRenderAreas = (const VkRect2D *)UlongToPtr(in_ext->pPerViewRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSubpassBeginInfo_win32_to_host(const VkSubpassBeginInfo32 *in, VkSubpassBeginInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->contents = in->contents; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkRenderingAttachmentInfo_win32_to_host(const VkRenderingAttachmentInfo32 *in, VkRenderingAttachmentInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - out->imageLayout = in->imageLayout; - out->resolveMode = in->resolveMode; - out->resolveImageView = in->resolveImageView; - out->resolveImageLayout = in->resolveImageLayout; - out->loadOp = in->loadOp; - out->storeOp = in->storeOp; - out->clearValue = in->clearValue; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRenderingAttachmentInfo *convert_VkRenderingAttachmentInfo_array_win32_to_host(struct conversion_context *ctx, const VkRenderingAttachmentInfo32 *in, uint32_t count) -{ - VkRenderingAttachmentInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRenderingAttachmentInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderingInfo_win32_to_host(struct conversion_context *ctx, const VkRenderingInfo32 *in, VkRenderingInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->renderArea = in->renderArea; - out->layerCount = in->layerCount; - out->viewMask = in->viewMask; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pColorAttachments), in->colorAttachmentCount); - out->pDepthAttachment = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pDepthAttachment), 1); - out->pStencilAttachment = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pStencilAttachment), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: - { - VkDeviceGroupRenderPassBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupRenderPassBeginInfo32 *in_ext = (const VkDeviceGroupRenderPassBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_ext->deviceRenderAreaCount = in_ext->deviceRenderAreaCount; - out_ext->pDeviceRenderAreas = (const VkRect2D *)UlongToPtr(in_ext->pDeviceRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT: - { - VkMultisampledRenderToSingleSampledInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultisampledRenderToSingleSampledInfoEXT32 *in_ext = (const VkMultisampledRenderToSingleSampledInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampledEnable = in_ext->multisampledRenderToSingleSampledEnable; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: - { - VkRenderingFragmentShadingRateAttachmentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingFragmentShadingRateAttachmentInfoKHR32 *in_ext = (const VkRenderingFragmentShadingRateAttachmentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->imageView = in_ext->imageView; - out_ext->imageLayout = in_ext->imageLayout; - out_ext->shadingRateAttachmentTexelSize = in_ext->shadingRateAttachmentTexelSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: - { - VkRenderingFragmentDensityMapAttachmentInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingFragmentDensityMapAttachmentInfoEXT32 *in_ext = (const VkRenderingFragmentDensityMapAttachmentInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT; - out_ext->pNext = NULL; - out_ext->imageView = in_ext->imageView; - out_ext->imageLayout = in_ext->imageLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: - { - VkMultiviewPerViewAttributesInfoNVX *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewAttributesInfoNVX32 *in_ext = (const VkMultiviewPerViewAttributesInfoNVX32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; - out_ext->pNext = NULL; - out_ext->perViewAttributes = in_ext->perViewAttributes; - out_ext->perViewAttributesPositionXOnly = in_ext->perViewAttributesPositionXOnly; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: - { - VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *in_ext = (const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->perViewRenderAreaCount = in_ext->perViewRenderAreaCount; - out_ext->pPerViewRenderAreas = (const VkRect2D *)UlongToPtr(in_ext->pPerViewRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorBufferBindingInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferBindingInfoEXT32 *in, VkDescriptorBufferBindingInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->address = in->address; - out->usage = in->usage; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR: - { - VkBufferUsageFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfoKHR32 *in_ext = (const VkBufferUsageFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT: - { - VkDescriptorBufferBindingPushDescriptorBufferHandleEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 *in_ext = (const VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT; - out_ext->pNext = NULL; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkDescriptorBufferBindingInfoEXT *convert_VkDescriptorBufferBindingInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferBindingInfoEXT32 *in, uint32_t count) -{ - VkDescriptorBufferBindingInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorBufferBindingInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageBlit2_win32_to_host(struct conversion_context *ctx, const VkImageBlit232 *in, VkImageBlit2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - memcpy(out->srcOffsets, in->srcOffsets, 2 * sizeof(VkOffset3D)); - out->dstSubresource = in->dstSubresource; - memcpy(out->dstOffsets, in->dstOffsets, 2 * sizeof(VkOffset3D)); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: - { - VkCopyCommandTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCopyCommandTransformInfoQCOM32 *in_ext = (const VkCopyCommandTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageBlit2 *convert_VkImageBlit2_array_win32_to_host(struct conversion_context *ctx, const VkImageBlit232 *in, uint32_t count) -{ - VkImageBlit2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageBlit2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBlitImageInfo2_win32_to_host(struct conversion_context *ctx, const VkBlitImageInfo232 *in, VkBlitImageInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageBlit2_array_win32_to_host(ctx, (const VkImageBlit232 *)UlongToPtr(in->pRegions), in->regionCount); - out->filter = in->filter; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM: - { - VkBlitImageCubicWeightsInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBlitImageCubicWeightsInfoQCOM32 *in_ext = (const VkBlitImageCubicWeightsInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->cubicWeights = in_ext->cubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkGeometryTrianglesNV_win32_to_host(const VkGeometryTrianglesNV32 *in, VkGeometryTrianglesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->vertexData = in->vertexData; - out->vertexOffset = in->vertexOffset; - out->vertexCount = in->vertexCount; - out->vertexStride = in->vertexStride; - out->vertexFormat = in->vertexFormat; - out->indexData = in->indexData; - out->indexOffset = in->indexOffset; - out->indexCount = in->indexCount; - out->indexType = in->indexType; - out->transformData = in->transformData; - out->transformOffset = in->transformOffset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGeometryAABBNV_win32_to_host(const VkGeometryAABBNV32 *in, VkGeometryAABBNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->aabbData = in->aabbData; - out->numAABBs = in->numAABBs; - out->stride = in->stride; - out->offset = in->offset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGeometryDataNV_win32_to_host(const VkGeometryDataNV32 *in, VkGeometryDataNV *out) -{ - if (!in) return; - - convert_VkGeometryTrianglesNV_win32_to_host(&in->triangles, &out->triangles); - convert_VkGeometryAABBNV_win32_to_host(&in->aabbs, &out->aabbs); -} - -static inline void convert_VkGeometryNV_win32_to_host(const VkGeometryNV32 *in, VkGeometryNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->geometryType = in->geometryType; - convert_VkGeometryDataNV_win32_to_host(&in->geometry, &out->geometry); - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkGeometryNV *convert_VkGeometryNV_array_win32_to_host(struct conversion_context *ctx, const VkGeometryNV32 *in, uint32_t count) -{ - VkGeometryNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGeometryNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAccelerationStructureInfoNV_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureInfoNV32 *in, VkAccelerationStructureInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->instanceCount = in->instanceCount; - out->geometryCount = in->geometryCount; - out->pGeometries = convert_VkGeometryNV_array_win32_to_host(ctx, (const VkGeometryNV32 *)UlongToPtr(in->pGeometries), in->geometryCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyAccelerationStructureInfoKHR_win32_to_host(const VkCopyAccelerationStructureInfoKHR32 *in, VkCopyAccelerationStructureInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host(const VkCopyAccelerationStructureToMemoryInfoKHR32 *in, VkCopyAccelerationStructureToMemoryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferCopy_win32_to_host(const VkBufferCopy32 *in, VkBufferCopy *out) -{ - if (!in) return; - - out->srcOffset = in->srcOffset; - out->dstOffset = in->dstOffset; - out->size = in->size; -} - -static inline const VkBufferCopy *convert_VkBufferCopy_array_win32_to_host(struct conversion_context *ctx, const VkBufferCopy32 *in, uint32_t count) -{ - VkBufferCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferCopy2_win32_to_host(const VkBufferCopy232 *in, VkBufferCopy2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcOffset = in->srcOffset; - out->dstOffset = in->dstOffset; - out->size = in->size; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkBufferCopy2 *convert_VkBufferCopy2_array_win32_to_host(struct conversion_context *ctx, const VkBufferCopy232 *in, uint32_t count) -{ - VkBufferCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCopy2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyBufferInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyBufferInfo232 *in, VkCopyBufferInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcBuffer = in->srcBuffer; - out->dstBuffer = in->dstBuffer; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferCopy2_array_win32_to_host(ctx, (const VkBufferCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferImageCopy_win32_to_host(const VkBufferImageCopy32 *in, VkBufferImageCopy *out) -{ - if (!in) return; - - out->bufferOffset = in->bufferOffset; - out->bufferRowLength = in->bufferRowLength; - out->bufferImageHeight = in->bufferImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; -} - -static inline const VkBufferImageCopy *convert_VkBufferImageCopy_array_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy32 *in, uint32_t count) -{ - VkBufferImageCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferImageCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferImageCopy2_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy232 *in, VkBufferImageCopy2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->bufferOffset = in->bufferOffset; - out->bufferRowLength = in->bufferRowLength; - out->bufferImageHeight = in->bufferImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: - { - VkCopyCommandTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCopyCommandTransformInfoQCOM32 *in_ext = (const VkCopyCommandTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferImageCopy2 *convert_VkBufferImageCopy2_array_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy232 *in, uint32_t count) -{ - VkBufferImageCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferImageCopy2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyBufferToImageInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyBufferToImageInfo232 *in, VkCopyBufferToImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcBuffer = in->srcBuffer; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferImageCopy2_array_win32_to_host(ctx, (const VkBufferImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageCopy2_win32_to_host(const VkImageCopy232 *in, VkImageCopy2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - out->srcOffset = in->srcOffset; - out->dstSubresource = in->dstSubresource; - out->dstOffset = in->dstOffset; - out->extent = in->extent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageCopy2 *convert_VkImageCopy2_array_win32_to_host(struct conversion_context *ctx, const VkImageCopy232 *in, uint32_t count) -{ - VkImageCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageCopy2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyImageInfo232 *in, VkCopyImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageCopy2_array_win32_to_host(ctx, (const VkImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyImageToBufferInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyImageToBufferInfo232 *in, VkCopyImageToBufferInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstBuffer = in->dstBuffer; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferImageCopy2_array_win32_to_host(ctx, (const VkBufferImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host(const VkCopyMemoryToAccelerationStructureInfoKHR32 *in, VkCopyMemoryToAccelerationStructureInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host(const VkCopyMemoryToMicromapInfoEXT32 *in, VkCopyMemoryToMicromapInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMicromapInfoEXT_win32_to_host(const VkCopyMicromapInfoEXT32 *in, VkCopyMicromapInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host(const VkCopyMicromapToMemoryInfoEXT32 *in, VkCopyMicromapToMemoryInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCuLaunchInfoNVX_win32_to_host(const VkCuLaunchInfoNVX32 *in, VkCuLaunchInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->function = in->function; - out->gridDimX = in->gridDimX; - out->gridDimY = in->gridDimY; - out->gridDimZ = in->gridDimZ; - out->blockDimX = in->blockDimX; - out->blockDimY = in->blockDimY; - out->blockDimZ = in->blockDimZ; - out->sharedMemBytes = in->sharedMemBytes; - out->paramCount = in->paramCount; - out->pParams = (const void * const *)UlongToPtr(in->pParams); - out->extraCount = in->extraCount; - out->pExtras = (const void * const *)UlongToPtr(in->pExtras); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCudaLaunchInfoNV_win32_to_host(const VkCudaLaunchInfoNV32 *in, VkCudaLaunchInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->function = in->function; - out->gridDimX = in->gridDimX; - out->gridDimY = in->gridDimY; - out->gridDimZ = in->gridDimZ; - out->blockDimX = in->blockDimX; - out->blockDimY = in->blockDimY; - out->blockDimZ = in->blockDimZ; - out->sharedMemBytes = in->sharedMemBytes; - out->paramCount = in->paramCount; - out->pParams = (const void * const *)UlongToPtr(in->pParams); - out->extraCount = in->extraCount; - out->pExtras = (const void * const *)UlongToPtr(in->pExtras); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugMarkerMarkerInfoEXT_win32_to_host(const VkDebugMarkerMarkerInfoEXT32 *in, VkDebugMarkerMarkerInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pMarkerName = (const char *)UlongToPtr(in->pMarkerName); - memcpy(out->color, in->color, 4 * sizeof(float)); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDecompressMemoryRegionNV_win32_to_host(const VkDecompressMemoryRegionNV32 *in, VkDecompressMemoryRegionNV *out) -{ - if (!in) return; - - out->srcAddress = in->srcAddress; - out->dstAddress = in->dstAddress; - out->compressedSize = in->compressedSize; - out->decompressedSize = in->decompressedSize; - out->decompressionMethod = in->decompressionMethod; -} - -static inline const VkDecompressMemoryRegionNV *convert_VkDecompressMemoryRegionNV_array_win32_to_host(struct conversion_context *ctx, const VkDecompressMemoryRegionNV32 *in, uint32_t count) -{ - VkDecompressMemoryRegionNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDecompressMemoryRegionNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassEndInfo_win32_to_host(struct conversion_context *ctx, const VkSubpassEndInfo32 *in, VkSubpassEndInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM: - { - VkSubpassFragmentDensityMapOffsetEndInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 *in_ext = (const VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityOffsetCount = in_ext->fragmentDensityOffsetCount; - out_ext->pFragmentDensityOffsets = (const VkOffset2D *)UlongToPtr(in_ext->pFragmentDensityOffsets); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkCommandBuffer *convert_VkCommandBuffer_array_win64_to_host(struct conversion_context *ctx, const VkCommandBuffer *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_cmd_buffer_from_handle(in[i])->host_command_buffer; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkCommandBuffer *convert_VkCommandBuffer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_cmd_buffer_from_handle(UlongToPtr(in[i]))->host_command_buffer; - } - - return out; -} - -static inline void convert_VkIndirectCommandsStreamNV_win32_to_host(const VkIndirectCommandsStreamNV32 *in, VkIndirectCommandsStreamNV *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->offset = in->offset; -} - -static inline const VkIndirectCommandsStreamNV *convert_VkIndirectCommandsStreamNV_array_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsStreamNV32 *in, uint32_t count) -{ - VkIndirectCommandsStreamNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectCommandsStreamNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkGeneratedCommandsInfoNV_win32_to_host(struct conversion_context *ctx, const VkGeneratedCommandsInfoNV32 *in, VkGeneratedCommandsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->streamCount = in->streamCount; - out->pStreams = convert_VkIndirectCommandsStreamNV_array_win32_to_host(ctx, (const VkIndirectCommandsStreamNV32 *)UlongToPtr(in->pStreams), in->streamCount); - out->sequencesCount = in->sequencesCount; - out->preprocessBuffer = in->preprocessBuffer; - out->preprocessOffset = in->preprocessOffset; - out->preprocessSize = in->preprocessSize; - out->sequencesCountBuffer = in->sequencesCountBuffer; - out->sequencesCountOffset = in->sequencesCountOffset; - out->sequencesIndexBuffer = in->sequencesIndexBuffer; - out->sequencesIndexOffset = in->sequencesIndexOffset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowExecuteInfoNV_win32_to_host(const VkOpticalFlowExecuteInfoNV32 *in, VkOpticalFlowExecuteInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->regionCount = in->regionCount; - out->pRegions = (const VkRect2D *)UlongToPtr(in->pRegions); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryBarrier_win32_to_host(const VkMemoryBarrier32 *in, VkMemoryBarrier *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryBarrier *convert_VkMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkMemoryBarrier32 *in, uint32_t count) -{ - VkMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryBarrier_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferMemoryBarrier_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier32 *in, VkBufferMemoryBarrier *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferMemoryBarrier *convert_VkBufferMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier32 *in, uint32_t count) -{ - VkBufferMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferMemoryBarrier_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageMemoryBarrier_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier32 *in, VkImageMemoryBarrier *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->image = in->image; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: - { - VkSampleLocationsInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSampleLocationsInfoEXT32 *in_ext = (const VkSampleLocationsInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsPerPixel = in_ext->sampleLocationsPerPixel; - out_ext->sampleLocationGridSize = in_ext->sampleLocationGridSize; - out_ext->sampleLocationsCount = in_ext->sampleLocationsCount; - out_ext->pSampleLocations = (const VkSampleLocationEXT *)UlongToPtr(in_ext->pSampleLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageMemoryBarrier *convert_VkImageMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier32 *in, uint32_t count) -{ - VkImageMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageMemoryBarrier_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkMemoryBarrier2_win32_to_host(const VkMemoryBarrier232 *in, VkMemoryBarrier2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryBarrier2 *convert_VkMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkMemoryBarrier232 *in, uint32_t count) -{ - VkMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryBarrier2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferMemoryBarrier2_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier232 *in, VkBufferMemoryBarrier2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferMemoryBarrier2 *convert_VkBufferMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier232 *in, uint32_t count) -{ - VkBufferMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferMemoryBarrier2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageMemoryBarrier2_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier232 *in, VkImageMemoryBarrier2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->image = in->image; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: - { - VkSampleLocationsInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSampleLocationsInfoEXT32 *in_ext = (const VkSampleLocationsInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsPerPixel = in_ext->sampleLocationsPerPixel; - out_ext->sampleLocationGridSize = in_ext->sampleLocationGridSize; - out_ext->sampleLocationsCount = in_ext->sampleLocationsCount; - out_ext->pSampleLocations = (const VkSampleLocationEXT *)UlongToPtr(in_ext->pSampleLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageMemoryBarrier2 *convert_VkImageMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier232 *in, uint32_t count) -{ - VkImageMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageMemoryBarrier2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDependencyInfo_win32_to_host(struct conversion_context *ctx, const VkDependencyInfo32 *in, VkDependencyInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dependencyFlags = in->dependencyFlags; - out->memoryBarrierCount = in->memoryBarrierCount; - out->pMemoryBarriers = convert_VkMemoryBarrier2_array_win32_to_host(ctx, (const VkMemoryBarrier232 *)UlongToPtr(in->pMemoryBarriers), in->memoryBarrierCount); - out->bufferMemoryBarrierCount = in->bufferMemoryBarrierCount; - out->pBufferMemoryBarriers = convert_VkBufferMemoryBarrier2_array_win32_to_host(ctx, (const VkBufferMemoryBarrier232 *)UlongToPtr(in->pBufferMemoryBarriers), in->bufferMemoryBarrierCount); - out->imageMemoryBarrierCount = in->imageMemoryBarrierCount; - out->pImageMemoryBarriers = convert_VkImageMemoryBarrier2_array_win32_to_host(ctx, (const VkImageMemoryBarrier232 *)UlongToPtr(in->pImageMemoryBarriers), in->imageMemoryBarrierCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorImageInfo_win32_to_host(const VkDescriptorImageInfo32 *in, VkDescriptorImageInfo *out) -{ - if (!in) return; - - out->sampler = in->sampler; - out->imageView = in->imageView; - out->imageLayout = in->imageLayout; -} - -static inline const VkDescriptorImageInfo *convert_VkDescriptorImageInfo_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorImageInfo32 *in, uint32_t count) -{ - VkDescriptorImageInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorImageInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorBufferInfo_win32_to_host(const VkDescriptorBufferInfo32 *in, VkDescriptorBufferInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->offset = in->offset; - out->range = in->range; -} - -static inline const VkDescriptorBufferInfo *convert_VkDescriptorBufferInfo_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferInfo32 *in, uint32_t count) -{ - VkDescriptorBufferInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorBufferInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkWriteDescriptorSet_win32_to_host(struct conversion_context *ctx, const VkWriteDescriptorSet32 *in, VkWriteDescriptorSet *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dstSet = in->dstSet; - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - out->descriptorType = in->descriptorType; - out->pImageInfo = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pImageInfo), in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER || in->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE || in->descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT || in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM || in->descriptorType == VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM ? in->descriptorCount : 0); - out->pBufferInfo = convert_VkDescriptorBufferInfo_array_win32_to_host(ctx, (const VkDescriptorBufferInfo32 *)UlongToPtr(in->pBufferInfo), in->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || in->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ? in->descriptorCount : 0); - out->pTexelBufferView = (const VkBufferView *)UlongToPtr(in->pTexelBufferView); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK: - { - VkWriteDescriptorSetInlineUniformBlock *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetInlineUniformBlock32 *in_ext = (const VkWriteDescriptorSetInlineUniformBlock32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK; - out_ext->pNext = NULL; - out_ext->dataSize = in_ext->dataSize; - out_ext->pData = (const void *)UlongToPtr(in_ext->pData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: - { - VkWriteDescriptorSetAccelerationStructureKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetAccelerationStructureKHR32 *in_ext = (const VkWriteDescriptorSetAccelerationStructureKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructureCount = in_ext->accelerationStructureCount; - out_ext->pAccelerationStructures = (const VkAccelerationStructureKHR *)UlongToPtr(in_ext->pAccelerationStructures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: - { - VkWriteDescriptorSetAccelerationStructureNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetAccelerationStructureNV32 *in_ext = (const VkWriteDescriptorSetAccelerationStructureNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV; - out_ext->pNext = NULL; - out_ext->accelerationStructureCount = in_ext->accelerationStructureCount; - out_ext->pAccelerationStructures = (const VkAccelerationStructureNV *)UlongToPtr(in_ext->pAccelerationStructures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkWriteDescriptorSet *convert_VkWriteDescriptorSet_array_win32_to_host(struct conversion_context *ctx, const VkWriteDescriptorSet32 *in, uint32_t count) -{ - VkWriteDescriptorSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkWriteDescriptorSet_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageResolve2_win32_to_host(const VkImageResolve232 *in, VkImageResolve2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - out->srcOffset = in->srcOffset; - out->dstSubresource = in->dstSubresource; - out->dstOffset = in->dstOffset; - out->extent = in->extent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageResolve2 *convert_VkImageResolve2_array_win32_to_host(struct conversion_context *ctx, const VkImageResolve232 *in, uint32_t count) -{ - VkImageResolve2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageResolve2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkResolveImageInfo2_win32_to_host(struct conversion_context *ctx, const VkResolveImageInfo232 *in, VkResolveImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageResolve2_array_win32_to_host(ctx, (const VkImageResolve232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCoarseSampleOrderCustomNV_win32_to_host(const VkCoarseSampleOrderCustomNV32 *in, VkCoarseSampleOrderCustomNV *out) -{ - if (!in) return; - - out->shadingRate = in->shadingRate; - out->sampleCount = in->sampleCount; - out->sampleLocationCount = in->sampleLocationCount; - out->pSampleLocations = (const VkCoarseSampleLocationNV *)UlongToPtr(in->pSampleLocations); -} - -static inline const VkCoarseSampleOrderCustomNV *convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(struct conversion_context *ctx, const VkCoarseSampleOrderCustomNV32 *in, uint32_t count) -{ - VkCoarseSampleOrderCustomNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCoarseSampleOrderCustomNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDepthBiasInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDepthBiasInfoEXT32 *in, VkDepthBiasInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->depthBiasConstantFactor = in->depthBiasConstantFactor; - out->depthBiasClamp = in->depthBiasClamp; - out->depthBiasSlopeFactor = in->depthBiasSlopeFactor; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT: - { - VkDepthBiasRepresentationInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDepthBiasRepresentationInfoEXT32 *in_ext = (const VkDepthBiasRepresentationInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasRepresentation = in_ext->depthBiasRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPerformanceMarkerInfoINTEL_win32_to_host(const VkPerformanceMarkerInfoINTEL32 *in, VkPerformanceMarkerInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceOverrideInfoINTEL_win32_to_host(const VkPerformanceOverrideInfoINTEL32 *in, VkPerformanceOverrideInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->enable = in->enable; - out->parameter = in->parameter; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceStreamMarkerInfoINTEL_win32_to_host(const VkPerformanceStreamMarkerInfoINTEL32 *in, VkPerformanceStreamMarkerInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkVertexInputBindingDescription2EXT_win32_to_host(const VkVertexInputBindingDescription2EXT32 *in, VkVertexInputBindingDescription2EXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->binding = in->binding; - out->stride = in->stride; - out->inputRate = in->inputRate; - out->divisor = in->divisor; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVertexInputBindingDescription2EXT *convert_VkVertexInputBindingDescription2EXT_array_win32_to_host(struct conversion_context *ctx, const VkVertexInputBindingDescription2EXT32 *in, uint32_t count) -{ - VkVertexInputBindingDescription2EXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVertexInputBindingDescription2EXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVertexInputAttributeDescription2EXT_win32_to_host(const VkVertexInputAttributeDescription2EXT32 *in, VkVertexInputAttributeDescription2EXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->location = in->location; - out->binding = in->binding; - out->format = in->format; - out->offset = in->offset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVertexInputAttributeDescription2EXT *convert_VkVertexInputAttributeDescription2EXT_array_win32_to_host(struct conversion_context *ctx, const VkVertexInputAttributeDescription2EXT32 *in, uint32_t count) -{ - VkVertexInputAttributeDescription2EXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVertexInputAttributeDescription2EXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkShadingRatePaletteNV_win32_to_host(const VkShadingRatePaletteNV32 *in, VkShadingRatePaletteNV *out) -{ - if (!in) return; - - out->shadingRatePaletteEntryCount = in->shadingRatePaletteEntryCount; - out->pShadingRatePaletteEntries = (const VkShadingRatePaletteEntryNV *)UlongToPtr(in->pShadingRatePaletteEntries); -} - -static inline const VkShadingRatePaletteNV *convert_VkShadingRatePaletteNV_array_win32_to_host(struct conversion_context *ctx, const VkShadingRatePaletteNV32 *in, uint32_t count) -{ - VkShadingRatePaletteNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkShadingRatePaletteNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkStridedDeviceAddressRegionKHR_win32_to_host(const VkStridedDeviceAddressRegionKHR32 *in, VkStridedDeviceAddressRegionKHR *out) -{ - if (!in) return; - - out->deviceAddress = in->deviceAddress; - out->stride = in->stride; - out->size = in->size; -} - -static inline const VkDependencyInfo *convert_VkDependencyInfo_array_win32_to_host(struct conversion_context *ctx, const VkDependencyInfo32 *in, uint32_t count) -{ - VkDependencyInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDependencyInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageToImageInfoEXT_win32_to_host(struct conversion_context *ctx, const VkCopyImageToImageInfoEXT32 *in, VkCopyImageToImageInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageCopy2_array_win32_to_host(ctx, (const VkImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageToMemoryCopyEXT_win32_to_host(const VkImageToMemoryCopyEXT32 *in, VkImageToMemoryCopyEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pHostPointer = (void *)UlongToPtr(in->pHostPointer); - out->memoryRowLength = in->memoryRowLength; - out->memoryImageHeight = in->memoryImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageToMemoryCopyEXT *convert_VkImageToMemoryCopyEXT_array_win32_to_host(struct conversion_context *ctx, const VkImageToMemoryCopyEXT32 *in, uint32_t count) -{ - VkImageToMemoryCopyEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageToMemoryCopyEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageToMemoryInfoEXT_win32_to_host(struct conversion_context *ctx, const VkCopyImageToMemoryInfoEXT32 *in, VkCopyImageToMemoryInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageToMemoryCopyEXT_array_win32_to_host(ctx, (const VkImageToMemoryCopyEXT32 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryToImageCopyEXT_win32_to_host(const VkMemoryToImageCopyEXT32 *in, VkMemoryToImageCopyEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pHostPointer = (const void *)UlongToPtr(in->pHostPointer); - out->memoryRowLength = in->memoryRowLength; - out->memoryImageHeight = in->memoryImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryToImageCopyEXT *convert_VkMemoryToImageCopyEXT_array_win32_to_host(struct conversion_context *ctx, const VkMemoryToImageCopyEXT32 *in, uint32_t count) -{ - VkMemoryToImageCopyEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryToImageCopyEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyMemoryToImageInfoEXT_win32_to_host(struct conversion_context *ctx, const VkCopyMemoryToImageInfoEXT32 *in, VkCopyMemoryToImageInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkMemoryToImageCopyEXT_array_win32_to_host(ctx, (const VkMemoryToImageCopyEXT32 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureCreateInfoKHR32 *in, VkAccelerationStructureCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->createFlags = in->createFlags; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - out->type = in->type; - out->deviceAddress = in->deviceAddress; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: - { - VkAccelerationStructureMotionInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureMotionInfoNV32 *in_ext = (const VkAccelerationStructureMotionInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV; - out_ext->pNext = NULL; - out_ext->maxInstances = in_ext->maxInstances; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAccelerationStructureCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureCreateInfoNV32 *in, VkAccelerationStructureCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->compactedSize = in->compactedSize; - convert_VkAccelerationStructureInfoNV_win32_to_host(ctx, &in->info, &out->info); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkBufferCreateInfo_win32_to_host(struct conversion_context *ctx, const VkBufferCreateInfo32 *in, VkBufferCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->size = in->size; - out->usage = in->usage; - out->sharingMode = in->sharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = (const uint32_t *)UlongToPtr(in->pQueueFamilyIndices); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR: - { - VkBufferUsageFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfoKHR32 *in_ext = (const VkBufferUsageFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: - { - VkDedicatedAllocationBufferCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationBufferCreateInfoNV32 *in_ext = (const VkDedicatedAllocationBufferCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocation = in_ext->dedicatedAllocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: - { - VkExternalMemoryBufferCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryBufferCreateInfo32 *in_ext = (const VkExternalMemoryBufferCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: - { - VkBufferOpaqueCaptureAddressCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferOpaqueCaptureAddressCreateInfo32 *in_ext = (const VkBufferOpaqueCaptureAddressCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->opaqueCaptureAddress = in_ext->opaqueCaptureAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: - { - VkBufferDeviceAddressCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferDeviceAddressCreateInfoEXT32 *in_ext = (const VkBufferDeviceAddressCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->deviceAddress = in_ext->deviceAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkBufferViewCreateInfo_win32_to_host(struct conversion_context *ctx, const VkBufferViewCreateInfo32 *in, VkBufferViewCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->buffer = in->buffer; - out->format = in->format; - out->offset = in->offset; - out->range = in->range; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR: - { - VkBufferUsageFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfoKHR32 *in_ext = (const VkBufferUsageFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkCommandPoolCreateInfo_win32_to_host(const VkCommandPoolCreateInfo32 *in, VkCommandPoolCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineCreationFeedback_host_to_win32(const VkPipelineCreationFeedback *in, VkPipelineCreationFeedback32 *out) -{ - if (!in) return; - - out->flags = in->flags; - out->duration = in->duration; -} - -static inline VkPipelineCreationFeedback *convert_VkPipelineCreationFeedback_array_win32_to_host(struct conversion_context *ctx, const VkPipelineCreationFeedback32 *in, uint32_t count) -{ - VkPipelineCreationFeedback *out; - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - - return out; -} - -static inline void convert_VkPipelineCreationFeedback_array_host_to_win32(const VkPipelineCreationFeedback *in, VkPipelineCreationFeedback32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineCreationFeedback_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkSpecializationMapEntry_win32_to_host(const VkSpecializationMapEntry32 *in, VkSpecializationMapEntry *out) -{ - if (!in) return; - - out->constantID = in->constantID; - out->offset = in->offset; - out->size = in->size; -} - -static inline const VkSpecializationMapEntry *convert_VkSpecializationMapEntry_array_win32_to_host(struct conversion_context *ctx, const VkSpecializationMapEntry32 *in, uint32_t count) -{ - VkSpecializationMapEntry *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSpecializationMapEntry_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSpecializationInfo_win32_to_host(struct conversion_context *ctx, const VkSpecializationInfo32 *in, VkSpecializationInfo *out) -{ - if (!in) return; - - out->mapEntryCount = in->mapEntryCount; - out->pMapEntries = convert_VkSpecializationMapEntry_array_win32_to_host(ctx, (const VkSpecializationMapEntry32 *)UlongToPtr(in->pMapEntries), in->mapEntryCount); - out->dataSize = in->dataSize; - out->pData = (const void *)UlongToPtr(in->pData); -} - -static inline const VkSpecializationInfo *convert_VkSpecializationInfo_array_win32_to_host(struct conversion_context *ctx, const VkSpecializationInfo32 *in, uint32_t count) -{ - VkSpecializationInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSpecializationInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkPipelineShaderStageCreateInfo_win64_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo *in, VkPipelineShaderStageCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->module = in->module; - out->pName = in->pName; - out->pSpecializationInfo = in->pSpecializationInfo; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: - { - VkShaderModuleCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleCreateInfo *in_ext = (const VkShaderModuleCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->codeSize = in_ext->codeSize; - out_ext->pCode = in_ext->pCode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: - { - VkDebugUtilsObjectNameInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsObjectNameInfoEXT *in_ext = (const VkDebugUtilsObjectNameInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; - out_ext->pNext = NULL; - out_ext->objectType = in_ext->objectType; - out_ext->objectHandle = wine_vk_unwrap_handle(in_ext->objectType, in_ext->objectHandle); - out_ext->pObjectName = in_ext->pObjectName; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT: - { - VkPipelineShaderStageModuleIdentifierCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageModuleIdentifierCreateInfoEXT *in_ext = (const VkPipelineShaderStageModuleIdentifierCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->identifierSize = in_ext->identifierSize; - out_ext->pIdentifier = in_ext->pIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT *in_ext = (const VkPipelineRobustnessCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkPipelineShaderStageCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo32 *in, VkPipelineShaderStageCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->module = in->module; - out->pName = (const char *)UlongToPtr(in->pName); - out->pSpecializationInfo = convert_VkSpecializationInfo_array_win32_to_host(ctx, (const VkSpecializationInfo32 *)UlongToPtr(in->pSpecializationInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: - { - VkShaderModuleCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleCreateInfo32 *in_ext = (const VkShaderModuleCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->codeSize = in_ext->codeSize; - out_ext->pCode = (const uint32_t *)UlongToPtr(in_ext->pCode); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT32 *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: - { - VkDebugUtilsObjectNameInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsObjectNameInfoEXT32 *in_ext = (const VkDebugUtilsObjectNameInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; - out_ext->pNext = NULL; - out_ext->objectType = in_ext->objectType; - out_ext->objectHandle = wine_vk_unwrap_handle(in_ext->objectType, in_ext->objectHandle); - out_ext->pObjectName = (const char *)UlongToPtr(in_ext->pObjectName); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT: - { - VkPipelineShaderStageModuleIdentifierCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 *in_ext = (const VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->identifierSize = in_ext->identifierSize; - out_ext->pIdentifier = (const uint8_t *)UlongToPtr(in_ext->pIdentifier); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT32 *in_ext = (const VkPipelineRobustnessCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkComputePipelineCreateInfo_win64_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo *in, VkComputePipelineCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - convert_VkPipelineShaderStageCreateInfo_win64_to_host(ctx, &in->stage, &out->stage); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkComputePipelineCreateInfo_win32_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo32 *in, VkComputePipelineCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - convert_VkPipelineShaderStageCreateInfo_win32_to_host(ctx, &in->stage, &out->stage); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR: - { - VkPipelineCreateFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfoKHR32 *in_ext = (const VkPipelineCreateFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: - { - VkSubpassShadingPipelineCreateInfoHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassShadingPipelineCreateInfoHUAWEI32 *in_ext = (const VkSubpassShadingPipelineCreateInfoHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI; - out_ext->pNext = NULL; - out_ext->renderPass = in_ext->renderPass; - out_ext->subpass = in_ext->subpass; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD32 *in_ext = (const VkPipelineCompilerControlCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT32 *in_ext = (const VkPipelineRobustnessCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkComputePipelineCreateInfo_host_to_win32(const VkComputePipelineCreateInfo *in, const VkComputePipelineCreateInfo32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkComputePipelineCreateInfo *convert_VkComputePipelineCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo *in, uint32_t count) -{ - VkComputePipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkComputePipelineCreateInfo *convert_VkComputePipelineCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo32 *in, uint32_t count) -{ - VkComputePipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkComputePipelineCreateInfo_array_host_to_win32(const VkComputePipelineCreateInfo *in, const VkComputePipelineCreateInfo32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCuFunctionCreateInfoNVX_win32_to_host(const VkCuFunctionCreateInfoNVX32 *in, VkCuFunctionCreateInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->module = in->module; - out->pName = (const char *)UlongToPtr(in->pName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCuModuleCreateInfoNVX_win32_to_host(const VkCuModuleCreateInfoNVX32 *in, VkCuModuleCreateInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dataSize = in->dataSize; - out->pData = (const void *)UlongToPtr(in->pData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCudaFunctionCreateInfoNV_win32_to_host(const VkCudaFunctionCreateInfoNV32 *in, VkCudaFunctionCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->module = in->module; - out->pName = (const char *)UlongToPtr(in->pName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCudaModuleCreateInfoNV_win32_to_host(const VkCudaModuleCreateInfoNV32 *in, VkCudaModuleCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dataSize = in->dataSize; - out->pData = (const void *)UlongToPtr(in->pData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugReportCallbackCreateInfoEXT_win32_to_host(const VkDebugReportCallbackCreateInfoEXT32 *in, VkDebugReportCallbackCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pfnCallback = in->pfnCallback; - out->pUserData = (void *)UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugUtilsMessengerCreateInfoEXT_win32_to_host(const VkDebugUtilsMessengerCreateInfoEXT32 *in, VkDebugUtilsMessengerCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->messageSeverity = in->messageSeverity; - out->messageType = in->messageType; - out->pfnUserCallback = in->pfnUserCallback; - out->pUserData = (void *)UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMutableDescriptorTypeListEXT_win32_to_host(const VkMutableDescriptorTypeListEXT32 *in, VkMutableDescriptorTypeListEXT *out) -{ - if (!in) return; - - out->descriptorTypeCount = in->descriptorTypeCount; - out->pDescriptorTypes = (const VkDescriptorType *)UlongToPtr(in->pDescriptorTypes); -} - -static inline const VkMutableDescriptorTypeListEXT *convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(struct conversion_context *ctx, const VkMutableDescriptorTypeListEXT32 *in, uint32_t count) -{ - VkMutableDescriptorTypeListEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMutableDescriptorTypeListEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorPoolCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorPoolCreateInfo32 *in, VkDescriptorPoolCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->maxSets = in->maxSets; - out->poolSizeCount = in->poolSizeCount; - out->pPoolSizes = (const VkDescriptorPoolSize *)UlongToPtr(in->pPoolSizes); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO: - { - VkDescriptorPoolInlineUniformBlockCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorPoolInlineUniformBlockCreateInfo32 *in_ext = (const VkDescriptorPoolInlineUniformBlockCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->maxInlineUniformBlockBindings = in_ext->maxInlineUniformBlockBindings; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: - { - VkMutableDescriptorTypeCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMutableDescriptorTypeCreateInfoEXT32 *in_ext = (const VkMutableDescriptorTypeCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorTypeListCount = in_ext->mutableDescriptorTypeListCount; - out_ext->pMutableDescriptorTypeLists = convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(ctx, (const VkMutableDescriptorTypeListEXT32 *)UlongToPtr(in_ext->pMutableDescriptorTypeLists), in_ext->mutableDescriptorTypeListCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorSetLayoutBinding_win32_to_host(const VkDescriptorSetLayoutBinding32 *in, VkDescriptorSetLayoutBinding *out) -{ - if (!in) return; - - out->binding = in->binding; - out->descriptorType = in->descriptorType; - out->descriptorCount = in->descriptorCount; - out->stageFlags = in->stageFlags; - out->pImmutableSamplers = (const VkSampler *)UlongToPtr(in->pImmutableSamplers); -} - -static inline const VkDescriptorSetLayoutBinding *convert_VkDescriptorSetLayoutBinding_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutBinding32 *in, uint32_t count) -{ - VkDescriptorSetLayoutBinding *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorSetLayoutBinding_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutCreateInfo32 *in, VkDescriptorSetLayoutCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->bindingCount = in->bindingCount; - out->pBindings = convert_VkDescriptorSetLayoutBinding_array_win32_to_host(ctx, (const VkDescriptorSetLayoutBinding32 *)UlongToPtr(in->pBindings), in->bindingCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: - { - VkDescriptorSetLayoutBindingFlagsCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorSetLayoutBindingFlagsCreateInfo32 *in_ext = (const VkDescriptorSetLayoutBindingFlagsCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->bindingCount = in_ext->bindingCount; - out_ext->pBindingFlags = (const VkDescriptorBindingFlags *)UlongToPtr(in_ext->pBindingFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: - { - VkMutableDescriptorTypeCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMutableDescriptorTypeCreateInfoEXT32 *in_ext = (const VkMutableDescriptorTypeCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorTypeListCount = in_ext->mutableDescriptorTypeListCount; - out_ext->pMutableDescriptorTypeLists = convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(ctx, (const VkMutableDescriptorTypeListEXT32 *)UlongToPtr(in_ext->pMutableDescriptorTypeLists), in_ext->mutableDescriptorTypeListCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorUpdateTemplateEntry_win32_to_host(const VkDescriptorUpdateTemplateEntry32 *in, VkDescriptorUpdateTemplateEntry *out) -{ - if (!in) return; - - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - out->descriptorType = in->descriptorType; - out->offset = in->offset; - out->stride = in->stride; -} - -static inline const VkDescriptorUpdateTemplateEntry *convert_VkDescriptorUpdateTemplateEntry_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorUpdateTemplateEntry32 *in, uint32_t count) -{ - VkDescriptorUpdateTemplateEntry *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorUpdateTemplateEntry_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorUpdateTemplateCreateInfo32 *in, VkDescriptorUpdateTemplateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->descriptorUpdateEntryCount = in->descriptorUpdateEntryCount; - out->pDescriptorUpdateEntries = convert_VkDescriptorUpdateTemplateEntry_array_win32_to_host(ctx, (const VkDescriptorUpdateTemplateEntry32 *)UlongToPtr(in->pDescriptorUpdateEntries), in->descriptorUpdateEntryCount); - out->templateType = in->templateType; - out->descriptorSetLayout = in->descriptorSetLayout; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipelineLayout = in->pipelineLayout; - out->set = in->set; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkPhysicalDevice *convert_VkPhysicalDevice_array_win64_to_host(struct conversion_context *ctx, const VkPhysicalDevice *in, uint32_t count) -{ - VkPhysicalDevice *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_phys_dev_from_handle(in[i])->host_physical_device; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkPhysicalDevice *convert_VkPhysicalDevice_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkPhysicalDevice *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_phys_dev_from_handle(UlongToPtr(in[i]))->host_physical_device; - } - - return out; -} - -static inline void convert_VkDeviceQueueCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDeviceQueueCreateInfo32 *in, VkDeviceQueueCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - out->queueCount = in->queueCount; - out->pQueuePriorities = (const float *)UlongToPtr(in->pQueuePriorities); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR: - { - VkDeviceQueueGlobalPriorityCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueGlobalPriorityCreateInfoKHR32 *in_ext = (const VkDeviceQueueGlobalPriorityCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->globalPriority = in_ext->globalPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM32 *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkDeviceQueueCreateInfo *convert_VkDeviceQueueCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkDeviceQueueCreateInfo32 *in, uint32_t count) -{ - VkDeviceQueueCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceQueueCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const char * const*convert_char_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - char **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -#ifdef _WIN64 -static inline void convert_VkDeviceCreateInfo_win64_to_host(struct conversion_context *ctx, const VkDeviceCreateInfo *in, VkDeviceCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueCreateInfoCount = in->queueCreateInfoCount; - out->pQueueCreateInfos = in->pQueueCreateInfos; - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = in->ppEnabledLayerNames; - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = in->ppEnabledExtensionNames; - out->pEnabledFeatures = in->pEnabledFeatures; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: - { - VkDevicePrivateDataCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePrivateDataCreateInfo *in_ext = (const VkDevicePrivateDataCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->privateDataSlotRequestCount = in_ext->privateDataSlotRequestCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures *in_ext = (const VkPhysicalDevicePrivateDataFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: - { - VkPhysicalDeviceFeatures2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFeatures2 *in_ext = (const VkPhysicalDeviceFeatures2 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - out_ext->pNext = NULL; - out_ext->features = in_ext->features; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures *in_ext = (const VkPhysicalDeviceVariablePointersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures *in_ext = (const VkPhysicalDeviceMultiviewFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: - { - VkDeviceGroupDeviceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupDeviceCreateInfo *in_ext = (const VkDeviceGroupDeviceCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->physicalDeviceCount = in_ext->physicalDeviceCount; - out_ext->pPhysicalDevices = convert_VkPhysicalDevice_array_win64_to_host(ctx, in_ext->pPhysicalDevices, in_ext->physicalDeviceCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures *in_ext = (const VkPhysicalDevice16BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features *in_ext = (const VkPhysicalDeviceMaintenance4Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: - { - VkPhysicalDeviceMaintenance5FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5FeaturesKHR *in_ext = (const VkPhysicalDeviceMaintenance5FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures *in_ext = (const VkPhysicalDevice8BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: - { - VkDeviceMemoryOverallocationCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceMemoryOverallocationCreateInfoAMD *in_ext = (const VkDeviceMemoryOverallocationCreateInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->overallocationBehavior = in_ext->overallocationBehavior; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR: - { - VkPerformanceQueryReservationInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQueryReservationInfoKHR *in_ext = (const VkPerformanceQueryReservationInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxPerformanceQueriesPerPool = in_ext->maxPerformanceQueriesPerPool; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: - { - VkPhysicalDeviceIndexTypeUint8FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8FeaturesEXT *in_ext = (const VkPhysicalDeviceIndexTypeUint8FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: - { - VkPhysicalDeviceLineRasterizationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeaturesEXT *in_ext = (const VkPhysicalDeviceLineRasterizationFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features *in_ext = (const VkPhysicalDeviceVulkan11Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features *in_ext = (const VkPhysicalDeviceVulkan12Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features *in_ext = (const VkPhysicalDeviceVulkan13Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: - { - VkDeviceDiagnosticsConfigCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceDiagnosticsConfigCreateInfoNV *in_ext = (const VkDeviceDiagnosticsConfigCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features *in_ext = (const VkPhysicalDeviceSynchronization2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT: - { - VkPhysicalDeviceHostImageCopyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeaturesEXT *in_ext = (const VkPhysicalDeviceHostImageCopyFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineRobustnessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDeviceCreateInfo32 *in, VkDeviceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueCreateInfoCount = in->queueCreateInfoCount; - out->pQueueCreateInfos = convert_VkDeviceQueueCreateInfo_array_win32_to_host(ctx, (const VkDeviceQueueCreateInfo32 *)UlongToPtr(in->pQueueCreateInfos), in->queueCreateInfoCount); - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledLayerNames), in->enabledLayerCount); - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledExtensionNames), in->enabledExtensionCount); - out->pEnabledFeatures = (const VkPhysicalDeviceFeatures *)UlongToPtr(in->pEnabledFeatures); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: - { - VkDevicePrivateDataCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePrivateDataCreateInfo32 *in_ext = (const VkDevicePrivateDataCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->privateDataSlotRequestCount = in_ext->privateDataSlotRequestCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures32 *in_ext = (const VkPhysicalDevicePrivateDataFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: - { - VkPhysicalDeviceFeatures2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFeatures232 *in_ext = (const VkPhysicalDeviceFeatures232 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - out_ext->pNext = NULL; - out_ext->features = in_ext->features; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures32 *in_ext = (const VkPhysicalDeviceVariablePointersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures32 *in_ext = (const VkPhysicalDeviceMultiviewFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: - { - VkDeviceGroupDeviceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupDeviceCreateInfo32 *in_ext = (const VkDeviceGroupDeviceCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->physicalDeviceCount = in_ext->physicalDeviceCount; - out_ext->pPhysicalDevices = convert_VkPhysicalDevice_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in_ext->pPhysicalDevices), in_ext->physicalDeviceCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures32 *in_ext = (const VkPhysicalDevice16BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures32 *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures32 *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features32 *in_ext = (const VkPhysicalDeviceMaintenance4Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: - { - VkPhysicalDeviceMaintenance5FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5FeaturesKHR32 *in_ext = (const VkPhysicalDeviceMaintenance5FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures32 *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features32 *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures32 *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures32 *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures32 *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures32 *in_ext = (const VkPhysicalDevice8BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures32 *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features32 *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: - { - VkDeviceMemoryOverallocationCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceMemoryOverallocationCreateInfoAMD32 *in_ext = (const VkDeviceMemoryOverallocationCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->overallocationBehavior = in_ext->overallocationBehavior; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures32 *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures32 *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV32 *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR: - { - VkPerformanceQueryReservationInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQueryReservationInfoKHR32 *in_ext = (const VkPerformanceQueryReservationInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxPerformanceQueriesPerPool = in_ext->maxPerformanceQueriesPerPool; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: - { - VkPhysicalDeviceIndexTypeUint8FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 *in_ext = (const VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures32 *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: - { - VkPhysicalDeviceLineRasterizationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLineRasterizationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features32 *in_ext = (const VkPhysicalDeviceVulkan11Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features32 *in_ext = (const VkPhysicalDeviceVulkan12Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features32 *in_ext = (const VkPhysicalDeviceVulkan13Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: - { - VkDeviceDiagnosticsConfigCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceDiagnosticsConfigCreateInfoNV32 *in_ext = (const VkDeviceDiagnosticsConfigCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures32 *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features32 *in_ext = (const VkPhysicalDeviceSynchronization2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT: - { - VkPhysicalDeviceHostImageCopyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeaturesEXT32 *in_ext = (const VkPhysicalDeviceHostImageCopyFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineRobustnessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV32 *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM32 *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkEventCreateInfo_win32_to_host(const VkEventCreateInfo32 *in, VkEventCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkFenceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkFenceCreateInfo32 *in, VkFenceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: - { - VkExportFenceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportFenceCreateInfo32 *in_ext = (const VkExportFenceCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkFramebufferAttachmentImageInfo_win32_to_host(const VkFramebufferAttachmentImageInfo32 *in, VkFramebufferAttachmentImageInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->usage = in->usage; - out->width = in->width; - out->height = in->height; - out->layerCount = in->layerCount; - out->viewFormatCount = in->viewFormatCount; - out->pViewFormats = (const VkFormat *)UlongToPtr(in->pViewFormats); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkFramebufferAttachmentImageInfo *convert_VkFramebufferAttachmentImageInfo_array_win32_to_host(struct conversion_context *ctx, const VkFramebufferAttachmentImageInfo32 *in, uint32_t count) -{ - VkFramebufferAttachmentImageInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkFramebufferAttachmentImageInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkFramebufferCreateInfo_win32_to_host(struct conversion_context *ctx, const VkFramebufferCreateInfo32 *in, VkFramebufferCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->renderPass = in->renderPass; - out->attachmentCount = in->attachmentCount; - out->pAttachments = (const VkImageView *)UlongToPtr(in->pAttachments); - out->width = in->width; - out->height = in->height; - out->layers = in->layers; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: - { - VkFramebufferAttachmentsCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFramebufferAttachmentsCreateInfo32 *in_ext = (const VkFramebufferAttachmentsCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->attachmentImageInfoCount = in_ext->attachmentImageInfoCount; - out_ext->pAttachmentImageInfos = convert_VkFramebufferAttachmentImageInfo_array_win32_to_host(ctx, (const VkFramebufferAttachmentImageInfo32 *)UlongToPtr(in_ext->pAttachmentImageInfos), in_ext->attachmentImageInfoCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkPipelineShaderStageCreateInfo *convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo *in, uint32_t count) -{ - VkPipelineShaderStageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineShaderStageCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkPipelineShaderStageCreateInfo *convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo32 *in, uint32_t count) -{ - VkPipelineShaderStageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineShaderStageCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineVertexInputStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineVertexInputStateCreateInfo32 *in, VkPipelineVertexInputStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->vertexBindingDescriptionCount = in->vertexBindingDescriptionCount; - out->pVertexBindingDescriptions = (const VkVertexInputBindingDescription *)UlongToPtr(in->pVertexBindingDescriptions); - out->vertexAttributeDescriptionCount = in->vertexAttributeDescriptionCount; - out->pVertexAttributeDescriptions = (const VkVertexInputAttributeDescription *)UlongToPtr(in->pVertexAttributeDescriptions); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: - { - VkPipelineVertexInputDivisorStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineVertexInputDivisorStateCreateInfoEXT32 *in_ext = (const VkPipelineVertexInputDivisorStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->vertexBindingDivisorCount = in_ext->vertexBindingDivisorCount; - out_ext->pVertexBindingDivisors = (const VkVertexInputBindingDivisorDescriptionEXT *)UlongToPtr(in_ext->pVertexBindingDivisors); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineVertexInputStateCreateInfo *convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineVertexInputStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineVertexInputStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineVertexInputStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineTessellationStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineTessellationStateCreateInfo32 *in, VkPipelineTessellationStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->patchControlPoints = in->patchControlPoints; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: - { - VkPipelineTessellationDomainOriginStateCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineTessellationDomainOriginStateCreateInfo32 *in_ext = (const VkPipelineTessellationDomainOriginStateCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->domainOrigin = in_ext->domainOrigin; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineTessellationStateCreateInfo *convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineTessellationStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineTessellationStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineTessellationStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkGraphicsShaderGroupCreateInfoNV_win64_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV *in, VkGraphicsShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->pVertexInputState = in->pVertexInputState; - out->pTessellationState = in->pTessellationState; -} -#endif /* _WIN64 */ - -static inline void convert_VkGraphicsShaderGroupCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV32 *in, VkGraphicsShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->pVertexInputState = convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineVertexInputStateCreateInfo32 *)UlongToPtr(in->pVertexInputState), 1); - out->pTessellationState = convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineTessellationStateCreateInfo32 *)UlongToPtr(in->pTessellationState), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkGraphicsShaderGroupCreateInfoNV *convert_VkGraphicsShaderGroupCreateInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV *in, uint32_t count) -{ - VkGraphicsShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsShaderGroupCreateInfoNV_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkGraphicsShaderGroupCreateInfoNV *convert_VkGraphicsShaderGroupCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV32 *in, uint32_t count) -{ - VkGraphicsShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsShaderGroupCreateInfoNV_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineInputAssemblyStateCreateInfo_win32_to_host(const VkPipelineInputAssemblyStateCreateInfo32 *in, VkPipelineInputAssemblyStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->topology = in->topology; - out->primitiveRestartEnable = in->primitiveRestartEnable; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineInputAssemblyStateCreateInfo *convert_VkPipelineInputAssemblyStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineInputAssemblyStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineInputAssemblyStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineInputAssemblyStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineViewportStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineViewportStateCreateInfo32 *in, VkPipelineViewportStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->viewportCount = in->viewportCount; - out->pViewports = (const VkViewport *)UlongToPtr(in->pViewports); - out->scissorCount = in->scissorCount; - out->pScissors = (const VkRect2D *)UlongToPtr(in->pScissors); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: - { - VkPipelineViewportWScalingStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportWScalingStateCreateInfoNV32 *in_ext = (const VkPipelineViewportWScalingStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->viewportWScalingEnable = in_ext->viewportWScalingEnable; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pViewportWScalings = (const VkViewportWScalingNV *)UlongToPtr(in_ext->pViewportWScalings); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: - { - VkPipelineViewportSwizzleStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportSwizzleStateCreateInfoNV32 *in_ext = (const VkPipelineViewportSwizzleStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pViewportSwizzles = (const VkViewportSwizzleNV *)UlongToPtr(in_ext->pViewportSwizzles); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: - { - VkPipelineViewportExclusiveScissorStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportExclusiveScissorStateCreateInfoNV32 *in_ext = (const VkPipelineViewportExclusiveScissorStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissorCount = in_ext->exclusiveScissorCount; - out_ext->pExclusiveScissors = (const VkRect2D *)UlongToPtr(in_ext->pExclusiveScissors); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: - { - VkPipelineViewportShadingRateImageStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportShadingRateImageStateCreateInfoNV32 *in_ext = (const VkPipelineViewportShadingRateImageStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImageEnable = in_ext->shadingRateImageEnable; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pShadingRatePalettes = convert_VkShadingRatePaletteNV_array_win32_to_host(ctx, (const VkShadingRatePaletteNV32 *)UlongToPtr(in_ext->pShadingRatePalettes), in_ext->viewportCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: - { - VkPipelineViewportCoarseSampleOrderStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 *in_ext = (const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->sampleOrderType = in_ext->sampleOrderType; - out_ext->customSampleOrderCount = in_ext->customSampleOrderCount; - out_ext->pCustomSampleOrders = convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(ctx, (const VkCoarseSampleOrderCustomNV32 *)UlongToPtr(in_ext->pCustomSampleOrders), in_ext->customSampleOrderCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT: - { - VkPipelineViewportDepthClipControlCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportDepthClipControlCreateInfoEXT32 *in_ext = (const VkPipelineViewportDepthClipControlCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->negativeOneToOne = in_ext->negativeOneToOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineViewportStateCreateInfo *convert_VkPipelineViewportStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineViewportStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineViewportStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineViewportStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineRasterizationStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineRasterizationStateCreateInfo32 *in, VkPipelineRasterizationStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->depthClampEnable = in->depthClampEnable; - out->rasterizerDiscardEnable = in->rasterizerDiscardEnable; - out->polygonMode = in->polygonMode; - out->cullMode = in->cullMode; - out->frontFace = in->frontFace; - out->depthBiasEnable = in->depthBiasEnable; - out->depthBiasConstantFactor = in->depthBiasConstantFactor; - out->depthBiasClamp = in->depthBiasClamp; - out->depthBiasSlopeFactor = in->depthBiasSlopeFactor; - out->lineWidth = in->lineWidth; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: - { - VkPipelineRasterizationStateRasterizationOrderAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationStateRasterizationOrderAMD32 *in_ext = (const VkPipelineRasterizationStateRasterizationOrderAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD; - out_ext->pNext = NULL; - out_ext->rasterizationOrder = in_ext->rasterizationOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationConservativeStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationConservativeStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationConservativeStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->conservativeRasterizationMode = in_ext->conservativeRasterizationMode; - out_ext->extraPrimitiveOverestimationSize = in_ext->extraPrimitiveOverestimationSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: - { - VkPipelineRasterizationStateStreamCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationStateStreamCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationStateStreamCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->rasterizationStream = in_ext->rasterizationStream; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationDepthClipStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationDepthClipStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationDepthClipStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationLineStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationLineStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationLineStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->lineRasterizationMode = in_ext->lineRasterizationMode; - out_ext->stippledLineEnable = in_ext->stippledLineEnable; - out_ext->lineStippleFactor = in_ext->lineStippleFactor; - out_ext->lineStipplePattern = in_ext->lineStipplePattern; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexMode = in_ext->provokingVertexMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT: - { - VkDepthBiasRepresentationInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDepthBiasRepresentationInfoEXT32 *in_ext = (const VkDepthBiasRepresentationInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasRepresentation = in_ext->depthBiasRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineRasterizationStateCreateInfo *convert_VkPipelineRasterizationStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineRasterizationStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineRasterizationStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineRasterizationStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineMultisampleStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineMultisampleStateCreateInfo32 *in, VkPipelineMultisampleStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->rasterizationSamples = in->rasterizationSamples; - out->sampleShadingEnable = in->sampleShadingEnable; - out->minSampleShading = in->minSampleShading; - out->pSampleMask = (const VkSampleMask *)UlongToPtr(in->pSampleMask); - out->alphaToCoverageEnable = in->alphaToCoverageEnable; - out->alphaToOneEnable = in->alphaToOneEnable; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageToColorStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageToColorStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageToColorStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageToColorEnable = in_ext->coverageToColorEnable; - out_ext->coverageToColorLocation = in_ext->coverageToColorLocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: - { - VkPipelineSampleLocationsStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineSampleLocationsStateCreateInfoEXT32 *in_ext = (const VkPipelineSampleLocationsStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsEnable = in_ext->sampleLocationsEnable; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in_ext->sampleLocationsInfo, &out_ext->sampleLocationsInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageModulationStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageModulationStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageModulationStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageModulationMode = in_ext->coverageModulationMode; - out_ext->coverageModulationTableEnable = in_ext->coverageModulationTableEnable; - out_ext->coverageModulationTableCount = in_ext->coverageModulationTableCount; - out_ext->pCoverageModulationTable = (const float *)UlongToPtr(in_ext->pCoverageModulationTable); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageReductionStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageReductionStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageReductionStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineMultisampleStateCreateInfo *convert_VkPipelineMultisampleStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineMultisampleStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineMultisampleStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineMultisampleStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineDepthStencilStateCreateInfo_win32_to_host(const VkPipelineDepthStencilStateCreateInfo32 *in, VkPipelineDepthStencilStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->depthTestEnable = in->depthTestEnable; - out->depthWriteEnable = in->depthWriteEnable; - out->depthCompareOp = in->depthCompareOp; - out->depthBoundsTestEnable = in->depthBoundsTestEnable; - out->stencilTestEnable = in->stencilTestEnable; - out->front = in->front; - out->back = in->back; - out->minDepthBounds = in->minDepthBounds; - out->maxDepthBounds = in->maxDepthBounds; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineDepthStencilStateCreateInfo *convert_VkPipelineDepthStencilStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineDepthStencilStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineDepthStencilStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineDepthStencilStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineColorBlendStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineColorBlendStateCreateInfo32 *in, VkPipelineColorBlendStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->logicOpEnable = in->logicOpEnable; - out->logicOp = in->logicOp; - out->attachmentCount = in->attachmentCount; - out->pAttachments = (const VkPipelineColorBlendAttachmentState *)UlongToPtr(in->pAttachments); - memcpy(out->blendConstants, in->blendConstants, 4 * sizeof(float)); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: - { - VkPipelineColorBlendAdvancedStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineColorBlendAdvancedStateCreateInfoEXT32 *in_ext = (const VkPipelineColorBlendAdvancedStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->srcPremultiplied = in_ext->srcPremultiplied; - out_ext->dstPremultiplied = in_ext->dstPremultiplied; - out_ext->blendOverlap = in_ext->blendOverlap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: - { - VkPipelineColorWriteCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineColorWriteCreateInfoEXT32 *in_ext = (const VkPipelineColorWriteCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->attachmentCount = in_ext->attachmentCount; - out_ext->pColorWriteEnables = (const VkBool32 *)UlongToPtr(in_ext->pColorWriteEnables); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineColorBlendStateCreateInfo *convert_VkPipelineColorBlendStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineColorBlendStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineColorBlendStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineColorBlendStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineDynamicStateCreateInfo_win32_to_host(const VkPipelineDynamicStateCreateInfo32 *in, VkPipelineDynamicStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->dynamicStateCount = in->dynamicStateCount; - out->pDynamicStates = (const VkDynamicState *)UlongToPtr(in->pDynamicStates); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineDynamicStateCreateInfo *convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineDynamicStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineDynamicStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineDynamicStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkGraphicsPipelineCreateInfo_win64_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo *in, VkGraphicsPipelineCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->pVertexInputState = in->pVertexInputState; - out->pInputAssemblyState = in->pInputAssemblyState; - out->pTessellationState = in->pTessellationState; - out->pViewportState = in->pViewportState; - out->pRasterizationState = in->pRasterizationState; - out->pMultisampleState = in->pMultisampleState; - out->pDepthStencilState = in->pDepthStencilState; - out->pColorBlendState = in->pColorBlendState; - out->pDynamicState = in->pDynamicState; - out->layout = in->layout; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR: - { - VkPipelineCreateFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfoKHR *in_ext = (const VkPipelineCreateFlags2CreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: - { - VkGraphicsPipelineShaderGroupsCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineShaderGroupsCreateInfoNV *in_ext = (const VkGraphicsPipelineShaderGroupsCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->groupCount = in_ext->groupCount; - out_ext->pGroups = convert_VkGraphicsShaderGroupCreateInfoNV_array_win64_to_host(ctx, in_ext->pGroups, in_ext->groupCount); - out_ext->pipelineCount = in_ext->pipelineCount; - out_ext->pPipelines = in_ext->pPipelines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: - { - VkPipelineDiscardRectangleStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineDiscardRectangleStateCreateInfoEXT *in_ext = (const VkPipelineDiscardRectangleStateCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->discardRectangleMode = in_ext->discardRectangleMode; - out_ext->discardRectangleCount = in_ext->discardRectangleCount; - out_ext->pDiscardRectangles = in_ext->pDiscardRectangles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: - { - VkPipelineRepresentativeFragmentTestStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRepresentativeFragmentTestStateCreateInfoNV *in_ext = (const VkPipelineRepresentativeFragmentTestStateCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTestEnable = in_ext->representativeFragmentTestEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = in_ext->pPipelineCreationFeedback; - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = in_ext->pPipelineStageCreationFeedbacks; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD *in_ext = (const VkPipelineCompilerControlCreateInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: - { - VkPipelineLibraryCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLibraryCreateInfoKHR *in_ext = (const VkPipelineLibraryCreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->libraryCount = in_ext->libraryCount; - out_ext->pLibraries = in_ext->pLibraries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: - { - VkPipelineFragmentShadingRateStateCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateStateCreateInfoKHR *in_ext = (const VkPipelineFragmentShadingRateStateCreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->fragmentSize = in_ext->fragmentSize; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: - { - VkPipelineFragmentShadingRateEnumStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateEnumStateCreateInfoNV *in_ext = (const VkPipelineFragmentShadingRateEnumStateCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateType = in_ext->shadingRateType; - out_ext->shadingRate = in_ext->shadingRate; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: - { - VkPipelineRenderingCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRenderingCreateInfo *in_ext = (const VkPipelineRenderingCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = in_ext->pColorAttachmentFormats; - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD *in_ext = (const VkAttachmentSampleCountInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = in_ext->pColorAttachmentSamples; - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: - { - VkMultiviewPerViewAttributesInfoNVX *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewAttributesInfoNVX *in_ext = (const VkMultiviewPerViewAttributesInfoNVX *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; - out_ext->pNext = NULL; - out_ext->perViewAttributes = in_ext->perViewAttributes; - out_ext->perViewAttributesPositionXOnly = in_ext->perViewAttributesPositionXOnly; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: - { - VkGraphicsPipelineLibraryCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineLibraryCreateInfoEXT *in_ext = (const VkGraphicsPipelineLibraryCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT *in_ext = (const VkPipelineRobustnessCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkGraphicsPipelineCreateInfo_win32_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo32 *in, VkGraphicsPipelineCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->pVertexInputState = convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineVertexInputStateCreateInfo32 *)UlongToPtr(in->pVertexInputState), 1); - out->pInputAssemblyState = convert_VkPipelineInputAssemblyStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineInputAssemblyStateCreateInfo32 *)UlongToPtr(in->pInputAssemblyState), 1); - out->pTessellationState = convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineTessellationStateCreateInfo32 *)UlongToPtr(in->pTessellationState), 1); - out->pViewportState = convert_VkPipelineViewportStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineViewportStateCreateInfo32 *)UlongToPtr(in->pViewportState), 1); - out->pRasterizationState = convert_VkPipelineRasterizationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineRasterizationStateCreateInfo32 *)UlongToPtr(in->pRasterizationState), 1); - out->pMultisampleState = convert_VkPipelineMultisampleStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineMultisampleStateCreateInfo32 *)UlongToPtr(in->pMultisampleState), 1); - out->pDepthStencilState = convert_VkPipelineDepthStencilStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDepthStencilStateCreateInfo32 *)UlongToPtr(in->pDepthStencilState), 1); - out->pColorBlendState = convert_VkPipelineColorBlendStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineColorBlendStateCreateInfo32 *)UlongToPtr(in->pColorBlendState), 1); - out->pDynamicState = convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDynamicStateCreateInfo32 *)UlongToPtr(in->pDynamicState), 1); - out->layout = in->layout; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR: - { - VkPipelineCreateFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfoKHR32 *in_ext = (const VkPipelineCreateFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: - { - VkGraphicsPipelineShaderGroupsCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineShaderGroupsCreateInfoNV32 *in_ext = (const VkGraphicsPipelineShaderGroupsCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->groupCount = in_ext->groupCount; - out_ext->pGroups = convert_VkGraphicsShaderGroupCreateInfoNV_array_win32_to_host(ctx, (const VkGraphicsShaderGroupCreateInfoNV32 *)UlongToPtr(in_ext->pGroups), in_ext->groupCount); - out_ext->pipelineCount = in_ext->pipelineCount; - out_ext->pPipelines = (const VkPipeline *)UlongToPtr(in_ext->pPipelines); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: - { - VkPipelineDiscardRectangleStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineDiscardRectangleStateCreateInfoEXT32 *in_ext = (const VkPipelineDiscardRectangleStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->discardRectangleMode = in_ext->discardRectangleMode; - out_ext->discardRectangleCount = in_ext->discardRectangleCount; - out_ext->pDiscardRectangles = (const VkRect2D *)UlongToPtr(in_ext->pDiscardRectangles); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: - { - VkPipelineRepresentativeFragmentTestStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 *in_ext = (const VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTestEnable = in_ext->representativeFragmentTestEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD32 *in_ext = (const VkPipelineCompilerControlCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: - { - VkPipelineLibraryCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLibraryCreateInfoKHR32 *in_ext = (const VkPipelineLibraryCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->libraryCount = in_ext->libraryCount; - out_ext->pLibraries = (const VkPipeline *)UlongToPtr(in_ext->pLibraries); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: - { - VkPipelineFragmentShadingRateStateCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateStateCreateInfoKHR32 *in_ext = (const VkPipelineFragmentShadingRateStateCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->fragmentSize = in_ext->fragmentSize; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: - { - VkPipelineFragmentShadingRateEnumStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 *in_ext = (const VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateType = in_ext->shadingRateType; - out_ext->shadingRate = in_ext->shadingRate; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: - { - VkPipelineRenderingCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRenderingCreateInfo32 *in_ext = (const VkPipelineRenderingCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = (const VkFormat *)UlongToPtr(in_ext->pColorAttachmentFormats); - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD32 *in_ext = (const VkAttachmentSampleCountInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = (const VkSampleCountFlagBits *)UlongToPtr(in_ext->pColorAttachmentSamples); - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: - { - VkMultiviewPerViewAttributesInfoNVX *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewAttributesInfoNVX32 *in_ext = (const VkMultiviewPerViewAttributesInfoNVX32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX; - out_ext->pNext = NULL; - out_ext->perViewAttributes = in_ext->perViewAttributes; - out_ext->perViewAttributesPositionXOnly = in_ext->perViewAttributesPositionXOnly; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: - { - VkGraphicsPipelineLibraryCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineLibraryCreateInfoEXT32 *in_ext = (const VkGraphicsPipelineLibraryCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT32 *in_ext = (const VkPipelineRobustnessCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkGraphicsPipelineCreateInfo_host_to_win32(const VkGraphicsPipelineCreateInfo *in, const VkGraphicsPipelineCreateInfo32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkGraphicsPipelineCreateInfo *convert_VkGraphicsPipelineCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo *in, uint32_t count) -{ - VkGraphicsPipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkGraphicsPipelineCreateInfo *convert_VkGraphicsPipelineCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo32 *in, uint32_t count) -{ - VkGraphicsPipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkGraphicsPipelineCreateInfo_array_host_to_win32(const VkGraphicsPipelineCreateInfo *in, const VkGraphicsPipelineCreateInfo32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageCreateInfo_win32_to_host(struct conversion_context *ctx, const VkImageCreateInfo32 *in, VkImageCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->imageType = in->imageType; - out->format = in->format; - out->extent = in->extent; - out->mipLevels = in->mipLevels; - out->arrayLayers = in->arrayLayers; - out->samples = in->samples; - out->tiling = in->tiling; - out->usage = in->usage; - out->sharingMode = in->sharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = (const uint32_t *)UlongToPtr(in->pQueueFamilyIndices); - out->initialLayout = in->initialLayout; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: - { - VkDedicatedAllocationImageCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationImageCreateInfoNV32 *in_ext = (const VkDedicatedAllocationImageCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocation = in_ext->dedicatedAllocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: - { - VkExternalMemoryImageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryImageCreateInfo32 *in_ext = (const VkExternalMemoryImageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: - { - VkImageSwapchainCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageSwapchainCreateInfoKHR32 *in_ext = (const VkImageSwapchainCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = (const VkFormat *)UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: - { - VkImageStencilUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageStencilUsageCreateInfo32 *in_ext = (const VkImageStencilUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->stencilUsage = in_ext->stencilUsage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = (VkImageCompressionFixedRateFlagsEXT *)UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: - { - VkOpticalFlowImageFormatInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowImageFormatInfoNV32 *in_ext = (const VkOpticalFlowImageFormatInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageViewCreateInfo_win32_to_host(struct conversion_context *ctx, const VkImageViewCreateInfo32 *in, VkImageViewCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->image = in->image; - out->viewType = in->viewType; - out->format = in->format; - out->components = in->components; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: - { - VkImageViewUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewUsageCreateInfo32 *in_ext = (const VkImageViewUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT: - { - VkImageViewSlicedCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewSlicedCreateInfoEXT32 *in_ext = (const VkImageViewSlicedCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sliceOffset = in_ext->sliceOffset; - out_ext->sliceCount = in_ext->sliceCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: - { - VkSamplerYcbcrConversionInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionInfo32 *in_ext = (const VkSamplerYcbcrConversionInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO; - out_ext->pNext = NULL; - out_ext->conversion = in_ext->conversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: - { - VkImageViewASTCDecodeModeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewASTCDecodeModeEXT32 *in_ext = (const VkImageViewASTCDecodeModeEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT; - out_ext->pNext = NULL; - out_ext->decodeMode = in_ext->decodeMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT: - { - VkImageViewMinLodCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewMinLodCreateInfoEXT32 *in_ext = (const VkImageViewMinLodCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM: - { - VkImageViewSampleWeightCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewSampleWeightCreateInfoQCOM32 *in_ext = (const VkImageViewSampleWeightCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->filterCenter = in_ext->filterCenter; - out_ext->filterSize = in_ext->filterSize; - out_ext->numPhases = in_ext->numPhases; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkIndirectCommandsLayoutTokenNV_win32_to_host(const VkIndirectCommandsLayoutTokenNV32 *in, VkIndirectCommandsLayoutTokenNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->tokenType = in->tokenType; - out->stream = in->stream; - out->offset = in->offset; - out->vertexBindingUnit = in->vertexBindingUnit; - out->vertexDynamicStride = in->vertexDynamicStride; - out->pushconstantPipelineLayout = in->pushconstantPipelineLayout; - out->pushconstantShaderStageFlags = in->pushconstantShaderStageFlags; - out->pushconstantOffset = in->pushconstantOffset; - out->pushconstantSize = in->pushconstantSize; - out->indirectStateFlags = in->indirectStateFlags; - out->indexTypeCount = in->indexTypeCount; - out->pIndexTypes = (const VkIndexType *)UlongToPtr(in->pIndexTypes); - out->pIndexTypeValues = (const uint32_t *)UlongToPtr(in->pIndexTypeValues); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectCommandsLayoutTokenNV *convert_VkIndirectCommandsLayoutTokenNV_array_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutTokenNV32 *in, uint32_t count) -{ - VkIndirectCommandsLayoutTokenNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectCommandsLayoutTokenNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectCommandsLayoutCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutCreateInfoNV32 *in, VkIndirectCommandsLayoutCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->tokenCount = in->tokenCount; - out->pTokens = convert_VkIndirectCommandsLayoutTokenNV_array_win32_to_host(ctx, (const VkIndirectCommandsLayoutTokenNV32 *)UlongToPtr(in->pTokens), in->tokenCount); - out->streamCount = in->streamCount; - out->pStreamStrides = (const uint32_t *)UlongToPtr(in->pStreamStrides); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLayerSettingEXT_win32_to_host(const VkLayerSettingEXT32 *in, VkLayerSettingEXT *out) -{ - if (!in) return; - - out->pLayerName = (const char *)UlongToPtr(in->pLayerName); - out->pSettingName = (const char *)UlongToPtr(in->pSettingName); - out->type = in->type; - out->valueCount = in->valueCount; - out->pValues = (const void *)UlongToPtr(in->pValues); -} - -static inline const VkLayerSettingEXT *convert_VkLayerSettingEXT_array_win32_to_host(struct conversion_context *ctx, const VkLayerSettingEXT32 *in, uint32_t count) -{ - VkLayerSettingEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkLayerSettingEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkApplicationInfo_win32_to_host(const VkApplicationInfo32 *in, VkApplicationInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pApplicationName = (const char *)UlongToPtr(in->pApplicationName); - out->applicationVersion = in->applicationVersion; - out->pEngineName = (const char *)UlongToPtr(in->pEngineName); - out->engineVersion = in->engineVersion; - out->apiVersion = in->apiVersion; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkApplicationInfo *convert_VkApplicationInfo_array_win32_to_host(struct conversion_context *ctx, const VkApplicationInfo32 *in, uint32_t count) -{ - VkApplicationInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkApplicationInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkInstanceCreateInfo_win64_to_host(struct conversion_context *ctx, const VkInstanceCreateInfo *in, VkInstanceCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pApplicationInfo = in->pApplicationInfo; - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = in->ppEnabledLayerNames; - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = in->ppEnabledExtensionNames; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: - { - VkDebugReportCallbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugReportCallbackCreateInfoEXT *in_ext = (const VkDebugReportCallbackCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->pfnCallback = in_ext->pfnCallback; - out_ext->pUserData = in_ext->pUserData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: - { - VkValidationFlagsEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFlagsEXT *in_ext = (const VkValidationFlagsEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT; - out_ext->pNext = NULL; - out_ext->disabledValidationCheckCount = in_ext->disabledValidationCheckCount; - out_ext->pDisabledValidationChecks = in_ext->pDisabledValidationChecks; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT *in_ext = (const VkValidationFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = in_ext->pEnabledValidationFeatures; - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = in_ext->pDisabledValidationFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT: - { - VkLayerSettingsCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLayerSettingsCreateInfoEXT *in_ext = (const VkLayerSettingsCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->settingCount = in_ext->settingCount; - out_ext->pSettings = in_ext->pSettings; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: - { - VkDebugUtilsMessengerCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsMessengerCreateInfoEXT *in_ext = (const VkDebugUtilsMessengerCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->messageSeverity = in_ext->messageSeverity; - out_ext->messageType = in_ext->messageType; - out_ext->pfnUserCallback = in_ext->pfnUserCallback; - out_ext->pUserData = in_ext->pUserData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkInstanceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkInstanceCreateInfo32 *in, VkInstanceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pApplicationInfo = convert_VkApplicationInfo_array_win32_to_host(ctx, (const VkApplicationInfo32 *)UlongToPtr(in->pApplicationInfo), 1); - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledLayerNames), in->enabledLayerCount); - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledExtensionNames), in->enabledExtensionCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: - { - VkDebugReportCallbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugReportCallbackCreateInfoEXT32 *in_ext = (const VkDebugReportCallbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->pfnCallback = in_ext->pfnCallback; - out_ext->pUserData = (void *)UlongToPtr(in_ext->pUserData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: - { - VkValidationFlagsEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFlagsEXT32 *in_ext = (const VkValidationFlagsEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT; - out_ext->pNext = NULL; - out_ext->disabledValidationCheckCount = in_ext->disabledValidationCheckCount; - out_ext->pDisabledValidationChecks = (const VkValidationCheckEXT *)UlongToPtr(in_ext->pDisabledValidationChecks); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT32 *in_ext = (const VkValidationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = (const VkValidationFeatureEnableEXT *)UlongToPtr(in_ext->pEnabledValidationFeatures); - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = (const VkValidationFeatureDisableEXT *)UlongToPtr(in_ext->pDisabledValidationFeatures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT: - { - VkLayerSettingsCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLayerSettingsCreateInfoEXT32 *in_ext = (const VkLayerSettingsCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->settingCount = in_ext->settingCount; - out_ext->pSettings = convert_VkLayerSettingEXT_array_win32_to_host(ctx, (const VkLayerSettingEXT32 *)UlongToPtr(in_ext->pSettings), in_ext->settingCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: - { - VkDebugUtilsMessengerCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsMessengerCreateInfoEXT32 *in_ext = (const VkDebugUtilsMessengerCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->messageSeverity = in_ext->messageSeverity; - out_ext->messageType = in_ext->messageType; - out_ext->pfnUserCallback = in_ext->pfnUserCallback; - out_ext->pUserData = (void *)UlongToPtr(in_ext->pUserData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMicromapCreateInfoEXT_win32_to_host(const VkMicromapCreateInfoEXT32 *in, VkMicromapCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->createFlags = in->createFlags; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - out->type = in->type; - out->deviceAddress = in->deviceAddress; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowSessionCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkOpticalFlowSessionCreateInfoNV32 *in, VkOpticalFlowSessionCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->width = in->width; - out->height = in->height; - out->imageFormat = in->imageFormat; - out->flowVectorFormat = in->flowVectorFormat; - out->costFormat = in->costFormat; - out->outputGridSize = in->outputGridSize; - out->hintGridSize = in->hintGridSize; - out->performanceLevel = in->performanceLevel; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV: - { - VkOpticalFlowSessionCreatePrivateDataInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowSessionCreatePrivateDataInfoNV32 *in_ext = (const VkOpticalFlowSessionCreatePrivateDataInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV; - out_ext->pNext = NULL; - out_ext->id = in_ext->id; - out_ext->size = in_ext->size; - out_ext->pPrivateData = (const void *)UlongToPtr(in_ext->pPrivateData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPipelineCacheCreateInfo_win32_to_host(const VkPipelineCacheCreateInfo32 *in, VkPipelineCacheCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->initialDataSize = in->initialDataSize; - out->pInitialData = (const void *)UlongToPtr(in->pInitialData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineLayoutCreateInfo_win32_to_host(const VkPipelineLayoutCreateInfo32 *in, VkPipelineLayoutCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->setLayoutCount = in->setLayoutCount; - out->pSetLayouts = (const VkDescriptorSetLayout *)UlongToPtr(in->pSetLayouts); - out->pushConstantRangeCount = in->pushConstantRangeCount; - out->pPushConstantRanges = (const VkPushConstantRange *)UlongToPtr(in->pPushConstantRanges); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPrivateDataSlotCreateInfo_win32_to_host(const VkPrivateDataSlotCreateInfo32 *in, VkPrivateDataSlotCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkQueryPoolCreateInfo_win32_to_host(struct conversion_context *ctx, const VkQueryPoolCreateInfo32 *in, VkQueryPoolCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queryType = in->queryType; - out->queryCount = in->queryCount; - out->pipelineStatistics = in->pipelineStatistics; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: - { - VkQueryPoolPerformanceCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryPoolPerformanceCreateInfoKHR32 *in_ext = (const VkQueryPoolPerformanceCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->queueFamilyIndex = in_ext->queueFamilyIndex; - out_ext->counterIndexCount = in_ext->counterIndexCount; - out_ext->pCounterIndices = (const uint32_t *)UlongToPtr(in_ext->pCounterIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: - { - VkQueryPoolPerformanceQueryCreateInfoINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryPoolPerformanceQueryCreateInfoINTEL32 *in_ext = (const VkQueryPoolPerformanceQueryCreateInfoINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL; - out_ext->pNext = NULL; - out_ext->performanceCountersSampling = in_ext->performanceCountersSampling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingShaderGroupCreateInfoKHR_win32_to_host(const VkRayTracingShaderGroupCreateInfoKHR32 *in, VkRayTracingShaderGroupCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->generalShader = in->generalShader; - out->closestHitShader = in->closestHitShader; - out->anyHitShader = in->anyHitShader; - out->intersectionShader = in->intersectionShader; - out->pShaderGroupCaptureReplayHandle = (const void *)UlongToPtr(in->pShaderGroupCaptureReplayHandle); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingShaderGroupCreateInfoKHR *convert_VkRayTracingShaderGroupCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingShaderGroupCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingShaderGroupCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingShaderGroupCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineLibraryCreateInfoKHR_win32_to_host(const VkPipelineLibraryCreateInfoKHR32 *in, VkPipelineLibraryCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->libraryCount = in->libraryCount; - out->pLibraries = (const VkPipeline *)UlongToPtr(in->pLibraries); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineLibraryCreateInfoKHR *convert_VkPipelineLibraryCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineLibraryCreateInfoKHR32 *in, uint32_t count) -{ - VkPipelineLibraryCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineLibraryCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineInterfaceCreateInfoKHR_win32_to_host(const VkRayTracingPipelineInterfaceCreateInfoKHR32 *in, VkRayTracingPipelineInterfaceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->maxPipelineRayPayloadSize = in->maxPipelineRayPayloadSize; - out->maxPipelineRayHitAttributeSize = in->maxPipelineRayHitAttributeSize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingPipelineInterfaceCreateInfoKHR *convert_VkRayTracingPipelineInterfaceCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineInterfaceCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingPipelineInterfaceCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineInterfaceCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkRayTracingPipelineCreateInfoKHR_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR *in, VkRayTracingPipelineCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = in->pGroups; - out->maxPipelineRayRecursionDepth = in->maxPipelineRayRecursionDepth; - out->pLibraryInfo = in->pLibraryInfo; - out->pLibraryInterface = in->pLibraryInterface; - out->pDynamicState = in->pDynamicState; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR32 *in, VkRayTracingPipelineCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = convert_VkRayTracingShaderGroupCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingShaderGroupCreateInfoKHR32 *)UlongToPtr(in->pGroups), in->groupCount); - out->maxPipelineRayRecursionDepth = in->maxPipelineRayRecursionDepth; - out->pLibraryInfo = convert_VkPipelineLibraryCreateInfoKHR_array_win32_to_host(ctx, (const VkPipelineLibraryCreateInfoKHR32 *)UlongToPtr(in->pLibraryInfo), 1); - out->pLibraryInterface = convert_VkRayTracingPipelineInterfaceCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingPipelineInterfaceCreateInfoKHR32 *)UlongToPtr(in->pLibraryInterface), 1); - out->pDynamicState = convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDynamicStateCreateInfo32 *)UlongToPtr(in->pDynamicState), 1); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR: - { - VkPipelineCreateFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfoKHR32 *in_ext = (const VkPipelineCreateFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT: - { - VkPipelineRobustnessCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfoEXT32 *in_ext = (const VkPipelineRobustnessCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_host_to_win32(const VkRayTracingPipelineCreateInfoKHR *in, const VkRayTracingPipelineCreateInfoKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkRayTracingPipelineCreateInfoKHR *convert_VkRayTracingPipelineCreateInfoKHR_array_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkRayTracingPipelineCreateInfoKHR *convert_VkRayTracingPipelineCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_array_host_to_win32(const VkRayTracingPipelineCreateInfoKHR *in, const VkRayTracingPipelineCreateInfoKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkRayTracingShaderGroupCreateInfoNV_win32_to_host(const VkRayTracingShaderGroupCreateInfoNV32 *in, VkRayTracingShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->generalShader = in->generalShader; - out->closestHitShader = in->closestHitShader; - out->anyHitShader = in->anyHitShader; - out->intersectionShader = in->intersectionShader; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingShaderGroupCreateInfoNV *convert_VkRayTracingShaderGroupCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingShaderGroupCreateInfoNV32 *in, uint32_t count) -{ - VkRayTracingShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingShaderGroupCreateInfoNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkRayTracingPipelineCreateInfoNV_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV *in, VkRayTracingPipelineCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = in->pGroups; - out->maxRecursionDepth = in->maxRecursionDepth; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkRayTracingPipelineCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV32 *in, VkRayTracingPipelineCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = convert_VkRayTracingShaderGroupCreateInfoNV_array_win32_to_host(ctx, (const VkRayTracingShaderGroupCreateInfoNV32 *)UlongToPtr(in->pGroups), in->groupCount); - out->maxRecursionDepth = in->maxRecursionDepth; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR: - { - VkPipelineCreateFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfoKHR32 *in_ext = (const VkPipelineCreateFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingPipelineCreateInfoNV_host_to_win32(const VkRayTracingPipelineCreateInfoNV *in, const VkRayTracingPipelineCreateInfoNV32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkRayTracingPipelineCreateInfoNV *convert_VkRayTracingPipelineCreateInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkRayTracingPipelineCreateInfoNV *convert_VkRayTracingPipelineCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV32 *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineCreateInfoNV_array_host_to_win32(const VkRayTracingPipelineCreateInfoNV *in, const VkRayTracingPipelineCreateInfoNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkSubpassDescription_win32_to_host(const VkSubpassDescription32 *in, VkSubpassDescription *out) -{ - if (!in) return; - - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->inputAttachmentCount = in->inputAttachmentCount; - out->pInputAttachments = (const VkAttachmentReference *)UlongToPtr(in->pInputAttachments); - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = (const VkAttachmentReference *)UlongToPtr(in->pColorAttachments); - out->pResolveAttachments = (const VkAttachmentReference *)UlongToPtr(in->pResolveAttachments); - out->pDepthStencilAttachment = (const VkAttachmentReference *)UlongToPtr(in->pDepthStencilAttachment); - out->preserveAttachmentCount = in->preserveAttachmentCount; - out->pPreserveAttachments = (const uint32_t *)UlongToPtr(in->pPreserveAttachments); -} - -static inline const VkSubpassDescription *convert_VkSubpassDescription_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription32 *in, uint32_t count) -{ - VkSubpassDescription *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDescription_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassCreateInfo_win32_to_host(struct conversion_context *ctx, const VkRenderPassCreateInfo32 *in, VkRenderPassCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->attachmentCount = in->attachmentCount; - out->pAttachments = (const VkAttachmentDescription *)UlongToPtr(in->pAttachments); - out->subpassCount = in->subpassCount; - out->pSubpasses = convert_VkSubpassDescription_array_win32_to_host(ctx, (const VkSubpassDescription32 *)UlongToPtr(in->pSubpasses), in->subpassCount); - out->dependencyCount = in->dependencyCount; - out->pDependencies = (const VkSubpassDependency *)UlongToPtr(in->pDependencies); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: - { - VkRenderPassMultiviewCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassMultiviewCreateInfo32 *in_ext = (const VkRenderPassMultiviewCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->subpassCount = in_ext->subpassCount; - out_ext->pViewMasks = (const uint32_t *)UlongToPtr(in_ext->pViewMasks); - out_ext->dependencyCount = in_ext->dependencyCount; - out_ext->pViewOffsets = (const int32_t *)UlongToPtr(in_ext->pViewOffsets); - out_ext->correlationMaskCount = in_ext->correlationMaskCount; - out_ext->pCorrelationMasks = (const uint32_t *)UlongToPtr(in_ext->pCorrelationMasks); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: - { - VkRenderPassInputAttachmentAspectCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassInputAttachmentAspectCreateInfo32 *in_ext = (const VkRenderPassInputAttachmentAspectCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->aspectReferenceCount = in_ext->aspectReferenceCount; - out_ext->pAspectReferences = (const VkInputAttachmentAspectReference *)UlongToPtr(in_ext->pAspectReferences); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: - { - VkRenderPassFragmentDensityMapCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassFragmentDensityMapCreateInfoEXT32 *in_ext = (const VkRenderPassFragmentDensityMapCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapAttachment = in_ext->fragmentDensityMapAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAttachmentDescription2_win32_to_host(struct conversion_context *ctx, const VkAttachmentDescription232 *in, VkAttachmentDescription2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->format = in->format; - out->samples = in->samples; - out->loadOp = in->loadOp; - out->storeOp = in->storeOp; - out->stencilLoadOp = in->stencilLoadOp; - out->stencilStoreOp = in->stencilStoreOp; - out->initialLayout = in->initialLayout; - out->finalLayout = in->finalLayout; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: - { - VkAttachmentDescriptionStencilLayout *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentDescriptionStencilLayout32 *in_ext = (const VkAttachmentDescriptionStencilLayout32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT; - out_ext->pNext = NULL; - out_ext->stencilInitialLayout = in_ext->stencilInitialLayout; - out_ext->stencilFinalLayout = in_ext->stencilFinalLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkAttachmentDescription2 *convert_VkAttachmentDescription2_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentDescription232 *in, uint32_t count) -{ - VkAttachmentDescription2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentDescription2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAttachmentReference2_win32_to_host(struct conversion_context *ctx, const VkAttachmentReference232 *in, VkAttachmentReference2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->attachment = in->attachment; - out->layout = in->layout; - out->aspectMask = in->aspectMask; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: - { - VkAttachmentReferenceStencilLayout *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentReferenceStencilLayout32 *in_ext = (const VkAttachmentReferenceStencilLayout32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT; - out_ext->pNext = NULL; - out_ext->stencilLayout = in_ext->stencilLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkAttachmentReference2 *convert_VkAttachmentReference2_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentReference232 *in, uint32_t count) -{ - VkAttachmentReference2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentReference2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassDescription2_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription232 *in, VkSubpassDescription2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->viewMask = in->viewMask; - out->inputAttachmentCount = in->inputAttachmentCount; - out->pInputAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pInputAttachments), in->inputAttachmentCount); - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pColorAttachments), in->colorAttachmentCount); - out->pResolveAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pResolveAttachments), in->colorAttachmentCount); - out->pDepthStencilAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pDepthStencilAttachment), 1); - out->preserveAttachmentCount = in->preserveAttachmentCount; - out->pPreserveAttachments = (const uint32_t *)UlongToPtr(in->pPreserveAttachments); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: - { - VkSubpassDescriptionDepthStencilResolve *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassDescriptionDepthStencilResolve32 *in_ext = (const VkSubpassDescriptionDepthStencilResolve32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE; - out_ext->pNext = NULL; - out_ext->depthResolveMode = in_ext->depthResolveMode; - out_ext->stencilResolveMode = in_ext->stencilResolveMode; - out_ext->pDepthStencilResolveAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in_ext->pDepthStencilResolveAttachment), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: - { - VkFragmentShadingRateAttachmentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFragmentShadingRateAttachmentInfoKHR32 *in_ext = (const VkFragmentShadingRateAttachmentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pFragmentShadingRateAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in_ext->pFragmentShadingRateAttachment), 1); - out_ext->shadingRateAttachmentTexelSize = in_ext->shadingRateAttachmentTexelSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT: - { - VkMultisampledRenderToSingleSampledInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultisampledRenderToSingleSampledInfoEXT32 *in_ext = (const VkMultisampledRenderToSingleSampledInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampledEnable = in_ext->multisampledRenderToSingleSampledEnable; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT: - { - VkRenderPassCreationControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationControlEXT32 *in_ext = (const VkRenderPassCreationControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->disallowMerging = in_ext->disallowMerging; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT: - { - VkRenderPassSubpassFeedbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassSubpassFeedbackCreateInfoEXT32 *in_ext = (const VkRenderPassSubpassFeedbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pSubpassFeedback = (VkRenderPassSubpassFeedbackInfoEXT *)UlongToPtr(in_ext->pSubpassFeedback); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkSubpassDescription2 *convert_VkSubpassDescription2_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription232 *in, uint32_t count) -{ - VkSubpassDescription2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDescription2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassDependency2_win32_to_host(struct conversion_context *ctx, const VkSubpassDependency232 *in, VkSubpassDependency2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubpass = in->srcSubpass; - out->dstSubpass = in->dstSubpass; - out->srcStageMask = in->srcStageMask; - out->dstStageMask = in->dstStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->dependencyFlags = in->dependencyFlags; - out->viewOffset = in->viewOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2: - { - VkMemoryBarrier2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryBarrier232 *in_ext = (const VkMemoryBarrier232 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2; - out_ext->pNext = NULL; - out_ext->srcStageMask = in_ext->srcStageMask; - out_ext->srcAccessMask = in_ext->srcAccessMask; - out_ext->dstStageMask = in_ext->dstStageMask; - out_ext->dstAccessMask = in_ext->dstAccessMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkSubpassDependency2 *convert_VkSubpassDependency2_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDependency232 *in, uint32_t count) -{ - VkSubpassDependency2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDependency2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassCreateInfo2_win32_to_host(struct conversion_context *ctx, const VkRenderPassCreateInfo232 *in, VkRenderPassCreateInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->attachmentCount = in->attachmentCount; - out->pAttachments = convert_VkAttachmentDescription2_array_win32_to_host(ctx, (const VkAttachmentDescription232 *)UlongToPtr(in->pAttachments), in->attachmentCount); - out->subpassCount = in->subpassCount; - out->pSubpasses = convert_VkSubpassDescription2_array_win32_to_host(ctx, (const VkSubpassDescription232 *)UlongToPtr(in->pSubpasses), in->subpassCount); - out->dependencyCount = in->dependencyCount; - out->pDependencies = convert_VkSubpassDependency2_array_win32_to_host(ctx, (const VkSubpassDependency232 *)UlongToPtr(in->pDependencies), in->dependencyCount); - out->correlatedViewMaskCount = in->correlatedViewMaskCount; - out->pCorrelatedViewMasks = (const uint32_t *)UlongToPtr(in->pCorrelatedViewMasks); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: - { - VkRenderPassFragmentDensityMapCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassFragmentDensityMapCreateInfoEXT32 *in_ext = (const VkRenderPassFragmentDensityMapCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapAttachment = in_ext->fragmentDensityMapAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT: - { - VkRenderPassCreationControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationControlEXT32 *in_ext = (const VkRenderPassCreationControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->disallowMerging = in_ext->disallowMerging; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT: - { - VkRenderPassCreationFeedbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationFeedbackCreateInfoEXT32 *in_ext = (const VkRenderPassCreationFeedbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pRenderPassFeedback = (VkRenderPassCreationFeedbackInfoEXT *)UlongToPtr(in_ext->pRenderPassFeedback); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSamplerCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSamplerCreateInfo32 *in, VkSamplerCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->magFilter = in->magFilter; - out->minFilter = in->minFilter; - out->mipmapMode = in->mipmapMode; - out->addressModeU = in->addressModeU; - out->addressModeV = in->addressModeV; - out->addressModeW = in->addressModeW; - out->mipLodBias = in->mipLodBias; - out->anisotropyEnable = in->anisotropyEnable; - out->maxAnisotropy = in->maxAnisotropy; - out->compareEnable = in->compareEnable; - out->compareOp = in->compareOp; - out->minLod = in->minLod; - out->maxLod = in->maxLod; - out->borderColor = in->borderColor; - out->unnormalizedCoordinates = in->unnormalizedCoordinates; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: - { - VkSamplerYcbcrConversionInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionInfo32 *in_ext = (const VkSamplerYcbcrConversionInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO; - out_ext->pNext = NULL; - out_ext->conversion = in_ext->conversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: - { - VkSamplerReductionModeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerReductionModeCreateInfo32 *in_ext = (const VkSamplerReductionModeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->reductionMode = in_ext->reductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: - { - VkSamplerCustomBorderColorCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerCustomBorderColorCreateInfoEXT32 *in_ext = (const VkSamplerCustomBorderColorCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColor = in_ext->customBorderColor; - out_ext->format = in_ext->format; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: - { - VkSamplerBorderColorComponentMappingCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerBorderColorComponentMappingCreateInfoEXT32 *in_ext = (const VkSamplerBorderColorComponentMappingCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->components = in_ext->components; - out_ext->srgb = in_ext->srgb; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = (const void *)UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM: - { - VkSamplerCubicWeightsCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerCubicWeightsCreateInfoQCOM32 *in_ext = (const VkSamplerCubicWeightsCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->cubicWeights = in_ext->cubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM: - { - VkSamplerBlockMatchWindowCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerBlockMatchWindowCreateInfoQCOM32 *in_ext = (const VkSamplerBlockMatchWindowCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->windowExtent = in_ext->windowExtent; - out_ext->windowCompareMode = in_ext->windowCompareMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSamplerYcbcrConversionCreateInfo32 *in, VkSamplerYcbcrConversionCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->ycbcrModel = in->ycbcrModel; - out->ycbcrRange = in->ycbcrRange; - out->components = in->components; - out->xChromaOffset = in->xChromaOffset; - out->yChromaOffset = in->yChromaOffset; - out->chromaFilter = in->chromaFilter; - out->forceExplicitReconstruction = in->forceExplicitReconstruction; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM: - { - VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 *in_ext = (const VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->enableYDegamma = in_ext->enableYDegamma; - out_ext->enableCbCrDegamma = in_ext->enableCbCrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSemaphoreCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSemaphoreCreateInfo32 *in, VkSemaphoreCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: - { - VkExportSemaphoreCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportSemaphoreCreateInfo32 *in_ext = (const VkExportSemaphoreCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: - { - VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSemaphoreTypeCreateInfo32 *in_ext = (const VkSemaphoreTypeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->semaphoreType = in_ext->semaphoreType; - out_ext->initialValue = in_ext->initialValue; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: - { - VkQueryLowLatencySupportNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryLowLatencySupportNV32 *in_ext = (const VkQueryLowLatencySupportNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV; - out_ext->pNext = NULL; - out_ext->pQueriedLowLatencyData = (void *)UlongToPtr(in_ext->pQueriedLowLatencyData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkShaderModuleCreateInfo_win32_to_host(struct conversion_context *ctx, const VkShaderModuleCreateInfo32 *in, VkShaderModuleCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->codeSize = in->codeSize; - out->pCode = (const uint32_t *)UlongToPtr(in->pCode); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT32 *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkShaderCreateInfoEXT_win32_to_host(struct conversion_context *ctx, const VkShaderCreateInfoEXT32 *in, VkShaderCreateInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->nextStage = in->nextStage; - out->codeType = in->codeType; - out->codeSize = in->codeSize; - out->pCode = (const void *)UlongToPtr(in->pCode); - out->pName = (const char *)UlongToPtr(in->pName); - out->setLayoutCount = in->setLayoutCount; - out->pSetLayouts = (const VkDescriptorSetLayout *)UlongToPtr(in->pSetLayouts); - out->pushConstantRangeCount = in->pushConstantRangeCount; - out->pPushConstantRanges = (const VkPushConstantRange *)UlongToPtr(in->pPushConstantRanges); - out->pSpecializationInfo = convert_VkSpecializationInfo_array_win32_to_host(ctx, (const VkSpecializationInfo32 *)UlongToPtr(in->pSpecializationInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkShaderCreateInfoEXT *convert_VkShaderCreateInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkShaderCreateInfoEXT32 *in, uint32_t count) -{ - VkShaderCreateInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkShaderCreateInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSwapchainCreateInfoKHR_win64_to_driver(const VkSwapchainCreateInfoKHR *in, VkSwapchainCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->surface = wine_surface_from_handle(in->surface)->driver_surface; - out->minImageCount = in->minImageCount; - out->imageFormat = in->imageFormat; - out->imageColorSpace = in->imageColorSpace; - out->imageExtent = in->imageExtent; - out->imageArrayLayers = in->imageArrayLayers; - out->imageUsage = in->imageUsage; - out->imageSharingMode = in->imageSharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = in->pQueueFamilyIndices; - out->preTransform = in->preTransform; - out->compositeAlpha = in->compositeAlpha; - out->presentMode = in->presentMode; - out->clipped = in->clipped; - out->oldSwapchain = in->oldSwapchain; -} -#endif /* _WIN64 */ - -static inline void convert_VkSwapchainCreateInfoKHR_win32_to_driver(struct conversion_context *ctx, const VkSwapchainCreateInfoKHR32 *in, VkSwapchainCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->surface = wine_surface_from_handle(in->surface)->driver_surface; - out->minImageCount = in->minImageCount; - out->imageFormat = in->imageFormat; - out->imageColorSpace = in->imageColorSpace; - out->imageExtent = in->imageExtent; - out->imageArrayLayers = in->imageArrayLayers; - out->imageUsage = in->imageUsage; - out->imageSharingMode = in->imageSharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = (const uint32_t *)UlongToPtr(in->pQueueFamilyIndices); - out->preTransform = in->preTransform; - out->compositeAlpha = in->compositeAlpha; - out->presentMode = in->presentMode; - out->clipped = in->clipped; - out->oldSwapchain = in->oldSwapchain; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: - { - VkDeviceGroupSwapchainCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupSwapchainCreateInfoKHR32 *in_ext = (const VkDeviceGroupSwapchainCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->modes = in_ext->modes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = (const VkFormat *)UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV: - { - VkSwapchainPresentBarrierCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentBarrierCreateInfoNV32 *in_ext = (const VkSwapchainPresentBarrierCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->presentBarrierEnable = in_ext->presentBarrierEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = (VkImageCompressionFixedRateFlagsEXT *)UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT: - { - VkSwapchainPresentModesCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentModesCreateInfoEXT32 *in_ext = (const VkSwapchainPresentModesCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = (const VkPresentModeKHR *)UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT: - { - VkSwapchainPresentScalingCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentScalingCreateInfoEXT32 *in_ext = (const VkSwapchainPresentScalingCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->scalingBehavior = in_ext->scalingBehavior; - out_ext->presentGravityX = in_ext->presentGravityX; - out_ext->presentGravityY = in_ext->presentGravityY; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV: - { - VkSwapchainLatencyCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainLatencyCreateInfoNV32 *in_ext = (const VkSwapchainLatencyCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->latencyModeEnable = in_ext->latencyModeEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkValidationCacheCreateInfoEXT_win32_to_host(const VkValidationCacheCreateInfoEXT32 *in, VkValidationCacheCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->initialDataSize = in->initialDataSize; - out->pInitialData = (const void *)UlongToPtr(in->pInitialData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkWin32SurfaceCreateInfoKHR_win32_to_host(const VkWin32SurfaceCreateInfoKHR32 *in, VkWin32SurfaceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->hinstance = (HINSTANCE)UlongToPtr(in->hinstance); - out->hwnd = (HWND)UlongToPtr(in->hwnd); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugMarkerObjectNameInfoEXT_win64_to_host(const VkDebugMarkerObjectNameInfoEXT *in, VkDebugMarkerObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->pObjectName = in->pObjectName; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugMarkerObjectNameInfoEXT_win32_to_host(const VkDebugMarkerObjectNameInfoEXT32 *in, VkDebugMarkerObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->pObjectName = (const char *)UlongToPtr(in->pObjectName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugMarkerObjectTagInfoEXT_win64_to_host(const VkDebugMarkerObjectTagInfoEXT *in, VkDebugMarkerObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = in->pTag; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugMarkerObjectTagInfoEXT_win32_to_host(const VkDebugMarkerObjectTagInfoEXT32 *in, VkDebugMarkerObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = (const void *)UlongToPtr(in->pTag); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDevice_array_unwrapped_host_to_win32(const VkPhysicalDevice *in, PTR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - out[i] = PtrToUlong(in[i]); - } -} - -static inline void convert_VkPhysicalDeviceGroupProperties_win32_to_unwrapped_host(const VkPhysicalDeviceGroupProperties32 *in, VkPhysicalDeviceGroupProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceGroupProperties_unwrapped_host_to_win32(const VkPhysicalDeviceGroupProperties *in, VkPhysicalDeviceGroupProperties32 *out) -{ - if (!in) return; - - out->physicalDeviceCount = in->physicalDeviceCount; - convert_VkPhysicalDevice_array_unwrapped_host_to_win32(in->physicalDevices, out->physicalDevices, VK_MAX_DEVICE_GROUP_SIZE); - out->subsetAllocation = in->subsetAllocation; -} - -static inline VkPhysicalDeviceGroupProperties *convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPhysicalDeviceGroupProperties32 *in, uint32_t count) -{ - VkPhysicalDeviceGroupProperties *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceGroupProperties_win32_to_unwrapped_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(const VkPhysicalDeviceGroupProperties *in, VkPhysicalDeviceGroupProperties32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceGroupProperties_unwrapped_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPerformanceCounterKHR_win32_to_host(const VkPerformanceCounterKHR32 *in, VkPerformanceCounterKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceCounterKHR_host_to_win32(const VkPerformanceCounterKHR *in, VkPerformanceCounterKHR32 *out) -{ - if (!in) return; - - out->unit = in->unit; - out->scope = in->scope; - out->storage = in->storage; - memcpy(out->uuid, in->uuid, VK_UUID_SIZE * sizeof(uint8_t)); -} - -static inline VkPerformanceCounterKHR *convert_VkPerformanceCounterKHR_array_win32_to_host(struct conversion_context *ctx, const VkPerformanceCounterKHR32 *in, uint32_t count) -{ - VkPerformanceCounterKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPerformanceCounterKHR_array_host_to_win32(const VkPerformanceCounterKHR *in, VkPerformanceCounterKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_win32_to_host(const VkPerformanceCounterDescriptionKHR32 *in, VkPerformanceCounterDescriptionKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_host_to_win32(const VkPerformanceCounterDescriptionKHR *in, VkPerformanceCounterDescriptionKHR32 *out) -{ - if (!in) return; - - out->flags = in->flags; - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->category, in->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); -} - -static inline VkPerformanceCounterDescriptionKHR *convert_VkPerformanceCounterDescriptionKHR_array_win32_to_host(struct conversion_context *ctx, const VkPerformanceCounterDescriptionKHR32 *in, uint32_t count) -{ - VkPerformanceCounterDescriptionKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterDescriptionKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_array_host_to_win32(const VkPerformanceCounterDescriptionKHR *in, VkPerformanceCounterDescriptionKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterDescriptionKHR_host_to_win32(&in[i], &out[i]); - } -} - -#ifdef _WIN64 -static inline void convert_VkMappedMemoryRange_win64_to_host(const VkMappedMemoryRange *in, VkMappedMemoryRange *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->offset = in->offset; - out->size = in->size; -} -#endif /* _WIN64 */ - -static inline void convert_VkMappedMemoryRange_win32_to_host(const VkMappedMemoryRange32 *in, VkMappedMemoryRange *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - out->offset = in->offset; - out->size = in->size; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win64_to_host(struct conversion_context *ctx, const VkMappedMemoryRange *in, uint32_t count) -{ - VkMappedMemoryRange *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMappedMemoryRange_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win32_to_host(struct conversion_context *ctx, const VkMappedMemoryRange32 *in, uint32_t count) -{ - VkMappedMemoryRange *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMappedMemoryRange_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_win32_to_host(const VkAccelerationStructureBuildSizesInfoKHR32 *in, VkAccelerationStructureBuildSizesInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructureSize = in->accelerationStructureSize; - out->updateScratchSize = in->updateScratchSize; - out->buildScratchSize = in->buildScratchSize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_host_to_win32(const VkAccelerationStructureBuildSizesInfoKHR *in, VkAccelerationStructureBuildSizesInfoKHR32 *out) -{ - if (!in) return; - - out->accelerationStructureSize = in->accelerationStructureSize; - out->updateScratchSize = in->updateScratchSize; - out->buildScratchSize = in->buildScratchSize; -} - -static inline void convert_VkAccelerationStructureDeviceAddressInfoKHR_win32_to_host(const VkAccelerationStructureDeviceAddressInfoKHR32 *in, VkAccelerationStructureDeviceAddressInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureMemoryRequirementsInfoNV_win32_to_host(const VkAccelerationStructureMemoryRequirementsInfoNV32 *in, VkAccelerationStructureMemoryRequirementsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->accelerationStructure = in->accelerationStructure; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements_host_to_win32(const VkMemoryRequirements *in, VkMemoryRequirements32 *out) -{ - if (!in) return; - - out->size = in->size; - out->alignment = in->alignment; - out->memoryTypeBits = in->memoryTypeBits; -} - -static inline void convert_VkMemoryRequirements2KHR_win32_to_host(const VkMemoryRequirements2KHR32 *in, VkMemoryRequirements2KHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements2KHR_host_to_win32(const VkMemoryRequirements2KHR *in, VkMemoryRequirements2KHR32 *out) -{ - if (!in) return; - - convert_VkMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); -} - -static inline void convert_VkAccelerationStructureCaptureDescriptorDataInfoEXT_win32_to_host(const VkAccelerationStructureCaptureDescriptorDataInfoEXT32 *in, VkAccelerationStructureCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - out->accelerationStructureNV = in->accelerationStructureNV; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferDeviceAddressInfo_win32_to_host(const VkBufferDeviceAddressInfo32 *in, VkBufferDeviceAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferMemoryRequirementsInfo2_win32_to_host(const VkBufferMemoryRequirementsInfo232 *in, VkBufferMemoryRequirementsInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements2_win32_to_host(struct conversion_context *ctx, const VkMemoryRequirements232 *in, VkMemoryRequirements2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: - { - VkMemoryDedicatedRequirements *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMemoryRequirements2_host_to_win32(const VkMemoryRequirements2 *in, VkMemoryRequirements232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: - { - VkMemoryDedicatedRequirements32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS); - const VkMemoryDedicatedRequirements *in_ext = (const VkMemoryDedicatedRequirements *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS; - out_ext->prefersDedicatedAllocation = in_ext->prefersDedicatedAllocation; - out_ext->requiresDedicatedAllocation = in_ext->requiresDedicatedAllocation; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkBufferCaptureDescriptorDataInfoEXT_win32_to_host(const VkBufferCaptureDescriptorDataInfoEXT32 *in, VkBufferCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCalibratedTimestampInfoEXT_win32_to_host(const VkCalibratedTimestampInfoEXT32 *in, VkCalibratedTimestampInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->timeDomain = in->timeDomain; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkCalibratedTimestampInfoEXT *convert_VkCalibratedTimestampInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkCalibratedTimestampInfoEXT32 *in, uint32_t count) -{ - VkCalibratedTimestampInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCalibratedTimestampInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorAddressInfoEXT_win32_to_host(const VkDescriptorAddressInfoEXT32 *in, VkDescriptorAddressInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->address = in->address; - out->range = in->range; - out->format = in->format; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkDescriptorAddressInfoEXT *convert_VkDescriptorAddressInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorAddressInfoEXT32 *in, uint32_t count) -{ - VkDescriptorAddressInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorAddressInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorDataEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorDataEXT32 *in, VkDescriptorDataEXT *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_DESCRIPTOR_TYPE_SAMPLER) - out->pSampler = (const VkSampler *)UlongToPtr(in->pSampler); - if (selector == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) - out->pCombinedImageSampler = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pCombinedImageSampler), 1); - if (selector == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT) - out->pInputAttachmentImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pInputAttachmentImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) - out->pSampledImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pSampledImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) - out->pStorageImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pStorageImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) - out->pUniformTexelBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pUniformTexelBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) - out->pStorageTexelBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pStorageTexelBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) - out->pUniformBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pUniformBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) - out->pStorageBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pStorageBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR || selector == VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV) - out->accelerationStructure = in->accelerationStructure; -} - -static inline void convert_VkDescriptorGetInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorGetInfoEXT32 *in, VkDescriptorGetInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - convert_VkDescriptorDataEXT_win32_to_host(ctx, &in->data, &out->data, in->type); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetBindingReferenceVALVE_win32_to_host(const VkDescriptorSetBindingReferenceVALVE32 *in, VkDescriptorSetBindingReferenceVALVE *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorSetLayout = in->descriptorSetLayout; - out->binding = in->binding; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetLayoutHostMappingInfoVALVE_win32_to_host(const VkDescriptorSetLayoutHostMappingInfoVALVE32 *in, VkDescriptorSetLayoutHostMappingInfoVALVE *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorOffset = in->descriptorOffset; - out->descriptorSize = in->descriptorSize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetLayoutHostMappingInfoVALVE_host_to_win32(const VkDescriptorSetLayoutHostMappingInfoVALVE *in, VkDescriptorSetLayoutHostMappingInfoVALVE32 *out) -{ - if (!in) return; - - out->descriptorOffset = in->descriptorOffset; - out->descriptorSize = in->descriptorSize; -} - -static inline void convert_VkDescriptorSetLayoutSupport_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutSupport32 *in, VkDescriptorSetLayoutSupport *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: - { - VkDescriptorSetVariableDescriptorCountLayoutSupport *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorSetLayoutSupport_host_to_win32(const VkDescriptorSetLayoutSupport *in, VkDescriptorSetLayoutSupport32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->supported = in->supported; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: - { - VkDescriptorSetVariableDescriptorCountLayoutSupport32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT); - const VkDescriptorSetVariableDescriptorCountLayoutSupport *in_ext = (const VkDescriptorSetVariableDescriptorCountLayoutSupport *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT; - out_ext->maxVariableDescriptorCount = in_ext->maxVariableDescriptorCount; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkAccelerationStructureVersionInfoKHR_win32_to_host(const VkAccelerationStructureVersionInfoKHR32 *in, VkAccelerationStructureVersionInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pVersionData = (const uint8_t *)UlongToPtr(in->pVersionData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkBufferCreateInfo *convert_VkBufferCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkBufferCreateInfo32 *in, uint32_t count) -{ - VkBufferCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceBufferMemoryRequirements_win32_to_host(struct conversion_context *ctx, const VkDeviceBufferMemoryRequirements32 *in, VkDeviceBufferMemoryRequirements *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkBufferCreateInfo_array_win32_to_host(ctx, (const VkBufferCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultCountsEXT_win32_to_host(const VkDeviceFaultCountsEXT32 *in, VkDeviceFaultCountsEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->addressInfoCount = in->addressInfoCount; - out->vendorInfoCount = in->vendorInfoCount; - out->vendorBinarySize = in->vendorBinarySize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultCountsEXT_host_to_win32(const VkDeviceFaultCountsEXT *in, VkDeviceFaultCountsEXT32 *out) -{ - if (!in) return; - - out->addressInfoCount = in->addressInfoCount; - out->vendorInfoCount = in->vendorInfoCount; - out->vendorBinarySize = in->vendorBinarySize; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_win32_to_host(const VkDeviceFaultAddressInfoEXT32 *in, VkDeviceFaultAddressInfoEXT *out) -{ - if (!in) return; - - out->addressType = in->addressType; - out->reportedAddress = in->reportedAddress; - out->addressPrecision = in->addressPrecision; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_host_to_win32(const VkDeviceFaultAddressInfoEXT *in, VkDeviceFaultAddressInfoEXT32 *out) -{ - if (!in) return; - - out->addressType = in->addressType; - out->reportedAddress = in->reportedAddress; - out->addressPrecision = in->addressPrecision; -} - -static inline VkDeviceFaultAddressInfoEXT *convert_VkDeviceFaultAddressInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultAddressInfoEXT32 *in, uint32_t count) -{ - VkDeviceFaultAddressInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultAddressInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_array_host_to_win32(const VkDeviceFaultAddressInfoEXT *in, VkDeviceFaultAddressInfoEXT32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultAddressInfoEXT_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_win32_to_host(const VkDeviceFaultVendorInfoEXT32 *in, VkDeviceFaultVendorInfoEXT *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->vendorFaultCode = in->vendorFaultCode; - out->vendorFaultData = in->vendorFaultData; -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_host_to_win32(const VkDeviceFaultVendorInfoEXT *in, VkDeviceFaultVendorInfoEXT32 *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->vendorFaultCode = in->vendorFaultCode; - out->vendorFaultData = in->vendorFaultData; -} - -static inline VkDeviceFaultVendorInfoEXT *convert_VkDeviceFaultVendorInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultVendorInfoEXT32 *in, uint32_t count) -{ - VkDeviceFaultVendorInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultVendorInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_array_host_to_win32(const VkDeviceFaultVendorInfoEXT *in, VkDeviceFaultVendorInfoEXT32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultVendorInfoEXT_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkDeviceFaultInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultInfoEXT32 *in, VkDeviceFaultInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->pAddressInfos = convert_VkDeviceFaultAddressInfoEXT_array_win32_to_host(ctx, (VkDeviceFaultAddressInfoEXT32 *)UlongToPtr(in->pAddressInfos), 1); - out->pVendorInfos = convert_VkDeviceFaultVendorInfoEXT_array_win32_to_host(ctx, (VkDeviceFaultVendorInfoEXT32 *)UlongToPtr(in->pVendorInfos), 1); - out->pVendorBinaryData = (void *)UlongToPtr(in->pVendorBinaryData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultInfoEXT_host_to_win32(const VkDeviceFaultInfoEXT *in, VkDeviceFaultInfoEXT32 *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - convert_VkDeviceFaultAddressInfoEXT_array_host_to_win32(in->pAddressInfos, (VkDeviceFaultAddressInfoEXT32 *)UlongToPtr(out->pAddressInfos), 1); - convert_VkDeviceFaultVendorInfoEXT_array_host_to_win32(in->pVendorInfos, (VkDeviceFaultVendorInfoEXT32 *)UlongToPtr(out->pVendorInfos), 1); - out->pVendorBinaryData = PtrToUlong(in->pVendorBinaryData); -} - -static inline void convert_VkDeviceGroupPresentCapabilitiesKHR_win32_to_host(const VkDeviceGroupPresentCapabilitiesKHR32 *in, VkDeviceGroupPresentCapabilitiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceGroupPresentCapabilitiesKHR_host_to_win32(const VkDeviceGroupPresentCapabilitiesKHR *in, VkDeviceGroupPresentCapabilitiesKHR32 *out) -{ - if (!in) return; - - memcpy(out->presentMask, in->presentMask, VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t)); - out->modes = in->modes; -} - -static inline const VkImageCreateInfo *convert_VkImageCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkImageCreateInfo32 *in, uint32_t count) -{ - VkImageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceImageMemoryRequirements_win32_to_host(struct conversion_context *ctx, const VkDeviceImageMemoryRequirements32 *in, VkDeviceImageMemoryRequirements *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkImageCreateInfo_array_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - out->planeAspect = in->planeAspect; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements_host_to_win32(const VkSparseImageMemoryRequirements *in, VkSparseImageMemoryRequirements32 *out) -{ - if (!in) return; - - out->formatProperties = in->formatProperties; - out->imageMipTailFirstLod = in->imageMipTailFirstLod; - out->imageMipTailSize = in->imageMipTailSize; - out->imageMipTailOffset = in->imageMipTailOffset; - out->imageMipTailStride = in->imageMipTailStride; -} - -static inline void convert_VkSparseImageMemoryRequirements2_win32_to_host(const VkSparseImageMemoryRequirements232 *in, VkSparseImageMemoryRequirements2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements2_host_to_win32(const VkSparseImageMemoryRequirements2 *in, VkSparseImageMemoryRequirements232 *out) -{ - if (!in) return; - - convert_VkSparseImageMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); -} - -static inline VkSparseImageMemoryRequirements2 *convert_VkSparseImageMemoryRequirements2_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryRequirements232 *in, uint32_t count) -{ - VkSparseImageMemoryRequirements2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSparseImageMemoryRequirements2_array_host_to_win32(const VkSparseImageMemoryRequirements2 *in, VkSparseImageMemoryRequirements232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageSubresource2KHR_win32_to_host(const VkImageSubresource2KHR32 *in, VkImageSubresource2KHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageSubresource = in->imageSubresource; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageSubresource2KHR *convert_VkImageSubresource2KHR_array_win32_to_host(struct conversion_context *ctx, const VkImageSubresource2KHR32 *in, uint32_t count) -{ - VkImageSubresource2KHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageSubresource2KHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceImageSubresourceInfoKHR_win32_to_host(struct conversion_context *ctx, const VkDeviceImageSubresourceInfoKHR32 *in, VkDeviceImageSubresourceInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkImageCreateInfo_array_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - out->pSubresource = convert_VkImageSubresource2KHR_array_win32_to_host(ctx, (const VkImageSubresource2KHR32 *)UlongToPtr(in->pSubresource), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSubresourceLayout_win32_to_host(const VkSubresourceLayout32 *in, VkSubresourceLayout *out) -{ - if (!in) return; - - out->offset = in->offset; - out->size = in->size; - out->rowPitch = in->rowPitch; - out->arrayPitch = in->arrayPitch; - out->depthPitch = in->depthPitch; -} - -static inline void convert_VkSubresourceLayout_host_to_win32(const VkSubresourceLayout *in, VkSubresourceLayout32 *out) -{ - if (!in) return; - - out->offset = in->offset; - out->size = in->size; - out->rowPitch = in->rowPitch; - out->arrayPitch = in->arrayPitch; - out->depthPitch = in->depthPitch; -} - -static inline void convert_VkSubresourceLayout2KHR_win32_to_host(struct conversion_context *ctx, const VkSubresourceLayout2KHR32 *in, VkSubresourceLayout2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT: - { - VkSubresourceHostMemcpySizeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSubresourceLayout2KHR_host_to_win32(const VkSubresourceLayout2KHR *in, VkSubresourceLayout2KHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkSubresourceLayout_host_to_win32(&in->subresourceLayout, &out->subresourceLayout); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT: - { - VkSubresourceHostMemcpySizeEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT); - const VkSubresourceHostMemcpySizeEXT *in_ext = (const VkSubresourceHostMemcpySizeEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT; - out_ext->size = in_ext->size; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo32 *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->memory = wine_device_memory_from_handle(in->memory)->host_memory; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMicromapVersionInfoEXT_win32_to_host(const VkMicromapVersionInfoEXT32 *in, VkMicromapVersionInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pVersionData = (const uint8_t *)UlongToPtr(in->pVersionData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceQueueInfo2_win32_to_host(const VkDeviceQueueInfo232 *in, VkDeviceQueueInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - out->queueIndex = in->queueIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkTilePropertiesQCOM_win32_to_host(const VkTilePropertiesQCOM32 *in, VkTilePropertiesQCOM *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->tileSize = in->tileSize; - out->apronSize = in->apronSize; - out->origin = in->origin; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkTilePropertiesQCOM_host_to_win32(const VkTilePropertiesQCOM *in, VkTilePropertiesQCOM32 *out) -{ - if (!in) return; - - out->tileSize = in->tileSize; - out->apronSize = in->apronSize; - out->origin = in->origin; -} - -static inline VkTilePropertiesQCOM *convert_VkTilePropertiesQCOM_array_win32_to_host(struct conversion_context *ctx, const VkTilePropertiesQCOM32 *in, uint32_t count) -{ - VkTilePropertiesQCOM *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkTilePropertiesQCOM_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkTilePropertiesQCOM_array_host_to_win32(const VkTilePropertiesQCOM *in, VkTilePropertiesQCOM32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkTilePropertiesQCOM_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win32_to_host(const VkGeneratedCommandsMemoryRequirementsInfoNV32 *in, VkGeneratedCommandsMemoryRequirementsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->maxSequencesCount = in->maxSequencesCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageMemoryRequirementsInfo2_win32_to_host(struct conversion_context *ctx, const VkImageMemoryRequirementsInfo232 *in, VkImageMemoryRequirementsInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: - { - VkImagePlaneMemoryRequirementsInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImagePlaneMemoryRequirementsInfo32 *in_ext = (const VkImagePlaneMemoryRequirementsInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO; - out_ext->pNext = NULL; - out_ext->planeAspect = in_ext->planeAspect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageCaptureDescriptorDataInfoEXT_win32_to_host(const VkImageCaptureDescriptorDataInfoEXT32 *in, VkImageCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements_array_host_to_win32(const VkSparseImageMemoryRequirements *in, VkSparseImageMemoryRequirements32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host(const VkImageSparseMemoryRequirementsInfo232 *in, VkImageSparseMemoryRequirementsInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewAddressPropertiesNVX_win32_to_host(const VkImageViewAddressPropertiesNVX32 *in, VkImageViewAddressPropertiesNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewAddressPropertiesNVX_host_to_win32(const VkImageViewAddressPropertiesNVX *in, VkImageViewAddressPropertiesNVX32 *out) -{ - if (!in) return; - - out->deviceAddress = in->deviceAddress; - out->size = in->size; -} - -static inline void convert_VkImageViewHandleInfoNVX_win32_to_host(const VkImageViewHandleInfoNVX32 *in, VkImageViewHandleInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - out->descriptorType = in->descriptorType; - out->sampler = in->sampler; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewCaptureDescriptorDataInfoEXT_win32_to_host(const VkImageViewCaptureDescriptorDataInfoEXT32 *in, VkImageViewCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencyTimingsFrameReportNV_win32_to_host(const VkLatencyTimingsFrameReportNV32 *in, VkLatencyTimingsFrameReportNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->presentID = in->presentID; - out->inputSampleTimeUs = in->inputSampleTimeUs; - out->simStartTimeUs = in->simStartTimeUs; - out->simEndTimeUs = in->simEndTimeUs; - out->renderSubmitStartTimeUs = in->renderSubmitStartTimeUs; - out->renderSubmitEndTimeUs = in->renderSubmitEndTimeUs; - out->presentStartTimeUs = in->presentStartTimeUs; - out->presentEndTimeUs = in->presentEndTimeUs; - out->driverStartTimeUs = in->driverStartTimeUs; - out->driverEndTimeUs = in->driverEndTimeUs; - out->osRenderQueueStartTimeUs = in->osRenderQueueStartTimeUs; - out->osRenderQueueEndTimeUs = in->osRenderQueueEndTimeUs; - out->gpuRenderStartTimeUs = in->gpuRenderStartTimeUs; - out->gpuRenderEndTimeUs = in->gpuRenderEndTimeUs; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencyTimingsFrameReportNV_host_to_win32(const VkLatencyTimingsFrameReportNV *in, VkLatencyTimingsFrameReportNV32 *out) -{ - if (!in) return; - - out->presentID = in->presentID; - out->inputSampleTimeUs = in->inputSampleTimeUs; - out->simStartTimeUs = in->simStartTimeUs; - out->simEndTimeUs = in->simEndTimeUs; - out->renderSubmitStartTimeUs = in->renderSubmitStartTimeUs; - out->renderSubmitEndTimeUs = in->renderSubmitEndTimeUs; - out->presentStartTimeUs = in->presentStartTimeUs; - out->presentEndTimeUs = in->presentEndTimeUs; - out->driverStartTimeUs = in->driverStartTimeUs; - out->driverEndTimeUs = in->driverEndTimeUs; - out->osRenderQueueStartTimeUs = in->osRenderQueueStartTimeUs; - out->osRenderQueueEndTimeUs = in->osRenderQueueEndTimeUs; - out->gpuRenderStartTimeUs = in->gpuRenderStartTimeUs; - out->gpuRenderEndTimeUs = in->gpuRenderEndTimeUs; -} - -static inline VkLatencyTimingsFrameReportNV *convert_VkLatencyTimingsFrameReportNV_array_win32_to_host(struct conversion_context *ctx, const VkLatencyTimingsFrameReportNV32 *in, uint32_t count) -{ - VkLatencyTimingsFrameReportNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkLatencyTimingsFrameReportNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkLatencyTimingsFrameReportNV_array_host_to_win32(const VkLatencyTimingsFrameReportNV *in, VkLatencyTimingsFrameReportNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkLatencyTimingsFrameReportNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkGetLatencyMarkerInfoNV_win32_to_host(struct conversion_context *ctx, const VkGetLatencyMarkerInfoNV32 *in, VkGetLatencyMarkerInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->timingCount = in->timingCount; - out->pTimings = convert_VkLatencyTimingsFrameReportNV_array_win32_to_host(ctx, (VkLatencyTimingsFrameReportNV32 *)UlongToPtr(in->pTimings), in->timingCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGetLatencyMarkerInfoNV_host_to_win32(const VkGetLatencyMarkerInfoNV *in, VkGetLatencyMarkerInfoNV32 *out) -{ - if (!in) return; - - out->timingCount = in->timingCount; - convert_VkLatencyTimingsFrameReportNV_array_host_to_win32(in->pTimings, (VkLatencyTimingsFrameReportNV32 *)UlongToPtr(out->pTimings), in->timingCount); -} - -static inline void convert_VkMemoryHostPointerPropertiesEXT_win32_to_host(const VkMemoryHostPointerPropertiesEXT32 *in, VkMemoryHostPointerPropertiesEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryHostPointerPropertiesEXT_host_to_win32(const VkMemoryHostPointerPropertiesEXT *in, VkMemoryHostPointerPropertiesEXT32 *out) -{ - if (!in) return; - - out->memoryTypeBits = in->memoryTypeBits; -} - -static inline void convert_VkMicromapBuildSizesInfoEXT_win32_to_host(const VkMicromapBuildSizesInfoEXT32 *in, VkMicromapBuildSizesInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->micromapSize = in->micromapSize; - out->buildScratchSize = in->buildScratchSize; - out->discardable = in->discardable; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMicromapBuildSizesInfoEXT_host_to_win32(const VkMicromapBuildSizesInfoEXT *in, VkMicromapBuildSizesInfoEXT32 *out) -{ - if (!in) return; - - out->micromapSize = in->micromapSize; - out->buildScratchSize = in->buildScratchSize; - out->discardable = in->discardable; -} - -static inline void convert_VkPerformanceValueDataINTEL_win32_to_host(const VkPerformanceValueDataINTEL32 *in, VkPerformanceValueDataINTEL *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL) - out->value32 = in->value32; - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL) - out->value64 = in->value64; - if (selector == VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL) - out->valueFloat = in->valueFloat; - if (selector == VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL) - out->valueBool = in->valueBool; - if (selector == VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL) - out->valueString = (const char *)UlongToPtr(in->valueString); -} - -static inline void convert_VkPerformanceValueDataINTEL_host_to_win32(const VkPerformanceValueDataINTEL *in, VkPerformanceValueDataINTEL32 *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL) - out->value32 = in->value32; - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL) - out->value64 = in->value64; - if (selector == VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL) - out->valueFloat = in->valueFloat; - if (selector == VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL) - out->valueBool = in->valueBool; -} - -static inline void convert_VkPerformanceValueINTEL_host_to_win32(const VkPerformanceValueINTEL *in, VkPerformanceValueINTEL32 *out) -{ - if (!in) return; - - out->type = in->type; - convert_VkPerformanceValueDataINTEL_host_to_win32(&in->data, &out->data, in->type); -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_win32_to_host(const VkCooperativeMatrixPropertiesKHR32 *in, VkCooperativeMatrixPropertiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->MSize = in->MSize; - out->NSize = in->NSize; - out->KSize = in->KSize; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->ResultType = in->ResultType; - out->saturatingAccumulation = in->saturatingAccumulation; - out->scope = in->scope; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_host_to_win32(const VkCooperativeMatrixPropertiesKHR *in, VkCooperativeMatrixPropertiesKHR32 *out) -{ - if (!in) return; - - out->MSize = in->MSize; - out->NSize = in->NSize; - out->KSize = in->KSize; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->ResultType = in->ResultType; - out->saturatingAccumulation = in->saturatingAccumulation; - out->scope = in->scope; -} - -static inline VkCooperativeMatrixPropertiesKHR *convert_VkCooperativeMatrixPropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkCooperativeMatrixPropertiesKHR32 *in, uint32_t count) -{ - VkCooperativeMatrixPropertiesKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_array_host_to_win32(const VkCooperativeMatrixPropertiesKHR *in, VkCooperativeMatrixPropertiesKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_win32_to_host(const VkCooperativeMatrixPropertiesNV32 *in, VkCooperativeMatrixPropertiesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_host_to_win32(const VkCooperativeMatrixPropertiesNV *in, VkCooperativeMatrixPropertiesNV32 *out) -{ - if (!in) return; - - out->MSize = in->MSize; - out->NSize = in->NSize; - out->KSize = in->KSize; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->DType = in->DType; - out->scope = in->scope; -} - -static inline VkCooperativeMatrixPropertiesNV *convert_VkCooperativeMatrixPropertiesNV_array_win32_to_host(struct conversion_context *ctx, const VkCooperativeMatrixPropertiesNV32 *in, uint32_t count) -{ - VkCooperativeMatrixPropertiesNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_array_host_to_win32(const VkCooperativeMatrixPropertiesNV *in, VkCooperativeMatrixPropertiesNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalBufferInfo32 *in, VkPhysicalDeviceExternalBufferInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->usage = in->usage; - out->handleType = in->handleType; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR: - { - VkBufferUsageFlags2CreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfoKHR32 *in_ext = (const VkBufferUsageFlags2CreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkExternalBufferProperties_win32_to_host(const VkExternalBufferProperties32 *in, VkExternalBufferProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalBufferProperties_host_to_win32(const VkExternalBufferProperties *in, VkExternalBufferProperties32 *out) -{ - if (!in) return; - - out->externalMemoryProperties = in->externalMemoryProperties; -} - -static inline void convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(const VkPhysicalDeviceExternalFenceInfo32 *in, VkPhysicalDeviceExternalFenceInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->handleType = in->handleType; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalFenceProperties_win32_to_host(const VkExternalFenceProperties32 *in, VkExternalFenceProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalFenceProperties_host_to_win32(const VkExternalFenceProperties *in, VkExternalFenceProperties32 *out) -{ - if (!in) return; - - out->exportFromImportedHandleTypes = in->exportFromImportedHandleTypes; - out->compatibleHandleTypes = in->compatibleHandleTypes; - out->externalFenceFeatures = in->externalFenceFeatures; -} - -static inline void convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalSemaphoreInfo32 *in, VkPhysicalDeviceExternalSemaphoreInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->handleType = in->handleType; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: - { - VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSemaphoreTypeCreateInfo32 *in_ext = (const VkSemaphoreTypeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->semaphoreType = in_ext->semaphoreType; - out_ext->initialValue = in_ext->initialValue; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkExternalSemaphoreProperties_win32_to_host(const VkExternalSemaphoreProperties32 *in, VkExternalSemaphoreProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalSemaphoreProperties_host_to_win32(const VkExternalSemaphoreProperties *in, VkExternalSemaphoreProperties32 *out) -{ - if (!in) return; - - out->exportFromImportedHandleTypes = in->exportFromImportedHandleTypes; - out->compatibleHandleTypes = in->compatibleHandleTypes; - out->externalSemaphoreFeatures = in->externalSemaphoreFeatures; -} - -static inline void convert_VkPhysicalDeviceFeatures2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceFeatures232 *in, VkPhysicalDeviceFeatures2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->features = in->features; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures32 *in_ext = (const VkPhysicalDevicePrivateDataFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures32 *in_ext = (const VkPhysicalDeviceVariablePointersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures32 *in_ext = (const VkPhysicalDeviceMultiviewFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures32 *in_ext = (const VkPhysicalDevice16BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures32 *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures32 *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features32 *in_ext = (const VkPhysicalDeviceMaintenance4Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: - { - VkPhysicalDeviceMaintenance5FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5FeaturesKHR32 *in_ext = (const VkPhysicalDeviceMaintenance5FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures32 *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features32 *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures32 *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures32 *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures32 *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures32 *in_ext = (const VkPhysicalDevice8BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures32 *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features32 *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures32 *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures32 *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV32 *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: - { - VkPhysicalDeviceIndexTypeUint8FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 *in_ext = (const VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures32 *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: - { - VkPhysicalDeviceLineRasterizationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLineRasterizationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features32 *in_ext = (const VkPhysicalDeviceVulkan11Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features32 *in_ext = (const VkPhysicalDeviceVulkan12Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features32 *in_ext = (const VkPhysicalDeviceVulkan13Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures32 *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features32 *in_ext = (const VkPhysicalDeviceSynchronization2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT: - { - VkPhysicalDeviceHostImageCopyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeaturesEXT32 *in_ext = (const VkPhysicalDeviceHostImageCopyFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineRobustnessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV32 *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceFeatures2_host_to_win32(const VkPhysicalDeviceFeatures2 *in, VkPhysicalDeviceFeatures232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->features = in->features; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES); - const VkPhysicalDevicePrivateDataFeatures *in_ext = (const VkPhysicalDevicePrivateDataFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->privateData = in_ext->privateData; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES); - const VkPhysicalDeviceVariablePointersFeatures *in_ext = (const VkPhysicalDeviceVariablePointersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES); - const VkPhysicalDeviceMultiviewFeatures *in_ext = (const VkPhysicalDeviceMultiviewFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR); - const VkPhysicalDevicePresentIdFeaturesKHR *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->presentId = in_ext->presentId; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR); - const VkPhysicalDevicePresentWaitFeaturesKHR *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->presentWait = in_ext->presentWait; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES); - const VkPhysicalDevice16BitStorageFeatures *in_ext = (const VkPhysicalDevice16BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES); - const VkPhysicalDeviceProtectedMemoryFeatures *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT); - const VkPhysicalDeviceMultiDrawFeaturesEXT *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->multiDraw = in_ext->multiDraw; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES); - const VkPhysicalDeviceInlineUniformBlockFeatures *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES); - const VkPhysicalDeviceMaintenance4Features *in_ext = (const VkPhysicalDeviceMaintenance4Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->maintenance4 = in_ext->maintenance4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: - { - VkPhysicalDeviceMaintenance5FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR); - const VkPhysicalDeviceMaintenance5FeaturesKHR *in_ext = (const VkPhysicalDeviceMaintenance5FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; - out_ext->maintenance5 = in_ext->maintenance5; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES); - const VkPhysicalDeviceShaderDrawParametersFeatures *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES); - const VkPhysicalDeviceShaderFloat16Int8Features *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES); - const VkPhysicalDeviceHostQueryResetFeatures *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR); - const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES); - const VkPhysicalDeviceDescriptorIndexingFeatures *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES); - const VkPhysicalDeviceTimelineSemaphoreFeatures *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES); - const VkPhysicalDevice8BitStorageFeatures *in_ext = (const VkPhysicalDevice8BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES); - const VkPhysicalDeviceVulkanMemoryModelFeatures *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES); - const VkPhysicalDeviceShaderAtomicInt64Features *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT); - const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT); - const VkPhysicalDeviceASTCDecodeFeaturesEXT *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV); - const VkPhysicalDeviceExclusiveScissorFeaturesNV *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV); - const VkPhysicalDeviceCornerSampledImageFeaturesNV *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV); - const VkPhysicalDeviceShadingRateImageFeaturesNV *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->invocationMask = in_ext->invocationMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV); - const VkPhysicalDeviceMeshShaderFeaturesNV *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT); - const VkPhysicalDeviceMeshShaderFeaturesEXT *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR); - const VkPhysicalDeviceRayQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->rayQuery = in_ext->rayQuery; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES); - const VkPhysicalDeviceScalarBlockLayoutFeatures *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES); - const VkPhysicalDeviceBufferDeviceAddressFeatures *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES); - const VkPhysicalDeviceImagelessFramebufferFeatures *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV); - const VkPhysicalDevicePresentBarrierFeaturesNV *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR); - const VkPhysicalDevicePerformanceQueryFeaturesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR); - const VkPhysicalDeviceShaderClockFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: - { - VkPhysicalDeviceIndexTypeUint8FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT); - const VkPhysicalDeviceIndexTypeUint8FeaturesEXT *in_ext = (const VkPhysicalDeviceIndexTypeUint8FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES); - const VkPhysicalDeviceSubgroupSizeControlFeatures *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: - { - VkPhysicalDeviceLineRasterizationFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT); - const VkPhysicalDeviceLineRasterizationFeaturesEXT *in_ext = (const VkPhysicalDeviceLineRasterizationFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES); - const VkPhysicalDevicePipelineCreationCacheControlFeatures *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES); - const VkPhysicalDeviceVulkan11Features *in_ext = (const VkPhysicalDeviceVulkan11Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES); - const VkPhysicalDeviceVulkan12Features *in_ext = (const VkPhysicalDeviceVulkan12Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES); - const VkPhysicalDeviceVulkan13Features *in_ext = (const VkPhysicalDeviceVulkan13Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT); - const VkPhysicalDeviceRobustness2FeaturesEXT *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES); - const VkPhysicalDeviceImageRobustnessFeatures *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT); - const VkPhysicalDevice4444FormatsFeaturesEXT *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->subpassShading = in_ext->subpassShading; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES); - const VkPhysicalDeviceShaderTerminateInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceDepthClipControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES); - const VkPhysicalDeviceSynchronization2Features *in_ext = (const VkPhysicalDeviceSynchronization2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->synchronization2 = in_ext->synchronization2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT: - { - VkPhysicalDeviceHostImageCopyFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT); - const VkPhysicalDeviceHostImageCopyFeaturesEXT *in_ext = (const VkPhysicalDeviceHostImageCopyFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT); - const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT); - const VkPhysicalDeviceProvokingVertexFeaturesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES); - const VkPhysicalDeviceShaderIntegerDotProductFeatures *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES); - const VkPhysicalDeviceDynamicRenderingFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->minLod = in_ext->minLod; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDevicePipelineRobustnessFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT); - const VkPhysicalDevicePipelineRobustnessFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineRobustnessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM); - const VkPhysicalDeviceImageProcessingFeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->tileProperties = in_ext->tileProperties; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV); - const VkPhysicalDeviceOpticalFlowFeaturesNV *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT); - const VkPhysicalDeviceFaultFeaturesEXT *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT); - const VkPhysicalDeviceShaderObjectFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->shaderObject = in_ext->shaderObject; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT); - const VkPhysicalDeviceShaderTileImageFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM); - const VkPhysicalDeviceCubicClampFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM); - const VkPhysicalDeviceSchedulingControlsFeaturesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkFormatProperties2_win32_to_host(struct conversion_context *ctx, const VkFormatProperties232 *in, VkFormatProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: - { - VkSubpassResolvePerformanceQueryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: - { - VkFormatProperties3 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkFormatProperties2_host_to_win32(const VkFormatProperties2 *in, VkFormatProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->formatProperties = in->formatProperties; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: - { - VkSubpassResolvePerformanceQueryEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT); - const VkSubpassResolvePerformanceQueryEXT *in_ext = (const VkSubpassResolvePerformanceQueryEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT; - out_ext->optimal = in_ext->optimal; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: - { - VkFormatProperties332 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3); - const VkFormatProperties3 *in_ext = (const VkFormatProperties3 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3; - out_ext->linearTilingFeatures = in_ext->linearTilingFeatures; - out_ext->optimalTilingFeatures = in_ext->optimalTilingFeatures; - out_ext->bufferFeatures = in_ext->bufferFeatures; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_win32_to_host(const VkPhysicalDeviceFragmentShadingRateKHR32 *in, VkPhysicalDeviceFragmentShadingRateKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_host_to_win32(const VkPhysicalDeviceFragmentShadingRateKHR *in, VkPhysicalDeviceFragmentShadingRateKHR32 *out) -{ - if (!in) return; - - out->sampleCounts = in->sampleCounts; - out->fragmentSize = in->fragmentSize; -} - -static inline VkPhysicalDeviceFragmentShadingRateKHR *convert_VkPhysicalDeviceFragmentShadingRateKHR_array_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceFragmentShadingRateKHR32 *in, uint32_t count) -{ - VkPhysicalDeviceFragmentShadingRateKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceFragmentShadingRateKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_array_host_to_win32(const VkPhysicalDeviceFragmentShadingRateKHR *in, VkPhysicalDeviceFragmentShadingRateKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceFragmentShadingRateKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageFormatProperties_host_to_win32(const VkImageFormatProperties *in, VkImageFormatProperties32 *out) -{ - if (!in) return; - - out->maxExtent = in->maxExtent; - out->maxMipLevels = in->maxMipLevels; - out->maxArrayLayers = in->maxArrayLayers; - out->sampleCounts = in->sampleCounts; - out->maxResourceSize = in->maxResourceSize; -} - -static inline void convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceImageFormatInfo232 *in, VkPhysicalDeviceImageFormatInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->type = in->type; - out->tiling = in->tiling; - out->usage = in->usage; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: - { - VkPhysicalDeviceExternalImageFormatInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExternalImageFormatInfo32 *in_ext = (const VkPhysicalDeviceExternalImageFormatInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = (const VkFormat *)UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: - { - VkImageStencilUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageStencilUsageCreateInfo32 *in_ext = (const VkImageStencilUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->stencilUsage = in_ext->stencilUsage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: - { - VkPhysicalDeviceImageViewImageFormatInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewImageFormatInfoEXT32 *in_ext = (const VkPhysicalDeviceImageViewImageFormatInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT; - out_ext->pNext = NULL; - out_ext->imageViewType = in_ext->imageViewType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = (VkImageCompressionFixedRateFlagsEXT *)UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: - { - VkOpticalFlowImageFormatInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowImageFormatInfoNV32 *in_ext = (const VkOpticalFlowImageFormatInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageFormatProperties2_win32_to_host(struct conversion_context *ctx, const VkImageFormatProperties232 *in, VkImageFormatProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: - { - VkExternalImageFormatProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: - { - VkSamplerYcbcrConversionImageFormatProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: - { - VkTextureLODGatherFormatPropertiesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: - { - VkFilterCubicImageViewImageFormatPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT: - { - VkHostImageCopyDevicePerformanceQueryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageFormatProperties2_host_to_win32(const VkImageFormatProperties2 *in, VkImageFormatProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkImageFormatProperties_host_to_win32(&in->imageFormatProperties, &out->imageFormatProperties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: - { - VkExternalImageFormatProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES); - const VkExternalImageFormatProperties *in_ext = (const VkExternalImageFormatProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES; - out_ext->externalMemoryProperties = in_ext->externalMemoryProperties; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: - { - VkSamplerYcbcrConversionImageFormatProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES); - const VkSamplerYcbcrConversionImageFormatProperties *in_ext = (const VkSamplerYcbcrConversionImageFormatProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES; - out_ext->combinedImageSamplerDescriptorCount = in_ext->combinedImageSamplerDescriptorCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: - { - VkTextureLODGatherFormatPropertiesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD); - const VkTextureLODGatherFormatPropertiesAMD *in_ext = (const VkTextureLODGatherFormatPropertiesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - out_ext->supportsTextureGatherLODBiasAMD = in_ext->supportsTextureGatherLODBiasAMD; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: - { - VkFilterCubicImageViewImageFormatPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT); - const VkFilterCubicImageViewImageFormatPropertiesEXT *in_ext = (const VkFilterCubicImageViewImageFormatPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT; - out_ext->filterCubic = in_ext->filterCubic; - out_ext->filterCubicMinmax = in_ext->filterCubicMinmax; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT: - { - VkHostImageCopyDevicePerformanceQueryEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT); - const VkHostImageCopyDevicePerformanceQueryEXT *in_ext = (const VkHostImageCopyDevicePerformanceQueryEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT; - out_ext->optimalDeviceAccess = in_ext->optimalDeviceAccess; - out_ext->identicalMemoryLayout = in_ext->identicalMemoryLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkMemoryHeap_host_to_win32(const VkMemoryHeap *in, VkMemoryHeap32 *out) -{ - if (!in) return; - - out->size = in->size; - out->flags = in->flags; -} - -static inline void convert_VkMemoryHeap_array_host_to_win32(const VkMemoryHeap *in, VkMemoryHeap32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkMemoryHeap_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceMemoryProperties_host_to_win32(const VkPhysicalDeviceMemoryProperties *in, VkPhysicalDeviceMemoryProperties32 *out) -{ - if (!in) return; - - out->memoryTypeCount = in->memoryTypeCount; - memcpy(out->memoryTypes, in->memoryTypes, VK_MAX_MEMORY_TYPES * sizeof(VkMemoryType)); - out->memoryHeapCount = in->memoryHeapCount; - convert_VkMemoryHeap_array_host_to_win32(in->memoryHeaps, out->memoryHeaps, VK_MAX_MEMORY_HEAPS); -} - -static inline void convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceMemoryProperties232 *in, VkPhysicalDeviceMemoryProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: - { - VkPhysicalDeviceMemoryBudgetPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(const VkPhysicalDeviceMemoryProperties2 *in, VkPhysicalDeviceMemoryProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkPhysicalDeviceMemoryProperties_host_to_win32(&in->memoryProperties, &out->memoryProperties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: - { - VkPhysicalDeviceMemoryBudgetPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT); - const VkPhysicalDeviceMemoryBudgetPropertiesEXT *in_ext = (const VkPhysicalDeviceMemoryBudgetPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; - memcpy(out_ext->heapBudget, in_ext->heapBudget, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize)); - memcpy(out_ext->heapUsage, in_ext->heapUsage, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize)); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkMultisamplePropertiesEXT_win32_to_host(const VkMultisamplePropertiesEXT32 *in, VkMultisamplePropertiesEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMultisamplePropertiesEXT_host_to_win32(const VkMultisamplePropertiesEXT *in, VkMultisamplePropertiesEXT32 *out) -{ - if (!in) return; - - out->maxSampleLocationGridSize = in->maxSampleLocationGridSize; -} - -static inline void convert_VkOpticalFlowImageFormatInfoNV_win32_to_host(const VkOpticalFlowImageFormatInfoNV32 *in, VkOpticalFlowImageFormatInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->usage = in->usage; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_win32_to_host(const VkOpticalFlowImageFormatPropertiesNV32 *in, VkOpticalFlowImageFormatPropertiesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_host_to_win32(const VkOpticalFlowImageFormatPropertiesNV *in, VkOpticalFlowImageFormatPropertiesNV32 *out) -{ - if (!in) return; - - out->format = in->format; -} - -static inline VkOpticalFlowImageFormatPropertiesNV *convert_VkOpticalFlowImageFormatPropertiesNV_array_win32_to_host(struct conversion_context *ctx, const VkOpticalFlowImageFormatPropertiesNV32 *in, uint32_t count) -{ - VkOpticalFlowImageFormatPropertiesNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkOpticalFlowImageFormatPropertiesNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_array_host_to_win32(const VkOpticalFlowImageFormatPropertiesNV *in, VkOpticalFlowImageFormatPropertiesNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkOpticalFlowImageFormatPropertiesNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceLimits_host_to_win32(const VkPhysicalDeviceLimits *in, VkPhysicalDeviceLimits32 *out) -{ - if (!in) return; - - out->maxImageDimension1D = in->maxImageDimension1D; - out->maxImageDimension2D = in->maxImageDimension2D; - out->maxImageDimension3D = in->maxImageDimension3D; - out->maxImageDimensionCube = in->maxImageDimensionCube; - out->maxImageArrayLayers = in->maxImageArrayLayers; - out->maxTexelBufferElements = in->maxTexelBufferElements; - out->maxUniformBufferRange = in->maxUniformBufferRange; - out->maxStorageBufferRange = in->maxStorageBufferRange; - out->maxPushConstantsSize = in->maxPushConstantsSize; - out->maxMemoryAllocationCount = in->maxMemoryAllocationCount; - out->maxSamplerAllocationCount = in->maxSamplerAllocationCount; - out->bufferImageGranularity = in->bufferImageGranularity; - out->sparseAddressSpaceSize = in->sparseAddressSpaceSize; - out->maxBoundDescriptorSets = in->maxBoundDescriptorSets; - out->maxPerStageDescriptorSamplers = in->maxPerStageDescriptorSamplers; - out->maxPerStageDescriptorUniformBuffers = in->maxPerStageDescriptorUniformBuffers; - out->maxPerStageDescriptorStorageBuffers = in->maxPerStageDescriptorStorageBuffers; - out->maxPerStageDescriptorSampledImages = in->maxPerStageDescriptorSampledImages; - out->maxPerStageDescriptorStorageImages = in->maxPerStageDescriptorStorageImages; - out->maxPerStageDescriptorInputAttachments = in->maxPerStageDescriptorInputAttachments; - out->maxPerStageResources = in->maxPerStageResources; - out->maxDescriptorSetSamplers = in->maxDescriptorSetSamplers; - out->maxDescriptorSetUniformBuffers = in->maxDescriptorSetUniformBuffers; - out->maxDescriptorSetUniformBuffersDynamic = in->maxDescriptorSetUniformBuffersDynamic; - out->maxDescriptorSetStorageBuffers = in->maxDescriptorSetStorageBuffers; - out->maxDescriptorSetStorageBuffersDynamic = in->maxDescriptorSetStorageBuffersDynamic; - out->maxDescriptorSetSampledImages = in->maxDescriptorSetSampledImages; - out->maxDescriptorSetStorageImages = in->maxDescriptorSetStorageImages; - out->maxDescriptorSetInputAttachments = in->maxDescriptorSetInputAttachments; - out->maxVertexInputAttributes = in->maxVertexInputAttributes; - out->maxVertexInputBindings = in->maxVertexInputBindings; - out->maxVertexInputAttributeOffset = in->maxVertexInputAttributeOffset; - out->maxVertexInputBindingStride = in->maxVertexInputBindingStride; - out->maxVertexOutputComponents = in->maxVertexOutputComponents; - out->maxTessellationGenerationLevel = in->maxTessellationGenerationLevel; - out->maxTessellationPatchSize = in->maxTessellationPatchSize; - out->maxTessellationControlPerVertexInputComponents = in->maxTessellationControlPerVertexInputComponents; - out->maxTessellationControlPerVertexOutputComponents = in->maxTessellationControlPerVertexOutputComponents; - out->maxTessellationControlPerPatchOutputComponents = in->maxTessellationControlPerPatchOutputComponents; - out->maxTessellationControlTotalOutputComponents = in->maxTessellationControlTotalOutputComponents; - out->maxTessellationEvaluationInputComponents = in->maxTessellationEvaluationInputComponents; - out->maxTessellationEvaluationOutputComponents = in->maxTessellationEvaluationOutputComponents; - out->maxGeometryShaderInvocations = in->maxGeometryShaderInvocations; - out->maxGeometryInputComponents = in->maxGeometryInputComponents; - out->maxGeometryOutputComponents = in->maxGeometryOutputComponents; - out->maxGeometryOutputVertices = in->maxGeometryOutputVertices; - out->maxGeometryTotalOutputComponents = in->maxGeometryTotalOutputComponents; - out->maxFragmentInputComponents = in->maxFragmentInputComponents; - out->maxFragmentOutputAttachments = in->maxFragmentOutputAttachments; - out->maxFragmentDualSrcAttachments = in->maxFragmentDualSrcAttachments; - out->maxFragmentCombinedOutputResources = in->maxFragmentCombinedOutputResources; - out->maxComputeSharedMemorySize = in->maxComputeSharedMemorySize; - memcpy(out->maxComputeWorkGroupCount, in->maxComputeWorkGroupCount, 3 * sizeof(uint32_t)); - out->maxComputeWorkGroupInvocations = in->maxComputeWorkGroupInvocations; - memcpy(out->maxComputeWorkGroupSize, in->maxComputeWorkGroupSize, 3 * sizeof(uint32_t)); - out->subPixelPrecisionBits = in->subPixelPrecisionBits; - out->subTexelPrecisionBits = in->subTexelPrecisionBits; - out->mipmapPrecisionBits = in->mipmapPrecisionBits; - out->maxDrawIndexedIndexValue = in->maxDrawIndexedIndexValue; - out->maxDrawIndirectCount = in->maxDrawIndirectCount; - out->maxSamplerLodBias = in->maxSamplerLodBias; - out->maxSamplerAnisotropy = in->maxSamplerAnisotropy; - out->maxViewports = in->maxViewports; - memcpy(out->maxViewportDimensions, in->maxViewportDimensions, 2 * sizeof(uint32_t)); - memcpy(out->viewportBoundsRange, in->viewportBoundsRange, 2 * sizeof(float)); - out->viewportSubPixelBits = in->viewportSubPixelBits; - out->minMemoryMapAlignment = in->minMemoryMapAlignment; - out->minTexelBufferOffsetAlignment = in->minTexelBufferOffsetAlignment; - out->minUniformBufferOffsetAlignment = in->minUniformBufferOffsetAlignment; - out->minStorageBufferOffsetAlignment = in->minStorageBufferOffsetAlignment; - out->minTexelOffset = in->minTexelOffset; - out->maxTexelOffset = in->maxTexelOffset; - out->minTexelGatherOffset = in->minTexelGatherOffset; - out->maxTexelGatherOffset = in->maxTexelGatherOffset; - out->minInterpolationOffset = in->minInterpolationOffset; - out->maxInterpolationOffset = in->maxInterpolationOffset; - out->subPixelInterpolationOffsetBits = in->subPixelInterpolationOffsetBits; - out->maxFramebufferWidth = in->maxFramebufferWidth; - out->maxFramebufferHeight = in->maxFramebufferHeight; - out->maxFramebufferLayers = in->maxFramebufferLayers; - out->framebufferColorSampleCounts = in->framebufferColorSampleCounts; - out->framebufferDepthSampleCounts = in->framebufferDepthSampleCounts; - out->framebufferStencilSampleCounts = in->framebufferStencilSampleCounts; - out->framebufferNoAttachmentsSampleCounts = in->framebufferNoAttachmentsSampleCounts; - out->maxColorAttachments = in->maxColorAttachments; - out->sampledImageColorSampleCounts = in->sampledImageColorSampleCounts; - out->sampledImageIntegerSampleCounts = in->sampledImageIntegerSampleCounts; - out->sampledImageDepthSampleCounts = in->sampledImageDepthSampleCounts; - out->sampledImageStencilSampleCounts = in->sampledImageStencilSampleCounts; - out->storageImageSampleCounts = in->storageImageSampleCounts; - out->maxSampleMaskWords = in->maxSampleMaskWords; - out->timestampComputeAndGraphics = in->timestampComputeAndGraphics; - out->timestampPeriod = in->timestampPeriod; - out->maxClipDistances = in->maxClipDistances; - out->maxCullDistances = in->maxCullDistances; - out->maxCombinedClipAndCullDistances = in->maxCombinedClipAndCullDistances; - out->discreteQueuePriorities = in->discreteQueuePriorities; - memcpy(out->pointSizeRange, in->pointSizeRange, 2 * sizeof(float)); - memcpy(out->lineWidthRange, in->lineWidthRange, 2 * sizeof(float)); - out->pointSizeGranularity = in->pointSizeGranularity; - out->lineWidthGranularity = in->lineWidthGranularity; - out->strictLines = in->strictLines; - out->standardSampleLocations = in->standardSampleLocations; - out->optimalBufferCopyOffsetAlignment = in->optimalBufferCopyOffsetAlignment; - out->optimalBufferCopyRowPitchAlignment = in->optimalBufferCopyRowPitchAlignment; - out->nonCoherentAtomSize = in->nonCoherentAtomSize; -} - -static inline void convert_VkPhysicalDeviceProperties_host_to_win32(const VkPhysicalDeviceProperties *in, VkPhysicalDeviceProperties32 *out) -{ - if (!in) return; - - out->apiVersion = in->apiVersion; - out->driverVersion = in->driverVersion; - out->vendorID = in->vendorID; - out->deviceID = in->deviceID; - out->deviceType = in->deviceType; - memcpy(out->deviceName, in->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char)); - memcpy(out->pipelineCacheUUID, in->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t)); - convert_VkPhysicalDeviceLimits_host_to_win32(&in->limits, &out->limits); - out->sparseProperties = in->sparseProperties; -} - -static inline void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceProperties232 *in, VkPhysicalDeviceProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: - { - VkPhysicalDeviceMultiDrawPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: - { - VkPhysicalDevicePushDescriptorPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: - { - VkPhysicalDeviceDriverProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: - { - VkPhysicalDeviceIDProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: - { - VkPhysicalDeviceMultiviewProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: - { - VkPhysicalDeviceDiscardRectanglePropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: - { - VkPhysicalDeviceSubgroupProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: - { - VkPhysicalDevicePointClippingProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: - { - VkPhysicalDeviceProtectedMemoryProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: - { - VkPhysicalDeviceSamplerFilterMinmaxProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: - { - VkPhysicalDeviceSampleLocationsPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: - { - VkPhysicalDeviceInlineUniformBlockProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: - { - VkPhysicalDeviceMaintenance3Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: - { - VkPhysicalDeviceMaintenance4Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR: - { - VkPhysicalDeviceMaintenance5PropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: - { - VkPhysicalDeviceFloatControlsProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: - { - VkPhysicalDeviceExternalMemoryHostPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceConservativeRasterizationPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: - { - VkPhysicalDeviceShaderCorePropertiesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: - { - VkPhysicalDeviceShaderCoreProperties2AMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: - { - VkPhysicalDeviceDescriptorIndexingProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: - { - VkPhysicalDeviceTimelineSemaphoreProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: - { - VkPhysicalDevicePCIBusInfoPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: - { - VkPhysicalDeviceDepthStencilResolveProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: - { - VkPhysicalDeviceTransformFeedbackPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: - { - VkPhysicalDeviceMemoryDecompressionPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: - { - VkPhysicalDeviceShadingRateImagePropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: - { - VkPhysicalDeviceMeshShaderPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: - { - VkPhysicalDeviceMeshShaderPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: - { - VkPhysicalDeviceAccelerationStructurePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: - { - VkPhysicalDeviceRayTracingPipelinePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrixPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: - { - VkPhysicalDevicePerformanceQueryPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: - { - VkPhysicalDeviceTexelBufferAlignmentProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: - { - VkPhysicalDeviceSubgroupSizeControlProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceLineRasterizationPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: - { - VkPhysicalDeviceVulkan11Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: - { - VkPhysicalDeviceVulkan12Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: - { - VkPhysicalDeviceVulkan13Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: - { - VkPhysicalDeviceCustomBorderColorPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicPrimitiveTopologyUnrestricted = in_ext->dynamicPrimitiveTopologyUnrestricted; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: - { - VkPhysicalDeviceRobustness2PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShadingRatePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_ext->maxFragmentShadingRateInvocationCount = in_ext->maxFragmentShadingRateInvocationCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT: - { - VkPhysicalDeviceHostImageCopyPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyPropertiesEXT32 *in_ext = (const VkPhysicalDeviceHostImageCopyPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->copySrcLayoutCount = in_ext->copySrcLayoutCount; - out_ext->pCopySrcLayouts = (VkImageLayout *)UlongToPtr(in_ext->pCopySrcLayouts); - out_ext->copyDstLayoutCount = in_ext->copyDstLayoutCount; - out_ext->pCopyDstLayouts = (VkImageLayout *)UlongToPtr(in_ext->pCopyDstLayouts); - memcpy(out_ext->optimalTilingLayoutUUID, in_ext->optimalTilingLayoutUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->identicalMemoryTypeRequirements = in_ext->identicalMemoryTypeRequirements; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: - { - VkPhysicalDeviceProvokingVertexPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: - { - VkPhysicalDeviceShaderIntegerDotProductProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibraryFastLinking = in_ext->graphicsPipelineLibraryFastLinking; - out_ext->graphicsPipelineLibraryIndependentInterpolationDecoration = in_ext->graphicsPipelineLibraryIndependentInterpolationDecoration; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceNestedCommandBufferPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->maxCommandBufferNestingLevel = in_ext->maxCommandBufferNestingLevel; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: - { - VkPhysicalDeviceOpacityMicromapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT: - { - VkPhysicalDevicePipelineRobustnessPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessingPropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: - { - VkPhysicalDeviceOpticalFlowPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCorePropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderObjectPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderTileImagePropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR: - { - VkPhysicalDeviceCooperativeMatrixPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessing2PropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: - { - VkPhysicalDeviceLayeredDriverPropertiesMSFT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: - { - VkPhysicalDeviceCudaKernelLaunchPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM: - { - VkPhysicalDeviceSchedulingControlsPropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsPropertiesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsPropertiesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControlsFlags = in_ext->schedulingControlsFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceProperties2_host_to_win32(const VkPhysicalDeviceProperties2 *in, VkPhysicalDeviceProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkPhysicalDeviceProperties_host_to_win32(&in->properties, &out->properties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV; - out_ext->maxGraphicsShaderGroupCount = in_ext->maxGraphicsShaderGroupCount; - out_ext->maxIndirectSequenceCount = in_ext->maxIndirectSequenceCount; - out_ext->maxIndirectCommandsTokenCount = in_ext->maxIndirectCommandsTokenCount; - out_ext->maxIndirectCommandsStreamCount = in_ext->maxIndirectCommandsStreamCount; - out_ext->maxIndirectCommandsTokenOffset = in_ext->maxIndirectCommandsTokenOffset; - out_ext->maxIndirectCommandsStreamStride = in_ext->maxIndirectCommandsStreamStride; - out_ext->minSequencesCountBufferOffsetAlignment = in_ext->minSequencesCountBufferOffsetAlignment; - out_ext->minSequencesIndexBufferOffsetAlignment = in_ext->minSequencesIndexBufferOffsetAlignment; - out_ext->minIndirectCommandsBufferOffsetAlignment = in_ext->minIndirectCommandsBufferOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: - { - VkPhysicalDeviceMultiDrawPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT); - const VkPhysicalDeviceMultiDrawPropertiesEXT *in_ext = (const VkPhysicalDeviceMultiDrawPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT; - out_ext->maxMultiDrawCount = in_ext->maxMultiDrawCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: - { - VkPhysicalDevicePushDescriptorPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR); - const VkPhysicalDevicePushDescriptorPropertiesKHR *in_ext = (const VkPhysicalDevicePushDescriptorPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR; - out_ext->maxPushDescriptors = in_ext->maxPushDescriptors; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: - { - VkPhysicalDeviceDriverProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES); - const VkPhysicalDeviceDriverProperties *in_ext = (const VkPhysicalDeviceDriverProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; - out_ext->driverID = in_ext->driverID; - memcpy(out_ext->driverName, in_ext->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char)); - memcpy(out_ext->driverInfo, in_ext->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char)); - out_ext->conformanceVersion = in_ext->conformanceVersion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: - { - VkPhysicalDeviceIDProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES); - const VkPhysicalDeviceIDProperties *in_ext = (const VkPhysicalDeviceIDProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; - memcpy(out_ext->deviceUUID, in_ext->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->driverUUID, in_ext->driverUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->deviceLUID, in_ext->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t)); - out_ext->deviceNodeMask = in_ext->deviceNodeMask; - out_ext->deviceLUIDValid = in_ext->deviceLUIDValid; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: - { - VkPhysicalDeviceMultiviewProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES); - const VkPhysicalDeviceMultiviewProperties *in_ext = (const VkPhysicalDeviceMultiviewProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; - out_ext->maxMultiviewViewCount = in_ext->maxMultiviewViewCount; - out_ext->maxMultiviewInstanceIndex = in_ext->maxMultiviewInstanceIndex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: - { - VkPhysicalDeviceDiscardRectanglePropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT); - const VkPhysicalDeviceDiscardRectanglePropertiesEXT *in_ext = (const VkPhysicalDeviceDiscardRectanglePropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT; - out_ext->maxDiscardRectangles = in_ext->maxDiscardRectangles; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: - { - VkPhysicalDeviceSubgroupProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES); - const VkPhysicalDeviceSubgroupProperties *in_ext = (const VkPhysicalDeviceSubgroupProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; - out_ext->subgroupSize = in_ext->subgroupSize; - out_ext->supportedStages = in_ext->supportedStages; - out_ext->supportedOperations = in_ext->supportedOperations; - out_ext->quadOperationsInAllStages = in_ext->quadOperationsInAllStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: - { - VkPhysicalDevicePointClippingProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES); - const VkPhysicalDevicePointClippingProperties *in_ext = (const VkPhysicalDevicePointClippingProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES; - out_ext->pointClippingBehavior = in_ext->pointClippingBehavior; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: - { - VkPhysicalDeviceProtectedMemoryProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES); - const VkPhysicalDeviceProtectedMemoryProperties *in_ext = (const VkPhysicalDeviceProtectedMemoryProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; - out_ext->protectedNoFault = in_ext->protectedNoFault; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: - { - VkPhysicalDeviceSamplerFilterMinmaxProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES); - const VkPhysicalDeviceSamplerFilterMinmaxProperties *in_ext = (const VkPhysicalDeviceSamplerFilterMinmaxProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES; - out_ext->filterMinmaxSingleComponentFormats = in_ext->filterMinmaxSingleComponentFormats; - out_ext->filterMinmaxImageComponentMapping = in_ext->filterMinmaxImageComponentMapping; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: - { - VkPhysicalDeviceSampleLocationsPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT); - const VkPhysicalDeviceSampleLocationsPropertiesEXT *in_ext = (const VkPhysicalDeviceSampleLocationsPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT; - out_ext->sampleLocationSampleCounts = in_ext->sampleLocationSampleCounts; - out_ext->maxSampleLocationGridSize = in_ext->maxSampleLocationGridSize; - memcpy(out_ext->sampleLocationCoordinateRange, in_ext->sampleLocationCoordinateRange, 2 * sizeof(float)); - out_ext->sampleLocationSubPixelBits = in_ext->sampleLocationSubPixelBits; - out_ext->variableSampleLocations = in_ext->variableSampleLocations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT); - const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT; - out_ext->advancedBlendMaxColorAttachments = in_ext->advancedBlendMaxColorAttachments; - out_ext->advancedBlendIndependentBlend = in_ext->advancedBlendIndependentBlend; - out_ext->advancedBlendNonPremultipliedSrcColor = in_ext->advancedBlendNonPremultipliedSrcColor; - out_ext->advancedBlendNonPremultipliedDstColor = in_ext->advancedBlendNonPremultipliedDstColor; - out_ext->advancedBlendCorrelatedOverlap = in_ext->advancedBlendCorrelatedOverlap; - out_ext->advancedBlendAllOperations = in_ext->advancedBlendAllOperations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: - { - VkPhysicalDeviceInlineUniformBlockProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES); - const VkPhysicalDeviceInlineUniformBlockProperties *in_ext = (const VkPhysicalDeviceInlineUniformBlockProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; - out_ext->maxInlineUniformBlockSize = in_ext->maxInlineUniformBlockSize; - out_ext->maxPerStageDescriptorInlineUniformBlocks = in_ext->maxPerStageDescriptorInlineUniformBlocks; - out_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = in_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - out_ext->maxDescriptorSetInlineUniformBlocks = in_ext->maxDescriptorSetInlineUniformBlocks; - out_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = in_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: - { - VkPhysicalDeviceMaintenance3Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES); - const VkPhysicalDeviceMaintenance3Properties *in_ext = (const VkPhysicalDeviceMaintenance3Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; - out_ext->maxPerSetDescriptors = in_ext->maxPerSetDescriptors; - out_ext->maxMemoryAllocationSize = in_ext->maxMemoryAllocationSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: - { - VkPhysicalDeviceMaintenance4Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES); - const VkPhysicalDeviceMaintenance4Properties *in_ext = (const VkPhysicalDeviceMaintenance4Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; - out_ext->maxBufferSize = in_ext->maxBufferSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR: - { - VkPhysicalDeviceMaintenance5PropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR); - const VkPhysicalDeviceMaintenance5PropertiesKHR *in_ext = (const VkPhysicalDeviceMaintenance5PropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR; - out_ext->earlyFragmentMultisampleCoverageAfterSampleCounting = in_ext->earlyFragmentMultisampleCoverageAfterSampleCounting; - out_ext->earlyFragmentSampleMaskTestBeforeSampleCounting = in_ext->earlyFragmentSampleMaskTestBeforeSampleCounting; - out_ext->depthStencilSwizzleOneSupport = in_ext->depthStencilSwizzleOneSupport; - out_ext->polygonModePointSize = in_ext->polygonModePointSize; - out_ext->nonStrictSinglePixelWideLinesUseParallelogram = in_ext->nonStrictSinglePixelWideLinesUseParallelogram; - out_ext->nonStrictWideLinesUseParallelogram = in_ext->nonStrictWideLinesUseParallelogram; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: - { - VkPhysicalDeviceFloatControlsProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES); - const VkPhysicalDeviceFloatControlsProperties *in_ext = (const VkPhysicalDeviceFloatControlsProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; - out_ext->denormBehaviorIndependence = in_ext->denormBehaviorIndependence; - out_ext->roundingModeIndependence = in_ext->roundingModeIndependence; - out_ext->shaderSignedZeroInfNanPreserveFloat16 = in_ext->shaderSignedZeroInfNanPreserveFloat16; - out_ext->shaderSignedZeroInfNanPreserveFloat32 = in_ext->shaderSignedZeroInfNanPreserveFloat32; - out_ext->shaderSignedZeroInfNanPreserveFloat64 = in_ext->shaderSignedZeroInfNanPreserveFloat64; - out_ext->shaderDenormPreserveFloat16 = in_ext->shaderDenormPreserveFloat16; - out_ext->shaderDenormPreserveFloat32 = in_ext->shaderDenormPreserveFloat32; - out_ext->shaderDenormPreserveFloat64 = in_ext->shaderDenormPreserveFloat64; - out_ext->shaderDenormFlushToZeroFloat16 = in_ext->shaderDenormFlushToZeroFloat16; - out_ext->shaderDenormFlushToZeroFloat32 = in_ext->shaderDenormFlushToZeroFloat32; - out_ext->shaderDenormFlushToZeroFloat64 = in_ext->shaderDenormFlushToZeroFloat64; - out_ext->shaderRoundingModeRTEFloat16 = in_ext->shaderRoundingModeRTEFloat16; - out_ext->shaderRoundingModeRTEFloat32 = in_ext->shaderRoundingModeRTEFloat32; - out_ext->shaderRoundingModeRTEFloat64 = in_ext->shaderRoundingModeRTEFloat64; - out_ext->shaderRoundingModeRTZFloat16 = in_ext->shaderRoundingModeRTZFloat16; - out_ext->shaderRoundingModeRTZFloat32 = in_ext->shaderRoundingModeRTZFloat32; - out_ext->shaderRoundingModeRTZFloat64 = in_ext->shaderRoundingModeRTZFloat64; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: - { - VkPhysicalDeviceExternalMemoryHostPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT); - const VkPhysicalDeviceExternalMemoryHostPropertiesEXT *in_ext = (const VkPhysicalDeviceExternalMemoryHostPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT; - out_ext->minImportedHostPointerAlignment = in_ext->minImportedHostPointerAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceConservativeRasterizationPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT); - const VkPhysicalDeviceConservativeRasterizationPropertiesEXT *in_ext = (const VkPhysicalDeviceConservativeRasterizationPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; - out_ext->primitiveOverestimationSize = in_ext->primitiveOverestimationSize; - out_ext->maxExtraPrimitiveOverestimationSize = in_ext->maxExtraPrimitiveOverestimationSize; - out_ext->extraPrimitiveOverestimationSizeGranularity = in_ext->extraPrimitiveOverestimationSizeGranularity; - out_ext->primitiveUnderestimation = in_ext->primitiveUnderestimation; - out_ext->conservativePointAndLineRasterization = in_ext->conservativePointAndLineRasterization; - out_ext->degenerateTrianglesRasterized = in_ext->degenerateTrianglesRasterized; - out_ext->degenerateLinesRasterized = in_ext->degenerateLinesRasterized; - out_ext->fullyCoveredFragmentShaderInputVariable = in_ext->fullyCoveredFragmentShaderInputVariable; - out_ext->conservativeRasterizationPostDepthCoverage = in_ext->conservativeRasterizationPostDepthCoverage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: - { - VkPhysicalDeviceShaderCorePropertiesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD); - const VkPhysicalDeviceShaderCorePropertiesAMD *in_ext = (const VkPhysicalDeviceShaderCorePropertiesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; - out_ext->shaderEngineCount = in_ext->shaderEngineCount; - out_ext->shaderArraysPerEngineCount = in_ext->shaderArraysPerEngineCount; - out_ext->computeUnitsPerShaderArray = in_ext->computeUnitsPerShaderArray; - out_ext->simdPerComputeUnit = in_ext->simdPerComputeUnit; - out_ext->wavefrontsPerSimd = in_ext->wavefrontsPerSimd; - out_ext->wavefrontSize = in_ext->wavefrontSize; - out_ext->sgprsPerSimd = in_ext->sgprsPerSimd; - out_ext->minSgprAllocation = in_ext->minSgprAllocation; - out_ext->maxSgprAllocation = in_ext->maxSgprAllocation; - out_ext->sgprAllocationGranularity = in_ext->sgprAllocationGranularity; - out_ext->vgprsPerSimd = in_ext->vgprsPerSimd; - out_ext->minVgprAllocation = in_ext->minVgprAllocation; - out_ext->maxVgprAllocation = in_ext->maxVgprAllocation; - out_ext->vgprAllocationGranularity = in_ext->vgprAllocationGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: - { - VkPhysicalDeviceShaderCoreProperties2AMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD); - const VkPhysicalDeviceShaderCoreProperties2AMD *in_ext = (const VkPhysicalDeviceShaderCoreProperties2AMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD; - out_ext->shaderCoreFeatures = in_ext->shaderCoreFeatures; - out_ext->activeComputeUnitCount = in_ext->activeComputeUnitCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: - { - VkPhysicalDeviceDescriptorIndexingProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES); - const VkPhysicalDeviceDescriptorIndexingProperties *in_ext = (const VkPhysicalDeviceDescriptorIndexingProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES; - out_ext->maxUpdateAfterBindDescriptorsInAllPools = in_ext->maxUpdateAfterBindDescriptorsInAllPools; - out_ext->shaderUniformBufferArrayNonUniformIndexingNative = in_ext->shaderUniformBufferArrayNonUniformIndexingNative; - out_ext->shaderSampledImageArrayNonUniformIndexingNative = in_ext->shaderSampledImageArrayNonUniformIndexingNative; - out_ext->shaderStorageBufferArrayNonUniformIndexingNative = in_ext->shaderStorageBufferArrayNonUniformIndexingNative; - out_ext->shaderStorageImageArrayNonUniformIndexingNative = in_ext->shaderStorageImageArrayNonUniformIndexingNative; - out_ext->shaderInputAttachmentArrayNonUniformIndexingNative = in_ext->shaderInputAttachmentArrayNonUniformIndexingNative; - out_ext->robustBufferAccessUpdateAfterBind = in_ext->robustBufferAccessUpdateAfterBind; - out_ext->quadDivergentImplicitLod = in_ext->quadDivergentImplicitLod; - out_ext->maxPerStageDescriptorUpdateAfterBindSamplers = in_ext->maxPerStageDescriptorUpdateAfterBindSamplers; - out_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindSampledImages = in_ext->maxPerStageDescriptorUpdateAfterBindSampledImages; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageImages = in_ext->maxPerStageDescriptorUpdateAfterBindStorageImages; - out_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments = in_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments; - out_ext->maxPerStageUpdateAfterBindResources = in_ext->maxPerStageUpdateAfterBindResources; - out_ext->maxDescriptorSetUpdateAfterBindSamplers = in_ext->maxDescriptorSetUpdateAfterBindSamplers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffers = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffers = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffers; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindSampledImages = in_ext->maxDescriptorSetUpdateAfterBindSampledImages; - out_ext->maxDescriptorSetUpdateAfterBindStorageImages = in_ext->maxDescriptorSetUpdateAfterBindStorageImages; - out_ext->maxDescriptorSetUpdateAfterBindInputAttachments = in_ext->maxDescriptorSetUpdateAfterBindInputAttachments; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: - { - VkPhysicalDeviceTimelineSemaphoreProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES); - const VkPhysicalDeviceTimelineSemaphoreProperties *in_ext = (const VkPhysicalDeviceTimelineSemaphoreProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; - out_ext->maxTimelineSemaphoreValueDifference = in_ext->maxTimelineSemaphoreValueDifference; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT); - const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; - out_ext->maxVertexAttribDivisor = in_ext->maxVertexAttribDivisor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: - { - VkPhysicalDevicePCIBusInfoPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT); - const VkPhysicalDevicePCIBusInfoPropertiesEXT *in_ext = (const VkPhysicalDevicePCIBusInfoPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; - out_ext->pciDomain = in_ext->pciDomain; - out_ext->pciBus = in_ext->pciBus; - out_ext->pciDevice = in_ext->pciDevice; - out_ext->pciFunction = in_ext->pciFunction; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: - { - VkPhysicalDeviceDepthStencilResolveProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES); - const VkPhysicalDeviceDepthStencilResolveProperties *in_ext = (const VkPhysicalDeviceDepthStencilResolveProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES; - out_ext->supportedDepthResolveModes = in_ext->supportedDepthResolveModes; - out_ext->supportedStencilResolveModes = in_ext->supportedStencilResolveModes; - out_ext->independentResolveNone = in_ext->independentResolveNone; - out_ext->independentResolve = in_ext->independentResolve; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: - { - VkPhysicalDeviceTransformFeedbackPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT); - const VkPhysicalDeviceTransformFeedbackPropertiesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; - out_ext->maxTransformFeedbackStreams = in_ext->maxTransformFeedbackStreams; - out_ext->maxTransformFeedbackBuffers = in_ext->maxTransformFeedbackBuffers; - out_ext->maxTransformFeedbackBufferSize = in_ext->maxTransformFeedbackBufferSize; - out_ext->maxTransformFeedbackStreamDataSize = in_ext->maxTransformFeedbackStreamDataSize; - out_ext->maxTransformFeedbackBufferDataSize = in_ext->maxTransformFeedbackBufferDataSize; - out_ext->maxTransformFeedbackBufferDataStride = in_ext->maxTransformFeedbackBufferDataStride; - out_ext->transformFeedbackQueries = in_ext->transformFeedbackQueries; - out_ext->transformFeedbackStreamsLinesTriangles = in_ext->transformFeedbackStreamsLinesTriangles; - out_ext->transformFeedbackRasterizationStreamSelect = in_ext->transformFeedbackRasterizationStreamSelect; - out_ext->transformFeedbackDraw = in_ext->transformFeedbackDraw; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV); - const VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV; - out_ext->supportedQueues = in_ext->supportedQueues; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: - { - VkPhysicalDeviceMemoryDecompressionPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV); - const VkPhysicalDeviceMemoryDecompressionPropertiesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV; - out_ext->decompressionMethods = in_ext->decompressionMethods; - out_ext->maxDecompressionIndirectCount = in_ext->maxDecompressionIndirectCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: - { - VkPhysicalDeviceShadingRateImagePropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV); - const VkPhysicalDeviceShadingRateImagePropertiesNV *in_ext = (const VkPhysicalDeviceShadingRateImagePropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV; - out_ext->shadingRateTexelSize = in_ext->shadingRateTexelSize; - out_ext->shadingRatePaletteSize = in_ext->shadingRatePaletteSize; - out_ext->shadingRateMaxCoarseSamples = in_ext->shadingRateMaxCoarseSamples; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: - { - VkPhysicalDeviceMeshShaderPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV); - const VkPhysicalDeviceMeshShaderPropertiesNV *in_ext = (const VkPhysicalDeviceMeshShaderPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV; - out_ext->maxDrawMeshTasksCount = in_ext->maxDrawMeshTasksCount; - out_ext->maxTaskWorkGroupInvocations = in_ext->maxTaskWorkGroupInvocations; - memcpy(out_ext->maxTaskWorkGroupSize, in_ext->maxTaskWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxTaskTotalMemorySize = in_ext->maxTaskTotalMemorySize; - out_ext->maxTaskOutputCount = in_ext->maxTaskOutputCount; - out_ext->maxMeshWorkGroupInvocations = in_ext->maxMeshWorkGroupInvocations; - memcpy(out_ext->maxMeshWorkGroupSize, in_ext->maxMeshWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxMeshTotalMemorySize = in_ext->maxMeshTotalMemorySize; - out_ext->maxMeshOutputVertices = in_ext->maxMeshOutputVertices; - out_ext->maxMeshOutputPrimitives = in_ext->maxMeshOutputPrimitives; - out_ext->maxMeshMultiviewViewCount = in_ext->maxMeshMultiviewViewCount; - out_ext->meshOutputPerVertexGranularity = in_ext->meshOutputPerVertexGranularity; - out_ext->meshOutputPerPrimitiveGranularity = in_ext->meshOutputPerPrimitiveGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: - { - VkPhysicalDeviceMeshShaderPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT); - const VkPhysicalDeviceMeshShaderPropertiesEXT *in_ext = (const VkPhysicalDeviceMeshShaderPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT; - out_ext->maxTaskWorkGroupTotalCount = in_ext->maxTaskWorkGroupTotalCount; - memcpy(out_ext->maxTaskWorkGroupCount, in_ext->maxTaskWorkGroupCount, 3 * sizeof(uint32_t)); - out_ext->maxTaskWorkGroupInvocations = in_ext->maxTaskWorkGroupInvocations; - memcpy(out_ext->maxTaskWorkGroupSize, in_ext->maxTaskWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxTaskPayloadSize = in_ext->maxTaskPayloadSize; - out_ext->maxTaskSharedMemorySize = in_ext->maxTaskSharedMemorySize; - out_ext->maxTaskPayloadAndSharedMemorySize = in_ext->maxTaskPayloadAndSharedMemorySize; - out_ext->maxMeshWorkGroupTotalCount = in_ext->maxMeshWorkGroupTotalCount; - memcpy(out_ext->maxMeshWorkGroupCount, in_ext->maxMeshWorkGroupCount, 3 * sizeof(uint32_t)); - out_ext->maxMeshWorkGroupInvocations = in_ext->maxMeshWorkGroupInvocations; - memcpy(out_ext->maxMeshWorkGroupSize, in_ext->maxMeshWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxMeshSharedMemorySize = in_ext->maxMeshSharedMemorySize; - out_ext->maxMeshPayloadAndSharedMemorySize = in_ext->maxMeshPayloadAndSharedMemorySize; - out_ext->maxMeshOutputMemorySize = in_ext->maxMeshOutputMemorySize; - out_ext->maxMeshPayloadAndOutputMemorySize = in_ext->maxMeshPayloadAndOutputMemorySize; - out_ext->maxMeshOutputComponents = in_ext->maxMeshOutputComponents; - out_ext->maxMeshOutputVertices = in_ext->maxMeshOutputVertices; - out_ext->maxMeshOutputPrimitives = in_ext->maxMeshOutputPrimitives; - out_ext->maxMeshOutputLayers = in_ext->maxMeshOutputLayers; - out_ext->maxMeshMultiviewViewCount = in_ext->maxMeshMultiviewViewCount; - out_ext->meshOutputPerVertexGranularity = in_ext->meshOutputPerVertexGranularity; - out_ext->meshOutputPerPrimitiveGranularity = in_ext->meshOutputPerPrimitiveGranularity; - out_ext->maxPreferredTaskWorkGroupInvocations = in_ext->maxPreferredTaskWorkGroupInvocations; - out_ext->maxPreferredMeshWorkGroupInvocations = in_ext->maxPreferredMeshWorkGroupInvocations; - out_ext->prefersLocalInvocationVertexOutput = in_ext->prefersLocalInvocationVertexOutput; - out_ext->prefersLocalInvocationPrimitiveOutput = in_ext->prefersLocalInvocationPrimitiveOutput; - out_ext->prefersCompactVertexOutput = in_ext->prefersCompactVertexOutput; - out_ext->prefersCompactPrimitiveOutput = in_ext->prefersCompactPrimitiveOutput; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: - { - VkPhysicalDeviceAccelerationStructurePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR); - const VkPhysicalDeviceAccelerationStructurePropertiesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructurePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR; - out_ext->maxGeometryCount = in_ext->maxGeometryCount; - out_ext->maxInstanceCount = in_ext->maxInstanceCount; - out_ext->maxPrimitiveCount = in_ext->maxPrimitiveCount; - out_ext->maxPerStageDescriptorAccelerationStructures = in_ext->maxPerStageDescriptorAccelerationStructures; - out_ext->maxPerStageDescriptorUpdateAfterBindAccelerationStructures = in_ext->maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - out_ext->maxDescriptorSetAccelerationStructures = in_ext->maxDescriptorSetAccelerationStructures; - out_ext->maxDescriptorSetUpdateAfterBindAccelerationStructures = in_ext->maxDescriptorSetUpdateAfterBindAccelerationStructures; - out_ext->minAccelerationStructureScratchOffsetAlignment = in_ext->minAccelerationStructureScratchOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: - { - VkPhysicalDeviceRayTracingPipelinePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR); - const VkPhysicalDeviceRayTracingPipelinePropertiesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelinePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR; - out_ext->shaderGroupHandleSize = in_ext->shaderGroupHandleSize; - out_ext->maxRayRecursionDepth = in_ext->maxRayRecursionDepth; - out_ext->maxShaderGroupStride = in_ext->maxShaderGroupStride; - out_ext->shaderGroupBaseAlignment = in_ext->shaderGroupBaseAlignment; - out_ext->shaderGroupHandleCaptureReplaySize = in_ext->shaderGroupHandleCaptureReplaySize; - out_ext->maxRayDispatchInvocationCount = in_ext->maxRayDispatchInvocationCount; - out_ext->shaderGroupHandleAlignment = in_ext->shaderGroupHandleAlignment; - out_ext->maxRayHitAttributeSize = in_ext->maxRayHitAttributeSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV); - const VkPhysicalDeviceRayTracingPropertiesNV *in_ext = (const VkPhysicalDeviceRayTracingPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV; - out_ext->shaderGroupHandleSize = in_ext->shaderGroupHandleSize; - out_ext->maxRecursionDepth = in_ext->maxRecursionDepth; - out_ext->maxShaderGroupStride = in_ext->maxShaderGroupStride; - out_ext->shaderGroupBaseAlignment = in_ext->shaderGroupBaseAlignment; - out_ext->maxGeometryCount = in_ext->maxGeometryCount; - out_ext->maxInstanceCount = in_ext->maxInstanceCount; - out_ext->maxTriangleCount = in_ext->maxTriangleCount; - out_ext->maxDescriptorSetAccelerationStructures = in_ext->maxDescriptorSetAccelerationStructures; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT); - const VkPhysicalDeviceFragmentDensityMapPropertiesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT; - out_ext->minFragmentDensityTexelSize = in_ext->minFragmentDensityTexelSize; - out_ext->maxFragmentDensityTexelSize = in_ext->maxFragmentDensityTexelSize; - out_ext->fragmentDensityInvocations = in_ext->fragmentDensityInvocations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT); - const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT; - out_ext->subsampledLoads = in_ext->subsampledLoads; - out_ext->subsampledCoarseReconstructionEarlyAccess = in_ext->subsampledCoarseReconstructionEarlyAccess; - out_ext->maxSubsampledArrayLayers = in_ext->maxSubsampledArrayLayers; - out_ext->maxDescriptorSetSubsampledSamplers = in_ext->maxDescriptorSetSubsampledSamplers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM); - const VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM; - out_ext->fragmentDensityOffsetGranularity = in_ext->fragmentDensityOffsetGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrixPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV); - const VkPhysicalDeviceCooperativeMatrixPropertiesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV; - out_ext->cooperativeMatrixSupportedStages = in_ext->cooperativeMatrixSupportedStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: - { - VkPhysicalDevicePerformanceQueryPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR); - const VkPhysicalDevicePerformanceQueryPropertiesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR; - out_ext->allowCommandBufferQueryCopies = in_ext->allowCommandBufferQueryCopies; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV); - const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV; - out_ext->shaderSMCount = in_ext->shaderSMCount; - out_ext->shaderWarpsPerSM = in_ext->shaderWarpsPerSM; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: - { - VkPhysicalDeviceTexelBufferAlignmentProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES); - const VkPhysicalDeviceTexelBufferAlignmentProperties *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; - out_ext->storageTexelBufferOffsetAlignmentBytes = in_ext->storageTexelBufferOffsetAlignmentBytes; - out_ext->storageTexelBufferOffsetSingleTexelAlignment = in_ext->storageTexelBufferOffsetSingleTexelAlignment; - out_ext->uniformTexelBufferOffsetAlignmentBytes = in_ext->uniformTexelBufferOffsetAlignmentBytes; - out_ext->uniformTexelBufferOffsetSingleTexelAlignment = in_ext->uniformTexelBufferOffsetSingleTexelAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: - { - VkPhysicalDeviceSubgroupSizeControlProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES); - const VkPhysicalDeviceSubgroupSizeControlProperties *in_ext = (const VkPhysicalDeviceSubgroupSizeControlProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; - out_ext->minSubgroupSize = in_ext->minSubgroupSize; - out_ext->maxSubgroupSize = in_ext->maxSubgroupSize; - out_ext->maxComputeWorkgroupSubgroups = in_ext->maxComputeWorkgroupSubgroups; - out_ext->requiredSubgroupSizeStages = in_ext->requiredSubgroupSizeStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI); - const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI; - out_ext->maxSubpassShadingWorkgroupSizeAspectRatio = in_ext->maxSubpassShadingWorkgroupSizeAspectRatio; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI); - const VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI; - memcpy(out_ext->maxWorkGroupCount, in_ext->maxWorkGroupCount, 3 * sizeof(uint32_t)); - memcpy(out_ext->maxWorkGroupSize, in_ext->maxWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxOutputClusterCount = in_ext->maxOutputClusterCount; - out_ext->indirectBufferOffsetAlignment = in_ext->indirectBufferOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceLineRasterizationPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT); - const VkPhysicalDeviceLineRasterizationPropertiesEXT *in_ext = (const VkPhysicalDeviceLineRasterizationPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT; - out_ext->lineSubPixelPrecisionBits = in_ext->lineSubPixelPrecisionBits; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: - { - VkPhysicalDeviceVulkan11Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES); - const VkPhysicalDeviceVulkan11Properties *in_ext = (const VkPhysicalDeviceVulkan11Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; - memcpy(out_ext->deviceUUID, in_ext->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->driverUUID, in_ext->driverUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->deviceLUID, in_ext->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t)); - out_ext->deviceNodeMask = in_ext->deviceNodeMask; - out_ext->deviceLUIDValid = in_ext->deviceLUIDValid; - out_ext->subgroupSize = in_ext->subgroupSize; - out_ext->subgroupSupportedStages = in_ext->subgroupSupportedStages; - out_ext->subgroupSupportedOperations = in_ext->subgroupSupportedOperations; - out_ext->subgroupQuadOperationsInAllStages = in_ext->subgroupQuadOperationsInAllStages; - out_ext->pointClippingBehavior = in_ext->pointClippingBehavior; - out_ext->maxMultiviewViewCount = in_ext->maxMultiviewViewCount; - out_ext->maxMultiviewInstanceIndex = in_ext->maxMultiviewInstanceIndex; - out_ext->protectedNoFault = in_ext->protectedNoFault; - out_ext->maxPerSetDescriptors = in_ext->maxPerSetDescriptors; - out_ext->maxMemoryAllocationSize = in_ext->maxMemoryAllocationSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: - { - VkPhysicalDeviceVulkan12Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES); - const VkPhysicalDeviceVulkan12Properties *in_ext = (const VkPhysicalDeviceVulkan12Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; - out_ext->driverID = in_ext->driverID; - memcpy(out_ext->driverName, in_ext->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char)); - memcpy(out_ext->driverInfo, in_ext->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char)); - out_ext->conformanceVersion = in_ext->conformanceVersion; - out_ext->denormBehaviorIndependence = in_ext->denormBehaviorIndependence; - out_ext->roundingModeIndependence = in_ext->roundingModeIndependence; - out_ext->shaderSignedZeroInfNanPreserveFloat16 = in_ext->shaderSignedZeroInfNanPreserveFloat16; - out_ext->shaderSignedZeroInfNanPreserveFloat32 = in_ext->shaderSignedZeroInfNanPreserveFloat32; - out_ext->shaderSignedZeroInfNanPreserveFloat64 = in_ext->shaderSignedZeroInfNanPreserveFloat64; - out_ext->shaderDenormPreserveFloat16 = in_ext->shaderDenormPreserveFloat16; - out_ext->shaderDenormPreserveFloat32 = in_ext->shaderDenormPreserveFloat32; - out_ext->shaderDenormPreserveFloat64 = in_ext->shaderDenormPreserveFloat64; - out_ext->shaderDenormFlushToZeroFloat16 = in_ext->shaderDenormFlushToZeroFloat16; - out_ext->shaderDenormFlushToZeroFloat32 = in_ext->shaderDenormFlushToZeroFloat32; - out_ext->shaderDenormFlushToZeroFloat64 = in_ext->shaderDenormFlushToZeroFloat64; - out_ext->shaderRoundingModeRTEFloat16 = in_ext->shaderRoundingModeRTEFloat16; - out_ext->shaderRoundingModeRTEFloat32 = in_ext->shaderRoundingModeRTEFloat32; - out_ext->shaderRoundingModeRTEFloat64 = in_ext->shaderRoundingModeRTEFloat64; - out_ext->shaderRoundingModeRTZFloat16 = in_ext->shaderRoundingModeRTZFloat16; - out_ext->shaderRoundingModeRTZFloat32 = in_ext->shaderRoundingModeRTZFloat32; - out_ext->shaderRoundingModeRTZFloat64 = in_ext->shaderRoundingModeRTZFloat64; - out_ext->maxUpdateAfterBindDescriptorsInAllPools = in_ext->maxUpdateAfterBindDescriptorsInAllPools; - out_ext->shaderUniformBufferArrayNonUniformIndexingNative = in_ext->shaderUniformBufferArrayNonUniformIndexingNative; - out_ext->shaderSampledImageArrayNonUniformIndexingNative = in_ext->shaderSampledImageArrayNonUniformIndexingNative; - out_ext->shaderStorageBufferArrayNonUniformIndexingNative = in_ext->shaderStorageBufferArrayNonUniformIndexingNative; - out_ext->shaderStorageImageArrayNonUniformIndexingNative = in_ext->shaderStorageImageArrayNonUniformIndexingNative; - out_ext->shaderInputAttachmentArrayNonUniformIndexingNative = in_ext->shaderInputAttachmentArrayNonUniformIndexingNative; - out_ext->robustBufferAccessUpdateAfterBind = in_ext->robustBufferAccessUpdateAfterBind; - out_ext->quadDivergentImplicitLod = in_ext->quadDivergentImplicitLod; - out_ext->maxPerStageDescriptorUpdateAfterBindSamplers = in_ext->maxPerStageDescriptorUpdateAfterBindSamplers; - out_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindSampledImages = in_ext->maxPerStageDescriptorUpdateAfterBindSampledImages; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageImages = in_ext->maxPerStageDescriptorUpdateAfterBindStorageImages; - out_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments = in_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments; - out_ext->maxPerStageUpdateAfterBindResources = in_ext->maxPerStageUpdateAfterBindResources; - out_ext->maxDescriptorSetUpdateAfterBindSamplers = in_ext->maxDescriptorSetUpdateAfterBindSamplers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffers = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffers = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffers; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindSampledImages = in_ext->maxDescriptorSetUpdateAfterBindSampledImages; - out_ext->maxDescriptorSetUpdateAfterBindStorageImages = in_ext->maxDescriptorSetUpdateAfterBindStorageImages; - out_ext->maxDescriptorSetUpdateAfterBindInputAttachments = in_ext->maxDescriptorSetUpdateAfterBindInputAttachments; - out_ext->supportedDepthResolveModes = in_ext->supportedDepthResolveModes; - out_ext->supportedStencilResolveModes = in_ext->supportedStencilResolveModes; - out_ext->independentResolveNone = in_ext->independentResolveNone; - out_ext->independentResolve = in_ext->independentResolve; - out_ext->filterMinmaxSingleComponentFormats = in_ext->filterMinmaxSingleComponentFormats; - out_ext->filterMinmaxImageComponentMapping = in_ext->filterMinmaxImageComponentMapping; - out_ext->maxTimelineSemaphoreValueDifference = in_ext->maxTimelineSemaphoreValueDifference; - out_ext->framebufferIntegerColorSampleCounts = in_ext->framebufferIntegerColorSampleCounts; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: - { - VkPhysicalDeviceVulkan13Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES); - const VkPhysicalDeviceVulkan13Properties *in_ext = (const VkPhysicalDeviceVulkan13Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; - out_ext->minSubgroupSize = in_ext->minSubgroupSize; - out_ext->maxSubgroupSize = in_ext->maxSubgroupSize; - out_ext->maxComputeWorkgroupSubgroups = in_ext->maxComputeWorkgroupSubgroups; - out_ext->requiredSubgroupSizeStages = in_ext->requiredSubgroupSizeStages; - out_ext->maxInlineUniformBlockSize = in_ext->maxInlineUniformBlockSize; - out_ext->maxPerStageDescriptorInlineUniformBlocks = in_ext->maxPerStageDescriptorInlineUniformBlocks; - out_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = in_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - out_ext->maxDescriptorSetInlineUniformBlocks = in_ext->maxDescriptorSetInlineUniformBlocks; - out_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = in_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - out_ext->maxInlineUniformTotalSize = in_ext->maxInlineUniformTotalSize; - out_ext->integerDotProduct8BitUnsignedAccelerated = in_ext->integerDotProduct8BitUnsignedAccelerated; - out_ext->integerDotProduct8BitSignedAccelerated = in_ext->integerDotProduct8BitSignedAccelerated; - out_ext->integerDotProduct8BitMixedSignednessAccelerated = in_ext->integerDotProduct8BitMixedSignednessAccelerated; - out_ext->integerDotProduct4x8BitPackedUnsignedAccelerated = in_ext->integerDotProduct4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProduct4x8BitPackedSignedAccelerated = in_ext->integerDotProduct4x8BitPackedSignedAccelerated; - out_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProduct16BitUnsignedAccelerated = in_ext->integerDotProduct16BitUnsignedAccelerated; - out_ext->integerDotProduct16BitSignedAccelerated = in_ext->integerDotProduct16BitSignedAccelerated; - out_ext->integerDotProduct16BitMixedSignednessAccelerated = in_ext->integerDotProduct16BitMixedSignednessAccelerated; - out_ext->integerDotProduct32BitUnsignedAccelerated = in_ext->integerDotProduct32BitUnsignedAccelerated; - out_ext->integerDotProduct32BitSignedAccelerated = in_ext->integerDotProduct32BitSignedAccelerated; - out_ext->integerDotProduct32BitMixedSignednessAccelerated = in_ext->integerDotProduct32BitMixedSignednessAccelerated; - out_ext->integerDotProduct64BitUnsignedAccelerated = in_ext->integerDotProduct64BitUnsignedAccelerated; - out_ext->integerDotProduct64BitSignedAccelerated = in_ext->integerDotProduct64BitSignedAccelerated; - out_ext->integerDotProduct64BitMixedSignednessAccelerated = in_ext->integerDotProduct64BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - out_ext->storageTexelBufferOffsetAlignmentBytes = in_ext->storageTexelBufferOffsetAlignmentBytes; - out_ext->storageTexelBufferOffsetSingleTexelAlignment = in_ext->storageTexelBufferOffsetSingleTexelAlignment; - out_ext->uniformTexelBufferOffsetAlignmentBytes = in_ext->uniformTexelBufferOffsetAlignmentBytes; - out_ext->uniformTexelBufferOffsetSingleTexelAlignment = in_ext->uniformTexelBufferOffsetSingleTexelAlignment; - out_ext->maxBufferSize = in_ext->maxBufferSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: - { - VkPhysicalDeviceCustomBorderColorPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT); - const VkPhysicalDeviceCustomBorderColorPropertiesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT; - out_ext->maxCustomBorderColorSamplers = in_ext->maxCustomBorderColorSamplers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT); - const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT; - out_ext->dynamicPrimitiveTopologyUnrestricted = in_ext->dynamicPrimitiveTopologyUnrestricted; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: - { - VkPhysicalDeviceRobustness2PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT); - const VkPhysicalDeviceRobustness2PropertiesEXT *in_ext = (const VkPhysicalDeviceRobustness2PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT; - out_ext->robustStorageBufferAccessSizeAlignment = in_ext->robustStorageBufferAccessSizeAlignment; - out_ext->robustUniformBufferAccessSizeAlignment = in_ext->robustUniformBufferAccessSizeAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShadingRatePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR); - const VkPhysicalDeviceFragmentShadingRatePropertiesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRatePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; - out_ext->minFragmentShadingRateAttachmentTexelSize = in_ext->minFragmentShadingRateAttachmentTexelSize; - out_ext->maxFragmentShadingRateAttachmentTexelSize = in_ext->maxFragmentShadingRateAttachmentTexelSize; - out_ext->maxFragmentShadingRateAttachmentTexelSizeAspectRatio = in_ext->maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - out_ext->primitiveFragmentShadingRateWithMultipleViewports = in_ext->primitiveFragmentShadingRateWithMultipleViewports; - out_ext->layeredShadingRateAttachments = in_ext->layeredShadingRateAttachments; - out_ext->fragmentShadingRateNonTrivialCombinerOps = in_ext->fragmentShadingRateNonTrivialCombinerOps; - out_ext->maxFragmentSize = in_ext->maxFragmentSize; - out_ext->maxFragmentSizeAspectRatio = in_ext->maxFragmentSizeAspectRatio; - out_ext->maxFragmentShadingRateCoverageSamples = in_ext->maxFragmentShadingRateCoverageSamples; - out_ext->maxFragmentShadingRateRasterizationSamples = in_ext->maxFragmentShadingRateRasterizationSamples; - out_ext->fragmentShadingRateWithShaderDepthStencilWrites = in_ext->fragmentShadingRateWithShaderDepthStencilWrites; - out_ext->fragmentShadingRateWithSampleMask = in_ext->fragmentShadingRateWithSampleMask; - out_ext->fragmentShadingRateWithShaderSampleMask = in_ext->fragmentShadingRateWithShaderSampleMask; - out_ext->fragmentShadingRateWithConservativeRasterization = in_ext->fragmentShadingRateWithConservativeRasterization; - out_ext->fragmentShadingRateWithFragmentShaderInterlock = in_ext->fragmentShadingRateWithFragmentShaderInterlock; - out_ext->fragmentShadingRateWithCustomSampleLocations = in_ext->fragmentShadingRateWithCustomSampleLocations; - out_ext->fragmentShadingRateStrictMultiplyCombiner = in_ext->fragmentShadingRateStrictMultiplyCombiner; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV); - const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV; - out_ext->maxFragmentShadingRateInvocationCount = in_ext->maxFragmentShadingRateInvocationCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT: - { - VkPhysicalDeviceHostImageCopyPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT); - const VkPhysicalDeviceHostImageCopyPropertiesEXT *in_ext = (const VkPhysicalDeviceHostImageCopyPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT; - out_ext->copySrcLayoutCount = in_ext->copySrcLayoutCount; - out_ext->pCopySrcLayouts = PtrToUlong(in_ext->pCopySrcLayouts); - out_ext->copyDstLayoutCount = in_ext->copyDstLayoutCount; - out_ext->pCopyDstLayouts = PtrToUlong(in_ext->pCopyDstLayouts); - memcpy(out_ext->optimalTilingLayoutUUID, in_ext->optimalTilingLayoutUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->identicalMemoryTypeRequirements = in_ext->identicalMemoryTypeRequirements; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: - { - VkPhysicalDeviceProvokingVertexPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT); - const VkPhysicalDeviceProvokingVertexPropertiesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT; - out_ext->provokingVertexModePerPipeline = in_ext->provokingVertexModePerPipeline; - out_ext->transformFeedbackPreservesTriangleFanProvokingVertex = in_ext->transformFeedbackPreservesTriangleFanProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT); - const VkPhysicalDeviceDescriptorBufferPropertiesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT; - out_ext->combinedImageSamplerDescriptorSingleArray = in_ext->combinedImageSamplerDescriptorSingleArray; - out_ext->bufferlessPushDescriptors = in_ext->bufferlessPushDescriptors; - out_ext->allowSamplerImageViewPostSubmitCreation = in_ext->allowSamplerImageViewPostSubmitCreation; - out_ext->descriptorBufferOffsetAlignment = in_ext->descriptorBufferOffsetAlignment; - out_ext->maxDescriptorBufferBindings = in_ext->maxDescriptorBufferBindings; - out_ext->maxResourceDescriptorBufferBindings = in_ext->maxResourceDescriptorBufferBindings; - out_ext->maxSamplerDescriptorBufferBindings = in_ext->maxSamplerDescriptorBufferBindings; - out_ext->maxEmbeddedImmutableSamplerBindings = in_ext->maxEmbeddedImmutableSamplerBindings; - out_ext->maxEmbeddedImmutableSamplers = in_ext->maxEmbeddedImmutableSamplers; - out_ext->bufferCaptureReplayDescriptorDataSize = in_ext->bufferCaptureReplayDescriptorDataSize; - out_ext->imageCaptureReplayDescriptorDataSize = in_ext->imageCaptureReplayDescriptorDataSize; - out_ext->imageViewCaptureReplayDescriptorDataSize = in_ext->imageViewCaptureReplayDescriptorDataSize; - out_ext->samplerCaptureReplayDescriptorDataSize = in_ext->samplerCaptureReplayDescriptorDataSize; - out_ext->accelerationStructureCaptureReplayDescriptorDataSize = in_ext->accelerationStructureCaptureReplayDescriptorDataSize; - out_ext->samplerDescriptorSize = in_ext->samplerDescriptorSize; - out_ext->combinedImageSamplerDescriptorSize = in_ext->combinedImageSamplerDescriptorSize; - out_ext->sampledImageDescriptorSize = in_ext->sampledImageDescriptorSize; - out_ext->storageImageDescriptorSize = in_ext->storageImageDescriptorSize; - out_ext->uniformTexelBufferDescriptorSize = in_ext->uniformTexelBufferDescriptorSize; - out_ext->robustUniformTexelBufferDescriptorSize = in_ext->robustUniformTexelBufferDescriptorSize; - out_ext->storageTexelBufferDescriptorSize = in_ext->storageTexelBufferDescriptorSize; - out_ext->robustStorageTexelBufferDescriptorSize = in_ext->robustStorageTexelBufferDescriptorSize; - out_ext->uniformBufferDescriptorSize = in_ext->uniformBufferDescriptorSize; - out_ext->robustUniformBufferDescriptorSize = in_ext->robustUniformBufferDescriptorSize; - out_ext->storageBufferDescriptorSize = in_ext->storageBufferDescriptorSize; - out_ext->robustStorageBufferDescriptorSize = in_ext->robustStorageBufferDescriptorSize; - out_ext->inputAttachmentDescriptorSize = in_ext->inputAttachmentDescriptorSize; - out_ext->accelerationStructureDescriptorSize = in_ext->accelerationStructureDescriptorSize; - out_ext->maxSamplerDescriptorBufferRange = in_ext->maxSamplerDescriptorBufferRange; - out_ext->maxResourceDescriptorBufferRange = in_ext->maxResourceDescriptorBufferRange; - out_ext->samplerDescriptorBufferAddressSpaceSize = in_ext->samplerDescriptorBufferAddressSpaceSize; - out_ext->resourceDescriptorBufferAddressSpaceSize = in_ext->resourceDescriptorBufferAddressSpaceSize; - out_ext->descriptorBufferAddressSpaceSize = in_ext->descriptorBufferAddressSpaceSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT); - const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT; - out_ext->combinedImageSamplerDensityMapDescriptorSize = in_ext->combinedImageSamplerDensityMapDescriptorSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: - { - VkPhysicalDeviceShaderIntegerDotProductProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES); - const VkPhysicalDeviceShaderIntegerDotProductProperties *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES; - out_ext->integerDotProduct8BitUnsignedAccelerated = in_ext->integerDotProduct8BitUnsignedAccelerated; - out_ext->integerDotProduct8BitSignedAccelerated = in_ext->integerDotProduct8BitSignedAccelerated; - out_ext->integerDotProduct8BitMixedSignednessAccelerated = in_ext->integerDotProduct8BitMixedSignednessAccelerated; - out_ext->integerDotProduct4x8BitPackedUnsignedAccelerated = in_ext->integerDotProduct4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProduct4x8BitPackedSignedAccelerated = in_ext->integerDotProduct4x8BitPackedSignedAccelerated; - out_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProduct16BitUnsignedAccelerated = in_ext->integerDotProduct16BitUnsignedAccelerated; - out_ext->integerDotProduct16BitSignedAccelerated = in_ext->integerDotProduct16BitSignedAccelerated; - out_ext->integerDotProduct16BitMixedSignednessAccelerated = in_ext->integerDotProduct16BitMixedSignednessAccelerated; - out_ext->integerDotProduct32BitUnsignedAccelerated = in_ext->integerDotProduct32BitUnsignedAccelerated; - out_ext->integerDotProduct32BitSignedAccelerated = in_ext->integerDotProduct32BitSignedAccelerated; - out_ext->integerDotProduct32BitMixedSignednessAccelerated = in_ext->integerDotProduct32BitMixedSignednessAccelerated; - out_ext->integerDotProduct64BitUnsignedAccelerated = in_ext->integerDotProduct64BitUnsignedAccelerated; - out_ext->integerDotProduct64BitSignedAccelerated = in_ext->integerDotProduct64BitSignedAccelerated; - out_ext->integerDotProduct64BitMixedSignednessAccelerated = in_ext->integerDotProduct64BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR); - const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR; - out_ext->triStripVertexOrderIndependentOfProvokingVertex = in_ext->triStripVertexOrderIndependentOfProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT); - const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; - out_ext->graphicsPipelineLibraryFastLinking = in_ext->graphicsPipelineLibraryFastLinking; - out_ext->graphicsPipelineLibraryIndependentInterpolationDecoration = in_ext->graphicsPipelineLibraryIndependentInterpolationDecoration; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT); - const VkPhysicalDeviceNestedCommandBufferPropertiesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT; - out_ext->maxCommandBufferNestingLevel = in_ext->maxCommandBufferNestingLevel; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT); - const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT; - memcpy(out_ext->shaderModuleIdentifierAlgorithmUUID, in_ext->shaderModuleIdentifierAlgorithmUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: - { - VkPhysicalDeviceOpacityMicromapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT); - const VkPhysicalDeviceOpacityMicromapPropertiesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT; - out_ext->maxOpacity2StateSubdivisionLevel = in_ext->maxOpacity2StateSubdivisionLevel; - out_ext->maxOpacity4StateSubdivisionLevel = in_ext->maxOpacity4StateSubdivisionLevel; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT: - { - VkPhysicalDevicePipelineRobustnessPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT); - const VkPhysicalDevicePipelineRobustnessPropertiesEXT *in_ext = (const VkPhysicalDevicePipelineRobustnessPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT; - out_ext->defaultRobustnessStorageBuffers = in_ext->defaultRobustnessStorageBuffers; - out_ext->defaultRobustnessUniformBuffers = in_ext->defaultRobustnessUniformBuffers; - out_ext->defaultRobustnessVertexInputs = in_ext->defaultRobustnessVertexInputs; - out_ext->defaultRobustnessImages = in_ext->defaultRobustnessImages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessingPropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM); - const VkPhysicalDeviceImageProcessingPropertiesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingPropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM; - out_ext->maxWeightFilterPhases = in_ext->maxWeightFilterPhases; - out_ext->maxWeightFilterDimension = in_ext->maxWeightFilterDimension; - out_ext->maxBlockMatchRegion = in_ext->maxBlockMatchRegion; - out_ext->maxBoxFilterBlockSize = in_ext->maxBoxFilterBlockSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: - { - VkPhysicalDeviceOpticalFlowPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV); - const VkPhysicalDeviceOpticalFlowPropertiesNV *in_ext = (const VkPhysicalDeviceOpticalFlowPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV; - out_ext->supportedOutputGridSizes = in_ext->supportedOutputGridSizes; - out_ext->supportedHintGridSizes = in_ext->supportedHintGridSizes; - out_ext->hintSupported = in_ext->hintSupported; - out_ext->costSupported = in_ext->costSupported; - out_ext->bidirectionalFlowSupported = in_ext->bidirectionalFlowSupported; - out_ext->globalFlowSupported = in_ext->globalFlowSupported; - out_ext->minWidth = in_ext->minWidth; - out_ext->minHeight = in_ext->minHeight; - out_ext->maxWidth = in_ext->maxWidth; - out_ext->maxHeight = in_ext->maxHeight; - out_ext->maxNumRegionsOfInterest = in_ext->maxNumRegionsOfInterest; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM); - const VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM; - out_ext->shaderCoreMask = in_ext->shaderCoreMask; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_ext->shaderWarpsPerCore = in_ext->shaderWarpsPerCore; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV); - const VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV; - out_ext->rayTracingInvocationReorderReorderingHint = in_ext->rayTracingInvocationReorderReorderingHint; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV); - const VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV; - out_ext->extendedSparseAddressSpaceSize = in_ext->extendedSparseAddressSpaceSize; - out_ext->extendedSparseImageUsageFlags = in_ext->extendedSparseImageUsageFlags; - out_ext->extendedSparseBufferUsageFlags = in_ext->extendedSparseBufferUsageFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCorePropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM); - const VkPhysicalDeviceShaderCorePropertiesARM *in_ext = (const VkPhysicalDeviceShaderCorePropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM; - out_ext->pixelRate = in_ext->pixelRate; - out_ext->texelRate = in_ext->texelRate; - out_ext->fmaRate = in_ext->fmaRate; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderObjectPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT); - const VkPhysicalDeviceShaderObjectPropertiesEXT *in_ext = (const VkPhysicalDeviceShaderObjectPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT; - memcpy(out_ext->shaderBinaryUUID, in_ext->shaderBinaryUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->shaderBinaryVersion = in_ext->shaderBinaryVersion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderTileImagePropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT); - const VkPhysicalDeviceShaderTileImagePropertiesEXT *in_ext = (const VkPhysicalDeviceShaderTileImagePropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT; - out_ext->shaderTileImageCoherentReadAccelerated = in_ext->shaderTileImageCoherentReadAccelerated; - out_ext->shaderTileImageReadSampleFromPixelRateInvocation = in_ext->shaderTileImageReadSampleFromPixelRateInvocation; - out_ext->shaderTileImageReadFromHelperInvocation = in_ext->shaderTileImageReadFromHelperInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR: - { - VkPhysicalDeviceCooperativeMatrixPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR); - const VkPhysicalDeviceCooperativeMatrixPropertiesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR; - out_ext->cooperativeMatrixSupportedStages = in_ext->cooperativeMatrixSupportedStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessing2PropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM); - const VkPhysicalDeviceImageProcessing2PropertiesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2PropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM; - out_ext->maxBlockMatchWindow = in_ext->maxBlockMatchWindow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: - { - VkPhysicalDeviceLayeredDriverPropertiesMSFT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT); - const VkPhysicalDeviceLayeredDriverPropertiesMSFT *in_ext = (const VkPhysicalDeviceLayeredDriverPropertiesMSFT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT; - out_ext->underlyingAPI = in_ext->underlyingAPI; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: - { - VkPhysicalDeviceCudaKernelLaunchPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV); - const VkPhysicalDeviceCudaKernelLaunchPropertiesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV; - out_ext->computeCapabilityMinor = in_ext->computeCapabilityMinor; - out_ext->computeCapabilityMajor = in_ext->computeCapabilityMajor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM: - { - VkPhysicalDeviceSchedulingControlsPropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM); - const VkPhysicalDeviceSchedulingControlsPropertiesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsPropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM; - out_ext->schedulingControlsFlags = in_ext->schedulingControlsFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkQueryPoolPerformanceCreateInfoKHR_win32_to_host(const VkQueryPoolPerformanceCreateInfoKHR32 *in, VkQueryPoolPerformanceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->queueFamilyIndex = in->queueFamilyIndex; - out->counterIndexCount = in->counterIndexCount; - out->pCounterIndices = (const uint32_t *)UlongToPtr(in->pCounterIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkQueueFamilyProperties2_win32_to_host(struct conversion_context *ctx, const VkQueueFamilyProperties232 *in, VkQueueFamilyProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR: - { - VkQueueFamilyGlobalPriorityPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueueFamilyGlobalPriorityPropertiesKHR32 *in_ext = (const VkQueueFamilyGlobalPriorityPropertiesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_ext->priorityCount = in_ext->priorityCount; - memcpy(out_ext->priorities, in_ext->priorities, VK_MAX_GLOBAL_PRIORITY_SIZE_KHR * sizeof(VkQueueGlobalPriorityKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: - { - VkQueueFamilyCheckpointPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: - { - VkQueueFamilyCheckpointProperties2NV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkQueueFamilyProperties2_host_to_win32(const VkQueueFamilyProperties2 *in, VkQueueFamilyProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->queueFamilyProperties = in->queueFamilyProperties; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR: - { - VkQueueFamilyGlobalPriorityPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR); - const VkQueueFamilyGlobalPriorityPropertiesKHR *in_ext = (const VkQueueFamilyGlobalPriorityPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; - out_ext->priorityCount = in_ext->priorityCount; - memcpy(out_ext->priorities, in_ext->priorities, VK_MAX_GLOBAL_PRIORITY_SIZE_KHR * sizeof(VkQueueGlobalPriorityKHR)); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: - { - VkQueueFamilyCheckpointPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV); - const VkQueueFamilyCheckpointPropertiesNV *in_ext = (const VkQueueFamilyCheckpointPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV; - out_ext->checkpointExecutionStageMask = in_ext->checkpointExecutionStageMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: - { - VkQueueFamilyCheckpointProperties2NV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV); - const VkQueueFamilyCheckpointProperties2NV *in_ext = (const VkQueueFamilyCheckpointProperties2NV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; - out_ext->checkpointExecutionStageMask = in_ext->checkpointExecutionStageMask; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkQueueFamilyProperties2 *convert_VkQueueFamilyProperties2_array_win32_to_host(struct conversion_context *ctx, const VkQueueFamilyProperties232 *in, uint32_t count) -{ - VkQueueFamilyProperties2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkQueueFamilyProperties2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkQueueFamilyProperties2_array_host_to_win32(const VkQueueFamilyProperties2 *in, VkQueueFamilyProperties232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkQueueFamilyProperties2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host(const VkPhysicalDeviceSparseImageFormatInfo232 *in, VkPhysicalDeviceSparseImageFormatInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->type = in->type; - out->samples = in->samples; - out->usage = in->usage; - out->tiling = in->tiling; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageFormatProperties2_win32_to_host(const VkSparseImageFormatProperties232 *in, VkSparseImageFormatProperties2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageFormatProperties2_host_to_win32(const VkSparseImageFormatProperties2 *in, VkSparseImageFormatProperties232 *out) -{ - if (!in) return; - - out->properties = in->properties; -} - -static inline VkSparseImageFormatProperties2 *convert_VkSparseImageFormatProperties2_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageFormatProperties232 *in, uint32_t count) -{ - VkSparseImageFormatProperties2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageFormatProperties2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSparseImageFormatProperties2_array_host_to_win32(const VkSparseImageFormatProperties2 *in, VkSparseImageFormatProperties232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageFormatProperties2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_win32_to_host(const VkFramebufferMixedSamplesCombinationNV32 *in, VkFramebufferMixedSamplesCombinationNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_host_to_win32(const VkFramebufferMixedSamplesCombinationNV *in, VkFramebufferMixedSamplesCombinationNV32 *out) -{ - if (!in) return; - - out->coverageReductionMode = in->coverageReductionMode; - out->rasterizationSamples = in->rasterizationSamples; - out->depthStencilSamples = in->depthStencilSamples; - out->colorSamples = in->colorSamples; -} - -static inline VkFramebufferMixedSamplesCombinationNV *convert_VkFramebufferMixedSamplesCombinationNV_array_win32_to_host(struct conversion_context *ctx, const VkFramebufferMixedSamplesCombinationNV32 *in, uint32_t count) -{ - VkFramebufferMixedSamplesCombinationNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkFramebufferMixedSamplesCombinationNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_array_host_to_win32(const VkFramebufferMixedSamplesCombinationNV *in, VkFramebufferMixedSamplesCombinationNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkFramebufferMixedSamplesCombinationNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPhysicalDeviceSurfaceInfo2KHR32 *in, VkPhysicalDeviceSurfaceInfo2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->surface = in->surface; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT: - { - VkSurfacePresentModeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentModeEXT32 *in_ext = (const VkSurfacePresentModeEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT; - out_ext->pNext = NULL; - out_ext->presentMode = in_ext->presentMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceCapabilities2KHR_win32_to_host(struct conversion_context *ctx, const VkSurfaceCapabilities2KHR32 *in, VkSurfaceCapabilities2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV: - { - VkSurfaceCapabilitiesPresentBarrierNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: - { - VkSurfacePresentScalingCapabilitiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentScalingCapabilitiesEXT32 *in_ext = (const VkSurfacePresentScalingCapabilitiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT; - out_ext->pNext = NULL; - out_ext->supportedPresentScaling = in_ext->supportedPresentScaling; - out_ext->supportedPresentGravityX = in_ext->supportedPresentGravityX; - out_ext->supportedPresentGravityY = in_ext->supportedPresentGravityY; - out_ext->minScaledImageExtent = in_ext->minScaledImageExtent; - out_ext->maxScaledImageExtent = in_ext->maxScaledImageExtent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: - { - VkSurfacePresentModeCompatibilityEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentModeCompatibilityEXT32 *in_ext = (const VkSurfacePresentModeCompatibilityEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = (VkPresentModeKHR *)UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: - { - VkLatencySurfaceCapabilitiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySurfaceCapabilitiesNV32 *in_ext = (const VkLatencySurfaceCapabilitiesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = (VkPresentModeKHR *)UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceCapabilities2KHR_host_to_win32(const VkSurfaceCapabilities2KHR *in, VkSurfaceCapabilities2KHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->surfaceCapabilities = in->surfaceCapabilities; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV: - { - VkSurfaceCapabilitiesPresentBarrierNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV); - const VkSurfaceCapabilitiesPresentBarrierNV *in_ext = (const VkSurfaceCapabilitiesPresentBarrierNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV; - out_ext->presentBarrierSupported = in_ext->presentBarrierSupported; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: - { - VkSurfacePresentScalingCapabilitiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT); - const VkSurfacePresentScalingCapabilitiesEXT *in_ext = (const VkSurfacePresentScalingCapabilitiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT; - out_ext->supportedPresentScaling = in_ext->supportedPresentScaling; - out_ext->supportedPresentGravityX = in_ext->supportedPresentGravityX; - out_ext->supportedPresentGravityY = in_ext->supportedPresentGravityY; - out_ext->minScaledImageExtent = in_ext->minScaledImageExtent; - out_ext->maxScaledImageExtent = in_ext->maxScaledImageExtent; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: - { - VkSurfacePresentModeCompatibilityEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT); - const VkSurfacePresentModeCompatibilityEXT *in_ext = (const VkSurfacePresentModeCompatibilityEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = PtrToUlong(in_ext->pPresentModes); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: - { - VkLatencySurfaceCapabilitiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV); - const VkLatencySurfaceCapabilitiesNV *in_ext = (const VkLatencySurfaceCapabilitiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = PtrToUlong(in_ext->pPresentModes); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win64_to_driver(const VkPhysicalDeviceSurfaceInfo2KHR *in, VkPhysicalDeviceSurfaceInfo2KHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->surface = in->surface ? wine_surface_from_handle(in->surface)->driver_surface : 0; -} -#endif /* _WIN64 */ - -static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_driver(struct conversion_context *ctx, const VkPhysicalDeviceSurfaceInfo2KHR32 *in, VkPhysicalDeviceSurfaceInfo2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->surface = in->surface ? wine_surface_from_handle(in->surface)->driver_surface : 0; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT: - { - VkSurfacePresentModeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentModeEXT32 *in_ext = (const VkSurfacePresentModeEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT; - out_ext->pNext = NULL; - out_ext->presentMode = in_ext->presentMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceFormat2KHR_win32_to_host(struct conversion_context *ctx, const VkSurfaceFormat2KHR32 *in, VkSurfaceFormat2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceFormat2KHR_host_to_win32(const VkSurfaceFormat2KHR *in, VkSurfaceFormat2KHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->surfaceFormat = in->surfaceFormat; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkSurfaceFormat2KHR *convert_VkSurfaceFormat2KHR_array_win32_to_host(struct conversion_context *ctx, const VkSurfaceFormat2KHR32 *in, uint32_t count) -{ - VkSurfaceFormat2KHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSurfaceFormat2KHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSurfaceFormat2KHR_array_host_to_win32(const VkSurfaceFormat2KHR *in, VkSurfaceFormat2KHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSurfaceFormat2KHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceToolProperties_win32_to_host(const VkPhysicalDeviceToolProperties32 *in, VkPhysicalDeviceToolProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceToolProperties_host_to_win32(const VkPhysicalDeviceToolProperties *in, VkPhysicalDeviceToolProperties32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); - memcpy(out->version, in->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); - out->purposes = in->purposes; - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->layer, in->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); -} - -static inline VkPhysicalDeviceToolProperties *convert_VkPhysicalDeviceToolProperties_array_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceToolProperties32 *in, uint32_t count) -{ - VkPhysicalDeviceToolProperties *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceToolProperties_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceToolProperties_array_host_to_win32(const VkPhysicalDeviceToolProperties *in, VkPhysicalDeviceToolProperties32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceToolProperties_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineExecutableInfoKHR_win32_to_host(const VkPipelineExecutableInfoKHR32 *in, VkPipelineExecutableInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - out->executableIndex = in->executableIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_win32_to_host(const VkPipelineExecutableInternalRepresentationKHR32 *in, VkPipelineExecutableInternalRepresentationKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_host_to_win32(const VkPipelineExecutableInternalRepresentationKHR *in, VkPipelineExecutableInternalRepresentationKHR32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->isText = in->isText; - out->dataSize = in->dataSize; - out->pData = PtrToUlong(in->pData); -} - -static inline VkPipelineExecutableInternalRepresentationKHR *convert_VkPipelineExecutableInternalRepresentationKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutableInternalRepresentationKHR32 *in, uint32_t count) -{ - VkPipelineExecutableInternalRepresentationKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableInternalRepresentationKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_array_host_to_win32(const VkPipelineExecutableInternalRepresentationKHR *in, VkPipelineExecutableInternalRepresentationKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableInternalRepresentationKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineInfoKHR_win32_to_host(const VkPipelineInfoKHR32 *in, VkPipelineInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_win32_to_host(const VkPipelineExecutablePropertiesKHR32 *in, VkPipelineExecutablePropertiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_host_to_win32(const VkPipelineExecutablePropertiesKHR *in, VkPipelineExecutablePropertiesKHR32 *out) -{ - if (!in) return; - - out->stages = in->stages; - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->subgroupSize = in->subgroupSize; -} - -static inline VkPipelineExecutablePropertiesKHR *convert_VkPipelineExecutablePropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutablePropertiesKHR32 *in, uint32_t count) -{ - VkPipelineExecutablePropertiesKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutablePropertiesKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_array_host_to_win32(const VkPipelineExecutablePropertiesKHR *in, VkPipelineExecutablePropertiesKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutablePropertiesKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineExecutableStatisticValueKHR_host_to_win32(const VkPipelineExecutableStatisticValueKHR *in, VkPipelineExecutableStatisticValueKHR32 *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR) - out->b32 = in->b32; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR) - out->i64 = in->i64; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR) - out->u64 = in->u64; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR) - out->f64 = in->f64; -} - -static inline void convert_VkPipelineExecutableStatisticKHR_win32_to_host(const VkPipelineExecutableStatisticKHR32 *in, VkPipelineExecutableStatisticKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableStatisticKHR_host_to_win32(const VkPipelineExecutableStatisticKHR *in, VkPipelineExecutableStatisticKHR32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->format = in->format; - convert_VkPipelineExecutableStatisticValueKHR_host_to_win32(&in->value, &out->value, in->format); -} - -static inline VkPipelineExecutableStatisticKHR *convert_VkPipelineExecutableStatisticKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutableStatisticKHR32 *in, uint32_t count) -{ - VkPipelineExecutableStatisticKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableStatisticKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutableStatisticKHR_array_host_to_win32(const VkPipelineExecutableStatisticKHR *in, VkPipelineExecutableStatisticKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableStatisticKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineIndirectDeviceAddressInfoNV_win32_to_host(const VkPipelineIndirectDeviceAddressInfoNV32 *in, VkPipelineIndirectDeviceAddressInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineInfoEXT_win32_to_host(const VkPipelineInfoEXT32 *in, VkPipelineInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointData2NV_win32_to_host(const VkCheckpointData2NV32 *in, VkCheckpointData2NV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointData2NV_host_to_win32(const VkCheckpointData2NV *in, VkCheckpointData2NV32 *out) -{ - if (!in) return; - - out->stage = in->stage; - out->pCheckpointMarker = PtrToUlong(in->pCheckpointMarker); -} - -static inline VkCheckpointData2NV *convert_VkCheckpointData2NV_array_win32_to_host(struct conversion_context *ctx, const VkCheckpointData2NV32 *in, uint32_t count) -{ - VkCheckpointData2NV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCheckpointData2NV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCheckpointData2NV_array_host_to_win32(const VkCheckpointData2NV *in, VkCheckpointData2NV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCheckpointData2NV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCheckpointDataNV_win32_to_host(const VkCheckpointDataNV32 *in, VkCheckpointDataNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointDataNV_host_to_win32(const VkCheckpointDataNV *in, VkCheckpointDataNV32 *out) -{ - if (!in) return; - - out->stage = in->stage; - out->pCheckpointMarker = PtrToUlong(in->pCheckpointMarker); -} - -static inline VkCheckpointDataNV *convert_VkCheckpointDataNV_array_win32_to_host(struct conversion_context *ctx, const VkCheckpointDataNV32 *in, uint32_t count) -{ - VkCheckpointDataNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCheckpointDataNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCheckpointDataNV_array_host_to_win32(const VkCheckpointDataNV *in, VkCheckpointDataNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCheckpointDataNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkRenderingAreaInfoKHR_win32_to_host(const VkRenderingAreaInfoKHR32 *in, VkRenderingAreaInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->viewMask = in->viewMask; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachmentFormats = (const VkFormat *)UlongToPtr(in->pColorAttachmentFormats); - out->depthAttachmentFormat = in->depthAttachmentFormat; - out->stencilAttachmentFormat = in->stencilAttachmentFormat; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSamplerCaptureDescriptorDataInfoEXT_win32_to_host(const VkSamplerCaptureDescriptorDataInfoEXT32 *in, VkSamplerCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->sampler = in->sampler; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkShaderModuleIdentifierEXT_win32_to_host(const VkShaderModuleIdentifierEXT32 *in, VkShaderModuleIdentifierEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkShaderModuleIdentifierEXT_host_to_win32(const VkShaderModuleIdentifierEXT *in, VkShaderModuleIdentifierEXT32 *out) -{ - if (!in) return; - - out->identifierSize = in->identifierSize; - memcpy(out->identifier, in->identifier, VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT * sizeof(uint8_t)); -} - -static inline void convert_VkInitializePerformanceApiInfoINTEL_win32_to_host(const VkInitializePerformanceApiInfoINTEL32 *in, VkInitializePerformanceApiInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pUserData = (void *)UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencySleepInfoNV_win32_to_host(const VkLatencySleepInfoNV32 *in, VkLatencySleepInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->signalSemaphore = in->signalSemaphore; - out->value = in->value; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryMapInfoKHR_win32_to_unwrapped_host(const VkMemoryMapInfoKHR32 *in, VkMemoryMapInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = in->memory; - out->offset = in->offset; - out->size = in->size; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkSparseMemoryBind_win64_to_host(const VkSparseMemoryBind *in, VkSparseMemoryBind *out) -{ - if (!in) return; - - out->resourceOffset = in->resourceOffset; - out->size = in->size; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseMemoryBind_win32_to_host(const VkSparseMemoryBind32 *in, VkSparseMemoryBind *out) -{ - if (!in) return; - - out->resourceOffset = in->resourceOffset; - out->size = in->size; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} - -#ifdef _WIN64 -static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseMemoryBind *in, uint32_t count) -{ - VkSparseMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseMemoryBind_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseMemoryBind32 *in, uint32_t count) -{ - VkSparseMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseMemoryBind_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseBufferMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, VkSparseBufferMemoryBindInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseBufferMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, VkSparseBufferMemoryBindInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, uint32_t count) -{ - VkSparseBufferMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseBufferMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseBufferMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseBufferMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, VkSparseImageOpaqueMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, VkSparseImageOpaqueMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, uint32_t count) -{ - VkSparseImageOpaqueMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseImageOpaqueMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageMemoryBind_win64_to_host(const VkSparseImageMemoryBind *in, VkSparseImageMemoryBind *out) -{ - if (!in) return; - - out->subresource = in->subresource; - out->offset = in->offset; - out->extent = in->extent; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageMemoryBind_win32_to_host(const VkSparseImageMemoryBind32 *in, VkSparseImageMemoryBind *out) -{ - if (!in) return; - - out->subresource = in->subresource; - out->offset = in->offset; - out->extent = in->extent; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} - -#ifdef _WIN64 -static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind *in, uint32_t count) -{ - VkSparseImageMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBind_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind32 *in, uint32_t count) -{ - VkSparseImageMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBind_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, VkSparseImageMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseImageMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, VkSparseImageMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseImageMemoryBind_array_win32_to_host(ctx, (const VkSparseImageMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, uint32_t count) -{ - VkSparseImageMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseImageMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindSparseInfo_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, VkBindSparseInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = in->pWaitSemaphores; - out->bufferBindCount = in->bufferBindCount; - out->pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(ctx, in->pBufferBinds, in->bufferBindCount); - out->imageOpaqueBindCount = in->imageOpaqueBindCount; - out->pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(ctx, in->pImageOpaqueBinds, in->imageOpaqueBindCount); - out->imageBindCount = in->imageBindCount; - out->pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win64_to_host(ctx, in->pImageBinds, in->imageBindCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = in->pSignalSemaphores; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindSparseInfo_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, VkBindSparseInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = (const VkSemaphore *)UlongToPtr(in->pWaitSemaphores); - out->bufferBindCount = in->bufferBindCount; - out->pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseBufferMemoryBindInfo32 *)UlongToPtr(in->pBufferBinds), in->bufferBindCount); - out->imageOpaqueBindCount = in->imageOpaqueBindCount; - out->pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseImageOpaqueMemoryBindInfo32 *)UlongToPtr(in->pImageOpaqueBinds), in->imageOpaqueBindCount); - out->imageBindCount = in->imageBindCount; - out->pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseImageMemoryBindInfo32 *)UlongToPtr(in->pImageBinds), in->imageBindCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = (const VkSemaphore *)UlongToPtr(in->pSignalSemaphores); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: - { - VkDeviceGroupBindSparseInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupBindSparseInfo32 *in_ext = (const VkDeviceGroupBindSparseInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO; - out_ext->pNext = NULL; - out_ext->resourceDeviceIndex = in_ext->resourceDeviceIndex; - out_ext->memoryDeviceIndex = in_ext->memoryDeviceIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: - { - VkTimelineSemaphoreSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkTimelineSemaphoreSubmitInfo32 *in_ext = (const VkTimelineSemaphoreSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreValueCount = in_ext->waitSemaphoreValueCount; - out_ext->pWaitSemaphoreValues = (const uint64_t *)UlongToPtr(in_ext->pWaitSemaphoreValues); - out_ext->signalSemaphoreValueCount = in_ext->signalSemaphoreValueCount; - out_ext->pSignalSemaphoreValues = (const uint64_t *)UlongToPtr(in_ext->pSignalSemaphoreValues); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = (const VkImage *)UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = (const VkBuffer *)UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = (const void *)UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, uint32_t count) -{ - VkBindSparseInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindSparseInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, uint32_t count) -{ - VkBindSparseInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindSparseInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkOutOfBandQueueTypeInfoNV_win32_to_host(const VkOutOfBandQueueTypeInfoNV32 *in, VkOutOfBandQueueTypeInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->queueType = in->queueType; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPresentRegionKHR_win32_to_host(const VkPresentRegionKHR32 *in, VkPresentRegionKHR *out) -{ - if (!in) return; - - out->rectangleCount = in->rectangleCount; - out->pRectangles = (const VkRectLayerKHR *)UlongToPtr(in->pRectangles); -} - -static inline const VkPresentRegionKHR *convert_VkPresentRegionKHR_array_win32_to_host(struct conversion_context *ctx, const VkPresentRegionKHR32 *in, uint32_t count) -{ - VkPresentRegionKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPresentRegionKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPresentInfoKHR_win32_to_host(struct conversion_context *ctx, const VkPresentInfoKHR32 *in, VkPresentInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = (const VkSemaphore *)UlongToPtr(in->pWaitSemaphores); - out->swapchainCount = in->swapchainCount; - out->pSwapchains = (const VkSwapchainKHR *)UlongToPtr(in->pSwapchains); - out->pImageIndices = (const uint32_t *)UlongToPtr(in->pImageIndices); - out->pResults = (VkResult *)UlongToPtr(in->pResults); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: - { - VkPresentRegionsKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPresentRegionsKHR32 *in_ext = (const VkPresentRegionsKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pRegions = convert_VkPresentRegionKHR_array_win32_to_host(ctx, (const VkPresentRegionKHR32 *)UlongToPtr(in_ext->pRegions), in_ext->swapchainCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: - { - VkDeviceGroupPresentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupPresentInfoKHR32 *in_ext = (const VkDeviceGroupPresentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pDeviceMasks = (const uint32_t *)UlongToPtr(in_ext->pDeviceMasks); - out_ext->mode = in_ext->mode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: - { - VkPresentIdKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPresentIdKHR32 *in_ext = (const VkPresentIdKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PRESENT_ID_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pPresentIds = (const uint64_t *)UlongToPtr(in_ext->pPresentIds); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = (const VkImage *)UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = (const VkBuffer *)UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = (const void *)UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT: - { - VkSwapchainPresentFenceInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentFenceInfoEXT32 *in_ext = (const VkSwapchainPresentFenceInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pFences = (const VkFence *)UlongToPtr(in_ext->pFences); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT: - { - VkSwapchainPresentModeInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentModeInfoEXT32 *in_ext = (const VkSwapchainPresentModeInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pPresentModes = (const VkPresentModeKHR *)UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkSubmitInfo_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo *in, VkSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = in->pWaitSemaphores; - out->pWaitDstStageMask = in->pWaitDstStageMask; - out->commandBufferCount = in->commandBufferCount; - out->pCommandBuffers = convert_VkCommandBuffer_array_win64_to_host(ctx, in->pCommandBuffers, in->commandBufferCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = in->pSignalSemaphores; -} -#endif /* _WIN64 */ - -static inline void convert_VkSubmitInfo_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo32 *in, VkSubmitInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = (const VkSemaphore *)UlongToPtr(in->pWaitSemaphores); - out->pWaitDstStageMask = (const VkPipelineStageFlags *)UlongToPtr(in->pWaitDstStageMask); - out->commandBufferCount = in->commandBufferCount; - out->pCommandBuffers = convert_VkCommandBuffer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->pCommandBuffers), in->commandBufferCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = (const VkSemaphore *)UlongToPtr(in->pSignalSemaphores); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: - { - VkDeviceGroupSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupSubmitInfo32 *in_ext = (const VkDeviceGroupSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreCount = in_ext->waitSemaphoreCount; - out_ext->pWaitSemaphoreDeviceIndices = (const uint32_t *)UlongToPtr(in_ext->pWaitSemaphoreDeviceIndices); - out_ext->commandBufferCount = in_ext->commandBufferCount; - out_ext->pCommandBufferDeviceMasks = (const uint32_t *)UlongToPtr(in_ext->pCommandBufferDeviceMasks); - out_ext->signalSemaphoreCount = in_ext->signalSemaphoreCount; - out_ext->pSignalSemaphoreDeviceIndices = (const uint32_t *)UlongToPtr(in_ext->pSignalSemaphoreDeviceIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: - { - VkProtectedSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkProtectedSubmitInfo32 *in_ext = (const VkProtectedSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->protectedSubmit = in_ext->protectedSubmit; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: - { - VkTimelineSemaphoreSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkTimelineSemaphoreSubmitInfo32 *in_ext = (const VkTimelineSemaphoreSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreValueCount = in_ext->waitSemaphoreValueCount; - out_ext->pWaitSemaphoreValues = (const uint64_t *)UlongToPtr(in_ext->pWaitSemaphoreValues); - out_ext->signalSemaphoreValueCount = in_ext->signalSemaphoreValueCount; - out_ext->pSignalSemaphoreValues = (const uint64_t *)UlongToPtr(in_ext->pSignalSemaphoreValues); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: - { - VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQuerySubmitInfoKHR32 *in_ext = (const VkPerformanceQuerySubmitInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->counterPassIndex = in_ext->counterPassIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = (const VkImage *)UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = (const VkBuffer *)UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = (const void *)UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: - { - VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySubmissionPresentIdNV32 *in_ext = (const VkLatencySubmissionPresentIdNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; - out_ext->pNext = NULL; - out_ext->presentID = in_ext->presentID; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkSubmitInfo *convert_VkSubmitInfo_array_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo *in, uint32_t count) -{ - VkSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSubmitInfo *convert_VkSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo32 *in, uint32_t count) -{ - VkSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSemaphoreSubmitInfo_win32_to_host(const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->semaphore = in->semaphore; - out->value = in->value; - out->stageMask = in->stageMask; - out->deviceIndex = in->deviceIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo32 *in, uint32_t count) -{ - VkSemaphoreSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSemaphoreSubmitInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkCommandBufferSubmitInfo_win64_to_host(const VkCommandBufferSubmitInfo *in, VkCommandBufferSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->commandBuffer = wine_cmd_buffer_from_handle(in->commandBuffer)->host_command_buffer; - out->deviceMask = in->deviceMask; -} -#endif /* _WIN64 */ - -static inline void convert_VkCommandBufferSubmitInfo_win32_to_host(const VkCommandBufferSubmitInfo32 *in, VkCommandBufferSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->commandBuffer = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(in->commandBuffer))->host_command_buffer; - out->deviceMask = in->deviceMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_win64_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo *in, uint32_t count) -{ - VkCommandBufferSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferSubmitInfo_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo32 *in, uint32_t count) -{ - VkCommandBufferSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferSubmitInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSubmitInfo2_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo2 *in, VkSubmitInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->waitSemaphoreInfoCount = in->waitSemaphoreInfoCount; - out->pWaitSemaphoreInfos = in->pWaitSemaphoreInfos; - out->commandBufferInfoCount = in->commandBufferInfoCount; - out->pCommandBufferInfos = convert_VkCommandBufferSubmitInfo_array_win64_to_host(ctx, in->pCommandBufferInfos, in->commandBufferInfoCount); - out->signalSemaphoreInfoCount = in->signalSemaphoreInfoCount; - out->pSignalSemaphoreInfos = in->pSignalSemaphoreInfos; -} -#endif /* _WIN64 */ - -static inline void convert_VkSubmitInfo2_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo232 *in, VkSubmitInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->waitSemaphoreInfoCount = in->waitSemaphoreInfoCount; - out->pWaitSemaphoreInfos = convert_VkSemaphoreSubmitInfo_array_win32_to_host(ctx, (const VkSemaphoreSubmitInfo32 *)UlongToPtr(in->pWaitSemaphoreInfos), in->waitSemaphoreInfoCount); - out->commandBufferInfoCount = in->commandBufferInfoCount; - out->pCommandBufferInfos = convert_VkCommandBufferSubmitInfo_array_win32_to_host(ctx, (const VkCommandBufferSubmitInfo32 *)UlongToPtr(in->pCommandBufferInfos), in->commandBufferInfoCount); - out->signalSemaphoreInfoCount = in->signalSemaphoreInfoCount; - out->pSignalSemaphoreInfos = convert_VkSemaphoreSubmitInfo_array_win32_to_host(ctx, (const VkSemaphoreSubmitInfo32 *)UlongToPtr(in->pSignalSemaphoreInfos), in->signalSemaphoreInfoCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: - { - VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQuerySubmitInfoKHR32 *in_ext = (const VkPerformanceQuerySubmitInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->counterPassIndex = in_ext->counterPassIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = (const VkImage *)UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = (const VkBuffer *)UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = (const void *)UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: - { - VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySubmissionPresentIdNV32 *in_ext = (const VkLatencySubmissionPresentIdNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; - out_ext->pNext = NULL; - out_ext->presentID = in_ext->presentID; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkSubmitInfo2 *convert_VkSubmitInfo2_array_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo2 *in, uint32_t count) -{ - VkSubmitInfo2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo2_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSubmitInfo2 *convert_VkSubmitInfo2_array_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo232 *in, uint32_t count) -{ - VkSubmitInfo2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkReleaseSwapchainImagesInfoEXT_win32_to_host(const VkReleaseSwapchainImagesInfoEXT32 *in, VkReleaseSwapchainImagesInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->swapchain = in->swapchain; - out->imageIndexCount = in->imageIndexCount; - out->pImageIndices = (const uint32_t *)UlongToPtr(in->pImageIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(const VkDebugUtilsObjectNameInfoEXT *in, VkDebugUtilsObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->pObjectName = in->pObjectName; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host(const VkDebugUtilsObjectNameInfoEXT32 *in, VkDebugUtilsObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->pObjectName = (const char *)UlongToPtr(in->pObjectName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsObjectTagInfoEXT_win64_to_host(const VkDebugUtilsObjectTagInfoEXT *in, VkDebugUtilsObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = in->pTag; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsObjectTagInfoEXT_win32_to_host(const VkDebugUtilsObjectTagInfoEXT32 *in, VkDebugUtilsObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = (const void *)UlongToPtr(in->pTag); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkHdrMetadataEXT_win32_to_host(const VkHdrMetadataEXT32 *in, VkHdrMetadataEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->displayPrimaryRed = in->displayPrimaryRed; - out->displayPrimaryGreen = in->displayPrimaryGreen; - out->displayPrimaryBlue = in->displayPrimaryBlue; - out->whitePoint = in->whitePoint; - out->maxLuminance = in->maxLuminance; - out->minLuminance = in->minLuminance; - out->maxContentLightLevel = in->maxContentLightLevel; - out->maxFrameAverageLightLevel = in->maxFrameAverageLightLevel; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkHdrMetadataEXT *convert_VkHdrMetadataEXT_array_win32_to_host(struct conversion_context *ctx, const VkHdrMetadataEXT32 *in, uint32_t count) -{ - VkHdrMetadataEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkHdrMetadataEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSetLatencyMarkerInfoNV_win32_to_host(const VkSetLatencyMarkerInfoNV32 *in, VkSetLatencyMarkerInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->presentID = in->presentID; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencySleepModeInfoNV_win32_to_host(const VkLatencySleepModeInfoNV32 *in, VkLatencySleepModeInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->lowLatencyMode = in->lowLatencyMode; - out->lowLatencyBoost = in->lowLatencyBoost; - out->minimumIntervalUs = in->minimumIntervalUs; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSemaphoreSignalInfo_win32_to_host(const VkSemaphoreSignalInfo32 *in, VkSemaphoreSignalInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->semaphore = in->semaphore; - out->value = in->value; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkDebugUtilsLabelEXT *convert_VkDebugUtilsLabelEXT_array_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsLabelEXT32 *in, uint32_t count) -{ - VkDebugUtilsLabelEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsLabelEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline const VkDebugUtilsObjectNameInfoEXT *convert_VkDebugUtilsObjectNameInfoEXT_array_win64_to_host(struct conversion_context *ctx, const VkDebugUtilsObjectNameInfoEXT *in, uint32_t count) -{ - VkDebugUtilsObjectNameInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkDebugUtilsObjectNameInfoEXT *convert_VkDebugUtilsObjectNameInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsObjectNameInfoEXT32 *in, uint32_t count) -{ - VkDebugUtilsObjectNameInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win64_to_host(struct conversion_context *ctx, const VkDebugUtilsMessengerCallbackDataEXT *in, VkDebugUtilsMessengerCallbackDataEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->pMessageIdName = in->pMessageIdName; - out->messageIdNumber = in->messageIdNumber; - out->pMessage = in->pMessage; - out->queueLabelCount = in->queueLabelCount; - out->pQueueLabels = in->pQueueLabels; - out->cmdBufLabelCount = in->cmdBufLabelCount; - out->pCmdBufLabels = in->pCmdBufLabels; - out->objectCount = in->objectCount; - out->pObjects = convert_VkDebugUtilsObjectNameInfoEXT_array_win64_to_host(ctx, in->pObjects, in->objectCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsMessengerCallbackDataEXT32 *in, VkDebugUtilsMessengerCallbackDataEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pMessageIdName = (const char *)UlongToPtr(in->pMessageIdName); - out->messageIdNumber = in->messageIdNumber; - out->pMessage = (const char *)UlongToPtr(in->pMessage); - out->queueLabelCount = in->queueLabelCount; - out->pQueueLabels = convert_VkDebugUtilsLabelEXT_array_win32_to_host(ctx, (const VkDebugUtilsLabelEXT32 *)UlongToPtr(in->pQueueLabels), in->queueLabelCount); - out->cmdBufLabelCount = in->cmdBufLabelCount; - out->pCmdBufLabels = convert_VkDebugUtilsLabelEXT_array_win32_to_host(ctx, (const VkDebugUtilsLabelEXT32 *)UlongToPtr(in->pCmdBufLabels), in->cmdBufLabelCount); - out->objectCount = in->objectCount; - out->pObjects = convert_VkDebugUtilsObjectNameInfoEXT_array_win32_to_host(ctx, (const VkDebugUtilsObjectNameInfoEXT32 *)UlongToPtr(in->pObjects), in->objectCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT: - { - VkDeviceAddressBindingCallbackDataEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceAddressBindingCallbackDataEXT32 *in_ext = (const VkDeviceAddressBindingCallbackDataEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->baseAddress = in_ext->baseAddress; - out_ext->size = in_ext->size; - out_ext->bindingType = in_ext->bindingType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkHostImageLayoutTransitionInfoEXT_win32_to_host(const VkHostImageLayoutTransitionInfoEXT32 *in, VkHostImageLayoutTransitionInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->subresourceRange = in->subresourceRange; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkHostImageLayoutTransitionInfoEXT *convert_VkHostImageLayoutTransitionInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkHostImageLayoutTransitionInfoEXT32 *in, uint32_t count) -{ - VkHostImageLayoutTransitionInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkHostImageLayoutTransitionInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkMemoryUnmapInfoKHR_win32_to_unwrapped_host(const VkMemoryUnmapInfoKHR32 *in, VkMemoryUnmapInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = in->memory; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyDescriptorSet_win32_to_host(const VkCopyDescriptorSet32 *in, VkCopyDescriptorSet *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSet = in->srcSet; - out->srcBinding = in->srcBinding; - out->srcArrayElement = in->srcArrayElement; - out->dstSet = in->dstSet; - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkCopyDescriptorSet *convert_VkCopyDescriptorSet_array_win32_to_host(struct conversion_context *ctx, const VkCopyDescriptorSet32 *in, uint32_t count) -{ - VkCopyDescriptorSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCopyDescriptorSet_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSemaphoreWaitInfo_win32_to_host(const VkSemaphoreWaitInfo32 *in, VkSemaphoreWaitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->semaphoreCount = in->semaphoreCount; - out->pSemaphores = (const VkSemaphore *)UlongToPtr(in->pSemaphores); - out->pValues = (const uint64_t *)UlongToPtr(in->pValues); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireNextImage2KHR(void *args) -{ - struct vkAcquireNextImage2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAcquireInfo, params->pImageIndex); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquireNextImage2KHR(wine_device_from_handle(params->device)->host_device, params->pAcquireInfo, params->pImageIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireNextImage2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pAcquireInfo; - PTR32 pImageIndex; - VkResult result; - } *params = args; - VkAcquireNextImageInfoKHR pAcquireInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAcquireInfo, params->pImageIndex); - - convert_VkAcquireNextImageInfoKHR_win32_to_host((const VkAcquireNextImageInfoKHR32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquireNextImage2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pAcquireInfo_host, (uint32_t *)UlongToPtr(params->pImageIndex)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireNextImageKHR(void *args) -{ - struct vkAcquireNextImageKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquireNextImageKHR(wine_device_from_handle(params->device)->host_device, params->swapchain, params->timeout, params->semaphore, params->fence, params->pImageIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireNextImageKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - PTR32 pImageIndex; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquireNextImageKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, params->timeout, params->semaphore, params->fence, (uint32_t *)UlongToPtr(params->pImageIndex)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquirePerformanceConfigurationINTEL(void *args) -{ - struct vkAcquirePerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAcquireInfo, params->pConfiguration); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquirePerformanceConfigurationINTEL(wine_device_from_handle(params->device)->host_device, params->pAcquireInfo, params->pConfiguration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquirePerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 device; - PTR32 pAcquireInfo; - PTR32 pConfiguration; - VkResult result; - } *params = args; - VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAcquireInfo, params->pConfiguration); - - convert_VkPerformanceConfigurationAcquireInfoINTEL_win32_to_host((const VkPerformanceConfigurationAcquireInfoINTEL32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquirePerformanceConfigurationINTEL(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pAcquireInfo_host, (VkPerformanceConfigurationINTEL *)UlongToPtr(params->pConfiguration)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireProfilingLockKHR(void *args) -{ - struct vkAcquireProfilingLockKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquireProfilingLockKHR(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireProfilingLockKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkResult result; - } *params = args; - VkAcquireProfilingLockInfoKHR pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkAcquireProfilingLockInfoKHR_win32_to_host((const VkAcquireProfilingLockInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquireProfilingLockKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateCommandBuffers(void *args) -{ - struct vkAllocateCommandBuffers_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocateInfo, params->pCommandBuffers); - - params->result = wine_vkAllocateCommandBuffers(params->device, params->pAllocateInfo, params->pCommandBuffers); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateCommandBuffers(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pCommandBuffers; - VkResult result; - } *params = args; - VkCommandBufferAllocateInfo pAllocateInfo_host; - VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pCommandBuffers); - - init_conversion_context(ctx); - convert_VkCommandBufferAllocateInfo_win32_to_unwrapped_host((const VkCommandBufferAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_unwrapped_host(ctx, (PTR32 *)UlongToPtr(params->pCommandBuffers), ((const VkCommandBufferAllocateInfo32 *)UlongToPtr(params->pAllocateInfo))->commandBufferCount); - params->result = wine_vkAllocateCommandBuffers((VkDevice)UlongToPtr(params->device), &pAllocateInfo_host, pCommandBuffers_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateDescriptorSets(void *args) -{ - struct vkAllocateDescriptorSets_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocateInfo, params->pDescriptorSets); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkAllocateDescriptorSets(wine_device_from_handle(params->device)->host_device, params->pAllocateInfo, params->pDescriptorSets); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateDescriptorSets(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pDescriptorSets; - VkResult result; - } *params = args; - VkDescriptorSetAllocateInfo pAllocateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pDescriptorSets); - - init_conversion_context(ctx); - convert_VkDescriptorSetAllocateInfo_win32_to_host(ctx, (const VkDescriptorSetAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAllocateDescriptorSets(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pAllocateInfo_host, (VkDescriptorSet *)UlongToPtr(params->pDescriptorSets)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateMemory(void *args) -{ - struct vkAllocateMemory_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - - params->result = wine_vkAllocateMemory(params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateMemory(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pAllocator; - PTR32 pMemory; - VkResult result; - } *params = args; - VkMemoryAllocateInfo pAllocateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - - init_conversion_context(ctx); - convert_VkMemoryAllocateInfo_win32_to_host(ctx, (const VkMemoryAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - params->result = wine_vkAllocateMemory((VkDevice)UlongToPtr(params->device), &pAllocateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDeviceMemory *)UlongToPtr(params->pMemory)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBeginCommandBuffer(void *args) -{ - struct vkBeginCommandBuffer_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pBeginInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkBeginCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pBeginInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBeginCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBeginInfo; - VkResult result; - } *params = args; - VkCommandBufferBeginInfo pBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pBeginInfo); - - init_conversion_context(ctx); - convert_VkCommandBufferBeginInfo_win32_to_host(ctx, (const VkCommandBufferBeginInfo32 *)UlongToPtr(params->pBeginInfo), &pBeginInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkBeginCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pBeginInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindAccelerationStructureMemoryNV(void *args) -{ - struct vkBindAccelerationStructureMemoryNV_params *params = args; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindAccelerationStructureMemoryNV(wine_device_from_handle(params->device)->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindAccelerationStructureMemoryNV(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindAccelerationStructureMemoryInfoNV_array_win32_to_host(ctx, (const VkBindAccelerationStructureMemoryInfoNV32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindAccelerationStructureMemoryNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory(void *args) -{ - struct vkBindBufferMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory(wine_device_from_handle(params->device)->host_device, params->buffer, wine_device_memory_from_handle(params->memory)->host_memory, params->memoryOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindBufferMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->buffer, wine_device_memory_from_handle(params->memory)->host_memory, params->memoryOffset); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory2(void *args) -{ - struct vkBindBufferMemory2_params *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2(wine_device_from_handle(params->device)->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory2(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win32_to_host(ctx, (const VkBindBufferMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindBufferMemory2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory2KHR(void *args) -{ - struct vkBindBufferMemory2KHR_params *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2KHR(wine_device_from_handle(params->device)->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory2KHR(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win32_to_host(ctx, (const VkBindBufferMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindBufferMemory2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory(void *args) -{ - struct vkBindImageMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory(wine_device_from_handle(params->device)->host_device, params->image, wine_device_memory_from_handle(params->memory)->host_memory, params->memoryOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindImageMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, wine_device_memory_from_handle(params->memory)->host_memory, params->memoryOffset); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory2(void *args) -{ - struct vkBindImageMemory2_params *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2(wine_device_from_handle(params->device)->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory2(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win32_to_host(ctx, (const VkBindImageMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindImageMemory2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory2KHR(void *args) -{ - struct vkBindImageMemory2KHR_params *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2KHR(wine_device_from_handle(params->device)->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory2KHR(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win32_to_host(ctx, (const VkBindImageMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindImageMemory2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindOpticalFlowSessionImageNV(void *args) -{ - struct vkBindOpticalFlowSessionImageNV_params *params = args; - - TRACE("%p, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->bindingPoint, wine_dbgstr_longlong(params->view), params->layout); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkBindOpticalFlowSessionImageNV(wine_device_from_handle(params->device)->host_device, params->session, params->bindingPoint, params->view, params->layout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindOpticalFlowSessionImageNV(void *args) -{ - struct - { - PTR32 device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - VkOpticalFlowSessionBindingPointNV bindingPoint; - VkImageView DECLSPEC_ALIGN(8) view; - VkImageLayout layout; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->bindingPoint, wine_dbgstr_longlong(params->view), params->layout); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindOpticalFlowSessionImageNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->session, params->bindingPoint, params->view, params->layout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBuildAccelerationStructuresKHR(void *args) -{ - struct vkBuildAccelerationStructuresKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %p, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos, params->ppBuildRangeInfos); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkBuildAccelerationStructuresKHR(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->infoCount, params->pInfos, params->ppBuildRangeInfos); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBuildAccelerationStructuresKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - PTR32 pInfos; - PTR32 ppBuildRangeInfos; - VkResult result; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos, params->ppBuildRangeInfos); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBuildAccelerationStructuresKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->infoCount, pInfos_host, (const VkAccelerationStructureBuildRangeInfoKHR * const*)UlongToPtr(params->ppBuildRangeInfos)); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBuildMicromapsEXT(void *args) -{ - struct vkBuildMicromapsEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkBuildMicromapsEXT(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->infoCount, params->pInfos); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBuildMicromapsEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - PTR32 pInfos; - VkResult result; - } *params = args; - const VkMicromapBuildInfoEXT *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pInfos_host = convert_VkMicromapBuildInfoEXT_array_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pInfos), params->infoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBuildMicromapsEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->infoCount, pInfos_host); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginConditionalRenderingEXT(void *args) -{ - struct vkCmdBeginConditionalRenderingEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginConditionalRenderingEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pConditionalRenderingBegin); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginConditionalRenderingEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pConditionalRenderingBegin; - } *params = args; - VkConditionalRenderingBeginInfoEXT pConditionalRenderingBegin_host; - - convert_VkConditionalRenderingBeginInfoEXT_win32_to_host((const VkConditionalRenderingBeginInfoEXT32 *)UlongToPtr(params->pConditionalRenderingBegin), &pConditionalRenderingBegin_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginConditionalRenderingEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pConditionalRenderingBegin_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginDebugUtilsLabelEXT(void *args) -{ - struct vkCmdBeginDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pLabelInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pLabelInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginQuery(void *args) -{ - struct vkCmdBeginQuery_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginQuery(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->query, params->flags); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginQuery(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginQuery(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->query, params->flags); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginQueryIndexedEXT(void *args) -{ - struct vkCmdBeginQueryIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginQueryIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->query, params->flags, params->index); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginQueryIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - uint32_t index; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginQueryIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->query, params->flags, params->index); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass(void *args) -{ - struct vkCmdBeginRenderPass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginRenderPass(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRenderPassBegin, params->contents); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - VkSubpassContents contents; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginRenderPass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRenderPassBegin_host, params->contents); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass2(void *args) -{ - struct vkCmdBeginRenderPass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginRenderPass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRenderPassBegin, params->pSubpassBeginInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - PTR32 pSubpassBeginInfo; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - VkSubpassBeginInfo pSubpassBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginRenderPass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRenderPassBegin_host, &pSubpassBeginInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass2KHR(void *args) -{ - struct vkCmdBeginRenderPass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginRenderPass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRenderPassBegin, params->pSubpassBeginInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - PTR32 pSubpassBeginInfo; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - VkSubpassBeginInfo pSubpassBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginRenderPass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRenderPassBegin_host, &pSubpassBeginInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRendering(void *args) -{ - struct vkCmdBeginRendering_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginRendering(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRenderingInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRendering(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderingInfo; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginRendering(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRenderingInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderingKHR(void *args) -{ - struct vkCmdBeginRenderingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginRenderingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRenderingInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderingInfo; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginRenderingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRenderingInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginTransformFeedbackEXT(void *args) -{ - struct vkCmdBeginTransformFeedbackEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBeginTransformFeedbackEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstCounterBuffer, params->counterBufferCount, params->pCounterBuffers, params->pCounterBufferOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginTransformFeedbackEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - PTR32 pCounterBuffers; - PTR32 pCounterBufferOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBeginTransformFeedbackEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstCounterBuffer, params->counterBufferCount, (const VkBuffer *)UlongToPtr(params->pCounterBuffers), (const VkDeviceSize *)UlongToPtr(params->pCounterBufferOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(void *args) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->layout, params->set); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->layout, params->set); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorBuffersEXT(void *args) -{ - struct vkCmdBindDescriptorBuffersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindDescriptorBuffersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->bufferCount, params->pBindingInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorBuffersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t bufferCount; - PTR32 pBindingInfos; - } *params = args; - const VkDescriptorBufferBindingInfoEXT *pBindingInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pBindingInfos_host = convert_VkDescriptorBufferBindingInfoEXT_array_win32_to_host(ctx, (const VkDescriptorBufferBindingInfoEXT32 *)UlongToPtr(params->pBindingInfos), params->bufferCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindDescriptorBuffersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->bufferCount, pBindingInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorSets(void *args) -{ - struct vkCmdBindDescriptorSets_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindDescriptorSets(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->descriptorSetCount, params->pDescriptorSets, params->dynamicOffsetCount, params->pDynamicOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorSets(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - PTR32 pDescriptorSets; - uint32_t dynamicOffsetCount; - PTR32 pDynamicOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindDescriptorSets(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->descriptorSetCount, (const VkDescriptorSet *)UlongToPtr(params->pDescriptorSets), params->dynamicOffsetCount, (const uint32_t *)UlongToPtr(params->pDynamicOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindIndexBuffer(void *args) -{ - struct vkCmdBindIndexBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindIndexBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->indexType); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindIndexBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkIndexType indexType; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindIndexBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->indexType); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindIndexBuffer2KHR(void *args) -{ - struct vkCmdBindIndexBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindIndexBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->size, params->indexType); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindIndexBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindIndexBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->size, params->indexType); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindInvocationMaskHUAWEI(void *args) -{ - struct vkCmdBindInvocationMaskHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindInvocationMaskHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->imageView, params->imageLayout); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindInvocationMaskHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindInvocationMaskHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->imageView, params->imageLayout); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindPipeline(void *args) -{ - struct vkCmdBindPipeline_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindPipeline(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->pipeline); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindPipeline(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindPipeline(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->pipeline); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindPipelineShaderGroupNV(void *args) -{ - struct vkCmdBindPipelineShaderGroupNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindPipelineShaderGroupNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->pipeline, params->groupIndex); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindPipelineShaderGroupNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t groupIndex; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindPipelineShaderGroupNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->pipeline, params->groupIndex); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindShadersEXT(void *args) -{ - struct vkCmdBindShadersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindShadersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stageCount, params->pStages, params->pShaders); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindShadersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t stageCount; - PTR32 pStages; - PTR32 pShaders; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindShadersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stageCount, (const VkShaderStageFlagBits *)UlongToPtr(params->pStages), (const VkShaderEXT *)UlongToPtr(params->pShaders)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindShadingRateImageNV(void *args) -{ - struct vkCmdBindShadingRateImageNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindShadingRateImageNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->imageView, params->imageLayout); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindShadingRateImageNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindShadingRateImageNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->imageView, params->imageLayout); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindTransformFeedbackBuffersEXT(void *args) -{ - struct vkCmdBindTransformFeedbackBuffersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindTransformFeedbackBuffersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindTransformFeedbackBuffersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindTransformFeedbackBuffersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers(void *args) -{ - struct vkCmdBindVertexBuffers_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindVertexBuffers(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindVertexBuffers(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers2(void *args) -{ - struct vkCmdBindVertexBuffers2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindVertexBuffers2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes, params->pStrides); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers2(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - PTR32 pStrides; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindVertexBuffers2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes), (const VkDeviceSize *)UlongToPtr(params->pStrides)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers2EXT(void *args) -{ - struct vkCmdBindVertexBuffers2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBindVertexBuffers2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes, params->pStrides); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - PTR32 pStrides; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBindVertexBuffers2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes), (const VkDeviceSize *)UlongToPtr(params->pStrides)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage(void *args) -{ - struct vkCmdBlitImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBlitImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions, params->filter); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - VkFilter filter; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBlitImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageBlit *)UlongToPtr(params->pRegions), params->filter); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage2(void *args) -{ - struct vkCmdBlitImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBlitImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pBlitImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBlitImageInfo; - } *params = args; - VkBlitImageInfo2 pBlitImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBlitImageInfo2_win32_to_host(ctx, (const VkBlitImageInfo232 *)UlongToPtr(params->pBlitImageInfo), &pBlitImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBlitImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pBlitImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage2KHR(void *args) -{ - struct vkCmdBlitImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBlitImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pBlitImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBlitImageInfo; - } *params = args; - VkBlitImageInfo2 pBlitImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBlitImageInfo2_win32_to_host(ctx, (const VkBlitImageInfo232 *)UlongToPtr(params->pBlitImageInfo), &pBlitImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBlitImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pBlitImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructureNV(void *args) -{ - struct vkCmdBuildAccelerationStructureNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBuildAccelerationStructureNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo, params->instanceData, params->instanceOffset, params->update, params->dst, params->src, params->scratch, params->scratchOffset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructureNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - VkBuffer DECLSPEC_ALIGN(8) instanceData; - VkDeviceSize DECLSPEC_ALIGN(8) instanceOffset; - VkBool32 update; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkBuffer DECLSPEC_ALIGN(8) scratch; - VkDeviceSize DECLSPEC_ALIGN(8) scratchOffset; - } *params = args; - VkAccelerationStructureInfoNV pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkAccelerationStructureInfoNV_win32_to_host(ctx, (const VkAccelerationStructureInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBuildAccelerationStructureNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host, params->instanceData, params->instanceOffset, params->update, params->dst, params->src, params->scratch, params->scratchOffset); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructuresIndirectKHR(void *args) -{ - struct vkCmdBuildAccelerationStructuresIndirectKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBuildAccelerationStructuresIndirectKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->infoCount, params->pInfos, params->pIndirectDeviceAddresses, params->pIndirectStrides, params->ppMaxPrimitiveCounts); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructuresIndirectKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - PTR32 pIndirectDeviceAddresses; - PTR32 pIndirectStrides; - PTR32 ppMaxPrimitiveCounts; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBuildAccelerationStructuresIndirectKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->infoCount, pInfos_host, (const VkDeviceAddress *)UlongToPtr(params->pIndirectDeviceAddresses), (const uint32_t *)UlongToPtr(params->pIndirectStrides), (const uint32_t * const*)UlongToPtr(params->ppMaxPrimitiveCounts)); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructuresKHR(void *args) -{ - struct vkCmdBuildAccelerationStructuresKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBuildAccelerationStructuresKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->infoCount, params->pInfos, params->ppBuildRangeInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructuresKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - PTR32 ppBuildRangeInfos; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBuildAccelerationStructuresKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->infoCount, pInfos_host, (const VkAccelerationStructureBuildRangeInfoKHR * const*)UlongToPtr(params->ppBuildRangeInfos)); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildMicromapsEXT(void *args) -{ - struct vkCmdBuildMicromapsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdBuildMicromapsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->infoCount, params->pInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildMicromapsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - } *params = args; - const VkMicromapBuildInfoEXT *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkMicromapBuildInfoEXT_array_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pInfos), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdBuildMicromapsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->infoCount, pInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearAttachments(void *args) -{ - struct vkCmdClearAttachments_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdClearAttachments(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->attachmentCount, params->pAttachments, params->rectCount, params->pRects); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearAttachments(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t rectCount; - PTR32 pRects; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdClearAttachments(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->attachmentCount, (const VkClearAttachment *)UlongToPtr(params->pAttachments), params->rectCount, (const VkClearRect *)UlongToPtr(params->pRects)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearColorImage(void *args) -{ - struct vkCmdClearColorImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdClearColorImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->image, params->imageLayout, params->pColor, params->rangeCount, params->pRanges); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearColorImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - PTR32 pColor; - uint32_t rangeCount; - PTR32 pRanges; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdClearColorImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->image, params->imageLayout, (const VkClearColorValue *)UlongToPtr(params->pColor), params->rangeCount, (const VkImageSubresourceRange *)UlongToPtr(params->pRanges)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearDepthStencilImage(void *args) -{ - struct vkCmdClearDepthStencilImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdClearDepthStencilImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->image, params->imageLayout, params->pDepthStencil, params->rangeCount, params->pRanges); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearDepthStencilImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - PTR32 pDepthStencil; - uint32_t rangeCount; - PTR32 pRanges; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdClearDepthStencilImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->image, params->imageLayout, (const VkClearDepthStencilValue *)UlongToPtr(params->pDepthStencil), params->rangeCount, (const VkImageSubresourceRange *)UlongToPtr(params->pRanges)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureKHR(void *args) -{ - struct vkCmdCopyAccelerationStructureKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyAccelerationStructureKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyAccelerationStructureInfoKHR pInfo_host; - - convert_VkCopyAccelerationStructureInfoKHR_win32_to_host((const VkCopyAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyAccelerationStructureKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureNV(void *args) -{ - struct vkCmdCopyAccelerationStructureNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyAccelerationStructureNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->dst, params->src, params->mode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkCopyAccelerationStructureModeKHR mode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyAccelerationStructureNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->dst, params->src, params->mode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct vkCmdCopyAccelerationStructureToMemoryKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyAccelerationStructureToMemoryKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyAccelerationStructureToMemoryInfoKHR pInfo_host; - - convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host((const VkCopyAccelerationStructureToMemoryInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyAccelerationStructureToMemoryKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer(void *args) -{ - struct vkCmdCopyBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcBuffer, params->dstBuffer, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferCopy_array_win32_to_host(ctx, (const VkBufferCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcBuffer, params->dstBuffer, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer2(void *args) -{ - struct vkCmdCopyBuffer2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBuffer2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferInfo; - } *params = args; - VkCopyBufferInfo2 pCopyBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferInfo2_win32_to_host(ctx, (const VkCopyBufferInfo232 *)UlongToPtr(params->pCopyBufferInfo), &pCopyBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBuffer2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer2KHR(void *args) -{ - struct vkCmdCopyBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferInfo; - } *params = args; - VkCopyBufferInfo2 pCopyBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferInfo2_win32_to_host(ctx, (const VkCopyBufferInfo232 *)UlongToPtr(params->pCopyBufferInfo), &pCopyBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage(void *args) -{ - struct vkCmdCopyBufferToImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBufferToImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcBuffer, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferImageCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferImageCopy_array_win32_to_host(ctx, (const VkBufferImageCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBufferToImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcBuffer, params->dstImage, params->dstImageLayout, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage2(void *args) -{ - struct vkCmdCopyBufferToImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBufferToImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyBufferToImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferToImageInfo; - } *params = args; - VkCopyBufferToImageInfo2 pCopyBufferToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferToImageInfo2_win32_to_host(ctx, (const VkCopyBufferToImageInfo232 *)UlongToPtr(params->pCopyBufferToImageInfo), &pCopyBufferToImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBufferToImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyBufferToImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage2KHR(void *args) -{ - struct vkCmdCopyBufferToImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyBufferToImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyBufferToImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferToImageInfo; - } *params = args; - VkCopyBufferToImageInfo2 pCopyBufferToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferToImageInfo2_win32_to_host(ctx, (const VkCopyBufferToImageInfo232 *)UlongToPtr(params->pCopyBufferToImageInfo), &pCopyBufferToImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyBufferToImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyBufferToImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage(void *args) -{ - struct vkCmdCopyImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageCopy *)UlongToPtr(params->pRegions)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage2(void *args) -{ - struct vkCmdCopyImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageInfo; - } *params = args; - VkCopyImageInfo2 pCopyImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageInfo2_win32_to_host(ctx, (const VkCopyImageInfo232 *)UlongToPtr(params->pCopyImageInfo), &pCopyImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage2KHR(void *args) -{ - struct vkCmdCopyImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageInfo; - } *params = args; - VkCopyImageInfo2 pCopyImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageInfo2_win32_to_host(ctx, (const VkCopyImageInfo232 *)UlongToPtr(params->pCopyImageInfo), &pCopyImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer(void *args) -{ - struct vkCmdCopyImageToBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImageToBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstBuffer, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferImageCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferImageCopy_array_win32_to_host(ctx, (const VkBufferImageCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImageToBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstBuffer, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer2(void *args) -{ - struct vkCmdCopyImageToBuffer2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImageToBuffer2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyImageToBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageToBufferInfo; - } *params = args; - VkCopyImageToBufferInfo2 pCopyImageToBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageToBufferInfo2_win32_to_host(ctx, (const VkCopyImageToBufferInfo232 *)UlongToPtr(params->pCopyImageToBufferInfo), &pCopyImageToBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImageToBuffer2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyImageToBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer2KHR(void *args) -{ - struct vkCmdCopyImageToBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyImageToBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCopyImageToBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageToBufferInfo; - } *params = args; - VkCopyImageToBufferInfo2 pCopyImageToBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageToBufferInfo2_win32_to_host(ctx, (const VkCopyImageToBufferInfo232 *)UlongToPtr(params->pCopyImageToBufferInfo), &pCopyImageToBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyImageToBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pCopyImageToBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryIndirectNV(void *args) -{ - struct vkCmdCopyMemoryIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMemoryIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->copyBufferAddress, params->copyCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMemoryIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->copyBufferAddress, params->copyCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct vkCmdCopyMemoryToAccelerationStructureKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMemoryToAccelerationStructureKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMemoryToAccelerationStructureInfoKHR pInfo_host; - - convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host((const VkCopyMemoryToAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMemoryToAccelerationStructureKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToImageIndirectNV(void *args) -{ - struct vkCmdCopyMemoryToImageIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMemoryToImageIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->copyBufferAddress, params->copyCount, params->stride, params->dstImage, params->dstImageLayout, params->pImageSubresources); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToImageIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - PTR32 pImageSubresources; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMemoryToImageIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->copyBufferAddress, params->copyCount, params->stride, params->dstImage, params->dstImageLayout, (const VkImageSubresourceLayers *)UlongToPtr(params->pImageSubresources)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToMicromapEXT(void *args) -{ - struct vkCmdCopyMemoryToMicromapEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMemoryToMicromapEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToMicromapEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMemoryToMicromapInfoEXT pInfo_host; - - convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host((const VkCopyMemoryToMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMemoryToMicromapEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMicromapEXT(void *args) -{ - struct vkCmdCopyMicromapEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMicromapEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMicromapEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMicromapInfoEXT pInfo_host; - - convert_VkCopyMicromapInfoEXT_win32_to_host((const VkCopyMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMicromapEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMicromapToMemoryEXT(void *args) -{ - struct vkCmdCopyMicromapToMemoryEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyMicromapToMemoryEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMicromapToMemoryEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMicromapToMemoryInfoEXT pInfo_host; - - convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host((const VkCopyMicromapToMemoryInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyMicromapToMemoryEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyQueryPoolResults(void *args) -{ - struct vkCmdCopyQueryPoolResults_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCopyQueryPoolResults(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->firstQuery, params->queryCount, params->dstBuffer, params->dstOffset, params->stride, params->flags); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyQueryPoolResults(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCopyQueryPoolResults(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->firstQuery, params->queryCount, params->dstBuffer, params->dstOffset, params->stride, params->flags); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCuLaunchKernelNVX(void *args) -{ - struct vkCmdCuLaunchKernelNVX_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCuLaunchKernelNVX(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pLaunchInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCuLaunchKernelNVX(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLaunchInfo; - } *params = args; - VkCuLaunchInfoNVX pLaunchInfo_host; - - convert_VkCuLaunchInfoNVX_win32_to_host((const VkCuLaunchInfoNVX32 *)UlongToPtr(params->pLaunchInfo), &pLaunchInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCuLaunchKernelNVX(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pLaunchInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCudaLaunchKernelNV(void *args) -{ - struct vkCmdCudaLaunchKernelNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdCudaLaunchKernelNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pLaunchInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCudaLaunchKernelNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLaunchInfo; - } *params = args; - VkCudaLaunchInfoNV pLaunchInfo_host; - - convert_VkCudaLaunchInfoNV_win32_to_host((const VkCudaLaunchInfoNV32 *)UlongToPtr(params->pLaunchInfo), &pLaunchInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdCudaLaunchKernelNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pLaunchInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerBeginEXT(void *args) -{ - struct vkCmdDebugMarkerBeginEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDebugMarkerBeginEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pMarkerInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerBeginEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - } *params = args; - VkDebugMarkerMarkerInfoEXT pMarkerInfo_host; - - convert_VkDebugMarkerMarkerInfoEXT_win32_to_host((const VkDebugMarkerMarkerInfoEXT32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDebugMarkerBeginEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pMarkerInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerEndEXT(void *args) -{ - struct vkCmdDebugMarkerEndEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDebugMarkerEndEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerEndEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDebugMarkerEndEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerInsertEXT(void *args) -{ - struct vkCmdDebugMarkerInsertEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDebugMarkerInsertEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pMarkerInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerInsertEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - } *params = args; - VkDebugMarkerMarkerInfoEXT pMarkerInfo_host; - - convert_VkDebugMarkerMarkerInfoEXT_win32_to_host((const VkDebugMarkerMarkerInfoEXT32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDebugMarkerInsertEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pMarkerInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDecompressMemoryIndirectCountNV(void *args) -{ - struct vkCmdDecompressMemoryIndirectCountNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDecompressMemoryIndirectCountNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->indirectCommandsAddress, params->indirectCommandsCountAddress, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDecompressMemoryIndirectCountNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsCountAddress; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDecompressMemoryIndirectCountNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->indirectCommandsAddress, params->indirectCommandsCountAddress, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDecompressMemoryNV(void *args) -{ - struct vkCmdDecompressMemoryNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDecompressMemoryNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->decompressRegionCount, params->pDecompressMemoryRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDecompressMemoryNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t decompressRegionCount; - PTR32 pDecompressMemoryRegions; - } *params = args; - const VkDecompressMemoryRegionNV *pDecompressMemoryRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDecompressMemoryRegions_host = convert_VkDecompressMemoryRegionNV_array_win32_to_host(ctx, (const VkDecompressMemoryRegionNV32 *)UlongToPtr(params->pDecompressMemoryRegions), params->decompressRegionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDecompressMemoryNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->decompressRegionCount, pDecompressMemoryRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatch(void *args) -{ - struct vkCmdDispatch_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDispatch(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatch(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDispatch(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchBase(void *args) -{ - struct vkCmdDispatchBase_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDispatchBase(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchBase(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDispatchBase(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchBaseKHR(void *args) -{ - struct vkCmdDispatchBaseKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDispatchBaseKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchBaseKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDispatchBaseKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchIndirect(void *args) -{ - struct vkCmdDispatchIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDispatchIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDispatchIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDraw(void *args) -{ - struct vkCmdDraw_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDraw(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->vertexCount, params->instanceCount, params->firstVertex, params->firstInstance); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDraw(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDraw(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->vertexCount, params->instanceCount, params->firstVertex, params->firstInstance); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawClusterHUAWEI(void *args) -{ - struct vkCmdDrawClusterHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawClusterHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawClusterHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawClusterHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawClusterIndirectHUAWEI(void *args) -{ - struct vkCmdDrawClusterIndirectHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawClusterIndirectHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawClusterIndirectHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawClusterIndirectHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexed(void *args) -{ - struct vkCmdDrawIndexed_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndexed(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->indexCount, params->instanceCount, params->firstIndex, params->vertexOffset, params->firstInstance); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexed(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndexed(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->indexCount, params->instanceCount, params->firstIndex, params->vertexOffset, params->firstInstance); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirect(void *args) -{ - struct vkCmdDrawIndexedIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndexedIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndexedIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCount(void *args) -{ - struct vkCmdDrawIndexedIndirectCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndexedIndirectCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCount(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndexedIndirectCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCountAMD(void *args) -{ - struct vkCmdDrawIndexedIndirectCountAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndexedIndirectCountAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCountAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndexedIndirectCountAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCountKHR(void *args) -{ - struct vkCmdDrawIndexedIndirectCountKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndexedIndirectCountKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCountKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndexedIndirectCountKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirect(void *args) -{ - struct vkCmdDrawIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectByteCountEXT(void *args) -{ - struct vkCmdDrawIndirectByteCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndirectByteCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->instanceCount, params->firstInstance, params->counterBuffer, params->counterBufferOffset, params->counterOffset, params->vertexStride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectByteCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t instanceCount; - uint32_t firstInstance; - VkBuffer DECLSPEC_ALIGN(8) counterBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) counterBufferOffset; - uint32_t counterOffset; - uint32_t vertexStride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndirectByteCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->instanceCount, params->firstInstance, params->counterBuffer, params->counterBufferOffset, params->counterOffset, params->vertexStride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCount(void *args) -{ - struct vkCmdDrawIndirectCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndirectCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCount(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndirectCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCountAMD(void *args) -{ - struct vkCmdDrawIndirectCountAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndirectCountAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCountAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndirectCountAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCountKHR(void *args) -{ - struct vkCmdDrawIndirectCountKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawIndirectCountKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCountKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawIndirectCountKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksEXT(void *args) -{ - struct vkCmdDrawMeshTasksEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectCountEXT(void *args) -{ - struct vkCmdDrawMeshTasksIndirectCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksIndirectCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksIndirectCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectCountNV(void *args) -{ - struct vkCmdDrawMeshTasksIndirectCountNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksIndirectCountNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectCountNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksIndirectCountNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectEXT(void *args) -{ - struct vkCmdDrawMeshTasksIndirectEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksIndirectEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksIndirectEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectNV(void *args) -{ - struct vkCmdDrawMeshTasksIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksNV(void *args) -{ - struct vkCmdDrawMeshTasksNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMeshTasksNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->taskCount, params->firstTask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t taskCount; - uint32_t firstTask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMeshTasksNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->taskCount, params->firstTask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMultiEXT(void *args) -{ - struct vkCmdDrawMultiEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMultiEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->drawCount, params->pVertexInfo, params->instanceCount, params->firstInstance, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMultiEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t drawCount; - PTR32 pVertexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMultiEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->drawCount, (const VkMultiDrawInfoEXT *)UlongToPtr(params->pVertexInfo), params->instanceCount, params->firstInstance, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMultiIndexedEXT(void *args) -{ - struct vkCmdDrawMultiIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdDrawMultiIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->drawCount, params->pIndexInfo, params->instanceCount, params->firstInstance, params->stride, params->pVertexOffset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMultiIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t drawCount; - PTR32 pIndexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - PTR32 pVertexOffset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdDrawMultiIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->drawCount, (const VkMultiDrawIndexedInfoEXT *)UlongToPtr(params->pIndexInfo), params->instanceCount, params->firstInstance, params->stride, (const int32_t *)UlongToPtr(params->pVertexOffset)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndConditionalRenderingEXT(void *args) -{ - struct vkCmdEndConditionalRenderingEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndConditionalRenderingEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndConditionalRenderingEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndConditionalRenderingEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndDebugUtilsLabelEXT(void *args) -{ - struct vkCmdEndDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndQuery(void *args) -{ - struct vkCmdEndQuery_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndQuery(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndQuery(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndQuery(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndQueryIndexedEXT(void *args) -{ - struct vkCmdEndQueryIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndQueryIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->query, params->index); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndQueryIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - uint32_t index; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndQueryIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->query, params->index); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass(void *args) -{ - struct vkCmdEndRenderPass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndRenderPass(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndRenderPass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass2(void *args) -{ - struct vkCmdEndRenderPass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndRenderPass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndRenderPass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass2KHR(void *args) -{ - struct vkCmdEndRenderPass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndRenderPass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndRenderPass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRendering(void *args) -{ - struct vkCmdEndRendering_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndRendering(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRendering(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndRendering(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderingKHR(void *args) -{ - struct vkCmdEndRenderingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndRenderingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndRenderingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndTransformFeedbackEXT(void *args) -{ - struct vkCmdEndTransformFeedbackEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdEndTransformFeedbackEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstCounterBuffer, params->counterBufferCount, params->pCounterBuffers, params->pCounterBufferOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndTransformFeedbackEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - PTR32 pCounterBuffers; - PTR32 pCounterBufferOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdEndTransformFeedbackEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstCounterBuffer, params->counterBufferCount, (const VkBuffer *)UlongToPtr(params->pCounterBuffers), (const VkDeviceSize *)UlongToPtr(params->pCounterBufferOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdExecuteCommands(void *args) -{ - struct vkCmdExecuteCommands_params *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win64_to_host(ctx, params->pCommandBuffers, params->commandBufferCount); - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdExecuteCommands(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdExecuteCommands(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - } *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(params->pCommandBuffers), params->commandBufferCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdExecuteCommands(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdExecuteGeneratedCommandsNV(void *args) -{ - struct vkCmdExecuteGeneratedCommandsNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdExecuteGeneratedCommandsNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->isPreprocessed, params->pGeneratedCommandsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdExecuteGeneratedCommandsNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 isPreprocessed; - PTR32 pGeneratedCommandsInfo; - } *params = args; - VkGeneratedCommandsInfoNV pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoNV_win32_to_host(ctx, (const VkGeneratedCommandsInfoNV32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdExecuteGeneratedCommandsNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->isPreprocessed, &pGeneratedCommandsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdFillBuffer(void *args) -{ - struct vkCmdFillBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdFillBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->dstBuffer, params->dstOffset, params->size, params->data); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdFillBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - uint32_t data; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdFillBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->dstBuffer, params->dstOffset, params->size, params->data); -} - -#ifdef _WIN64 -static void thunk64_vkCmdInsertDebugUtilsLabelEXT(void *args) -{ - struct vkCmdInsertDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdInsertDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pLabelInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdInsertDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdInsertDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pLabelInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass(void *args) -{ - struct vkCmdNextSubpass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdNextSubpass(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->contents); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSubpassContents contents; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdNextSubpass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->contents); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass2(void *args) -{ - struct vkCmdNextSubpass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdNextSubpass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pSubpassBeginInfo, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassBeginInfo; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassBeginInfo pSubpassBeginInfo_host; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdNextSubpass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pSubpassBeginInfo_host, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass2KHR(void *args) -{ - struct vkCmdNextSubpass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdNextSubpass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pSubpassBeginInfo, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassBeginInfo; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassBeginInfo pSubpassBeginInfo_host; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdNextSubpass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pSubpassBeginInfo_host, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdOpticalFlowExecuteNV(void *args) -{ - struct vkCmdOpticalFlowExecuteNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdOpticalFlowExecuteNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->session, params->pExecuteInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdOpticalFlowExecuteNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - PTR32 pExecuteInfo; - } *params = args; - VkOpticalFlowExecuteInfoNV pExecuteInfo_host; - - convert_VkOpticalFlowExecuteInfoNV_win32_to_host((const VkOpticalFlowExecuteInfoNV32 *)UlongToPtr(params->pExecuteInfo), &pExecuteInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdOpticalFlowExecuteNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->session, &pExecuteInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier(void *args) -{ - struct vkCmdPipelineBarrier_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPipelineBarrier(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcStageMask, params->dstStageMask, params->dependencyFlags, params->memoryBarrierCount, params->pMemoryBarriers, params->bufferMemoryBarrierCount, params->pBufferMemoryBarriers, params->imageMemoryBarrierCount, params->pImageMemoryBarriers); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; - } *params = args; - const VkMemoryBarrier *pMemoryBarriers_host; - const VkBufferMemoryBarrier *pBufferMemoryBarriers_host; - const VkImageMemoryBarrier *pImageMemoryBarriers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pMemoryBarriers_host = convert_VkMemoryBarrier_array_win32_to_host(ctx, (const VkMemoryBarrier32 *)UlongToPtr(params->pMemoryBarriers), params->memoryBarrierCount); - pBufferMemoryBarriers_host = convert_VkBufferMemoryBarrier_array_win32_to_host(ctx, (const VkBufferMemoryBarrier32 *)UlongToPtr(params->pBufferMemoryBarriers), params->bufferMemoryBarrierCount); - pImageMemoryBarriers_host = convert_VkImageMemoryBarrier_array_win32_to_host(ctx, (const VkImageMemoryBarrier32 *)UlongToPtr(params->pImageMemoryBarriers), params->imageMemoryBarrierCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPipelineBarrier(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcStageMask, params->dstStageMask, params->dependencyFlags, params->memoryBarrierCount, pMemoryBarriers_host, params->bufferMemoryBarrierCount, pBufferMemoryBarriers_host, params->imageMemoryBarrierCount, pImageMemoryBarriers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier2(void *args) -{ - struct vkCmdPipelineBarrier2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPipelineBarrier2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPipelineBarrier2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier2KHR(void *args) -{ - struct vkCmdPipelineBarrier2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPipelineBarrier2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPipelineBarrier2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPreprocessGeneratedCommandsNV(void *args) -{ - struct vkCmdPreprocessGeneratedCommandsNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPreprocessGeneratedCommandsNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pGeneratedCommandsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPreprocessGeneratedCommandsNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pGeneratedCommandsInfo; - } *params = args; - VkGeneratedCommandsInfoNV pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoNV_win32_to_host(ctx, (const VkGeneratedCommandsInfoNV32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPreprocessGeneratedCommandsNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pGeneratedCommandsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushConstants(void *args) -{ - struct vkCmdPushConstants_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPushConstants(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->layout, params->stageFlags, params->offset, params->size, params->pValues); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushConstants(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - PTR32 pValues; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPushConstants(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->layout, params->stageFlags, params->offset, params->size, (const void *)UlongToPtr(params->pValues)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetKHR(void *args) -{ - struct vkCmdPushDescriptorSetKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPushDescriptorSetKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, params->pDescriptorWrites); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; - } *params = args; - const VkWriteDescriptorSet *pDescriptorWrites_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(params->pDescriptorWrites), params->descriptorWriteCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPushDescriptorSetKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, pDescriptorWrites_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetWithTemplateKHR(void *args) -{ - struct vkCmdPushDescriptorSetWithTemplateKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdPushDescriptorSetWithTemplateKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetWithTemplateKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - PTR32 pData; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdPushDescriptorSetWithTemplateKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent(void *args) -{ - struct vkCmdResetEvent_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResetEvent(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResetEvent(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent2(void *args) -{ - struct vkCmdResetEvent2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResetEvent2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResetEvent2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent2KHR(void *args) -{ - struct vkCmdResetEvent2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResetEvent2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResetEvent2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetQueryPool(void *args) -{ - struct vkCmdResetQueryPool_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResetQueryPool(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->queryPool, params->firstQuery, params->queryCount); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetQueryPool(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResetQueryPool(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->queryPool, params->firstQuery, params->queryCount); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage(void *args) -{ - struct vkCmdResolveImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResolveImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResolveImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageResolve *)UlongToPtr(params->pRegions)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage2(void *args) -{ - struct vkCmdResolveImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResolveImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pResolveImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pResolveImageInfo; - } *params = args; - VkResolveImageInfo2 pResolveImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkResolveImageInfo2_win32_to_host(ctx, (const VkResolveImageInfo232 *)UlongToPtr(params->pResolveImageInfo), &pResolveImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResolveImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pResolveImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage2KHR(void *args) -{ - struct vkCmdResolveImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdResolveImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pResolveImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pResolveImageInfo; - } *params = args; - VkResolveImageInfo2 pResolveImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkResolveImageInfo2_win32_to_host(ctx, (const VkResolveImageInfo232 *)UlongToPtr(params->pResolveImageInfo), &pResolveImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdResolveImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pResolveImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAlphaToCoverageEnableEXT(void *args) -{ - struct vkCmdSetAlphaToCoverageEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetAlphaToCoverageEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->alphaToCoverageEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAlphaToCoverageEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 alphaToCoverageEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetAlphaToCoverageEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->alphaToCoverageEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAlphaToOneEnableEXT(void *args) -{ - struct vkCmdSetAlphaToOneEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetAlphaToOneEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->alphaToOneEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAlphaToOneEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 alphaToOneEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetAlphaToOneEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->alphaToOneEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAttachmentFeedbackLoopEnableEXT(void *args) -{ - struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetAttachmentFeedbackLoopEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->aspectMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAttachmentFeedbackLoopEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageAspectFlags aspectMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetAttachmentFeedbackLoopEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->aspectMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetBlendConstants(void *args) -{ - struct vkCmdSetBlendConstants_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetBlendConstants(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->blendConstants); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetBlendConstants(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 blendConstants; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetBlendConstants(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, (const float *)UlongToPtr(params->blendConstants)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCheckpointNV(void *args) -{ - struct vkCmdSetCheckpointNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCheckpointNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pCheckpointMarker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCheckpointNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCheckpointMarker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCheckpointNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, (const void *)UlongToPtr(params->pCheckpointMarker)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoarseSampleOrderNV(void *args) -{ - struct vkCmdSetCoarseSampleOrderNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoarseSampleOrderNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->sampleOrderType, params->customSampleOrderCount, params->pCustomSampleOrders); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoarseSampleOrderNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - PTR32 pCustomSampleOrders; - } *params = args; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCustomSampleOrders_host = convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(ctx, (const VkCoarseSampleOrderCustomNV32 *)UlongToPtr(params->pCustomSampleOrders), params->customSampleOrderCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoarseSampleOrderNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->sampleOrderType, params->customSampleOrderCount, pCustomSampleOrders_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendAdvancedEXT(void *args) -{ - struct vkCmdSetColorBlendAdvancedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetColorBlendAdvancedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendAdvanced); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendAdvancedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendAdvanced; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetColorBlendAdvancedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorBlendAdvancedEXT *)UlongToPtr(params->pColorBlendAdvanced)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendEnableEXT(void *args) -{ - struct vkCmdSetColorBlendEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetColorBlendEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetColorBlendEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstAttachment, params->attachmentCount, (const VkBool32 *)UlongToPtr(params->pColorBlendEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendEquationEXT(void *args) -{ - struct vkCmdSetColorBlendEquationEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetColorBlendEquationEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendEquations); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendEquationEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendEquations; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetColorBlendEquationEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorBlendEquationEXT *)UlongToPtr(params->pColorBlendEquations)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorWriteEnableEXT(void *args) -{ - struct vkCmdSetColorWriteEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetColorWriteEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->attachmentCount, params->pColorWriteEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorWriteEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t attachmentCount; - PTR32 pColorWriteEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetColorWriteEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->attachmentCount, (const VkBool32 *)UlongToPtr(params->pColorWriteEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorWriteMaskEXT(void *args) -{ - struct vkCmdSetColorWriteMaskEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetColorWriteMaskEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstAttachment, params->attachmentCount, params->pColorWriteMasks); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorWriteMaskEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorWriteMasks; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetColorWriteMaskEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorComponentFlags *)UlongToPtr(params->pColorWriteMasks)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetConservativeRasterizationModeEXT(void *args) -{ - struct vkCmdSetConservativeRasterizationModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetConservativeRasterizationModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->conservativeRasterizationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetConservativeRasterizationModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetConservativeRasterizationModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->conservativeRasterizationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationModeNV(void *args) -{ - struct vkCmdSetCoverageModulationModeNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageModulationModeNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageModulationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationModeNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoverageModulationModeNV coverageModulationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageModulationModeNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageModulationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationTableEnableNV(void *args) -{ - struct vkCmdSetCoverageModulationTableEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageModulationTableEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageModulationTableEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationTableEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 coverageModulationTableEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageModulationTableEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageModulationTableEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationTableNV(void *args) -{ - struct vkCmdSetCoverageModulationTableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageModulationTableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageModulationTableCount, params->pCoverageModulationTable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationTableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t coverageModulationTableCount; - PTR32 pCoverageModulationTable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageModulationTableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageModulationTableCount, (const float *)UlongToPtr(params->pCoverageModulationTable)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageReductionModeNV(void *args) -{ - struct vkCmdSetCoverageReductionModeNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageReductionModeNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageReductionMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageReductionModeNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoverageReductionModeNV coverageReductionMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageReductionModeNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageReductionMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageToColorEnableNV(void *args) -{ - struct vkCmdSetCoverageToColorEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageToColorEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageToColorEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageToColorEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 coverageToColorEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageToColorEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageToColorEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageToColorLocationNV(void *args) -{ - struct vkCmdSetCoverageToColorLocationNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCoverageToColorLocationNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->coverageToColorLocation); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageToColorLocationNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t coverageToColorLocation; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCoverageToColorLocationNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->coverageToColorLocation); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCullMode(void *args) -{ - struct vkCmdSetCullMode_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCullMode(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->cullMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCullMode(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCullModeFlags cullMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCullMode(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->cullMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCullModeEXT(void *args) -{ - struct vkCmdSetCullModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetCullModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->cullMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCullModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCullModeFlags cullMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetCullModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->cullMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBias(void *args) -{ - struct vkCmdSetDepthBias_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBias(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthBiasConstantFactor, params->depthBiasClamp, params->depthBiasSlopeFactor); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBias(void *args) -{ - struct - { - PTR32 commandBuffer; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBias(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthBiasConstantFactor, params->depthBiasClamp, params->depthBiasSlopeFactor); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBias2EXT(void *args) -{ - struct vkCmdSetDepthBias2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBias2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pDepthBiasInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBias2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDepthBiasInfo; - } *params = args; - VkDepthBiasInfoEXT pDepthBiasInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDepthBiasInfoEXT_win32_to_host(ctx, (const VkDepthBiasInfoEXT32 *)UlongToPtr(params->pDepthBiasInfo), &pDepthBiasInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBias2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pDepthBiasInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBiasEnable(void *args) -{ - struct vkCmdSetDepthBiasEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBiasEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthBiasEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBiasEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBiasEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBiasEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthBiasEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBiasEnableEXT(void *args) -{ - struct vkCmdSetDepthBiasEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBiasEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthBiasEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBiasEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBiasEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBiasEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthBiasEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBounds(void *args) -{ - struct vkCmdSetDepthBounds_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBounds(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->minDepthBounds, params->maxDepthBounds); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBounds(void *args) -{ - struct - { - PTR32 commandBuffer; - float minDepthBounds; - float maxDepthBounds; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBounds(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->minDepthBounds, params->maxDepthBounds); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBoundsTestEnable(void *args) -{ - struct vkCmdSetDepthBoundsTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBoundsTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthBoundsTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBoundsTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBoundsTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBoundsTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthBoundsTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBoundsTestEnableEXT(void *args) -{ - struct vkCmdSetDepthBoundsTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthBoundsTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthBoundsTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBoundsTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBoundsTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthBoundsTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthBoundsTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClampEnableEXT(void *args) -{ - struct vkCmdSetDepthClampEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthClampEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthClampEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClampEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthClampEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthClampEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthClampEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClipEnableEXT(void *args) -{ - struct vkCmdSetDepthClipEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthClipEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthClipEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClipEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthClipEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthClipEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthClipEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClipNegativeOneToOneEXT(void *args) -{ - struct vkCmdSetDepthClipNegativeOneToOneEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthClipNegativeOneToOneEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->negativeOneToOne); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClipNegativeOneToOneEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 negativeOneToOne; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthClipNegativeOneToOneEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->negativeOneToOne); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthCompareOp(void *args) -{ - struct vkCmdSetDepthCompareOp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthCompareOp(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthCompareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthCompareOp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCompareOp depthCompareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthCompareOp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthCompareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthCompareOpEXT(void *args) -{ - struct vkCmdSetDepthCompareOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthCompareOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthCompareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthCompareOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCompareOp depthCompareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthCompareOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthCompareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthTestEnable(void *args) -{ - struct vkCmdSetDepthTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthTestEnableEXT(void *args) -{ - struct vkCmdSetDepthTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthWriteEnable(void *args) -{ - struct vkCmdSetDepthWriteEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthWriteEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthWriteEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthWriteEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthWriteEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthWriteEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthWriteEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthWriteEnableEXT(void *args) -{ - struct vkCmdSetDepthWriteEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDepthWriteEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->depthWriteEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthWriteEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthWriteEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDepthWriteEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->depthWriteEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDescriptorBufferOffsetsEXT(void *args) -{ - struct vkCmdSetDescriptorBufferOffsetsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDescriptorBufferOffsetsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->setCount, params->pBufferIndices, params->pOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDescriptorBufferOffsetsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - PTR32 pBufferIndices; - PTR32 pOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDescriptorBufferOffsetsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->setCount, (const uint32_t *)UlongToPtr(params->pBufferIndices), (const VkDeviceSize *)UlongToPtr(params->pOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDeviceMask(void *args) -{ - struct vkCmdSetDeviceMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDeviceMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->deviceMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDeviceMask(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t deviceMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDeviceMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->deviceMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDeviceMaskKHR(void *args) -{ - struct vkCmdSetDeviceMaskKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDeviceMaskKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->deviceMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDeviceMaskKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t deviceMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDeviceMaskKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->deviceMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleEXT(void *args) -{ - struct vkCmdSetDiscardRectangleEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDiscardRectangleEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstDiscardRectangle, params->discardRectangleCount, params->pDiscardRectangles); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstDiscardRectangle; - uint32_t discardRectangleCount; - PTR32 pDiscardRectangles; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDiscardRectangleEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstDiscardRectangle, params->discardRectangleCount, (const VkRect2D *)UlongToPtr(params->pDiscardRectangles)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleEnableEXT(void *args) -{ - struct vkCmdSetDiscardRectangleEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDiscardRectangleEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->discardRectangleEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 discardRectangleEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDiscardRectangleEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->discardRectangleEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleModeEXT(void *args) -{ - struct vkCmdSetDiscardRectangleModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetDiscardRectangleModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->discardRectangleMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDiscardRectangleModeEXT discardRectangleMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetDiscardRectangleModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->discardRectangleMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent(void *args) -{ - struct vkCmdSetEvent_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetEvent(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetEvent(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent2(void *args) -{ - struct vkCmdSetEvent2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetEvent2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetEvent2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent2KHR(void *args) -{ - struct vkCmdSetEvent2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetEvent2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->event, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetEvent2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->event, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExclusiveScissorEnableNV(void *args) -{ - struct vkCmdSetExclusiveScissorEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetExclusiveScissorEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, params->pExclusiveScissorEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExclusiveScissorEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissorEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetExclusiveScissorEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, (const VkBool32 *)UlongToPtr(params->pExclusiveScissorEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExclusiveScissorNV(void *args) -{ - struct vkCmdSetExclusiveScissorNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetExclusiveScissorNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, params->pExclusiveScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExclusiveScissorNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetExclusiveScissorNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, (const VkRect2D *)UlongToPtr(params->pExclusiveScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExtraPrimitiveOverestimationSizeEXT(void *args) -{ - struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetExtraPrimitiveOverestimationSizeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->extraPrimitiveOverestimationSize); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExtraPrimitiveOverestimationSizeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - float extraPrimitiveOverestimationSize; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetExtraPrimitiveOverestimationSizeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->extraPrimitiveOverestimationSize); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFragmentShadingRateEnumNV(void *args) -{ - struct vkCmdSetFragmentShadingRateEnumNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetFragmentShadingRateEnumNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->shadingRate, params->combinerOps); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFragmentShadingRateEnumNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFragmentShadingRateNV shadingRate; - PTR32 combinerOps; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetFragmentShadingRateEnumNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->shadingRate, (const VkFragmentShadingRateCombinerOpKHR *)UlongToPtr(params->combinerOps)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFragmentShadingRateKHR(void *args) -{ - struct vkCmdSetFragmentShadingRateKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetFragmentShadingRateKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pFragmentSize, params->combinerOps); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFragmentShadingRateKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pFragmentSize; - PTR32 combinerOps; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetFragmentShadingRateKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, (const VkExtent2D *)UlongToPtr(params->pFragmentSize), (const VkFragmentShadingRateCombinerOpKHR *)UlongToPtr(params->combinerOps)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFrontFace(void *args) -{ - struct vkCmdSetFrontFace_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetFrontFace(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->frontFace); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFrontFace(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFrontFace frontFace; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetFrontFace(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->frontFace); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFrontFaceEXT(void *args) -{ - struct vkCmdSetFrontFaceEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetFrontFaceEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->frontFace); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFrontFaceEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFrontFace frontFace; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetFrontFaceEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->frontFace); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineRasterizationModeEXT(void *args) -{ - struct vkCmdSetLineRasterizationModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLineRasterizationModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->lineRasterizationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineRasterizationModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkLineRasterizationModeEXT lineRasterizationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLineRasterizationModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->lineRasterizationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStippleEXT(void *args) -{ - struct vkCmdSetLineStippleEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLineStippleEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStippleEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLineStippleEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStippleEnableEXT(void *args) -{ - struct vkCmdSetLineStippleEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLineStippleEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stippledLineEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStippleEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stippledLineEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLineStippleEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stippledLineEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineWidth(void *args) -{ - struct vkCmdSetLineWidth_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLineWidth(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->lineWidth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineWidth(void *args) -{ - struct - { - PTR32 commandBuffer; - float lineWidth; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLineWidth(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->lineWidth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLogicOpEXT(void *args) -{ - struct vkCmdSetLogicOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLogicOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->logicOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLogicOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkLogicOp logicOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLogicOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->logicOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLogicOpEnableEXT(void *args) -{ - struct vkCmdSetLogicOpEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetLogicOpEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->logicOpEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLogicOpEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 logicOpEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetLogicOpEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->logicOpEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPatchControlPointsEXT(void *args) -{ - struct vkCmdSetPatchControlPointsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPatchControlPointsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->patchControlPoints); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPatchControlPointsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t patchControlPoints; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPatchControlPointsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->patchControlPoints); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceMarkerINTEL(void *args) -{ - struct vkCmdSetPerformanceMarkerINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pMarkerInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPerformanceMarkerINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceMarkerINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - VkResult result; - } *params = args; - VkPerformanceMarkerInfoINTEL pMarkerInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pMarkerInfo); - - convert_VkPerformanceMarkerInfoINTEL_win32_to_host((const VkPerformanceMarkerInfoINTEL32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPerformanceMarkerINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceOverrideINTEL(void *args) -{ - struct vkCmdSetPerformanceOverrideINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pOverrideInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPerformanceOverrideINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pOverrideInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceOverrideINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pOverrideInfo; - VkResult result; - } *params = args; - VkPerformanceOverrideInfoINTEL pOverrideInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pOverrideInfo); - - convert_VkPerformanceOverrideInfoINTEL_win32_to_host((const VkPerformanceOverrideInfoINTEL32 *)UlongToPtr(params->pOverrideInfo), &pOverrideInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPerformanceOverrideINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pOverrideInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceStreamMarkerINTEL(void *args) -{ - struct vkCmdSetPerformanceStreamMarkerINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pMarkerInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPerformanceStreamMarkerINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceStreamMarkerINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - VkResult result; - } *params = args; - VkPerformanceStreamMarkerInfoINTEL pMarkerInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pMarkerInfo); - - convert_VkPerformanceStreamMarkerInfoINTEL_win32_to_host((const VkPerformanceStreamMarkerInfoINTEL32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPerformanceStreamMarkerINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPolygonModeEXT(void *args) -{ - struct vkCmdSetPolygonModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPolygonModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->polygonMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPolygonModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPolygonMode polygonMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPolygonModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->polygonMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveRestartEnable(void *args) -{ - struct vkCmdSetPrimitiveRestartEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPrimitiveRestartEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->primitiveRestartEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveRestartEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 primitiveRestartEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPrimitiveRestartEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->primitiveRestartEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveRestartEnableEXT(void *args) -{ - struct vkCmdSetPrimitiveRestartEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPrimitiveRestartEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->primitiveRestartEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveRestartEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 primitiveRestartEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPrimitiveRestartEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->primitiveRestartEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveTopology(void *args) -{ - struct vkCmdSetPrimitiveTopology_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPrimitiveTopology(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->primitiveTopology); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveTopology(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPrimitiveTopology primitiveTopology; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPrimitiveTopology(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->primitiveTopology); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveTopologyEXT(void *args) -{ - struct vkCmdSetPrimitiveTopologyEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetPrimitiveTopologyEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->primitiveTopology); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveTopologyEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPrimitiveTopology primitiveTopology; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetPrimitiveTopologyEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->primitiveTopology); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetProvokingVertexModeEXT(void *args) -{ - struct vkCmdSetProvokingVertexModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetProvokingVertexModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->provokingVertexMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetProvokingVertexModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkProvokingVertexModeEXT provokingVertexMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetProvokingVertexModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->provokingVertexMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizationSamplesEXT(void *args) -{ - struct vkCmdSetRasterizationSamplesEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRasterizationSamplesEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->rasterizationSamples); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizationSamplesEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSampleCountFlagBits rasterizationSamples; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRasterizationSamplesEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->rasterizationSamples); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizationStreamEXT(void *args) -{ - struct vkCmdSetRasterizationStreamEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRasterizationStreamEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->rasterizationStream); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizationStreamEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t rasterizationStream; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRasterizationStreamEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->rasterizationStream); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizerDiscardEnable(void *args) -{ - struct vkCmdSetRasterizerDiscardEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRasterizerDiscardEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->rasterizerDiscardEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizerDiscardEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 rasterizerDiscardEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRasterizerDiscardEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->rasterizerDiscardEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizerDiscardEnableEXT(void *args) -{ - struct vkCmdSetRasterizerDiscardEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRasterizerDiscardEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->rasterizerDiscardEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizerDiscardEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 rasterizerDiscardEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRasterizerDiscardEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->rasterizerDiscardEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRayTracingPipelineStackSizeKHR(void *args) -{ - struct vkCmdSetRayTracingPipelineStackSizeKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRayTracingPipelineStackSizeKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineStackSize); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRayTracingPipelineStackSizeKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t pipelineStackSize; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRayTracingPipelineStackSizeKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineStackSize); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRepresentativeFragmentTestEnableNV(void *args) -{ - struct vkCmdSetRepresentativeFragmentTestEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetRepresentativeFragmentTestEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->representativeFragmentTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRepresentativeFragmentTestEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 representativeFragmentTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetRepresentativeFragmentTestEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->representativeFragmentTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleLocationsEXT(void *args) -{ - struct vkCmdSetSampleLocationsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetSampleLocationsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pSampleLocationsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleLocationsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSampleLocationsInfo; - } *params = args; - VkSampleLocationsInfoEXT pSampleLocationsInfo_host; - - convert_VkSampleLocationsInfoEXT_win32_to_host((const VkSampleLocationsInfoEXT32 *)UlongToPtr(params->pSampleLocationsInfo), &pSampleLocationsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetSampleLocationsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pSampleLocationsInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleLocationsEnableEXT(void *args) -{ - struct vkCmdSetSampleLocationsEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetSampleLocationsEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->sampleLocationsEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleLocationsEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 sampleLocationsEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetSampleLocationsEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->sampleLocationsEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleMaskEXT(void *args) -{ - struct vkCmdSetSampleMaskEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetSampleMaskEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->samples, params->pSampleMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleMaskEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSampleCountFlagBits samples; - PTR32 pSampleMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetSampleMaskEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->samples, (const VkSampleMask *)UlongToPtr(params->pSampleMask)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissor(void *args) -{ - struct vkCmdSetScissor_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetScissor(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstScissor, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissor(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstScissor; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetScissor(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstScissor, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissorWithCount(void *args) -{ - struct vkCmdSetScissorWithCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetScissorWithCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissorWithCount(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetScissorWithCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissorWithCountEXT(void *args) -{ - struct vkCmdSetScissorWithCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetScissorWithCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissorWithCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetScissorWithCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetShadingRateImageEnableNV(void *args) -{ - struct vkCmdSetShadingRateImageEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetShadingRateImageEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->shadingRateImageEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetShadingRateImageEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 shadingRateImageEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetShadingRateImageEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->shadingRateImageEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilCompareMask(void *args) -{ - struct vkCmdSetStencilCompareMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilCompareMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->faceMask, params->compareMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilCompareMask(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t compareMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilCompareMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->faceMask, params->compareMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilOp(void *args) -{ - struct vkCmdSetStencilOp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilOp(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilOp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilOp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilOpEXT(void *args) -{ - struct vkCmdSetStencilOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilReference(void *args) -{ - struct vkCmdSetStencilReference_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilReference(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->faceMask, params->reference); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilReference(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t reference; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilReference(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->faceMask, params->reference); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilTestEnable(void *args) -{ - struct vkCmdSetStencilTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stencilTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stencilTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stencilTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilTestEnableEXT(void *args) -{ - struct vkCmdSetStencilTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stencilTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stencilTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stencilTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilWriteMask(void *args) -{ - struct vkCmdSetStencilWriteMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetStencilWriteMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->faceMask, params->writeMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilWriteMask(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t writeMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetStencilWriteMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->faceMask, params->writeMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetTessellationDomainOriginEXT(void *args) -{ - struct vkCmdSetTessellationDomainOriginEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetTessellationDomainOriginEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->domainOrigin); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetTessellationDomainOriginEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkTessellationDomainOrigin domainOrigin; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetTessellationDomainOriginEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->domainOrigin); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetVertexInputEXT(void *args) -{ - struct vkCmdSetVertexInputEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetVertexInputEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->vertexBindingDescriptionCount, params->pVertexBindingDescriptions, params->vertexAttributeDescriptionCount, params->pVertexAttributeDescriptions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetVertexInputEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t vertexBindingDescriptionCount; - PTR32 pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - PTR32 pVertexAttributeDescriptions; - } *params = args; - const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions_host; - const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pVertexBindingDescriptions_host = convert_VkVertexInputBindingDescription2EXT_array_win32_to_host(ctx, (const VkVertexInputBindingDescription2EXT32 *)UlongToPtr(params->pVertexBindingDescriptions), params->vertexBindingDescriptionCount); - pVertexAttributeDescriptions_host = convert_VkVertexInputAttributeDescription2EXT_array_win32_to_host(ctx, (const VkVertexInputAttributeDescription2EXT32 *)UlongToPtr(params->pVertexAttributeDescriptions), params->vertexAttributeDescriptionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetVertexInputEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->vertexBindingDescriptionCount, pVertexBindingDescriptions_host, params->vertexAttributeDescriptionCount, pVertexAttributeDescriptions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewport(void *args) -{ - struct vkCmdSetViewport_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewport(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstViewport, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewport(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewport(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstViewport, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportShadingRatePaletteNV(void *args) -{ - struct vkCmdSetViewportShadingRatePaletteNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportShadingRatePaletteNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstViewport, params->viewportCount, params->pShadingRatePalettes); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportShadingRatePaletteNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pShadingRatePalettes; - } *params = args; - const VkShadingRatePaletteNV *pShadingRatePalettes_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pShadingRatePalettes_host = convert_VkShadingRatePaletteNV_array_win32_to_host(ctx, (const VkShadingRatePaletteNV32 *)UlongToPtr(params->pShadingRatePalettes), params->viewportCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportShadingRatePaletteNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstViewport, params->viewportCount, pShadingRatePalettes_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportSwizzleNV(void *args) -{ - struct vkCmdSetViewportSwizzleNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportSwizzleNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstViewport, params->viewportCount, params->pViewportSwizzles); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportSwizzleNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewportSwizzles; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportSwizzleNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstViewport, params->viewportCount, (const VkViewportSwizzleNV *)UlongToPtr(params->pViewportSwizzles)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWScalingEnableNV(void *args) -{ - struct vkCmdSetViewportWScalingEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportWScalingEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->viewportWScalingEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWScalingEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 viewportWScalingEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportWScalingEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->viewportWScalingEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWScalingNV(void *args) -{ - struct vkCmdSetViewportWScalingNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportWScalingNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->firstViewport, params->viewportCount, params->pViewportWScalings); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWScalingNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewportWScalings; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportWScalingNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->firstViewport, params->viewportCount, (const VkViewportWScalingNV *)UlongToPtr(params->pViewportWScalings)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWithCount(void *args) -{ - struct vkCmdSetViewportWithCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportWithCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWithCount(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportWithCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWithCountEXT(void *args) -{ - struct vkCmdSetViewportWithCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSetViewportWithCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWithCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSetViewportWithCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSubpassShadingHUAWEI(void *args) -{ - struct vkCmdSubpassShadingHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdSubpassShadingHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSubpassShadingHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdSubpassShadingHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysIndirect2KHR(void *args) -{ - struct vkCmdTraceRaysIndirect2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdTraceRaysIndirect2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->indirectDeviceAddress); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysIndirect2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdTraceRaysIndirect2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->indirectDeviceAddress); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysIndirectKHR(void *args) -{ - struct vkCmdTraceRaysIndirectKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdTraceRaysIndirectKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRaygenShaderBindingTable, params->pMissShaderBindingTable, params->pHitShaderBindingTable, params->pCallableShaderBindingTable, params->indirectDeviceAddress); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysIndirectKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRaygenShaderBindingTable; - PTR32 pMissShaderBindingTable; - PTR32 pHitShaderBindingTable; - PTR32 pCallableShaderBindingTable; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; - } *params = args; - VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pMissShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pHitShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable_host; - - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pRaygenShaderBindingTable), &pRaygenShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pMissShaderBindingTable), &pMissShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pHitShaderBindingTable), &pHitShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pCallableShaderBindingTable), &pCallableShaderBindingTable_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdTraceRaysIndirectKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRaygenShaderBindingTable_host, &pMissShaderBindingTable_host, &pHitShaderBindingTable_host, &pCallableShaderBindingTable_host, params->indirectDeviceAddress); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysKHR(void *args) -{ - struct vkCmdTraceRaysKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdTraceRaysKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pRaygenShaderBindingTable, params->pMissShaderBindingTable, params->pHitShaderBindingTable, params->pCallableShaderBindingTable, params->width, params->height, params->depth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRaygenShaderBindingTable; - PTR32 pMissShaderBindingTable; - PTR32 pHitShaderBindingTable; - PTR32 pCallableShaderBindingTable; - uint32_t width; - uint32_t height; - uint32_t depth; - } *params = args; - VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pMissShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pHitShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable_host; - - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pRaygenShaderBindingTable), &pRaygenShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pMissShaderBindingTable), &pMissShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pHitShaderBindingTable), &pHitShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pCallableShaderBindingTable), &pCallableShaderBindingTable_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdTraceRaysKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, &pRaygenShaderBindingTable_host, &pMissShaderBindingTable_host, &pHitShaderBindingTable_host, &pCallableShaderBindingTable_host, params->width, params->height, params->depth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysNV(void *args) -{ - struct vkCmdTraceRaysNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdTraceRaysNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->raygenShaderBindingTableBuffer, params->raygenShaderBindingOffset, params->missShaderBindingTableBuffer, params->missShaderBindingOffset, params->missShaderBindingStride, params->hitShaderBindingTableBuffer, params->hitShaderBindingOffset, params->hitShaderBindingStride, params->callableShaderBindingTableBuffer, params->callableShaderBindingOffset, params->callableShaderBindingStride, params->width, params->height, params->depth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) raygenShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) raygenShaderBindingOffset; - VkBuffer DECLSPEC_ALIGN(8) missShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) hitShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) callableShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingStride; - uint32_t width; - uint32_t height; - uint32_t depth; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdTraceRaysNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->raygenShaderBindingTableBuffer, params->raygenShaderBindingOffset, params->missShaderBindingTableBuffer, params->missShaderBindingOffset, params->missShaderBindingStride, params->hitShaderBindingTableBuffer, params->hitShaderBindingOffset, params->hitShaderBindingStride, params->callableShaderBindingTableBuffer, params->callableShaderBindingOffset, params->callableShaderBindingStride, params->width, params->height, params->depth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdUpdateBuffer(void *args) -{ - struct vkCmdUpdateBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdUpdateBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->dstBuffer, params->dstOffset, params->dataSize, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdUpdateBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dataSize; - PTR32 pData; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdUpdateBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->dstBuffer, params->dstOffset, params->dataSize, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdUpdatePipelineIndirectBufferNV(void *args) -{ - struct vkCmdUpdatePipelineIndirectBufferNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdUpdatePipelineIndirectBufferNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineBindPoint, params->pipeline); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdUpdatePipelineIndirectBufferNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdUpdatePipelineIndirectBufferNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineBindPoint, params->pipeline); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents(void *args) -{ - struct vkCmdWaitEvents_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWaitEvents(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->eventCount, params->pEvents, params->srcStageMask, params->dstStageMask, params->memoryBarrierCount, params->pMemoryBarriers, params->bufferMemoryBarrierCount, params->pBufferMemoryBarriers, params->imageMemoryBarrierCount, params->pImageMemoryBarriers); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; - } *params = args; - const VkMemoryBarrier *pMemoryBarriers_host; - const VkBufferMemoryBarrier *pBufferMemoryBarriers_host; - const VkImageMemoryBarrier *pImageMemoryBarriers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pMemoryBarriers_host = convert_VkMemoryBarrier_array_win32_to_host(ctx, (const VkMemoryBarrier32 *)UlongToPtr(params->pMemoryBarriers), params->memoryBarrierCount); - pBufferMemoryBarriers_host = convert_VkBufferMemoryBarrier_array_win32_to_host(ctx, (const VkBufferMemoryBarrier32 *)UlongToPtr(params->pBufferMemoryBarriers), params->bufferMemoryBarrierCount); - pImageMemoryBarriers_host = convert_VkImageMemoryBarrier_array_win32_to_host(ctx, (const VkImageMemoryBarrier32 *)UlongToPtr(params->pImageMemoryBarriers), params->imageMemoryBarrierCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWaitEvents(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), params->srcStageMask, params->dstStageMask, params->memoryBarrierCount, pMemoryBarriers_host, params->bufferMemoryBarrierCount, pBufferMemoryBarriers_host, params->imageMemoryBarrierCount, pImageMemoryBarriers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents2(void *args) -{ - struct vkCmdWaitEvents2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWaitEvents2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->eventCount, params->pEvents, params->pDependencyInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents2(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - PTR32 pDependencyInfos; - } *params = args; - const VkDependencyInfo *pDependencyInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDependencyInfos_host = convert_VkDependencyInfo_array_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfos), params->eventCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWaitEvents2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), pDependencyInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents2KHR(void *args) -{ - struct vkCmdWaitEvents2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWaitEvents2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->eventCount, params->pEvents, params->pDependencyInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - PTR32 pDependencyInfos; - } *params = args; - const VkDependencyInfo *pDependencyInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDependencyInfos_host = convert_VkDependencyInfo_array_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfos), params->eventCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWaitEvents2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), pDependencyInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct vkCmdWriteAccelerationStructuresPropertiesKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteAccelerationStructuresPropertiesKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteAccelerationStructuresPropertiesKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->accelerationStructureCount, (const VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteAccelerationStructuresPropertiesNV(void *args) -{ - struct vkCmdWriteAccelerationStructuresPropertiesNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteAccelerationStructuresPropertiesNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteAccelerationStructuresPropertiesNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteAccelerationStructuresPropertiesNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->accelerationStructureCount, (const VkAccelerationStructureNV *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteBufferMarker2AMD(void *args) -{ - struct vkCmdWriteBufferMarker2AMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteBufferMarker2AMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stage, params->dstBuffer, params->dstOffset, params->marker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteBufferMarker2AMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteBufferMarker2AMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stage, params->dstBuffer, params->dstOffset, params->marker); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteBufferMarkerAMD(void *args) -{ - struct vkCmdWriteBufferMarkerAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteBufferMarkerAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineStage, params->dstBuffer, params->dstOffset, params->marker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteBufferMarkerAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteBufferMarkerAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineStage, params->dstBuffer, params->dstOffset, params->marker); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteMicromapsPropertiesEXT(void *args) -{ - struct vkCmdWriteMicromapsPropertiesEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteMicromapsPropertiesEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->micromapCount, params->pMicromaps, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteMicromapsPropertiesEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t micromapCount; - PTR32 pMicromaps; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteMicromapsPropertiesEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->micromapCount, (const VkMicromapEXT *)UlongToPtr(params->pMicromaps), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp(void *args) -{ - struct vkCmdWriteTimestamp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteTimestamp(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->pipelineStage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteTimestamp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->pipelineStage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp2(void *args) -{ - struct vkCmdWriteTimestamp2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteTimestamp2(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteTimestamp2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp2KHR(void *args) -{ - struct vkCmdWriteTimestamp2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkCmdWriteTimestamp2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->stage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkCmdWriteTimestamp2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->stage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCompileDeferredNV(void *args) -{ - struct vkCompileDeferredNV_params *params = args; - - TRACE("%p, 0x%s, %u\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shader); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCompileDeferredNV(wine_device_from_handle(params->device)->host_device, params->pipeline, params->shader); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCompileDeferredNV(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t shader; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shader); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCompileDeferredNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->shader); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyAccelerationStructureKHR(void *args) -{ - struct vkCopyAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyAccelerationStructureKHR(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyAccelerationStructureInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyAccelerationStructureInfoKHR_win32_to_host((const VkCopyAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyAccelerationStructureKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct vkCopyAccelerationStructureToMemoryKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyAccelerationStructureToMemoryKHR(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyAccelerationStructureToMemoryInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host((const VkCopyAccelerationStructureToMemoryInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyAccelerationStructureToMemoryKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToImageEXT(void *args) -{ - struct vkCopyImageToImageEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToImageInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyImageToImageEXT(wine_device_from_handle(params->device)->host_device, params->pCopyImageToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToImageEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToImageInfo; - VkResult result; - } *params = args; - VkCopyImageToImageInfoEXT pCopyImageToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToImageInfoEXT_win32_to_host(ctx, (const VkCopyImageToImageInfoEXT32 *)UlongToPtr(params->pCopyImageToImageInfo), &pCopyImageToImageInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyImageToImageEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCopyImageToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToMemoryEXT(void *args) -{ - struct vkCopyImageToMemoryEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToMemoryInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyImageToMemoryEXT(wine_device_from_handle(params->device)->host_device, params->pCopyImageToMemoryInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToMemoryEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToMemoryInfo; - VkResult result; - } *params = args; - VkCopyImageToMemoryInfoEXT pCopyImageToMemoryInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToMemoryInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToMemoryInfoEXT_win32_to_host(ctx, (const VkCopyImageToMemoryInfoEXT32 *)UlongToPtr(params->pCopyImageToMemoryInfo), &pCopyImageToMemoryInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyImageToMemoryEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCopyImageToMemoryInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct vkCopyMemoryToAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyMemoryToAccelerationStructureKHR(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMemoryToAccelerationStructureInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host((const VkCopyMemoryToAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyMemoryToAccelerationStructureKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToImageEXT(void *args) -{ - struct vkCopyMemoryToImageEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyMemoryToImageInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyMemoryToImageEXT(wine_device_from_handle(params->device)->host_device, params->pCopyMemoryToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToImageEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyMemoryToImageInfo; - VkResult result; - } *params = args; - VkCopyMemoryToImageInfoEXT pCopyMemoryToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyMemoryToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyMemoryToImageInfoEXT_win32_to_host(ctx, (const VkCopyMemoryToImageInfoEXT32 *)UlongToPtr(params->pCopyMemoryToImageInfo), &pCopyMemoryToImageInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyMemoryToImageEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCopyMemoryToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToMicromapEXT(void *args) -{ - struct vkCopyMemoryToMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyMemoryToMicromapEXT(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMemoryToMicromapInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host((const VkCopyMemoryToMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyMemoryToMicromapEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMicromapEXT(void *args) -{ - struct vkCopyMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyMicromapEXT(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMicromapInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMicromapInfoEXT_win32_to_host((const VkCopyMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyMicromapEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMicromapToMemoryEXT(void *args) -{ - struct vkCopyMicromapToMemoryEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCopyMicromapToMemoryEXT(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMicromapToMemoryEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMicromapToMemoryInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host((const VkCopyMicromapToMemoryInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCopyMicromapToMemoryEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateAccelerationStructureKHR(void *args) -{ - struct vkCreateAccelerationStructureKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateAccelerationStructureKHR(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pAccelerationStructure); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pAccelerationStructure; - VkResult result; - } *params = args; - VkAccelerationStructureCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - init_conversion_context(ctx); - convert_VkAccelerationStructureCreateInfoKHR_win32_to_host(ctx, (const VkAccelerationStructureCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateAccelerationStructureKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructure)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateAccelerationStructureNV(void *args) -{ - struct vkCreateAccelerationStructureNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateAccelerationStructureNV(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pAccelerationStructure); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateAccelerationStructureNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pAccelerationStructure; - VkResult result; - } *params = args; - VkAccelerationStructureCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - init_conversion_context(ctx); - convert_VkAccelerationStructureCreateInfoNV_win32_to_host(ctx, (const VkAccelerationStructureCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateAccelerationStructureNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkAccelerationStructureNV *)UlongToPtr(params->pAccelerationStructure)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateBuffer(void *args) -{ - struct vkCreateBuffer_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - - params->result = wine_vkCreateBuffer(params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateBuffer(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pBuffer; - VkResult result; - } *params = args; - VkBufferCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - - init_conversion_context(ctx); - convert_VkBufferCreateInfo_win32_to_host(ctx, (const VkBufferCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateBuffer((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkBuffer *)UlongToPtr(params->pBuffer)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateBufferView(void *args) -{ - struct vkCreateBufferView_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateBufferView(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pView); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateBufferView(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pView; - VkResult result; - } *params = args; - VkBufferViewCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - init_conversion_context(ctx); - convert_VkBufferViewCreateInfo_win32_to_host(ctx, (const VkBufferViewCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateBufferView(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkBufferView *)UlongToPtr(params->pView)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCommandPool(void *args) -{ - struct vkCreateCommandPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool); - - params->result = wine_vkCreateCommandPool(params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool, params->client_ptr); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCommandPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pCommandPool; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkCommandPoolCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool); - - convert_VkCommandPoolCreateInfo_win32_to_host((const VkCommandPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateCommandPool((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkCommandPool *)UlongToPtr(params->pCommandPool), UlongToPtr(params->client_ptr)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateComputePipelines(void *args) -{ - struct vkCreateComputePipelines_params *params = args; - const VkComputePipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateComputePipelines(wine_device_from_handle(params->device)->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateComputePipelines(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkComputePipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win32_to_host(ctx, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateComputePipelines(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkComputePipelineCreateInfo_array_host_to_win32(pCreateInfos_host, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCuFunctionNVX(void *args) -{ - struct vkCreateCuFunctionNVX_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateCuFunctionNVX(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pFunction); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCuFunctionNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFunction; - VkResult result; - } *params = args; - VkCuFunctionCreateInfoNVX pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - convert_VkCuFunctionCreateInfoNVX_win32_to_host((const VkCuFunctionCreateInfoNVX32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateCuFunctionNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkCuFunctionNVX *)UlongToPtr(params->pFunction)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCuModuleNVX(void *args) -{ - struct vkCreateCuModuleNVX_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateCuModuleNVX(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCuModuleNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pModule; - VkResult result; - } *params = args; - VkCuModuleCreateInfoNVX pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - convert_VkCuModuleCreateInfoNVX_win32_to_host((const VkCuModuleCreateInfoNVX32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateCuModuleNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkCuModuleNVX *)UlongToPtr(params->pModule)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCudaFunctionNV(void *args) -{ - struct vkCreateCudaFunctionNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateCudaFunctionNV(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pFunction); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCudaFunctionNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFunction; - VkResult result; - } *params = args; - VkCudaFunctionCreateInfoNV pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - convert_VkCudaFunctionCreateInfoNV_win32_to_host((const VkCudaFunctionCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateCudaFunctionNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkCudaFunctionNV *)UlongToPtr(params->pFunction)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCudaModuleNV(void *args) -{ - struct vkCreateCudaModuleNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateCudaModuleNV(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCudaModuleNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pModule; - VkResult result; - } *params = args; - VkCudaModuleCreateInfoNV pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - convert_VkCudaModuleCreateInfoNV_win32_to_host((const VkCudaModuleCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateCudaModuleNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkCudaModuleNV *)UlongToPtr(params->pModule)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDebugReportCallbackEXT(void *args) -{ - struct vkCreateDebugReportCallbackEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - - params->result = wine_vkCreateDebugReportCallbackEXT(params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDebugReportCallbackEXT(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pCallback; - VkResult result; - } *params = args; - VkDebugReportCallbackCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - - convert_VkDebugReportCallbackCreateInfoEXT_win32_to_host((const VkDebugReportCallbackCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateDebugReportCallbackEXT((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDebugReportCallbackEXT *)UlongToPtr(params->pCallback)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDebugUtilsMessengerEXT(void *args) -{ - struct vkCreateDebugUtilsMessengerEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - - params->result = wine_vkCreateDebugUtilsMessengerEXT(params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDebugUtilsMessengerEXT(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pMessenger; - VkResult result; - } *params = args; - VkDebugUtilsMessengerCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - - convert_VkDebugUtilsMessengerCreateInfoEXT_win32_to_host((const VkDebugUtilsMessengerCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateDebugUtilsMessengerEXT((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDebugUtilsMessengerEXT *)UlongToPtr(params->pMessenger)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDeferredOperationKHR(void *args) -{ - struct vkCreateDeferredOperationKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocator, params->pDeferredOperation); - - params->result = wine_vkCreateDeferredOperationKHR(params->device, params->pAllocator, params->pDeferredOperation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDeferredOperationKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocator; - PTR32 pDeferredOperation; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocator, params->pDeferredOperation); - - params->result = wine_vkCreateDeferredOperationKHR((VkDevice)UlongToPtr(params->device), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDeferredOperationKHR *)UlongToPtr(params->pDeferredOperation)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorPool(void *args) -{ - struct vkCreateDescriptorPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorPool); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateDescriptorPool(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pDescriptorPool); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorPool; - VkResult result; - } *params = args; - VkDescriptorPoolCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorPool); - - init_conversion_context(ctx); - convert_VkDescriptorPoolCreateInfo_win32_to_host(ctx, (const VkDescriptorPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateDescriptorPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkDescriptorPool *)UlongToPtr(params->pDescriptorPool)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorSetLayout(void *args) -{ - struct vkCreateDescriptorSetLayout_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSetLayout); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateDescriptorSetLayout(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pSetLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorSetLayout(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSetLayout; - VkResult result; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSetLayout); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateDescriptorSetLayout(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkDescriptorSetLayout *)UlongToPtr(params->pSetLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorUpdateTemplate(void *args) -{ - struct vkCreateDescriptorUpdateTemplate_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateDescriptorUpdateTemplate(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pDescriptorUpdateTemplate); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorUpdateTemplate(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorUpdateTemplate; - VkResult result; - } *params = args; - VkDescriptorUpdateTemplateCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - init_conversion_context(ctx); - convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(ctx, (const VkDescriptorUpdateTemplateCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateDescriptorUpdateTemplate(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkDescriptorUpdateTemplate *)UlongToPtr(params->pDescriptorUpdateTemplate)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorUpdateTemplateKHR(void *args) -{ - struct vkCreateDescriptorUpdateTemplateKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateDescriptorUpdateTemplateKHR(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pDescriptorUpdateTemplate); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorUpdateTemplateKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorUpdateTemplate; - VkResult result; - } *params = args; - VkDescriptorUpdateTemplateCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - init_conversion_context(ctx); - convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(ctx, (const VkDescriptorUpdateTemplateCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateDescriptorUpdateTemplateKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkDescriptorUpdateTemplate *)UlongToPtr(params->pDescriptorUpdateTemplate)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDevice(void *args) -{ - struct vkCreateDevice_params *params = args; - VkDeviceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice); - - init_conversion_context(ctx); - convert_VkDeviceCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - params->result = wine_vkCreateDevice(params->physicalDevice, &pCreateInfo_host, params->pAllocator, params->pDevice, params->client_ptr); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDevice(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDevice; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkDeviceCreateInfo pCreateInfo_host; - VkDevice pDevice_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice); - - init_conversion_context(ctx); - convert_VkDeviceCreateInfo_win32_to_host(ctx, (const VkDeviceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - pDevice_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pDevice)); - params->result = wine_vkCreateDevice((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), &pDevice_host, UlongToPtr(params->client_ptr)); - *(PTR32 *)UlongToPtr(params->pDevice) = PtrToUlong(pDevice_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateEvent(void *args) -{ - struct vkCreateEvent_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pEvent); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateEvent(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pEvent); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateEvent(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pEvent; - VkResult result; - } *params = args; - VkEventCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pEvent); - - convert_VkEventCreateInfo_win32_to_host((const VkEventCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateEvent(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkEvent *)UlongToPtr(params->pEvent)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateFence(void *args) -{ - struct vkCreateFence_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFence); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateFence(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pFence); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateFence(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFence; - VkResult result; - } *params = args; - VkFenceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFence); - - init_conversion_context(ctx); - convert_VkFenceCreateInfo_win32_to_host(ctx, (const VkFenceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateFence(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkFence *)UlongToPtr(params->pFence)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateFramebuffer(void *args) -{ - struct vkCreateFramebuffer_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFramebuffer); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateFramebuffer(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pFramebuffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateFramebuffer(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFramebuffer; - VkResult result; - } *params = args; - VkFramebufferCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFramebuffer); - - init_conversion_context(ctx); - convert_VkFramebufferCreateInfo_win32_to_host(ctx, (const VkFramebufferCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateFramebuffer(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkFramebuffer *)UlongToPtr(params->pFramebuffer)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateGraphicsPipelines(void *args) -{ - struct vkCreateGraphicsPipelines_params *params = args; - const VkGraphicsPipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateGraphicsPipelines(wine_device_from_handle(params->device)->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateGraphicsPipelines(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkGraphicsPipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win32_to_host(ctx, (const VkGraphicsPipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateGraphicsPipelines(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkGraphicsPipelineCreateInfo_array_host_to_win32(pCreateInfos_host, (const VkGraphicsPipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateImage(void *args) -{ - struct vkCreateImage_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pImage); - - params->result = wine_vkCreateImage(params->device, params->pCreateInfo, params->pAllocator, params->pImage); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateImage(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pImage; - VkResult result; - } *params = args; - VkImageCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pImage); - - init_conversion_context(ctx); - convert_VkImageCreateInfo_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateImage((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkImage *)UlongToPtr(params->pImage)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateImageView(void *args) -{ - struct vkCreateImageView_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateImageView(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pView); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateImageView(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pView; - VkResult result; - } *params = args; - VkImageViewCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - init_conversion_context(ctx); - convert_VkImageViewCreateInfo_win32_to_host(ctx, (const VkImageViewCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateImageView(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkImageView *)UlongToPtr(params->pView)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateIndirectCommandsLayoutNV(void *args) -{ - struct vkCreateIndirectCommandsLayoutNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateIndirectCommandsLayoutNV(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pIndirectCommandsLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateIndirectCommandsLayoutNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pIndirectCommandsLayout; - VkResult result; - } *params = args; - VkIndirectCommandsLayoutCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - init_conversion_context(ctx); - convert_VkIndirectCommandsLayoutCreateInfoNV_win32_to_host(ctx, (const VkIndirectCommandsLayoutCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateIndirectCommandsLayoutNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkIndirectCommandsLayoutNV *)UlongToPtr(params->pIndirectCommandsLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateInstance(void *args) -{ - struct vkCreateInstance_params *params = args; - VkInstanceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->pCreateInfo, params->pAllocator, params->pInstance); - - init_conversion_context(ctx); - convert_VkInstanceCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - params->result = wine_vkCreateInstance(&pCreateInfo_host, params->pAllocator, params->pInstance, params->client_ptr); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateInstance(void *args) -{ - struct - { - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pInstance; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkInstanceCreateInfo pCreateInfo_host; - VkInstance pInstance_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->pCreateInfo, params->pAllocator, params->pInstance); - - init_conversion_context(ctx); - convert_VkInstanceCreateInfo_win32_to_host(ctx, (const VkInstanceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - pInstance_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pInstance)); - params->result = wine_vkCreateInstance(&pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), &pInstance_host, UlongToPtr(params->client_ptr)); - *(PTR32 *)UlongToPtr(params->pInstance) = PtrToUlong(pInstance_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateMicromapEXT(void *args) -{ - struct vkCreateMicromapEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pMicromap); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateMicromapEXT(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pMicromap); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateMicromapEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pMicromap; - VkResult result; - } *params = args; - VkMicromapCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pMicromap); - - convert_VkMicromapCreateInfoEXT_win32_to_host((const VkMicromapCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateMicromapEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkMicromapEXT *)UlongToPtr(params->pMicromap)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateOpticalFlowSessionNV(void *args) -{ - struct vkCreateOpticalFlowSessionNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSession); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateOpticalFlowSessionNV(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pSession); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateOpticalFlowSessionNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSession; - VkResult result; - } *params = args; - VkOpticalFlowSessionCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSession); - - init_conversion_context(ctx); - convert_VkOpticalFlowSessionCreateInfoNV_win32_to_host(ctx, (const VkOpticalFlowSessionCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateOpticalFlowSessionNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkOpticalFlowSessionNV *)UlongToPtr(params->pSession)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePipelineCache(void *args) -{ - struct vkCreatePipelineCache_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineCache); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreatePipelineCache(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pPipelineCache); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePipelineCache(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPipelineCache; - VkResult result; - } *params = args; - VkPipelineCacheCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineCache); - - convert_VkPipelineCacheCreateInfo_win32_to_host((const VkPipelineCacheCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreatePipelineCache(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkPipelineCache *)UlongToPtr(params->pPipelineCache)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePipelineLayout(void *args) -{ - struct vkCreatePipelineLayout_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineLayout); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreatePipelineLayout(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pPipelineLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePipelineLayout(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPipelineLayout; - VkResult result; - } *params = args; - VkPipelineLayoutCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineLayout); - - convert_VkPipelineLayoutCreateInfo_win32_to_host((const VkPipelineLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreatePipelineLayout(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkPipelineLayout *)UlongToPtr(params->pPipelineLayout)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePrivateDataSlot(void *args) -{ - struct vkCreatePrivateDataSlot_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreatePrivateDataSlot(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pPrivateDataSlot); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePrivateDataSlot(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPrivateDataSlot; - VkResult result; - } *params = args; - VkPrivateDataSlotCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - convert_VkPrivateDataSlotCreateInfo_win32_to_host((const VkPrivateDataSlotCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreatePrivateDataSlot(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkPrivateDataSlot *)UlongToPtr(params->pPrivateDataSlot)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePrivateDataSlotEXT(void *args) -{ - struct vkCreatePrivateDataSlotEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreatePrivateDataSlotEXT(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pPrivateDataSlot); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePrivateDataSlotEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPrivateDataSlot; - VkResult result; - } *params = args; - VkPrivateDataSlotCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - convert_VkPrivateDataSlotCreateInfo_win32_to_host((const VkPrivateDataSlotCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreatePrivateDataSlotEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkPrivateDataSlot *)UlongToPtr(params->pPrivateDataSlot)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateQueryPool(void *args) -{ - struct vkCreateQueryPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pQueryPool); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateQueryPool(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pQueryPool); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateQueryPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pQueryPool; - VkResult result; - } *params = args; - VkQueryPoolCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pQueryPool); - - init_conversion_context(ctx); - convert_VkQueryPoolCreateInfo_win32_to_host(ctx, (const VkQueryPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateQueryPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkQueryPool *)UlongToPtr(params->pQueryPool)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRayTracingPipelinesKHR(void *args) -{ - struct vkCreateRayTracingPipelinesKHR_params *params = args; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateRayTracingPipelinesKHR(wine_device_from_handle(params->device)->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRayTracingPipelinesKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingPipelineCreateInfoKHR32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateRayTracingPipelinesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host_deferred_operation : 0, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkRayTracingPipelineCreateInfoKHR_array_host_to_win32(pCreateInfos_host, (const VkRayTracingPipelineCreateInfoKHR32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRayTracingPipelinesNV(void *args) -{ - struct vkCreateRayTracingPipelinesNV_params *params = args; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateRayTracingPipelinesNV(wine_device_from_handle(params->device)->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRayTracingPipelinesNV(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win32_to_host(ctx, (const VkRayTracingPipelineCreateInfoNV32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateRayTracingPipelinesNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkRayTracingPipelineCreateInfoNV_array_host_to_win32(pCreateInfos_host, (const VkRayTracingPipelineCreateInfoNV32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass(void *args) -{ - struct vkCreateRenderPass_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateRenderPass(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo_win32_to_host(ctx, (const VkRenderPassCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateRenderPass(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass2(void *args) -{ - struct vkCreateRenderPass2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateRenderPass2(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass2(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo2 pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo2_win32_to_host(ctx, (const VkRenderPassCreateInfo232 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateRenderPass2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass2KHR(void *args) -{ - struct vkCreateRenderPass2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateRenderPass2KHR(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo2 pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo2_win32_to_host(ctx, (const VkRenderPassCreateInfo232 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateRenderPass2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSampler(void *args) -{ - struct vkCreateSampler_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSampler); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateSampler(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pSampler); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSampler(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSampler; - VkResult result; - } *params = args; - VkSamplerCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSampler); - - init_conversion_context(ctx); - convert_VkSamplerCreateInfo_win32_to_host(ctx, (const VkSamplerCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateSampler(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkSampler *)UlongToPtr(params->pSampler)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSamplerYcbcrConversion(void *args) -{ - struct vkCreateSamplerYcbcrConversion_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateSamplerYcbcrConversion(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pYcbcrConversion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSamplerYcbcrConversion(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pYcbcrConversion; - VkResult result; - } *params = args; - VkSamplerYcbcrConversionCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - init_conversion_context(ctx); - convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(ctx, (const VkSamplerYcbcrConversionCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateSamplerYcbcrConversion(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkSamplerYcbcrConversion *)UlongToPtr(params->pYcbcrConversion)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSamplerYcbcrConversionKHR(void *args) -{ - struct vkCreateSamplerYcbcrConversionKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateSamplerYcbcrConversionKHR(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pYcbcrConversion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSamplerYcbcrConversionKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pYcbcrConversion; - VkResult result; - } *params = args; - VkSamplerYcbcrConversionCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - init_conversion_context(ctx); - convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(ctx, (const VkSamplerYcbcrConversionCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateSamplerYcbcrConversionKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkSamplerYcbcrConversion *)UlongToPtr(params->pYcbcrConversion)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSemaphore(void *args) -{ - struct vkCreateSemaphore_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSemaphore); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateSemaphore(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pSemaphore); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSemaphore(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSemaphore; - VkResult result; - } *params = args; - VkSemaphoreCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSemaphore); - - init_conversion_context(ctx); - convert_VkSemaphoreCreateInfo_win32_to_host(ctx, (const VkSemaphoreCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateSemaphore(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkSemaphore *)UlongToPtr(params->pSemaphore)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateShaderModule(void *args) -{ - struct vkCreateShaderModule_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pShaderModule); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateShaderModule(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pShaderModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateShaderModule(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pShaderModule; - VkResult result; - } *params = args; - VkShaderModuleCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pShaderModule); - - init_conversion_context(ctx); - convert_VkShaderModuleCreateInfo_win32_to_host(ctx, (const VkShaderModuleCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateShaderModule(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkShaderModule *)UlongToPtr(params->pShaderModule)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateShadersEXT(void *args) -{ - struct vkCreateShadersEXT_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->device, params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pShaders); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateShadersEXT(wine_device_from_handle(params->device)->host_device, params->createInfoCount, params->pCreateInfos, NULL, params->pShaders); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateShadersEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pShaders; - VkResult result; - } *params = args; - const VkShaderCreateInfoEXT *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->device, params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pShaders); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkShaderCreateInfoEXT_array_win32_to_host(ctx, (const VkShaderCreateInfoEXT32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateShadersEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->createInfoCount, pCreateInfos_host, NULL, (VkShaderEXT *)UlongToPtr(params->pShaders)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSwapchainKHR(void *args) -{ - struct vkCreateSwapchainKHR_params *params = args; - VkSwapchainCreateInfoKHR pCreateInfo_host; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSwapchain); - - convert_VkSwapchainCreateInfoKHR_win64_to_driver(params->pCreateInfo, &pCreateInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateSwapchainKHR(wine_device_from_handle(params->device)->host_device, &pCreateInfo_host, NULL, params->pSwapchain); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSwapchainKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSwapchain; - VkResult result; - } *params = args; - VkSwapchainCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSwapchain); - - init_conversion_context(ctx); - convert_VkSwapchainCreateInfoKHR_win32_to_driver(ctx, (const VkSwapchainCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateSwapchainKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkSwapchainKHR *)UlongToPtr(params->pSwapchain)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateValidationCacheEXT(void *args) -{ - struct vkCreateValidationCacheEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pValidationCache); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkCreateValidationCacheEXT(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, NULL, params->pValidationCache); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateValidationCacheEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pValidationCache; - VkResult result; - } *params = args; - VkValidationCacheCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pValidationCache); - - convert_VkValidationCacheCreateInfoEXT_win32_to_host((const VkValidationCacheCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkCreateValidationCacheEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, NULL, (VkValidationCacheEXT *)UlongToPtr(params->pValidationCache)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateWin32SurfaceKHR(void *args) -{ - struct vkCreateWin32SurfaceKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - - params->result = wine_vkCreateWin32SurfaceKHR(params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateWin32SurfaceKHR(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSurface; - VkResult result; - } *params = args; - VkWin32SurfaceCreateInfoKHR pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - - convert_VkWin32SurfaceCreateInfoKHR_win32_to_host((const VkWin32SurfaceCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateWin32SurfaceKHR((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkSurfaceKHR *)UlongToPtr(params->pSurface)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugMarkerSetObjectNameEXT(void *args) -{ - struct vkDebugMarkerSetObjectNameEXT_params *params = args; - VkDebugMarkerObjectNameInfoEXT pNameInfo_host; - - TRACE("%p, %p\n", params->device, params->pNameInfo); - - convert_VkDebugMarkerObjectNameInfoEXT_win64_to_host(params->pNameInfo, &pNameInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkDebugMarkerSetObjectNameEXT(wine_device_from_handle(params->device)->host_device, &pNameInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugMarkerSetObjectNameEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pNameInfo; - VkResult result; - } *params = args; - VkDebugMarkerObjectNameInfoEXT pNameInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pNameInfo); - - convert_VkDebugMarkerObjectNameInfoEXT_win32_to_host((const VkDebugMarkerObjectNameInfoEXT32 *)UlongToPtr(params->pNameInfo), &pNameInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDebugMarkerSetObjectNameEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pNameInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugMarkerSetObjectTagEXT(void *args) -{ - struct vkDebugMarkerSetObjectTagEXT_params *params = args; - VkDebugMarkerObjectTagInfoEXT pTagInfo_host; - - TRACE("%p, %p\n", params->device, params->pTagInfo); - - convert_VkDebugMarkerObjectTagInfoEXT_win64_to_host(params->pTagInfo, &pTagInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkDebugMarkerSetObjectTagEXT(wine_device_from_handle(params->device)->host_device, &pTagInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugMarkerSetObjectTagEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pTagInfo; - VkResult result; - } *params = args; - VkDebugMarkerObjectTagInfoEXT pTagInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pTagInfo); - - convert_VkDebugMarkerObjectTagInfoEXT_win32_to_host((const VkDebugMarkerObjectTagInfoEXT32 *)UlongToPtr(params->pTagInfo), &pTagInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDebugMarkerSetObjectTagEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pTagInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugReportMessageEXT(void *args) -{ - struct vkDebugReportMessageEXT_params *params = args; - - TRACE("%p, %#x, %#x, 0x%s, 0x%s, %d, %p, %p\n", params->instance, params->flags, params->objectType, wine_dbgstr_longlong(params->object), wine_dbgstr_longlong(params->location), params->messageCode, params->pLayerPrefix, params->pMessage); - - wine_instance_from_handle(params->instance)->funcs.p_vkDebugReportMessageEXT(wine_instance_from_handle(params->instance)->host_instance, params->flags, params->objectType, wine_vk_unwrap_handle(params->objectType, params->object), params->location, params->messageCode, params->pLayerPrefix, params->pMessage); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugReportMessageEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugReportFlagsEXT flags; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - PTR32 location; - int32_t messageCode; - PTR32 pLayerPrefix; - PTR32 pMessage; - } *params = args; - - TRACE("%#x, %#x, %#x, 0x%s, 0x%s, %d, %#x, %#x\n", params->instance, params->flags, params->objectType, wine_dbgstr_longlong(params->object), wine_dbgstr_longlong(params->location), params->messageCode, params->pLayerPrefix, params->pMessage); - - wine_instance_from_handle((VkInstance)UlongToPtr(params->instance))->funcs.p_vkDebugReportMessageEXT(wine_instance_from_handle((VkInstance)UlongToPtr(params->instance))->host_instance, params->flags, params->objectType, wine_vk_unwrap_handle(params->objectType, params->object), params->location, params->messageCode, (const char *)UlongToPtr(params->pLayerPrefix), (const char *)UlongToPtr(params->pMessage)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDeferredOperationJoinKHR(void *args) -{ - struct vkDeferredOperationJoinKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkDeferredOperationJoinKHR(wine_device_from_handle(params->device)->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDeferredOperationJoinKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDeferredOperationJoinKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyAccelerationStructureKHR(void *args) -{ - struct vkDestroyAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyAccelerationStructureKHR(wine_device_from_handle(params->device)->host_device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyAccelerationStructureKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyAccelerationStructureNV(void *args) -{ - struct vkDestroyAccelerationStructureNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyAccelerationStructureNV(wine_device_from_handle(params->device)->host_device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyAccelerationStructureNV(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyAccelerationStructureNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyBuffer(void *args) -{ - struct vkDestroyBuffer_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->buffer), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyBuffer(wine_device_from_handle(params->device)->host_device, params->buffer, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyBuffer(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->buffer), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyBuffer(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->buffer, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyBufferView(void *args) -{ - struct vkDestroyBufferView_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->bufferView), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyBufferView(wine_device_from_handle(params->device)->host_device, params->bufferView, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyBufferView(void *args) -{ - struct - { - PTR32 device; - VkBufferView DECLSPEC_ALIGN(8) bufferView; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->bufferView), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyBufferView(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->bufferView, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCommandPool(void *args) -{ - struct vkDestroyCommandPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->commandPool), params->pAllocator); - - wine_vkDestroyCommandPool(params->device, params->commandPool, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->pAllocator); - - wine_vkDestroyCommandPool((VkDevice)UlongToPtr(params->device), params->commandPool, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCuFunctionNVX(void *args) -{ - struct vkDestroyCuFunctionNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyCuFunctionNVX(wine_device_from_handle(params->device)->host_device, params->function, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCuFunctionNVX(void *args) -{ - struct - { - PTR32 device; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyCuFunctionNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->function, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCuModuleNVX(void *args) -{ - struct vkDestroyCuModuleNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyCuModuleNVX(wine_device_from_handle(params->device)->host_device, params->module, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCuModuleNVX(void *args) -{ - struct - { - PTR32 device; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyCuModuleNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->module, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCudaFunctionNV(void *args) -{ - struct vkDestroyCudaFunctionNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyCudaFunctionNV(wine_device_from_handle(params->device)->host_device, params->function, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCudaFunctionNV(void *args) -{ - struct - { - PTR32 device; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyCudaFunctionNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->function, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCudaModuleNV(void *args) -{ - struct vkDestroyCudaModuleNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyCudaModuleNV(wine_device_from_handle(params->device)->host_device, params->module, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCudaModuleNV(void *args) -{ - struct - { - PTR32 device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyCudaModuleNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->module, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDebugReportCallbackEXT(void *args) -{ - struct vkDestroyDebugReportCallbackEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->callback), params->pAllocator); - - wine_vkDestroyDebugReportCallbackEXT(params->instance, params->callback, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDebugReportCallbackEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugReportCallbackEXT DECLSPEC_ALIGN(8) callback; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->callback), params->pAllocator); - - wine_vkDestroyDebugReportCallbackEXT((VkInstance)UlongToPtr(params->instance), params->callback, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDebugUtilsMessengerEXT(void *args) -{ - struct vkDestroyDebugUtilsMessengerEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->messenger), params->pAllocator); - - wine_vkDestroyDebugUtilsMessengerEXT(params->instance, params->messenger, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDebugUtilsMessengerEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugUtilsMessengerEXT DECLSPEC_ALIGN(8) messenger; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->messenger), params->pAllocator); - - wine_vkDestroyDebugUtilsMessengerEXT((VkInstance)UlongToPtr(params->instance), params->messenger, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDeferredOperationKHR(void *args) -{ - struct vkDestroyDeferredOperationKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->operation), params->pAllocator); - - wine_vkDestroyDeferredOperationKHR(params->device, params->operation, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDeferredOperationKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->operation), params->pAllocator); - - wine_vkDestroyDeferredOperationKHR((VkDevice)UlongToPtr(params->device), params->operation, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorPool(void *args) -{ - struct vkDestroyDescriptorPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyDescriptorPool(wine_device_from_handle(params->device)->host_device, params->descriptorPool, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorPool(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyDescriptorPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorPool, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorSetLayout(void *args) -{ - struct vkDestroyDescriptorSetLayout_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSetLayout), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyDescriptorSetLayout(wine_device_from_handle(params->device)->host_device, params->descriptorSetLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorSetLayout(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSetLayout), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyDescriptorSetLayout(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorSetLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorUpdateTemplate(void *args) -{ - struct vkDestroyDescriptorUpdateTemplate_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyDescriptorUpdateTemplate(wine_device_from_handle(params->device)->host_device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorUpdateTemplate(void *args) -{ - struct - { - PTR32 device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyDescriptorUpdateTemplate(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorUpdateTemplateKHR(void *args) -{ - struct vkDestroyDescriptorUpdateTemplateKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyDescriptorUpdateTemplateKHR(wine_device_from_handle(params->device)->host_device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorUpdateTemplateKHR(void *args) -{ - struct - { - PTR32 device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyDescriptorUpdateTemplateKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDevice(void *args) -{ - struct vkDestroyDevice_params *params = args; - - TRACE("%p, %p\n", params->device, params->pAllocator); - - if (!params->device) - return STATUS_SUCCESS; - - wine_vkDestroyDevice(params->device, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDevice(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, %#x\n", params->device, params->pAllocator); - - if (!params->device) - return STATUS_SUCCESS; - - wine_vkDestroyDevice((VkDevice)UlongToPtr(params->device), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyEvent(void *args) -{ - struct vkDestroyEvent_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->event), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyEvent(wine_device_from_handle(params->device)->host_device, params->event, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->event), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyEvent(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->event, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyFence(void *args) -{ - struct vkDestroyFence_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->fence), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyFence(wine_device_from_handle(params->device)->host_device, params->fence, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyFence(void *args) -{ - struct - { - PTR32 device; - VkFence DECLSPEC_ALIGN(8) fence; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->fence), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyFence(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->fence, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyFramebuffer(void *args) -{ - struct vkDestroyFramebuffer_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyFramebuffer(wine_device_from_handle(params->device)->host_device, params->framebuffer, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyFramebuffer(void *args) -{ - struct - { - PTR32 device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyFramebuffer(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->framebuffer, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyImage(void *args) -{ - struct vkDestroyImage_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyImage(wine_device_from_handle(params->device)->host_device, params->image, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyImage(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyImage(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyImageView(void *args) -{ - struct vkDestroyImageView_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->imageView), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyImageView(wine_device_from_handle(params->device)->host_device, params->imageView, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyImageView(void *args) -{ - struct - { - PTR32 device; - VkImageView DECLSPEC_ALIGN(8) imageView; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->imageView), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyImageView(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->imageView, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyIndirectCommandsLayoutNV(void *args) -{ - struct vkDestroyIndirectCommandsLayoutNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyIndirectCommandsLayoutNV(wine_device_from_handle(params->device)->host_device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyIndirectCommandsLayoutNV(void *args) -{ - struct - { - PTR32 device; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyIndirectCommandsLayoutNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyInstance(void *args) -{ - struct vkDestroyInstance_params *params = args; - - TRACE("%p, %p\n", params->instance, params->pAllocator); - - if (!params->instance) - return STATUS_SUCCESS; - - wine_vkDestroyInstance(params->instance, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyInstance(void *args) -{ - struct - { - PTR32 instance; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, %#x\n", params->instance, params->pAllocator); - - if (!params->instance) - return STATUS_SUCCESS; - - wine_vkDestroyInstance((VkInstance)UlongToPtr(params->instance), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyMicromapEXT(void *args) -{ - struct vkDestroyMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->micromap), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyMicromapEXT(wine_device_from_handle(params->device)->host_device, params->micromap, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->micromap), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyMicromapEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->micromap, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyOpticalFlowSessionNV(void *args) -{ - struct vkDestroyOpticalFlowSessionNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->session), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyOpticalFlowSessionNV(wine_device_from_handle(params->device)->host_device, params->session, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyOpticalFlowSessionNV(void *args) -{ - struct - { - PTR32 device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyOpticalFlowSessionNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->session, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipeline(void *args) -{ - struct vkDestroyPipeline_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyPipeline(wine_device_from_handle(params->device)->host_device, params->pipeline, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipeline(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyPipeline(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipelineCache(void *args) -{ - struct vkDestroyPipelineCache_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyPipelineCache(wine_device_from_handle(params->device)->host_device, params->pipelineCache, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipelineCache(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyPipelineCache(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineCache, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipelineLayout(void *args) -{ - struct vkDestroyPipelineLayout_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipelineLayout), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyPipelineLayout(wine_device_from_handle(params->device)->host_device, params->pipelineLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipelineLayout(void *args) -{ - struct - { - PTR32 device; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineLayout), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyPipelineLayout(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPrivateDataSlot(void *args) -{ - struct vkDestroyPrivateDataSlot_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyPrivateDataSlot(wine_device_from_handle(params->device)->host_device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPrivateDataSlot(void *args) -{ - struct - { - PTR32 device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyPrivateDataSlot(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPrivateDataSlotEXT(void *args) -{ - struct vkDestroyPrivateDataSlotEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyPrivateDataSlotEXT(wine_device_from_handle(params->device)->host_device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPrivateDataSlotEXT(void *args) -{ - struct - { - PTR32 device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyPrivateDataSlotEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyQueryPool(void *args) -{ - struct vkDestroyQueryPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->queryPool), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyQueryPool(wine_device_from_handle(params->device)->host_device, params->queryPool, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyQueryPool(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyQueryPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->queryPool, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyRenderPass(void *args) -{ - struct vkDestroyRenderPass_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyRenderPass(wine_device_from_handle(params->device)->host_device, params->renderPass, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyRenderPass(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyRenderPass(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->renderPass, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySampler(void *args) -{ - struct vkDestroySampler_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->sampler), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroySampler(wine_device_from_handle(params->device)->host_device, params->sampler, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySampler(void *args) -{ - struct - { - PTR32 device; - VkSampler DECLSPEC_ALIGN(8) sampler; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->sampler), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroySampler(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->sampler, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySamplerYcbcrConversion(void *args) -{ - struct vkDestroySamplerYcbcrConversion_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroySamplerYcbcrConversion(wine_device_from_handle(params->device)->host_device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySamplerYcbcrConversion(void *args) -{ - struct - { - PTR32 device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroySamplerYcbcrConversion(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySamplerYcbcrConversionKHR(void *args) -{ - struct vkDestroySamplerYcbcrConversionKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroySamplerYcbcrConversionKHR(wine_device_from_handle(params->device)->host_device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySamplerYcbcrConversionKHR(void *args) -{ - struct - { - PTR32 device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroySamplerYcbcrConversionKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySemaphore(void *args) -{ - struct vkDestroySemaphore_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroySemaphore(wine_device_from_handle(params->device)->host_device, params->semaphore, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySemaphore(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroySemaphore(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->semaphore, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyShaderEXT(void *args) -{ - struct vkDestroyShaderEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shader), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyShaderEXT(wine_device_from_handle(params->device)->host_device, params->shader, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyShaderEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shader), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyShaderEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->shader, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyShaderModule(void *args) -{ - struct vkDestroyShaderModule_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyShaderModule(wine_device_from_handle(params->device)->host_device, params->shaderModule, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyShaderModule(void *args) -{ - struct - { - PTR32 device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyShaderModule(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->shaderModule, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySurfaceKHR(void *args) -{ - struct vkDestroySurfaceKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->surface), params->pAllocator); - - wine_vkDestroySurfaceKHR(params->instance, params->surface, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySurfaceKHR(void *args) -{ - struct - { - PTR32 instance; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->surface), params->pAllocator); - - wine_vkDestroySurfaceKHR((VkInstance)UlongToPtr(params->instance), params->surface, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySwapchainKHR(void *args) -{ - struct vkDestroySwapchainKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroySwapchainKHR(wine_device_from_handle(params->device)->host_device, params->swapchain, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySwapchainKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroySwapchainKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyValidationCacheEXT(void *args) -{ - struct vkDestroyValidationCacheEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pAllocator); - - wine_device_from_handle(params->device)->funcs.p_vkDestroyValidationCacheEXT(wine_device_from_handle(params->device)->host_device, params->validationCache, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyValidationCacheEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pAllocator); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDestroyValidationCacheEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->validationCache, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDeviceWaitIdle(void *args) -{ - struct vkDeviceWaitIdle_params *params = args; - - TRACE("%p\n", params->device); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkDeviceWaitIdle(wine_device_from_handle(params->device)->host_device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDeviceWaitIdle(void *args) -{ - struct - { - PTR32 device; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->device); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkDeviceWaitIdle(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEndCommandBuffer(void *args) -{ - struct vkEndCommandBuffer_params *params = args; - - TRACE("%p\n", params->commandBuffer); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkEndCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEndCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->commandBuffer); - - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkEndCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateDeviceExtensionProperties(void *args) -{ - struct vkEnumerateDeviceExtensionProperties_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceExtensionProperties(params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateDeviceExtensionProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pLayerName; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceExtensionProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (const char *)UlongToPtr(params->pLayerName), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkExtensionProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateDeviceLayerProperties(void *args) -{ - struct vkEnumerateDeviceLayerProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceLayerProperties(params->physicalDevice, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateDeviceLayerProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceLayerProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkLayerProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateInstanceExtensionProperties(void *args) -{ - struct vkEnumerateInstanceExtensionProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateInstanceExtensionProperties(params->pLayerName, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateInstanceExtensionProperties(void *args) -{ - struct - { - PTR32 pLayerName; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateInstanceExtensionProperties((const char *)UlongToPtr(params->pLayerName), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkExtensionProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateInstanceVersion(void *args) -{ - struct vkEnumerateInstanceVersion_params *params = args; - - TRACE("%p\n", params->pApiVersion); - - params->result = wine_vkEnumerateInstanceVersion(params->pApiVersion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateInstanceVersion(void *args) -{ - struct - { - PTR32 pApiVersion; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->pApiVersion); - - params->result = wine_vkEnumerateInstanceVersion((uint32_t *)UlongToPtr(params->pApiVersion)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceGroups(void *args) -{ - struct vkEnumeratePhysicalDeviceGroups_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - params->result = wine_vkEnumeratePhysicalDeviceGroups(params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceGroups(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceGroupCount; - PTR32 pPhysicalDeviceGroupProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - init_conversion_context(ctx); - pPhysicalDeviceGroupProperties_host = convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(ctx, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - params->result = wine_vkEnumeratePhysicalDeviceGroups((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount), pPhysicalDeviceGroupProperties_host); - convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(pPhysicalDeviceGroupProperties_host, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceGroupsKHR(void *args) -{ - struct vkEnumeratePhysicalDeviceGroupsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - params->result = wine_vkEnumeratePhysicalDeviceGroupsKHR(params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceGroupsKHR(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceGroupCount; - PTR32 pPhysicalDeviceGroupProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - init_conversion_context(ctx); - pPhysicalDeviceGroupProperties_host = convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(ctx, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - params->result = wine_vkEnumeratePhysicalDeviceGroupsKHR((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount), pPhysicalDeviceGroupProperties_host); - convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(pPhysicalDeviceGroupProperties_host, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(void *args) -{ - struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->physicalDevice, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - PTR32 pCounterCount; - PTR32 pCounters; - PTR32 pCounterDescriptions; - VkResult result; - } *params = args; - VkPerformanceCounterKHR *pCounters_host; - VkPerformanceCounterDescriptionKHR *pCounterDescriptions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->physicalDevice, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - - init_conversion_context(ctx); - pCounters_host = convert_VkPerformanceCounterKHR_array_win32_to_host(ctx, (VkPerformanceCounterKHR32 *)UlongToPtr(params->pCounters), *(uint32_t *)UlongToPtr(params->pCounterCount)); - pCounterDescriptions_host = convert_VkPerformanceCounterDescriptionKHR_array_win32_to_host(ctx, (VkPerformanceCounterDescriptionKHR32 *)UlongToPtr(params->pCounterDescriptions), *(uint32_t *)UlongToPtr(params->pCounterCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->queueFamilyIndex, (uint32_t *)UlongToPtr(params->pCounterCount), pCounters_host, pCounterDescriptions_host); - convert_VkPerformanceCounterKHR_array_host_to_win32(pCounters_host, (VkPerformanceCounterKHR32 *)UlongToPtr(params->pCounters), *(uint32_t *)UlongToPtr(params->pCounterCount)); - convert_VkPerformanceCounterDescriptionKHR_array_host_to_win32(pCounterDescriptions_host, (VkPerformanceCounterDescriptionKHR32 *)UlongToPtr(params->pCounterDescriptions), *(uint32_t *)UlongToPtr(params->pCounterCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDevices(void *args) -{ - struct vkEnumeratePhysicalDevices_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - - params->result = wine_vkEnumeratePhysicalDevices(params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDevices(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceCount; - PTR32 pPhysicalDevices; - VkResult result; - } *params = args; - VkPhysicalDevice *pPhysicalDevices_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - - init_conversion_context(ctx); - pPhysicalDevices_host = (params->pPhysicalDevices && *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)) ? conversion_context_alloc(ctx, sizeof(*pPhysicalDevices_host) * *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)) : NULL; - params->result = wine_vkEnumeratePhysicalDevices((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceCount), pPhysicalDevices_host); - convert_VkPhysicalDevice_array_unwrapped_host_to_win32(pPhysicalDevices_host, (PTR32 *)UlongToPtr(params->pPhysicalDevices), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFlushMappedMemoryRanges(void *args) -{ - struct vkFlushMappedMemoryRanges_params *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(ctx, params->pMemoryRanges, params->memoryRangeCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkFlushMappedMemoryRanges(wine_device_from_handle(params->device)->host_device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFlushMappedMemoryRanges(void *args) -{ - struct - { - PTR32 device; - uint32_t memoryRangeCount; - PTR32 pMemoryRanges; - VkResult result; - } *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win32_to_host(ctx, (const VkMappedMemoryRange32 *)UlongToPtr(params->pMemoryRanges), params->memoryRangeCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkFlushMappedMemoryRanges(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeCommandBuffers(void *args) -{ - struct vkFreeCommandBuffers_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->commandPool), params->commandBufferCount, params->pCommandBuffers); - - wine_vkFreeCommandBuffers(params->device, params->commandPool, params->commandBufferCount, params->pCommandBuffers); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeCommandBuffers(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - } *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->commandBufferCount, params->pCommandBuffers); - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_unwrapped_host(ctx, (const PTR32 *)UlongToPtr(params->pCommandBuffers), params->commandBufferCount); - wine_vkFreeCommandBuffers((VkDevice)UlongToPtr(params->device), params->commandPool, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeDescriptorSets(void *args) -{ - struct vkFreeDescriptorSets_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->descriptorSetCount, params->pDescriptorSets); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkFreeDescriptorSets(wine_device_from_handle(params->device)->host_device, params->descriptorPool, params->descriptorSetCount, params->pDescriptorSets); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeDescriptorSets(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - PTR32 pDescriptorSets; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->descriptorSetCount, params->pDescriptorSets); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkFreeDescriptorSets(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorPool, params->descriptorSetCount, (const VkDescriptorSet *)UlongToPtr(params->pDescriptorSets)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeMemory(void *args) -{ - struct vkFreeMemory_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator); - - wine_vkFreeMemory(params->device, params->memory, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator); - - wine_vkFreeMemory((VkDevice)UlongToPtr(params->device), params->memory, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureBuildSizesKHR(void *args) -{ - struct vkGetAccelerationStructureBuildSizesKHR_params *params = args; - - TRACE("%p, %#x, %p, %p, %p\n", params->device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - - wine_device_from_handle(params->device)->funcs.p_vkGetAccelerationStructureBuildSizesKHR(wine_device_from_handle(params->device)->host_device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureBuildSizesKHR(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureBuildTypeKHR buildType; - PTR32 pBuildInfo; - PTR32 pMaxPrimitiveCounts; - PTR32 pSizeInfo; - } *params = args; - VkAccelerationStructureBuildGeometryInfoKHR pBuildInfo_host; - VkAccelerationStructureBuildSizesInfoKHR pSizeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x, %#x\n", params->device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - - init_conversion_context(ctx); - convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pBuildInfo), &pBuildInfo_host); - convert_VkAccelerationStructureBuildSizesInfoKHR_win32_to_host((VkAccelerationStructureBuildSizesInfoKHR32 *)UlongToPtr(params->pSizeInfo), &pSizeInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetAccelerationStructureBuildSizesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->buildType, &pBuildInfo_host, (const uint32_t *)UlongToPtr(params->pMaxPrimitiveCounts), &pSizeInfo_host); - convert_VkAccelerationStructureBuildSizesInfoKHR_host_to_win32(&pSizeInfo_host, (VkAccelerationStructureBuildSizesInfoKHR32 *)UlongToPtr(params->pSizeInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureDeviceAddressKHR(void *args) -{ - struct vkGetAccelerationStructureDeviceAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetAccelerationStructureDeviceAddressKHR(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureDeviceAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkAccelerationStructureDeviceAddressInfoKHR pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkAccelerationStructureDeviceAddressInfoKHR_win32_to_host((const VkAccelerationStructureDeviceAddressInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetAccelerationStructureDeviceAddressKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureHandleNV(void *args) -{ - struct vkGetAccelerationStructureHandleNV_params *params = args; - - TRACE("%p, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetAccelerationStructureHandleNV(wine_device_from_handle(params->device)->host_device, params->accelerationStructure, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureHandleNV(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetAccelerationStructureHandleNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->accelerationStructure, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureMemoryRequirementsNV(void *args) -{ - struct vkGetAccelerationStructureMemoryRequirementsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetAccelerationStructureMemoryRequirementsNV(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkAccelerationStructureMemoryRequirementsInfoNV pInfo_host; - VkMemoryRequirements2KHR pMemoryRequirements_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - convert_VkAccelerationStructureMemoryRequirementsInfoNV_win32_to_host((const VkAccelerationStructureMemoryRequirementsInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2KHR_win32_to_host((VkMemoryRequirements2KHR32 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetAccelerationStructureMemoryRequirementsNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2KHR_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements2KHR32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkAccelerationStructureCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkAccelerationStructureCaptureDescriptorDataInfoEXT_win32_to_host((const VkAccelerationStructureCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddress(void *args) -{ - struct vkGetBufferDeviceAddress_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferDeviceAddress(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferDeviceAddress(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddressEXT(void *args) -{ - struct vkGetBufferDeviceAddressEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferDeviceAddressEXT(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddressEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferDeviceAddressEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddressKHR(void *args) -{ - struct vkGetBufferDeviceAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferDeviceAddressKHR(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferDeviceAddressKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements(void *args) -{ - struct vkGetBufferMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->buffer), params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetBufferMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->buffer, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - PTR32 pMemoryRequirements; - } *params = args; - VkMemoryRequirements pMemoryRequirements_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->buffer), params->pMemoryRequirements); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->buffer, &pMemoryRequirements_host); - convert_VkMemoryRequirements_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements2(void *args) -{ - struct vkGetBufferMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetBufferMemoryRequirements2(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkBufferMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkBufferMemoryRequirementsInfo2_win32_to_host((const VkBufferMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferMemoryRequirements2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements2KHR(void *args) -{ - struct vkGetBufferMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetBufferMemoryRequirements2KHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkBufferMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkBufferMemoryRequirementsInfo2_win32_to_host((const VkBufferMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferMemoryRequirements2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureAddress(void *args) -{ - struct vkGetBufferOpaqueCaptureAddress_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferOpaqueCaptureAddress(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferOpaqueCaptureAddress(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureAddressKHR(void *args) -{ - struct vkGetBufferOpaqueCaptureAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferOpaqueCaptureAddressKHR(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferOpaqueCaptureAddressKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetBufferOpaqueCaptureDescriptorDataEXT(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkBufferCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkBufferCaptureDescriptorDataInfoEXT_win32_to_host((const VkBufferCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetBufferOpaqueCaptureDescriptorDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetCalibratedTimestampsEXT(void *args) -{ - struct vkGetCalibratedTimestampsEXT_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - params->result = wine_vkGetCalibratedTimestampsEXT(params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetCalibratedTimestampsEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t timestampCount; - PTR32 pTimestampInfos; - PTR32 pTimestamps; - PTR32 pMaxDeviation; - VkResult result; - } *params = args; - const VkCalibratedTimestampInfoEXT *pTimestampInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - init_conversion_context(ctx); - pTimestampInfos_host = convert_VkCalibratedTimestampInfoEXT_array_win32_to_host(ctx, (const VkCalibratedTimestampInfoEXT32 *)UlongToPtr(params->pTimestampInfos), params->timestampCount); - params->result = wine_vkGetCalibratedTimestampsEXT((VkDevice)UlongToPtr(params->device), params->timestampCount, pTimestampInfos_host, (uint64_t *)UlongToPtr(params->pTimestamps), (uint64_t *)UlongToPtr(params->pMaxDeviation)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetCudaModuleCacheNV(void *args) -{ - struct vkGetCudaModuleCacheNV_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pCacheSize, params->pCacheData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetCudaModuleCacheNV(wine_device_from_handle(params->device)->host_device, params->module, params->pCacheSize, params->pCacheData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetCudaModuleCacheNV(void *args) -{ - struct - { - PTR32 device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pCacheSize; - PTR32 pCacheData; - VkResult result; - } *params = args; - size_t pCacheSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pCacheSize, params->pCacheData); - - pCacheSize_host = *(PTR32 *)UlongToPtr(params->pCacheSize); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetCudaModuleCacheNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->module, &pCacheSize_host, (void *)UlongToPtr(params->pCacheData)); - *(PTR32 *)UlongToPtr(params->pCacheSize) = pCacheSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeferredOperationMaxConcurrencyKHR(void *args) -{ - struct vkGetDeferredOperationMaxConcurrencyKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeferredOperationMaxConcurrencyKHR(wine_device_from_handle(params->device)->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeferredOperationMaxConcurrencyKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - uint32_t result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeferredOperationMaxConcurrencyKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeferredOperationResultKHR(void *args) -{ - struct vkGetDeferredOperationResultKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeferredOperationResultKHR(wine_device_from_handle(params->device)->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeferredOperationResultKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeferredOperationResultKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_deferred_operation_from_handle(params->operation)->host_deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkGetDescriptorEXT(void *args) -{ - struct vkGetDescriptorEXT_params *params = args; - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorEXT(wine_device_from_handle(params->device)->host_device, params->pDescriptorInfo, params->dataSize, params->pDescriptor); -} -#endif /* _WIN64 */ - -static void thunk32_vkGetDescriptorEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pDescriptorInfo; - PTR32 dataSize; - PTR32 pDescriptor; - } *params = args; - VkDescriptorGetInfoEXT pDescriptorInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDescriptorGetInfoEXT_win32_to_host(ctx, (const VkDescriptorGetInfoEXT32 *)UlongToPtr(params->pDescriptorInfo), &pDescriptorInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pDescriptorInfo_host, params->dataSize, (void *)UlongToPtr(params->pDescriptor)); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetHostMappingVALVE(void *args) -{ - struct vkGetDescriptorSetHostMappingVALVE_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSet), params->ppData); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetHostMappingVALVE(wine_device_from_handle(params->device)->host_device, params->descriptorSet, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetHostMappingVALVE(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - PTR32 ppData; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSet), params->ppData); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetHostMappingVALVE(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorSet, (void **)UlongToPtr(params->ppData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutBindingOffsetEXT(void *args) -{ - struct vkGetDescriptorSetLayoutBindingOffsetEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->layout), params->binding, params->pOffset); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetLayoutBindingOffsetEXT(wine_device_from_handle(params->device)->host_device, params->layout, params->binding, params->pOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutBindingOffsetEXT(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - uint32_t binding; - PTR32 pOffset; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->layout), params->binding, params->pOffset); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetLayoutBindingOffsetEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->layout, params->binding, (VkDeviceSize *)UlongToPtr(params->pOffset)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutHostMappingInfoVALVE(void *args) -{ - struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pBindingReference, params->pHostMapping); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetLayoutHostMappingInfoVALVE(wine_device_from_handle(params->device)->host_device, params->pBindingReference, params->pHostMapping); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutHostMappingInfoVALVE(void *args) -{ - struct - { - PTR32 device; - PTR32 pBindingReference; - PTR32 pHostMapping; - } *params = args; - VkDescriptorSetBindingReferenceVALVE pBindingReference_host; - VkDescriptorSetLayoutHostMappingInfoVALVE pHostMapping_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pBindingReference, params->pHostMapping); - - convert_VkDescriptorSetBindingReferenceVALVE_win32_to_host((const VkDescriptorSetBindingReferenceVALVE32 *)UlongToPtr(params->pBindingReference), &pBindingReference_host); - convert_VkDescriptorSetLayoutHostMappingInfoVALVE_win32_to_host((VkDescriptorSetLayoutHostMappingInfoVALVE32 *)UlongToPtr(params->pHostMapping), &pHostMapping_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetLayoutHostMappingInfoVALVE(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pBindingReference_host, &pHostMapping_host); - convert_VkDescriptorSetLayoutHostMappingInfoVALVE_host_to_win32(&pHostMapping_host, (VkDescriptorSetLayoutHostMappingInfoVALVE32 *)UlongToPtr(params->pHostMapping)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSizeEXT(void *args) -{ - struct vkGetDescriptorSetLayoutSizeEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->layout), params->pLayoutSizeInBytes); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetLayoutSizeEXT(wine_device_from_handle(params->device)->host_device, params->layout, params->pLayoutSizeInBytes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSizeEXT(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - PTR32 pLayoutSizeInBytes; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->layout), params->pLayoutSizeInBytes); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetLayoutSizeEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->layout, (VkDeviceSize *)UlongToPtr(params->pLayoutSizeInBytes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSupport(void *args) -{ - struct vkGetDescriptorSetLayoutSupport_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pSupport); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetLayoutSupport(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, params->pSupport); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSupport(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pSupport; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - VkDescriptorSetLayoutSupport pSupport_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pSupport); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkDescriptorSetLayoutSupport_win32_to_host(ctx, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport), &pSupport_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetLayoutSupport(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, &pSupport_host); - convert_VkDescriptorSetLayoutSupport_host_to_win32(&pSupport_host, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSupportKHR(void *args) -{ - struct vkGetDescriptorSetLayoutSupportKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pSupport); - - wine_device_from_handle(params->device)->funcs.p_vkGetDescriptorSetLayoutSupportKHR(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, params->pSupport); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSupportKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pSupport; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - VkDescriptorSetLayoutSupport pSupport_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pSupport); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkDescriptorSetLayoutSupport_win32_to_host(ctx, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport), &pSupport_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDescriptorSetLayoutSupportKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, &pSupport_host); - convert_VkDescriptorSetLayoutSupport_host_to_win32(&pSupport_host, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceAccelerationStructureCompatibilityKHR(void *args) -{ - struct vkGetDeviceAccelerationStructureCompatibilityKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pVersionInfo, params->pCompatibility); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceAccelerationStructureCompatibilityKHR(wine_device_from_handle(params->device)->host_device, params->pVersionInfo, params->pCompatibility); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceAccelerationStructureCompatibilityKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pVersionInfo; - PTR32 pCompatibility; - } *params = args; - VkAccelerationStructureVersionInfoKHR pVersionInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pVersionInfo, params->pCompatibility); - - convert_VkAccelerationStructureVersionInfoKHR_win32_to_host((const VkAccelerationStructureVersionInfoKHR32 *)UlongToPtr(params->pVersionInfo), &pVersionInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceAccelerationStructureCompatibilityKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pVersionInfo_host, (VkAccelerationStructureCompatibilityKHR *)UlongToPtr(params->pCompatibility)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceBufferMemoryRequirements(void *args) -{ - struct vkGetDeviceBufferMemoryRequirements_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceBufferMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceBufferMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceBufferMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceBufferMemoryRequirements_win32_to_host(ctx, (const VkDeviceBufferMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceBufferMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceBufferMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceBufferMemoryRequirementsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceBufferMemoryRequirementsKHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceBufferMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceBufferMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceBufferMemoryRequirements_win32_to_host(ctx, (const VkDeviceBufferMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceBufferMemoryRequirementsKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceFaultInfoEXT(void *args) -{ - struct vkGetDeviceFaultInfoEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pFaultCounts, params->pFaultInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceFaultInfoEXT(wine_device_from_handle(params->device)->host_device, params->pFaultCounts, params->pFaultInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceFaultInfoEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pFaultCounts; - PTR32 pFaultInfo; - VkResult result; - } *params = args; - VkDeviceFaultCountsEXT pFaultCounts_host; - VkDeviceFaultInfoEXT *pFaultInfo_host = NULL; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pFaultCounts, params->pFaultInfo); - - init_conversion_context(ctx); - convert_VkDeviceFaultCountsEXT_win32_to_host((VkDeviceFaultCountsEXT32 *)UlongToPtr(params->pFaultCounts), &pFaultCounts_host); - if (params->pFaultInfo) - { - pFaultInfo_host = conversion_context_alloc(ctx, sizeof(*pFaultInfo_host)); - convert_VkDeviceFaultInfoEXT_win32_to_host(ctx, (VkDeviceFaultInfoEXT32 *)UlongToPtr(params->pFaultInfo), pFaultInfo_host); - } - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceFaultInfoEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pFaultCounts_host, pFaultInfo_host); - convert_VkDeviceFaultCountsEXT_host_to_win32(&pFaultCounts_host, (VkDeviceFaultCountsEXT32 *)UlongToPtr(params->pFaultCounts)); - convert_VkDeviceFaultInfoEXT_host_to_win32(pFaultInfo_host, (VkDeviceFaultInfoEXT32 *)UlongToPtr(params->pFaultInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPeerMemoryFeatures(void *args) -{ - struct vkGetDeviceGroupPeerMemoryFeatures_params *params = args; - - TRACE("%p, %u, %u, %u, %p\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceGroupPeerMemoryFeatures(wine_device_from_handle(params->device)->host_device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPeerMemoryFeatures(void *args) -{ - struct - { - PTR32 device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - PTR32 pPeerMemoryFeatures; - } *params = args; - - TRACE("%#x, %u, %u, %u, %#x\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceGroupPeerMemoryFeatures(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, (VkPeerMemoryFeatureFlags *)UlongToPtr(params->pPeerMemoryFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPeerMemoryFeaturesKHR(void *args) -{ - struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params *params = args; - - TRACE("%p, %u, %u, %u, %p\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceGroupPeerMemoryFeaturesKHR(wine_device_from_handle(params->device)->host_device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPeerMemoryFeaturesKHR(void *args) -{ - struct - { - PTR32 device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - PTR32 pPeerMemoryFeatures; - } *params = args; - - TRACE("%#x, %u, %u, %u, %#x\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceGroupPeerMemoryFeaturesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, (VkPeerMemoryFeatureFlags *)UlongToPtr(params->pPeerMemoryFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPresentCapabilitiesKHR(void *args) -{ - struct vkGetDeviceGroupPresentCapabilitiesKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pDeviceGroupPresentCapabilities); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceGroupPresentCapabilitiesKHR(wine_device_from_handle(params->device)->host_device, params->pDeviceGroupPresentCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPresentCapabilitiesKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pDeviceGroupPresentCapabilities; - VkResult result; - } *params = args; - VkDeviceGroupPresentCapabilitiesKHR pDeviceGroupPresentCapabilities_host; - - TRACE("%#x, %#x\n", params->device, params->pDeviceGroupPresentCapabilities); - - convert_VkDeviceGroupPresentCapabilitiesKHR_win32_to_host((VkDeviceGroupPresentCapabilitiesKHR32 *)UlongToPtr(params->pDeviceGroupPresentCapabilities), &pDeviceGroupPresentCapabilities_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceGroupPresentCapabilitiesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pDeviceGroupPresentCapabilities_host); - convert_VkDeviceGroupPresentCapabilitiesKHR_host_to_win32(&pDeviceGroupPresentCapabilities_host, (VkDeviceGroupPresentCapabilitiesKHR32 *)UlongToPtr(params->pDeviceGroupPresentCapabilities)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupSurfacePresentModesKHR(void *args) -{ - struct vkGetDeviceGroupSurfacePresentModesKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->surface), params->pModes); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceGroupSurfacePresentModesKHR(wine_device_from_handle(params->device)->host_device, wine_surface_from_handle(params->surface)->driver_surface, params->pModes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupSurfacePresentModesKHR(void *args) -{ - struct - { - PTR32 device; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pModes; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->surface), params->pModes); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceGroupSurfacePresentModesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_surface_from_handle(params->surface)->driver_surface, (VkDeviceGroupPresentModeFlagsKHR *)UlongToPtr(params->pModes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageMemoryRequirements(void *args) -{ - struct vkGetDeviceImageMemoryRequirements_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceImageMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceImageMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceImageMemoryRequirementsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceImageMemoryRequirementsKHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceImageMemoryRequirementsKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSparseMemoryRequirements(void *args) -{ - struct vkGetDeviceImageSparseMemoryRequirements_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceImageSparseMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSparseMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceImageSparseMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSparseMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceImageSparseMemoryRequirementsKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceImageSparseMemoryRequirementsKHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSparseMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceImageSparseMemoryRequirementsKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSubresourceLayoutKHR(void *args) -{ - struct vkGetDeviceImageSubresourceLayoutKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pLayout); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceImageSubresourceLayoutKHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSubresourceLayoutKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pLayout; - } *params = args; - VkDeviceImageSubresourceInfoKHR pInfo_host; - VkSubresourceLayout2KHR pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pLayout); - - init_conversion_context(ctx); - convert_VkDeviceImageSubresourceInfoKHR_win32_to_host(ctx, (const VkDeviceImageSubresourceInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkSubresourceLayout2KHR_win32_to_host(ctx, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout), &pLayout_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceImageSubresourceLayoutKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pLayout_host); - convert_VkSubresourceLayout2KHR_host_to_win32(&pLayout_host, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryCommitment(void *args) -{ - struct vkGetDeviceMemoryCommitment_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle(params->device)->host_device, wine_device_memory_from_handle(params->memory)->host_memory, params->pCommittedMemoryInBytes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryCommitment(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - PTR32 pCommittedMemoryInBytes; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_device_memory_from_handle(params->memory)->host_memory, (VkDeviceSize *)UlongToPtr(params->pCommittedMemoryInBytes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddress_params *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%p, %p\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddress(wine_device_from_handle(params->device)->host_device, &pInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host((const VkDeviceMemoryOpaqueCaptureAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddress(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddressKHR(void *args) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%p, %p\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(wine_device_from_handle(params->device)->host_device, &pInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryOpaqueCaptureAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host((const VkDeviceMemoryOpaqueCaptureAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMicromapCompatibilityEXT(void *args) -{ - struct vkGetDeviceMicromapCompatibilityEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pVersionInfo, params->pCompatibility); - - wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMicromapCompatibilityEXT(wine_device_from_handle(params->device)->host_device, params->pVersionInfo, params->pCompatibility); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMicromapCompatibilityEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pVersionInfo; - PTR32 pCompatibility; - } *params = args; - VkMicromapVersionInfoEXT pVersionInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pVersionInfo, params->pCompatibility); - - convert_VkMicromapVersionInfoEXT_win32_to_host((const VkMicromapVersionInfoEXT32 *)UlongToPtr(params->pVersionInfo), &pVersionInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMicromapCompatibilityEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pVersionInfo_host, (VkAccelerationStructureCompatibilityKHR *)UlongToPtr(params->pCompatibility)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceQueue(void *args) -{ - struct vkGetDeviceQueue_params *params = args; - - TRACE("%p, %u, %u, %p\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - - wine_vkGetDeviceQueue(params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceQueue(void *args) -{ - struct - { - PTR32 device; - uint32_t queueFamilyIndex; - uint32_t queueIndex; - PTR32 pQueue; - } *params = args; - VkQueue pQueue_host; - - TRACE("%#x, %u, %u, %#x\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - - pQueue_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pQueue)); - wine_vkGetDeviceQueue((VkDevice)UlongToPtr(params->device), params->queueFamilyIndex, params->queueIndex, &pQueue_host); - *(PTR32 *)UlongToPtr(params->pQueue) = PtrToUlong(pQueue_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceQueue2(void *args) -{ - struct vkGetDeviceQueue2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pQueueInfo, params->pQueue); - - wine_vkGetDeviceQueue2(params->device, params->pQueueInfo, params->pQueue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceQueue2(void *args) -{ - struct - { - PTR32 device; - PTR32 pQueueInfo; - PTR32 pQueue; - } *params = args; - VkDeviceQueueInfo2 pQueueInfo_host; - VkQueue pQueue_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pQueueInfo, params->pQueue); - - convert_VkDeviceQueueInfo2_win32_to_host((const VkDeviceQueueInfo232 *)UlongToPtr(params->pQueueInfo), &pQueueInfo_host); - pQueue_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pQueue)); - wine_vkGetDeviceQueue2((VkDevice)UlongToPtr(params->device), &pQueueInfo_host, &pQueue_host); - *(PTR32 *)UlongToPtr(params->pQueue) = PtrToUlong(pQueue_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(void *args) -{ - struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderpass), params->pMaxWorkgroupSize); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(wine_device_from_handle(params->device)->host_device, params->renderpass, params->pMaxWorkgroupSize); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderpass; - PTR32 pMaxWorkgroupSize; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderpass), params->pMaxWorkgroupSize); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->renderpass, (VkExtent2D *)UlongToPtr(params->pMaxWorkgroupSize)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDynamicRenderingTilePropertiesQCOM(void *args) -{ - struct vkGetDynamicRenderingTilePropertiesQCOM_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pRenderingInfo, params->pProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDynamicRenderingTilePropertiesQCOM(wine_device_from_handle(params->device)->host_device, params->pRenderingInfo, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDynamicRenderingTilePropertiesQCOM(void *args) -{ - struct - { - PTR32 device; - PTR32 pRenderingInfo; - PTR32 pProperties; - VkResult result; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - VkTilePropertiesQCOM pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pRenderingInfo, params->pProperties); - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - convert_VkTilePropertiesQCOM_win32_to_host((VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), &pProperties_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDynamicRenderingTilePropertiesQCOM(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pRenderingInfo_host, &pProperties_host); - convert_VkTilePropertiesQCOM_host_to_win32(&pProperties_host, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetEventStatus(void *args) -{ - struct vkGetEventStatus_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetEventStatus(wine_device_from_handle(params->device)->host_device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetEventStatus(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetEventStatus(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetFenceStatus(void *args) -{ - struct vkGetFenceStatus_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->fence)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetFenceStatus(wine_device_from_handle(params->device)->host_device, params->fence); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetFenceStatus(void *args) -{ - struct - { - PTR32 device; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->fence)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetFenceStatus(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->fence); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetFramebufferTilePropertiesQCOM(void *args) -{ - struct vkGetFramebufferTilePropertiesQCOM_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pPropertiesCount, params->pProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetFramebufferTilePropertiesQCOM(wine_device_from_handle(params->device)->host_device, params->framebuffer, params->pPropertiesCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetFramebufferTilePropertiesQCOM(void *args) -{ - struct - { - PTR32 device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - PTR32 pPropertiesCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkTilePropertiesQCOM *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pPropertiesCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkTilePropertiesQCOM_array_win32_to_host(ctx, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertiesCount)); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetFramebufferTilePropertiesQCOM(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->framebuffer, (uint32_t *)UlongToPtr(params->pPropertiesCount), pProperties_host); - convert_VkTilePropertiesQCOM_array_host_to_win32(pProperties_host, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertiesCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetGeneratedCommandsMemoryRequirementsNV(void *args) -{ - struct vkGetGeneratedCommandsMemoryRequirementsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetGeneratedCommandsMemoryRequirementsNV(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetGeneratedCommandsMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkGeneratedCommandsMemoryRequirementsInfoNV pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win32_to_host((const VkGeneratedCommandsMemoryRequirementsInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetGeneratedCommandsMemoryRequirementsNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements(void *args) -{ - struct vkGetImageMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->image, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pMemoryRequirements; - } *params = args; - VkMemoryRequirements pMemoryRequirements_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pMemoryRequirements); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, &pMemoryRequirements_host); - convert_VkMemoryRequirements_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements2(void *args) -{ - struct vkGetImageMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageMemoryRequirements2(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkImageMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageMemoryRequirementsInfo2_win32_to_host(ctx, (const VkImageMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageMemoryRequirements2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements2KHR(void *args) -{ - struct vkGetImageMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageMemoryRequirements2KHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkImageMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageMemoryRequirementsInfo2_win32_to_host(ctx, (const VkImageMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageMemoryRequirements2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetImageOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetImageOpaqueCaptureDescriptorDataEXT(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkImageCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkImageCaptureDescriptorDataInfoEXT_win32_to_host((const VkImageCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageOpaqueCaptureDescriptorDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements(void *args) -{ - struct vkGetImageSparseMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSparseMemoryRequirements(wine_device_from_handle(params->device)->host_device, params->image, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkSparseImageMemoryRequirements *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - pSparseMemoryRequirements_host = (params->pSparseMemoryRequirements && *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)) ? conversion_context_alloc(ctx, sizeof(*pSparseMemoryRequirements_host) * *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)) : NULL; - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSparseMemoryRequirements(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements32 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements2(void *args) -{ - struct vkGetImageSparseMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSparseMemoryRequirements2(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkImageSparseMemoryRequirementsInfo2 pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host((const VkImageSparseMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSparseMemoryRequirements2(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements2KHR(void *args) -{ - struct vkGetImageSparseMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSparseMemoryRequirements2KHR(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkImageSparseMemoryRequirementsInfo2 pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host((const VkImageSparseMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSparseMemoryRequirements2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout(void *args) -{ - struct vkGetImageSubresourceLayout_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSubresourceLayout(wine_device_from_handle(params->device)->host_device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkSubresourceLayout pLayout_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - convert_VkSubresourceLayout_win32_to_host((VkSubresourceLayout32 *)UlongToPtr(params->pLayout), &pLayout_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSubresourceLayout(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, (const VkImageSubresource *)UlongToPtr(params->pSubresource), &pLayout_host); - convert_VkSubresourceLayout_host_to_win32(&pLayout_host, (VkSubresourceLayout32 *)UlongToPtr(params->pLayout)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout2EXT(void *args) -{ - struct vkGetImageSubresourceLayout2EXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSubresourceLayout2EXT(wine_device_from_handle(params->device)->host_device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout2EXT(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkImageSubresource2KHR pSubresource_host; - VkSubresourceLayout2KHR pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - init_conversion_context(ctx); - convert_VkImageSubresource2KHR_win32_to_host((const VkImageSubresource2KHR32 *)UlongToPtr(params->pSubresource), &pSubresource_host); - convert_VkSubresourceLayout2KHR_win32_to_host(ctx, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout), &pLayout_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSubresourceLayout2EXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, &pSubresource_host, &pLayout_host); - convert_VkSubresourceLayout2KHR_host_to_win32(&pLayout_host, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout2KHR(void *args) -{ - struct vkGetImageSubresourceLayout2KHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - wine_device_from_handle(params->device)->funcs.p_vkGetImageSubresourceLayout2KHR(wine_device_from_handle(params->device)->host_device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout2KHR(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkImageSubresource2KHR pSubresource_host; - VkSubresourceLayout2KHR pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - init_conversion_context(ctx); - convert_VkImageSubresource2KHR_win32_to_host((const VkImageSubresource2KHR32 *)UlongToPtr(params->pSubresource), &pSubresource_host); - convert_VkSubresourceLayout2KHR_win32_to_host(ctx, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout), &pLayout_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageSubresourceLayout2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->image, &pSubresource_host, &pLayout_host); - convert_VkSubresourceLayout2KHR_host_to_win32(&pLayout_host, (VkSubresourceLayout2KHR32 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewAddressNVX(void *args) -{ - struct vkGetImageViewAddressNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->imageView), params->pProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetImageViewAddressNVX(wine_device_from_handle(params->device)->host_device, params->imageView, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewAddressNVX(void *args) -{ - struct - { - PTR32 device; - VkImageView DECLSPEC_ALIGN(8) imageView; - PTR32 pProperties; - VkResult result; - } *params = args; - VkImageViewAddressPropertiesNVX pProperties_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->imageView), params->pProperties); - - convert_VkImageViewAddressPropertiesNVX_win32_to_host((VkImageViewAddressPropertiesNVX32 *)UlongToPtr(params->pProperties), &pProperties_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageViewAddressNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->imageView, &pProperties_host); - convert_VkImageViewAddressPropertiesNVX_host_to_win32(&pProperties_host, (VkImageViewAddressPropertiesNVX32 *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewHandleNVX(void *args) -{ - struct vkGetImageViewHandleNVX_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetImageViewHandleNVX(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewHandleNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint32_t result; - } *params = args; - VkImageViewHandleInfoNVX pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkImageViewHandleInfoNVX_win32_to_host((const VkImageViewHandleInfoNVX32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageViewHandleNVX(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetImageViewOpaqueCaptureDescriptorDataEXT(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkImageViewCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkImageViewCaptureDescriptorDataInfoEXT_win32_to_host((const VkImageViewCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetImageViewOpaqueCaptureDescriptorDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetLatencyTimingsNV(void *args) -{ - struct vkGetLatencyTimingsNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - wine_device_from_handle(params->device)->funcs.p_vkGetLatencyTimingsNV(wine_device_from_handle(params->device)->host_device, params->swapchain, params->pLatencyMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetLatencyTimingsNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pLatencyMarkerInfo; - } *params = args; - VkGetLatencyMarkerInfoNV pLatencyMarkerInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - init_conversion_context(ctx); - convert_VkGetLatencyMarkerInfoNV_win32_to_host(ctx, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetLatencyTimingsNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, &pLatencyMarkerInfo_host); - convert_VkGetLatencyMarkerInfoNV_host_to_win32(&pLatencyMarkerInfo_host, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetMemoryHostPointerPropertiesEXT(void *args) -{ - struct vkGetMemoryHostPointerPropertiesEXT_params *params = args; - - TRACE("%p, %#x, %p, %p\n", params->device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetMemoryHostPointerPropertiesEXT(wine_device_from_handle(params->device)->host_device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetMemoryHostPointerPropertiesEXT(void *args) -{ - struct - { - PTR32 device; - VkExternalMemoryHandleTypeFlagBits handleType; - PTR32 pHostPointer; - PTR32 pMemoryHostPointerProperties; - VkResult result; - } *params = args; - VkMemoryHostPointerPropertiesEXT pMemoryHostPointerProperties_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - - convert_VkMemoryHostPointerPropertiesEXT_win32_to_host((VkMemoryHostPointerPropertiesEXT32 *)UlongToPtr(params->pMemoryHostPointerProperties), &pMemoryHostPointerProperties_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetMemoryHostPointerPropertiesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->handleType, (const void *)UlongToPtr(params->pHostPointer), &pMemoryHostPointerProperties_host); - convert_VkMemoryHostPointerPropertiesEXT_host_to_win32(&pMemoryHostPointerProperties_host, (VkMemoryHostPointerPropertiesEXT32 *)UlongToPtr(params->pMemoryHostPointerProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetMicromapBuildSizesEXT(void *args) -{ - struct vkGetMicromapBuildSizesEXT_params *params = args; - - TRACE("%p, %#x, %p, %p\n", params->device, params->buildType, params->pBuildInfo, params->pSizeInfo); - - wine_device_from_handle(params->device)->funcs.p_vkGetMicromapBuildSizesEXT(wine_device_from_handle(params->device)->host_device, params->buildType, params->pBuildInfo, params->pSizeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetMicromapBuildSizesEXT(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureBuildTypeKHR buildType; - PTR32 pBuildInfo; - PTR32 pSizeInfo; - } *params = args; - VkMicromapBuildInfoEXT pBuildInfo_host; - VkMicromapBuildSizesInfoEXT pSizeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->buildType, params->pBuildInfo, params->pSizeInfo); - - init_conversion_context(ctx); - convert_VkMicromapBuildInfoEXT_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pBuildInfo), &pBuildInfo_host); - convert_VkMicromapBuildSizesInfoEXT_win32_to_host((VkMicromapBuildSizesInfoEXT32 *)UlongToPtr(params->pSizeInfo), &pSizeInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetMicromapBuildSizesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->buildType, &pBuildInfo_host, &pSizeInfo_host); - convert_VkMicromapBuildSizesInfoEXT_host_to_win32(&pSizeInfo_host, (VkMicromapBuildSizesInfoEXT32 *)UlongToPtr(params->pSizeInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPerformanceParameterINTEL(void *args) -{ - struct vkGetPerformanceParameterINTEL_params *params = args; - - TRACE("%p, %#x, %p\n", params->device, params->parameter, params->pValue); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPerformanceParameterINTEL(wine_device_from_handle(params->device)->host_device, params->parameter, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPerformanceParameterINTEL(void *args) -{ - struct - { - PTR32 device; - VkPerformanceParameterTypeINTEL parameter; - PTR32 pValue; - VkResult result; - } *params = args; - VkPerformanceValueINTEL pValue_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->parameter, params->pValue); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPerformanceParameterINTEL(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->parameter, &pValue_host); - convert_VkPerformanceValueINTEL_host_to_win32(&pValue_host, (VkPerformanceValueINTEL32 *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(void *args) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pTimeDomainCount; - PTR32 pTimeDomains; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (uint32_t *)UlongToPtr(params->pTimeDomainCount), (VkTimeDomainEXT *)UlongToPtr(params->pTimeDomains)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkCooperativeMatrixPropertiesKHR *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkCooperativeMatrixPropertiesKHR_array_win32_to_host(ctx, (VkCooperativeMatrixPropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkCooperativeMatrixPropertiesKHR_array_host_to_win32(pProperties_host, (VkCooperativeMatrixPropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(void *args) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkCooperativeMatrixPropertiesNV *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkCooperativeMatrixPropertiesNV_array_win32_to_host(ctx, (VkCooperativeMatrixPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkCooperativeMatrixPropertiesNV_array_host_to_win32(pProperties_host, (VkCooperativeMatrixPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalBufferProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - wine_vkGetPhysicalDeviceExternalBufferProperties(params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalBufferProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalBufferInfo; - PTR32 pExternalBufferProperties; - } *params = args; - VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - VkExternalBufferProperties pExternalBufferProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalBufferInfo32 *)UlongToPtr(params->pExternalBufferInfo), &pExternalBufferInfo_host); - convert_VkExternalBufferProperties_win32_to_host((VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties), &pExternalBufferProperties_host); - wine_vkGetPhysicalDeviceExternalBufferProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalBufferInfo_host, &pExternalBufferProperties_host); - convert_VkExternalBufferProperties_host_to_win32(&pExternalBufferProperties_host, (VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalBufferPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalBufferInfo; - PTR32 pExternalBufferProperties; - } *params = args; - VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - VkExternalBufferProperties pExternalBufferProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalBufferInfo32 *)UlongToPtr(params->pExternalBufferInfo), &pExternalBufferInfo_host); - convert_VkExternalBufferProperties_win32_to_host((VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties), &pExternalBufferProperties_host); - wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalBufferInfo_host, &pExternalBufferProperties_host); - convert_VkExternalBufferProperties_host_to_win32(&pExternalBufferProperties_host, (VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFenceProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalFenceProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - wine_vkGetPhysicalDeviceExternalFenceProperties(params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFenceProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalFenceInfo; - PTR32 pExternalFenceProperties; - } *params = args; - VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - VkExternalFenceProperties pExternalFenceProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); - convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); - wine_vkGetPhysicalDeviceExternalFenceProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); - convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalFenceInfo; - PTR32 pExternalFenceProperties; - } *params = args; - VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - VkExternalFenceProperties pExternalFenceProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); - convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); - wine_vkGetPhysicalDeviceExternalFencePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); - convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalSemaphoreProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - wine_vkGetPhysicalDeviceExternalSemaphoreProperties(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphoreProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalSemaphoreInfo; - PTR32 pExternalSemaphoreProperties; - } *params = args; - VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - VkExternalSemaphoreProperties pExternalSemaphoreProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); - convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphoreProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); - convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalSemaphoreInfo; - PTR32 pExternalSemaphoreProperties; - } *params = args; - VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - VkExternalSemaphoreProperties pExternalSemaphoreProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); - convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); - convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures(void *args) -{ - struct vkGetPhysicalDeviceFeatures_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFeatures(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFeatures(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (VkPhysicalDeviceFeatures *)UlongToPtr(params->pFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures2(void *args) -{ - struct vkGetPhysicalDeviceFeatures2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFeatures2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - VkPhysicalDeviceFeatures2 pFeatures_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceFeatures2_win32_to_host(ctx, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures), &pFeatures_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFeatures2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pFeatures_host); - convert_VkPhysicalDeviceFeatures2_host_to_win32(&pFeatures_host, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures2KHR(void *args) -{ - struct vkGetPhysicalDeviceFeatures2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFeatures2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - VkPhysicalDeviceFeatures2 pFeatures_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceFeatures2_win32_to_host(ctx, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures), &pFeatures_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFeatures2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pFeatures_host); - convert_VkPhysicalDeviceFeatures2_host_to_win32(&pFeatures_host, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFormatProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFormatProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->format, (VkFormatProperties *)UlongToPtr(params->pFormatProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties2_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFormatProperties2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - VkFormatProperties2 pFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - init_conversion_context(ctx); - convert_VkFormatProperties2_win32_to_host(ctx, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties), &pFormatProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFormatProperties2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->format, &pFormatProperties_host); - convert_VkFormatProperties2_host_to_win32(&pFormatProperties_host, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties2KHR_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFormatProperties2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - VkFormatProperties2 pFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - init_conversion_context(ctx); - convert_VkFormatProperties2_win32_to_host(ctx, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties), &pFormatProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFormatProperties2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->format, &pFormatProperties_host); - convert_VkFormatProperties2_host_to_win32(&pFormatProperties_host, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFragmentShadingRatesKHR(void *args) -{ - struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceFragmentShadingRatesKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFragmentShadingRatesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFragmentShadingRateCount; - PTR32 pFragmentShadingRates; - VkResult result; - } *params = args; - VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - - init_conversion_context(ctx); - pFragmentShadingRates_host = convert_VkPhysicalDeviceFragmentShadingRateKHR_array_win32_to_host(ctx, (VkPhysicalDeviceFragmentShadingRateKHR32 *)UlongToPtr(params->pFragmentShadingRates), *(uint32_t *)UlongToPtr(params->pFragmentShadingRateCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceFragmentShadingRatesKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pFragmentShadingRateCount), pFragmentShadingRates_host); - convert_VkPhysicalDeviceFragmentShadingRateKHR_array_host_to_win32(pFragmentShadingRates_host, (VkPhysicalDeviceFragmentShadingRateKHR32 *)UlongToPtr(params->pFragmentShadingRates), *(uint32_t *)UlongToPtr(params->pFragmentShadingRateCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties_params *params = args; - - TRACE("%p, %#x, %#x, %#x, %#x, %#x, %p\n", params->physicalDevice, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkImageFormatProperties pImageFormatProperties_host; - - TRACE("%#x, %#x, %#x, %#x, %#x, %#x, %#x\n", params->physicalDevice, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->format, params->type, params->tiling, params->usage, params->flags, &pImageFormatProperties_host); - convert_VkImageFormatProperties_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties32 *)UlongToPtr(params->pImageFormatProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties2_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2(params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pImageFormatInfo; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceImageFormatInfo2 pImageFormatInfo_host; - VkImageFormatProperties2 pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(ctx, (const VkPhysicalDeviceImageFormatInfo232 *)UlongToPtr(params->pImageFormatInfo), &pImageFormatInfo_host); - convert_VkImageFormatProperties2_win32_to_host(ctx, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties), &pImageFormatProperties_host); - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pImageFormatInfo_host, &pImageFormatProperties_host); - convert_VkImageFormatProperties2_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2KHR(params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pImageFormatInfo; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceImageFormatInfo2 pImageFormatInfo_host; - VkImageFormatProperties2 pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(ctx, (const VkPhysicalDeviceImageFormatInfo232 *)UlongToPtr(params->pImageFormatInfo), &pImageFormatInfo_host); - convert_VkImageFormatProperties2_win32_to_host(ctx, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties), &pImageFormatProperties_host); - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2KHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pImageFormatInfo_host, &pImageFormatProperties_host); - convert_VkImageFormatProperties2_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties pMemoryProperties_host; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties32 *)UlongToPtr(params->pMemoryProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties2(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties2 pMemoryProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(ctx, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties), &pMemoryProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties2 pMemoryProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(ctx, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties), &pMemoryProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMultisamplePropertiesEXT(void *args) -{ - struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->samples, params->pMultisampleProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceMultisamplePropertiesEXT(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->samples, params->pMultisampleProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMultisamplePropertiesEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSampleCountFlagBits samples; - PTR32 pMultisampleProperties; - } *params = args; - VkMultisamplePropertiesEXT pMultisampleProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->samples, params->pMultisampleProperties); - - convert_VkMultisamplePropertiesEXT_win32_to_host((VkMultisamplePropertiesEXT32 *)UlongToPtr(params->pMultisampleProperties), &pMultisampleProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceMultisamplePropertiesEXT(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->samples, &pMultisampleProperties_host); - convert_VkMultisamplePropertiesEXT_host_to_win32(&pMultisampleProperties_host, (VkMultisamplePropertiesEXT32 *)UlongToPtr(params->pMultisampleProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(void *args) -{ - struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pOpticalFlowImageFormatInfo; - PTR32 pFormatCount; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkOpticalFlowImageFormatInfoNV pOpticalFlowImageFormatInfo_host; - VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkOpticalFlowImageFormatInfoNV_win32_to_host((const VkOpticalFlowImageFormatInfoNV32 *)UlongToPtr(params->pOpticalFlowImageFormatInfo), &pOpticalFlowImageFormatInfo_host); - pImageFormatProperties_host = convert_VkOpticalFlowImageFormatPropertiesNV_array_win32_to_host(ctx, (VkOpticalFlowImageFormatPropertiesNV32 *)UlongToPtr(params->pImageFormatProperties), *(uint32_t *)UlongToPtr(params->pFormatCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pOpticalFlowImageFormatInfo_host, (uint32_t *)UlongToPtr(params->pFormatCount), pImageFormatProperties_host); - convert_VkOpticalFlowImageFormatPropertiesNV_array_host_to_win32(pImageFormatProperties_host, (VkOpticalFlowImageFormatPropertiesNV32 *)UlongToPtr(params->pImageFormatProperties), *(uint32_t *)UlongToPtr(params->pFormatCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDevicePresentRectanglesKHR(void *args) -{ - struct vkGetPhysicalDevicePresentRectanglesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pRectCount, params->pRects); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDevicePresentRectanglesKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, wine_surface_from_handle(params->surface)->driver_surface, params->pRectCount, params->pRects); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDevicePresentRectanglesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pRectCount; - PTR32 pRects; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pRectCount, params->pRects); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDevicePresentRectanglesKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, wine_surface_from_handle(params->surface)->driver_surface, (uint32_t *)UlongToPtr(params->pRectCount), (VkRect2D *)UlongToPtr(params->pRects)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties(void *args) -{ - struct vkGetPhysicalDeviceProperties_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties pProperties_host; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties32 *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties2(void *args) -{ - struct vkGetPhysicalDeviceProperties2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceProperties2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties2 pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceProperties2_win32_to_host(ctx, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties), &pProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceProperties2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties2_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceProperties2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceProperties2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties2 pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceProperties2_win32_to_host(ctx, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties), &pProperties_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceProperties2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties2_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPerformanceQueryCreateInfo, params->pNumPasses); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pPerformanceQueryCreateInfo, params->pNumPasses); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPerformanceQueryCreateInfo; - PTR32 pNumPasses; - } *params = args; - VkQueryPoolPerformanceCreateInfoKHR pPerformanceQueryCreateInfo_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPerformanceQueryCreateInfo, params->pNumPasses); - - convert_VkQueryPoolPerformanceCreateInfoKHR_win32_to_host((const VkQueryPoolPerformanceCreateInfoKHR32 *)UlongToPtr(params->pPerformanceQueryCreateInfo), &pPerformanceQueryCreateInfo_host); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pPerformanceQueryCreateInfo_host, (uint32_t *)UlongToPtr(params->pNumPasses)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), (VkQueueFamilyProperties *)UlongToPtr(params->pQueueFamilyProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties2(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - VkQueueFamilyProperties2 *pQueueFamilyProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - init_conversion_context(ctx); - pQueueFamilyProperties_host = convert_VkQueueFamilyProperties2_array_win32_to_host(ctx, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), pQueueFamilyProperties_host); - convert_VkQueueFamilyProperties2_array_host_to_win32(pQueueFamilyProperties_host, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - VkQueueFamilyProperties2 *pQueueFamilyProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - init_conversion_context(ctx); - pQueueFamilyProperties_host = convert_VkQueueFamilyProperties2_array_win32_to_host(ctx, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), pQueueFamilyProperties_host); - convert_VkQueueFamilyProperties2_array_host_to_win32(pQueueFamilyProperties_host, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties_params *params = args; - - TRACE("%p, %#x, %#x, %#x, %#x, %#x, %p, %p\n", params->physicalDevice, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - - TRACE("%#x, %#x, %#x, %#x, %#x, %#x, %#x, %#x\n", params->physicalDevice, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->format, params->type, params->samples, params->usage, params->tiling, (uint32_t *)UlongToPtr(params->pPropertyCount), (VkSparseImageFormatProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFormatInfo, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFormatInfo; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceSparseImageFormatInfo2 pFormatInfo_host; - VkSparseImageFormatProperties2 *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host((const VkPhysicalDeviceSparseImageFormatInfo232 *)UlongToPtr(params->pFormatInfo), &pFormatInfo_host); - pProperties_host = convert_VkSparseImageFormatProperties2_array_win32_to_host(ctx, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pFormatInfo_host, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkSparseImageFormatProperties2_array_host_to_win32(pProperties_host, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pFormatInfo, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFormatInfo; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceSparseImageFormatInfo2 pFormatInfo_host; - VkSparseImageFormatProperties2 *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host((const VkPhysicalDeviceSparseImageFormatInfo232 *)UlongToPtr(params->pFormatInfo), &pFormatInfo_host); - pProperties_host = convert_VkSparseImageFormatProperties2_array_win32_to_host(ctx, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pFormatInfo_host, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkSparseImageFormatProperties2_array_host_to_win32(pProperties_host, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(void *args) -{ - struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pCombinationCount, params->pCombinations); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pCombinationCount, params->pCombinations); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pCombinationCount; - PTR32 pCombinations; - VkResult result; - } *params = args; - VkFramebufferMixedSamplesCombinationNV *pCombinations_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pCombinationCount, params->pCombinations); - - init_conversion_context(ctx); - pCombinations_host = convert_VkFramebufferMixedSamplesCombinationNV_array_win32_to_host(ctx, (VkFramebufferMixedSamplesCombinationNV32 *)UlongToPtr(params->pCombinations), *(uint32_t *)UlongToPtr(params->pCombinationCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pCombinationCount), pCombinations_host); - convert_VkFramebufferMixedSamplesCombinationNV_array_host_to_win32(pCombinations_host, (VkFramebufferMixedSamplesCombinationNV32 *)UlongToPtr(params->pCombinations), *(uint32_t *)UlongToPtr(params->pCombinationCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceCapabilities2KHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - - params->result = wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceCapabilities2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pSurfaceInfo; - PTR32 pSurfaceCapabilities; - VkResult result; - } *params = args; - VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host; - VkSurfaceCapabilities2KHR pSurfaceCapabilities_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_unwrapped_host(ctx, (const VkPhysicalDeviceSurfaceInfo2KHR32 *)UlongToPtr(params->pSurfaceInfo), &pSurfaceInfo_host); - convert_VkSurfaceCapabilities2KHR_win32_to_host(ctx, (VkSurfaceCapabilities2KHR32 *)UlongToPtr(params->pSurfaceCapabilities), &pSurfaceCapabilities_host); - params->result = wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pSurfaceInfo_host, &pSurfaceCapabilities_host); - convert_VkSurfaceCapabilities2KHR_host_to_win32(&pSurfaceCapabilities_host, (VkSurfaceCapabilities2KHR32 *)UlongToPtr(params->pSurfaceCapabilities)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceCapabilities); - - params->result = wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(params->physicalDevice, params->surface, params->pSurfaceCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSurfaceCapabilities; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceCapabilities); - - params->result = wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), params->surface, (VkSurfaceCapabilitiesKHR *)UlongToPtr(params->pSurfaceCapabilities)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceFormats2KHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceFormats2KHR_params *params = args; - VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceFormatCount, params->pSurfaceFormats); - - convert_VkPhysicalDeviceSurfaceInfo2KHR_win64_to_driver(params->pSurfaceInfo, &pSurfaceInfo_host); - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, &pSurfaceInfo_host, params->pSurfaceFormatCount, params->pSurfaceFormats); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceFormats2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pSurfaceInfo; - PTR32 pSurfaceFormatCount; - PTR32 pSurfaceFormats; - VkResult result; - } *params = args; - VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host; - VkSurfaceFormat2KHR *pSurfaceFormats_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceFormatCount, params->pSurfaceFormats); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_driver(ctx, (const VkPhysicalDeviceSurfaceInfo2KHR32 *)UlongToPtr(params->pSurfaceInfo), &pSurfaceInfo_host); - pSurfaceFormats_host = convert_VkSurfaceFormat2KHR_array_win32_to_host(ctx, (VkSurfaceFormat2KHR32 *)UlongToPtr(params->pSurfaceFormats), *(uint32_t *)UlongToPtr(params->pSurfaceFormatCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, &pSurfaceInfo_host, (uint32_t *)UlongToPtr(params->pSurfaceFormatCount), pSurfaceFormats_host); - convert_VkSurfaceFormat2KHR_array_host_to_win32(pSurfaceFormats_host, (VkSurfaceFormat2KHR32 *)UlongToPtr(params->pSurfaceFormats), *(uint32_t *)UlongToPtr(params->pSurfaceFormatCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceFormatsKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceFormatsKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceFormatCount, params->pSurfaceFormats); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormatsKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->surface ? wine_surface_from_handle(params->surface)->driver_surface : 0, params->pSurfaceFormatCount, params->pSurfaceFormats); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceFormatsKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSurfaceFormatCount; - PTR32 pSurfaceFormats; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceFormatCount, params->pSurfaceFormats); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormatsKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->surface ? wine_surface_from_handle(params->surface)->driver_surface : 0, (uint32_t *)UlongToPtr(params->pSurfaceFormatCount), (VkSurfaceFormatKHR *)UlongToPtr(params->pSurfaceFormats)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfacePresentModesKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfacePresentModesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pPresentModeCount, params->pPresentModes); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSurfacePresentModesKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->surface ? wine_surface_from_handle(params->surface)->driver_surface : 0, params->pPresentModeCount, params->pPresentModes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfacePresentModesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pPresentModeCount; - PTR32 pPresentModes; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pPresentModeCount, params->pPresentModes); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSurfacePresentModesKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->surface ? wine_surface_from_handle(params->surface)->driver_surface : 0, (uint32_t *)UlongToPtr(params->pPresentModeCount), (VkPresentModeKHR *)UlongToPtr(params->pPresentModes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceSupportKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceSupportKHR_params *params = args; - - TRACE("%p, %u, 0x%s, %p\n", params->physicalDevice, params->queueFamilyIndex, wine_dbgstr_longlong(params->surface), params->pSupported); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceSurfaceSupportKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->queueFamilyIndex, wine_surface_from_handle(params->surface)->driver_surface, params->pSupported); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceSupportKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSupported; - VkResult result; - } *params = args; - - TRACE("%#x, %u, 0x%s, %#x\n", params->physicalDevice, params->queueFamilyIndex, wine_dbgstr_longlong(params->surface), params->pSupported); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceSurfaceSupportKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->queueFamilyIndex, wine_surface_from_handle(params->surface)->driver_surface, (VkBool32 *)UlongToPtr(params->pSupported)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceToolProperties(void *args) -{ - struct vkGetPhysicalDeviceToolProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceToolProperties(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pToolCount, params->pToolProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceToolProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pToolCount; - PTR32 pToolProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceToolProperties *pToolProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - init_conversion_context(ctx); - pToolProperties_host = convert_VkPhysicalDeviceToolProperties_array_win32_to_host(ctx, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceToolProperties(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pToolCount), pToolProperties_host); - convert_VkPhysicalDeviceToolProperties_array_host_to_win32(pToolProperties_host, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceToolPropertiesEXT(void *args) -{ - struct vkGetPhysicalDeviceToolPropertiesEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceToolPropertiesEXT(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->pToolCount, params->pToolProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceToolPropertiesEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pToolCount; - PTR32 pToolProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceToolProperties *pToolProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - init_conversion_context(ctx); - pToolProperties_host = convert_VkPhysicalDeviceToolProperties_array_win32_to_host(ctx, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceToolPropertiesEXT(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, (uint32_t *)UlongToPtr(params->pToolCount), pToolProperties_host); - convert_VkPhysicalDeviceToolProperties_array_host_to_win32(pToolProperties_host, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceWin32PresentationSupportKHR(void *args) -{ - struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params *params = args; - - TRACE("%p, %u\n", params->physicalDevice, params->queueFamilyIndex); - - params->result = wine_phys_dev_from_handle(params->physicalDevice)->instance->funcs.p_vkGetPhysicalDeviceWin32PresentationSupportKHR(wine_phys_dev_from_handle(params->physicalDevice)->host_physical_device, params->queueFamilyIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceWin32PresentationSupportKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - VkBool32 result; - } *params = args; - - TRACE("%#x, %u\n", params->physicalDevice, params->queueFamilyIndex); - - params->result = wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->funcs.p_vkGetPhysicalDeviceWin32PresentationSupportKHR(wine_phys_dev_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host_physical_device, params->queueFamilyIndex); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineCacheData(void *args) -{ - struct vkGetPipelineCacheData_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineCacheData(wine_device_from_handle(params->device)->host_device, params->pipelineCache, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineCacheData(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineCacheData(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipelineCache, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutableInternalRepresentationsKHR(void *args) -{ - struct vkGetPipelineExecutableInternalRepresentationsKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineExecutableInternalRepresentationsKHR(wine_device_from_handle(params->device)->host_device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutableInternalRepresentationsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pExecutableInfo; - PTR32 pInternalRepresentationCount; - PTR32 pInternalRepresentations; - VkResult result; - } *params = args; - VkPipelineExecutableInfoKHR pExecutableInfo_host; - VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - - init_conversion_context(ctx); - convert_VkPipelineExecutableInfoKHR_win32_to_host((const VkPipelineExecutableInfoKHR32 *)UlongToPtr(params->pExecutableInfo), &pExecutableInfo_host); - pInternalRepresentations_host = convert_VkPipelineExecutableInternalRepresentationKHR_array_win32_to_host(ctx, (VkPipelineExecutableInternalRepresentationKHR32 *)UlongToPtr(params->pInternalRepresentations), *(uint32_t *)UlongToPtr(params->pInternalRepresentationCount)); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineExecutableInternalRepresentationsKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pExecutableInfo_host, (uint32_t *)UlongToPtr(params->pInternalRepresentationCount), pInternalRepresentations_host); - convert_VkPipelineExecutableInternalRepresentationKHR_array_host_to_win32(pInternalRepresentations_host, (VkPipelineExecutableInternalRepresentationKHR32 *)UlongToPtr(params->pInternalRepresentations), *(uint32_t *)UlongToPtr(params->pInternalRepresentationCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutablePropertiesKHR(void *args) -{ - struct vkGetPipelineExecutablePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineExecutablePropertiesKHR(wine_device_from_handle(params->device)->host_device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutablePropertiesKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pPipelineInfo; - PTR32 pExecutableCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkPipelineInfoKHR pPipelineInfo_host; - VkPipelineExecutablePropertiesKHR *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPipelineInfoKHR_win32_to_host((const VkPipelineInfoKHR32 *)UlongToPtr(params->pPipelineInfo), &pPipelineInfo_host); - pProperties_host = convert_VkPipelineExecutablePropertiesKHR_array_win32_to_host(ctx, (VkPipelineExecutablePropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pExecutableCount)); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineExecutablePropertiesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pPipelineInfo_host, (uint32_t *)UlongToPtr(params->pExecutableCount), pProperties_host); - convert_VkPipelineExecutablePropertiesKHR_array_host_to_win32(pProperties_host, (VkPipelineExecutablePropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pExecutableCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutableStatisticsKHR(void *args) -{ - struct vkGetPipelineExecutableStatisticsKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineExecutableStatisticsKHR(wine_device_from_handle(params->device)->host_device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutableStatisticsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pExecutableInfo; - PTR32 pStatisticCount; - PTR32 pStatistics; - VkResult result; - } *params = args; - VkPipelineExecutableInfoKHR pExecutableInfo_host; - VkPipelineExecutableStatisticKHR *pStatistics_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - - init_conversion_context(ctx); - convert_VkPipelineExecutableInfoKHR_win32_to_host((const VkPipelineExecutableInfoKHR32 *)UlongToPtr(params->pExecutableInfo), &pExecutableInfo_host); - pStatistics_host = convert_VkPipelineExecutableStatisticKHR_array_win32_to_host(ctx, (VkPipelineExecutableStatisticKHR32 *)UlongToPtr(params->pStatistics), *(uint32_t *)UlongToPtr(params->pStatisticCount)); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineExecutableStatisticsKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pExecutableInfo_host, (uint32_t *)UlongToPtr(params->pStatisticCount), pStatistics_host); - convert_VkPipelineExecutableStatisticKHR_array_host_to_win32(pStatistics_host, (VkPipelineExecutableStatisticKHR32 *)UlongToPtr(params->pStatistics), *(uint32_t *)UlongToPtr(params->pStatisticCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineIndirectDeviceAddressNV(void *args) -{ - struct vkGetPipelineIndirectDeviceAddressNV_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineIndirectDeviceAddressNV(wine_device_from_handle(params->device)->host_device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineIndirectDeviceAddressNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkPipelineIndirectDeviceAddressInfoNV pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkPipelineIndirectDeviceAddressInfoNV_win32_to_host((const VkPipelineIndirectDeviceAddressInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineIndirectDeviceAddressNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineIndirectMemoryRequirementsNV(void *args) -{ - struct vkGetPipelineIndirectMemoryRequirementsNV_params *params = args; - VkComputePipelineCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkComputePipelineCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - wine_device_from_handle(params->device)->funcs.p_vkGetPipelineIndirectMemoryRequirementsNV(wine_device_from_handle(params->device)->host_device, &pCreateInfo_host, params->pMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineIndirectMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkComputePipelineCreateInfo pCreateInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkComputePipelineCreateInfo_win32_to_host(ctx, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelineIndirectMemoryRequirementsNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, &pMemoryRequirements_host); - convert_VkComputePipelineCreateInfo_host_to_win32(&pCreateInfo_host, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfo)); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelinePropertiesEXT(void *args) -{ - struct vkGetPipelinePropertiesEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pPipelineInfo, params->pPipelineProperties); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelinePropertiesEXT(wine_device_from_handle(params->device)->host_device, params->pPipelineInfo, params->pPipelineProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelinePropertiesEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pPipelineInfo; - PTR32 pPipelineProperties; - VkResult result; - } *params = args; - VkPipelineInfoEXT pPipelineInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pPipelineInfo, params->pPipelineProperties); - - convert_VkPipelineInfoEXT_win32_to_host((const VkPipelineInfoEXT32 *)UlongToPtr(params->pPipelineInfo), &pPipelineInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPipelinePropertiesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pPipelineInfo_host, (VkBaseOutStructure *)UlongToPtr(params->pPipelineProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPrivateData(void *args) -{ - struct vkGetPrivateData_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, %p\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - wine_device_from_handle(params->device)->funcs.p_vkGetPrivateData(wine_device_from_handle(params->device)->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPrivateData(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pData; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, %#x\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPrivateData(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, (uint64_t *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPrivateDataEXT(void *args) -{ - struct vkGetPrivateDataEXT_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, %p\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - wine_device_from_handle(params->device)->funcs.p_vkGetPrivateDataEXT(wine_device_from_handle(params->device)->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPrivateDataEXT(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pData; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, %#x\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetPrivateDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, (uint64_t *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueryPoolResults(void *args) -{ - struct vkGetQueryPoolResults_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride), params->flags); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetQueryPoolResults(wine_device_from_handle(params->device)->host_device, params->queryPool, params->firstQuery, params->queryCount, params->dataSize, params->pData, params->stride, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueryPoolResults(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - PTR32 dataSize; - PTR32 pData; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride), params->flags); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetQueryPoolResults(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->queryPool, params->firstQuery, params->queryCount, params->dataSize, (void *)UlongToPtr(params->pData), params->stride, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueueCheckpointData2NV(void *args) -{ - struct vkGetQueueCheckpointData2NV_params *params = args; - - TRACE("%p, %p, %p\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkGetQueueCheckpointData2NV(wine_queue_from_handle(params->queue)->host_queue, params->pCheckpointDataCount, params->pCheckpointData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueueCheckpointData2NV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pCheckpointDataCount; - PTR32 pCheckpointData; - } *params = args; - VkCheckpointData2NV *pCheckpointData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - init_conversion_context(ctx); - pCheckpointData_host = convert_VkCheckpointData2NV_array_win32_to_host(ctx, (VkCheckpointData2NV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkGetQueueCheckpointData2NV(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, (uint32_t *)UlongToPtr(params->pCheckpointDataCount), pCheckpointData_host); - convert_VkCheckpointData2NV_array_host_to_win32(pCheckpointData_host, (VkCheckpointData2NV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueueCheckpointDataNV(void *args) -{ - struct vkGetQueueCheckpointDataNV_params *params = args; - - TRACE("%p, %p, %p\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkGetQueueCheckpointDataNV(wine_queue_from_handle(params->queue)->host_queue, params->pCheckpointDataCount, params->pCheckpointData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueueCheckpointDataNV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pCheckpointDataCount; - PTR32 pCheckpointData; - } *params = args; - VkCheckpointDataNV *pCheckpointData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - init_conversion_context(ctx); - pCheckpointData_host = convert_VkCheckpointDataNV_array_win32_to_host(ctx, (VkCheckpointDataNV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkGetQueueCheckpointDataNV(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, (uint32_t *)UlongToPtr(params->pCheckpointDataCount), pCheckpointData_host); - convert_VkCheckpointDataNV_array_host_to_win32(pCheckpointData_host, (VkCheckpointDataNV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(void *args) -{ - struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(wine_device_from_handle(params->device)->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupHandlesKHR(void *args) -{ - struct vkGetRayTracingShaderGroupHandlesKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetRayTracingShaderGroupHandlesKHR(wine_device_from_handle(params->device)->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupHandlesKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRayTracingShaderGroupHandlesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupHandlesNV(void *args) -{ - struct vkGetRayTracingShaderGroupHandlesNV_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetRayTracingShaderGroupHandlesNV(wine_device_from_handle(params->device)->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupHandlesNV(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRayTracingShaderGroupHandlesNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupStackSizeKHR(void *args) -{ - struct vkGetRayTracingShaderGroupStackSizeKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->group, params->groupShader); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetRayTracingShaderGroupStackSizeKHR(wine_device_from_handle(params->device)->host_device, params->pipeline, params->group, params->groupShader); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupStackSizeKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t group; - VkShaderGroupShaderKHR groupShader; - VkDeviceSize result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->group, params->groupShader); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRayTracingShaderGroupStackSizeKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->group, params->groupShader); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRenderAreaGranularity(void *args) -{ - struct vkGetRenderAreaGranularity_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pGranularity); - - wine_device_from_handle(params->device)->funcs.p_vkGetRenderAreaGranularity(wine_device_from_handle(params->device)->host_device, params->renderPass, params->pGranularity); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRenderAreaGranularity(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - PTR32 pGranularity; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pGranularity); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRenderAreaGranularity(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->renderPass, (VkExtent2D *)UlongToPtr(params->pGranularity)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRenderingAreaGranularityKHR(void *args) -{ - struct vkGetRenderingAreaGranularityKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - wine_device_from_handle(params->device)->funcs.p_vkGetRenderingAreaGranularityKHR(wine_device_from_handle(params->device)->host_device, params->pRenderingAreaInfo, params->pGranularity); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRenderingAreaGranularityKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pRenderingAreaInfo; - PTR32 pGranularity; - } *params = args; - VkRenderingAreaInfoKHR pRenderingAreaInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - convert_VkRenderingAreaInfoKHR_win32_to_host((const VkRenderingAreaInfoKHR32 *)UlongToPtr(params->pRenderingAreaInfo), &pRenderingAreaInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetRenderingAreaGranularityKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pRenderingAreaInfo_host, (VkExtent2D *)UlongToPtr(params->pGranularity)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSamplerOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetSamplerOpaqueCaptureDescriptorDataEXT(wine_device_from_handle(params->device)->host_device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSamplerOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkSamplerCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkSamplerCaptureDescriptorDataInfoEXT_win32_to_host((const VkSamplerCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetSamplerOpaqueCaptureDescriptorDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSemaphoreCounterValue(void *args) -{ - struct vkGetSemaphoreCounterValue_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetSemaphoreCounterValue(wine_device_from_handle(params->device)->host_device, params->semaphore, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSemaphoreCounterValue(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pValue; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetSemaphoreCounterValue(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->semaphore, (uint64_t *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSemaphoreCounterValueKHR(void *args) -{ - struct vkGetSemaphoreCounterValueKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetSemaphoreCounterValueKHR(wine_device_from_handle(params->device)->host_device, params->semaphore, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSemaphoreCounterValueKHR(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pValue; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetSemaphoreCounterValueKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->semaphore, (uint64_t *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderBinaryDataEXT(void *args) -{ - struct vkGetShaderBinaryDataEXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->shader), params->pDataSize, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetShaderBinaryDataEXT(wine_device_from_handle(params->device)->host_device, params->shader, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderBinaryDataEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->shader), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetShaderBinaryDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->shader, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderInfoAMD(void *args) -{ - struct vkGetShaderInfoAMD_params *params = args; - - TRACE("%p, 0x%s, %#x, %#x, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetShaderInfoAMD(wine_device_from_handle(params->device)->host_device, params->pipeline, params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderInfoAMD(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkShaderStageFlagBits shaderStage; - VkShaderInfoTypeAMD infoType; - PTR32 pInfoSize; - PTR32 pInfo; - VkResult result; - } *params = args; - size_t pInfoSize_host; - - TRACE("%#x, 0x%s, %#x, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - - pInfoSize_host = *(PTR32 *)UlongToPtr(params->pInfoSize); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetShaderInfoAMD(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->pipeline, params->shaderStage, params->infoType, &pInfoSize_host, (void *)UlongToPtr(params->pInfo)); - *(PTR32 *)UlongToPtr(params->pInfoSize) = pInfoSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderModuleCreateInfoIdentifierEXT(void *args) -{ - struct vkGetShaderModuleCreateInfoIdentifierEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pIdentifier); - - wine_device_from_handle(params->device)->funcs.p_vkGetShaderModuleCreateInfoIdentifierEXT(wine_device_from_handle(params->device)->host_device, params->pCreateInfo, params->pIdentifier); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderModuleCreateInfoIdentifierEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pIdentifier; - } *params = args; - VkShaderModuleCreateInfo pCreateInfo_host; - VkShaderModuleIdentifierEXT pIdentifier_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pIdentifier); - - init_conversion_context(ctx); - convert_VkShaderModuleCreateInfo_win32_to_host(ctx, (const VkShaderModuleCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkShaderModuleIdentifierEXT_win32_to_host((VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier), &pIdentifier_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetShaderModuleCreateInfoIdentifierEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pCreateInfo_host, &pIdentifier_host); - convert_VkShaderModuleIdentifierEXT_host_to_win32(&pIdentifier_host, (VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderModuleIdentifierEXT(void *args) -{ - struct vkGetShaderModuleIdentifierEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pIdentifier); - - wine_device_from_handle(params->device)->funcs.p_vkGetShaderModuleIdentifierEXT(wine_device_from_handle(params->device)->host_device, params->shaderModule, params->pIdentifier); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderModuleIdentifierEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - PTR32 pIdentifier; - } *params = args; - VkShaderModuleIdentifierEXT pIdentifier_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pIdentifier); - - convert_VkShaderModuleIdentifierEXT_win32_to_host((VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier), &pIdentifier_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetShaderModuleIdentifierEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->shaderModule, &pIdentifier_host); - convert_VkShaderModuleIdentifierEXT_host_to_win32(&pIdentifier_host, (VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSwapchainImagesKHR(void *args) -{ - struct vkGetSwapchainImagesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetSwapchainImagesKHR(wine_device_from_handle(params->device)->host_device, params->swapchain, params->pSwapchainImageCount, params->pSwapchainImages); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSwapchainImagesKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSwapchainImageCount; - PTR32 pSwapchainImages; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetSwapchainImagesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, (uint32_t *)UlongToPtr(params->pSwapchainImageCount), (VkImage *)UlongToPtr(params->pSwapchainImages)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetValidationCacheDataEXT(void *args) -{ - struct vkGetValidationCacheDataEXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetValidationCacheDataEXT(wine_device_from_handle(params->device)->host_device, params->validationCache, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetValidationCacheDataEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetValidationCacheDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->validationCache, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkInitializePerformanceApiINTEL(void *args) -{ - struct vkInitializePerformanceApiINTEL_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInitializeInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkInitializePerformanceApiINTEL(wine_device_from_handle(params->device)->host_device, params->pInitializeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkInitializePerformanceApiINTEL(void *args) -{ - struct - { - PTR32 device; - PTR32 pInitializeInfo; - VkResult result; - } *params = args; - VkInitializePerformanceApiInfoINTEL pInitializeInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInitializeInfo); - - convert_VkInitializePerformanceApiInfoINTEL_win32_to_host((const VkInitializePerformanceApiInfoINTEL32 *)UlongToPtr(params->pInitializeInfo), &pInitializeInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkInitializePerformanceApiINTEL(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pInitializeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkInvalidateMappedMemoryRanges(void *args) -{ - struct vkInvalidateMappedMemoryRanges_params *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(ctx, params->pMemoryRanges, params->memoryRangeCount); - params->result = wine_device_from_handle(params->device)->funcs.p_vkInvalidateMappedMemoryRanges(wine_device_from_handle(params->device)->host_device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkInvalidateMappedMemoryRanges(void *args) -{ - struct - { - PTR32 device; - uint32_t memoryRangeCount; - PTR32 pMemoryRanges; - VkResult result; - } *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win32_to_host(ctx, (const VkMappedMemoryRange32 *)UlongToPtr(params->pMemoryRanges), params->memoryRangeCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkInvalidateMappedMemoryRanges(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkLatencySleepNV(void *args) -{ - struct vkLatencySleepNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkLatencySleepNV(wine_device_from_handle(params->device)->host_device, params->swapchain, params->pSleepInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkLatencySleepNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSleepInfo; - VkResult result; - } *params = args; - VkLatencySleepInfoNV pSleepInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo); - - convert_VkLatencySleepInfoNV_win32_to_host((const VkLatencySleepInfoNV32 *)UlongToPtr(params->pSleepInfo), &pSleepInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkLatencySleepNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, &pSleepInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMapMemory(void *args) -{ - struct vkMapMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s, %#x, %p\n", params->device, wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->offset), wine_dbgstr_longlong(params->size), params->flags, params->ppData); - - params->result = wine_vkMapMemory(params->device, params->memory, params->offset, params->size, params->flags, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMapMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryMapFlags flags; - PTR32 ppData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->offset), wine_dbgstr_longlong(params->size), params->flags, params->ppData); - - params->result = wine_vkMapMemory((VkDevice)UlongToPtr(params->device), params->memory, params->offset, params->size, params->flags, (void **)UlongToPtr(params->ppData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMapMemory2KHR(void *args) -{ - struct vkMapMemory2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pMemoryMapInfo, params->ppData); - - params->result = wine_vkMapMemory2KHR(params->device, params->pMemoryMapInfo, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMapMemory2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryMapInfo; - PTR32 ppData; - VkResult result; - } *params = args; - VkMemoryMapInfoKHR pMemoryMapInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pMemoryMapInfo, params->ppData); - - convert_VkMemoryMapInfoKHR_win32_to_unwrapped_host((const VkMemoryMapInfoKHR32 *)UlongToPtr(params->pMemoryMapInfo), &pMemoryMapInfo_host); - params->result = wine_vkMapMemory2KHR((VkDevice)UlongToPtr(params->device), &pMemoryMapInfo_host, (void **)UlongToPtr(params->ppData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMergePipelineCaches(void *args) -{ - struct vkMergePipelineCaches_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkMergePipelineCaches(wine_device_from_handle(params->device)->host_device, params->dstCache, params->srcCacheCount, params->pSrcCaches); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMergePipelineCaches(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - PTR32 pSrcCaches; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkMergePipelineCaches(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->dstCache, params->srcCacheCount, (const VkPipelineCache *)UlongToPtr(params->pSrcCaches)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMergeValidationCachesEXT(void *args) -{ - struct vkMergeValidationCachesEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkMergeValidationCachesEXT(wine_device_from_handle(params->device)->host_device, params->dstCache, params->srcCacheCount, params->pSrcCaches); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMergeValidationCachesEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - PTR32 pSrcCaches; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkMergeValidationCachesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->dstCache, params->srcCacheCount, (const VkValidationCacheEXT *)UlongToPtr(params->pSrcCaches)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueBeginDebugUtilsLabelEXT(void *args) -{ - struct vkQueueBeginDebugUtilsLabelEXT_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pLabelInfo); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueBeginDebugUtilsLabelEXT(wine_queue_from_handle(params->queue)->host_queue, params->pLabelInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueBeginDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pLabelInfo); - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueBeginDebugUtilsLabelEXT(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, &pLabelInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueBindSparse(void *args) -{ - struct vkQueueBindSparse_params *params = args; - const VkBindSparseInfo *pBindInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->bindInfoCount, params->pBindInfo, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pBindInfo_host = convert_VkBindSparseInfo_array_win64_to_host(ctx, params->pBindInfo, params->bindInfoCount); - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueBindSparse(wine_queue_from_handle(params->queue)->host_queue, params->bindInfoCount, pBindInfo_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueBindSparse(void *args) -{ - struct - { - PTR32 queue; - uint32_t bindInfoCount; - PTR32 pBindInfo; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkBindSparseInfo *pBindInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->bindInfoCount, params->pBindInfo, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pBindInfo_host = convert_VkBindSparseInfo_array_win32_to_host(ctx, (const VkBindSparseInfo32 *)UlongToPtr(params->pBindInfo), params->bindInfoCount); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueBindSparse(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, params->bindInfoCount, pBindInfo_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueEndDebugUtilsLabelEXT(void *args) -{ - struct vkQueueEndDebugUtilsLabelEXT_params *params = args; - - TRACE("%p\n", params->queue); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueEndDebugUtilsLabelEXT(wine_queue_from_handle(params->queue)->host_queue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueEndDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - } *params = args; - - TRACE("%#x\n", params->queue); - - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueEndDebugUtilsLabelEXT(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueInsertDebugUtilsLabelEXT(void *args) -{ - struct vkQueueInsertDebugUtilsLabelEXT_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pLabelInfo); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueInsertDebugUtilsLabelEXT(wine_queue_from_handle(params->queue)->host_queue, params->pLabelInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueInsertDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pLabelInfo); - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueInsertDebugUtilsLabelEXT(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, &pLabelInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueNotifyOutOfBandNV(void *args) -{ - struct vkQueueNotifyOutOfBandNV_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pQueueTypeInfo); - - wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueNotifyOutOfBandNV(wine_queue_from_handle(params->queue)->host_queue, params->pQueueTypeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueNotifyOutOfBandNV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pQueueTypeInfo; - } *params = args; - VkOutOfBandQueueTypeInfoNV pQueueTypeInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pQueueTypeInfo); - - convert_VkOutOfBandQueueTypeInfoNV_win32_to_host((const VkOutOfBandQueueTypeInfoNV32 *)UlongToPtr(params->pQueueTypeInfo), &pQueueTypeInfo_host); - wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueNotifyOutOfBandNV(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, &pQueueTypeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueuePresentKHR(void *args) -{ - struct vkQueuePresentKHR_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pPresentInfo); - - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueuePresentKHR(wine_queue_from_handle(params->queue)->host_queue, params->pPresentInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueuePresentKHR(void *args) -{ - struct - { - PTR32 queue; - PTR32 pPresentInfo; - VkResult result; - } *params = args; - VkPresentInfoKHR pPresentInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->queue, params->pPresentInfo); - - init_conversion_context(ctx); - convert_VkPresentInfoKHR_win32_to_host(ctx, (const VkPresentInfoKHR32 *)UlongToPtr(params->pPresentInfo), &pPresentInfo_host); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueuePresentKHR(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, &pPresentInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSetPerformanceConfigurationINTEL(void *args) -{ - struct vkQueueSetPerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, 0x%s\n", params->queue, wine_dbgstr_longlong(params->configuration)); - - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueSetPerformanceConfigurationINTEL(wine_queue_from_handle(params->queue)->host_queue, params->configuration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSetPerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 queue; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->queue, wine_dbgstr_longlong(params->configuration)); - - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueSetPerformanceConfigurationINTEL(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, params->configuration); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit(void *args) -{ - struct vkQueueSubmit_params *params = args; - const VkSubmitInfo *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueSubmit(wine_queue_from_handle(params->queue)->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo_array_win32_to_host(ctx, (const VkSubmitInfo32 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueSubmit(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit2(void *args) -{ - struct vkQueueSubmit2_params *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueSubmit2(wine_queue_from_handle(params->queue)->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit2(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win32_to_host(ctx, (const VkSubmitInfo232 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueSubmit2(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit2KHR(void *args) -{ - struct vkQueueSubmit2KHR_params *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueSubmit2KHR(wine_queue_from_handle(params->queue)->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit2KHR(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win32_to_host(ctx, (const VkSubmitInfo232 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueSubmit2KHR(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueWaitIdle(void *args) -{ - struct vkQueueWaitIdle_params *params = args; - - TRACE("%p\n", params->queue); - - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueWaitIdle(wine_queue_from_handle(params->queue)->host_queue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueWaitIdle(void *args) -{ - struct - { - PTR32 queue; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->queue); - - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueueWaitIdle(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleasePerformanceConfigurationINTEL(void *args) -{ - struct vkReleasePerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->configuration)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkReleasePerformanceConfigurationINTEL(wine_device_from_handle(params->device)->host_device, params->configuration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleasePerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 device; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->configuration)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkReleasePerformanceConfigurationINTEL(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->configuration); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleaseProfilingLockKHR(void *args) -{ - struct vkReleaseProfilingLockKHR_params *params = args; - - TRACE("%p\n", params->device); - - wine_device_from_handle(params->device)->funcs.p_vkReleaseProfilingLockKHR(wine_device_from_handle(params->device)->host_device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleaseProfilingLockKHR(void *args) -{ - struct - { - PTR32 device; - } *params = args; - - TRACE("%#x\n", params->device); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkReleaseProfilingLockKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleaseSwapchainImagesEXT(void *args) -{ - struct vkReleaseSwapchainImagesEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pReleaseInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkReleaseSwapchainImagesEXT(wine_device_from_handle(params->device)->host_device, params->pReleaseInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleaseSwapchainImagesEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pReleaseInfo; - VkResult result; - } *params = args; - VkReleaseSwapchainImagesInfoEXT pReleaseInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pReleaseInfo); - - convert_VkReleaseSwapchainImagesInfoEXT_win32_to_host((const VkReleaseSwapchainImagesInfoEXT32 *)UlongToPtr(params->pReleaseInfo), &pReleaseInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkReleaseSwapchainImagesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pReleaseInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetCommandBuffer(void *args) -{ - struct vkResetCommandBuffer_params *params = args; - - TRACE("%p, %#x\n", params->commandBuffer, params->flags); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->funcs.p_vkResetCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host_command_buffer, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCommandBufferResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, %#x\n", params->commandBuffer, params->flags); - - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->funcs.p_vkResetCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host_command_buffer, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetCommandPool(void *args) -{ - struct vkResetCommandPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkResetCommandPool(wine_device_from_handle(params->device)->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetCommandPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetDescriptorPool(void *args) -{ - struct vkResetDescriptorPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->flags); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkResetDescriptorPool(wine_device_from_handle(params->device)->host_device, params->descriptorPool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetDescriptorPool(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - VkDescriptorPoolResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->flags); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetDescriptorPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorPool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetEvent(void *args) -{ - struct vkResetEvent_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkResetEvent(wine_device_from_handle(params->device)->host_device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetEvent(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetFences(void *args) -{ - struct vkResetFences_params *params = args; - - TRACE("%p, %u, %p\n", params->device, params->fenceCount, params->pFences); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkResetFences(wine_device_from_handle(params->device)->host_device, params->fenceCount, params->pFences); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetFences(void *args) -{ - struct - { - PTR32 device; - uint32_t fenceCount; - PTR32 pFences; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x\n", params->device, params->fenceCount, params->pFences); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetFences(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->fenceCount, (const VkFence *)UlongToPtr(params->pFences)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetQueryPool(void *args) -{ - struct vkResetQueryPool_params *params = args; - - TRACE("%p, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - wine_device_from_handle(params->device)->funcs.p_vkResetQueryPool(wine_device_from_handle(params->device)->host_device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetQueryPool(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetQueryPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetQueryPoolEXT(void *args) -{ - struct vkResetQueryPoolEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - wine_device_from_handle(params->device)->funcs.p_vkResetQueryPoolEXT(wine_device_from_handle(params->device)->host_device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetQueryPoolEXT(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkResetQueryPoolEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDebugUtilsObjectNameEXT(void *args) -{ - struct vkSetDebugUtilsObjectNameEXT_params *params = args; - VkDebugUtilsObjectNameInfoEXT pNameInfo_host; - - TRACE("%p, %p\n", params->device, params->pNameInfo); - - convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(params->pNameInfo, &pNameInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetDebugUtilsObjectNameEXT(wine_device_from_handle(params->device)->host_device, &pNameInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDebugUtilsObjectNameEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pNameInfo; - VkResult result; - } *params = args; - VkDebugUtilsObjectNameInfoEXT pNameInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pNameInfo); - - convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host((const VkDebugUtilsObjectNameInfoEXT32 *)UlongToPtr(params->pNameInfo), &pNameInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetDebugUtilsObjectNameEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pNameInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDebugUtilsObjectTagEXT(void *args) -{ - struct vkSetDebugUtilsObjectTagEXT_params *params = args; - VkDebugUtilsObjectTagInfoEXT pTagInfo_host; - - TRACE("%p, %p\n", params->device, params->pTagInfo); - - convert_VkDebugUtilsObjectTagInfoEXT_win64_to_host(params->pTagInfo, &pTagInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetDebugUtilsObjectTagEXT(wine_device_from_handle(params->device)->host_device, &pTagInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDebugUtilsObjectTagEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pTagInfo; - VkResult result; - } *params = args; - VkDebugUtilsObjectTagInfoEXT pTagInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pTagInfo); - - convert_VkDebugUtilsObjectTagInfoEXT_win32_to_host((const VkDebugUtilsObjectTagInfoEXT32 *)UlongToPtr(params->pTagInfo), &pTagInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetDebugUtilsObjectTagEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pTagInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDeviceMemoryPriorityEXT(void *args) -{ - struct vkSetDeviceMemoryPriorityEXT_params *params = args; - - TRACE("%p, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority); - - wine_device_from_handle(params->device)->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle(params->device)->host_device, wine_device_memory_from_handle(params->memory)->host_memory, params->priority); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDeviceMemoryPriorityEXT(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - float priority; - } *params = args; - - TRACE("%#x, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_device_memory_from_handle(params->memory)->host_memory, params->priority); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetEvent(void *args) -{ - struct vkSetEvent_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetEvent(wine_device_from_handle(params->device)->host_device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetEvent(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetHdrMetadataEXT(void *args) -{ - struct vkSetHdrMetadataEXT_params *params = args; - - TRACE("%p, %u, %p, %p\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata); - - wine_device_from_handle(params->device)->funcs.p_vkSetHdrMetadataEXT(wine_device_from_handle(params->device)->host_device, params->swapchainCount, params->pSwapchains, params->pMetadata); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetHdrMetadataEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t swapchainCount; - PTR32 pSwapchains; - PTR32 pMetadata; - } *params = args; - const VkHdrMetadataEXT *pMetadata_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata); - - init_conversion_context(ctx); - pMetadata_host = convert_VkHdrMetadataEXT_array_win32_to_host(ctx, (const VkHdrMetadataEXT32 *)UlongToPtr(params->pMetadata), params->swapchainCount); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetHdrMetadataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchainCount, (const VkSwapchainKHR *)UlongToPtr(params->pSwapchains), pMetadata_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetLatencyMarkerNV(void *args) -{ - struct vkSetLatencyMarkerNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - wine_device_from_handle(params->device)->funcs.p_vkSetLatencyMarkerNV(wine_device_from_handle(params->device)->host_device, params->swapchain, params->pLatencyMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetLatencyMarkerNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pLatencyMarkerInfo; - } *params = args; - VkSetLatencyMarkerInfoNV pLatencyMarkerInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - convert_VkSetLatencyMarkerInfoNV_win32_to_host((const VkSetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetLatencyMarkerNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, &pLatencyMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetLatencySleepModeNV(void *args) -{ - struct vkSetLatencySleepModeNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetLatencySleepModeNV(wine_device_from_handle(params->device)->host_device, params->swapchain, params->pSleepModeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetLatencySleepModeNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSleepModeInfo; - VkResult result; - } *params = args; - VkLatencySleepModeInfoNV pSleepModeInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo); - - convert_VkLatencySleepModeInfoNV_win32_to_host((const VkLatencySleepModeInfoNV32 *)UlongToPtr(params->pSleepModeInfo), &pSleepModeInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetLatencySleepModeNV(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, &pSleepModeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetPrivateData(void *args) -{ - struct vkSetPrivateData_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetPrivateData(wine_device_from_handle(params->device)->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetPrivateData(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetPrivateData(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetPrivateDataEXT(void *args) -{ - struct vkSetPrivateDataEXT_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSetPrivateDataEXT(wine_device_from_handle(params->device)->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetPrivateDataEXT(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetPrivateDataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSignalSemaphore(void *args) -{ - struct vkSignalSemaphore_params *params = args; - - TRACE("%p, %p\n", params->device, params->pSignalInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSignalSemaphore(wine_device_from_handle(params->device)->host_device, params->pSignalInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSignalSemaphore(void *args) -{ - struct - { - PTR32 device; - PTR32 pSignalInfo; - VkResult result; - } *params = args; - VkSemaphoreSignalInfo pSignalInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pSignalInfo); - - convert_VkSemaphoreSignalInfo_win32_to_host((const VkSemaphoreSignalInfo32 *)UlongToPtr(params->pSignalInfo), &pSignalInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSignalSemaphore(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pSignalInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSignalSemaphoreKHR(void *args) -{ - struct vkSignalSemaphoreKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pSignalInfo); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkSignalSemaphoreKHR(wine_device_from_handle(params->device)->host_device, params->pSignalInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSignalSemaphoreKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pSignalInfo; - VkResult result; - } *params = args; - VkSemaphoreSignalInfo pSignalInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pSignalInfo); - - convert_VkSemaphoreSignalInfo_win32_to_host((const VkSemaphoreSignalInfo32 *)UlongToPtr(params->pSignalInfo), &pSignalInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSignalSemaphoreKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pSignalInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSubmitDebugUtilsMessageEXT(void *args) -{ - struct vkSubmitDebugUtilsMessageEXT_params *params = args; - VkDebugUtilsMessengerCallbackDataEXT pCallbackData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %#x, %#x, %p\n", params->instance, params->messageSeverity, params->messageTypes, params->pCallbackData); - - init_conversion_context(ctx); - convert_VkDebugUtilsMessengerCallbackDataEXT_win64_to_host(ctx, params->pCallbackData, &pCallbackData_host); - wine_instance_from_handle(params->instance)->funcs.p_vkSubmitDebugUtilsMessageEXT(wine_instance_from_handle(params->instance)->host_instance, params->messageSeverity, params->messageTypes, &pCallbackData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSubmitDebugUtilsMessageEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageTypes; - PTR32 pCallbackData; - } *params = args; - VkDebugUtilsMessengerCallbackDataEXT pCallbackData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->messageSeverity, params->messageTypes, params->pCallbackData); - - init_conversion_context(ctx); - convert_VkDebugUtilsMessengerCallbackDataEXT_win32_to_host(ctx, (const VkDebugUtilsMessengerCallbackDataEXT32 *)UlongToPtr(params->pCallbackData), &pCallbackData_host); - wine_instance_from_handle((VkInstance)UlongToPtr(params->instance))->funcs.p_vkSubmitDebugUtilsMessageEXT(wine_instance_from_handle((VkInstance)UlongToPtr(params->instance))->host_instance, params->messageSeverity, params->messageTypes, &pCallbackData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTransitionImageLayoutEXT(void *args) -{ - struct vkTransitionImageLayoutEXT_params *params = args; - - TRACE("%p, %u, %p\n", params->device, params->transitionCount, params->pTransitions); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkTransitionImageLayoutEXT(wine_device_from_handle(params->device)->host_device, params->transitionCount, params->pTransitions); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTransitionImageLayoutEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t transitionCount; - PTR32 pTransitions; - VkResult result; - } *params = args; - const VkHostImageLayoutTransitionInfoEXT *pTransitions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->transitionCount, params->pTransitions); - - init_conversion_context(ctx); - pTransitions_host = convert_VkHostImageLayoutTransitionInfoEXT_array_win32_to_host(ctx, (const VkHostImageLayoutTransitionInfoEXT32 *)UlongToPtr(params->pTransitions), params->transitionCount); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkTransitionImageLayoutEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->transitionCount, pTransitions_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTrimCommandPool(void *args) -{ - struct vkTrimCommandPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - wine_device_from_handle(params->device)->funcs.p_vkTrimCommandPool(wine_device_from_handle(params->device)->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTrimCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkTrimCommandPool(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTrimCommandPoolKHR(void *args) -{ - struct vkTrimCommandPoolKHR_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - wine_device_from_handle(params->device)->funcs.p_vkTrimCommandPoolKHR(wine_device_from_handle(params->device)->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTrimCommandPoolKHR(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkTrimCommandPoolKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_cmd_pool_from_handle(params->commandPool)->host_command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUninitializePerformanceApiINTEL(void *args) -{ - struct vkUninitializePerformanceApiINTEL_params *params = args; - - TRACE("%p\n", params->device); - - wine_device_from_handle(params->device)->funcs.p_vkUninitializePerformanceApiINTEL(wine_device_from_handle(params->device)->host_device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUninitializePerformanceApiINTEL(void *args) -{ - struct - { - PTR32 device; - } *params = args; - - TRACE("%#x\n", params->device); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkUninitializePerformanceApiINTEL(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUnmapMemory(void *args) -{ - struct vkUnmapMemory_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory)); - - wine_vkUnmapMemory(params->device, params->memory); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUnmapMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory)); - - wine_vkUnmapMemory((VkDevice)UlongToPtr(params->device), params->memory); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUnmapMemory2KHR(void *args) -{ - struct vkUnmapMemory2KHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pMemoryUnmapInfo); - - params->result = wine_vkUnmapMemory2KHR(params->device, params->pMemoryUnmapInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUnmapMemory2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryUnmapInfo; - VkResult result; - } *params = args; - VkMemoryUnmapInfoKHR pMemoryUnmapInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pMemoryUnmapInfo); - - convert_VkMemoryUnmapInfoKHR_win32_to_unwrapped_host((const VkMemoryUnmapInfoKHR32 *)UlongToPtr(params->pMemoryUnmapInfo), &pMemoryUnmapInfo_host); - params->result = wine_vkUnmapMemory2KHR((VkDevice)UlongToPtr(params->device), &pMemoryUnmapInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkUpdateDescriptorSetWithTemplate(void *args) -{ - struct vkUpdateDescriptorSetWithTemplate_params *params = args; - - wine_device_from_handle(params->device)->funcs.p_vkUpdateDescriptorSetWithTemplate(wine_device_from_handle(params->device)->host_device, params->descriptorSet, params->descriptorUpdateTemplate, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkUpdateDescriptorSetWithTemplate(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pData; - } *params = args; - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkUpdateDescriptorSetWithTemplate(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorSet, params->descriptorUpdateTemplate, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUpdateDescriptorSetWithTemplateKHR(void *args) -{ - struct vkUpdateDescriptorSetWithTemplateKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSet), wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pData); - - wine_device_from_handle(params->device)->funcs.p_vkUpdateDescriptorSetWithTemplateKHR(wine_device_from_handle(params->device)->host_device, params->descriptorSet, params->descriptorUpdateTemplate, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUpdateDescriptorSetWithTemplateKHR(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pData; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSet), wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pData); - - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkUpdateDescriptorSetWithTemplateKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorSet, params->descriptorUpdateTemplate, (const void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkUpdateDescriptorSets(void *args) -{ - struct vkUpdateDescriptorSets_params *params = args; - - wine_device_from_handle(params->device)->funcs.p_vkUpdateDescriptorSets(wine_device_from_handle(params->device)->host_device, params->descriptorWriteCount, params->pDescriptorWrites, params->descriptorCopyCount, params->pDescriptorCopies); -} -#endif /* _WIN64 */ - -static void thunk32_vkUpdateDescriptorSets(void *args) -{ - struct - { - PTR32 device; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; - uint32_t descriptorCopyCount; - PTR32 pDescriptorCopies; - } *params = args; - const VkWriteDescriptorSet *pDescriptorWrites_host; - const VkCopyDescriptorSet *pDescriptorCopies_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(params->pDescriptorWrites), params->descriptorWriteCount); - pDescriptorCopies_host = convert_VkCopyDescriptorSet_array_win32_to_host(ctx, (const VkCopyDescriptorSet32 *)UlongToPtr(params->pDescriptorCopies), params->descriptorCopyCount); - wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkUpdateDescriptorSets(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->descriptorWriteCount, pDescriptorWrites_host, params->descriptorCopyCount, pDescriptorCopies_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitForFences(void *args) -{ - struct vkWaitForFences_params *params = args; - - TRACE("%p, %u, %p, %u, 0x%s\n", params->device, params->fenceCount, params->pFences, params->waitAll, wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWaitForFences(wine_device_from_handle(params->device)->host_device, params->fenceCount, params->pFences, params->waitAll, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitForFences(void *args) -{ - struct - { - PTR32 device; - uint32_t fenceCount; - PTR32 pFences; - VkBool32 waitAll; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %u, 0x%s\n", params->device, params->fenceCount, params->pFences, params->waitAll, wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWaitForFences(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->fenceCount, (const VkFence *)UlongToPtr(params->pFences), params->waitAll, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitForPresentKHR(void *args) -{ - struct vkWaitForPresentKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWaitForPresentKHR(wine_device_from_handle(params->device)->host_device, params->swapchain, params->presentId, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitForPresentKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) presentId; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWaitForPresentKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->swapchain, params->presentId, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitSemaphores(void *args) -{ - struct vkWaitSemaphores_params *params = args; - - TRACE("%p, %p, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWaitSemaphores(wine_device_from_handle(params->device)->host_device, params->pWaitInfo, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitSemaphores(void *args) -{ - struct - { - PTR32 device; - PTR32 pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - VkSemaphoreWaitInfo pWaitInfo_host; - - TRACE("%#x, %#x, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - convert_VkSemaphoreWaitInfo_win32_to_host((const VkSemaphoreWaitInfo32 *)UlongToPtr(params->pWaitInfo), &pWaitInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWaitSemaphores(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pWaitInfo_host, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitSemaphoresKHR(void *args) -{ - struct vkWaitSemaphoresKHR_params *params = args; - - TRACE("%p, %p, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWaitSemaphoresKHR(wine_device_from_handle(params->device)->host_device, params->pWaitInfo, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitSemaphoresKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - VkSemaphoreWaitInfo pWaitInfo_host; - - TRACE("%#x, %#x, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - convert_VkSemaphoreWaitInfo_win32_to_host((const VkSemaphoreWaitInfo32 *)UlongToPtr(params->pWaitInfo), &pWaitInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWaitSemaphoresKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pWaitInfo_host, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct vkWriteAccelerationStructuresPropertiesKHR_params *params = args; - - TRACE("%p, %u, %p, %#x, 0x%s, %p, 0x%s\n", params->device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWriteAccelerationStructuresPropertiesKHR(wine_device_from_handle(params->device)->host_device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->dataSize, params->pData, params->stride); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct - { - PTR32 device; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - PTR32 dataSize; - PTR32 pData; - PTR32 stride; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %#x, 0x%s, %#x, 0x%s\n", params->device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWriteAccelerationStructuresPropertiesKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->accelerationStructureCount, (const VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->dataSize, (void *)UlongToPtr(params->pData), params->stride); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWriteMicromapsPropertiesEXT(void *args) -{ - struct vkWriteMicromapsPropertiesEXT_params *params = args; - - TRACE("%p, %u, %p, %#x, 0x%s, %p, 0x%s\n", params->device, params->micromapCount, params->pMicromaps, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = wine_device_from_handle(params->device)->funcs.p_vkWriteMicromapsPropertiesEXT(wine_device_from_handle(params->device)->host_device, params->micromapCount, params->pMicromaps, params->queryType, params->dataSize, params->pData, params->stride); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWriteMicromapsPropertiesEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t micromapCount; - PTR32 pMicromaps; - VkQueryType queryType; - PTR32 dataSize; - PTR32 pData; - PTR32 stride; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %#x, 0x%s, %#x, 0x%s\n", params->device, params->micromapCount, params->pMicromaps, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkWriteMicromapsPropertiesEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, params->micromapCount, (const VkMicromapEXT *)UlongToPtr(params->pMicromaps), params->queryType, params->dataSize, (void *)UlongToPtr(params->pData), params->stride); - return STATUS_SUCCESS; -} - -static const char * const vk_device_extensions[] = -{ - "VK_AMD_buffer_marker", - "VK_AMD_device_coherent_memory", - "VK_AMD_draw_indirect_count", - "VK_AMD_gcn_shader", - "VK_AMD_gpu_shader_half_float", - "VK_AMD_gpu_shader_int16", - "VK_AMD_memory_overallocation_behavior", - "VK_AMD_mixed_attachment_samples", - "VK_AMD_negative_viewport_height", - "VK_AMD_pipeline_compiler_control", - "VK_AMD_rasterization_order", - "VK_AMD_shader_ballot", - "VK_AMD_shader_core_properties", - "VK_AMD_shader_core_properties2", - "VK_AMD_shader_early_and_late_fragment_tests", - "VK_AMD_shader_explicit_vertex_parameter", - "VK_AMD_shader_fragment_mask", - "VK_AMD_shader_image_load_store_lod", - "VK_AMD_shader_info", - "VK_AMD_shader_trinary_minmax", - "VK_AMD_texture_gather_bias_lod", - "VK_ARM_rasterization_order_attachment_access", - "VK_ARM_scheduling_controls", - "VK_ARM_shader_core_builtins", - "VK_ARM_shader_core_properties", - "VK_EXT_4444_formats", - "VK_EXT_astc_decode_mode", - "VK_EXT_attachment_feedback_loop_dynamic_state", - "VK_EXT_attachment_feedback_loop_layout", - "VK_EXT_blend_operation_advanced", - "VK_EXT_border_color_swizzle", - "VK_EXT_buffer_device_address", - "VK_EXT_calibrated_timestamps", - "VK_EXT_color_write_enable", - "VK_EXT_conditional_rendering", - "VK_EXT_conservative_rasterization", - "VK_EXT_custom_border_color", - "VK_EXT_debug_marker", - "VK_EXT_depth_bias_control", - "VK_EXT_depth_clamp_zero_one", - "VK_EXT_depth_clip_control", - "VK_EXT_depth_clip_enable", - "VK_EXT_depth_range_unrestricted", - "VK_EXT_descriptor_buffer", - "VK_EXT_descriptor_indexing", - "VK_EXT_device_address_binding_report", - "VK_EXT_device_fault", - "VK_EXT_discard_rectangles", - "VK_EXT_dynamic_rendering_unused_attachments", - "VK_EXT_extended_dynamic_state", - "VK_EXT_extended_dynamic_state2", - "VK_EXT_extended_dynamic_state3", - "VK_EXT_external_memory_acquire_unmodified", - "VK_EXT_external_memory_host", - "VK_EXT_filter_cubic", - "VK_EXT_fragment_density_map", - "VK_EXT_fragment_density_map2", - "VK_EXT_fragment_shader_interlock", - "VK_EXT_frame_boundary", - "VK_EXT_global_priority", - "VK_EXT_global_priority_query", - "VK_EXT_graphics_pipeline_library", - "VK_EXT_hdr_metadata", - "VK_EXT_host_image_copy", - "VK_EXT_host_query_reset", - "VK_EXT_image_2d_view_of_3d", - "VK_EXT_image_compression_control", - "VK_EXT_image_compression_control_swapchain", - "VK_EXT_image_robustness", - "VK_EXT_image_sliced_view_of_3d", - "VK_EXT_image_view_min_lod", - "VK_EXT_index_type_uint8", - "VK_EXT_inline_uniform_block", - "VK_EXT_legacy_dithering", - "VK_EXT_line_rasterization", - "VK_EXT_load_store_op_none", - "VK_EXT_memory_budget", - "VK_EXT_memory_priority", - "VK_EXT_mesh_shader", - "VK_EXT_multi_draw", - "VK_EXT_multisampled_render_to_single_sampled", - "VK_EXT_mutable_descriptor_type", - "VK_EXT_nested_command_buffer", - "VK_EXT_non_seamless_cube_map", - "VK_EXT_opacity_micromap", - "VK_EXT_pageable_device_local_memory", - "VK_EXT_pci_bus_info", - "VK_EXT_pipeline_creation_cache_control", - "VK_EXT_pipeline_creation_feedback", - "VK_EXT_pipeline_library_group_handles", - "VK_EXT_pipeline_properties", - "VK_EXT_pipeline_protected_access", - "VK_EXT_pipeline_robustness", - "VK_EXT_post_depth_coverage", - "VK_EXT_primitive_topology_list_restart", - "VK_EXT_primitives_generated_query", - "VK_EXT_private_data", - "VK_EXT_provoking_vertex", - "VK_EXT_queue_family_foreign", - "VK_EXT_rasterization_order_attachment_access", - "VK_EXT_rgba10x6_formats", - "VK_EXT_robustness2", - "VK_EXT_sample_locations", - "VK_EXT_sampler_filter_minmax", - "VK_EXT_scalar_block_layout", - "VK_EXT_separate_stencil_usage", - "VK_EXT_shader_atomic_float", - "VK_EXT_shader_atomic_float2", - "VK_EXT_shader_demote_to_helper_invocation", - "VK_EXT_shader_image_atomic_int64", - "VK_EXT_shader_module_identifier", - "VK_EXT_shader_object", - "VK_EXT_shader_stencil_export", - "VK_EXT_shader_subgroup_ballot", - "VK_EXT_shader_subgroup_vote", - "VK_EXT_shader_tile_image", - "VK_EXT_shader_viewport_index_layer", - "VK_EXT_subgroup_size_control", - "VK_EXT_subpass_merge_feedback", - "VK_EXT_swapchain_maintenance1", - "VK_EXT_texel_buffer_alignment", - "VK_EXT_texture_compression_astc_hdr", - "VK_EXT_tooling_info", - "VK_EXT_transform_feedback", - "VK_EXT_validation_cache", - "VK_EXT_vertex_attribute_divisor", - "VK_EXT_vertex_input_dynamic_state", - "VK_EXT_ycbcr_2plane_444_formats", - "VK_EXT_ycbcr_image_arrays", - "VK_GOOGLE_decorate_string", - "VK_GOOGLE_hlsl_functionality1", - "VK_GOOGLE_user_type", - "VK_HUAWEI_cluster_culling_shader", - "VK_HUAWEI_invocation_mask", - "VK_HUAWEI_subpass_shading", - "VK_IMG_filter_cubic", - "VK_IMG_format_pvrtc", - "VK_IMG_relaxed_line_rasterization", - "VK_INTEL_performance_query", - "VK_INTEL_shader_integer_functions2", - "VK_KHR_16bit_storage", - "VK_KHR_8bit_storage", - "VK_KHR_acceleration_structure", - "VK_KHR_bind_memory2", - "VK_KHR_buffer_device_address", - "VK_KHR_cooperative_matrix", - "VK_KHR_copy_commands2", - "VK_KHR_create_renderpass2", - "VK_KHR_dedicated_allocation", - "VK_KHR_deferred_host_operations", - "VK_KHR_depth_stencil_resolve", - "VK_KHR_descriptor_update_template", - "VK_KHR_device_group", - "VK_KHR_draw_indirect_count", - "VK_KHR_driver_properties", - "VK_KHR_dynamic_rendering", - "VK_KHR_external_fence", - "VK_KHR_external_memory", - "VK_KHR_external_semaphore", - "VK_KHR_format_feature_flags2", - "VK_KHR_fragment_shader_barycentric", - "VK_KHR_fragment_shading_rate", - "VK_KHR_get_memory_requirements2", - "VK_KHR_global_priority", - "VK_KHR_image_format_list", - "VK_KHR_imageless_framebuffer", - "VK_KHR_incremental_present", - "VK_KHR_maintenance1", - "VK_KHR_maintenance2", - "VK_KHR_maintenance3", - "VK_KHR_maintenance4", - "VK_KHR_maintenance5", - "VK_KHR_map_memory2", - "VK_KHR_multiview", - "VK_KHR_performance_query", - "VK_KHR_pipeline_executable_properties", - "VK_KHR_pipeline_library", - "VK_KHR_present_id", - "VK_KHR_present_wait", - "VK_KHR_push_descriptor", - "VK_KHR_ray_query", - "VK_KHR_ray_tracing_maintenance1", - "VK_KHR_ray_tracing_pipeline", - "VK_KHR_ray_tracing_position_fetch", - "VK_KHR_relaxed_block_layout", - "VK_KHR_sampler_mirror_clamp_to_edge", - "VK_KHR_sampler_ycbcr_conversion", - "VK_KHR_separate_depth_stencil_layouts", - "VK_KHR_shader_atomic_int64", - "VK_KHR_shader_clock", - "VK_KHR_shader_draw_parameters", - "VK_KHR_shader_float16_int8", - "VK_KHR_shader_float_controls", - "VK_KHR_shader_integer_dot_product", - "VK_KHR_shader_non_semantic_info", - "VK_KHR_shader_subgroup_extended_types", - "VK_KHR_shader_subgroup_uniform_control_flow", - "VK_KHR_shader_terminate_invocation", - "VK_KHR_spirv_1_4", - "VK_KHR_storage_buffer_storage_class", - "VK_KHR_swapchain", - "VK_KHR_swapchain_mutable_format", - "VK_KHR_synchronization2", - "VK_KHR_timeline_semaphore", - "VK_KHR_uniform_buffer_standard_layout", - "VK_KHR_variable_pointers", - "VK_KHR_vulkan_memory_model", - "VK_KHR_workgroup_memory_explicit_layout", - "VK_KHR_zero_initialize_workgroup_memory", - "VK_MSFT_layered_driver", - "VK_NVX_binary_import", - "VK_NVX_image_view_handle", - "VK_NV_clip_space_w_scaling", - "VK_NV_compute_shader_derivatives", - "VK_NV_cooperative_matrix", - "VK_NV_copy_memory_indirect", - "VK_NV_corner_sampled_image", - "VK_NV_coverage_reduction_mode", - "VK_NV_cuda_kernel_launch", - "VK_NV_dedicated_allocation", - "VK_NV_dedicated_allocation_image_aliasing", - "VK_NV_descriptor_pool_overallocation", - "VK_NV_device_diagnostic_checkpoints", - "VK_NV_device_diagnostics_config", - "VK_NV_device_generated_commands", - "VK_NV_device_generated_commands_compute", - "VK_NV_extended_sparse_address_space", - "VK_NV_fill_rectangle", - "VK_NV_fragment_coverage_to_color", - "VK_NV_fragment_shader_barycentric", - "VK_NV_fragment_shading_rate_enums", - "VK_NV_framebuffer_mixed_samples", - "VK_NV_geometry_shader_passthrough", - "VK_NV_glsl_shader", - "VK_NV_inherited_viewport_scissor", - "VK_NV_linear_color_attachment", - "VK_NV_low_latency", - "VK_NV_low_latency2", - "VK_NV_memory_decompression", - "VK_NV_mesh_shader", - "VK_NV_optical_flow", - "VK_NV_present_barrier", - "VK_NV_ray_tracing", - "VK_NV_ray_tracing_invocation_reorder", - "VK_NV_ray_tracing_motion_blur", - "VK_NV_representative_fragment_test", - "VK_NV_sample_mask_override_coverage", - "VK_NV_scissor_exclusive", - "VK_NV_shader_image_footprint", - "VK_NV_shader_sm_builtins", - "VK_NV_shader_subgroup_partitioned", - "VK_NV_shading_rate_image", - "VK_NV_viewport_array2", - "VK_NV_viewport_swizzle", - "VK_QCOM_filter_cubic_clamp", - "VK_QCOM_filter_cubic_weights", - "VK_QCOM_fragment_density_map_offset", - "VK_QCOM_image_processing", - "VK_QCOM_image_processing2", - "VK_QCOM_multiview_per_view_render_areas", - "VK_QCOM_multiview_per_view_viewports", - "VK_QCOM_render_pass_shader_resolve", - "VK_QCOM_render_pass_store_ops", - "VK_QCOM_render_pass_transform", - "VK_QCOM_rotated_copy_commands", - "VK_QCOM_tile_properties", - "VK_QCOM_ycbcr_degamma", - "VK_VALVE_descriptor_set_host_mapping", - "VK_VALVE_mutable_descriptor_type", -}; - -static const char * const vk_instance_extensions[] = -{ - "VK_EXT_debug_report", - "VK_EXT_debug_utils", - "VK_EXT_layer_settings", - "VK_EXT_surface_maintenance1", - "VK_EXT_swapchain_colorspace", - "VK_EXT_validation_features", - "VK_EXT_validation_flags", - "VK_KHR_device_group_creation", - "VK_KHR_external_fence_capabilities", - "VK_KHR_external_memory_capabilities", - "VK_KHR_external_semaphore_capabilities", - "VK_KHR_get_physical_device_properties2", - "VK_KHR_get_surface_capabilities2", - "VK_KHR_portability_enumeration", - "VK_KHR_surface", - "VK_KHR_win32_surface", -}; - -BOOL wine_vk_device_extension_supported(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_device_extensions); i++) - { - if (strcmp(vk_device_extensions[i], name) == 0) - return TRUE; - } - return FALSE; -} - -BOOL wine_vk_instance_extension_supported(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_instance_extensions); i++) - { - if (strcmp(vk_instance_extensions[i], name) == 0) - return TRUE; - } - return FALSE; -} - -BOOL wine_vk_is_type_wrapped(VkObjectType type) -{ - return FALSE || - type == VK_OBJECT_TYPE_COMMAND_BUFFER || - type == VK_OBJECT_TYPE_COMMAND_POOL || - type == VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT || - type == VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT || - type == VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR || - type == VK_OBJECT_TYPE_DEVICE || - type == VK_OBJECT_TYPE_DEVICE_MEMORY || - type == VK_OBJECT_TYPE_INSTANCE || - type == VK_OBJECT_TYPE_PHYSICAL_DEVICE || - type == VK_OBJECT_TYPE_QUEUE || - type == VK_OBJECT_TYPE_SURFACE_KHR; -} - -#ifdef _WIN64 - -const unixlib_entry_t __wine_unix_call_funcs[] = -{ - init_vulkan, - vk_is_available_instance_function, - vk_is_available_device_function, - thunk64_vkAcquireNextImage2KHR, - thunk64_vkAcquireNextImageKHR, - thunk64_vkAcquirePerformanceConfigurationINTEL, - thunk64_vkAcquireProfilingLockKHR, - thunk64_vkAllocateCommandBuffers, - thunk64_vkAllocateDescriptorSets, - thunk64_vkAllocateMemory, - thunk64_vkBeginCommandBuffer, - thunk64_vkBindAccelerationStructureMemoryNV, - thunk64_vkBindBufferMemory, - thunk64_vkBindBufferMemory2, - thunk64_vkBindBufferMemory2KHR, - thunk64_vkBindImageMemory, - thunk64_vkBindImageMemory2, - thunk64_vkBindImageMemory2KHR, - thunk64_vkBindOpticalFlowSessionImageNV, - thunk64_vkBuildAccelerationStructuresKHR, - thunk64_vkBuildMicromapsEXT, - (void *)thunk64_vkCmdBeginConditionalRenderingEXT, - (void *)thunk64_vkCmdBeginDebugUtilsLabelEXT, - (void *)thunk64_vkCmdBeginQuery, - (void *)thunk64_vkCmdBeginQueryIndexedEXT, - (void *)thunk64_vkCmdBeginRenderPass, - (void *)thunk64_vkCmdBeginRenderPass2, - (void *)thunk64_vkCmdBeginRenderPass2KHR, - (void *)thunk64_vkCmdBeginRendering, - (void *)thunk64_vkCmdBeginRenderingKHR, - (void *)thunk64_vkCmdBeginTransformFeedbackEXT, - (void *)thunk64_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - (void *)thunk64_vkCmdBindDescriptorBuffersEXT, - (void *)thunk64_vkCmdBindDescriptorSets, - (void *)thunk64_vkCmdBindIndexBuffer, - (void *)thunk64_vkCmdBindIndexBuffer2KHR, - (void *)thunk64_vkCmdBindInvocationMaskHUAWEI, - (void *)thunk64_vkCmdBindPipeline, - (void *)thunk64_vkCmdBindPipelineShaderGroupNV, - (void *)thunk64_vkCmdBindShadersEXT, - (void *)thunk64_vkCmdBindShadingRateImageNV, - (void *)thunk64_vkCmdBindTransformFeedbackBuffersEXT, - (void *)thunk64_vkCmdBindVertexBuffers, - (void *)thunk64_vkCmdBindVertexBuffers2, - (void *)thunk64_vkCmdBindVertexBuffers2EXT, - (void *)thunk64_vkCmdBlitImage, - (void *)thunk64_vkCmdBlitImage2, - (void *)thunk64_vkCmdBlitImage2KHR, - (void *)thunk64_vkCmdBuildAccelerationStructureNV, - (void *)thunk64_vkCmdBuildAccelerationStructuresIndirectKHR, - (void *)thunk64_vkCmdBuildAccelerationStructuresKHR, - (void *)thunk64_vkCmdBuildMicromapsEXT, - (void *)thunk64_vkCmdClearAttachments, - (void *)thunk64_vkCmdClearColorImage, - (void *)thunk64_vkCmdClearDepthStencilImage, - (void *)thunk64_vkCmdCopyAccelerationStructureKHR, - (void *)thunk64_vkCmdCopyAccelerationStructureNV, - (void *)thunk64_vkCmdCopyAccelerationStructureToMemoryKHR, - (void *)thunk64_vkCmdCopyBuffer, - (void *)thunk64_vkCmdCopyBuffer2, - (void *)thunk64_vkCmdCopyBuffer2KHR, - (void *)thunk64_vkCmdCopyBufferToImage, - (void *)thunk64_vkCmdCopyBufferToImage2, - (void *)thunk64_vkCmdCopyBufferToImage2KHR, - (void *)thunk64_vkCmdCopyImage, - (void *)thunk64_vkCmdCopyImage2, - (void *)thunk64_vkCmdCopyImage2KHR, - (void *)thunk64_vkCmdCopyImageToBuffer, - (void *)thunk64_vkCmdCopyImageToBuffer2, - (void *)thunk64_vkCmdCopyImageToBuffer2KHR, - (void *)thunk64_vkCmdCopyMemoryIndirectNV, - (void *)thunk64_vkCmdCopyMemoryToAccelerationStructureKHR, - (void *)thunk64_vkCmdCopyMemoryToImageIndirectNV, - (void *)thunk64_vkCmdCopyMemoryToMicromapEXT, - (void *)thunk64_vkCmdCopyMicromapEXT, - (void *)thunk64_vkCmdCopyMicromapToMemoryEXT, - (void *)thunk64_vkCmdCopyQueryPoolResults, - (void *)thunk64_vkCmdCuLaunchKernelNVX, - (void *)thunk64_vkCmdCudaLaunchKernelNV, - (void *)thunk64_vkCmdDebugMarkerBeginEXT, - (void *)thunk64_vkCmdDebugMarkerEndEXT, - (void *)thunk64_vkCmdDebugMarkerInsertEXT, - (void *)thunk64_vkCmdDecompressMemoryIndirectCountNV, - (void *)thunk64_vkCmdDecompressMemoryNV, - (void *)thunk64_vkCmdDispatch, - (void *)thunk64_vkCmdDispatchBase, - (void *)thunk64_vkCmdDispatchBaseKHR, - (void *)thunk64_vkCmdDispatchIndirect, - (void *)thunk64_vkCmdDraw, - (void *)thunk64_vkCmdDrawClusterHUAWEI, - (void *)thunk64_vkCmdDrawClusterIndirectHUAWEI, - (void *)thunk64_vkCmdDrawIndexed, - (void *)thunk64_vkCmdDrawIndexedIndirect, - (void *)thunk64_vkCmdDrawIndexedIndirectCount, - (void *)thunk64_vkCmdDrawIndexedIndirectCountAMD, - (void *)thunk64_vkCmdDrawIndexedIndirectCountKHR, - (void *)thunk64_vkCmdDrawIndirect, - (void *)thunk64_vkCmdDrawIndirectByteCountEXT, - (void *)thunk64_vkCmdDrawIndirectCount, - (void *)thunk64_vkCmdDrawIndirectCountAMD, - (void *)thunk64_vkCmdDrawIndirectCountKHR, - (void *)thunk64_vkCmdDrawMeshTasksEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectCountEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectCountNV, - (void *)thunk64_vkCmdDrawMeshTasksIndirectEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectNV, - (void *)thunk64_vkCmdDrawMeshTasksNV, - (void *)thunk64_vkCmdDrawMultiEXT, - (void *)thunk64_vkCmdDrawMultiIndexedEXT, - (void *)thunk64_vkCmdEndConditionalRenderingEXT, - (void *)thunk64_vkCmdEndDebugUtilsLabelEXT, - (void *)thunk64_vkCmdEndQuery, - (void *)thunk64_vkCmdEndQueryIndexedEXT, - (void *)thunk64_vkCmdEndRenderPass, - (void *)thunk64_vkCmdEndRenderPass2, - (void *)thunk64_vkCmdEndRenderPass2KHR, - (void *)thunk64_vkCmdEndRendering, - (void *)thunk64_vkCmdEndRenderingKHR, - (void *)thunk64_vkCmdEndTransformFeedbackEXT, - (void *)thunk64_vkCmdExecuteCommands, - (void *)thunk64_vkCmdExecuteGeneratedCommandsNV, - (void *)thunk64_vkCmdFillBuffer, - (void *)thunk64_vkCmdInsertDebugUtilsLabelEXT, - (void *)thunk64_vkCmdNextSubpass, - (void *)thunk64_vkCmdNextSubpass2, - (void *)thunk64_vkCmdNextSubpass2KHR, - (void *)thunk64_vkCmdOpticalFlowExecuteNV, - (void *)thunk64_vkCmdPipelineBarrier, - (void *)thunk64_vkCmdPipelineBarrier2, - (void *)thunk64_vkCmdPipelineBarrier2KHR, - (void *)thunk64_vkCmdPreprocessGeneratedCommandsNV, - (void *)thunk64_vkCmdPushConstants, - (void *)thunk64_vkCmdPushDescriptorSetKHR, - (void *)thunk64_vkCmdPushDescriptorSetWithTemplateKHR, - (void *)thunk64_vkCmdResetEvent, - (void *)thunk64_vkCmdResetEvent2, - (void *)thunk64_vkCmdResetEvent2KHR, - (void *)thunk64_vkCmdResetQueryPool, - (void *)thunk64_vkCmdResolveImage, - (void *)thunk64_vkCmdResolveImage2, - (void *)thunk64_vkCmdResolveImage2KHR, - (void *)thunk64_vkCmdSetAlphaToCoverageEnableEXT, - (void *)thunk64_vkCmdSetAlphaToOneEnableEXT, - (void *)thunk64_vkCmdSetAttachmentFeedbackLoopEnableEXT, - (void *)thunk64_vkCmdSetBlendConstants, - (void *)thunk64_vkCmdSetCheckpointNV, - (void *)thunk64_vkCmdSetCoarseSampleOrderNV, - (void *)thunk64_vkCmdSetColorBlendAdvancedEXT, - (void *)thunk64_vkCmdSetColorBlendEnableEXT, - (void *)thunk64_vkCmdSetColorBlendEquationEXT, - (void *)thunk64_vkCmdSetColorWriteEnableEXT, - (void *)thunk64_vkCmdSetColorWriteMaskEXT, - (void *)thunk64_vkCmdSetConservativeRasterizationModeEXT, - (void *)thunk64_vkCmdSetCoverageModulationModeNV, - (void *)thunk64_vkCmdSetCoverageModulationTableEnableNV, - (void *)thunk64_vkCmdSetCoverageModulationTableNV, - (void *)thunk64_vkCmdSetCoverageReductionModeNV, - (void *)thunk64_vkCmdSetCoverageToColorEnableNV, - (void *)thunk64_vkCmdSetCoverageToColorLocationNV, - (void *)thunk64_vkCmdSetCullMode, - (void *)thunk64_vkCmdSetCullModeEXT, - (void *)thunk64_vkCmdSetDepthBias, - (void *)thunk64_vkCmdSetDepthBias2EXT, - (void *)thunk64_vkCmdSetDepthBiasEnable, - (void *)thunk64_vkCmdSetDepthBiasEnableEXT, - (void *)thunk64_vkCmdSetDepthBounds, - (void *)thunk64_vkCmdSetDepthBoundsTestEnable, - (void *)thunk64_vkCmdSetDepthBoundsTestEnableEXT, - (void *)thunk64_vkCmdSetDepthClampEnableEXT, - (void *)thunk64_vkCmdSetDepthClipEnableEXT, - (void *)thunk64_vkCmdSetDepthClipNegativeOneToOneEXT, - (void *)thunk64_vkCmdSetDepthCompareOp, - (void *)thunk64_vkCmdSetDepthCompareOpEXT, - (void *)thunk64_vkCmdSetDepthTestEnable, - (void *)thunk64_vkCmdSetDepthTestEnableEXT, - (void *)thunk64_vkCmdSetDepthWriteEnable, - (void *)thunk64_vkCmdSetDepthWriteEnableEXT, - (void *)thunk64_vkCmdSetDescriptorBufferOffsetsEXT, - (void *)thunk64_vkCmdSetDeviceMask, - (void *)thunk64_vkCmdSetDeviceMaskKHR, - (void *)thunk64_vkCmdSetDiscardRectangleEXT, - (void *)thunk64_vkCmdSetDiscardRectangleEnableEXT, - (void *)thunk64_vkCmdSetDiscardRectangleModeEXT, - (void *)thunk64_vkCmdSetEvent, - (void *)thunk64_vkCmdSetEvent2, - (void *)thunk64_vkCmdSetEvent2KHR, - (void *)thunk64_vkCmdSetExclusiveScissorEnableNV, - (void *)thunk64_vkCmdSetExclusiveScissorNV, - (void *)thunk64_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - (void *)thunk64_vkCmdSetFragmentShadingRateEnumNV, - (void *)thunk64_vkCmdSetFragmentShadingRateKHR, - (void *)thunk64_vkCmdSetFrontFace, - (void *)thunk64_vkCmdSetFrontFaceEXT, - (void *)thunk64_vkCmdSetLineRasterizationModeEXT, - (void *)thunk64_vkCmdSetLineStippleEXT, - (void *)thunk64_vkCmdSetLineStippleEnableEXT, - (void *)thunk64_vkCmdSetLineWidth, - (void *)thunk64_vkCmdSetLogicOpEXT, - (void *)thunk64_vkCmdSetLogicOpEnableEXT, - (void *)thunk64_vkCmdSetPatchControlPointsEXT, - thunk64_vkCmdSetPerformanceMarkerINTEL, - thunk64_vkCmdSetPerformanceOverrideINTEL, - thunk64_vkCmdSetPerformanceStreamMarkerINTEL, - (void *)thunk64_vkCmdSetPolygonModeEXT, - (void *)thunk64_vkCmdSetPrimitiveRestartEnable, - (void *)thunk64_vkCmdSetPrimitiveRestartEnableEXT, - (void *)thunk64_vkCmdSetPrimitiveTopology, - (void *)thunk64_vkCmdSetPrimitiveTopologyEXT, - (void *)thunk64_vkCmdSetProvokingVertexModeEXT, - (void *)thunk64_vkCmdSetRasterizationSamplesEXT, - (void *)thunk64_vkCmdSetRasterizationStreamEXT, - (void *)thunk64_vkCmdSetRasterizerDiscardEnable, - (void *)thunk64_vkCmdSetRasterizerDiscardEnableEXT, - (void *)thunk64_vkCmdSetRayTracingPipelineStackSizeKHR, - (void *)thunk64_vkCmdSetRepresentativeFragmentTestEnableNV, - (void *)thunk64_vkCmdSetSampleLocationsEXT, - (void *)thunk64_vkCmdSetSampleLocationsEnableEXT, - (void *)thunk64_vkCmdSetSampleMaskEXT, - (void *)thunk64_vkCmdSetScissor, - (void *)thunk64_vkCmdSetScissorWithCount, - (void *)thunk64_vkCmdSetScissorWithCountEXT, - (void *)thunk64_vkCmdSetShadingRateImageEnableNV, - (void *)thunk64_vkCmdSetStencilCompareMask, - (void *)thunk64_vkCmdSetStencilOp, - (void *)thunk64_vkCmdSetStencilOpEXT, - (void *)thunk64_vkCmdSetStencilReference, - (void *)thunk64_vkCmdSetStencilTestEnable, - (void *)thunk64_vkCmdSetStencilTestEnableEXT, - (void *)thunk64_vkCmdSetStencilWriteMask, - (void *)thunk64_vkCmdSetTessellationDomainOriginEXT, - (void *)thunk64_vkCmdSetVertexInputEXT, - (void *)thunk64_vkCmdSetViewport, - (void *)thunk64_vkCmdSetViewportShadingRatePaletteNV, - (void *)thunk64_vkCmdSetViewportSwizzleNV, - (void *)thunk64_vkCmdSetViewportWScalingEnableNV, - (void *)thunk64_vkCmdSetViewportWScalingNV, - (void *)thunk64_vkCmdSetViewportWithCount, - (void *)thunk64_vkCmdSetViewportWithCountEXT, - (void *)thunk64_vkCmdSubpassShadingHUAWEI, - (void *)thunk64_vkCmdTraceRaysIndirect2KHR, - (void *)thunk64_vkCmdTraceRaysIndirectKHR, - (void *)thunk64_vkCmdTraceRaysKHR, - (void *)thunk64_vkCmdTraceRaysNV, - (void *)thunk64_vkCmdUpdateBuffer, - (void *)thunk64_vkCmdUpdatePipelineIndirectBufferNV, - (void *)thunk64_vkCmdWaitEvents, - (void *)thunk64_vkCmdWaitEvents2, - (void *)thunk64_vkCmdWaitEvents2KHR, - (void *)thunk64_vkCmdWriteAccelerationStructuresPropertiesKHR, - (void *)thunk64_vkCmdWriteAccelerationStructuresPropertiesNV, - (void *)thunk64_vkCmdWriteBufferMarker2AMD, - (void *)thunk64_vkCmdWriteBufferMarkerAMD, - (void *)thunk64_vkCmdWriteMicromapsPropertiesEXT, - (void *)thunk64_vkCmdWriteTimestamp, - (void *)thunk64_vkCmdWriteTimestamp2, - (void *)thunk64_vkCmdWriteTimestamp2KHR, - thunk64_vkCompileDeferredNV, - thunk64_vkCopyAccelerationStructureKHR, - thunk64_vkCopyAccelerationStructureToMemoryKHR, - thunk64_vkCopyImageToImageEXT, - thunk64_vkCopyImageToMemoryEXT, - thunk64_vkCopyMemoryToAccelerationStructureKHR, - thunk64_vkCopyMemoryToImageEXT, - thunk64_vkCopyMemoryToMicromapEXT, - thunk64_vkCopyMicromapEXT, - thunk64_vkCopyMicromapToMemoryEXT, - thunk64_vkCreateAccelerationStructureKHR, - thunk64_vkCreateAccelerationStructureNV, - thunk64_vkCreateBuffer, - thunk64_vkCreateBufferView, - thunk64_vkCreateCommandPool, - thunk64_vkCreateComputePipelines, - thunk64_vkCreateCuFunctionNVX, - thunk64_vkCreateCuModuleNVX, - thunk64_vkCreateCudaFunctionNV, - thunk64_vkCreateCudaModuleNV, - thunk64_vkCreateDebugReportCallbackEXT, - thunk64_vkCreateDebugUtilsMessengerEXT, - thunk64_vkCreateDeferredOperationKHR, - thunk64_vkCreateDescriptorPool, - thunk64_vkCreateDescriptorSetLayout, - thunk64_vkCreateDescriptorUpdateTemplate, - thunk64_vkCreateDescriptorUpdateTemplateKHR, - thunk64_vkCreateDevice, - thunk64_vkCreateEvent, - thunk64_vkCreateFence, - thunk64_vkCreateFramebuffer, - thunk64_vkCreateGraphicsPipelines, - thunk64_vkCreateImage, - thunk64_vkCreateImageView, - thunk64_vkCreateIndirectCommandsLayoutNV, - thunk64_vkCreateInstance, - thunk64_vkCreateMicromapEXT, - thunk64_vkCreateOpticalFlowSessionNV, - thunk64_vkCreatePipelineCache, - thunk64_vkCreatePipelineLayout, - thunk64_vkCreatePrivateDataSlot, - thunk64_vkCreatePrivateDataSlotEXT, - thunk64_vkCreateQueryPool, - thunk64_vkCreateRayTracingPipelinesKHR, - thunk64_vkCreateRayTracingPipelinesNV, - thunk64_vkCreateRenderPass, - thunk64_vkCreateRenderPass2, - thunk64_vkCreateRenderPass2KHR, - thunk64_vkCreateSampler, - thunk64_vkCreateSamplerYcbcrConversion, - thunk64_vkCreateSamplerYcbcrConversionKHR, - thunk64_vkCreateSemaphore, - thunk64_vkCreateShaderModule, - thunk64_vkCreateShadersEXT, - thunk64_vkCreateSwapchainKHR, - thunk64_vkCreateValidationCacheEXT, - thunk64_vkCreateWin32SurfaceKHR, - thunk64_vkDebugMarkerSetObjectNameEXT, - thunk64_vkDebugMarkerSetObjectTagEXT, - thunk64_vkDebugReportMessageEXT, - thunk64_vkDeferredOperationJoinKHR, - thunk64_vkDestroyAccelerationStructureKHR, - thunk64_vkDestroyAccelerationStructureNV, - thunk64_vkDestroyBuffer, - thunk64_vkDestroyBufferView, - thunk64_vkDestroyCommandPool, - thunk64_vkDestroyCuFunctionNVX, - thunk64_vkDestroyCuModuleNVX, - thunk64_vkDestroyCudaFunctionNV, - thunk64_vkDestroyCudaModuleNV, - thunk64_vkDestroyDebugReportCallbackEXT, - thunk64_vkDestroyDebugUtilsMessengerEXT, - thunk64_vkDestroyDeferredOperationKHR, - thunk64_vkDestroyDescriptorPool, - thunk64_vkDestroyDescriptorSetLayout, - thunk64_vkDestroyDescriptorUpdateTemplate, - thunk64_vkDestroyDescriptorUpdateTemplateKHR, - thunk64_vkDestroyDevice, - thunk64_vkDestroyEvent, - thunk64_vkDestroyFence, - thunk64_vkDestroyFramebuffer, - thunk64_vkDestroyImage, - thunk64_vkDestroyImageView, - thunk64_vkDestroyIndirectCommandsLayoutNV, - thunk64_vkDestroyInstance, - thunk64_vkDestroyMicromapEXT, - thunk64_vkDestroyOpticalFlowSessionNV, - thunk64_vkDestroyPipeline, - thunk64_vkDestroyPipelineCache, - thunk64_vkDestroyPipelineLayout, - thunk64_vkDestroyPrivateDataSlot, - thunk64_vkDestroyPrivateDataSlotEXT, - thunk64_vkDestroyQueryPool, - thunk64_vkDestroyRenderPass, - thunk64_vkDestroySampler, - thunk64_vkDestroySamplerYcbcrConversion, - thunk64_vkDestroySamplerYcbcrConversionKHR, - thunk64_vkDestroySemaphore, - thunk64_vkDestroyShaderEXT, - thunk64_vkDestroyShaderModule, - thunk64_vkDestroySurfaceKHR, - thunk64_vkDestroySwapchainKHR, - thunk64_vkDestroyValidationCacheEXT, - thunk64_vkDeviceWaitIdle, - thunk64_vkEndCommandBuffer, - thunk64_vkEnumerateDeviceExtensionProperties, - thunk64_vkEnumerateDeviceLayerProperties, - thunk64_vkEnumerateInstanceExtensionProperties, - thunk64_vkEnumerateInstanceVersion, - thunk64_vkEnumeratePhysicalDeviceGroups, - thunk64_vkEnumeratePhysicalDeviceGroupsKHR, - thunk64_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - thunk64_vkEnumeratePhysicalDevices, - thunk64_vkFlushMappedMemoryRanges, - thunk64_vkFreeCommandBuffers, - thunk64_vkFreeDescriptorSets, - thunk64_vkFreeMemory, - thunk64_vkGetAccelerationStructureBuildSizesKHR, - thunk64_vkGetAccelerationStructureDeviceAddressKHR, - thunk64_vkGetAccelerationStructureHandleNV, - thunk64_vkGetAccelerationStructureMemoryRequirementsNV, - thunk64_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetBufferDeviceAddress, - thunk64_vkGetBufferDeviceAddressEXT, - thunk64_vkGetBufferDeviceAddressKHR, - thunk64_vkGetBufferMemoryRequirements, - thunk64_vkGetBufferMemoryRequirements2, - thunk64_vkGetBufferMemoryRequirements2KHR, - thunk64_vkGetBufferOpaqueCaptureAddress, - thunk64_vkGetBufferOpaqueCaptureAddressKHR, - thunk64_vkGetBufferOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetCalibratedTimestampsEXT, - thunk64_vkGetCudaModuleCacheNV, - thunk64_vkGetDeferredOperationMaxConcurrencyKHR, - thunk64_vkGetDeferredOperationResultKHR, - (void *)thunk64_vkGetDescriptorEXT, - thunk64_vkGetDescriptorSetHostMappingVALVE, - thunk64_vkGetDescriptorSetLayoutBindingOffsetEXT, - thunk64_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - thunk64_vkGetDescriptorSetLayoutSizeEXT, - thunk64_vkGetDescriptorSetLayoutSupport, - thunk64_vkGetDescriptorSetLayoutSupportKHR, - thunk64_vkGetDeviceAccelerationStructureCompatibilityKHR, - thunk64_vkGetDeviceBufferMemoryRequirements, - thunk64_vkGetDeviceBufferMemoryRequirementsKHR, - thunk64_vkGetDeviceFaultInfoEXT, - thunk64_vkGetDeviceGroupPeerMemoryFeatures, - thunk64_vkGetDeviceGroupPeerMemoryFeaturesKHR, - thunk64_vkGetDeviceGroupPresentCapabilitiesKHR, - thunk64_vkGetDeviceGroupSurfacePresentModesKHR, - thunk64_vkGetDeviceImageMemoryRequirements, - thunk64_vkGetDeviceImageMemoryRequirementsKHR, - thunk64_vkGetDeviceImageSparseMemoryRequirements, - thunk64_vkGetDeviceImageSparseMemoryRequirementsKHR, - thunk64_vkGetDeviceImageSubresourceLayoutKHR, - thunk64_vkGetDeviceMemoryCommitment, - thunk64_vkGetDeviceMemoryOpaqueCaptureAddress, - thunk64_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - thunk64_vkGetDeviceMicromapCompatibilityEXT, - thunk64_vkGetDeviceQueue, - thunk64_vkGetDeviceQueue2, - thunk64_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - thunk64_vkGetDynamicRenderingTilePropertiesQCOM, - thunk64_vkGetEventStatus, - thunk64_vkGetFenceStatus, - thunk64_vkGetFramebufferTilePropertiesQCOM, - thunk64_vkGetGeneratedCommandsMemoryRequirementsNV, - thunk64_vkGetImageMemoryRequirements, - thunk64_vkGetImageMemoryRequirements2, - thunk64_vkGetImageMemoryRequirements2KHR, - thunk64_vkGetImageOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetImageSparseMemoryRequirements, - thunk64_vkGetImageSparseMemoryRequirements2, - thunk64_vkGetImageSparseMemoryRequirements2KHR, - thunk64_vkGetImageSubresourceLayout, - thunk64_vkGetImageSubresourceLayout2EXT, - thunk64_vkGetImageSubresourceLayout2KHR, - thunk64_vkGetImageViewAddressNVX, - thunk64_vkGetImageViewHandleNVX, - thunk64_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetLatencyTimingsNV, - thunk64_vkGetMemoryHostPointerPropertiesEXT, - thunk64_vkGetMicromapBuildSizesEXT, - thunk64_vkGetPerformanceParameterINTEL, - thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - thunk64_vkGetPhysicalDeviceExternalBufferProperties, - thunk64_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - thunk64_vkGetPhysicalDeviceExternalFenceProperties, - thunk64_vkGetPhysicalDeviceExternalFencePropertiesKHR, - thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties, - thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - thunk64_vkGetPhysicalDeviceFeatures, - thunk64_vkGetPhysicalDeviceFeatures2, - thunk64_vkGetPhysicalDeviceFeatures2KHR, - thunk64_vkGetPhysicalDeviceFormatProperties, - thunk64_vkGetPhysicalDeviceFormatProperties2, - thunk64_vkGetPhysicalDeviceFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceFragmentShadingRatesKHR, - thunk64_vkGetPhysicalDeviceImageFormatProperties, - thunk64_vkGetPhysicalDeviceImageFormatProperties2, - thunk64_vkGetPhysicalDeviceImageFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceMemoryProperties, - thunk64_vkGetPhysicalDeviceMemoryProperties2, - thunk64_vkGetPhysicalDeviceMemoryProperties2KHR, - thunk64_vkGetPhysicalDeviceMultisamplePropertiesEXT, - thunk64_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - thunk64_vkGetPhysicalDevicePresentRectanglesKHR, - thunk64_vkGetPhysicalDeviceProperties, - thunk64_vkGetPhysicalDeviceProperties2, - thunk64_vkGetPhysicalDeviceProperties2KHR, - thunk64_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties2, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - thunk64_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - thunk64_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - thunk64_vkGetPhysicalDeviceSurfaceFormats2KHR, - thunk64_vkGetPhysicalDeviceSurfaceFormatsKHR, - thunk64_vkGetPhysicalDeviceSurfacePresentModesKHR, - thunk64_vkGetPhysicalDeviceSurfaceSupportKHR, - thunk64_vkGetPhysicalDeviceToolProperties, - thunk64_vkGetPhysicalDeviceToolPropertiesEXT, - thunk64_vkGetPhysicalDeviceWin32PresentationSupportKHR, - thunk64_vkGetPipelineCacheData, - thunk64_vkGetPipelineExecutableInternalRepresentationsKHR, - thunk64_vkGetPipelineExecutablePropertiesKHR, - thunk64_vkGetPipelineExecutableStatisticsKHR, - thunk64_vkGetPipelineIndirectDeviceAddressNV, - thunk64_vkGetPipelineIndirectMemoryRequirementsNV, - thunk64_vkGetPipelinePropertiesEXT, - thunk64_vkGetPrivateData, - thunk64_vkGetPrivateDataEXT, - thunk64_vkGetQueryPoolResults, - thunk64_vkGetQueueCheckpointData2NV, - thunk64_vkGetQueueCheckpointDataNV, - thunk64_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - thunk64_vkGetRayTracingShaderGroupHandlesKHR, - thunk64_vkGetRayTracingShaderGroupHandlesNV, - thunk64_vkGetRayTracingShaderGroupStackSizeKHR, - thunk64_vkGetRenderAreaGranularity, - thunk64_vkGetRenderingAreaGranularityKHR, - thunk64_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetSemaphoreCounterValue, - thunk64_vkGetSemaphoreCounterValueKHR, - thunk64_vkGetShaderBinaryDataEXT, - thunk64_vkGetShaderInfoAMD, - thunk64_vkGetShaderModuleCreateInfoIdentifierEXT, - thunk64_vkGetShaderModuleIdentifierEXT, - thunk64_vkGetSwapchainImagesKHR, - thunk64_vkGetValidationCacheDataEXT, - thunk64_vkInitializePerformanceApiINTEL, - thunk64_vkInvalidateMappedMemoryRanges, - thunk64_vkLatencySleepNV, - thunk64_vkMapMemory, - thunk64_vkMapMemory2KHR, - thunk64_vkMergePipelineCaches, - thunk64_vkMergeValidationCachesEXT, - thunk64_vkQueueBeginDebugUtilsLabelEXT, - thunk64_vkQueueBindSparse, - thunk64_vkQueueEndDebugUtilsLabelEXT, - thunk64_vkQueueInsertDebugUtilsLabelEXT, - thunk64_vkQueueNotifyOutOfBandNV, - thunk64_vkQueuePresentKHR, - thunk64_vkQueueSetPerformanceConfigurationINTEL, - thunk64_vkQueueSubmit, - thunk64_vkQueueSubmit2, - thunk64_vkQueueSubmit2KHR, - thunk64_vkQueueWaitIdle, - thunk64_vkReleasePerformanceConfigurationINTEL, - thunk64_vkReleaseProfilingLockKHR, - thunk64_vkReleaseSwapchainImagesEXT, - thunk64_vkResetCommandBuffer, - thunk64_vkResetCommandPool, - thunk64_vkResetDescriptorPool, - thunk64_vkResetEvent, - thunk64_vkResetFences, - thunk64_vkResetQueryPool, - thunk64_vkResetQueryPoolEXT, - thunk64_vkSetDebugUtilsObjectNameEXT, - thunk64_vkSetDebugUtilsObjectTagEXT, - thunk64_vkSetDeviceMemoryPriorityEXT, - thunk64_vkSetEvent, - thunk64_vkSetHdrMetadataEXT, - thunk64_vkSetLatencyMarkerNV, - thunk64_vkSetLatencySleepModeNV, - thunk64_vkSetPrivateData, - thunk64_vkSetPrivateDataEXT, - thunk64_vkSignalSemaphore, - thunk64_vkSignalSemaphoreKHR, - thunk64_vkSubmitDebugUtilsMessageEXT, - thunk64_vkTransitionImageLayoutEXT, - thunk64_vkTrimCommandPool, - thunk64_vkTrimCommandPoolKHR, - thunk64_vkUninitializePerformanceApiINTEL, - thunk64_vkUnmapMemory, - thunk64_vkUnmapMemory2KHR, - (void *)thunk64_vkUpdateDescriptorSetWithTemplate, - thunk64_vkUpdateDescriptorSetWithTemplateKHR, - (void *)thunk64_vkUpdateDescriptorSets, - thunk64_vkWaitForFences, - thunk64_vkWaitForPresentKHR, - thunk64_vkWaitSemaphores, - thunk64_vkWaitSemaphoresKHR, - thunk64_vkWriteAccelerationStructuresPropertiesKHR, - thunk64_vkWriteMicromapsPropertiesEXT, -}; -C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count); - -#endif /* _WIN64 */ - -#ifdef _WIN64 -const unixlib_entry_t __wine_unix_call_wow64_funcs[] = -#else -const unixlib_entry_t __wine_unix_call_funcs[] = -#endif -{ - init_vulkan, - vk_is_available_instance_function32, - vk_is_available_device_function32, - thunk32_vkAcquireNextImage2KHR, - thunk32_vkAcquireNextImageKHR, - thunk32_vkAcquirePerformanceConfigurationINTEL, - thunk32_vkAcquireProfilingLockKHR, - thunk32_vkAllocateCommandBuffers, - thunk32_vkAllocateDescriptorSets, - thunk32_vkAllocateMemory, - thunk32_vkBeginCommandBuffer, - thunk32_vkBindAccelerationStructureMemoryNV, - thunk32_vkBindBufferMemory, - thunk32_vkBindBufferMemory2, - thunk32_vkBindBufferMemory2KHR, - thunk32_vkBindImageMemory, - thunk32_vkBindImageMemory2, - thunk32_vkBindImageMemory2KHR, - thunk32_vkBindOpticalFlowSessionImageNV, - thunk32_vkBuildAccelerationStructuresKHR, - thunk32_vkBuildMicromapsEXT, - (void *)thunk32_vkCmdBeginConditionalRenderingEXT, - (void *)thunk32_vkCmdBeginDebugUtilsLabelEXT, - (void *)thunk32_vkCmdBeginQuery, - (void *)thunk32_vkCmdBeginQueryIndexedEXT, - (void *)thunk32_vkCmdBeginRenderPass, - (void *)thunk32_vkCmdBeginRenderPass2, - (void *)thunk32_vkCmdBeginRenderPass2KHR, - (void *)thunk32_vkCmdBeginRendering, - (void *)thunk32_vkCmdBeginRenderingKHR, - (void *)thunk32_vkCmdBeginTransformFeedbackEXT, - (void *)thunk32_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - (void *)thunk32_vkCmdBindDescriptorBuffersEXT, - (void *)thunk32_vkCmdBindDescriptorSets, - (void *)thunk32_vkCmdBindIndexBuffer, - (void *)thunk32_vkCmdBindIndexBuffer2KHR, - (void *)thunk32_vkCmdBindInvocationMaskHUAWEI, - (void *)thunk32_vkCmdBindPipeline, - (void *)thunk32_vkCmdBindPipelineShaderGroupNV, - (void *)thunk32_vkCmdBindShadersEXT, - (void *)thunk32_vkCmdBindShadingRateImageNV, - (void *)thunk32_vkCmdBindTransformFeedbackBuffersEXT, - (void *)thunk32_vkCmdBindVertexBuffers, - (void *)thunk32_vkCmdBindVertexBuffers2, - (void *)thunk32_vkCmdBindVertexBuffers2EXT, - (void *)thunk32_vkCmdBlitImage, - (void *)thunk32_vkCmdBlitImage2, - (void *)thunk32_vkCmdBlitImage2KHR, - (void *)thunk32_vkCmdBuildAccelerationStructureNV, - (void *)thunk32_vkCmdBuildAccelerationStructuresIndirectKHR, - (void *)thunk32_vkCmdBuildAccelerationStructuresKHR, - (void *)thunk32_vkCmdBuildMicromapsEXT, - (void *)thunk32_vkCmdClearAttachments, - (void *)thunk32_vkCmdClearColorImage, - (void *)thunk32_vkCmdClearDepthStencilImage, - (void *)thunk32_vkCmdCopyAccelerationStructureKHR, - (void *)thunk32_vkCmdCopyAccelerationStructureNV, - (void *)thunk32_vkCmdCopyAccelerationStructureToMemoryKHR, - (void *)thunk32_vkCmdCopyBuffer, - (void *)thunk32_vkCmdCopyBuffer2, - (void *)thunk32_vkCmdCopyBuffer2KHR, - (void *)thunk32_vkCmdCopyBufferToImage, - (void *)thunk32_vkCmdCopyBufferToImage2, - (void *)thunk32_vkCmdCopyBufferToImage2KHR, - (void *)thunk32_vkCmdCopyImage, - (void *)thunk32_vkCmdCopyImage2, - (void *)thunk32_vkCmdCopyImage2KHR, - (void *)thunk32_vkCmdCopyImageToBuffer, - (void *)thunk32_vkCmdCopyImageToBuffer2, - (void *)thunk32_vkCmdCopyImageToBuffer2KHR, - (void *)thunk32_vkCmdCopyMemoryIndirectNV, - (void *)thunk32_vkCmdCopyMemoryToAccelerationStructureKHR, - (void *)thunk32_vkCmdCopyMemoryToImageIndirectNV, - (void *)thunk32_vkCmdCopyMemoryToMicromapEXT, - (void *)thunk32_vkCmdCopyMicromapEXT, - (void *)thunk32_vkCmdCopyMicromapToMemoryEXT, - (void *)thunk32_vkCmdCopyQueryPoolResults, - (void *)thunk32_vkCmdCuLaunchKernelNVX, - (void *)thunk32_vkCmdCudaLaunchKernelNV, - (void *)thunk32_vkCmdDebugMarkerBeginEXT, - (void *)thunk32_vkCmdDebugMarkerEndEXT, - (void *)thunk32_vkCmdDebugMarkerInsertEXT, - (void *)thunk32_vkCmdDecompressMemoryIndirectCountNV, - (void *)thunk32_vkCmdDecompressMemoryNV, - (void *)thunk32_vkCmdDispatch, - (void *)thunk32_vkCmdDispatchBase, - (void *)thunk32_vkCmdDispatchBaseKHR, - (void *)thunk32_vkCmdDispatchIndirect, - (void *)thunk32_vkCmdDraw, - (void *)thunk32_vkCmdDrawClusterHUAWEI, - (void *)thunk32_vkCmdDrawClusterIndirectHUAWEI, - (void *)thunk32_vkCmdDrawIndexed, - (void *)thunk32_vkCmdDrawIndexedIndirect, - (void *)thunk32_vkCmdDrawIndexedIndirectCount, - (void *)thunk32_vkCmdDrawIndexedIndirectCountAMD, - (void *)thunk32_vkCmdDrawIndexedIndirectCountKHR, - (void *)thunk32_vkCmdDrawIndirect, - (void *)thunk32_vkCmdDrawIndirectByteCountEXT, - (void *)thunk32_vkCmdDrawIndirectCount, - (void *)thunk32_vkCmdDrawIndirectCountAMD, - (void *)thunk32_vkCmdDrawIndirectCountKHR, - (void *)thunk32_vkCmdDrawMeshTasksEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectCountEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectCountNV, - (void *)thunk32_vkCmdDrawMeshTasksIndirectEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectNV, - (void *)thunk32_vkCmdDrawMeshTasksNV, - (void *)thunk32_vkCmdDrawMultiEXT, - (void *)thunk32_vkCmdDrawMultiIndexedEXT, - (void *)thunk32_vkCmdEndConditionalRenderingEXT, - (void *)thunk32_vkCmdEndDebugUtilsLabelEXT, - (void *)thunk32_vkCmdEndQuery, - (void *)thunk32_vkCmdEndQueryIndexedEXT, - (void *)thunk32_vkCmdEndRenderPass, - (void *)thunk32_vkCmdEndRenderPass2, - (void *)thunk32_vkCmdEndRenderPass2KHR, - (void *)thunk32_vkCmdEndRendering, - (void *)thunk32_vkCmdEndRenderingKHR, - (void *)thunk32_vkCmdEndTransformFeedbackEXT, - (void *)thunk32_vkCmdExecuteCommands, - (void *)thunk32_vkCmdExecuteGeneratedCommandsNV, - (void *)thunk32_vkCmdFillBuffer, - (void *)thunk32_vkCmdInsertDebugUtilsLabelEXT, - (void *)thunk32_vkCmdNextSubpass, - (void *)thunk32_vkCmdNextSubpass2, - (void *)thunk32_vkCmdNextSubpass2KHR, - (void *)thunk32_vkCmdOpticalFlowExecuteNV, - (void *)thunk32_vkCmdPipelineBarrier, - (void *)thunk32_vkCmdPipelineBarrier2, - (void *)thunk32_vkCmdPipelineBarrier2KHR, - (void *)thunk32_vkCmdPreprocessGeneratedCommandsNV, - (void *)thunk32_vkCmdPushConstants, - (void *)thunk32_vkCmdPushDescriptorSetKHR, - (void *)thunk32_vkCmdPushDescriptorSetWithTemplateKHR, - (void *)thunk32_vkCmdResetEvent, - (void *)thunk32_vkCmdResetEvent2, - (void *)thunk32_vkCmdResetEvent2KHR, - (void *)thunk32_vkCmdResetQueryPool, - (void *)thunk32_vkCmdResolveImage, - (void *)thunk32_vkCmdResolveImage2, - (void *)thunk32_vkCmdResolveImage2KHR, - (void *)thunk32_vkCmdSetAlphaToCoverageEnableEXT, - (void *)thunk32_vkCmdSetAlphaToOneEnableEXT, - (void *)thunk32_vkCmdSetAttachmentFeedbackLoopEnableEXT, - (void *)thunk32_vkCmdSetBlendConstants, - (void *)thunk32_vkCmdSetCheckpointNV, - (void *)thunk32_vkCmdSetCoarseSampleOrderNV, - (void *)thunk32_vkCmdSetColorBlendAdvancedEXT, - (void *)thunk32_vkCmdSetColorBlendEnableEXT, - (void *)thunk32_vkCmdSetColorBlendEquationEXT, - (void *)thunk32_vkCmdSetColorWriteEnableEXT, - (void *)thunk32_vkCmdSetColorWriteMaskEXT, - (void *)thunk32_vkCmdSetConservativeRasterizationModeEXT, - (void *)thunk32_vkCmdSetCoverageModulationModeNV, - (void *)thunk32_vkCmdSetCoverageModulationTableEnableNV, - (void *)thunk32_vkCmdSetCoverageModulationTableNV, - (void *)thunk32_vkCmdSetCoverageReductionModeNV, - (void *)thunk32_vkCmdSetCoverageToColorEnableNV, - (void *)thunk32_vkCmdSetCoverageToColorLocationNV, - (void *)thunk32_vkCmdSetCullMode, - (void *)thunk32_vkCmdSetCullModeEXT, - (void *)thunk32_vkCmdSetDepthBias, - (void *)thunk32_vkCmdSetDepthBias2EXT, - (void *)thunk32_vkCmdSetDepthBiasEnable, - (void *)thunk32_vkCmdSetDepthBiasEnableEXT, - (void *)thunk32_vkCmdSetDepthBounds, - (void *)thunk32_vkCmdSetDepthBoundsTestEnable, - (void *)thunk32_vkCmdSetDepthBoundsTestEnableEXT, - (void *)thunk32_vkCmdSetDepthClampEnableEXT, - (void *)thunk32_vkCmdSetDepthClipEnableEXT, - (void *)thunk32_vkCmdSetDepthClipNegativeOneToOneEXT, - (void *)thunk32_vkCmdSetDepthCompareOp, - (void *)thunk32_vkCmdSetDepthCompareOpEXT, - (void *)thunk32_vkCmdSetDepthTestEnable, - (void *)thunk32_vkCmdSetDepthTestEnableEXT, - (void *)thunk32_vkCmdSetDepthWriteEnable, - (void *)thunk32_vkCmdSetDepthWriteEnableEXT, - (void *)thunk32_vkCmdSetDescriptorBufferOffsetsEXT, - (void *)thunk32_vkCmdSetDeviceMask, - (void *)thunk32_vkCmdSetDeviceMaskKHR, - (void *)thunk32_vkCmdSetDiscardRectangleEXT, - (void *)thunk32_vkCmdSetDiscardRectangleEnableEXT, - (void *)thunk32_vkCmdSetDiscardRectangleModeEXT, - (void *)thunk32_vkCmdSetEvent, - (void *)thunk32_vkCmdSetEvent2, - (void *)thunk32_vkCmdSetEvent2KHR, - (void *)thunk32_vkCmdSetExclusiveScissorEnableNV, - (void *)thunk32_vkCmdSetExclusiveScissorNV, - (void *)thunk32_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - (void *)thunk32_vkCmdSetFragmentShadingRateEnumNV, - (void *)thunk32_vkCmdSetFragmentShadingRateKHR, - (void *)thunk32_vkCmdSetFrontFace, - (void *)thunk32_vkCmdSetFrontFaceEXT, - (void *)thunk32_vkCmdSetLineRasterizationModeEXT, - (void *)thunk32_vkCmdSetLineStippleEXT, - (void *)thunk32_vkCmdSetLineStippleEnableEXT, - (void *)thunk32_vkCmdSetLineWidth, - (void *)thunk32_vkCmdSetLogicOpEXT, - (void *)thunk32_vkCmdSetLogicOpEnableEXT, - (void *)thunk32_vkCmdSetPatchControlPointsEXT, - thunk32_vkCmdSetPerformanceMarkerINTEL, - thunk32_vkCmdSetPerformanceOverrideINTEL, - thunk32_vkCmdSetPerformanceStreamMarkerINTEL, - (void *)thunk32_vkCmdSetPolygonModeEXT, - (void *)thunk32_vkCmdSetPrimitiveRestartEnable, - (void *)thunk32_vkCmdSetPrimitiveRestartEnableEXT, - (void *)thunk32_vkCmdSetPrimitiveTopology, - (void *)thunk32_vkCmdSetPrimitiveTopologyEXT, - (void *)thunk32_vkCmdSetProvokingVertexModeEXT, - (void *)thunk32_vkCmdSetRasterizationSamplesEXT, - (void *)thunk32_vkCmdSetRasterizationStreamEXT, - (void *)thunk32_vkCmdSetRasterizerDiscardEnable, - (void *)thunk32_vkCmdSetRasterizerDiscardEnableEXT, - (void *)thunk32_vkCmdSetRayTracingPipelineStackSizeKHR, - (void *)thunk32_vkCmdSetRepresentativeFragmentTestEnableNV, - (void *)thunk32_vkCmdSetSampleLocationsEXT, - (void *)thunk32_vkCmdSetSampleLocationsEnableEXT, - (void *)thunk32_vkCmdSetSampleMaskEXT, - (void *)thunk32_vkCmdSetScissor, - (void *)thunk32_vkCmdSetScissorWithCount, - (void *)thunk32_vkCmdSetScissorWithCountEXT, - (void *)thunk32_vkCmdSetShadingRateImageEnableNV, - (void *)thunk32_vkCmdSetStencilCompareMask, - (void *)thunk32_vkCmdSetStencilOp, - (void *)thunk32_vkCmdSetStencilOpEXT, - (void *)thunk32_vkCmdSetStencilReference, - (void *)thunk32_vkCmdSetStencilTestEnable, - (void *)thunk32_vkCmdSetStencilTestEnableEXT, - (void *)thunk32_vkCmdSetStencilWriteMask, - (void *)thunk32_vkCmdSetTessellationDomainOriginEXT, - (void *)thunk32_vkCmdSetVertexInputEXT, - (void *)thunk32_vkCmdSetViewport, - (void *)thunk32_vkCmdSetViewportShadingRatePaletteNV, - (void *)thunk32_vkCmdSetViewportSwizzleNV, - (void *)thunk32_vkCmdSetViewportWScalingEnableNV, - (void *)thunk32_vkCmdSetViewportWScalingNV, - (void *)thunk32_vkCmdSetViewportWithCount, - (void *)thunk32_vkCmdSetViewportWithCountEXT, - (void *)thunk32_vkCmdSubpassShadingHUAWEI, - (void *)thunk32_vkCmdTraceRaysIndirect2KHR, - (void *)thunk32_vkCmdTraceRaysIndirectKHR, - (void *)thunk32_vkCmdTraceRaysKHR, - (void *)thunk32_vkCmdTraceRaysNV, - (void *)thunk32_vkCmdUpdateBuffer, - (void *)thunk32_vkCmdUpdatePipelineIndirectBufferNV, - (void *)thunk32_vkCmdWaitEvents, - (void *)thunk32_vkCmdWaitEvents2, - (void *)thunk32_vkCmdWaitEvents2KHR, - (void *)thunk32_vkCmdWriteAccelerationStructuresPropertiesKHR, - (void *)thunk32_vkCmdWriteAccelerationStructuresPropertiesNV, - (void *)thunk32_vkCmdWriteBufferMarker2AMD, - (void *)thunk32_vkCmdWriteBufferMarkerAMD, - (void *)thunk32_vkCmdWriteMicromapsPropertiesEXT, - (void *)thunk32_vkCmdWriteTimestamp, - (void *)thunk32_vkCmdWriteTimestamp2, - (void *)thunk32_vkCmdWriteTimestamp2KHR, - thunk32_vkCompileDeferredNV, - thunk32_vkCopyAccelerationStructureKHR, - thunk32_vkCopyAccelerationStructureToMemoryKHR, - thunk32_vkCopyImageToImageEXT, - thunk32_vkCopyImageToMemoryEXT, - thunk32_vkCopyMemoryToAccelerationStructureKHR, - thunk32_vkCopyMemoryToImageEXT, - thunk32_vkCopyMemoryToMicromapEXT, - thunk32_vkCopyMicromapEXT, - thunk32_vkCopyMicromapToMemoryEXT, - thunk32_vkCreateAccelerationStructureKHR, - thunk32_vkCreateAccelerationStructureNV, - thunk32_vkCreateBuffer, - thunk32_vkCreateBufferView, - thunk32_vkCreateCommandPool, - thunk32_vkCreateComputePipelines, - thunk32_vkCreateCuFunctionNVX, - thunk32_vkCreateCuModuleNVX, - thunk32_vkCreateCudaFunctionNV, - thunk32_vkCreateCudaModuleNV, - thunk32_vkCreateDebugReportCallbackEXT, - thunk32_vkCreateDebugUtilsMessengerEXT, - thunk32_vkCreateDeferredOperationKHR, - thunk32_vkCreateDescriptorPool, - thunk32_vkCreateDescriptorSetLayout, - thunk32_vkCreateDescriptorUpdateTemplate, - thunk32_vkCreateDescriptorUpdateTemplateKHR, - thunk32_vkCreateDevice, - thunk32_vkCreateEvent, - thunk32_vkCreateFence, - thunk32_vkCreateFramebuffer, - thunk32_vkCreateGraphicsPipelines, - thunk32_vkCreateImage, - thunk32_vkCreateImageView, - thunk32_vkCreateIndirectCommandsLayoutNV, - thunk32_vkCreateInstance, - thunk32_vkCreateMicromapEXT, - thunk32_vkCreateOpticalFlowSessionNV, - thunk32_vkCreatePipelineCache, - thunk32_vkCreatePipelineLayout, - thunk32_vkCreatePrivateDataSlot, - thunk32_vkCreatePrivateDataSlotEXT, - thunk32_vkCreateQueryPool, - thunk32_vkCreateRayTracingPipelinesKHR, - thunk32_vkCreateRayTracingPipelinesNV, - thunk32_vkCreateRenderPass, - thunk32_vkCreateRenderPass2, - thunk32_vkCreateRenderPass2KHR, - thunk32_vkCreateSampler, - thunk32_vkCreateSamplerYcbcrConversion, - thunk32_vkCreateSamplerYcbcrConversionKHR, - thunk32_vkCreateSemaphore, - thunk32_vkCreateShaderModule, - thunk32_vkCreateShadersEXT, - thunk32_vkCreateSwapchainKHR, - thunk32_vkCreateValidationCacheEXT, - thunk32_vkCreateWin32SurfaceKHR, - thunk32_vkDebugMarkerSetObjectNameEXT, - thunk32_vkDebugMarkerSetObjectTagEXT, - thunk32_vkDebugReportMessageEXT, - thunk32_vkDeferredOperationJoinKHR, - thunk32_vkDestroyAccelerationStructureKHR, - thunk32_vkDestroyAccelerationStructureNV, - thunk32_vkDestroyBuffer, - thunk32_vkDestroyBufferView, - thunk32_vkDestroyCommandPool, - thunk32_vkDestroyCuFunctionNVX, - thunk32_vkDestroyCuModuleNVX, - thunk32_vkDestroyCudaFunctionNV, - thunk32_vkDestroyCudaModuleNV, - thunk32_vkDestroyDebugReportCallbackEXT, - thunk32_vkDestroyDebugUtilsMessengerEXT, - thunk32_vkDestroyDeferredOperationKHR, - thunk32_vkDestroyDescriptorPool, - thunk32_vkDestroyDescriptorSetLayout, - thunk32_vkDestroyDescriptorUpdateTemplate, - thunk32_vkDestroyDescriptorUpdateTemplateKHR, - thunk32_vkDestroyDevice, - thunk32_vkDestroyEvent, - thunk32_vkDestroyFence, - thunk32_vkDestroyFramebuffer, - thunk32_vkDestroyImage, - thunk32_vkDestroyImageView, - thunk32_vkDestroyIndirectCommandsLayoutNV, - thunk32_vkDestroyInstance, - thunk32_vkDestroyMicromapEXT, - thunk32_vkDestroyOpticalFlowSessionNV, - thunk32_vkDestroyPipeline, - thunk32_vkDestroyPipelineCache, - thunk32_vkDestroyPipelineLayout, - thunk32_vkDestroyPrivateDataSlot, - thunk32_vkDestroyPrivateDataSlotEXT, - thunk32_vkDestroyQueryPool, - thunk32_vkDestroyRenderPass, - thunk32_vkDestroySampler, - thunk32_vkDestroySamplerYcbcrConversion, - thunk32_vkDestroySamplerYcbcrConversionKHR, - thunk32_vkDestroySemaphore, - thunk32_vkDestroyShaderEXT, - thunk32_vkDestroyShaderModule, - thunk32_vkDestroySurfaceKHR, - thunk32_vkDestroySwapchainKHR, - thunk32_vkDestroyValidationCacheEXT, - thunk32_vkDeviceWaitIdle, - thunk32_vkEndCommandBuffer, - thunk32_vkEnumerateDeviceExtensionProperties, - thunk32_vkEnumerateDeviceLayerProperties, - thunk32_vkEnumerateInstanceExtensionProperties, - thunk32_vkEnumerateInstanceVersion, - thunk32_vkEnumeratePhysicalDeviceGroups, - thunk32_vkEnumeratePhysicalDeviceGroupsKHR, - thunk32_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - thunk32_vkEnumeratePhysicalDevices, - thunk32_vkFlushMappedMemoryRanges, - thunk32_vkFreeCommandBuffers, - thunk32_vkFreeDescriptorSets, - thunk32_vkFreeMemory, - thunk32_vkGetAccelerationStructureBuildSizesKHR, - thunk32_vkGetAccelerationStructureDeviceAddressKHR, - thunk32_vkGetAccelerationStructureHandleNV, - thunk32_vkGetAccelerationStructureMemoryRequirementsNV, - thunk32_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetBufferDeviceAddress, - thunk32_vkGetBufferDeviceAddressEXT, - thunk32_vkGetBufferDeviceAddressKHR, - thunk32_vkGetBufferMemoryRequirements, - thunk32_vkGetBufferMemoryRequirements2, - thunk32_vkGetBufferMemoryRequirements2KHR, - thunk32_vkGetBufferOpaqueCaptureAddress, - thunk32_vkGetBufferOpaqueCaptureAddressKHR, - thunk32_vkGetBufferOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetCalibratedTimestampsEXT, - thunk32_vkGetCudaModuleCacheNV, - thunk32_vkGetDeferredOperationMaxConcurrencyKHR, - thunk32_vkGetDeferredOperationResultKHR, - (void *)thunk32_vkGetDescriptorEXT, - thunk32_vkGetDescriptorSetHostMappingVALVE, - thunk32_vkGetDescriptorSetLayoutBindingOffsetEXT, - thunk32_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - thunk32_vkGetDescriptorSetLayoutSizeEXT, - thunk32_vkGetDescriptorSetLayoutSupport, - thunk32_vkGetDescriptorSetLayoutSupportKHR, - thunk32_vkGetDeviceAccelerationStructureCompatibilityKHR, - thunk32_vkGetDeviceBufferMemoryRequirements, - thunk32_vkGetDeviceBufferMemoryRequirementsKHR, - thunk32_vkGetDeviceFaultInfoEXT, - thunk32_vkGetDeviceGroupPeerMemoryFeatures, - thunk32_vkGetDeviceGroupPeerMemoryFeaturesKHR, - thunk32_vkGetDeviceGroupPresentCapabilitiesKHR, - thunk32_vkGetDeviceGroupSurfacePresentModesKHR, - thunk32_vkGetDeviceImageMemoryRequirements, - thunk32_vkGetDeviceImageMemoryRequirementsKHR, - thunk32_vkGetDeviceImageSparseMemoryRequirements, - thunk32_vkGetDeviceImageSparseMemoryRequirementsKHR, - thunk32_vkGetDeviceImageSubresourceLayoutKHR, - thunk32_vkGetDeviceMemoryCommitment, - thunk32_vkGetDeviceMemoryOpaqueCaptureAddress, - thunk32_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - thunk32_vkGetDeviceMicromapCompatibilityEXT, - thunk32_vkGetDeviceQueue, - thunk32_vkGetDeviceQueue2, - thunk32_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - thunk32_vkGetDynamicRenderingTilePropertiesQCOM, - thunk32_vkGetEventStatus, - thunk32_vkGetFenceStatus, - thunk32_vkGetFramebufferTilePropertiesQCOM, - thunk32_vkGetGeneratedCommandsMemoryRequirementsNV, - thunk32_vkGetImageMemoryRequirements, - thunk32_vkGetImageMemoryRequirements2, - thunk32_vkGetImageMemoryRequirements2KHR, - thunk32_vkGetImageOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetImageSparseMemoryRequirements, - thunk32_vkGetImageSparseMemoryRequirements2, - thunk32_vkGetImageSparseMemoryRequirements2KHR, - thunk32_vkGetImageSubresourceLayout, - thunk32_vkGetImageSubresourceLayout2EXT, - thunk32_vkGetImageSubresourceLayout2KHR, - thunk32_vkGetImageViewAddressNVX, - thunk32_vkGetImageViewHandleNVX, - thunk32_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetLatencyTimingsNV, - thunk32_vkGetMemoryHostPointerPropertiesEXT, - thunk32_vkGetMicromapBuildSizesEXT, - thunk32_vkGetPerformanceParameterINTEL, - thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - thunk32_vkGetPhysicalDeviceExternalBufferProperties, - thunk32_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - thunk32_vkGetPhysicalDeviceExternalFenceProperties, - thunk32_vkGetPhysicalDeviceExternalFencePropertiesKHR, - thunk32_vkGetPhysicalDeviceExternalSemaphoreProperties, - thunk32_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - thunk32_vkGetPhysicalDeviceFeatures, - thunk32_vkGetPhysicalDeviceFeatures2, - thunk32_vkGetPhysicalDeviceFeatures2KHR, - thunk32_vkGetPhysicalDeviceFormatProperties, - thunk32_vkGetPhysicalDeviceFormatProperties2, - thunk32_vkGetPhysicalDeviceFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceFragmentShadingRatesKHR, - thunk32_vkGetPhysicalDeviceImageFormatProperties, - thunk32_vkGetPhysicalDeviceImageFormatProperties2, - thunk32_vkGetPhysicalDeviceImageFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceMemoryProperties, - thunk32_vkGetPhysicalDeviceMemoryProperties2, - thunk32_vkGetPhysicalDeviceMemoryProperties2KHR, - thunk32_vkGetPhysicalDeviceMultisamplePropertiesEXT, - thunk32_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - thunk32_vkGetPhysicalDevicePresentRectanglesKHR, - thunk32_vkGetPhysicalDeviceProperties, - thunk32_vkGetPhysicalDeviceProperties2, - thunk32_vkGetPhysicalDeviceProperties2KHR, - thunk32_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties2, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - thunk32_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - thunk32_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - thunk32_vkGetPhysicalDeviceSurfaceFormats2KHR, - thunk32_vkGetPhysicalDeviceSurfaceFormatsKHR, - thunk32_vkGetPhysicalDeviceSurfacePresentModesKHR, - thunk32_vkGetPhysicalDeviceSurfaceSupportKHR, - thunk32_vkGetPhysicalDeviceToolProperties, - thunk32_vkGetPhysicalDeviceToolPropertiesEXT, - thunk32_vkGetPhysicalDeviceWin32PresentationSupportKHR, - thunk32_vkGetPipelineCacheData, - thunk32_vkGetPipelineExecutableInternalRepresentationsKHR, - thunk32_vkGetPipelineExecutablePropertiesKHR, - thunk32_vkGetPipelineExecutableStatisticsKHR, - thunk32_vkGetPipelineIndirectDeviceAddressNV, - thunk32_vkGetPipelineIndirectMemoryRequirementsNV, - thunk32_vkGetPipelinePropertiesEXT, - thunk32_vkGetPrivateData, - thunk32_vkGetPrivateDataEXT, - thunk32_vkGetQueryPoolResults, - thunk32_vkGetQueueCheckpointData2NV, - thunk32_vkGetQueueCheckpointDataNV, - thunk32_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - thunk32_vkGetRayTracingShaderGroupHandlesKHR, - thunk32_vkGetRayTracingShaderGroupHandlesNV, - thunk32_vkGetRayTracingShaderGroupStackSizeKHR, - thunk32_vkGetRenderAreaGranularity, - thunk32_vkGetRenderingAreaGranularityKHR, - thunk32_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetSemaphoreCounterValue, - thunk32_vkGetSemaphoreCounterValueKHR, - thunk32_vkGetShaderBinaryDataEXT, - thunk32_vkGetShaderInfoAMD, - thunk32_vkGetShaderModuleCreateInfoIdentifierEXT, - thunk32_vkGetShaderModuleIdentifierEXT, - thunk32_vkGetSwapchainImagesKHR, - thunk32_vkGetValidationCacheDataEXT, - thunk32_vkInitializePerformanceApiINTEL, - thunk32_vkInvalidateMappedMemoryRanges, - thunk32_vkLatencySleepNV, - thunk32_vkMapMemory, - thunk32_vkMapMemory2KHR, - thunk32_vkMergePipelineCaches, - thunk32_vkMergeValidationCachesEXT, - thunk32_vkQueueBeginDebugUtilsLabelEXT, - thunk32_vkQueueBindSparse, - thunk32_vkQueueEndDebugUtilsLabelEXT, - thunk32_vkQueueInsertDebugUtilsLabelEXT, - thunk32_vkQueueNotifyOutOfBandNV, - thunk32_vkQueuePresentKHR, - thunk32_vkQueueSetPerformanceConfigurationINTEL, - thunk32_vkQueueSubmit, - thunk32_vkQueueSubmit2, - thunk32_vkQueueSubmit2KHR, - thunk32_vkQueueWaitIdle, - thunk32_vkReleasePerformanceConfigurationINTEL, - thunk32_vkReleaseProfilingLockKHR, - thunk32_vkReleaseSwapchainImagesEXT, - thunk32_vkResetCommandBuffer, - thunk32_vkResetCommandPool, - thunk32_vkResetDescriptorPool, - thunk32_vkResetEvent, - thunk32_vkResetFences, - thunk32_vkResetQueryPool, - thunk32_vkResetQueryPoolEXT, - thunk32_vkSetDebugUtilsObjectNameEXT, - thunk32_vkSetDebugUtilsObjectTagEXT, - thunk32_vkSetDeviceMemoryPriorityEXT, - thunk32_vkSetEvent, - thunk32_vkSetHdrMetadataEXT, - thunk32_vkSetLatencyMarkerNV, - thunk32_vkSetLatencySleepModeNV, - thunk32_vkSetPrivateData, - thunk32_vkSetPrivateDataEXT, - thunk32_vkSignalSemaphore, - thunk32_vkSignalSemaphoreKHR, - thunk32_vkSubmitDebugUtilsMessageEXT, - thunk32_vkTransitionImageLayoutEXT, - thunk32_vkTrimCommandPool, - thunk32_vkTrimCommandPoolKHR, - thunk32_vkUninitializePerformanceApiINTEL, - thunk32_vkUnmapMemory, - thunk32_vkUnmapMemory2KHR, - (void *)thunk32_vkUpdateDescriptorSetWithTemplate, - thunk32_vkUpdateDescriptorSetWithTemplateKHR, - (void *)thunk32_vkUpdateDescriptorSets, - thunk32_vkWaitForFences, - thunk32_vkWaitForPresentKHR, - thunk32_vkWaitSemaphores, - thunk32_vkWaitSemaphoresKHR, - thunk32_vkWriteAccelerationStructuresPropertiesKHR, - thunk32_vkWriteMicromapsPropertiesEXT, -}; -C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count); diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h deleted file mode 100644 index 8b0d43fadf5..00000000000 --- a/dlls/winevulkan/vulkan_thunks.h +++ /dev/null @@ -1,1186 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_THUNKS_H -#define __WINE_VULKAN_THUNKS_H - -#define WINE_VK_VERSION VK_API_VERSION_1_3 - -/* Functions for which we have custom implementations outside of the thunks. */ -VkResult wine_vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); -VkResult wine_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); -VkResult wine_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer); -VkResult wine_vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool, void *client_ptr); -VkResult wine_vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback); -VkResult wine_vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger); -VkResult wine_vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation); -VkResult wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, void *client_ptr); -VkResult wine_vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); -VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance, void *client_ptr); -VkResult wine_vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -void wine_vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator); -VkResult wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult wine_vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult wine_vkEnumerateInstanceVersion(uint32_t *pApiVersion); -VkResult wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices); -void wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -void wine_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator); -VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -void wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue); -void wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue); -VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainEXT *pTimeDomains); -void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void wine_vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities); -VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); -VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); -VkResult wine_vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData); -void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory); -VkResult wine_vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo); - -/* For use by vkDevice and children */ -struct vulkan_device_funcs -{ - VkResult (*p_vkAcquireNextImage2KHR)(VkDevice, const VkAcquireNextImageInfoKHR *, uint32_t *); - VkResult (*p_vkAcquireNextImageKHR)(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t *); - VkResult (*p_vkAcquirePerformanceConfigurationINTEL)(VkDevice, const VkPerformanceConfigurationAcquireInfoINTEL *, VkPerformanceConfigurationINTEL *); - VkResult (*p_vkAcquireProfilingLockKHR)(VkDevice, const VkAcquireProfilingLockInfoKHR *); - VkResult (*p_vkAllocateCommandBuffers)(VkDevice, const VkCommandBufferAllocateInfo *, VkCommandBuffer *); - VkResult (*p_vkAllocateDescriptorSets)(VkDevice, const VkDescriptorSetAllocateInfo *, VkDescriptorSet *); - VkResult (*p_vkAllocateMemory)(VkDevice, const VkMemoryAllocateInfo *, const VkAllocationCallbacks *, VkDeviceMemory *); - VkResult (*p_vkBeginCommandBuffer)(VkCommandBuffer, const VkCommandBufferBeginInfo *); - VkResult (*p_vkBindAccelerationStructureMemoryNV)(VkDevice, uint32_t, const VkBindAccelerationStructureMemoryInfoNV *); - VkResult (*p_vkBindBufferMemory)(VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize); - VkResult (*p_vkBindBufferMemory2)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); - VkResult (*p_vkBindBufferMemory2KHR)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); - VkResult (*p_vkBindImageMemory)(VkDevice, VkImage, VkDeviceMemory, VkDeviceSize); - VkResult (*p_vkBindImageMemory2)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); - VkResult (*p_vkBindImageMemory2KHR)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); - VkResult (*p_vkBindOpticalFlowSessionImageNV)(VkDevice, VkOpticalFlowSessionNV, VkOpticalFlowSessionBindingPointNV, VkImageView, VkImageLayout); - VkResult (*p_vkBuildAccelerationStructuresKHR)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); - VkResult (*p_vkBuildMicromapsEXT)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkMicromapBuildInfoEXT *); - void (*p_vkCmdBeginConditionalRenderingEXT)(VkCommandBuffer, const VkConditionalRenderingBeginInfoEXT *); - void (*p_vkCmdBeginDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); - void (*p_vkCmdBeginQuery)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags); - void (*p_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags, uint32_t); - void (*p_vkCmdBeginRenderPass)(VkCommandBuffer, const VkRenderPassBeginInfo *, VkSubpassContents); - void (*p_vkCmdBeginRenderPass2)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); - void (*p_vkCmdBeginRenderPass2KHR)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); - void (*p_vkCmdBeginRendering)(VkCommandBuffer, const VkRenderingInfo *); - void (*p_vkCmdBeginRenderingKHR)(VkCommandBuffer, const VkRenderingInfo *); - void (*p_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); - void (*p_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t); - void (*p_vkCmdBindDescriptorBuffersEXT)(VkCommandBuffer, uint32_t, const VkDescriptorBufferBindingInfoEXT *); - void (*p_vkCmdBindDescriptorSets)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkDescriptorSet *, uint32_t, const uint32_t *); - void (*p_vkCmdBindIndexBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkIndexType); - void (*p_vkCmdBindIndexBuffer2KHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, VkIndexType); - void (*p_vkCmdBindInvocationMaskHUAWEI)(VkCommandBuffer, VkImageView, VkImageLayout); - void (*p_vkCmdBindPipeline)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); - void (*p_vkCmdBindPipelineShaderGroupNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline, uint32_t); - void (*p_vkCmdBindShadersEXT)(VkCommandBuffer, uint32_t, const VkShaderStageFlagBits *, const VkShaderEXT *); - void (*p_vkCmdBindShadingRateImageNV)(VkCommandBuffer, VkImageView, VkImageLayout); - void (*p_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *); - void (*p_vkCmdBindVertexBuffers)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); - void (*p_vkCmdBindVertexBuffers2)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); - void (*p_vkCmdBindVertexBuffers2EXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); - void (*p_vkCmdBlitImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageBlit *, VkFilter); - void (*p_vkCmdBlitImage2)(VkCommandBuffer, const VkBlitImageInfo2 *); - void (*p_vkCmdBlitImage2KHR)(VkCommandBuffer, const VkBlitImageInfo2 *); - void (*p_vkCmdBuildAccelerationStructureNV)(VkCommandBuffer, const VkAccelerationStructureInfoNV *, VkBuffer, VkDeviceSize, VkBool32, VkAccelerationStructureNV, VkAccelerationStructureNV, VkBuffer, VkDeviceSize); - void (*p_vkCmdBuildAccelerationStructuresIndirectKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkDeviceAddress *, const uint32_t *, const uint32_t * const*); - void (*p_vkCmdBuildAccelerationStructuresKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); - void (*p_vkCmdBuildMicromapsEXT)(VkCommandBuffer, uint32_t, const VkMicromapBuildInfoEXT *); - void (*p_vkCmdClearAttachments)(VkCommandBuffer, uint32_t, const VkClearAttachment *, uint32_t, const VkClearRect *); - void (*p_vkCmdClearColorImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearColorValue *, uint32_t, const VkImageSubresourceRange *); - void (*p_vkCmdClearDepthStencilImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearDepthStencilValue *, uint32_t, const VkImageSubresourceRange *); - void (*p_vkCmdCopyAccelerationStructureKHR)(VkCommandBuffer, const VkCopyAccelerationStructureInfoKHR *); - void (*p_vkCmdCopyAccelerationStructureNV)(VkCommandBuffer, VkAccelerationStructureNV, VkAccelerationStructureNV, VkCopyAccelerationStructureModeKHR); - void (*p_vkCmdCopyAccelerationStructureToMemoryKHR)(VkCommandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *); - void (*p_vkCmdCopyBuffer)(VkCommandBuffer, VkBuffer, VkBuffer, uint32_t, const VkBufferCopy *); - void (*p_vkCmdCopyBuffer2)(VkCommandBuffer, const VkCopyBufferInfo2 *); - void (*p_vkCmdCopyBuffer2KHR)(VkCommandBuffer, const VkCopyBufferInfo2 *); - void (*p_vkCmdCopyBufferToImage)(VkCommandBuffer, VkBuffer, VkImage, VkImageLayout, uint32_t, const VkBufferImageCopy *); - void (*p_vkCmdCopyBufferToImage2)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); - void (*p_vkCmdCopyBufferToImage2KHR)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); - void (*p_vkCmdCopyImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageCopy *); - void (*p_vkCmdCopyImage2)(VkCommandBuffer, const VkCopyImageInfo2 *); - void (*p_vkCmdCopyImage2KHR)(VkCommandBuffer, const VkCopyImageInfo2 *); - void (*p_vkCmdCopyImageToBuffer)(VkCommandBuffer, VkImage, VkImageLayout, VkBuffer, uint32_t, const VkBufferImageCopy *); - void (*p_vkCmdCopyImageToBuffer2)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); - void (*p_vkCmdCopyImageToBuffer2KHR)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); - void (*p_vkCmdCopyMemoryIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t); - void (*p_vkCmdCopyMemoryToAccelerationStructureKHR)(VkCommandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *); - void (*p_vkCmdCopyMemoryToImageIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t, VkImage, VkImageLayout, const VkImageSubresourceLayers *); - void (*p_vkCmdCopyMemoryToMicromapEXT)(VkCommandBuffer, const VkCopyMemoryToMicromapInfoEXT *); - void (*p_vkCmdCopyMicromapEXT)(VkCommandBuffer, const VkCopyMicromapInfoEXT *); - void (*p_vkCmdCopyMicromapToMemoryEXT)(VkCommandBuffer, const VkCopyMicromapToMemoryInfoEXT *); - void (*p_vkCmdCopyQueryPoolResults)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t, VkBuffer, VkDeviceSize, VkDeviceSize, VkQueryResultFlags); - void (*p_vkCmdCuLaunchKernelNVX)(VkCommandBuffer, const VkCuLaunchInfoNVX *); - void (*p_vkCmdCudaLaunchKernelNV)(VkCommandBuffer, const VkCudaLaunchInfoNV *); - void (*p_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); - void (*p_vkCmdDebugMarkerEndEXT)(VkCommandBuffer); - void (*p_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); - void (*p_vkCmdDecompressMemoryIndirectCountNV)(VkCommandBuffer, VkDeviceAddress, VkDeviceAddress, uint32_t); - void (*p_vkCmdDecompressMemoryNV)(VkCommandBuffer, uint32_t, const VkDecompressMemoryRegionNV *); - void (*p_vkCmdDispatch)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDispatchBase)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDispatchBaseKHR)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDispatchIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize); - void (*p_vkCmdDraw)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDrawClusterHUAWEI)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer, VkBuffer, VkDeviceSize); - void (*p_vkCmdDrawIndexed)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); - void (*p_vkCmdDrawIndexedIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndexedIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndexedIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer, uint32_t, uint32_t, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksEXT)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksIndirectCountEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksIndirectCountNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksIndirectEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksIndirectNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); - void (*p_vkCmdDrawMeshTasksNV)(VkCommandBuffer, uint32_t, uint32_t); - void (*p_vkCmdDrawMultiEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawInfoEXT *, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdDrawMultiIndexedEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawIndexedInfoEXT *, uint32_t, uint32_t, uint32_t, const int32_t *); - void (*p_vkCmdEndConditionalRenderingEXT)(VkCommandBuffer); - void (*p_vkCmdEndDebugUtilsLabelEXT)(VkCommandBuffer); - void (*p_vkCmdEndQuery)(VkCommandBuffer, VkQueryPool, uint32_t); - void (*p_vkCmdEndQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); - void (*p_vkCmdEndRenderPass)(VkCommandBuffer); - void (*p_vkCmdEndRenderPass2)(VkCommandBuffer, const VkSubpassEndInfo *); - void (*p_vkCmdEndRenderPass2KHR)(VkCommandBuffer, const VkSubpassEndInfo *); - void (*p_vkCmdEndRendering)(VkCommandBuffer); - void (*p_vkCmdEndRenderingKHR)(VkCommandBuffer); - void (*p_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); - void (*p_vkCmdExecuteCommands)(VkCommandBuffer, uint32_t, const VkCommandBuffer *); - void (*p_vkCmdExecuteGeneratedCommandsNV)(VkCommandBuffer, VkBool32, const VkGeneratedCommandsInfoNV *); - void (*p_vkCmdFillBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t); - void (*p_vkCmdInsertDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); - void (*p_vkCmdNextSubpass)(VkCommandBuffer, VkSubpassContents); - void (*p_vkCmdNextSubpass2)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); - void (*p_vkCmdNextSubpass2KHR)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); - void (*p_vkCmdOpticalFlowExecuteNV)(VkCommandBuffer, VkOpticalFlowSessionNV, const VkOpticalFlowExecuteInfoNV *); - void (*p_vkCmdPipelineBarrier)(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); - void (*p_vkCmdPipelineBarrier2)(VkCommandBuffer, const VkDependencyInfo *); - void (*p_vkCmdPipelineBarrier2KHR)(VkCommandBuffer, const VkDependencyInfo *); - void (*p_vkCmdPreprocessGeneratedCommandsNV)(VkCommandBuffer, const VkGeneratedCommandsInfoNV *); - void (*p_vkCmdPushConstants)(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, uint32_t, uint32_t, const void *); - void (*p_vkCmdPushDescriptorSetKHR)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet *); - void (*p_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer, VkDescriptorUpdateTemplate, VkPipelineLayout, uint32_t, const void *); - void (*p_vkCmdResetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); - void (*p_vkCmdResetEvent2)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); - void (*p_vkCmdResetEvent2KHR)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); - void (*p_vkCmdResetQueryPool)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); - void (*p_vkCmdResolveImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageResolve *); - void (*p_vkCmdResolveImage2)(VkCommandBuffer, const VkResolveImageInfo2 *); - void (*p_vkCmdResolveImage2KHR)(VkCommandBuffer, const VkResolveImageInfo2 *); - void (*p_vkCmdSetAlphaToCoverageEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetAlphaToOneEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetAttachmentFeedbackLoopEnableEXT)(VkCommandBuffer, VkImageAspectFlags); - void (*p_vkCmdSetBlendConstants)(VkCommandBuffer, const float[4]); - void (*p_vkCmdSetCheckpointNV)(VkCommandBuffer, const void *); - void (*p_vkCmdSetCoarseSampleOrderNV)(VkCommandBuffer, VkCoarseSampleOrderTypeNV, uint32_t, const VkCoarseSampleOrderCustomNV *); - void (*p_vkCmdSetColorBlendAdvancedEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendAdvancedEXT *); - void (*p_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); - void (*p_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendEquationEXT *); - void (*p_vkCmdSetColorWriteEnableEXT)(VkCommandBuffer, uint32_t, const VkBool32 *); - void (*p_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorComponentFlags *); - void (*p_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer, VkConservativeRasterizationModeEXT); - void (*p_vkCmdSetCoverageModulationModeNV)(VkCommandBuffer, VkCoverageModulationModeNV); - void (*p_vkCmdSetCoverageModulationTableEnableNV)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetCoverageModulationTableNV)(VkCommandBuffer, uint32_t, const float *); - void (*p_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer, VkCoverageReductionModeNV); - void (*p_vkCmdSetCoverageToColorEnableNV)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetCoverageToColorLocationNV)(VkCommandBuffer, uint32_t); - void (*p_vkCmdSetCullMode)(VkCommandBuffer, VkCullModeFlags); - void (*p_vkCmdSetCullModeEXT)(VkCommandBuffer, VkCullModeFlags); - void (*p_vkCmdSetDepthBias)(VkCommandBuffer, float, float, float); - void (*p_vkCmdSetDepthBias2EXT)(VkCommandBuffer, const VkDepthBiasInfoEXT *); - void (*p_vkCmdSetDepthBiasEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthBiasEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthBounds)(VkCommandBuffer, float, float); - void (*p_vkCmdSetDepthBoundsTestEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthBoundsTestEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthClipEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthClipNegativeOneToOneEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthCompareOp)(VkCommandBuffer, VkCompareOp); - void (*p_vkCmdSetDepthCompareOpEXT)(VkCommandBuffer, VkCompareOp); - void (*p_vkCmdSetDepthTestEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthTestEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthWriteEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDepthWriteEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDescriptorBufferOffsetsEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const uint32_t *, const VkDeviceSize *); - void (*p_vkCmdSetDeviceMask)(VkCommandBuffer, uint32_t); - void (*p_vkCmdSetDeviceMaskKHR)(VkCommandBuffer, uint32_t); - void (*p_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); - void (*p_vkCmdSetDiscardRectangleEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetDiscardRectangleModeEXT)(VkCommandBuffer, VkDiscardRectangleModeEXT); - void (*p_vkCmdSetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); - void (*p_vkCmdSetEvent2)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); - void (*p_vkCmdSetEvent2KHR)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); - void (*p_vkCmdSetExclusiveScissorEnableNV)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); - void (*p_vkCmdSetExclusiveScissorNV)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); - void (*p_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer, float); - void (*p_vkCmdSetFragmentShadingRateEnumNV)(VkCommandBuffer, VkFragmentShadingRateNV, const VkFragmentShadingRateCombinerOpKHR[2]); - void (*p_vkCmdSetFragmentShadingRateKHR)(VkCommandBuffer, const VkExtent2D *, const VkFragmentShadingRateCombinerOpKHR[2]); - void (*p_vkCmdSetFrontFace)(VkCommandBuffer, VkFrontFace); - void (*p_vkCmdSetFrontFaceEXT)(VkCommandBuffer, VkFrontFace); - void (*p_vkCmdSetLineRasterizationModeEXT)(VkCommandBuffer, VkLineRasterizationModeEXT); - void (*p_vkCmdSetLineStippleEXT)(VkCommandBuffer, uint32_t, uint16_t); - void (*p_vkCmdSetLineStippleEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetLineWidth)(VkCommandBuffer, float); - void (*p_vkCmdSetLogicOpEXT)(VkCommandBuffer, VkLogicOp); - void (*p_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetPatchControlPointsEXT)(VkCommandBuffer, uint32_t); - VkResult (*p_vkCmdSetPerformanceMarkerINTEL)(VkCommandBuffer, const VkPerformanceMarkerInfoINTEL *); - VkResult (*p_vkCmdSetPerformanceOverrideINTEL)(VkCommandBuffer, const VkPerformanceOverrideInfoINTEL *); - VkResult (*p_vkCmdSetPerformanceStreamMarkerINTEL)(VkCommandBuffer, const VkPerformanceStreamMarkerInfoINTEL *); - void (*p_vkCmdSetPolygonModeEXT)(VkCommandBuffer, VkPolygonMode); - void (*p_vkCmdSetPrimitiveRestartEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetPrimitiveRestartEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetPrimitiveTopology)(VkCommandBuffer, VkPrimitiveTopology); - void (*p_vkCmdSetPrimitiveTopologyEXT)(VkCommandBuffer, VkPrimitiveTopology); - void (*p_vkCmdSetProvokingVertexModeEXT)(VkCommandBuffer, VkProvokingVertexModeEXT); - void (*p_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer, VkSampleCountFlagBits); - void (*p_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer, uint32_t); - void (*p_vkCmdSetRasterizerDiscardEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetRasterizerDiscardEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetRayTracingPipelineStackSizeKHR)(VkCommandBuffer, uint32_t); - void (*p_vkCmdSetRepresentativeFragmentTestEnableNV)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetSampleLocationsEXT)(VkCommandBuffer, const VkSampleLocationsInfoEXT *); - void (*p_vkCmdSetSampleLocationsEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetSampleMaskEXT)(VkCommandBuffer, VkSampleCountFlagBits, const VkSampleMask *); - void (*p_vkCmdSetScissor)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); - void (*p_vkCmdSetScissorWithCount)(VkCommandBuffer, uint32_t, const VkRect2D *); - void (*p_vkCmdSetScissorWithCountEXT)(VkCommandBuffer, uint32_t, const VkRect2D *); - void (*p_vkCmdSetShadingRateImageEnableNV)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetStencilCompareMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); - void (*p_vkCmdSetStencilOp)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); - void (*p_vkCmdSetStencilOpEXT)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); - void (*p_vkCmdSetStencilReference)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); - void (*p_vkCmdSetStencilTestEnable)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetStencilTestEnableEXT)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetStencilWriteMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); - void (*p_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer, VkTessellationDomainOrigin); - void (*p_vkCmdSetVertexInputEXT)(VkCommandBuffer, uint32_t, const VkVertexInputBindingDescription2EXT *, uint32_t, const VkVertexInputAttributeDescription2EXT *); - void (*p_vkCmdSetViewport)(VkCommandBuffer, uint32_t, uint32_t, const VkViewport *); - void (*p_vkCmdSetViewportShadingRatePaletteNV)(VkCommandBuffer, uint32_t, uint32_t, const VkShadingRatePaletteNV *); - void (*p_vkCmdSetViewportSwizzleNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportSwizzleNV *); - void (*p_vkCmdSetViewportWScalingEnableNV)(VkCommandBuffer, VkBool32); - void (*p_vkCmdSetViewportWScalingNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportWScalingNV *); - void (*p_vkCmdSetViewportWithCount)(VkCommandBuffer, uint32_t, const VkViewport *); - void (*p_vkCmdSetViewportWithCountEXT)(VkCommandBuffer, uint32_t, const VkViewport *); - void (*p_vkCmdSubpassShadingHUAWEI)(VkCommandBuffer); - void (*p_vkCmdTraceRaysIndirect2KHR)(VkCommandBuffer, VkDeviceAddress); - void (*p_vkCmdTraceRaysIndirectKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, VkDeviceAddress); - void (*p_vkCmdTraceRaysKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdTraceRaysNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t, uint32_t, uint32_t); - void (*p_vkCmdUpdateBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, const void *); - void (*p_vkCmdUpdatePipelineIndirectBufferNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); - void (*p_vkCmdWaitEvents)(VkCommandBuffer, uint32_t, const VkEvent *, VkPipelineStageFlags, VkPipelineStageFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); - void (*p_vkCmdWaitEvents2)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); - void (*p_vkCmdWaitEvents2KHR)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); - void (*p_vkCmdWriteAccelerationStructuresPropertiesKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, VkQueryPool, uint32_t); - void (*p_vkCmdWriteAccelerationStructuresPropertiesNV)(VkCommandBuffer, uint32_t, const VkAccelerationStructureNV *, VkQueryType, VkQueryPool, uint32_t); - void (*p_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer, VkPipelineStageFlags2, VkBuffer, VkDeviceSize, uint32_t); - void (*p_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer, VkPipelineStageFlagBits, VkBuffer, VkDeviceSize, uint32_t); - void (*p_vkCmdWriteMicromapsPropertiesEXT)(VkCommandBuffer, uint32_t, const VkMicromapEXT *, VkQueryType, VkQueryPool, uint32_t); - void (*p_vkCmdWriteTimestamp)(VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool, uint32_t); - void (*p_vkCmdWriteTimestamp2)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); - void (*p_vkCmdWriteTimestamp2KHR)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); - VkResult (*p_vkCompileDeferredNV)(VkDevice, VkPipeline, uint32_t); - VkResult (*p_vkCopyAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureInfoKHR *); - VkResult (*p_vkCopyAccelerationStructureToMemoryKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureToMemoryInfoKHR *); - VkResult (*p_vkCopyImageToImageEXT)(VkDevice, const VkCopyImageToImageInfoEXT *); - VkResult (*p_vkCopyImageToMemoryEXT)(VkDevice, const VkCopyImageToMemoryInfoEXT *); - VkResult (*p_vkCopyMemoryToAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToAccelerationStructureInfoKHR *); - VkResult (*p_vkCopyMemoryToImageEXT)(VkDevice, const VkCopyMemoryToImageInfoEXT *); - VkResult (*p_vkCopyMemoryToMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToMicromapInfoEXT *); - VkResult (*p_vkCopyMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapInfoEXT *); - VkResult (*p_vkCopyMicromapToMemoryEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapToMemoryInfoEXT *); - VkResult (*p_vkCreateAccelerationStructureKHR)(VkDevice, const VkAccelerationStructureCreateInfoKHR *, const VkAllocationCallbacks *, VkAccelerationStructureKHR *); - VkResult (*p_vkCreateAccelerationStructureNV)(VkDevice, const VkAccelerationStructureCreateInfoNV *, const VkAllocationCallbacks *, VkAccelerationStructureNV *); - VkResult (*p_vkCreateBuffer)(VkDevice, const VkBufferCreateInfo *, const VkAllocationCallbacks *, VkBuffer *); - VkResult (*p_vkCreateBufferView)(VkDevice, const VkBufferViewCreateInfo *, const VkAllocationCallbacks *, VkBufferView *); - VkResult (*p_vkCreateCommandPool)(VkDevice, const VkCommandPoolCreateInfo *, const VkAllocationCallbacks *, VkCommandPool *); - VkResult (*p_vkCreateComputePipelines)(VkDevice, VkPipelineCache, uint32_t, const VkComputePipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); - VkResult (*p_vkCreateCuFunctionNVX)(VkDevice, const VkCuFunctionCreateInfoNVX *, const VkAllocationCallbacks *, VkCuFunctionNVX *); - VkResult (*p_vkCreateCuModuleNVX)(VkDevice, const VkCuModuleCreateInfoNVX *, const VkAllocationCallbacks *, VkCuModuleNVX *); - VkResult (*p_vkCreateCudaFunctionNV)(VkDevice, const VkCudaFunctionCreateInfoNV *, const VkAllocationCallbacks *, VkCudaFunctionNV *); - VkResult (*p_vkCreateCudaModuleNV)(VkDevice, const VkCudaModuleCreateInfoNV *, const VkAllocationCallbacks *, VkCudaModuleNV *); - VkResult (*p_vkCreateDeferredOperationKHR)(VkDevice, const VkAllocationCallbacks *, VkDeferredOperationKHR *); - VkResult (*p_vkCreateDescriptorPool)(VkDevice, const VkDescriptorPoolCreateInfo *, const VkAllocationCallbacks *, VkDescriptorPool *); - VkResult (*p_vkCreateDescriptorSetLayout)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, const VkAllocationCallbacks *, VkDescriptorSetLayout *); - VkResult (*p_vkCreateDescriptorUpdateTemplate)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); - VkResult (*p_vkCreateDescriptorUpdateTemplateKHR)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); - VkResult (*p_vkCreateEvent)(VkDevice, const VkEventCreateInfo *, const VkAllocationCallbacks *, VkEvent *); - VkResult (*p_vkCreateFence)(VkDevice, const VkFenceCreateInfo *, const VkAllocationCallbacks *, VkFence *); - VkResult (*p_vkCreateFramebuffer)(VkDevice, const VkFramebufferCreateInfo *, const VkAllocationCallbacks *, VkFramebuffer *); - VkResult (*p_vkCreateGraphicsPipelines)(VkDevice, VkPipelineCache, uint32_t, const VkGraphicsPipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); - VkResult (*p_vkCreateImage)(VkDevice, const VkImageCreateInfo *, const VkAllocationCallbacks *, VkImage *); - VkResult (*p_vkCreateImageView)(VkDevice, const VkImageViewCreateInfo *, const VkAllocationCallbacks *, VkImageView *); - VkResult (*p_vkCreateIndirectCommandsLayoutNV)(VkDevice, const VkIndirectCommandsLayoutCreateInfoNV *, const VkAllocationCallbacks *, VkIndirectCommandsLayoutNV *); - VkResult (*p_vkCreateMicromapEXT)(VkDevice, const VkMicromapCreateInfoEXT *, const VkAllocationCallbacks *, VkMicromapEXT *); - VkResult (*p_vkCreateOpticalFlowSessionNV)(VkDevice, const VkOpticalFlowSessionCreateInfoNV *, const VkAllocationCallbacks *, VkOpticalFlowSessionNV *); - VkResult (*p_vkCreatePipelineCache)(VkDevice, const VkPipelineCacheCreateInfo *, const VkAllocationCallbacks *, VkPipelineCache *); - VkResult (*p_vkCreatePipelineLayout)(VkDevice, const VkPipelineLayoutCreateInfo *, const VkAllocationCallbacks *, VkPipelineLayout *); - VkResult (*p_vkCreatePrivateDataSlot)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); - VkResult (*p_vkCreatePrivateDataSlotEXT)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); - VkResult (*p_vkCreateQueryPool)(VkDevice, const VkQueryPoolCreateInfo *, const VkAllocationCallbacks *, VkQueryPool *); - VkResult (*p_vkCreateRayTracingPipelinesKHR)(VkDevice, VkDeferredOperationKHR, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoKHR *, const VkAllocationCallbacks *, VkPipeline *); - VkResult (*p_vkCreateRayTracingPipelinesNV)(VkDevice, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoNV *, const VkAllocationCallbacks *, VkPipeline *); - VkResult (*p_vkCreateRenderPass)(VkDevice, const VkRenderPassCreateInfo *, const VkAllocationCallbacks *, VkRenderPass *); - VkResult (*p_vkCreateRenderPass2)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); - VkResult (*p_vkCreateRenderPass2KHR)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); - VkResult (*p_vkCreateSampler)(VkDevice, const VkSamplerCreateInfo *, const VkAllocationCallbacks *, VkSampler *); - VkResult (*p_vkCreateSamplerYcbcrConversion)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); - VkResult (*p_vkCreateSamplerYcbcrConversionKHR)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); - VkResult (*p_vkCreateSemaphore)(VkDevice, const VkSemaphoreCreateInfo *, const VkAllocationCallbacks *, VkSemaphore *); - VkResult (*p_vkCreateShaderModule)(VkDevice, const VkShaderModuleCreateInfo *, const VkAllocationCallbacks *, VkShaderModule *); - VkResult (*p_vkCreateShadersEXT)(VkDevice, uint32_t, const VkShaderCreateInfoEXT *, const VkAllocationCallbacks *, VkShaderEXT *); - VkResult (*p_vkCreateSwapchainKHR)(VkDevice, const VkSwapchainCreateInfoKHR *, const VkAllocationCallbacks *, VkSwapchainKHR *); - VkResult (*p_vkCreateValidationCacheEXT)(VkDevice, const VkValidationCacheCreateInfoEXT *, const VkAllocationCallbacks *, VkValidationCacheEXT *); - VkResult (*p_vkDebugMarkerSetObjectNameEXT)(VkDevice, const VkDebugMarkerObjectNameInfoEXT *); - VkResult (*p_vkDebugMarkerSetObjectTagEXT)(VkDevice, const VkDebugMarkerObjectTagInfoEXT *); - VkResult (*p_vkDeferredOperationJoinKHR)(VkDevice, VkDeferredOperationKHR); - void (*p_vkDestroyAccelerationStructureKHR)(VkDevice, VkAccelerationStructureKHR, const VkAllocationCallbacks *); - void (*p_vkDestroyAccelerationStructureNV)(VkDevice, VkAccelerationStructureNV, const VkAllocationCallbacks *); - void (*p_vkDestroyBuffer)(VkDevice, VkBuffer, const VkAllocationCallbacks *); - void (*p_vkDestroyBufferView)(VkDevice, VkBufferView, const VkAllocationCallbacks *); - void (*p_vkDestroyCommandPool)(VkDevice, VkCommandPool, const VkAllocationCallbacks *); - void (*p_vkDestroyCuFunctionNVX)(VkDevice, VkCuFunctionNVX, const VkAllocationCallbacks *); - void (*p_vkDestroyCuModuleNVX)(VkDevice, VkCuModuleNVX, const VkAllocationCallbacks *); - void (*p_vkDestroyCudaFunctionNV)(VkDevice, VkCudaFunctionNV, const VkAllocationCallbacks *); - void (*p_vkDestroyCudaModuleNV)(VkDevice, VkCudaModuleNV, const VkAllocationCallbacks *); - void (*p_vkDestroyDeferredOperationKHR)(VkDevice, VkDeferredOperationKHR, const VkAllocationCallbacks *); - void (*p_vkDestroyDescriptorPool)(VkDevice, VkDescriptorPool, const VkAllocationCallbacks *); - void (*p_vkDestroyDescriptorSetLayout)(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks *); - void (*p_vkDestroyDescriptorUpdateTemplate)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); - void (*p_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); - void (*p_vkDestroyDevice)(VkDevice, const VkAllocationCallbacks *); - void (*p_vkDestroyEvent)(VkDevice, VkEvent, const VkAllocationCallbacks *); - void (*p_vkDestroyFence)(VkDevice, VkFence, const VkAllocationCallbacks *); - void (*p_vkDestroyFramebuffer)(VkDevice, VkFramebuffer, const VkAllocationCallbacks *); - void (*p_vkDestroyImage)(VkDevice, VkImage, const VkAllocationCallbacks *); - void (*p_vkDestroyImageView)(VkDevice, VkImageView, const VkAllocationCallbacks *); - void (*p_vkDestroyIndirectCommandsLayoutNV)(VkDevice, VkIndirectCommandsLayoutNV, const VkAllocationCallbacks *); - void (*p_vkDestroyMicromapEXT)(VkDevice, VkMicromapEXT, const VkAllocationCallbacks *); - void (*p_vkDestroyOpticalFlowSessionNV)(VkDevice, VkOpticalFlowSessionNV, const VkAllocationCallbacks *); - void (*p_vkDestroyPipeline)(VkDevice, VkPipeline, const VkAllocationCallbacks *); - void (*p_vkDestroyPipelineCache)(VkDevice, VkPipelineCache, const VkAllocationCallbacks *); - void (*p_vkDestroyPipelineLayout)(VkDevice, VkPipelineLayout, const VkAllocationCallbacks *); - void (*p_vkDestroyPrivateDataSlot)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); - void (*p_vkDestroyPrivateDataSlotEXT)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); - void (*p_vkDestroyQueryPool)(VkDevice, VkQueryPool, const VkAllocationCallbacks *); - void (*p_vkDestroyRenderPass)(VkDevice, VkRenderPass, const VkAllocationCallbacks *); - void (*p_vkDestroySampler)(VkDevice, VkSampler, const VkAllocationCallbacks *); - void (*p_vkDestroySamplerYcbcrConversion)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); - void (*p_vkDestroySamplerYcbcrConversionKHR)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); - void (*p_vkDestroySemaphore)(VkDevice, VkSemaphore, const VkAllocationCallbacks *); - void (*p_vkDestroyShaderEXT)(VkDevice, VkShaderEXT, const VkAllocationCallbacks *); - void (*p_vkDestroyShaderModule)(VkDevice, VkShaderModule, const VkAllocationCallbacks *); - void (*p_vkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); - void (*p_vkDestroyValidationCacheEXT)(VkDevice, VkValidationCacheEXT, const VkAllocationCallbacks *); - VkResult (*p_vkDeviceWaitIdle)(VkDevice); - VkResult (*p_vkEndCommandBuffer)(VkCommandBuffer); - VkResult (*p_vkFlushMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); - void (*p_vkFreeCommandBuffers)(VkDevice, VkCommandPool, uint32_t, const VkCommandBuffer *); - VkResult (*p_vkFreeDescriptorSets)(VkDevice, VkDescriptorPool, uint32_t, const VkDescriptorSet *); - void (*p_vkFreeMemory)(VkDevice, VkDeviceMemory, const VkAllocationCallbacks *); - void (*p_vkGetAccelerationStructureBuildSizesKHR)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkAccelerationStructureBuildGeometryInfoKHR *, const uint32_t *, VkAccelerationStructureBuildSizesInfoKHR *); - VkDeviceAddress (*p_vkGetAccelerationStructureDeviceAddressKHR)(VkDevice, const VkAccelerationStructureDeviceAddressInfoKHR *); - VkResult (*p_vkGetAccelerationStructureHandleNV)(VkDevice, VkAccelerationStructureNV, size_t, void *); - void (*p_vkGetAccelerationStructureMemoryRequirementsNV)(VkDevice, const VkAccelerationStructureMemoryRequirementsInfoNV *, VkMemoryRequirements2KHR *); - VkResult (*p_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *, void *); - VkDeviceAddress (*p_vkGetBufferDeviceAddress)(VkDevice, const VkBufferDeviceAddressInfo *); - VkDeviceAddress (*p_vkGetBufferDeviceAddressEXT)(VkDevice, const VkBufferDeviceAddressInfo *); - VkDeviceAddress (*p_vkGetBufferDeviceAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); - void (*p_vkGetBufferMemoryRequirements)(VkDevice, VkBuffer, VkMemoryRequirements *); - void (*p_vkGetBufferMemoryRequirements2)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); - void (*p_vkGetBufferMemoryRequirements2KHR)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); - uint64_t (*p_vkGetBufferOpaqueCaptureAddress)(VkDevice, const VkBufferDeviceAddressInfo *); - uint64_t (*p_vkGetBufferOpaqueCaptureAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); - VkResult (*p_vkGetBufferOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkBufferCaptureDescriptorDataInfoEXT *, void *); - VkResult (*p_vkGetCalibratedTimestampsEXT)(VkDevice, uint32_t, const VkCalibratedTimestampInfoEXT *, uint64_t *, uint64_t *); - VkResult (*p_vkGetCudaModuleCacheNV)(VkDevice, VkCudaModuleNV, size_t *, void *); - uint32_t (*p_vkGetDeferredOperationMaxConcurrencyKHR)(VkDevice, VkDeferredOperationKHR); - VkResult (*p_vkGetDeferredOperationResultKHR)(VkDevice, VkDeferredOperationKHR); - void (*p_vkGetDescriptorEXT)(VkDevice, const VkDescriptorGetInfoEXT *, size_t, void *); - void (*p_vkGetDescriptorSetHostMappingVALVE)(VkDevice, VkDescriptorSet, void **); - void (*p_vkGetDescriptorSetLayoutBindingOffsetEXT)(VkDevice, VkDescriptorSetLayout, uint32_t, VkDeviceSize *); - void (*p_vkGetDescriptorSetLayoutHostMappingInfoVALVE)(VkDevice, const VkDescriptorSetBindingReferenceVALVE *, VkDescriptorSetLayoutHostMappingInfoVALVE *); - void (*p_vkGetDescriptorSetLayoutSizeEXT)(VkDevice, VkDescriptorSetLayout, VkDeviceSize *); - void (*p_vkGetDescriptorSetLayoutSupport)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); - void (*p_vkGetDescriptorSetLayoutSupportKHR)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); - void (*p_vkGetDeviceAccelerationStructureCompatibilityKHR)(VkDevice, const VkAccelerationStructureVersionInfoKHR *, VkAccelerationStructureCompatibilityKHR *); - void (*p_vkGetDeviceBufferMemoryRequirements)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); - void (*p_vkGetDeviceBufferMemoryRequirementsKHR)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); - VkResult (*p_vkGetDeviceFaultInfoEXT)(VkDevice, VkDeviceFaultCountsEXT *, VkDeviceFaultInfoEXT *); - void (*p_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); - void (*p_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); - VkResult (*p_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice, VkDeviceGroupPresentCapabilitiesKHR *); - VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); - void (*p_vkGetDeviceImageMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); - void (*p_vkGetDeviceImageMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); - void (*p_vkGetDeviceImageSparseMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); - void (*p_vkGetDeviceImageSparseMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); - void (*p_vkGetDeviceImageSubresourceLayoutKHR)(VkDevice, const VkDeviceImageSubresourceInfoKHR *, VkSubresourceLayout2KHR *); - void (*p_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *); - uint64_t (*p_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); - uint64_t (*p_vkGetDeviceMemoryOpaqueCaptureAddressKHR)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); - void (*p_vkGetDeviceMicromapCompatibilityEXT)(VkDevice, const VkMicromapVersionInfoEXT *, VkAccelerationStructureCompatibilityKHR *); - void (*p_vkGetDeviceQueue)(VkDevice, uint32_t, uint32_t, VkQueue *); - void (*p_vkGetDeviceQueue2)(VkDevice, const VkDeviceQueueInfo2 *, VkQueue *); - VkResult (*p_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI)(VkDevice, VkRenderPass, VkExtent2D *); - VkResult (*p_vkGetDynamicRenderingTilePropertiesQCOM)(VkDevice, const VkRenderingInfo *, VkTilePropertiesQCOM *); - VkResult (*p_vkGetEventStatus)(VkDevice, VkEvent); - VkResult (*p_vkGetFenceStatus)(VkDevice, VkFence); - VkResult (*p_vkGetFramebufferTilePropertiesQCOM)(VkDevice, VkFramebuffer, uint32_t *, VkTilePropertiesQCOM *); - void (*p_vkGetGeneratedCommandsMemoryRequirementsNV)(VkDevice, const VkGeneratedCommandsMemoryRequirementsInfoNV *, VkMemoryRequirements2 *); - void (*p_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *); - void (*p_vkGetImageMemoryRequirements2)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); - void (*p_vkGetImageMemoryRequirements2KHR)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); - VkResult (*p_vkGetImageOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageCaptureDescriptorDataInfoEXT *, void *); - void (*p_vkGetImageSparseMemoryRequirements)(VkDevice, VkImage, uint32_t *, VkSparseImageMemoryRequirements *); - void (*p_vkGetImageSparseMemoryRequirements2)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); - void (*p_vkGetImageSparseMemoryRequirements2KHR)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); - void (*p_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *); - void (*p_vkGetImageSubresourceLayout2EXT)(VkDevice, VkImage, const VkImageSubresource2KHR *, VkSubresourceLayout2KHR *); - void (*p_vkGetImageSubresourceLayout2KHR)(VkDevice, VkImage, const VkImageSubresource2KHR *, VkSubresourceLayout2KHR *); - VkResult (*p_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *); - uint32_t (*p_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *); - VkResult (*p_vkGetImageViewOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageViewCaptureDescriptorDataInfoEXT *, void *); - void (*p_vkGetLatencyTimingsNV)(VkDevice, VkSwapchainKHR, VkGetLatencyMarkerInfoNV *); - VkResult (*p_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *); - void (*p_vkGetMicromapBuildSizesEXT)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkMicromapBuildInfoEXT *, VkMicromapBuildSizesInfoEXT *); - VkResult (*p_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *); - VkResult (*p_vkGetPipelineCacheData)(VkDevice, VkPipelineCache, size_t *, void *); - VkResult (*p_vkGetPipelineExecutableInternalRepresentationsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableInternalRepresentationKHR *); - VkResult (*p_vkGetPipelineExecutablePropertiesKHR)(VkDevice, const VkPipelineInfoKHR *, uint32_t *, VkPipelineExecutablePropertiesKHR *); - VkResult (*p_vkGetPipelineExecutableStatisticsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableStatisticKHR *); - VkDeviceAddress (*p_vkGetPipelineIndirectDeviceAddressNV)(VkDevice, const VkPipelineIndirectDeviceAddressInfoNV *); - void (*p_vkGetPipelineIndirectMemoryRequirementsNV)(VkDevice, const VkComputePipelineCreateInfo *, VkMemoryRequirements2 *); - VkResult (*p_vkGetPipelinePropertiesEXT)(VkDevice, const VkPipelineInfoEXT *, VkBaseOutStructure *); - void (*p_vkGetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); - void (*p_vkGetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); - VkResult (*p_vkGetQueryPoolResults)(VkDevice, VkQueryPool, uint32_t, uint32_t, size_t, void *, VkDeviceSize, VkQueryResultFlags); - void (*p_vkGetQueueCheckpointData2NV)(VkQueue, uint32_t *, VkCheckpointData2NV *); - void (*p_vkGetQueueCheckpointDataNV)(VkQueue, uint32_t *, VkCheckpointDataNV *); - VkResult (*p_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); - VkResult (*p_vkGetRayTracingShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); - VkResult (*p_vkGetRayTracingShaderGroupHandlesNV)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); - VkDeviceSize (*p_vkGetRayTracingShaderGroupStackSizeKHR)(VkDevice, VkPipeline, uint32_t, VkShaderGroupShaderKHR); - void (*p_vkGetRenderAreaGranularity)(VkDevice, VkRenderPass, VkExtent2D *); - void (*p_vkGetRenderingAreaGranularityKHR)(VkDevice, const VkRenderingAreaInfoKHR *, VkExtent2D *); - VkResult (*p_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkSamplerCaptureDescriptorDataInfoEXT *, void *); - VkResult (*p_vkGetSemaphoreCounterValue)(VkDevice, VkSemaphore, uint64_t *); - VkResult (*p_vkGetSemaphoreCounterValueKHR)(VkDevice, VkSemaphore, uint64_t *); - VkResult (*p_vkGetShaderBinaryDataEXT)(VkDevice, VkShaderEXT, size_t *, void *); - VkResult (*p_vkGetShaderInfoAMD)(VkDevice, VkPipeline, VkShaderStageFlagBits, VkShaderInfoTypeAMD, size_t *, void *); - void (*p_vkGetShaderModuleCreateInfoIdentifierEXT)(VkDevice, const VkShaderModuleCreateInfo *, VkShaderModuleIdentifierEXT *); - void (*p_vkGetShaderModuleIdentifierEXT)(VkDevice, VkShaderModule, VkShaderModuleIdentifierEXT *); - VkResult (*p_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); - VkResult (*p_vkGetValidationCacheDataEXT)(VkDevice, VkValidationCacheEXT, size_t *, void *); - VkResult (*p_vkInitializePerformanceApiINTEL)(VkDevice, const VkInitializePerformanceApiInfoINTEL *); - VkResult (*p_vkInvalidateMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); - VkResult (*p_vkLatencySleepNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepInfoNV *); - VkResult (*p_vkMapMemory)(VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void **); - VkResult (*p_vkMapMemory2KHR)(VkDevice, const VkMemoryMapInfoKHR *, void **); - VkResult (*p_vkMergePipelineCaches)(VkDevice, VkPipelineCache, uint32_t, const VkPipelineCache *); - VkResult (*p_vkMergeValidationCachesEXT)(VkDevice, VkValidationCacheEXT, uint32_t, const VkValidationCacheEXT *); - void (*p_vkQueueBeginDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); - VkResult (*p_vkQueueBindSparse)(VkQueue, uint32_t, const VkBindSparseInfo *, VkFence); - void (*p_vkQueueEndDebugUtilsLabelEXT)(VkQueue); - void (*p_vkQueueInsertDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); - void (*p_vkQueueNotifyOutOfBandNV)(VkQueue, const VkOutOfBandQueueTypeInfoNV *); - VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); - VkResult (*p_vkQueueSetPerformanceConfigurationINTEL)(VkQueue, VkPerformanceConfigurationINTEL); - VkResult (*p_vkQueueSubmit)(VkQueue, uint32_t, const VkSubmitInfo *, VkFence); - VkResult (*p_vkQueueSubmit2)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); - VkResult (*p_vkQueueSubmit2KHR)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); - VkResult (*p_vkQueueWaitIdle)(VkQueue); - VkResult (*p_vkReleasePerformanceConfigurationINTEL)(VkDevice, VkPerformanceConfigurationINTEL); - void (*p_vkReleaseProfilingLockKHR)(VkDevice); - VkResult (*p_vkReleaseSwapchainImagesEXT)(VkDevice, const VkReleaseSwapchainImagesInfoEXT *); - VkResult (*p_vkResetCommandBuffer)(VkCommandBuffer, VkCommandBufferResetFlags); - VkResult (*p_vkResetCommandPool)(VkDevice, VkCommandPool, VkCommandPoolResetFlags); - VkResult (*p_vkResetDescriptorPool)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags); - VkResult (*p_vkResetEvent)(VkDevice, VkEvent); - VkResult (*p_vkResetFences)(VkDevice, uint32_t, const VkFence *); - void (*p_vkResetQueryPool)(VkDevice, VkQueryPool, uint32_t, uint32_t); - void (*p_vkResetQueryPoolEXT)(VkDevice, VkQueryPool, uint32_t, uint32_t); - VkResult (*p_vkSetDebugUtilsObjectNameEXT)(VkDevice, const VkDebugUtilsObjectNameInfoEXT *); - VkResult (*p_vkSetDebugUtilsObjectTagEXT)(VkDevice, const VkDebugUtilsObjectTagInfoEXT *); - void (*p_vkSetDeviceMemoryPriorityEXT)(VkDevice, VkDeviceMemory, float); - VkResult (*p_vkSetEvent)(VkDevice, VkEvent); - void (*p_vkSetHdrMetadataEXT)(VkDevice, uint32_t, const VkSwapchainKHR *, const VkHdrMetadataEXT *); - void (*p_vkSetLatencyMarkerNV)(VkDevice, VkSwapchainKHR, const VkSetLatencyMarkerInfoNV *); - VkResult (*p_vkSetLatencySleepModeNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepModeInfoNV *); - VkResult (*p_vkSetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); - VkResult (*p_vkSetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); - VkResult (*p_vkSignalSemaphore)(VkDevice, const VkSemaphoreSignalInfo *); - VkResult (*p_vkSignalSemaphoreKHR)(VkDevice, const VkSemaphoreSignalInfo *); - VkResult (*p_vkTransitionImageLayoutEXT)(VkDevice, uint32_t, const VkHostImageLayoutTransitionInfoEXT *); - void (*p_vkTrimCommandPool)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); - void (*p_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); - void (*p_vkUninitializePerformanceApiINTEL)(VkDevice); - void (*p_vkUnmapMemory)(VkDevice, VkDeviceMemory); - VkResult (*p_vkUnmapMemory2KHR)(VkDevice, const VkMemoryUnmapInfoKHR *); - void (*p_vkUpdateDescriptorSetWithTemplate)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); - void (*p_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); - void (*p_vkUpdateDescriptorSets)(VkDevice, uint32_t, const VkWriteDescriptorSet *, uint32_t, const VkCopyDescriptorSet *); - VkResult (*p_vkWaitForFences)(VkDevice, uint32_t, const VkFence *, VkBool32, uint64_t); - VkResult (*p_vkWaitForPresentKHR)(VkDevice, VkSwapchainKHR, uint64_t, uint64_t); - VkResult (*p_vkWaitSemaphores)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); - VkResult (*p_vkWaitSemaphoresKHR)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); - VkResult (*p_vkWriteAccelerationStructuresPropertiesKHR)(VkDevice, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, size_t, void *, size_t); - VkResult (*p_vkWriteMicromapsPropertiesEXT)(VkDevice, uint32_t, const VkMicromapEXT *, VkQueryType, size_t, void *, size_t); -}; - -/* For use by vkInstance and children */ -struct vulkan_instance_funcs -{ - VkResult (*p_vkCreateDebugReportCallbackEXT)(VkInstance, const VkDebugReportCallbackCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugReportCallbackEXT *); - VkResult (*p_vkCreateDebugUtilsMessengerEXT)(VkInstance, const VkDebugUtilsMessengerCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugUtilsMessengerEXT *); - VkResult (*p_vkCreateWin32SurfaceKHR)(VkInstance, const VkWin32SurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *); - void (*p_vkDebugReportMessageEXT)(VkInstance, VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *); - void (*p_vkDestroyDebugReportCallbackEXT)(VkInstance, VkDebugReportCallbackEXT, const VkAllocationCallbacks *); - void (*p_vkDestroyDebugUtilsMessengerEXT)(VkInstance, VkDebugUtilsMessengerEXT, const VkAllocationCallbacks *); - void (*p_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); - VkResult (*p_vkEnumeratePhysicalDeviceGroups)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); - VkResult (*p_vkEnumeratePhysicalDeviceGroupsKHR)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); - VkResult (*p_vkEnumeratePhysicalDevices)(VkInstance, uint32_t *, VkPhysicalDevice *); - void (*p_vkSubmitDebugUtilsMessageEXT)(VkInstance, VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *); - VkResult (*p_vkCreateDevice)(VkPhysicalDevice, const VkDeviceCreateInfo *, const VkAllocationCallbacks *, VkDevice *); - VkResult (*p_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice, const char *, uint32_t *, VkExtensionProperties *); - VkResult (*p_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice, uint32_t *, VkLayerProperties *); - VkResult (*p_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice, uint32_t, uint32_t *, VkPerformanceCounterKHR *, VkPerformanceCounterDescriptionKHR *); - VkResult (*p_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice, uint32_t *, VkTimeDomainEXT *); - VkResult (*p_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesKHR *); - VkResult (*p_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesNV *); - void (*p_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice, VkPhysicalDeviceFeatures *); - void (*p_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); - void (*p_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); - void (*p_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice, VkFormat, VkFormatProperties *); - void (*p_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); - void (*p_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); - VkResult (*p_vkGetPhysicalDeviceFragmentShadingRatesKHR)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceFragmentShadingRateKHR *); - VkResult (*p_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties *); - VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); - VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); - void (*p_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties *); - void (*p_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); - void (*p_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); - void (*p_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice, VkSampleCountFlagBits, VkMultisamplePropertiesEXT *); - VkResult (*p_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)(VkPhysicalDevice, const VkOpticalFlowImageFormatInfoNV *, uint32_t *, VkOpticalFlowImageFormatPropertiesNV *); - VkResult (*p_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *); - void (*p_vkGetPhysicalDeviceProperties)(VkPhysicalDevice, VkPhysicalDeviceProperties *); - void (*p_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); - void (*p_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); - void (*p_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *, uint32_t *); - void (*p_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties *); - void (*p_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); - void (*p_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); - void (*p_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkSampleCountFlagBits, VkImageUsageFlags, VkImageTiling, uint32_t *, VkSparseImageFormatProperties *); - void (*p_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); - void (*p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); - VkResult (*p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)(VkPhysicalDevice, uint32_t *, VkFramebufferMixedSamplesCombinationNV *); - VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *); - VkResult (*p_vkGetPhysicalDeviceToolProperties)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); - VkResult (*p_vkGetPhysicalDeviceToolPropertiesEXT)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); - VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); -}; - -#define ALL_VK_DEVICE_FUNCS() \ - USE_VK_FUNC(vkAcquireNextImage2KHR) \ - USE_VK_FUNC(vkAcquireNextImageKHR) \ - USE_VK_FUNC(vkAcquirePerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkAcquireProfilingLockKHR) \ - USE_VK_FUNC(vkAllocateCommandBuffers) \ - USE_VK_FUNC(vkAllocateDescriptorSets) \ - USE_VK_FUNC(vkAllocateMemory) \ - USE_VK_FUNC(vkBeginCommandBuffer) \ - USE_VK_FUNC(vkBindAccelerationStructureMemoryNV) \ - USE_VK_FUNC(vkBindBufferMemory) \ - USE_VK_FUNC(vkBindBufferMemory2) \ - USE_VK_FUNC(vkBindBufferMemory2KHR) \ - USE_VK_FUNC(vkBindImageMemory) \ - USE_VK_FUNC(vkBindImageMemory2) \ - USE_VK_FUNC(vkBindImageMemory2KHR) \ - USE_VK_FUNC(vkBindOpticalFlowSessionImageNV) \ - USE_VK_FUNC(vkBuildAccelerationStructuresKHR) \ - USE_VK_FUNC(vkBuildMicromapsEXT) \ - USE_VK_FUNC(vkCmdBeginConditionalRenderingEXT) \ - USE_VK_FUNC(vkCmdBeginDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdBeginQuery) \ - USE_VK_FUNC(vkCmdBeginQueryIndexedEXT) \ - USE_VK_FUNC(vkCmdBeginRenderPass) \ - USE_VK_FUNC(vkCmdBeginRenderPass2) \ - USE_VK_FUNC(vkCmdBeginRenderPass2KHR) \ - USE_VK_FUNC(vkCmdBeginRendering) \ - USE_VK_FUNC(vkCmdBeginRenderingKHR) \ - USE_VK_FUNC(vkCmdBeginTransformFeedbackEXT) \ - USE_VK_FUNC(vkCmdBindDescriptorBufferEmbeddedSamplersEXT) \ - USE_VK_FUNC(vkCmdBindDescriptorBuffersEXT) \ - USE_VK_FUNC(vkCmdBindDescriptorSets) \ - USE_VK_FUNC(vkCmdBindIndexBuffer) \ - USE_VK_FUNC(vkCmdBindIndexBuffer2KHR) \ - USE_VK_FUNC(vkCmdBindInvocationMaskHUAWEI) \ - USE_VK_FUNC(vkCmdBindPipeline) \ - USE_VK_FUNC(vkCmdBindPipelineShaderGroupNV) \ - USE_VK_FUNC(vkCmdBindShadersEXT) \ - USE_VK_FUNC(vkCmdBindShadingRateImageNV) \ - USE_VK_FUNC(vkCmdBindTransformFeedbackBuffersEXT) \ - USE_VK_FUNC(vkCmdBindVertexBuffers) \ - USE_VK_FUNC(vkCmdBindVertexBuffers2) \ - USE_VK_FUNC(vkCmdBindVertexBuffers2EXT) \ - USE_VK_FUNC(vkCmdBlitImage) \ - USE_VK_FUNC(vkCmdBlitImage2) \ - USE_VK_FUNC(vkCmdBlitImage2KHR) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructureNV) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructuresIndirectKHR) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructuresKHR) \ - USE_VK_FUNC(vkCmdBuildMicromapsEXT) \ - USE_VK_FUNC(vkCmdClearAttachments) \ - USE_VK_FUNC(vkCmdClearColorImage) \ - USE_VK_FUNC(vkCmdClearDepthStencilImage) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureKHR) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureNV) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureToMemoryKHR) \ - USE_VK_FUNC(vkCmdCopyBuffer) \ - USE_VK_FUNC(vkCmdCopyBuffer2) \ - USE_VK_FUNC(vkCmdCopyBuffer2KHR) \ - USE_VK_FUNC(vkCmdCopyBufferToImage) \ - USE_VK_FUNC(vkCmdCopyBufferToImage2) \ - USE_VK_FUNC(vkCmdCopyBufferToImage2KHR) \ - USE_VK_FUNC(vkCmdCopyImage) \ - USE_VK_FUNC(vkCmdCopyImage2) \ - USE_VK_FUNC(vkCmdCopyImage2KHR) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer2) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer2KHR) \ - USE_VK_FUNC(vkCmdCopyMemoryIndirectNV) \ - USE_VK_FUNC(vkCmdCopyMemoryToAccelerationStructureKHR) \ - USE_VK_FUNC(vkCmdCopyMemoryToImageIndirectNV) \ - USE_VK_FUNC(vkCmdCopyMemoryToMicromapEXT) \ - USE_VK_FUNC(vkCmdCopyMicromapEXT) \ - USE_VK_FUNC(vkCmdCopyMicromapToMemoryEXT) \ - USE_VK_FUNC(vkCmdCopyQueryPoolResults) \ - USE_VK_FUNC(vkCmdCuLaunchKernelNVX) \ - USE_VK_FUNC(vkCmdCudaLaunchKernelNV) \ - USE_VK_FUNC(vkCmdDebugMarkerBeginEXT) \ - USE_VK_FUNC(vkCmdDebugMarkerEndEXT) \ - USE_VK_FUNC(vkCmdDebugMarkerInsertEXT) \ - USE_VK_FUNC(vkCmdDecompressMemoryIndirectCountNV) \ - USE_VK_FUNC(vkCmdDecompressMemoryNV) \ - USE_VK_FUNC(vkCmdDispatch) \ - USE_VK_FUNC(vkCmdDispatchBase) \ - USE_VK_FUNC(vkCmdDispatchBaseKHR) \ - USE_VK_FUNC(vkCmdDispatchIndirect) \ - USE_VK_FUNC(vkCmdDraw) \ - USE_VK_FUNC(vkCmdDrawClusterHUAWEI) \ - USE_VK_FUNC(vkCmdDrawClusterIndirectHUAWEI) \ - USE_VK_FUNC(vkCmdDrawIndexed) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirect) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCount) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCountAMD) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCountKHR) \ - USE_VK_FUNC(vkCmdDrawIndirect) \ - USE_VK_FUNC(vkCmdDrawIndirectByteCountEXT) \ - USE_VK_FUNC(vkCmdDrawIndirectCount) \ - USE_VK_FUNC(vkCmdDrawIndirectCountAMD) \ - USE_VK_FUNC(vkCmdDrawIndirectCountKHR) \ - USE_VK_FUNC(vkCmdDrawMeshTasksEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectCountEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectCountNV) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectNV) \ - USE_VK_FUNC(vkCmdDrawMeshTasksNV) \ - USE_VK_FUNC(vkCmdDrawMultiEXT) \ - USE_VK_FUNC(vkCmdDrawMultiIndexedEXT) \ - USE_VK_FUNC(vkCmdEndConditionalRenderingEXT) \ - USE_VK_FUNC(vkCmdEndDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdEndQuery) \ - USE_VK_FUNC(vkCmdEndQueryIndexedEXT) \ - USE_VK_FUNC(vkCmdEndRenderPass) \ - USE_VK_FUNC(vkCmdEndRenderPass2) \ - USE_VK_FUNC(vkCmdEndRenderPass2KHR) \ - USE_VK_FUNC(vkCmdEndRendering) \ - USE_VK_FUNC(vkCmdEndRenderingKHR) \ - USE_VK_FUNC(vkCmdEndTransformFeedbackEXT) \ - USE_VK_FUNC(vkCmdExecuteCommands) \ - USE_VK_FUNC(vkCmdExecuteGeneratedCommandsNV) \ - USE_VK_FUNC(vkCmdFillBuffer) \ - USE_VK_FUNC(vkCmdInsertDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdNextSubpass) \ - USE_VK_FUNC(vkCmdNextSubpass2) \ - USE_VK_FUNC(vkCmdNextSubpass2KHR) \ - USE_VK_FUNC(vkCmdOpticalFlowExecuteNV) \ - USE_VK_FUNC(vkCmdPipelineBarrier) \ - USE_VK_FUNC(vkCmdPipelineBarrier2) \ - USE_VK_FUNC(vkCmdPipelineBarrier2KHR) \ - USE_VK_FUNC(vkCmdPreprocessGeneratedCommandsNV) \ - USE_VK_FUNC(vkCmdPushConstants) \ - USE_VK_FUNC(vkCmdPushDescriptorSetKHR) \ - USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplateKHR) \ - USE_VK_FUNC(vkCmdResetEvent) \ - USE_VK_FUNC(vkCmdResetEvent2) \ - USE_VK_FUNC(vkCmdResetEvent2KHR) \ - USE_VK_FUNC(vkCmdResetQueryPool) \ - USE_VK_FUNC(vkCmdResolveImage) \ - USE_VK_FUNC(vkCmdResolveImage2) \ - USE_VK_FUNC(vkCmdResolveImage2KHR) \ - USE_VK_FUNC(vkCmdSetAlphaToCoverageEnableEXT) \ - USE_VK_FUNC(vkCmdSetAlphaToOneEnableEXT) \ - USE_VK_FUNC(vkCmdSetAttachmentFeedbackLoopEnableEXT) \ - USE_VK_FUNC(vkCmdSetBlendConstants) \ - USE_VK_FUNC(vkCmdSetCheckpointNV) \ - USE_VK_FUNC(vkCmdSetCoarseSampleOrderNV) \ - USE_VK_FUNC(vkCmdSetColorBlendAdvancedEXT) \ - USE_VK_FUNC(vkCmdSetColorBlendEnableEXT) \ - USE_VK_FUNC(vkCmdSetColorBlendEquationEXT) \ - USE_VK_FUNC(vkCmdSetColorWriteEnableEXT) \ - USE_VK_FUNC(vkCmdSetColorWriteMaskEXT) \ - USE_VK_FUNC(vkCmdSetConservativeRasterizationModeEXT) \ - USE_VK_FUNC(vkCmdSetCoverageModulationModeNV) \ - USE_VK_FUNC(vkCmdSetCoverageModulationTableEnableNV) \ - USE_VK_FUNC(vkCmdSetCoverageModulationTableNV) \ - USE_VK_FUNC(vkCmdSetCoverageReductionModeNV) \ - USE_VK_FUNC(vkCmdSetCoverageToColorEnableNV) \ - USE_VK_FUNC(vkCmdSetCoverageToColorLocationNV) \ - USE_VK_FUNC(vkCmdSetCullMode) \ - USE_VK_FUNC(vkCmdSetCullModeEXT) \ - USE_VK_FUNC(vkCmdSetDepthBias) \ - USE_VK_FUNC(vkCmdSetDepthBias2EXT) \ - USE_VK_FUNC(vkCmdSetDepthBiasEnable) \ - USE_VK_FUNC(vkCmdSetDepthBiasEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthBounds) \ - USE_VK_FUNC(vkCmdSetDepthBoundsTestEnable) \ - USE_VK_FUNC(vkCmdSetDepthBoundsTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClampEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClipEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClipNegativeOneToOneEXT) \ - USE_VK_FUNC(vkCmdSetDepthCompareOp) \ - USE_VK_FUNC(vkCmdSetDepthCompareOpEXT) \ - USE_VK_FUNC(vkCmdSetDepthTestEnable) \ - USE_VK_FUNC(vkCmdSetDepthTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthWriteEnable) \ - USE_VK_FUNC(vkCmdSetDepthWriteEnableEXT) \ - USE_VK_FUNC(vkCmdSetDescriptorBufferOffsetsEXT) \ - USE_VK_FUNC(vkCmdSetDeviceMask) \ - USE_VK_FUNC(vkCmdSetDeviceMaskKHR) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleEXT) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleEnableEXT) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleModeEXT) \ - USE_VK_FUNC(vkCmdSetEvent) \ - USE_VK_FUNC(vkCmdSetEvent2) \ - USE_VK_FUNC(vkCmdSetEvent2KHR) \ - USE_VK_FUNC(vkCmdSetExclusiveScissorEnableNV) \ - USE_VK_FUNC(vkCmdSetExclusiveScissorNV) \ - USE_VK_FUNC(vkCmdSetExtraPrimitiveOverestimationSizeEXT) \ - USE_VK_FUNC(vkCmdSetFragmentShadingRateEnumNV) \ - USE_VK_FUNC(vkCmdSetFragmentShadingRateKHR) \ - USE_VK_FUNC(vkCmdSetFrontFace) \ - USE_VK_FUNC(vkCmdSetFrontFaceEXT) \ - USE_VK_FUNC(vkCmdSetLineRasterizationModeEXT) \ - USE_VK_FUNC(vkCmdSetLineStippleEXT) \ - USE_VK_FUNC(vkCmdSetLineStippleEnableEXT) \ - USE_VK_FUNC(vkCmdSetLineWidth) \ - USE_VK_FUNC(vkCmdSetLogicOpEXT) \ - USE_VK_FUNC(vkCmdSetLogicOpEnableEXT) \ - USE_VK_FUNC(vkCmdSetPatchControlPointsEXT) \ - USE_VK_FUNC(vkCmdSetPerformanceMarkerINTEL) \ - USE_VK_FUNC(vkCmdSetPerformanceOverrideINTEL) \ - USE_VK_FUNC(vkCmdSetPerformanceStreamMarkerINTEL) \ - USE_VK_FUNC(vkCmdSetPolygonModeEXT) \ - USE_VK_FUNC(vkCmdSetPrimitiveRestartEnable) \ - USE_VK_FUNC(vkCmdSetPrimitiveRestartEnableEXT) \ - USE_VK_FUNC(vkCmdSetPrimitiveTopology) \ - USE_VK_FUNC(vkCmdSetPrimitiveTopologyEXT) \ - USE_VK_FUNC(vkCmdSetProvokingVertexModeEXT) \ - USE_VK_FUNC(vkCmdSetRasterizationSamplesEXT) \ - USE_VK_FUNC(vkCmdSetRasterizationStreamEXT) \ - USE_VK_FUNC(vkCmdSetRasterizerDiscardEnable) \ - USE_VK_FUNC(vkCmdSetRasterizerDiscardEnableEXT) \ - USE_VK_FUNC(vkCmdSetRayTracingPipelineStackSizeKHR) \ - USE_VK_FUNC(vkCmdSetRepresentativeFragmentTestEnableNV) \ - USE_VK_FUNC(vkCmdSetSampleLocationsEXT) \ - USE_VK_FUNC(vkCmdSetSampleLocationsEnableEXT) \ - USE_VK_FUNC(vkCmdSetSampleMaskEXT) \ - USE_VK_FUNC(vkCmdSetScissor) \ - USE_VK_FUNC(vkCmdSetScissorWithCount) \ - USE_VK_FUNC(vkCmdSetScissorWithCountEXT) \ - USE_VK_FUNC(vkCmdSetShadingRateImageEnableNV) \ - USE_VK_FUNC(vkCmdSetStencilCompareMask) \ - USE_VK_FUNC(vkCmdSetStencilOp) \ - USE_VK_FUNC(vkCmdSetStencilOpEXT) \ - USE_VK_FUNC(vkCmdSetStencilReference) \ - USE_VK_FUNC(vkCmdSetStencilTestEnable) \ - USE_VK_FUNC(vkCmdSetStencilTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetStencilWriteMask) \ - USE_VK_FUNC(vkCmdSetTessellationDomainOriginEXT) \ - USE_VK_FUNC(vkCmdSetVertexInputEXT) \ - USE_VK_FUNC(vkCmdSetViewport) \ - USE_VK_FUNC(vkCmdSetViewportShadingRatePaletteNV) \ - USE_VK_FUNC(vkCmdSetViewportSwizzleNV) \ - USE_VK_FUNC(vkCmdSetViewportWScalingEnableNV) \ - USE_VK_FUNC(vkCmdSetViewportWScalingNV) \ - USE_VK_FUNC(vkCmdSetViewportWithCount) \ - USE_VK_FUNC(vkCmdSetViewportWithCountEXT) \ - USE_VK_FUNC(vkCmdSubpassShadingHUAWEI) \ - USE_VK_FUNC(vkCmdTraceRaysIndirect2KHR) \ - USE_VK_FUNC(vkCmdTraceRaysIndirectKHR) \ - USE_VK_FUNC(vkCmdTraceRaysKHR) \ - USE_VK_FUNC(vkCmdTraceRaysNV) \ - USE_VK_FUNC(vkCmdUpdateBuffer) \ - USE_VK_FUNC(vkCmdUpdatePipelineIndirectBufferNV) \ - USE_VK_FUNC(vkCmdWaitEvents) \ - USE_VK_FUNC(vkCmdWaitEvents2) \ - USE_VK_FUNC(vkCmdWaitEvents2KHR) \ - USE_VK_FUNC(vkCmdWriteAccelerationStructuresPropertiesKHR) \ - USE_VK_FUNC(vkCmdWriteAccelerationStructuresPropertiesNV) \ - USE_VK_FUNC(vkCmdWriteBufferMarker2AMD) \ - USE_VK_FUNC(vkCmdWriteBufferMarkerAMD) \ - USE_VK_FUNC(vkCmdWriteMicromapsPropertiesEXT) \ - USE_VK_FUNC(vkCmdWriteTimestamp) \ - USE_VK_FUNC(vkCmdWriteTimestamp2) \ - USE_VK_FUNC(vkCmdWriteTimestamp2KHR) \ - USE_VK_FUNC(vkCompileDeferredNV) \ - USE_VK_FUNC(vkCopyAccelerationStructureKHR) \ - USE_VK_FUNC(vkCopyAccelerationStructureToMemoryKHR) \ - USE_VK_FUNC(vkCopyImageToImageEXT) \ - USE_VK_FUNC(vkCopyImageToMemoryEXT) \ - USE_VK_FUNC(vkCopyMemoryToAccelerationStructureKHR) \ - USE_VK_FUNC(vkCopyMemoryToImageEXT) \ - USE_VK_FUNC(vkCopyMemoryToMicromapEXT) \ - USE_VK_FUNC(vkCopyMicromapEXT) \ - USE_VK_FUNC(vkCopyMicromapToMemoryEXT) \ - USE_VK_FUNC(vkCreateAccelerationStructureKHR) \ - USE_VK_FUNC(vkCreateAccelerationStructureNV) \ - USE_VK_FUNC(vkCreateBuffer) \ - USE_VK_FUNC(vkCreateBufferView) \ - USE_VK_FUNC(vkCreateCommandPool) \ - USE_VK_FUNC(vkCreateComputePipelines) \ - USE_VK_FUNC(vkCreateCuFunctionNVX) \ - USE_VK_FUNC(vkCreateCuModuleNVX) \ - USE_VK_FUNC(vkCreateCudaFunctionNV) \ - USE_VK_FUNC(vkCreateCudaModuleNV) \ - USE_VK_FUNC(vkCreateDeferredOperationKHR) \ - USE_VK_FUNC(vkCreateDescriptorPool) \ - USE_VK_FUNC(vkCreateDescriptorSetLayout) \ - USE_VK_FUNC(vkCreateDescriptorUpdateTemplate) \ - USE_VK_FUNC(vkCreateDescriptorUpdateTemplateKHR) \ - USE_VK_FUNC(vkCreateEvent) \ - USE_VK_FUNC(vkCreateFence) \ - USE_VK_FUNC(vkCreateFramebuffer) \ - USE_VK_FUNC(vkCreateGraphicsPipelines) \ - USE_VK_FUNC(vkCreateImage) \ - USE_VK_FUNC(vkCreateImageView) \ - USE_VK_FUNC(vkCreateIndirectCommandsLayoutNV) \ - USE_VK_FUNC(vkCreateMicromapEXT) \ - USE_VK_FUNC(vkCreateOpticalFlowSessionNV) \ - USE_VK_FUNC(vkCreatePipelineCache) \ - USE_VK_FUNC(vkCreatePipelineLayout) \ - USE_VK_FUNC(vkCreatePrivateDataSlot) \ - USE_VK_FUNC(vkCreatePrivateDataSlotEXT) \ - USE_VK_FUNC(vkCreateQueryPool) \ - USE_VK_FUNC(vkCreateRayTracingPipelinesKHR) \ - USE_VK_FUNC(vkCreateRayTracingPipelinesNV) \ - USE_VK_FUNC(vkCreateRenderPass) \ - USE_VK_FUNC(vkCreateRenderPass2) \ - USE_VK_FUNC(vkCreateRenderPass2KHR) \ - USE_VK_FUNC(vkCreateSampler) \ - USE_VK_FUNC(vkCreateSamplerYcbcrConversion) \ - USE_VK_FUNC(vkCreateSamplerYcbcrConversionKHR) \ - USE_VK_FUNC(vkCreateSemaphore) \ - USE_VK_FUNC(vkCreateShaderModule) \ - USE_VK_FUNC(vkCreateShadersEXT) \ - USE_VK_FUNC(vkCreateSwapchainKHR) \ - USE_VK_FUNC(vkCreateValidationCacheEXT) \ - USE_VK_FUNC(vkDebugMarkerSetObjectNameEXT) \ - USE_VK_FUNC(vkDebugMarkerSetObjectTagEXT) \ - USE_VK_FUNC(vkDeferredOperationJoinKHR) \ - USE_VK_FUNC(vkDestroyAccelerationStructureKHR) \ - USE_VK_FUNC(vkDestroyAccelerationStructureNV) \ - USE_VK_FUNC(vkDestroyBuffer) \ - USE_VK_FUNC(vkDestroyBufferView) \ - USE_VK_FUNC(vkDestroyCommandPool) \ - USE_VK_FUNC(vkDestroyCuFunctionNVX) \ - USE_VK_FUNC(vkDestroyCuModuleNVX) \ - USE_VK_FUNC(vkDestroyCudaFunctionNV) \ - USE_VK_FUNC(vkDestroyCudaModuleNV) \ - USE_VK_FUNC(vkDestroyDeferredOperationKHR) \ - USE_VK_FUNC(vkDestroyDescriptorPool) \ - USE_VK_FUNC(vkDestroyDescriptorSetLayout) \ - USE_VK_FUNC(vkDestroyDescriptorUpdateTemplate) \ - USE_VK_FUNC(vkDestroyDescriptorUpdateTemplateKHR) \ - USE_VK_FUNC(vkDestroyDevice) \ - USE_VK_FUNC(vkDestroyEvent) \ - USE_VK_FUNC(vkDestroyFence) \ - USE_VK_FUNC(vkDestroyFramebuffer) \ - USE_VK_FUNC(vkDestroyImage) \ - USE_VK_FUNC(vkDestroyImageView) \ - USE_VK_FUNC(vkDestroyIndirectCommandsLayoutNV) \ - USE_VK_FUNC(vkDestroyMicromapEXT) \ - USE_VK_FUNC(vkDestroyOpticalFlowSessionNV) \ - USE_VK_FUNC(vkDestroyPipeline) \ - USE_VK_FUNC(vkDestroyPipelineCache) \ - USE_VK_FUNC(vkDestroyPipelineLayout) \ - USE_VK_FUNC(vkDestroyPrivateDataSlot) \ - USE_VK_FUNC(vkDestroyPrivateDataSlotEXT) \ - USE_VK_FUNC(vkDestroyQueryPool) \ - USE_VK_FUNC(vkDestroyRenderPass) \ - USE_VK_FUNC(vkDestroySampler) \ - USE_VK_FUNC(vkDestroySamplerYcbcrConversion) \ - USE_VK_FUNC(vkDestroySamplerYcbcrConversionKHR) \ - USE_VK_FUNC(vkDestroySemaphore) \ - USE_VK_FUNC(vkDestroyShaderEXT) \ - USE_VK_FUNC(vkDestroyShaderModule) \ - USE_VK_FUNC(vkDestroySwapchainKHR) \ - USE_VK_FUNC(vkDestroyValidationCacheEXT) \ - USE_VK_FUNC(vkDeviceWaitIdle) \ - USE_VK_FUNC(vkEndCommandBuffer) \ - USE_VK_FUNC(vkFlushMappedMemoryRanges) \ - USE_VK_FUNC(vkFreeCommandBuffers) \ - USE_VK_FUNC(vkFreeDescriptorSets) \ - USE_VK_FUNC(vkFreeMemory) \ - USE_VK_FUNC(vkGetAccelerationStructureBuildSizesKHR) \ - USE_VK_FUNC(vkGetAccelerationStructureDeviceAddressKHR) \ - USE_VK_FUNC(vkGetAccelerationStructureHandleNV) \ - USE_VK_FUNC(vkGetAccelerationStructureMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetBufferDeviceAddress) \ - USE_VK_FUNC(vkGetBufferDeviceAddressEXT) \ - USE_VK_FUNC(vkGetBufferDeviceAddressKHR) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements2) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureAddress) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureAddressKHR) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetCalibratedTimestampsEXT) \ - USE_VK_FUNC(vkGetCudaModuleCacheNV) \ - USE_VK_FUNC(vkGetDeferredOperationMaxConcurrencyKHR) \ - USE_VK_FUNC(vkGetDeferredOperationResultKHR) \ - USE_VK_FUNC(vkGetDescriptorEXT) \ - USE_VK_FUNC(vkGetDescriptorSetHostMappingVALVE) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutBindingOffsetEXT) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutHostMappingInfoVALVE) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSizeEXT) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSupport) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSupportKHR) \ - USE_VK_FUNC(vkGetDeviceAccelerationStructureCompatibilityKHR) \ - USE_VK_FUNC(vkGetDeviceBufferMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceBufferMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceFaultInfoEXT) \ - USE_VK_FUNC(vkGetDeviceGroupPeerMemoryFeatures) \ - USE_VK_FUNC(vkGetDeviceGroupPeerMemoryFeaturesKHR) \ - USE_VK_FUNC(vkGetDeviceGroupPresentCapabilitiesKHR) \ - USE_VK_FUNC(vkGetDeviceGroupSurfacePresentModesKHR) \ - USE_VK_FUNC(vkGetDeviceImageMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceImageMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceImageSparseMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceImageSparseMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceImageSubresourceLayoutKHR) \ - USE_VK_FUNC(vkGetDeviceMemoryCommitment) \ - USE_VK_FUNC(vkGetDeviceMemoryOpaqueCaptureAddress) \ - USE_VK_FUNC(vkGetDeviceMemoryOpaqueCaptureAddressKHR) \ - USE_VK_FUNC(vkGetDeviceMicromapCompatibilityEXT) \ - USE_VK_FUNC(vkGetDeviceQueue) \ - USE_VK_FUNC(vkGetDeviceQueue2) \ - USE_VK_FUNC(vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI) \ - USE_VK_FUNC(vkGetDynamicRenderingTilePropertiesQCOM) \ - USE_VK_FUNC(vkGetEventStatus) \ - USE_VK_FUNC(vkGetFenceStatus) \ - USE_VK_FUNC(vkGetFramebufferTilePropertiesQCOM) \ - USE_VK_FUNC(vkGetGeneratedCommandsMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetImageMemoryRequirements) \ - USE_VK_FUNC(vkGetImageMemoryRequirements2) \ - USE_VK_FUNC(vkGetImageMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetImageOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements2) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetImageSubresourceLayout) \ - USE_VK_FUNC(vkGetImageSubresourceLayout2EXT) \ - USE_VK_FUNC(vkGetImageSubresourceLayout2KHR) \ - USE_VK_FUNC(vkGetImageViewAddressNVX) \ - USE_VK_FUNC(vkGetImageViewHandleNVX) \ - USE_VK_FUNC(vkGetImageViewOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetLatencyTimingsNV) \ - USE_VK_FUNC(vkGetMemoryHostPointerPropertiesEXT) \ - USE_VK_FUNC(vkGetMicromapBuildSizesEXT) \ - USE_VK_FUNC(vkGetPerformanceParameterINTEL) \ - USE_VK_FUNC(vkGetPipelineCacheData) \ - USE_VK_FUNC(vkGetPipelineExecutableInternalRepresentationsKHR) \ - USE_VK_FUNC(vkGetPipelineExecutablePropertiesKHR) \ - USE_VK_FUNC(vkGetPipelineExecutableStatisticsKHR) \ - USE_VK_FUNC(vkGetPipelineIndirectDeviceAddressNV) \ - USE_VK_FUNC(vkGetPipelineIndirectMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetPipelinePropertiesEXT) \ - USE_VK_FUNC(vkGetPrivateData) \ - USE_VK_FUNC(vkGetPrivateDataEXT) \ - USE_VK_FUNC(vkGetQueryPoolResults) \ - USE_VK_FUNC(vkGetQueueCheckpointData2NV) \ - USE_VK_FUNC(vkGetQueueCheckpointDataNV) \ - USE_VK_FUNC(vkGetRayTracingCaptureReplayShaderGroupHandlesKHR) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupHandlesKHR) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupHandlesNV) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupStackSizeKHR) \ - USE_VK_FUNC(vkGetRenderAreaGranularity) \ - USE_VK_FUNC(vkGetRenderingAreaGranularityKHR) \ - USE_VK_FUNC(vkGetSamplerOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetSemaphoreCounterValue) \ - USE_VK_FUNC(vkGetSemaphoreCounterValueKHR) \ - USE_VK_FUNC(vkGetShaderBinaryDataEXT) \ - USE_VK_FUNC(vkGetShaderInfoAMD) \ - USE_VK_FUNC(vkGetShaderModuleCreateInfoIdentifierEXT) \ - USE_VK_FUNC(vkGetShaderModuleIdentifierEXT) \ - USE_VK_FUNC(vkGetSwapchainImagesKHR) \ - USE_VK_FUNC(vkGetValidationCacheDataEXT) \ - USE_VK_FUNC(vkInitializePerformanceApiINTEL) \ - USE_VK_FUNC(vkInvalidateMappedMemoryRanges) \ - USE_VK_FUNC(vkLatencySleepNV) \ - USE_VK_FUNC(vkMapMemory) \ - USE_VK_FUNC(vkMapMemory2KHR) \ - USE_VK_FUNC(vkMergePipelineCaches) \ - USE_VK_FUNC(vkMergeValidationCachesEXT) \ - USE_VK_FUNC(vkQueueBeginDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueBindSparse) \ - USE_VK_FUNC(vkQueueEndDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueInsertDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueNotifyOutOfBandNV) \ - USE_VK_FUNC(vkQueuePresentKHR) \ - USE_VK_FUNC(vkQueueSetPerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkQueueSubmit) \ - USE_VK_FUNC(vkQueueSubmit2) \ - USE_VK_FUNC(vkQueueSubmit2KHR) \ - USE_VK_FUNC(vkQueueWaitIdle) \ - USE_VK_FUNC(vkReleasePerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkReleaseProfilingLockKHR) \ - USE_VK_FUNC(vkReleaseSwapchainImagesEXT) \ - USE_VK_FUNC(vkResetCommandBuffer) \ - USE_VK_FUNC(vkResetCommandPool) \ - USE_VK_FUNC(vkResetDescriptorPool) \ - USE_VK_FUNC(vkResetEvent) \ - USE_VK_FUNC(vkResetFences) \ - USE_VK_FUNC(vkResetQueryPool) \ - USE_VK_FUNC(vkResetQueryPoolEXT) \ - USE_VK_FUNC(vkSetDebugUtilsObjectNameEXT) \ - USE_VK_FUNC(vkSetDebugUtilsObjectTagEXT) \ - USE_VK_FUNC(vkSetDeviceMemoryPriorityEXT) \ - USE_VK_FUNC(vkSetEvent) \ - USE_VK_FUNC(vkSetHdrMetadataEXT) \ - USE_VK_FUNC(vkSetLatencyMarkerNV) \ - USE_VK_FUNC(vkSetLatencySleepModeNV) \ - USE_VK_FUNC(vkSetPrivateData) \ - USE_VK_FUNC(vkSetPrivateDataEXT) \ - USE_VK_FUNC(vkSignalSemaphore) \ - USE_VK_FUNC(vkSignalSemaphoreKHR) \ - USE_VK_FUNC(vkTransitionImageLayoutEXT) \ - USE_VK_FUNC(vkTrimCommandPool) \ - USE_VK_FUNC(vkTrimCommandPoolKHR) \ - USE_VK_FUNC(vkUninitializePerformanceApiINTEL) \ - USE_VK_FUNC(vkUnmapMemory) \ - USE_VK_FUNC(vkUnmapMemory2KHR) \ - USE_VK_FUNC(vkUpdateDescriptorSetWithTemplate) \ - USE_VK_FUNC(vkUpdateDescriptorSetWithTemplateKHR) \ - USE_VK_FUNC(vkUpdateDescriptorSets) \ - USE_VK_FUNC(vkWaitForFences) \ - USE_VK_FUNC(vkWaitForPresentKHR) \ - USE_VK_FUNC(vkWaitSemaphores) \ - USE_VK_FUNC(vkWaitSemaphoresKHR) \ - USE_VK_FUNC(vkWriteAccelerationStructuresPropertiesKHR) \ - USE_VK_FUNC(vkWriteMicromapsPropertiesEXT) - -#define ALL_VK_INSTANCE_FUNCS() \ - USE_VK_FUNC(vkCreateDebugReportCallbackEXT) \ - USE_VK_FUNC(vkCreateDebugUtilsMessengerEXT) \ - USE_VK_FUNC(vkCreateWin32SurfaceKHR) \ - USE_VK_FUNC(vkDebugReportMessageEXT) \ - USE_VK_FUNC(vkDestroyDebugReportCallbackEXT) \ - USE_VK_FUNC(vkDestroyDebugUtilsMessengerEXT) \ - USE_VK_FUNC(vkDestroySurfaceKHR) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceGroups) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceGroupsKHR) \ - USE_VK_FUNC(vkEnumeratePhysicalDevices) \ - USE_VK_FUNC(vkSubmitDebugUtilsMessageEXT) \ - USE_VK_FUNC(vkCreateDevice) \ - USE_VK_FUNC(vkEnumerateDeviceExtensionProperties) \ - USE_VK_FUNC(vkEnumerateDeviceLayerProperties) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceCalibrateableTimeDomainsEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceCooperativeMatrixPropertiesNV) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures2) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceFragmentShadingRatesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceMultisamplePropertiesEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceOpticalFlowImageFormatsNV) \ - USE_VK_FUNC(vkGetPhysicalDevicePresentRectanglesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilities2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormats2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormatsKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfacePresentModesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceSupportKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceToolProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceToolPropertiesEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceWin32PresentationSupportKHR) - -#endif /* __WINE_VULKAN_THUNKS_H */ diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json deleted file mode 100644 index a4ae238dfba..00000000000 --- a/dlls/winevulkan/winevulkan.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "file_format_version": "1.0.0", - "ICD": { - "library_path": ".\\winevulkan.dll", - "api_version": "1.3.272" - } -} diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec deleted file mode 100644 index e8b58b018e5..00000000000 --- a/dlls/winevulkan/winevulkan.spec +++ /dev/null @@ -1,258 +0,0 @@ -# Automatically generated from Vulkan vk.xml; DO NOT EDIT! -# -# This file is generated from Vulkan vk.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2015-2023 The Khronos Group Inc. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -@ stdcall -private vk_icdGetInstanceProcAddr(ptr str) -@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str) -@ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr) -@ stdcall vkAcquireNextImage2KHR(ptr ptr ptr) -@ stdcall vkAcquireNextImageKHR(ptr int64 int64 int64 int64 ptr) -@ stdcall vkAllocateCommandBuffers(ptr ptr ptr) -@ stdcall vkAllocateDescriptorSets(ptr ptr ptr) -@ stdcall vkAllocateMemory(ptr ptr ptr ptr) -@ stdcall vkBeginCommandBuffer(ptr ptr) -@ stdcall vkBindBufferMemory(ptr int64 int64 int64) -@ stdcall vkBindBufferMemory2(ptr long ptr) -@ stdcall vkBindImageMemory(ptr int64 int64 int64) -@ stdcall vkBindImageMemory2(ptr long ptr) -@ stdcall vkCmdBeginQuery(ptr int64 long long) -@ stdcall vkCmdBeginRenderPass(ptr ptr long) -@ stdcall vkCmdBeginRenderPass2(ptr ptr ptr) -@ stdcall vkCmdBeginRendering(ptr ptr) -@ stdcall vkCmdBindDescriptorSets(ptr long int64 long long ptr long ptr) -@ stdcall vkCmdBindIndexBuffer(ptr int64 int64 long) -@ stdcall vkCmdBindPipeline(ptr long int64) -@ stdcall vkCmdBindVertexBuffers(ptr long long ptr ptr) -@ stdcall vkCmdBindVertexBuffers2(ptr long long ptr ptr ptr ptr) -@ stdcall vkCmdBlitImage(ptr int64 long int64 long long ptr long) -@ stdcall vkCmdBlitImage2(ptr ptr) -@ stdcall vkCmdClearAttachments(ptr long ptr long ptr) -@ stdcall vkCmdClearColorImage(ptr int64 long ptr long ptr) -@ stdcall vkCmdClearDepthStencilImage(ptr int64 long ptr long ptr) -@ stdcall vkCmdCopyBuffer(ptr int64 int64 long ptr) -@ stdcall vkCmdCopyBuffer2(ptr ptr) -@ stdcall vkCmdCopyBufferToImage(ptr int64 int64 long long ptr) -@ stdcall vkCmdCopyBufferToImage2(ptr ptr) -@ stdcall vkCmdCopyImage(ptr int64 long int64 long long ptr) -@ stdcall vkCmdCopyImage2(ptr ptr) -@ stdcall vkCmdCopyImageToBuffer(ptr int64 long int64 long ptr) -@ stdcall vkCmdCopyImageToBuffer2(ptr ptr) -@ stdcall vkCmdCopyQueryPoolResults(ptr int64 long long int64 int64 int64 long) -@ stdcall vkCmdDispatch(ptr long long long) -@ stdcall vkCmdDispatchBase(ptr long long long long long long) -@ stdcall vkCmdDispatchIndirect(ptr int64 int64) -@ stdcall vkCmdDraw(ptr long long long long) -@ stdcall vkCmdDrawIndexed(ptr long long long long long) -@ stdcall vkCmdDrawIndexedIndirect(ptr int64 int64 long long) -@ stdcall vkCmdDrawIndexedIndirectCount(ptr int64 int64 int64 int64 long long) -@ stdcall vkCmdDrawIndirect(ptr int64 int64 long long) -@ stdcall vkCmdDrawIndirectCount(ptr int64 int64 int64 int64 long long) -@ stdcall vkCmdEndQuery(ptr int64 long) -@ stdcall vkCmdEndRenderPass(ptr) -@ stdcall vkCmdEndRenderPass2(ptr ptr) -@ stdcall vkCmdEndRendering(ptr) -@ stdcall vkCmdExecuteCommands(ptr long ptr) -@ stdcall vkCmdFillBuffer(ptr int64 int64 int64 long) -@ stdcall vkCmdNextSubpass(ptr long) -@ stdcall vkCmdNextSubpass2(ptr ptr ptr) -@ stdcall vkCmdPipelineBarrier(ptr long long long long ptr long ptr long ptr) -@ stdcall vkCmdPipelineBarrier2(ptr ptr) -@ stdcall vkCmdPushConstants(ptr int64 long long long ptr) -@ stdcall vkCmdResetEvent(ptr int64 long) -@ stdcall vkCmdResetEvent2(ptr int64 int64) -@ stdcall vkCmdResetQueryPool(ptr int64 long long) -@ stdcall vkCmdResolveImage(ptr int64 long int64 long long ptr) -@ stdcall vkCmdResolveImage2(ptr ptr) -@ stdcall vkCmdSetBlendConstants(ptr ptr) -@ stdcall vkCmdSetCullMode(ptr long) -@ stdcall vkCmdSetDepthBias(ptr float float float) -@ stdcall vkCmdSetDepthBiasEnable(ptr long) -@ stdcall vkCmdSetDepthBounds(ptr float float) -@ stdcall vkCmdSetDepthBoundsTestEnable(ptr long) -@ stdcall vkCmdSetDepthCompareOp(ptr long) -@ stdcall vkCmdSetDepthTestEnable(ptr long) -@ stdcall vkCmdSetDepthWriteEnable(ptr long) -@ stdcall vkCmdSetDeviceMask(ptr long) -@ stdcall vkCmdSetEvent(ptr int64 long) -@ stdcall vkCmdSetEvent2(ptr int64 ptr) -@ stdcall vkCmdSetFrontFace(ptr long) -@ stdcall vkCmdSetLineWidth(ptr float) -@ stdcall vkCmdSetPrimitiveRestartEnable(ptr long) -@ stdcall vkCmdSetPrimitiveTopology(ptr long) -@ stdcall vkCmdSetRasterizerDiscardEnable(ptr long) -@ stdcall vkCmdSetScissor(ptr long long ptr) -@ stdcall vkCmdSetScissorWithCount(ptr long ptr) -@ stdcall vkCmdSetStencilCompareMask(ptr long long) -@ stdcall vkCmdSetStencilOp(ptr long long long long long) -@ stdcall vkCmdSetStencilReference(ptr long long) -@ stdcall vkCmdSetStencilTestEnable(ptr long) -@ stdcall vkCmdSetStencilWriteMask(ptr long long) -@ stdcall vkCmdSetViewport(ptr long long ptr) -@ stdcall vkCmdSetViewportWithCount(ptr long ptr) -@ stdcall vkCmdUpdateBuffer(ptr int64 int64 int64 ptr) -@ stdcall vkCmdWaitEvents(ptr long ptr long long long ptr long ptr long ptr) -@ stdcall vkCmdWaitEvents2(ptr long ptr ptr) -@ stdcall vkCmdWriteTimestamp(ptr long int64 long) -@ stdcall vkCmdWriteTimestamp2(ptr int64 int64 long) -@ stdcall vkCreateBuffer(ptr ptr ptr ptr) -@ stdcall vkCreateBufferView(ptr ptr ptr ptr) -@ stdcall vkCreateCommandPool(ptr ptr ptr ptr) -@ stdcall vkCreateComputePipelines(ptr int64 long ptr ptr ptr) -@ stdcall vkCreateDescriptorPool(ptr ptr ptr ptr) -@ stdcall vkCreateDescriptorSetLayout(ptr ptr ptr ptr) -@ stdcall vkCreateDescriptorUpdateTemplate(ptr ptr ptr ptr) -@ stdcall vkCreateDevice(ptr ptr ptr ptr) -@ stub vkCreateDisplayModeKHR -@ stub vkCreateDisplayPlaneSurfaceKHR -@ stdcall vkCreateEvent(ptr ptr ptr ptr) -@ stdcall vkCreateFence(ptr ptr ptr ptr) -@ stdcall vkCreateFramebuffer(ptr ptr ptr ptr) -@ stdcall vkCreateGraphicsPipelines(ptr int64 long ptr ptr ptr) -@ stdcall vkCreateImage(ptr ptr ptr ptr) -@ stdcall vkCreateImageView(ptr ptr ptr ptr) -@ stdcall vkCreateInstance(ptr ptr ptr) -@ stdcall vkCreatePipelineCache(ptr ptr ptr ptr) -@ stdcall vkCreatePipelineLayout(ptr ptr ptr ptr) -@ stdcall vkCreatePrivateDataSlot(ptr ptr ptr ptr) -@ stdcall vkCreateQueryPool(ptr ptr ptr ptr) -@ stdcall vkCreateRenderPass(ptr ptr ptr ptr) -@ stdcall vkCreateRenderPass2(ptr ptr ptr ptr) -@ stdcall vkCreateSampler(ptr ptr ptr ptr) -@ stdcall vkCreateSamplerYcbcrConversion(ptr ptr ptr ptr) -@ stdcall vkCreateSemaphore(ptr ptr ptr ptr) -@ stdcall vkCreateShaderModule(ptr ptr ptr ptr) -@ stub vkCreateSharedSwapchainsKHR -@ stdcall vkCreateSwapchainKHR(ptr ptr ptr ptr) -@ stdcall vkCreateWin32SurfaceKHR(ptr ptr ptr ptr) -@ stdcall vkDestroyBuffer(ptr int64 ptr) -@ stdcall vkDestroyBufferView(ptr int64 ptr) -@ stdcall vkDestroyCommandPool(ptr int64 ptr) -@ stdcall vkDestroyDescriptorPool(ptr int64 ptr) -@ stdcall vkDestroyDescriptorSetLayout(ptr int64 ptr) -@ stdcall vkDestroyDescriptorUpdateTemplate(ptr int64 ptr) -@ stdcall vkDestroyDevice(ptr ptr) -@ stdcall vkDestroyEvent(ptr int64 ptr) -@ stdcall vkDestroyFence(ptr int64 ptr) -@ stdcall vkDestroyFramebuffer(ptr int64 ptr) -@ stdcall vkDestroyImage(ptr int64 ptr) -@ stdcall vkDestroyImageView(ptr int64 ptr) -@ stdcall vkDestroyInstance(ptr ptr) -@ stdcall vkDestroyPipeline(ptr int64 ptr) -@ stdcall vkDestroyPipelineCache(ptr int64 ptr) -@ stdcall vkDestroyPipelineLayout(ptr int64 ptr) -@ stdcall vkDestroyPrivateDataSlot(ptr int64 ptr) -@ stdcall vkDestroyQueryPool(ptr int64 ptr) -@ stdcall vkDestroyRenderPass(ptr int64 ptr) -@ stdcall vkDestroySampler(ptr int64 ptr) -@ stdcall vkDestroySamplerYcbcrConversion(ptr int64 ptr) -@ stdcall vkDestroySemaphore(ptr int64 ptr) -@ stdcall vkDestroyShaderModule(ptr int64 ptr) -@ stdcall vkDestroySurfaceKHR(ptr int64 ptr) -@ stdcall vkDestroySwapchainKHR(ptr int64 ptr) -@ stdcall vkDeviceWaitIdle(ptr) -@ stdcall vkEndCommandBuffer(ptr) -@ stdcall vkEnumerateDeviceExtensionProperties(ptr str ptr ptr) -@ stdcall vkEnumerateDeviceLayerProperties(ptr ptr ptr) -@ stdcall vkEnumerateInstanceExtensionProperties(str ptr ptr) -@ stdcall vkEnumerateInstanceLayerProperties(ptr ptr) -@ stdcall vkEnumerateInstanceVersion(ptr) -@ stdcall vkEnumeratePhysicalDeviceGroups(ptr ptr ptr) -@ stdcall vkEnumeratePhysicalDevices(ptr ptr ptr) -@ stdcall vkFlushMappedMemoryRanges(ptr long ptr) -@ stdcall vkFreeCommandBuffers(ptr int64 long ptr) -@ stdcall vkFreeDescriptorSets(ptr int64 long ptr) -@ stdcall vkFreeMemory(ptr int64 ptr) -@ stdcall vkGetBufferDeviceAddress(ptr ptr) -@ stdcall vkGetBufferMemoryRequirements(ptr int64 ptr) -@ stdcall vkGetBufferMemoryRequirements2(ptr ptr ptr) -@ stdcall vkGetBufferOpaqueCaptureAddress(ptr ptr) -@ stub vkGetCommandPoolMemoryConsumption -@ stdcall vkGetDescriptorSetLayoutSupport(ptr ptr ptr) -@ stdcall vkGetDeviceBufferMemoryRequirements(ptr ptr ptr) -@ stdcall vkGetDeviceGroupPeerMemoryFeatures(ptr long long long ptr) -@ stdcall vkGetDeviceGroupPresentCapabilitiesKHR(ptr ptr) -@ stdcall vkGetDeviceGroupSurfacePresentModesKHR(ptr int64 ptr) -@ stdcall vkGetDeviceImageMemoryRequirements(ptr ptr ptr) -@ stdcall vkGetDeviceImageSparseMemoryRequirements(ptr ptr ptr ptr) -@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) -@ stdcall vkGetDeviceMemoryOpaqueCaptureAddress(ptr ptr) -@ stdcall vkGetDeviceProcAddr(ptr str) -@ stdcall vkGetDeviceQueue(ptr long long ptr) -@ stdcall vkGetDeviceQueue2(ptr ptr ptr) -@ stub vkGetDisplayModePropertiesKHR -@ stub vkGetDisplayPlaneCapabilitiesKHR -@ stub vkGetDisplayPlaneSupportedDisplaysKHR -@ stdcall vkGetEventStatus(ptr int64) -@ stub vkGetFaultData -@ stdcall vkGetFenceStatus(ptr int64) -@ stdcall vkGetImageMemoryRequirements(ptr int64 ptr) -@ stdcall vkGetImageMemoryRequirements2(ptr ptr ptr) -@ stdcall vkGetImageSparseMemoryRequirements(ptr int64 ptr ptr) -@ stdcall vkGetImageSparseMemoryRequirements2(ptr ptr ptr ptr) -@ stdcall vkGetImageSubresourceLayout(ptr int64 ptr ptr) -@ stdcall vkGetInstanceProcAddr(ptr str) -@ stub vkGetPhysicalDeviceDisplayPlanePropertiesKHR -@ stub vkGetPhysicalDeviceDisplayPropertiesKHR -@ stdcall vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) -@ stdcall vkGetPhysicalDeviceFeatures2(ptr ptr) -@ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) -@ stdcall vkGetPhysicalDeviceFormatProperties2(ptr long ptr) -@ stdcall vkGetPhysicalDeviceImageFormatProperties(ptr long long long long long ptr) -@ stdcall vkGetPhysicalDeviceImageFormatProperties2(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceMemoryProperties(ptr ptr) -@ stdcall vkGetPhysicalDeviceMemoryProperties2(ptr ptr) -@ stdcall vkGetPhysicalDevicePresentRectanglesKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceProperties(ptr ptr) -@ stdcall vkGetPhysicalDeviceProperties2(ptr ptr) -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties2(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties(ptr long long long long long ptr ptr) -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties2(ptr ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceCapabilities2KHR(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceCapabilitiesKHR(ptr int64 ptr) -@ stdcall vkGetPhysicalDeviceSurfaceFormats2KHR(ptr ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceFormatsKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfacePresentModesKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceSupportKHR(ptr long int64 ptr) -@ stdcall vkGetPhysicalDeviceToolProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceWin32PresentationSupportKHR(ptr long) -@ stdcall vkGetPipelineCacheData(ptr int64 ptr ptr) -@ stdcall vkGetPrivateData(ptr long int64 int64 ptr) -@ stdcall vkGetQueryPoolResults(ptr int64 long long long ptr int64 long) -@ stdcall vkGetRenderAreaGranularity(ptr int64 ptr) -@ stdcall vkGetSemaphoreCounterValue(ptr int64 ptr) -@ stdcall vkGetSwapchainImagesKHR(ptr int64 ptr ptr) -@ stdcall vkInvalidateMappedMemoryRanges(ptr long ptr) -@ stdcall vkMapMemory(ptr int64 int64 int64 long ptr) -@ stdcall vkMergePipelineCaches(ptr int64 long ptr) -@ stdcall vkQueueBindSparse(ptr long ptr int64) -@ stdcall vkQueuePresentKHR(ptr ptr) -@ stdcall vkQueueSubmit(ptr long ptr int64) -@ stdcall vkQueueSubmit2(ptr long ptr int64) -@ stdcall vkQueueWaitIdle(ptr) -@ stdcall vkResetCommandBuffer(ptr long) -@ stdcall vkResetCommandPool(ptr int64 long) -@ stdcall vkResetDescriptorPool(ptr int64 long) -@ stdcall vkResetEvent(ptr int64) -@ stdcall vkResetFences(ptr long ptr) -@ stdcall vkResetQueryPool(ptr int64 long long) -@ stdcall vkSetEvent(ptr int64) -@ stdcall vkSetPrivateData(ptr long int64 int64 int64) -@ stdcall vkSignalSemaphore(ptr ptr) -@ stdcall vkTrimCommandPool(ptr int64 long) -@ stdcall vkUnmapMemory(ptr int64) -@ stdcall vkUpdateDescriptorSetWithTemplate(ptr int64 int64 ptr) -@ stdcall vkUpdateDescriptorSets(ptr long ptr long ptr) -@ stdcall vkWaitForFences(ptr long ptr long int64) -@ stdcall vkWaitSemaphores(ptr ptr int64) -@ stdcall -private DllRegisterServer() -@ stdcall -private DllUnregisterServer() diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 6439c78e2e9..7b89cd688b9 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -13,6 +13,7 @@ SOURCES = \ display.c \ dllmain.c \ event.c \ + fs.c \ graphics.c \ init.c \ keyboard.c \ diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 94aa06773a7..5d2392fe450 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1642,6 +1642,8 @@ static void update_surface_region( struct x11drv_window_surface *surface ) if (!shape_layered_windows) return; + if (wm_is_steamcompmgr(gdi_display)) return; + if (!surface->is_argb && surface->color_key == CLR_INVALID) { XShapeCombineMask( gdi_display, surface->window, ShapeBounding, 0, 0, None, ShapeSet ); @@ -1750,8 +1752,21 @@ static void update_surface_region( struct x11drv_window_surface *surface ) if ((data = X11DRV_GetRegionData( rgn, 0 ))) { - XShapeCombineRectangles( gdi_display, surface->window, ShapeBounding, 0, 0, - (XRectangle *)data->Buffer, data->rdh.nCount, ShapeSet, YXBanded ); + if (!data->rdh.nCount && wm_is_mutter(gdi_display)) + { + XRectangle xrect; + + xrect.x = xrect.y = -1; + xrect.width = 1; + xrect.height = 1; + XShapeCombineRectangles( gdi_display, surface->window, ShapeBounding, 0, 0, + &xrect, 1, ShapeSet, YXBanded ); + } + else + { + XShapeCombineRectangles( gdi_display, surface->window, ShapeBounding, 0, 0, + (XRectangle *)data->Buffer, data->rdh.nCount, ShapeSet, YXBanded ); + } free( data ); } diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 087e0aab79b..3714e15780d 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -83,6 +83,7 @@ #include "ntstatus.h" #define WIN32_NO_STATUS #include "x11drv.h" +#include "xfixes.h" #ifdef HAVE_X11_EXTENSIONS_XFIXES_H #include @@ -199,7 +200,6 @@ static UINT rendered_formats; static ULONG last_clipboard_update; static struct clipboard_format **current_x11_formats; static unsigned int nb_current_x11_formats; -static BOOL use_xfixes; Display *clipboard_display = NULL; @@ -2170,28 +2170,6 @@ static BOOL selection_notify_event( HWND hwnd, XEvent *event ) static void xfixes_init(void) { #ifdef SONAME_LIBXFIXES - typeof(XFixesSelectSelectionInput) *pXFixesSelectSelectionInput; - typeof(XFixesQueryExtension) *pXFixesQueryExtension; - typeof(XFixesQueryVersion) *pXFixesQueryVersion; - - int event_base, error_base; - int major = 3, minor = 0; - void *handle; - - handle = dlopen(SONAME_LIBXFIXES, RTLD_NOW); - if (!handle) return; - - pXFixesQueryExtension = dlsym(handle, "XFixesQueryExtension"); - if (!pXFixesQueryExtension) return; - pXFixesQueryVersion = dlsym(handle, "XFixesQueryVersion"); - if (!pXFixesQueryVersion) return; - pXFixesSelectSelectionInput = dlsym(handle, "XFixesSelectSelectionInput"); - if (!pXFixesSelectSelectionInput) return; - - if (!pXFixesQueryExtension(clipboard_display, &event_base, &error_base)) - return; - pXFixesQueryVersion(clipboard_display, &major, &minor); - use_xfixes = (major >= 1); if (!use_xfixes) return; pXFixesSelectSelectionInput(clipboard_display, import_window, x11drv_atom(CLIPBOARD), @@ -2205,7 +2183,7 @@ static void xfixes_init(void) XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); } - X11DRV_register_event_handler(event_base + XFixesSelectionNotify, + X11DRV_register_event_handler(xfixes_event_base + XFixesSelectionNotify, selection_notify_event, "XFixesSelectionNotify"); TRACE("xfixes succesully initialized\n"); #else diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index d6fa078e8a9..ba55b71deb4 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -86,6 +86,7 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height ) 0, 0, width, height, 0, default_visual.depth, InputOutput, default_visual.visual, CWEventMask | CWCursor | CWColormap, &win_attr ); if (!win) return FALSE; + X11DRV_XInput2_Enable( display, win, win_attr.event_mask ); XFlush( display ); X11DRV_init_desktop( win, width, height ); @@ -114,9 +115,9 @@ void X11DRV_resize_desktop(void) NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, width, height, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); - if (old_virtual_rect.left != virtual_rect.left || old_virtual_rect.top != virtual_rect.top) - send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, - old_virtual_rect.top, SMTO_ABORTIFHUNG, 2000, FALSE ); + /* HACK: always send the desktop resize notification, to eventually update fshack on windows */ + send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, + old_virtual_rect.top, SMTO_ABORTIFHUNG, 2000, FALSE ); old_virtual_rect = virtual_rect; } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 49475571f71..a0cd93bac0f 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -30,6 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); static struct x11drv_display_device_handler host_handler; static struct x11drv_settings_handler settings_handler; +RECT native_screen_rect; #define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra)) @@ -61,6 +62,11 @@ void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *new_handle } } +struct x11drv_settings_handler X11DRV_Settings_GetHandler(void) +{ + return settings_handler; +} + /*********************************************************************** * Default handlers if resolution switching is not enabled * @@ -340,7 +346,6 @@ static LONG apply_display_settings( DEVMODEW *displays, x11drv_settings_id *ids, */ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid ) { - INT left_most = INT_MAX, top_most = INT_MAX; LONG count, ret = DISP_CHANGE_BADPARAM; x11drv_settings_id *ids; DEVMODEW *mode; @@ -348,18 +353,13 @@ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HW /* Convert virtual screen coordinates to root coordinates, and find display ids. * We cannot safely get the ids while changing modes, as the backend state may be invalidated. */ - for (count = 0, mode = displays; mode->dmSize; mode = NEXT_DEVMODEW(mode), count++) - { - left_most = min( left_most, mode->dmPosition.x ); - top_most = min( top_most, mode->dmPosition.y ); - } + for (count = 0, mode = displays; mode->dmSize; mode = NEXT_DEVMODEW( mode )) count++; if (!(ids = calloc( count, sizeof(*ids) ))) return DISP_CHANGE_FAILED; for (count = 0, mode = displays; mode->dmSize; mode = NEXT_DEVMODEW(mode), count++) { - if (!settings_handler.get_id( mode->dmDeviceName, !wcsicmp( mode->dmDeviceName, primary_name ), ids + count )) goto done; - mode->dmPosition.x -= left_most; - mode->dmPosition.y -= top_most; + BOOL is_primary = !wcsicmp( mode->dmDeviceName, primary_name ); + if (!settings_handler.get_id( mode->dmDeviceName, is_primary, ids + count )) goto done; } /* Detach displays first to free up CRTCs */ @@ -374,21 +374,33 @@ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HW POINT virtual_screen_to_root(INT x, INT y) { - RECT virtual = NtUserGetVirtualScreenRect(); + RECT virtual = fs_hack_get_real_virtual_screen(); POINT pt; - pt.x = x - virtual.left; - pt.y = y - virtual.top; + TRACE( "from %d,%d\n", x, y ); + + pt.x = x; + pt.y = y; + fs_hack_point_user_to_real( &pt ); + TRACE( "to real %s\n", wine_dbgstr_point( &pt ) ); + + pt.x -= virtual.left; + pt.y -= virtual.top; + TRACE( "to root %s\n", wine_dbgstr_point( &pt ) ); return pt; } POINT root_to_virtual_screen(INT x, INT y) { - RECT virtual = NtUserGetVirtualScreenRect(); + RECT virtual = fs_hack_get_real_virtual_screen(); POINT pt; + TRACE( "from root %d,%d\n", x, y ); pt.x = x + virtual.left; pt.y = y + virtual.top; + TRACE( "to real %s\n", wine_dbgstr_point( &pt ) ); + fs_hack_point_real_to_user( &pt ); + TRACE( "to user %s\n", wine_dbgstr_point( &pt ) ); return pt; } @@ -481,6 +493,11 @@ void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler } } +struct x11drv_display_device_handler X11DRV_DisplayDevices_GetHandler(void) +{ + return host_handler; +} + void X11DRV_DisplayDevices_RegisterEventHandlers(void) { if (host_handler.register_event_handlers) host_handler.register_event_handlers(); @@ -513,6 +530,26 @@ static const char *debugstr_devmodew( const DEVMODEW *devmode ) position ); } +static void fixup_device_id(UINT *vendor_id, UINT *device_id) +{ + const char *sgi; + + if (*vendor_id == 0x10de /* NVIDIA */ && (sgi = getenv("WINE_HIDE_NVIDIA_GPU")) && *sgi != '0') + { + *vendor_id = 0x1002; /* AMD */ + *device_id = 0x73df; /* RX 6700XT */ + } + else if (*vendor_id == 0x1002 /* AMD */ && (sgi = getenv("WINE_HIDE_AMD_GPU")) && *sgi != '0') + { + *vendor_id = 0x10de; /* NVIDIA */ + *device_id = 0x2487; /* RTX 3060 */ + } + else if (*vendor_id == 0x1002 && (*device_id == 0x163f || *device_id == 0x1435) && (sgi = getenv("WINE_HIDE_VANGOGH_GPU")) && *sgi != '0') + { + *device_id = 0x687f; /* Radeon RX Vega 56/64 */ + } +} + BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) { struct gdi_adapter *adapters; @@ -534,6 +571,8 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage for (gpu = 0; gpu < gpu_count; gpu++) { + fixup_device_id( &gpus[gpu].vendor_id, &gpus[gpu].device_id ); + device_manager->add_gpu( &gpus[gpu], param ); /* Initialize adapters */ @@ -600,4 +639,6 @@ void X11DRV_DisplayDevices_Init(BOOL force) if (force) force_display_devices_refresh = TRUE; /* trigger refresh in win32u */ NtUserGetDisplayConfigBufferSizes( QDC_ONLY_ACTIVE_PATHS, &num_path, &num_mode ); + + if (!native_screen_rect.bottom) native_screen_rect = NtUserGetVirtualScreenRect(); } diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 97ebf4ae0d6..48903cd5623 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -233,9 +233,6 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) case ButtonPress: case ButtonRelease: return (mask & QS_MOUSEBUTTON) != 0; -#ifdef GenericEvent - case GenericEvent: -#endif case MotionNotify: case EnterNotify: case LeaveNotify: @@ -250,11 +247,42 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) case PropertyNotify: case ClientMessage: return (mask & QS_POSTMESSAGE) != 0; +#ifdef GenericEvent + case GenericEvent: +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + if (event->xcookie.extension == xinput2_opcode) return (mask & QS_INPUT) != 0; +#endif + /* fallthrough */ +#endif default: return (mask & QS_SENDMESSAGE) != 0; } } +static void wait_grab_pointer( Display *display ) +{ + RECT rect; + + /* unnecessary on gamescope, windows cannot be moved with the mouse */ + if (wm_is_steamcompmgr( display )) return; + + /* release cursor grab held by any Wine process */ + NtUserGetClipCursor( &rect ); + NtUserClipCursor( NULL ); + + while (XGrabPointer( display, root_window, False, 0, GrabModeAsync, GrabModeAsync, + None, None, CurrentTime ) != GrabSuccess) + { + LARGE_INTEGER timeout = {.QuadPart = -10 * (ULONGLONG)10000}; + NtDelayExecution( FALSE, &timeout ); + } + + XUngrabPointer( display, CurrentTime ); + XFlush( display ); + + /* restore the previously used clipping rect */ + NtUserClipCursor( &rect ); +} enum event_merge_action { @@ -311,6 +339,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE */ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) { +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + struct x11drv_thread_data *thread_data = x11drv_thread_data(); +#endif + switch (prev->type) { case ConfigureNotify: @@ -342,19 +374,21 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) case GenericEvent: if (next->xcookie.extension != xinput2_opcode) break; if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; + if (thread_data->xi2_rawinput_only) break; + if (thread_data->warp_serial) break; return MERGE_KEEP; } break; case GenericEvent: if (prev->xcookie.extension != xinput2_opcode) break; if (prev->xcookie.evtype != XI_RawMotion) break; + if (thread_data->xi2_rawinput_only) break; switch (next->type) { case GenericEvent: if (next->xcookie.extension != xinput2_opcode) break; if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; + if (thread_data->warp_serial) break; return merge_raw_motion_events( prev->xcookie.data, next->xcookie.data ); #endif } @@ -405,13 +439,23 @@ static BOOL process_events( Display *display, Bool (*filter)(Display*, XEvent*,X { XEvent event, prev_event; int count = 0; - BOOL queued = FALSE; + BOOL queued = FALSE, overlay_enabled = FALSE, steam_keyboard_opened = FALSE; enum event_merge_action action = MERGE_DISCARD; + ULONG_PTR overlay_filter = QS_KEY | QS_MOUSEBUTTON | QS_MOUSEMOVE; + ULONG_PTR keyboard_filter = QS_MOUSEBUTTON | QS_MOUSEMOVE; + LARGE_INTEGER timeout = {0}; + + if (NtWaitForSingleObject(steam_overlay_event, FALSE, &timeout) == WAIT_OBJECT_0) + overlay_enabled = TRUE; + if (NtWaitForSingleObject(steam_keyboard_event, FALSE, &timeout) == WAIT_OBJECT_0) + steam_keyboard_opened = TRUE; prev_event.type = 0; while (XCheckIfEvent( display, &event, filter, (char *)arg )) { count++; + if (overlay_enabled && filter_event( display, &event, (char *)overlay_filter )) continue; + if (steam_keyboard_opened && filter_event( display, &event, (char *)keyboard_filter )) continue; if (XFilterEvent( &event, None )) { /* @@ -483,12 +527,12 @@ BOOL X11DRV_ProcessEvents( DWORD mask ) } /*********************************************************************** - * EVENT_x11_time_to_win32_time + * x11drv_time_to_ticks * * Make our timer and the X timer line up as best we can * Pass 0 to retrieve the current adjustment value (times -1) */ -DWORD EVENT_x11_time_to_win32_time(Time time) +DWORD x11drv_time_to_ticks( Time time ) { static DWORD adjust = 0; DWORD now = NtGetTickCount(); @@ -549,10 +593,10 @@ static void set_input_focus( struct x11drv_win_data *data ) if (!data->whole_window) return; - if (EVENT_x11_time_to_win32_time(0)) + if (x11drv_time_to_ticks(0)) /* ICCCM says don't use CurrentTime, so try to use last message time if possible */ /* FIXME: this is not entirely correct */ - timestamp = NtUserGetThreadInfo()->message_time - EVENT_x11_time_to_win32_time(0); + timestamp = NtUserGetThreadInfo()->message_time - x11drv_time_to_ticks(0); else timestamp = CurrentTime; @@ -576,6 +620,8 @@ static void set_focus( Display *display, HWND hwnd, Time time ) Window win; GUITHREADINFO threadinfo; + wait_grab_pointer( display ); + TRACE( "setting foreground window to %p\n", hwnd ); NtUserSetForegroundWindow( hwnd ); @@ -597,8 +643,10 @@ static void set_focus( Display *display, HWND hwnd, Time time ) /********************************************************************** * handle_manager_message */ -static void handle_manager_message( HWND hwnd, XClientMessageEvent *event ) +static void handle_manager_message( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; + if (hwnd != NtUserGetDesktopWindow()) return; if (systray_atom && event->data.l[1] == systray_atom) @@ -612,8 +660,9 @@ static void handle_manager_message( HWND hwnd, XClientMessageEvent *event ) /********************************************************************** * handle_wm_protocols */ -static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) +static void handle_wm_protocols( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; Atom protocol = (Atom)event->data.l[0]; Time event_time = (Time)event->data.l[1]; @@ -771,6 +820,17 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (is_virtual_desktop() && hwnd == NtUserGetDesktopWindow()) retry_grab_clipping_window(); if (hwnd == NtUserGetDesktopWindow()) return FALSE; + /* Focus was just restored but it can be right after super was + * pressed and gnome-shell needs a bit of time to respond and + * toggle the activity view. If we grab the cursor right away + * it will cancel it and super key will do nothing. + */ + if (event->mode == NotifyUngrab && wm_is_mutter(event->display)) + { + LARGE_INTEGER timeout = {.QuadPart = 100 * -10000}; + NtDelayExecution( FALSE, &timeout ); + } + x11drv_thread_data()->keymapnotify_hwnd = hwnd; /* when keyboard grab is released, re-apply the cursor clipping rect */ @@ -792,7 +852,12 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (!hwnd) hwnd = x11drv_thread_data()->last_focus; if (hwnd && can_activate_window(hwnd)) set_focus( event->display, hwnd, CurrentTime ); } - else NtUserSetForegroundWindow( hwnd ); + else + { + wait_grab_pointer( event->display ); + NtUserSetForegroundWindow( hwnd ); + } + return TRUE; } @@ -801,8 +866,30 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) */ static void focus_out( Display *display , HWND hwnd ) { + struct x11drv_win_data *data; + if (xim_in_compose_mode()) return; + data = get_win_data(hwnd); + if(data){ + LARGE_INTEGER frequency, counter; + ULONGLONG now; + NtQueryPerformanceCounter( &counter, &frequency ); + now = 1000 * counter.QuadPart / frequency.QuadPart; + if(data->take_focus_back > 0 && + now >= data->take_focus_back && + now - data->take_focus_back < 1000){ + data->take_focus_back = 0; + TRACE("workaround mutter bug, taking focus back\n"); + XSetInputFocus( data->display, data->whole_window, RevertToParent, CurrentTime); + release_win_data(data); + /* don't inform win32 client */ + return; + } + data->take_focus_back = 0; + release_win_data(data); + } + x11drv_thread_data()->last_focus = hwnd; xim_set_focus( hwnd, FALSE ); @@ -836,9 +923,21 @@ static void focus_out( Display *display , HWND hwnd ) static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) { XFocusChangeEvent *event = &xev->xfocus; + struct x11drv_win_data *data; TRACE( "win %p xwin %lx detail=%s mode=%s\n", hwnd, event->window, focus_details[event->detail], focus_modes[event->mode] ); + if ((data = get_win_data( hwnd ))) + { + if (data->fake_unmap_serial == event->serial) + { + release_win_data( data ); + TRACE( "Ignoring event from intermediate unmap.\n" ); + return FALSE; + } + release_win_data( data ); + } + if (event->detail == NotifyPointer) { if (!hwnd && event->window == x11drv_thread_data()->clip_window) @@ -892,7 +991,10 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) rect.right = pos.x + event->width; rect.bottom = pos.y + event->height; - if (event->window != data->client_window) + if (layered_window_client_hack && event->window == data->client_window) + OffsetRect( &rect, data->client_rect.left - data->whole_rect.left, + data->client_rect.top - data->whole_rect.top ); + if (layered_window_client_hack || event->window != data->client_window) { if (data->surface) { @@ -1064,6 +1166,12 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) event->serial, data->configure_serial ); goto done; } + if (data->pending_fullscreen) + { + TRACE( "win %p/%lx event %d,%d,%dx%d pending_fullscreen is pending, so ignoring\n", hwnd, + data->whole_window, event->x, event->y, event->width, event->height ); + goto done; + } /* Get geometry */ @@ -1085,8 +1193,21 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) } else pos = root_to_virtual_screen( x, y ); - X11DRV_X_to_window_rect( data, &rect, pos.x, pos.y, event->width, event->height ); - if (root_coords) NtUserMapWindowPoints( 0, parent, (POINT *)&rect, 2 ); + if (data->fs_hack) + { + MONITORINFO info = {.cbSize = sizeof(MONITORINFO)}; + HMONITOR monitor; + + monitor = fs_hack_monitor_from_hwnd( hwnd ); + NtUserGetMonitorInfo( monitor, &info ); + rect = info.rcMonitor; + TRACE( "monitor %p rect: %s\n", monitor, wine_dbgstr_rect( &rect ) ); + } + else + { + X11DRV_X_to_window_rect( data, &rect, pos.x, pos.y, event->width, event->height ); + if (root_coords) NtUserMapWindowPoints( 0, parent, (POINT *)&rect, 2 ); + } TRACE( "win %p/%lx new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n", hwnd, data->whole_window, (int)rect.left, (int)rect.top, @@ -1095,6 +1216,33 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) /* Compare what has changed */ + { + const char *steamgameid = getenv( "SteamGameId" ); + + if (steamgameid && !strcmp( steamgameid, "590380" )) + { + /* Into The Breach is extremely picky about the size of its window. */ + if (NtUserIsWindowRectFullScreen( &data->whole_rect ) && NtUserIsWindowRectFullScreen( &rect )) + { + TRACE( "window is fullscreen and new size is also fullscreen, so preserving window size\n" ); + rect.right = rect.left + (data->whole_rect.right - data->whole_rect.left); + rect.bottom = rect.top + (data->whole_rect.bottom - data->whole_rect.top); + } + } + else if (steamgameid && !strcmp( steamgameid, "863550" )) + { + /* When going fullscreen WMs may set intermediate window sizes (e. g., excluding taskbar) before finally + * settle with the correct fullscreen window size. Hitman 2 is quick to react on window size change + * and trigger window resize again which randomly triggers the process to repeat. */ + if (data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN) && NtUserIsWindowRectFullScreen( &data->whole_rect ) + && !NtUserIsWindowRectFullScreen( &rect )) + { + TRACE( "Window is fullscreen, ignoring.\n" ); + goto done; + } + } + } + x = rect.left; y = rect.top; cx = rect.right - rect.left; @@ -1274,7 +1422,7 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat TRACE( "restoring win %p/%lx\n", data->hwnd, data->whole_window ); release_win_data( data ); if ((style & (WS_MINIMIZE | WS_VISIBLE)) == (WS_MINIMIZE | WS_VISIBLE)) - NtUserSetActiveWindow( hwnd ); + NtUserSetForegroundWindow( hwnd ); send_message( hwnd, WM_SYSCOMMAND, SC_RESTORE, 0 ); return; } @@ -1298,15 +1446,92 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat } +static void handle__net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) +{ + struct x11drv_win_data *data = get_win_data( hwnd ); + + if (data->pending_fullscreen) + { + read_net_wm_states( event->display, data ); + if (data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) + { + data->pending_fullscreen = FALSE; + TRACE( "PropertyNotify _NET_WM_STATE, now %#x, pending_fullscreen no longer pending.\n", (UINT)data->net_wm_state ); + } + else TRACE( "PropertyNotify _NET_WM_STATE, now %#x, pending_fullscreen still pending.\n", (UINT)data->net_wm_state ); + } + + release_win_data( data ); +} + +static int handle_gamescope_focused_app_error( Display *dpy, XErrorEvent *event, void *arg ) +{ + WARN( "Failed to read GAMESCOPE_FOCUSED_APP property, ignoring.\n" ); + return 1; +} + +static void handle_gamescope_focused_app( XPropertyEvent *event ) +{ + static const char *sgi = NULL; + static BOOL steam_keyboard_opened; + + unsigned long count, remaining, *property; + int format, app_id, focused_app_id; + BOOL keyboard_opened; + Atom type; + + if (!sgi && !(sgi = getenv( "SteamGameId" ))) return; + app_id = atoi( sgi ); + + X11DRV_expect_error( event->display, handle_gamescope_focused_app_error, NULL ); + XGetWindowProperty( event->display, DefaultRootWindow( event->display ), x11drv_atom( GAMESCOPE_FOCUSED_APP ), + 0, ~0UL, False, XA_CARDINAL, &type, &format, &count, &remaining, (unsigned char **)&property ); + if (X11DRV_check_error()) focused_app_id = app_id; + else + { + if (!property) focused_app_id = app_id; + else focused_app_id = *property; + XFree( property ); + } + + keyboard_opened = app_id != focused_app_id; + if (steam_keyboard_opened == keyboard_opened) return; + steam_keyboard_opened = keyboard_opened; + + FIXME( "HACK: Got app id %u, focused app %u\n", app_id, focused_app_id ); + if (keyboard_opened) + { + FIXME( "HACK: Steam Keyboard is opened, filtering events.\n" ); + NtSetEvent( steam_keyboard_event, NULL ); + } + else + { + FIXME( "HACK: Steam Keyboard is closed, stopping events filter.\n" ); + NtResetEvent( steam_keyboard_event, NULL ); + } +} + /*********************************************************************** * X11DRV_PropertyNotify */ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) { XPropertyEvent *event = &xev->xproperty; + char *name; + + if (event->atom == x11drv_atom( GAMESCOPE_FOCUSED_APP )) handle_gamescope_focused_app( event ); if (!hwnd) return FALSE; + + name = XGetAtomName( event->display, event->atom ); + if (name) + { + TRACE( "win %p PropertyNotify atom: %s, state: 0x%x\n", hwnd, name, event->state ); + XFree( name ); + } + if (event->atom == x11drv_atom(WM_STATE)) handle_wm_state_notify( hwnd, event, TRUE ); + else if (event->atom == x11drv_atom( _NET_WM_STATE )) handle__net_wm_state_notify( hwnd, event ); return TRUE; } @@ -1460,6 +1685,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event ) Window win, w_aux_root, w_aux_child; if (!(data = get_win_data( hWnd ))) return; + ERR( "TODO: fs hack\n" ); cx = data->whole_rect.right - data->whole_rect.left; cy = data->whole_rect.bottom - data->whole_rect.top; win = data->whole_window; @@ -1567,8 +1793,10 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) /********************************************************************** * handle_xembed_protocol */ -static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event ) +static void handle_xembed_protocol( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; + switch (event->data.l[1]) { case XEMBED_EMBEDDED_NOTIFY: @@ -1623,8 +1851,9 @@ static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event ) /********************************************************************** * handle_dnd_protocol */ -static void handle_dnd_protocol( HWND hwnd, XClientMessageEvent *event ) +static void handle_dnd_protocol( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; Window root, child; int root_x, root_y, child_x, child_y; unsigned int u; @@ -1646,8 +1875,9 @@ static void handle_dnd_protocol( HWND hwnd, XClientMessageEvent *event ) * * Handle an XdndEnter event. */ -static void handle_xdnd_enter_event( HWND hWnd, XClientMessageEvent *event ) +static void handle_xdnd_enter_event( HWND hWnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; struct format_entry *data; unsigned long count = 0; Atom *xdndtypes; @@ -1750,8 +1980,9 @@ static long drop_effect_to_xdnd_action( UINT effect ) } -static void handle_xdnd_position_event( HWND hwnd, XClientMessageEvent *event ) +static void handle_xdnd_position_event( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; struct dnd_position_event_params params; XClientMessageEvent e; UINT effect; @@ -1783,8 +2014,9 @@ static void handle_xdnd_position_event( HWND hwnd, XClientMessageEvent *event ) } -static void handle_xdnd_drop_event( HWND hwnd, XClientMessageEvent *event ) +static void handle_xdnd_drop_event( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; XClientMessageEvent e; DWORD effect; @@ -1804,7 +2036,7 @@ static void handle_xdnd_drop_event( HWND hwnd, XClientMessageEvent *event ) } -static void handle_xdnd_leave_event( HWND hwnd, XClientMessageEvent *event ) +static void handle_xdnd_leave_event( HWND hwnd, XEvent *xev ) { x11drv_client_call( client_dnd_leave_event, 0 ); } @@ -1812,8 +2044,8 @@ static void handle_xdnd_leave_event( HWND hwnd, XClientMessageEvent *event ) struct client_message_handler { - int atom; /* protocol atom */ - void (*handler)(HWND, XClientMessageEvent *); /* corresponding handler function */ + int atom; /* protocol atom */ + void (*handler)(HWND, XEvent *); /* corresponding handler function */ }; static const struct client_message_handler client_messages[] = @@ -1849,7 +2081,7 @@ static BOOL X11DRV_ClientMessage( HWND hwnd, XEvent *xev ) { if (event->message_type == X11DRV_Atoms[client_messages[i].atom - FIRST_XATOM]) { - client_messages[i].handler( hwnd, event ); + client_messages[i].handler( hwnd, xev ); return TRUE; } } diff --git a/dlls/winex11.drv/fs.c b/dlls/winex11.drv/fs.c new file mode 100644 index 00000000000..73824021060 --- /dev/null +++ b/dlls/winex11.drv/fs.c @@ -0,0 +1,1030 @@ +/* + * Fullscreen Hack + * + * Simulate monitor resolution change + * + * Copyright 2020 Andrew Eikum for CodeWeavers + * Copyright 2020 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include + +#include "x11drv.h" +#include "wine/debug.h" +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(fshack); + +static struct x11drv_display_device_handler real_device_handler; +static struct x11drv_settings_handler real_settings_handler; + +static BOOL initialized; + +/* A table of resolutions some games expect but host system may not report */ +static const struct +{ + SIZE size; + BOOL additional; +} +fs_monitor_sizes[] = +{ + {{640, 480}}, /* 4:3 */ + {{800, 600}}, /* 4:3 */ + {{1024, 768}}, /* 4:3 */ + {{1600, 1200}}, /* 4:3 */ + {{960, 540}}, /* 16:9 */ + {{1280, 720}}, /* 16:9 */ + {{1600, 900}}, /* 16:9 */ + {{1920, 1080}}, /* 16:9 */ + {{2560, 1440}}, /* 16:9 */ + {{2880, 1620}}, /* 16:9 */ + {{3200, 1800}}, /* 16:9 */ + {{1440, 900}}, /* 8:5 */ + {{1680, 1050}}, /* 8:5 */ + {{1920, 1200}}, /* 8:5 */ + {{2560, 1600}}, /* 8:5 */ + {{1440, 960}}, /* 3:2 */ + {{1920, 1280}}, /* 3:2 */ + {{2560, 1080}}, /* 21:9 ultra-wide */ + {{1920, 800}}, /* 12:5 */ + {{3840, 1600}}, /* 12:5 */ + {{1280, 1024}}, /* 5:4 */ + {{1280, 768}, TRUE }, +}; + +/* A fake monitor for the fullscreen hack */ +struct fs_monitor +{ + struct list entry; + UINT_PTR gpu_id; + x11drv_settings_id settings_id; + + DEVMODEW user_mode; /* Mode changed to by users */ + DEVMODEW real_mode; /* Mode actually used by the host system */ + double user_to_real_scale; /* Scale factor from fake monitor to real monitor */ + POINT top_left; /* Top left corner of the fake monitor rectangle in real virtual screen coordinates */ +}; + +/* Access to fs_monitors is protected by fs_lock */ +static pthread_mutex_t fs_lock = PTHREAD_MUTEX_INITIALIZER; +static struct list fs_monitors = LIST_INIT( fs_monitors ); + +static WORD gamma_ramp_i[GAMMA_RAMP_SIZE * 3]; +static float gamma_ramp[GAMMA_RAMP_SIZE * 4]; +static LONG gamma_serial; + +#define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra)) + +static const char *debugstr_devmode( const DEVMODEW *devmode ) +{ + char buffer[256], *buf = buffer; + + if (devmode->dmFields & DM_BITSPERPEL) + buf += sprintf( buf, "bits %u ", (int)devmode->dmBitsPerPel ); + if (devmode->dmFields & DM_PELSWIDTH) + buf += sprintf( buf, "width %u ", (int)devmode->dmPelsWidth ); + if (devmode->dmFields & DM_PELSHEIGHT) + buf += sprintf( buf, "height %u ", (int)devmode->dmPelsHeight ); + if (devmode->dmFields & DM_DISPLAYFREQUENCY) + buf += sprintf( buf, "%u Hz ", (int)devmode->dmDisplayFrequency ); + if (devmode->dmFields & DM_POSITION) + buf += sprintf( buf, "pos (%d,%d) ", (int)devmode->dmPosition.x, (int)devmode->dmPosition.y ); + if (devmode->dmFields & DM_DISPLAYFLAGS) + buf += sprintf( buf, "flags %#x ", (int)devmode->dmDisplayFlags ); + if (devmode->dmFields & DM_DISPLAYORIENTATION) + buf += sprintf( buf, "orientation %u ", (int)devmode->dmDisplayOrientation ); + + return wine_dbg_sprintf("%s", buffer); +} + +static struct fs_monitor *find_adapter_monitor( struct list *monitors, struct gdi_adapter *adapter, DEVMODEW *mode ) +{ + struct fs_monitor *monitor; + + LIST_FOR_EACH_ENTRY( monitor, monitors, struct fs_monitor, entry ) + { + if (monitor->real_mode.dmPosition.x != mode->dmPosition.x) continue; + if (monitor->real_mode.dmPosition.y != mode->dmPosition.y) continue; + if (monitor->real_mode.dmPelsWidth != mode->dmPelsWidth) continue; + if (monitor->real_mode.dmPelsHeight != mode->dmPelsHeight) continue; + return monitor; + } + + return NULL; +} + +static void update_gpu_monitor_list( struct gdi_gpu *gpu, struct list *monitors ) +{ + struct gdi_adapter *adapters; + struct fs_monitor *monitor; + int count; + + if (!real_device_handler.get_adapters( gpu->id, &adapters, &count )) return; + + while (count--) + { + struct gdi_adapter *adapter = adapters + count; + BOOL is_primary = adapter->state_flags & DISPLAY_DEVICE_PRIMARY_DEVICE; + x11drv_settings_id settings_id; + DEVMODEW mode = {0}; + WCHAR devname[32]; + char buffer[32]; + + TRACE( "adapter %p id %p\n", adapter, (void *)adapter->id ); + + /* Get the settings handler id for the adapter */ + snprintf( buffer, sizeof(buffer), "\\\\.\\DISPLAY%d", count + 1 ); + asciiz_to_unicode( devname, buffer ); + if (!real_settings_handler.get_id( devname, is_primary, &settings_id )) break; + + if (!real_settings_handler.get_current_mode( settings_id, &mode )) + { + WARN( "Failed to get current display mode\n" ); + continue; + } + + if ((monitor = find_adapter_monitor( monitors, adapter, &mode ))) + { + TRACE( "Reusing monitor %p, mode %s\n", monitor, debugstr_devmode( &mode ) ); + list_remove( &monitor->entry ); + } + else if (!(monitor = calloc( 1, sizeof(*monitor) ))) + { + WARN( "Failed to allocate monitor\n" ); + continue; + } + else + { + monitor->gpu_id = gpu->id; + monitor->user_mode = mode; + monitor->real_mode = mode; + monitor->user_to_real_scale = 1.0; + monitor->top_left.x = mode.dmPosition.x; + monitor->top_left.y = mode.dmPosition.y; + + TRACE( "Created monitor %p, mode %s\n", monitor, debugstr_devmode( &mode ) ); + } + + monitor->settings_id = settings_id; + list_add_tail( &fs_monitors, &monitor->entry ); + } + + real_device_handler.free_adapters( adapters ); +} + +static void update_monitor_list( struct gdi_gpu *gpus, int count ) +{ + struct list monitors = LIST_INIT( monitors ); + struct fs_monitor *monitor, *next; + + list_move_tail( &monitors, &fs_monitors ); + + while (count--) + { + struct list gpu_monitors = LIST_INIT( gpu_monitors ); + struct gdi_gpu *gpu = gpus + count; + + TRACE( "gpu %p id %p\n", gpu, (void *)gpu->id ); + + LIST_FOR_EACH_ENTRY_SAFE( monitor, next, &monitors, struct fs_monitor, entry ) + { + if (monitor->gpu_id != gpu->id) continue; + list_remove( &monitor->entry ); + list_add_tail( &gpu_monitors, &monitor->entry ); + } + + update_gpu_monitor_list( gpu, &gpu_monitors ); + + list_move_tail( &monitors, &gpu_monitors ); + } + + LIST_FOR_EACH_ENTRY_SAFE( monitor, next, &monitors, struct fs_monitor, entry ) + { + TRACE( "Removing stale monitor %p with gpu id %p, adapter id %p\n", + monitor, (void *)monitor->gpu_id, (void *)monitor->settings_id.id ); + free( monitor ); + } +} + +static void modes_append( DEVMODEW *modes, UINT *mode_count, UINT *resolutions, DEVMODEW *mode ) +{ + BOOL is_new_resolution; + const char *appid; + int i; + + /* Titan Souls renders incorrectly if we report modes smaller than 800x600 */ + if ((appid = getenv( "SteamAppId" )) && !strcmp( appid, "297130" )) + { + if (mode->dmDisplayOrientation == DMDO_DEFAULT || mode->dmDisplayOrientation == DMDO_180) + { + if (mode->dmPelsHeight <= 600 && !(mode->dmPelsHeight == 600 && mode->dmPelsWidth == 800)) return; + } + else + { + if (mode->dmPelsWidth <= 600 && !(mode->dmPelsWidth == 600 && mode->dmPelsHeight == 800)) return; + } + } + + is_new_resolution = TRUE; + + for (i = 0; i < *mode_count; ++i) + { + if (modes[i].dmPelsWidth != mode->dmPelsWidth) continue; + if (modes[i].dmPelsHeight != mode->dmPelsHeight) continue; + is_new_resolution = FALSE; + + if (modes[i].dmBitsPerPel != mode->dmBitsPerPel) continue; + if (modes[i].dmDisplayFrequency != mode->dmDisplayFrequency) continue; + if (modes[i].dmDisplayOrientation != mode->dmDisplayOrientation) continue; + if ((mode->dmFields & DM_DISPLAYFIXEDOUTPUT) != (modes[i].dmFields & DM_DISPLAYFIXEDOUTPUT)) continue; + if (mode->dmFields & DM_DISPLAYFIXEDOUTPUT && modes[i].dmDisplayFixedOutput != mode->dmDisplayFixedOutput) continue; + return; /* The exact mode is already added, nothing to do */ + } + + if (is_new_resolution) + { + /* Some games crash if we report too many unique resolutions (in terms of HxW) */ + if (limit_number_of_resolutions && *resolutions >= limit_number_of_resolutions) return; + *resolutions = *resolutions + 1; + } + + mode->dmFields = DM_DISPLAYORIENTATION | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | + DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY | (mode->dmFields & DM_DISPLAYFIXEDOUTPUT); + mode->dmSize = sizeof(DEVMODEW); + mode->dmDriverExtra = 0; + mode->dmDisplayFlags = 0; + + TRACE( "adding mode %s\n", debugstr_devmode(mode) ); + + modes[*mode_count] = *mode; + *mode_count = *mode_count + 1; +} + +static void monitor_get_modes( struct fs_monitor *monitor, DEVMODEW **modes, UINT *mode_count ) +{ + UINT i, j, max_count, real_mode_count, resolutions = 0; + DEVMODEW *real_modes, *real_mode, mode_host = {0}; + BOOL additional_modes = FALSE, center_modes = FALSE, landscape; + const char *env; + + *mode_count = 0; + *modes = NULL; + + if (!real_settings_handler.get_current_mode( monitor->settings_id, &mode_host )) return; + /* Fullscreen hack doesn't support changing display orientations */ + if (!real_settings_handler.get_modes( monitor->settings_id, 0, &real_modes, &real_mode_count )) return; + + if ((env = getenv( "WINE_CENTER_DISPLAY_MODES" ))) + center_modes = (env[0] != '0'); + else if ((env = getenv( "SteamAppId" ))) + center_modes = !strcmp( env, "359870" ); + + if ((env = getenv( "WINE_CENTER_DISPLAY_MODES" ))) + center_modes = (env[0] != '0'); + else if ((env = getenv( "SteamAppId" ))) + center_modes = !strcmp( env, "359870" ); + + max_count = ARRAY_SIZE(fs_monitor_sizes) * DEPTH_COUNT + real_mode_count; + if (center_modes) max_count += ARRAY_SIZE(fs_monitor_sizes) + real_mode_count; + + if (!(*modes = calloc( max_count, sizeof(DEVMODEW) ))) + { + real_settings_handler.free_modes( real_modes ); + return; + } + + /* Check the ratio of dmPelsWidth to dmPelsHeight to determine whether the host is currently in + * portrait or landscape orientation. DMDO_DEFAULT is the natural orientation of the device, + * which isn't necessarily a landscape mode */ + landscape = mode_host.dmPelsWidth >= mode_host.dmPelsHeight; + + /* Add the current mode early, in case we have to limit */ + modes_append( *modes, mode_count, &resolutions, &mode_host ); + + if ((env = getenv( "WINE_ADDITIONAL_DISPLAY_MODES" ))) + additional_modes = (env[0] != '0'); + else if ((env = getenv( "SteamAppId" ))) + additional_modes = !strcmp( env, "979400" ); + + /* Linux reports far fewer resolutions than Windows. Add modes that some games may expect. */ + for (i = 0; i < ARRAY_SIZE(fs_monitor_sizes); ++i) + { + DEVMODEW mode = mode_host; + + if (!additional_modes && fs_monitor_sizes[i].additional) continue; + + if (landscape) + { + mode.dmPelsWidth = fs_monitor_sizes[i].size.cx; + mode.dmPelsHeight = fs_monitor_sizes[i].size.cy; + } + else + { + mode.dmPelsWidth = fs_monitor_sizes[i].size.cy; + mode.dmPelsHeight = fs_monitor_sizes[i].size.cx; + } + + /* Don't report modes that are larger than the current mode */ + if (mode.dmPelsWidth > mode_host.dmPelsWidth) continue; + if (mode.dmPelsHeight > mode_host.dmPelsHeight) continue; + + for (j = 0; j < DEPTH_COUNT; ++j) + { + mode.dmBitsPerPel = depths[j]; + mode.dmDisplayFrequency = 60; + modes_append( *modes, mode_count, &resolutions, &mode ); + } + + if (center_modes && mode.dmPelsWidth != mode_host.dmPelsWidth && mode.dmPelsHeight != mode_host.dmPelsHeight) + { + mode.dmFields |= DM_DISPLAYFIXEDOUTPUT; + mode.dmDisplayFixedOutput = DMDFO_CENTER; + modes_append( *modes, mode_count, &resolutions, &mode ); + } + } + + for (i = 0, real_mode = real_modes; i < real_mode_count; ++i) + { + DEVMODEW mode = *real_mode; + + /* Don't report modes that are larger than the current mode */ + if (mode.dmPelsWidth <= mode_host.dmPelsWidth && mode.dmPelsHeight <= mode_host.dmPelsHeight) + { + modes_append( *modes, mode_count, &resolutions, &mode ); + + if (center_modes && mode.dmPelsWidth != mode_host.dmPelsWidth && mode.dmPelsHeight != mode_host.dmPelsHeight) + { + mode.dmFields |= DM_DISPLAYFIXEDOUTPUT; + mode.dmDisplayFixedOutput = DMDFO_CENTER; + modes_append( *modes, mode_count, &resolutions, &mode ); + } + } + + real_mode = NEXT_DEVMODEW(real_mode); + } + + real_settings_handler.free_modes( real_modes ); +} + +static struct fs_monitor *monitor_from_settings_id( x11drv_settings_id settings_id ) +{ + struct fs_monitor *monitor; + struct gdi_gpu *gpus; + int count; + + pthread_mutex_lock( &fs_lock ); + + LIST_FOR_EACH_ENTRY( monitor, &fs_monitors, struct fs_monitor, entry ) + if (!memcmp( &monitor->settings_id, &settings_id, sizeof(settings_id) )) return monitor; + + if (real_device_handler.get_gpus( &gpus, &count, FALSE )) + { + update_monitor_list( gpus, count ); + real_device_handler.free_gpus( gpus ); + + LIST_FOR_EACH_ENTRY( monitor, &fs_monitors, struct fs_monitor, entry ) + if (!memcmp( &monitor->settings_id, &settings_id, sizeof(settings_id) )) return monitor; + } + + WARN( "Failed to find monitor for adapter id %p\n", (void *)settings_id.id ); + pthread_mutex_unlock( &fs_lock ); + return NULL; +} + +static void monitor_release( struct fs_monitor *monitor ) +{ + pthread_mutex_unlock( &fs_lock ); +} + +static BOOL fs_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **new_modes, UINT *mode_count ) +{ + struct fs_monitor *monitor; + + TRACE( "id %#zx, flags %#x, modes %p, modes_count %p\n", + (size_t)id.id, (int)flags, new_modes, mode_count ); + + if ((monitor = monitor_from_settings_id( id ))) + { + monitor_get_modes( monitor, new_modes, mode_count ); + monitor_release( monitor ); + } + + return monitor && *new_modes; +} + +static void fs_free_modes( DEVMODEW *modes ) +{ + free( modes ); +} + +static BOOL fs_get_current_mode( x11drv_settings_id settings_id, DEVMODEW *mode ) +{ + struct fs_monitor *monitor; + + TRACE( "settings_id %p, mode %p\n", (void *)settings_id.id, mode ); + + if ((monitor = monitor_from_settings_id( settings_id ))) + { + *mode = monitor->user_mode; + monitor_release( monitor ); + } + + return !!monitor; +} + +static LONG fs_set_current_mode( x11drv_settings_id settings_id, const DEVMODEW *user_mode ) +{ + static const WCHAR fshackW[] = {'f','s','h','a','c','k',0}; + struct fs_monitor *fs_monitor; + DEVMODEW real_mode; + double scale; + + TRACE( "settings_id %p, mode %s\n", (void *)settings_id.id, debugstr_devmode( user_mode ) ); + + if (!(fs_monitor = monitor_from_settings_id( settings_id ))) + return DISP_CHANGE_FAILED; + + if (is_detached_mode( &fs_monitor->real_mode ) && !is_detached_mode( user_mode )) + { + monitor_release( fs_monitor ); + FIXME( "Attaching adapters is unsupported with fullscreen hack.\n" ); + return DISP_CHANGE_SUCCESSFUL; + } + + /* Real modes may be changed since initialization */ + if (!real_settings_handler.get_current_mode( settings_id, &real_mode )) + { + monitor_release( fs_monitor ); + return DISP_CHANGE_FAILED; + } + + fs_monitor->user_mode = *user_mode; + fs_monitor->real_mode = real_mode; + lstrcpyW( fs_monitor->user_mode.dmDeviceName, fshackW ); + + if (is_detached_mode( user_mode )) + { + fs_monitor->user_to_real_scale = 0; + fs_monitor->top_left.x = 0; + fs_monitor->top_left.y = 0; + } + /* Integer scaling */ + else if (fs_hack_is_integer()) + { + scale = min( real_mode.dmPelsWidth / user_mode->dmPelsWidth, + real_mode.dmPelsHeight / user_mode->dmPelsHeight ); + fs_monitor->user_to_real_scale = scale; + fs_monitor->top_left.x = real_mode.dmPosition.x + + (real_mode.dmPelsWidth - user_mode->dmPelsWidth * scale) / 2; + fs_monitor->top_left.y = real_mode.dmPosition.y + + (real_mode.dmPelsHeight - user_mode->dmPelsHeight * scale) / 2; + } + /* If real mode is narrower than fake mode, scale to fit width */ + else if ((double)real_mode.dmPelsWidth / (double)real_mode.dmPelsHeight < + (double)user_mode->dmPelsWidth / (double)user_mode->dmPelsHeight) + { + scale = (double)real_mode.dmPelsWidth / (double)user_mode->dmPelsWidth; + fs_monitor->user_to_real_scale = scale; + fs_monitor->top_left.x = real_mode.dmPosition.x; + fs_monitor->top_left.y = real_mode.dmPosition.y + + (real_mode.dmPelsHeight - user_mode->dmPelsHeight * scale) / 2; + } + /* Else scale to fit height */ + else + { + scale = (double)real_mode.dmPelsHeight / (double)user_mode->dmPelsHeight; + fs_monitor->user_to_real_scale = scale; + fs_monitor->top_left.x = real_mode.dmPosition.x + + (real_mode.dmPelsWidth - user_mode->dmPelsWidth * scale) / 2; + fs_monitor->top_left.y = real_mode.dmPosition.y; + } + + TRACE( "real_mode x %d y %d width %d height %d\n", (int)real_mode.dmPosition.x, + (int)real_mode.dmPosition.y, (int)real_mode.dmPelsWidth, (int)real_mode.dmPelsHeight ); + TRACE( "user_mode x %d y %d width %d height %d\n", (int)user_mode->dmPosition.x, + (int)user_mode->dmPosition.y, (int)user_mode->dmPelsWidth, (int)user_mode->dmPelsHeight ); + TRACE( "user_to_real_scale %lf\n", fs_monitor->user_to_real_scale ); + TRACE( "top left corner:%s\n", wine_dbgstr_point( &fs_monitor->top_left ) ); + + monitor_release( fs_monitor ); + return DISP_CHANGE_SUCCESSFUL; +} + +/* Display device handler functions */ + +static BOOL fs_get_gpus( struct gdi_gpu **gpus, int *count, BOOL get_properties ) +{ + TRACE( "gpus %p, count %p\n", gpus, count ); + + if (!real_device_handler.get_gpus( gpus, count, get_properties )) return FALSE; + + pthread_mutex_lock( &fs_lock ); + update_monitor_list( *gpus, *count ); + pthread_mutex_unlock( &fs_lock ); + + return TRUE; +} + +static BOOL fs_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **new_monitors, int *count ) +{ + struct fs_monitor *fs_monitor; + struct gdi_monitor *monitor; + RECT rect; + INT i; + + TRACE( "adapter_id %p, monitors %p, count %p\n", (void *)adapter_id, new_monitors, count ); + + if (!real_device_handler.get_monitors( adapter_id, new_monitors, count )) return FALSE; + + pthread_mutex_lock( &fs_lock ); + + for (i = 0; i < *count; ++i) + { + monitor = &(*new_monitors)[i]; + + LIST_FOR_EACH_ENTRY( fs_monitor, &fs_monitors, struct fs_monitor, entry ) + { + rect.left = fs_monitor->real_mode.dmPosition.x; + rect.top = fs_monitor->real_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->real_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->real_mode.dmPelsHeight; + + if (EqualRect( &rect, &monitor->rc_monitor )) + { + monitor->rc_monitor.left = fs_monitor->user_mode.dmPosition.x; + monitor->rc_monitor.top = fs_monitor->user_mode.dmPosition.y; + monitor->rc_monitor.right = monitor->rc_monitor.left + fs_monitor->user_mode.dmPelsWidth; + monitor->rc_monitor.bottom = monitor->rc_monitor.top + fs_monitor->user_mode.dmPelsHeight; + monitor->rc_work = monitor->rc_monitor; + monitor->state_flags = DISPLAY_DEVICE_ATTACHED; + if (fs_monitor->user_mode.dmPelsWidth && fs_monitor->user_mode.dmPelsHeight) + monitor->state_flags |= DISPLAY_DEVICE_ACTIVE; + } + } + } + + pthread_mutex_unlock( &fs_lock ); + + return TRUE; +} + +/* Fullscreen hack helpers */ + +static struct fs_monitor *monitor_from_handle( HMONITOR handle ) +{ + MONITORINFOEXW info = {.cbSize = sizeof(MONITORINFOEXW)}; + x11drv_settings_id settings_id; + BOOL is_primary; + + TRACE( "handle %p\n", handle ); + + if (!initialized) return NULL; + + if (!NtUserGetMonitorInfo( handle, (MONITORINFO *)&info )) return NULL; + is_primary = !!(info.dwFlags & MONITORINFOF_PRIMARY); + if (!real_settings_handler.get_id( info.szDevice, is_primary, &settings_id )) return NULL; + return monitor_from_settings_id( settings_id ); +} + +/* Return whether fullscreen hack is enabled on a specific monitor */ +BOOL fs_hack_enabled( HMONITOR monitor ) +{ + struct fs_monitor *fs_monitor; + BOOL enabled = FALSE; + + TRACE( "monitor %p\n", monitor ); + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + if (fs_monitor->user_mode.dmPelsWidth != fs_monitor->real_mode.dmPelsWidth || + fs_monitor->user_mode.dmPelsHeight != fs_monitor->real_mode.dmPelsHeight) + enabled = TRUE; + monitor_release( fs_monitor ); + } + + TRACE( "enabled: %s\n", enabled ? "TRUE" : "FALSE" ); + return enabled; +} + +BOOL fs_hack_mapping_required( HMONITOR monitor ) +{ + BOOL required; + + TRACE( "monitor %p\n", monitor ); + + /* steamcompmgr does our mapping for us */ + required = !wm_is_steamcompmgr( NULL ) && fs_hack_enabled( monitor ); + TRACE( "required: %s\n", required ? "TRUE" : "FALSE" ); + return required; +} + +/* Return whether integer scaling is on */ +BOOL fs_hack_is_integer(void) +{ + static int is_int = -1; + if (is_int < 0) + { + const char *e = getenv( "WINE_FULLSCREEN_INTEGER_SCALING" ); + is_int = e && strcmp( e, "0" ); + } + TRACE( "is_interger_scaling: %s\n", is_int ? "TRUE" : "FALSE" ); + return is_int; +} + +HMONITOR fs_hack_monitor_from_rect( const RECT *in_rect ) +{ + RECT rect = *in_rect; + + TRACE( "rect %s\n", wine_dbgstr_rect( &rect ) ); + rect.right = rect.left + 1; + rect.bottom = rect.top + 1; + return NtUserMonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY ); +} + +/* Get the monitor a window is on. MonitorFromWindow() doesn't work here because it finds the + * monitor with the maximum overlapped rectangle when a window is spanned over two monitors, whereas + * for the fullscreen hack, the monitor where the left top corner of the window is on is the correct + * one. For example, a game with a window of 3840x2160 changes the primary monitor to 1280x720, if + * there is a secondary monitor of 3840x2160 to the right, MonitorFromWindow() will return the + * secondary monitor instead of the primary one. */ +HMONITOR fs_hack_monitor_from_hwnd( HWND hwnd ) +{ + RECT rect = {0}; + + if (!NtUserGetWindowRect( hwnd, &rect )) ERR( "Invalid hwnd %p.\n", hwnd ); + + TRACE( "hwnd %p rect %s\n", hwnd, wine_dbgstr_rect( &rect ) ); + return fs_hack_monitor_from_rect( &rect ); +} + +/* Return the rectangle of a monitor in current mode in user virtual screen coordinates */ +RECT fs_hack_current_mode( HMONITOR monitor ) +{ + struct fs_monitor *fs_monitor; + RECT rect = {0}; + + TRACE( "monitor %p\n", monitor ); + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + rect.left = fs_monitor->user_mode.dmPosition.x; + rect.top = fs_monitor->user_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->user_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->user_mode.dmPelsHeight; + monitor_release( fs_monitor ); + } + + TRACE( "current mode rect: %s\n", wine_dbgstr_rect( &rect ) ); + return rect; +} + +/* Return the rectangle of a monitor in real mode in real virtual screen coordinates */ +RECT fs_hack_real_mode( HMONITOR monitor ) +{ + struct fs_monitor *fs_monitor; + RECT rect = {0}; + + TRACE( "monitor %p\n", monitor ); + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + rect.left = fs_monitor->real_mode.dmPosition.x; + rect.top = fs_monitor->real_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->real_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->real_mode.dmPelsHeight; + monitor_release( fs_monitor ); + } + + TRACE( "real mode rect: %s\n", wine_dbgstr_rect( &rect ) ); + return rect; +} + +/* Return whether a window rectangle is fullscreen on a fshack monitor */ +BOOL fs_hack_is_window_rect_fullscreen( HMONITOR monitor, const RECT *rect ) +{ + MONITORINFO info = {.cbSize = sizeof(MONITORINFO)}; + BOOL fullscreen; + + TRACE( "monitor %p\n", monitor ); + + if (!NtUserGetMonitorInfo( monitor, &info )) return FALSE; + + fullscreen = rect->left <= info.rcMonitor.left && rect->right >= info.rcMonitor.right && + rect->top <= info.rcMonitor.top && rect->bottom >= info.rcMonitor.bottom; + TRACE( "fullscreen: %s\n", fullscreen ? "TRUE" : "FALSE" ); + + return fullscreen; +} + +/* Transform a point in user virtual screen coordinates to real virtual screen coordinates */ +void fs_hack_point_user_to_real( POINT *pos ) +{ + struct fs_monitor *fs_monitor; + RECT rect; + + TRACE( "from %s\n", wine_dbgstr_point( pos ) ); + + if (wm_is_steamcompmgr( NULL )) return; + + pthread_mutex_lock( &fs_lock ); + LIST_FOR_EACH_ENTRY( fs_monitor, &fs_monitors, struct fs_monitor, entry ) + { + rect.left = fs_monitor->user_mode.dmPosition.x; + rect.top = fs_monitor->user_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->user_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->user_mode.dmPelsHeight; + + if (PtInRect( &rect, *pos )) + { + pos->x -= fs_monitor->user_mode.dmPosition.x; + pos->y -= fs_monitor->user_mode.dmPosition.y; + pos->x = lround( pos->x * fs_monitor->user_to_real_scale ); + pos->y = lround( pos->y * fs_monitor->user_to_real_scale ); + pos->x += fs_monitor->top_left.x; + pos->y += fs_monitor->top_left.y; + pthread_mutex_unlock( &fs_lock ); + TRACE( "to %s\n", wine_dbgstr_point( pos ) ); + return; + } + } + pthread_mutex_unlock( &fs_lock ); + WARN( "%s not transformed.\n", wine_dbgstr_point( pos ) ); +} + +/* Transform a point in real virtual screen coordinates to user virtual screen coordinates */ +void fs_hack_point_real_to_user( POINT *pos ) +{ + struct fs_monitor *fs_monitor; + RECT rect; + + TRACE( "from %s\n", wine_dbgstr_point( pos ) ); + + if (wm_is_steamcompmgr( NULL )) return; + + pthread_mutex_lock( &fs_lock ); + LIST_FOR_EACH_ENTRY( fs_monitor, &fs_monitors, struct fs_monitor, entry ) + { + rect.left = fs_monitor->real_mode.dmPosition.x; + rect.top = fs_monitor->real_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->real_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->real_mode.dmPelsHeight; + + if (PtInRect( &rect, *pos )) + { + pos->x -= fs_monitor->top_left.x; + pos->y -= fs_monitor->top_left.y; + pos->x = lround( pos->x / fs_monitor->user_to_real_scale ); + pos->y = lround( pos->y / fs_monitor->user_to_real_scale ); + pos->x += fs_monitor->user_mode.dmPosition.x; + pos->y += fs_monitor->user_mode.dmPosition.y; + pos->x = max( pos->x, fs_monitor->user_mode.dmPosition.x ); + pos->y = max( pos->y, fs_monitor->user_mode.dmPosition.y ); + pos->x = min( pos->x, fs_monitor->user_mode.dmPosition.x + + (INT)fs_monitor->user_mode.dmPelsWidth - 1 ); + pos->y = min( pos->y, fs_monitor->user_mode.dmPosition.y + + (INT)fs_monitor->user_mode.dmPelsHeight - 1 ); + pthread_mutex_unlock( &fs_lock ); + TRACE( "to %s\n", wine_dbgstr_point( pos ) ); + return; + } + } + pthread_mutex_unlock( &fs_lock ); + WARN( "%s not transformed.\n", wine_dbgstr_point( pos ) ); +} + +/* Transform RGNDATA in user virtual screen coordinates to real virtual screen coordinates. + * This is for clipping. Be sure to use Unsorted for Xlib calls after this transformation because + * this may break the requirement of using YXBanded. For example, say there are two monitors aligned + * horizontally with the primary monitor on the right. Each of monitor is of real resolution + * 1920x1080 and the fake primary monitor resolution is 1024x768. Then (0, 10, 1024, 768) should be + * transformed to (0, 14, 1920, 1080). While (1024, 10, 2944, 1080) should be transformed to + * (1920, 10, 3840, 1080) and this is breaking YXBanded because it requires y in non-decreasing order */ +void fs_hack_rgndata_user_to_real( RGNDATA *data ) +{ + unsigned int i; + XRectangle *xrect; + RECT rect; + + if (!data || wm_is_steamcompmgr( NULL )) return; + + xrect = (XRectangle *)data->Buffer; + for (i = 0; i < data->rdh.nCount; i++) + { + rect.left = xrect[i].x; + rect.top = xrect[i].y; + rect.right = xrect[i].x + xrect[i].width; + rect.bottom = xrect[i].y + xrect[i].height; + TRACE( "from rect %s\n", wine_dbgstr_rect( &rect ) ); + fs_hack_rect_user_to_real( &rect ); + TRACE( "to rect %s\n", wine_dbgstr_rect( &rect ) ); + xrect[i].x = rect.left; + xrect[i].y = rect.top; + xrect[i].width = rect.right - rect.left; + xrect[i].height = rect.bottom - rect.top; + } +} + +/* Transform a rectangle in user virtual screen coordinates to real virtual screen coordinates. A + * difference compared to fs_hack_point_user_to_real() is that fs_hack_point_user_to_real() finds + * the wrong monitor if the point is on the right edge of the monitor rectangle. For example, when + * there are two monitors of real size 1920x1080, the primary monitor is of user mode 1024x768 and + * the secondary monitor is to the right. Rectangle (0, 0, 1024, 768) should transform to + * (0, 0, 1920, 1080). If (1024, 768) is passed to fs_hack_point_user_to_real(), + * fs_hack_point_user_to_real() will think (1024, 768) is on the secondary monitor, ends up + * returning a wrong result to callers. */ +void fs_hack_rect_user_to_real( RECT *rect ) +{ + struct fs_monitor *fs_monitor; + HMONITOR monitor; + RECT point; + + TRACE( "from %s\n", wine_dbgstr_rect( rect ) ); + + if (wm_is_steamcompmgr( NULL )) return; + + SetRect( &point, rect->left, rect->top, rect->left + 1, rect->top + 1 ); + monitor = NtUserMonitorFromRect( &point, MONITOR_DEFAULTTONEAREST ); + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + OffsetRect( rect, -fs_monitor->user_mode.dmPosition.x, + -fs_monitor->user_mode.dmPosition.y ); + rect->left = lround( rect->left * fs_monitor->user_to_real_scale ); + rect->right = lround( rect->right * fs_monitor->user_to_real_scale ); + rect->top = lround( rect->top * fs_monitor->user_to_real_scale ); + rect->bottom = lround( rect->bottom * fs_monitor->user_to_real_scale ); + OffsetRect( rect, fs_monitor->top_left.x, fs_monitor->top_left.y ); + monitor_release( fs_monitor ); + } + + TRACE( "to %s\n", wine_dbgstr_rect( rect ) ); +} + +/* Get the user_to_real_scale value in a monitor */ +double fs_hack_get_user_to_real_scale( HMONITOR monitor ) +{ + struct fs_monitor *fs_monitor; + double scale = 1.0; + + TRACE( "monitor %p\n", monitor ); + + if (wm_is_steamcompmgr( NULL )) return scale; + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + scale = fs_monitor->user_to_real_scale; + monitor_release( fs_monitor ); + } + + TRACE( "scale %lf\n", scale ); + return scale; +} + +/* Get the scaled scree size of a monitor */ +SIZE fs_hack_get_scaled_screen_size( HMONITOR monitor ) +{ + struct fs_monitor *fs_monitor; + SIZE size = {0}; + + TRACE( "monitor %p\n", monitor ); + + if ((fs_monitor = monitor_from_handle( monitor ))) + { + if (wm_is_steamcompmgr( NULL )) + { + size.cx = fs_monitor->user_mode.dmPelsWidth; + size.cy = fs_monitor->user_mode.dmPelsHeight; + } + else + { + size.cx = lround( fs_monitor->user_mode.dmPelsWidth * fs_monitor->user_to_real_scale ); + size.cy = lround( fs_monitor->user_mode.dmPelsHeight * fs_monitor->user_to_real_scale ); + } + monitor_release( fs_monitor ); + } + + TRACE( "width %d height %d\n", (int)size.cx, (int)size.cy ); + return size; +} + +/* Get the real virtual screen size instead of virtual screen size using fake modes */ +RECT fs_hack_get_real_virtual_screen(void) +{ + struct fs_monitor *fs_monitor; + RECT rect, virtual = {0}; + + pthread_mutex_lock( &fs_lock ); + LIST_FOR_EACH_ENTRY( fs_monitor, &fs_monitors, struct fs_monitor, entry ) + { + rect.left = fs_monitor->real_mode.dmPosition.x; + rect.top = fs_monitor->real_mode.dmPosition.y; + rect.right = rect.left + fs_monitor->real_mode.dmPelsWidth; + rect.bottom = rect.top + fs_monitor->real_mode.dmPelsHeight; + + union_rect( &virtual, &virtual, &rect ); + } + pthread_mutex_unlock( &fs_lock ); + TRACE( "real virtual screen rect:%s\n", wine_dbgstr_rect( &virtual ) ); + return virtual; +} + +/* Initialize the fullscreen hack, which is a layer on top of real settings handlers and real + * display device handlers */ +void fs_hack_init(void) +{ + struct x11drv_display_device_handler device_handler; + struct x11drv_settings_handler settings_handler; + struct gdi_gpu *gpus; + int count; + RECT rect; + + real_device_handler = X11DRV_DisplayDevices_GetHandler(); + real_settings_handler = X11DRV_Settings_GetHandler(); + + rect = get_host_primary_monitor_rect(); + xinerama_init( rect.right - rect.left, rect.bottom - rect.top ); + + settings_handler.name = "Fullscreen Hack"; + settings_handler.priority = 500; + settings_handler.get_id = real_settings_handler.get_id; + settings_handler.get_modes = fs_get_modes; + settings_handler.free_modes = fs_free_modes; + settings_handler.get_current_mode = fs_get_current_mode; + settings_handler.set_current_mode = fs_set_current_mode; + X11DRV_Settings_SetHandler( &settings_handler ); + + device_handler.name = "Fullscreen Hack"; + device_handler.priority = 500; + device_handler.get_gpus = fs_get_gpus; + device_handler.get_adapters = real_device_handler.get_adapters; + device_handler.get_monitors = fs_get_monitors; + device_handler.free_gpus = real_device_handler.free_gpus; + device_handler.free_adapters = real_device_handler.free_adapters; + device_handler.free_monitors = real_device_handler.free_monitors; + device_handler.register_event_handlers = real_device_handler.register_event_handlers; + X11DRV_DisplayDevices_SetHandler( &device_handler ); + + if (!real_device_handler.get_gpus( &gpus, &count, FALSE )) + { + ERR("Failed to initialize fshack monitor list.\n"); + return; + } + + pthread_mutex_lock( &fs_lock ); + update_monitor_list( gpus, count ); + pthread_mutex_unlock( &fs_lock ); + real_device_handler.free_gpus( gpus ); + + initialized = TRUE; +} + +const float *fs_hack_get_gamma_ramp( LONG *serial ) +{ + if (gamma_serial == 0) return NULL; + if (serial) *serial = gamma_serial; + return gamma_ramp; +} + +void fs_hack_set_gamma_ramp( const WORD *ramp ) +{ + int i; + if (memcmp( gamma_ramp_i, ramp, sizeof(gamma_ramp_i) ) == 0) + { + /* identical */ + return; + } + for (i = 0; i < GAMMA_RAMP_SIZE; ++i) + { + gamma_ramp[i * 4] = ramp[i] / 65535.f; + gamma_ramp[i * 4 + 1] = ramp[i + GAMMA_RAMP_SIZE] / 65535.f; + gamma_ramp[i * 4 + 2] = ramp[i + 2 * GAMMA_RAMP_SIZE] / 65535.f; + } + memcpy( gamma_ramp_i, ramp, sizeof(gamma_ramp_i) ); + InterlockedIncrement( &gamma_serial ); + TRACE( "new gamma serial: %u\n", (int)gamma_serial ); + if (gamma_serial == 0) + { + InterlockedIncrement( &gamma_serial ); + } +} diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 4a0564392bd..e3c8a4318c8 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -256,8 +256,9 @@ static void update_x11_clipping( X11DRV_PDEVICE *physDev, HRGN rgn ) } else if ((data = X11DRV_GetRegionData( rgn, 0 ))) { + fs_hack_rgndata_user_to_real( data ); XSetClipRectangles( gdi_display, physDev->gc, physDev->dc_rect.left, physDev->dc_rect.top, - (XRectangle *)data->Buffer, data->rdh.nCount, YXBanded ); + (XRectangle *)data->Buffer, data->rdh.nCount, Unsorted ); free( data ); } } diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 2cef05d2140..5576fdd50e6 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -243,18 +243,20 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d return TRUE; } break; - case X11DRV_FLUSH_GL_DRAWABLE: - if (in_count >= sizeof(struct x11drv_escape_flush_gl_drawable)) + case X11DRV_PRESENT_DRAWABLE: + if (in_count >= sizeof(struct x11drv_escape_present_drawable)) { - const struct x11drv_escape_flush_gl_drawable *data = in_data; + const struct x11drv_escape_present_drawable *data = in_data; RECT rect = physDev->dc_rect; + RECT real_rect = physDev->dc_rect; + fs_hack_rect_user_to_real( &real_rect ); OffsetRect( &rect, -physDev->dc_rect.left, -physDev->dc_rect.top ); if (data->flush) XFlush( gdi_display ); XSetFunction( gdi_display, physDev->gc, GXcopy ); - XCopyArea( gdi_display, data->gl_drawable, physDev->drawable, physDev->gc, - 0, 0, rect.right, rect.bottom, - physDev->dc_rect.left, physDev->dc_rect.top ); + XCopyArea( gdi_display, data->drawable, physDev->drawable, physDev->gc, + 0, 0, real_rect.right - real_rect.left, real_rect.bottom - real_rect.top, + real_rect.left, real_rect.top ); add_device_bounds( physDev, &rect ); return TRUE; } @@ -401,7 +403,6 @@ static const struct user_driver_funcs x11drv_funcs = .pNotifyIMEStatus = X11DRV_NotifyIMEStatus, .pDestroyCursorIcon = X11DRV_DestroyCursorIcon, .pSetCursor = X11DRV_SetCursor, - .pGetCursorPos = X11DRV_GetCursorPos, .pSetCursorPos = X11DRV_SetCursorPos, .pClipCursor = X11DRV_ClipCursor, .pSystrayDockInit = X11DRV_SystrayDockInit, diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 5c7f6c37276..a0e8047605c 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1121,6 +1121,7 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e) */ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT flags, UINT time ) { + RAWINPUT rawinput; INPUT input; TRACE_(key)( "hwnd %p vkey=%04x scan=%04x flags=%04x\n", hwnd, vkey, scan, flags ); @@ -1132,7 +1133,7 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT fl input.ki.time = time; input.ki.dwExtraInfo = 0; - __wine_send_input( hwnd, &input, NULL ); + __wine_send_input( hwnd, &input, &rawinput ); } @@ -1353,7 +1354,7 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) DWORD dwFlags; int ascii_chars; XIC xic = X11DRV_get_ic( hwnd ); - DWORD event_time = EVENT_x11_time_to_win32_time(event->time); + DWORD event_time = x11drv_time_to_ticks( event->time ); Status status = 0; TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", @@ -1439,6 +1440,35 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) return TRUE; } +/* From the point of view of this function there are two types of + * keys: those for which the mapping to vkey and scancode depends on + * the keyboard layout (i.e., letters, numbers, punctuation) and those + * for which it doesn't (control keys); since this function is used to + * recognize the keyboard layout and map keysyms to vkeys and + * scancodes, we are only concerned about the first type, and map + * everything in the second type to zero. + */ +static char keysym_to_char( KeySym keysym ) +{ + /* Dead keys */ + if (0xfe50 <= keysym && keysym < 0xfed0) + return KEYBOARD_MapDeadKeysym( keysym ); + + /* Control keys (there is nothing allocated below 0xfc00, but I + take some margin in case something is added in the future) */ + if (0xf000 <= keysym && keysym < 0x10000) + return 0; + + /* XFree86 vendor keys */ + if (0x10000000 <= keysym) + return 0; + + /* "Normal" keys: return last octet, because our tables don't have + more than that; it would be better to extend the tables and + compare the whole keysym, but it's a lot of work... */ + return keysym & 0xff; +} + /********************************************************************** * X11DRV_KEYBOARD_DetectLayout * @@ -1469,22 +1499,20 @@ X11DRV_KEYBOARD_DetectLayout( Display *display ) /* get data for keycode from X server */ for (i = 0; i < syms; i++) { if (!(keysym = XkbKeycodeToKeysym( display, keyc, 0, i ))) continue; - /* Allow both one-byte and two-byte national keysyms */ - if ((keysym < 0x8000) && (keysym != ' ')) + ckey[keyc][i] = keysym_to_char(keysym); + if (TRACE_ON(keyboard)) { - if (!XkbTranslateKeySym(display, &keysym, 0, &ckey[keyc][i], 1, NULL)) - { - TRACE("XKB could not translate keysym %04lx\n", keysym); - /* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent - * with appropriate ShiftMask and Mode_switch, use XLookupString - * to get character in the local encoding. - */ - ckey[keyc][i] = keysym & 0xFF; - } + char buf[32]; + WCHAR bufW[32]; + int len, lenW; + KeySym orig_keysym = keysym; + len = XkbTranslateKeySym(display, &keysym, 0, buf, sizeof(buf), NULL); + lenW = ntdll_umbstowcs(buf, len, bufW, ARRAY_SIZE(bufW)); + if (lenW < ARRAY_SIZE(bufW)) + bufW[lenW] = 0; + TRACE("keycode %u, index %d, orig_keysym 0x%04lx, keysym 0x%04lx, buf %s, bufW %s\n", + keyc, i, orig_keysym, keysym, debugstr_a(buf), debugstr_w(bufW)); } - else { - ckey[keyc][i] = KEYBOARD_MapDeadKeysym(keysym); - } } } @@ -1659,20 +1687,8 @@ void X11DRV_InitKeyboard( Display *display ) /* we seem to need to search the layout-dependent scancodes */ int maxlen=0,maxval=-1,ok; for (i=0; ixmapping); - X11DRV_InitKeyboard( event->xmapping.display ); + switch (event->xmapping.request) + { + case MappingModifier: + case MappingKeyboard: + XRefreshKeyboardMapping( &event->xmapping ); + X11DRV_InitKeyboard( event->xmapping.display ); + + hwnd = get_focus(); + if (!hwnd) hwnd = get_active_window(); + NtUserPostMessage( hwnd, WM_INPUTLANGCHANGEREQUEST, + 0 /*FIXME*/, (LPARAM)NtUserGetKeyboardLayout(0) ); + break; + + case MappingPointer: + X11DRV_InitMouse( event->xmapping.display ); + break; + } - hwnd = get_focus(); - if (!hwnd) hwnd = get_active_window(); - NtUserPostMessage( hwnd, WM_INPUTLANGCHANGEREQUEST, - 0 /*FIXME*/, (LPARAM)NtUserGetKeyboardLayout(0) ); return TRUE; } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 612fff9995c..655b0c67651 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -30,6 +30,9 @@ #include #include #include +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H +#include +#endif #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H #include #endif @@ -51,6 +54,7 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor); #define OEMRESOURCE #include "x11drv.h" +#include "xfixes.h" #include "winreg.h" #include "wine/server.h" #include "wine/debug.h" @@ -75,8 +79,8 @@ static const UINT button_down_flags[NB_BUTTONS] = MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_WHEEL, MOUSEEVENTF_WHEEL, - MOUSEEVENTF_HWHEEL, - MOUSEEVENTF_HWHEEL, + MOUSEEVENTF_XDOWN, /* FIXME: horizontal wheel */ + MOUSEEVENTF_XDOWN, MOUSEEVENTF_XDOWN, MOUSEEVENTF_XDOWN }; @@ -88,8 +92,8 @@ static const UINT button_up_flags[NB_BUTTONS] = MOUSEEVENTF_RIGHTUP, 0, 0, - 0, - 0, + MOUSEEVENTF_XUP, + MOUSEEVENTF_XUP, MOUSEEVENTF_XUP, MOUSEEVENTF_XUP }; @@ -101,8 +105,8 @@ static const UINT button_down_data[NB_BUTTONS] = 0, WHEEL_DELTA, -WHEEL_DELTA, - -WHEEL_DELTA, - WHEEL_DELTA, + XBUTTON1, + XBUTTON2, XBUTTON1, XBUTTON2 }; @@ -114,8 +118,8 @@ static const UINT button_up_data[NB_BUTTONS] = 0, 0, 0, - 0, - 0, + XBUTTON1, + XBUTTON2, XBUTTON1, XBUTTON2 }; @@ -137,6 +141,14 @@ MAKE_FUNCPTR(XISelectEvents); #undef MAKE_FUNCPTR #endif +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H +#define MAKE_FUNCPTR(f) static typeof(f) * p##f +MAKE_FUNCPTR(XOpenDevice); +MAKE_FUNCPTR(XCloseDevice); +MAKE_FUNCPTR(XGetDeviceButtonMapping); +#undef MAKE_FUNCPTR +#endif + /*********************************************************************** * X11DRV_Xcursor_Init * @@ -224,28 +236,93 @@ void set_window_cursor( Window window, HCURSOR handle ) XFlush( gdi_display ); } +struct mouse_button_mapping +{ + int deviceid; + unsigned int button_count; + unsigned char buttons[256]; +}; + +static struct mouse_button_mapping *pointer_mapping; +static struct mouse_button_mapping *device_mapping; + +static void update_pointer_mapping( Display *display ) +{ + struct mouse_button_mapping *tmp; + + if (!(tmp = malloc( sizeof(*tmp) ))) + { + WARN("Unable to allocate device mapping.\n"); + return; + } + + tmp->button_count = ARRAY_SIZE( tmp->buttons ); + tmp->button_count = XGetPointerMapping( display, tmp->buttons, tmp->button_count ); + + free( InterlockedExchangePointer( (void**)&pointer_mapping, tmp ) ); +} + +static void update_device_mapping( Display *display, int deviceid ) +{ +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H + struct mouse_button_mapping *tmp; + XDevice *device; + + if (!(device = pXOpenDevice( display, deviceid ))) + { + WARN( "Unable to open cursor device %d\n", deviceid ); + return; + } + + if (!(tmp = malloc( sizeof(*tmp) ))) + { + WARN( "Unable to allocate device mapping.\n" ); + pXCloseDevice( display, device ); + return; + } + + tmp->deviceid = deviceid; + tmp->button_count = ARRAY_SIZE( tmp->buttons ); + tmp->button_count = pXGetDeviceButtonMapping( display, device, tmp->buttons, tmp->button_count ); + + free( InterlockedExchangePointer( (void**)&device_mapping, tmp ) ); + + pXCloseDevice( display, device ); +#endif +} + +void X11DRV_InitMouse( Display *display ) +{ + update_pointer_mapping( display ); +} + #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H /*********************************************************************** * update_relative_valuators */ -static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuators) +static void update_relative_valuators( XIAnyClassInfo **classes, int num_classes ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); - int i; + XIValuatorClassInfo *valuator; thread_data->x_valuator.number = -1; thread_data->y_valuator.number = -1; - for (i = 0; i < n_valuators; i++) + while (num_classes--) + { + valuator = (XIValuatorClassInfo *)classes[num_classes]; + if (classes[num_classes]->type != XIValuatorClass) continue; + if (valuator->number == 0) thread_data->x_valuator = *valuator; + if (valuator->number == 1) thread_data->y_valuator = *valuator; + } + + if (thread_data->x_valuator.number < 0 || thread_data->y_valuator.number < 0) + WARN( "X/Y axis valuators not found, ignoring RawMotion events\n" ); + else if (thread_data->x_valuator.mode != thread_data->y_valuator.mode) { - XIValuatorClassInfo *class = (XIValuatorClassInfo *)valuators[i]; - if (valuators[i]->type != XIValuatorClass) continue; - if (class->label == x11drv_atom( Rel_X ) || - (!class->label && class->number == 0 && class->mode == XIModeRelative)) - thread_data->x_valuator = *class; - else if (class->label == x11drv_atom( Rel_Y ) || - (!class->label && class->number == 1 && class->mode == XIModeRelative)) - thread_data->y_valuator = *class; + WARN( "Relative/Absolute mismatch between X/Y axis, ignoring RawMotion events\n" ); + thread_data->x_valuator.number = -1; + thread_data->y_valuator.number = -1; } thread_data->x_valuator.value = 0; @@ -254,90 +331,80 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator /*********************************************************************** - * enable_xinput2 + * x11drv_xinput2_init */ -static void enable_xinput2(void) +void x11drv_xinput2_init( struct x11drv_thread_data *data ) { - struct x11drv_thread_data *data = x11drv_thread_data(); - XIEventMask mask; - XIDeviceInfo *pointer_info; +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)]; + int major = 2, minor = 2; + XIEventMask mask; int count; - if (!xinput2_available) return; - - if (data->xi2_state == xi_unknown) + if (!xinput2_available || pXIQueryVersion( data->display, &major, &minor )) { - int major = 2, minor = 0; - if (!pXIQueryVersion( data->display, &major, &minor )) data->xi2_state = xi_disabled; - else - { - data->xi2_state = xi_unavailable; - WARN( "X Input 2 not available\n" ); - } + WARN( "XInput 2.0 not available\n" ); + xinput2_available = FALSE; + return; } - if (data->xi2_state == xi_unavailable) return; - if (!pXIGetClientPointer( data->display, None, &data->xi2_core_pointer )) return; + + TRACE( "XInput2 %d.%d available\n", major, minor ); mask.mask = mask_bits; mask.mask_len = sizeof(mask_bits); - mask.deviceid = XIAllDevices; + mask.deviceid = XIAllMasterDevices; memset( mask_bits, 0, sizeof(mask_bits) ); XISetMask( mask_bits, XI_DeviceChanged ); - XISetMask( mask_bits, XI_RawMotion ); - XISetMask( mask_bits, XI_ButtonPress ); - pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); - pointer_info = pXIQueryDevice( data->display, data->xi2_core_pointer, &count ); - update_relative_valuators( pointer_info->classes, pointer_info->num_classes ); - pXIFreeDeviceInfo( pointer_info ); - - /* This device info list is only used to find the initial current slave if - * no XI_DeviceChanged events happened. If any hierarchy change occurred that - * might be relevant here (eg. user switching mice after (un)plugging), a - * XI_DeviceChanged event will point us to the right slave. So this list is - * safe to be obtained statically at enable_xinput2() time. - */ - if (data->xi2_devices) pXIFreeDeviceInfo( data->xi2_devices ); - data->xi2_devices = pXIQueryDevice( data->display, XIAllDevices, &data->xi2_device_count ); - data->xi2_current_slave = 0; - - data->xi2_state = xi_enabled; + if (!pXIGetClientPointer( data->display, None, &data->xinput2_pointer )) + WARN( "Failed to get xinput2 master pointer device\n" ); + else + { + XIDeviceInfo *pointer_info = pXIQueryDevice( data->display, data->xinput2_pointer, &count ); + update_relative_valuators( pointer_info->classes, pointer_info->num_classes ); + pXIFreeDeviceInfo( pointer_info ); + } +#endif } -#endif /*********************************************************************** - * disable_xinput2 + * X11DRV_XInput2_Enable */ -static void disable_xinput2(void) +void X11DRV_XInput2_Enable( Display *display, Window window, long event_mask ) { -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H struct x11drv_thread_data *data = x11drv_thread_data(); + unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)]; + BOOL raw = (window == None); XIEventMask mask; - if (data->xi2_state != xi_enabled) return; + mask.mask = mask_bits; + mask.mask_len = sizeof(mask_bits); + mask.deviceid = XIAllMasterDevices; + memset( mask_bits, 0, sizeof(mask_bits) ); - TRACE( "disabling\n" ); - data->xi2_state = xi_disabled; + /* FIXME: steam overlay doesn't like if we use XI2 for non-raw events */ - mask.mask = NULL; - mask.mask_len = 0; - mask.deviceid = XIAllDevices; + if (raw && event_mask) + { + XISetMask( mask_bits, XI_RawMotion ); + if (data->xi2_rawinput_only) + { + XISetMask( mask_bits, XI_RawTouchBegin ); + XISetMask( mask_bits, XI_RawTouchUpdate ); + XISetMask( mask_bits, XI_RawTouchEnd ); + XISetMask( mask_bits, XI_RawButtonPress ); + XISetMask( mask_bits, XI_RawButtonRelease ); + } + } - pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); - pXIFreeDeviceInfo( data->xi2_devices ); - data->x_valuator.number = -1; - data->y_valuator.number = -1; - data->x_valuator.value = 0; - data->y_valuator.value = 0; - data->xi2_devices = NULL; - data->xi2_core_pointer = 0; - data->xi2_current_slave = 0; -#endif + XISetMask( mask_bits, XI_DeviceChanged ); + pXISelectEvents( display, raw ? DefaultRootWindow( display ) : window, &mask, 1 ); + if (!raw) XSelectInput( display, window, event_mask ); } +#endif /*********************************************************************** * grab_clipping_window @@ -351,6 +418,7 @@ static BOOL grab_clipping_window( const RECT *clip ) Window clip_window; HCURSOR cursor; POINT pos; + RECT real_clip; /* don't clip in the desktop process */ if (NtUserGetWindowThread( NtUserGetDesktopWindow(), NULL ) == GetCurrentThreadId()) return TRUE; @@ -367,21 +435,26 @@ static BOOL grab_clipping_window( const RECT *clip ) } /* enable XInput2 unless we are already clipping */ - if (!data->clipping_cursor) enable_xinput2(); - - if (data->xi2_state != xi_enabled) - { - WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) ); - NtUserClipCursor( NULL ); - return TRUE; - } + if (!data->clipping_cursor) X11DRV_XInput2_Enable( data->display, None, PointerMotionMask ); TRACE( "clipping to %s win %lx\n", wine_dbgstr_rect(clip), clip_window ); if (!data->clipping_cursor) XUnmapWindow( data->display, clip_window ); + + TRACE( "user clip rect %s\n", wine_dbgstr_rect( clip ) ); + + real_clip = *clip; + fs_hack_rect_user_to_real( &real_clip ); + pos = virtual_screen_to_root( clip->left, clip->top ); + + TRACE( "setting real clip to %s x (%d,%d)\n", wine_dbgstr_point( &pos ), + (int)real_clip.right - (int)real_clip.left, + (int)real_clip.bottom - (int)real_clip.top ); + XMoveResizeWindow( data->display, clip_window, pos.x, pos.y, - max( 1, clip->right - clip->left ), max( 1, clip->bottom - clip->top ) ); + max( 1, real_clip.right - real_clip.left ), + max( 1, real_clip.bottom - real_clip.top ) ); XMapWindow( data->display, clip_window ); /* if the rectangle is shrinking we may get a pointer warp */ @@ -407,7 +480,7 @@ static BOOL grab_clipping_window( const RECT *clip ) if (!clipping_cursor) { - disable_xinput2(); + X11DRV_XInput2_Enable( data->display, None, 0 ); return FALSE; } clip_rect = *clip; @@ -433,10 +506,17 @@ void ungrab_clipping_window(void) TRACE( "no longer clipping\n" ); XUnmapWindow( data->display, clip_window ); - if (clipping_cursor) XUngrabPointer( data->display, CurrentTime ); + if (clipping_cursor) + { + XUngrabPointer( data->display, CurrentTime ); + XFlush( data->display ); + } clipping_cursor = FALSE; data->clipping_cursor = FALSE; - disable_xinput2(); + + /* desktop window needs to listen to XInput2 events all the time for rawinput to work */ + if (NtUserGetWindowThread( NtUserGetDesktopWindow(), NULL ) != GetCurrentThreadId()) + X11DRV_XInput2_Enable( data->display, None, 0 ); } /*********************************************************************** @@ -485,11 +565,17 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x thread_data = x11drv_thread_data(); if (!thread_data->clipping_cursor) return; if (thread_data->clip_window != window) return; - pt.x += clip_rect.left; - pt.y += clip_rect.top; + pt.x = clip_rect.left; + pt.y = clip_rect.top; + fs_hack_point_user_to_real( &pt ); + + pt.x += input->mi.dx; + pt.y += input->mi.dy; + fs_hack_point_real_to_user( &pt ); } else if ((data = get_win_data( hwnd ))) { + if (data->fs_hack) fs_hack_point_real_to_user( &pt ); if (window == root_window) pt = root_to_virtual_screen( pt.x, pt.y ); else if (event_root == root_window) pt = root_to_virtual_screen( x_root, y_root ); else @@ -513,6 +599,8 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x input->mi.dy = pt.y; } + + /*********************************************************************** * send_mouse_input * @@ -1379,48 +1467,17 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) return FALSE; } - if (!clipping_cursor && - XGrabPointer( data->display, root_window, False, - PointerMotionMask | ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, None, CurrentTime ) != GrabSuccess) - { - WARN( "refusing to warp pointer to %u, %u without exclusive grab\n", (int)pos.x, (int)pos.y ); - return FALSE; - } + TRACE( "real setting to %s\n", wine_dbgstr_point( &pos ) ); + pXFixesHideCursor( data->display, root_window ); XWarpPointer( data->display, root_window, root_window, 0, 0, 0, 0, pos.x, pos.y ); data->warp_serial = NextRequest( data->display ); - - if (!clipping_cursor) - XUngrabPointer( data->display, CurrentTime ); - - XNoOp( data->display ); + pXFixesShowCursor( data->display, root_window ); XFlush( data->display ); /* avoids bad mouse lag in games that do their own mouse warping */ - TRACE( "warped to %d,%d serial %lu\n", x, y, data->warp_serial ); + TRACE( "warped to (fake) %d,%d serial %lu\n", x, y, data->warp_serial ); return TRUE; } -/*********************************************************************** - * GetCursorPos (X11DRV.@) - */ -BOOL X11DRV_GetCursorPos(LPPOINT pos) -{ - Display *display = thread_init_display(); - Window root, child; - int rootX, rootY, winX, winY; - unsigned int xstate; - BOOL ret; - - ret = XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &winX, &winY, &xstate ); - if (ret) - { - POINT old = *pos; - *pos = root_to_virtual_screen( winX, winY ); - TRACE( "pointer at %s server pos %s\n", wine_dbgstr_point(pos), wine_dbgstr_point(&old) ); - } - return ret; -} - /*********************************************************************** * ClipCursor (X11DRV.@) */ @@ -1536,7 +1593,7 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) input.mi.dy = event->y; input.mi.mouseData = button_down_data[buttonNum]; input.mi.dwFlags = button_down_flags[buttonNum] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.time = x11drv_time_to_ticks( event->time ); input.mi.dwExtraInfo = 0; update_user_time( event->time ); @@ -1563,7 +1620,7 @@ BOOL X11DRV_ButtonRelease( HWND hwnd, XEvent *xev ) input.mi.dy = event->y; input.mi.mouseData = button_up_data[buttonNum]; input.mi.dwFlags = button_up_flags[buttonNum] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.time = x11drv_time_to_ticks( event->time ); input.mi.dwExtraInfo = 0; map_event_coords( hwnd, event->window, event->root, event->x_root, event->y_root, &input ); @@ -1587,10 +1644,10 @@ BOOL X11DRV_MotionNotify( HWND hwnd, XEvent *xev ) input.mi.dy = event->y; input.mi.mouseData = 0; input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.time = x11drv_time_to_ticks( event->time ); input.mi.dwExtraInfo = 0; - if (!hwnd && is_old_motion_event( event->serial )) + if (is_old_motion_event( event->serial )) { TRACE( "pos %d,%d old serial %lu, ignoring\n", event->x, event->y, event->serial ); return FALSE; @@ -1620,7 +1677,7 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev ) input.mi.dy = event->y; input.mi.mouseData = 0; input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.time = x11drv_time_to_ticks( event->time ); input.mi.dwExtraInfo = 0; if (is_old_motion_event( event->serial )) @@ -1636,54 +1693,44 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev ) #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H /*********************************************************************** - * X11DRV_DeviceChanged + * X11DRV_XIDeviceChangedEvent */ -static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev ) +static BOOL X11DRV_XIDeviceChangedEvent( XIDeviceChangedEvent *event ) { - XIDeviceChangedEvent *event = xev->data; struct x11drv_thread_data *data = x11drv_thread_data(); - if (event->deviceid != data->xi2_core_pointer) return FALSE; + if (event->deviceid != data->xinput2_pointer) return FALSE; if (event->reason != XISlaveSwitch) return FALSE; update_relative_valuators( event->classes, event->num_classes ); - data->xi2_current_slave = event->sourceid; + update_device_mapping( event->display, event->sourceid ); + return TRUE; } -static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input, RAWINPUT *rawinput ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; - double x_value = 0, y_value = 0, x_scale, y_scale; - const double *values = event->valuators.values; + const double *values = event->valuators.values, *raw_values = event->raw_values; + double x_raw = 0, y_raw = 0, x_value = 0, y_value = 0, x_scale, y_scale; RECT virtual_rect; int i; if (x->number < 0 || y->number < 0) return FALSE; if (!event->valuators.mask_len) return FALSE; - if (thread_data->xi2_state != xi_enabled) return FALSE; + if (event->deviceid != thread_data->xinput2_pointer) return FALSE; - /* If there is no slave currently detected, no previous motion nor device - * change events were received. Look it up now on the device list in this - * case. - */ - if (!thread_data->xi2_current_slave) - { - XIDeviceInfo *devices = thread_data->xi2_devices; - - for (i = 0; i < thread_data->xi2_device_count; i++) - { - if (devices[i].use != XISlavePointer) continue; - if (devices[i].deviceid != event->deviceid) continue; - if (devices[i].attachment != thread_data->xi2_core_pointer) continue; - thread_data->xi2_current_slave = event->deviceid; - break; - } - } - if (event->deviceid != thread_data->xi2_current_slave) return FALSE; + if (x->mode == XIModeRelative && y->mode == XIModeRelative) + input->mi.dwFlags &= ~(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK); + else if (x->mode == XIModeAbsolute && y->mode == XIModeAbsolute) + input->mi.dwFlags |= MOUSEEVENTF_ABSOLUTE; + else + FIXME( "Unsupported relative/absolute X/Y axis mismatch\n." ); - virtual_rect = NtUserGetVirtualScreenRect(); + if (input->mi.dwFlags & MOUSEEVENTF_VIRTUALDESK) SetRect( &virtual_rect, 0, 0, 65535, 65535 ); + else if (wm_is_steamcompmgr( event->display )) virtual_rect = native_screen_rect; + else virtual_rect = NtUserGetVirtualScreenRect(); if (x->max <= x->min) x_scale = 1; else x_scale = (virtual_rect.right - virtual_rect.left) / (x->max - x->min); @@ -1695,14 +1742,19 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (!XIMaskIsSet( event->valuators.mask, i )) continue; if (i == x->number) { + x_raw = *raw_values; x_value = *values; - x->value += x_value * x_scale; + if (x->mode == XIModeRelative) x->value += x_value * x_scale; + else x->value = (x_value - x->min) * x_scale; } if (i == y->number) { + y_raw = *raw_values; y_value = *values; - y->value += y_value * y_scale; + if (y->mode == XIModeRelative) y->value += y_value * y_scale; + else y->value = (y_value - y->min) * y_scale; } + raw_values++; values++; } @@ -1715,21 +1767,40 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) x->value -= input->mi.dx; y->value -= input->mi.dy; - if (!input->mi.dx && !input->mi.dy) + if (input->mi.dwFlags & MOUSEEVENTF_ABSOLUTE) + fs_hack_point_real_to_user( (POINT *)&input->mi.dx ); + else { - TRACE( "accumulating motion\n" ); - return FALSE; + double user_to_real_scale; + HMONITOR monitor; + RECT rect; + POINT pt; + + NtUserGetCursorPos( &pt ); + SetRect( &rect, pt.x, pt.y, pt.x + 1, pt.y + 1 ); + monitor = NtUserMonitorFromRect( &rect, MONITOR_DEFAULTTONULL ); + user_to_real_scale = fs_hack_get_user_to_real_scale( monitor ); + input->mi.dx = lround( (double)input->mi.dx / user_to_real_scale ); + input->mi.dy = lround( (double)input->mi.dy / user_to_real_scale ); } + if (x->mode != XIModeAbsolute) rawinput->data.mouse.lLastX = x_raw; + else rawinput->data.mouse.lLastX = input->mi.dx; + if (y->mode != XIModeAbsolute) rawinput->data.mouse.lLastY = y_raw; + else rawinput->data.mouse.lLastY = input->mi.dy; + return TRUE; } + /*********************************************************************** * X11DRV_RawMotion */ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) { + struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIRawEvent *event = xev->data; + RAWINPUT rawinput; INPUT input; if (broken_rawevents && is_old_motion_event( xev->serial )) @@ -1740,26 +1811,146 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) input.type = INPUT_MOUSE; input.mi.mouseData = 0; - input.mi.dwFlags = MOUSEEVENTF_MOVE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK; + input.mi.time = x11drv_time_to_ticks( event->time ); input.mi.dwExtraInfo = 0; input.mi.dx = 0; input.mi.dy = 0; - if (!map_raw_event_coords( event, &input )) return FALSE; + if (!map_raw_event_coords( event, &input, &rawinput )) return FALSE; + + if (!thread_data->xi2_rawinput_only) + __wine_send_input( 0, &input, NULL ); + else + { + rawinput.header.dwType = RIM_TYPEMOUSE; + rawinput.header.dwSize = offsetof(RAWINPUT, data) + sizeof(RAWMOUSE); + rawinput.header.hDevice = ULongToHandle(1); /* WINE_MOUSE_HANDLE */ + rawinput.header.wParam = RIM_INPUT; + rawinput.data.mouse.usFlags = input.mi.dwFlags; + rawinput.data.mouse.ulRawButtons = 0; + rawinput.data.mouse.usButtonData = 0; + rawinput.data.mouse.usButtonFlags = 0; + rawinput.data.mouse.ulExtraInformation = 0; + + input.type = INPUT_HARDWARE; + input.hi.uMsg = WM_INPUT; + input.hi.wParamH = 0; + input.hi.wParamL = 0; + if (rawinput.data.mouse.lLastX || rawinput.data.mouse.lLastY) + __wine_send_input( 0, &input, &rawinput ); + } - __wine_send_input( 0, &input, NULL ); return TRUE; } -#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ +/*********************************************************************** + * X11DRV_RawButtonEvent + */ +static BOOL X11DRV_RawButtonEvent( XGenericEventCookie *cookie ) +{ + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + XIRawEvent *event = cookie->data; + int button = event->detail - 1; + RAWINPUT rawinput; + INPUT input; + + if (!device_mapping || device_mapping->deviceid != event->sourceid) + update_device_mapping( event->display, event->sourceid ); + + if (button >= 0 && device_mapping) + button = device_mapping->buttons[button] - 1; + + if (button >= 0 && pointer_mapping) + button = pointer_mapping->buttons[button] - 1; + + if (button < 0 || button >= NB_BUTTONS) return FALSE; + if (event->deviceid != thread_data->xinput2_pointer) return FALSE; + + TRACE( "raw button %u (raw: %u) %s\n", button, event->detail, event->evtype == XI_RawButtonRelease ? "up" : "down" ); + rawinput.header.dwType = RIM_TYPEMOUSE; + rawinput.header.dwSize = offsetof(RAWINPUT, data) + sizeof(RAWMOUSE); + rawinput.header.hDevice = ULongToHandle(1); /* WINE_MOUSE_HANDLE */ + rawinput.header.wParam = RIM_INPUT; + if (event->evtype == XI_RawButtonRelease) + { + rawinput.data.mouse.usFlags = button_up_flags[button]; + rawinput.data.mouse.ulRawButtons = button_up_data[button]; + } + else + { + rawinput.data.mouse.usFlags = button_down_flags[button]; + rawinput.data.mouse.ulRawButtons = button_down_data[button]; + } + rawinput.data.mouse.usButtonData = 0; + rawinput.data.mouse.usButtonFlags = 0; + rawinput.data.mouse.lLastX = 0; + rawinput.data.mouse.lLastY = 0; + rawinput.data.mouse.ulExtraInformation = 0; + + input.type = INPUT_HARDWARE; + input.hi.uMsg = WM_INPUT; + input.hi.wParamH = 0; + input.hi.wParamL = 0; + if (rawinput.data.mouse.usFlags || rawinput.data.mouse.ulRawButtons) + __wine_send_input( 0, &input, &rawinput ); + return TRUE; +} + +static BOOL X11DRV_XIDeviceEvent( XIDeviceEvent *event ) +{ + DWORD button = event->detail - 1; + INPUT input; + HWND hwnd; + + if (XFindContext( event->display, event->event, winContext, (char **)&hwnd ) != 0) + hwnd = 0; /* not for a registered window */ + if (!hwnd && event->event == root_window) hwnd = NtUserGetDesktopWindow(); + + TRACE( "evtype %u hwnd %p/%lx pos %f,%f detail %u flags %#x serial %lu\n", + event->evtype, hwnd, event->event, event->event_x, event->event_y, event->detail, event->flags, event->serial ); + + if (is_old_motion_event( event->serial )) + { + TRACE( "pos %f,%f old serial %lu, ignoring\n", event->event_x, event->event_y, event->serial ); + return FALSE; + } + + input.mi.dx = event->event_x; + input.mi.dy = event->event_y; + input.mi.mouseData = 0; + input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; + input.mi.time = x11drv_time_to_ticks( event->time ); + input.mi.dwExtraInfo = 0; + + switch (event->evtype) + { + case XI_ButtonPress: + if (button >= NB_BUTTONS) return FALSE; + update_user_time( event->time ); + input.mi.mouseData = button_down_data[button]; + input.mi.dwFlags |= button_down_flags[button]; + break; + case XI_ButtonRelease: + if (button >= NB_BUTTONS) return FALSE; + input.mi.mouseData = button_up_data[button]; + input.mi.dwFlags |= button_up_flags[button]; + break; + } + + map_event_coords( hwnd, event->event, event->root, event->root_x, event->root_y, &input ); + send_mouse_input( hwnd, event->event, event->detail, &input ); + return TRUE; +} + +#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ /*********************************************************************** - * X11DRV_XInput2_Init + * x11drv_xinput2_load */ -void X11DRV_XInput2_Init(void) +void x11drv_xinput2_load(void) { -#if defined(SONAME_LIBXI) && defined(HAVE_X11_EXTENSIONS_XINPUT2_H) +#if defined(SONAME_LIBXI) int event, error; void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW ); @@ -1775,11 +1966,20 @@ void X11DRV_XInput2_Init(void) return; \ } +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H LOAD_FUNCPTR(XIGetClientPointer); LOAD_FUNCPTR(XIFreeDeviceInfo); LOAD_FUNCPTR(XIQueryDevice); LOAD_FUNCPTR(XIQueryVersion); LOAD_FUNCPTR(XISelectEvents); +#endif + +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H + LOAD_FUNCPTR(XOpenDevice); + LOAD_FUNCPTR(XCloseDevice); + LOAD_FUNCPTR(XGetDeviceButtonMapping); +#endif + #undef LOAD_FUNCPTR xinput2_available = XQueryExtension( gdi_display, "XInputExtension", &xinput2_opcode, &event, &error ); @@ -1794,6 +1994,78 @@ void X11DRV_XInput2_Init(void) #endif } +static BOOL X11DRV_RawTouchEvent( XGenericEventCookie *xev ) +{ + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + XIRawEvent *event = xev->data; + RAWINPUT rawinput = + { + .header = + { + .dwType = RIM_TYPEMOUSE, + .dwSize = offsetof(RAWINPUT, data) + sizeof(RAWMOUSE), + .hDevice = ULongToHandle(1), /* WINE_MOUSE_HANDLE */ + .wParam = RIM_INPUT, + }, + }; + INPUT input = + { + .type = INPUT_MOUSE, + }; + int flags = 0; + POINT pos; + + if (!map_raw_event_coords( event, &input, &rawinput )) return FALSE; + if (!(input.mi.dwFlags & MOUSEEVENTF_ABSOLUTE)) return FALSE; + pos.x = input.mi.dx; + pos.y = input.mi.dy; + + flags = POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_INCONTACT; + if (!thread_data->xi2_active_touches) thread_data->xi2_primary_touchid = event->detail; + if (thread_data->xi2_primary_touchid == event->detail) flags |= POINTER_MESSAGE_FLAG_PRIMARY; + + input.type = INPUT_HARDWARE; + switch (event->evtype) + { + case XI_RawTouchBegin: + input.hi.uMsg = WM_POINTERDOWN; + flags |= POINTER_MESSAGE_FLAG_NEW; + thread_data->xi2_active_touches++; + TRACE("XI_RawTouchBegin detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); + break; + case XI_RawTouchEnd: + input.hi.uMsg = WM_POINTERUP; + thread_data->xi2_active_touches--; + TRACE("XI_RawTouchEnd detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); + break; + case XI_RawTouchUpdate: + input.hi.uMsg = WM_POINTERUPDATE; + TRACE("XI_RawTouchUpdate detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); + break; + } + + rawinput.data.mouse.usFlags = 0; + rawinput.data.mouse.ulRawButtons = MAKELONG( event->detail, flags ); + + __wine_send_input( 0, &input, &rawinput ); + if (!(flags & POINTER_MESSAGE_FLAG_PRIMARY)) return TRUE; + + input.type = INPUT_MOUSE; + input.mi.mouseData = 0; + input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; + if (event->evtype == XI_RawTouchBegin) input.mi.dwFlags |= MOUSEEVENTF_LEFTDOWN; + if (event->evtype == XI_RawTouchEnd) input.mi.dwFlags |= MOUSEEVENTF_LEFTUP; + input.mi.time = x11drv_time_to_ticks( event->time ); + input.mi.dx = rawinput.data.mouse.lLastX; + input.mi.dy = rawinput.data.mouse.lLastY; + input.mi.dwExtraInfo = 0xff515700; + + rawinput.data.mouse.usFlags = input.mi.dwFlags; + rawinput.data.mouse.ulRawButtons = 0; + + __wine_send_input( 0, &input, &rawinput ); + return TRUE; +} /*********************************************************************** * X11DRV_GenericEvent @@ -1810,11 +2082,24 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) switch (event->evtype) { case XI_DeviceChanged: - ret = X11DRV_DeviceChanged( event ); - break; + return X11DRV_XIDeviceChangedEvent( event->data ); case XI_RawMotion: ret = X11DRV_RawMotion( event ); break; + case XI_RawButtonPress: + case XI_RawButtonRelease: + ret = X11DRV_RawButtonEvent( event ); + break; + case XI_Motion: + case XI_ButtonPress: + case XI_ButtonRelease: + return X11DRV_XIDeviceEvent( event->data ); + + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: + ret = X11DRV_RawTouchEvent( event ); + break; default: TRACE( "Unhandled event %#x\n", event->evtype ); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index bb8f13f78b9..23eb26420fa 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -37,12 +37,18 @@ #ifdef HAVE_SYS_UN_H #include #endif +#include +#include #include "x11drv.h" #include "xcomposite.h" #include "winternl.h" #include "wine/debug.h" +#ifndef ARRAY_SIZE +#define ARRAY_SIZE( array ) (sizeof(array) / sizeof((array)[0])) +#endif + #ifdef SONAME_LIBGL WINE_DEFAULT_DEBUG_CHANNEL(wgl); @@ -206,6 +212,17 @@ struct wgl_context struct gl_drawable *drawables[2]; struct gl_drawable *new_drawables[2]; BOOL refresh_drawables; + BOOL fs_hack; + BOOL fs_hack_integer; + BOOL is_core; + GLuint fs_hack_fbo, fs_hack_resolve_fbo; + GLuint fs_hack_color_texture, fs_hack_ds_texture; + GLuint fs_hack_color_renderbuffer, fs_hack_ds_renderbuffer; + GLuint fs_hack_gamma_pgm, ramp_ubo; + POINT setup_for; + GLuint current_draw_fbo, current_read_fbo; + BOOL drawing_to_front; + BOOL fs_hack_needs_resolve; struct list entry; }; @@ -218,18 +235,38 @@ enum dc_gl_type DC_GL_PBUFFER /* pseudo memory DC using a PBuffer */ }; +enum dc_gl_layered_type +{ + DC_GL_LAYERED_NONE, + DC_GL_LAYERED_UPDATES, + DC_GL_LAYERED_ATTRIBUTES, +}; + struct gl_drawable { LONG ref; /* reference count */ enum dc_gl_type type; /* type of GL surface */ + HWND hwnd; GLXDrawable drawable; /* drawable for rendering with GL */ Window window; /* window if drawable is a GLXWindow */ + Colormap colormap; /* colormap for the client window */ Pixmap pixmap; /* base pixmap if drawable is a GLXPixmap */ const struct wgl_pixel_format *format; /* pixel format for the drawable */ SIZE pixmap_size; /* pixmap size for GLXPixmap drawables */ + enum dc_gl_layered_type layered_type; int swap_interval; BOOL refresh_swap_interval; BOOL mutable_pf; + BOOL fs_hack; + BOOL fs_hack_did_swapbuf; + BOOL fs_hack_context_set_up; + BOOL fs_hack_needs_resolve; + BOOL has_scissor_indexed; + BOOL has_clip_control; + BOOL has_ati_frag_shader; + BOOL has_fragment_program; + BOOL has_vertex_program; + LONG last_gamma_serial; }; struct wgl_pbuffer @@ -389,6 +426,72 @@ static void wglFinish(void); static void wglFlush(void); static const GLubyte *wglGetString(GLenum name); +/* Fullscreen hack */ +static void (*pglActiveTexture)( GLenum texture ); +static void (*pglAttachShader)( GLuint program, GLuint shader ); +static void (*pglBindBuffer)( GLenum target, GLuint buffer ); +static void (*pglBindBufferBase)( GLenum target, GLuint index, GLuint buffer ); +static void (*pglBindBufferRange)( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ); +static void (*pglBindFramebuffer)( GLenum target, GLuint framebuffer ); +static void (*pglBindFramebufferEXT)( GLenum target, GLuint framebuffer ); +static void (*pglBindRenderbuffer)( GLenum target, GLuint renderbuffer ); +static void (*pglBindSampler)( GLuint target, GLuint sampler ); +static void (*pglBlitFramebuffer)( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ); +static void (*pglBufferData)( GLenum target, GLsizeiptr size, const void *data, GLenum usage ); +static void (*pglClipControl)( GLenum origin, GLenum depth ); +static void (*pglColorMaski)( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ); +static void (*pglCompileShader)( GLuint shader ); +static GLuint (*pglCreateProgram)(void); +static GLuint (*pglCreateShader)( GLenum type ); +static void (*pglDeleteBuffers)( GLsizei n, GLuint *buffers ); +static void (*pglDeleteFramebuffers)( GLsizei n, const GLuint *framebuffers ); +static void (*pglDeleteProgram)( GLuint program ); +static void (*pglDeleteRenderbuffers)( GLsizei n, const GLuint *renderbuffers ); +static void (*pglDeleteShader)( GLuint shader ); +static void (*pglDrawArrays)( GLenum mode, GLint first, GLsizei count ); +static void (*pglDrawBuffer)( GLenum buffer ); +static void (*pglFramebufferRenderbuffer)( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ); +static void (*pglFramebufferTexture2D)( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ); +static void (*pglGenBuffers)( GLsizei n, GLuint *buffers ); +static void (*pglGenFramebuffers)( GLsizei n, GLuint *ids ); +static void (*pglGetBooleani_v)( GLenum target, GLuint index, GLboolean *data ); +static void (*pglGetInteger64i_v)( GLenum target, GLuint index, GLint64 *data ); +static void (*pglGetIntegeri_v)( GLenum, GLuint, GLint * ); +static void (*pglGetFloati_v)( GLenum, GLuint, GLfloat * ); +static void (*pglGenRenderbuffers)( GLsizei n, GLuint *renderbuffers ); +static void (*pglGetProgramiv)( GLuint program, GLenum pname, GLint *params ); +static void (*pglGetProgramInfoLog)( GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog ); +static void (*pglGetShaderiv)( GLuint shader, GLenum pname, GLint *params ); +static void (*pglGetShaderInfoLog)( GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog ); +static GLuint (*pglGetUniformBlockIndex)( GLuint program, const GLchar *uniformBlockName ); +static GLint (*pglGetUniformLocation)( GLuint program, const GLchar *name ); +static void (*pglLinkProgram)( GLuint program ); +static void (*pglReadBuffer)( GLenum src ); +static void (*pglRenderbufferStorage)( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ); +static void (*pglRenderbufferStorageMultisample)( GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height ); +static void (*pglScissorIndexed)( GLuint, GLint, GLint, GLsizei, GLsizei ); +static void (*pglScissorIndexedv)( GLuint, const GLint * ); +static void (*pglShaderSource)( GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length ); +static void (*pglUniformBlockBinding)( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ); +static void (*pglUniform1i)( GLint location, GLint v0 ); +static void (*pglUseProgram)( GLuint program ); +static void (*pglViewportIndexedf)( GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h ); +static void (*pglViewportIndexedfv)( GLuint index, const GLfloat *v ); +static void (*pglGetFramebufferAttachmentParameteriv)( GLenum target, GLenum attachment, GLenum pname, GLint *params ); +static void (*pglCopyTexImage2D)( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +static void (*pglCopyTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +static void (*pglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data); +static void wglBindFramebuffer( GLenum target, GLuint framebuffer ); +static void wglBindFramebufferEXT( GLenum target, GLuint framebuffer ); +static void wglDrawBuffer( GLenum buffer ); +static void wglReadBuffer( GLenum src ); +static void wglFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ); +static void wglCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +static void wglCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +static void wglReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data); + /* check if the extension is present in the list */ static BOOL has_extension( const char *list, const char *ext ) { @@ -564,9 +667,14 @@ static void init_opengl(void) /* redirect some standard OpenGL functions */ #define REDIRECT(func) \ do { p##func = opengl_funcs.gl.p_##func; opengl_funcs.gl.p_##func = w##func; } while(0) + REDIRECT( glDrawBuffer ); REDIRECT( glFinish ); REDIRECT( glFlush ); REDIRECT( glGetString ); + REDIRECT( glReadBuffer ); + REDIRECT( glCopyTexSubImage2D ); + REDIRECT( glCopyTexImage2D ); + REDIRECT( glReadPixels ); #undef REDIRECT pglXGetProcAddressARB = dlsym(opengl_handle, "glXGetProcAddressARB"); @@ -575,6 +683,59 @@ static void init_opengl(void) goto failed; } + /* Fullscreen hack */ +#define LOAD_FUNCPTR(func) p##func = (void *)pglXGetProcAddressARB((const unsigned char *)#func); + LOAD_FUNCPTR( glActiveTexture ); + LOAD_FUNCPTR( glAttachShader ); + LOAD_FUNCPTR( glBindBuffer ); + LOAD_FUNCPTR( glBindBufferBase ); + LOAD_FUNCPTR( glBindBufferRange ); + LOAD_FUNCPTR( glBindFramebuffer ); + LOAD_FUNCPTR( glBindFramebufferEXT ); + LOAD_FUNCPTR( glBindRenderbuffer ); + LOAD_FUNCPTR( glBindSampler ); + LOAD_FUNCPTR( glBlitFramebuffer ); + LOAD_FUNCPTR( glBufferData ); + LOAD_FUNCPTR( glClipControl ); + LOAD_FUNCPTR( glColorMaski ); + LOAD_FUNCPTR( glCompileShader ); + LOAD_FUNCPTR( glCreateProgram ); + LOAD_FUNCPTR( glCreateShader ); + LOAD_FUNCPTR( glDeleteBuffers ); + LOAD_FUNCPTR( glDeleteFramebuffers ); + LOAD_FUNCPTR( glDeleteProgram ); + LOAD_FUNCPTR( glDeleteRenderbuffers ); + LOAD_FUNCPTR( glDeleteShader ); + LOAD_FUNCPTR( glDrawArrays ); + LOAD_FUNCPTR( glFramebufferRenderbuffer ); + LOAD_FUNCPTR( glFramebufferTexture2D ); + LOAD_FUNCPTR( glGenBuffers ); + LOAD_FUNCPTR( glGenFramebuffers ); + LOAD_FUNCPTR( glGetBooleani_v ); + LOAD_FUNCPTR( glGetInteger64i_v ); + LOAD_FUNCPTR( glGetIntegeri_v ); + LOAD_FUNCPTR( glGetFloati_v ); + LOAD_FUNCPTR( glGenRenderbuffers ); + LOAD_FUNCPTR( glGetProgramiv ); + LOAD_FUNCPTR( glGetProgramInfoLog ); + LOAD_FUNCPTR( glGetShaderiv ); + LOAD_FUNCPTR( glGetShaderInfoLog ); + LOAD_FUNCPTR( glGetUniformBlockIndex ); + LOAD_FUNCPTR( glGetUniformLocation ); + LOAD_FUNCPTR( glLinkProgram ); + LOAD_FUNCPTR( glRenderbufferStorage ); + LOAD_FUNCPTR( glRenderbufferStorageMultisample ); + LOAD_FUNCPTR( glScissorIndexed ); + LOAD_FUNCPTR( glScissorIndexedv ); + LOAD_FUNCPTR( glShaderSource ); + LOAD_FUNCPTR( glUniformBlockBinding ); + LOAD_FUNCPTR( glUniform1i ); + LOAD_FUNCPTR( glUseProgram ); + LOAD_FUNCPTR( glViewportIndexedf ); + LOAD_FUNCPTR( glViewportIndexedfv ); + LOAD_FUNCPTR( glGetFramebufferAttachmentParameteriv ); +#undef LOAD_FUNCPTR + #define LOAD_FUNCPTR(f) do if((p##f = (void*)pglXGetProcAddressARB((const unsigned char*)#f)) == NULL) \ { \ ERR( "%s not found in libGL, disabling OpenGL.\n", #f ); \ @@ -1158,7 +1319,8 @@ static void release_gl_drawable( struct gl_drawable *gl ) case DC_GL_CHILD_WIN: TRACE( "destroying %lx drawable %lx\n", gl->window, gl->drawable ); pglXDestroyWindow( gdi_display, gl->drawable ); - XDestroyWindow( gdi_display, gl->window ); + destroy_client_window( gl->hwnd, gl->window ); + XFreeColormap( gdi_display, gl->colormap ); break; case DC_GL_PIXMAP_WIN: TRACE( "destroying pixmap %lx drawable %lx\n", gl->pixmap, gl->drawable ); @@ -1303,6 +1465,35 @@ static GLXContext create_glxcontext(Display *display, struct wgl_context *contex } +static enum dc_gl_layered_type get_gl_layered_type( HWND hwnd ) +{ + struct x11drv_win_data *data; + enum dc_gl_layered_type ret; + + if (!(data = get_win_data( hwnd ))) return DC_GL_LAYERED_NONE; + if (data->layered) ret = data->layered_attributes ? DC_GL_LAYERED_ATTRIBUTES : DC_GL_LAYERED_UPDATES; + else ret = DC_GL_LAYERED_NONE; + release_win_data( data ); + + return ret; +} + +static BOOL drawable_needs_clipping( HWND hwnd, BOOL known_child ) +{ + static int no_child_clipping_cached = -1; + + if (no_child_clipping_cached == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + no_child_clipping_cached = sgi && (!strcmp( sgi, "2229850" ) || !strcmp( sgi, "2229880" )); + if (no_child_clipping_cached) FIXME( "HACK: disabling child GL window clipping.\n" ); + } + + if (known_child && !no_child_clipping_cached) return TRUE; + return (!no_child_clipping_cached && NtUserGetWindowRelative( hwnd, GW_CHILD )) || NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow(); +} + /*********************************************************************** * create_gl_drawable */ @@ -1327,27 +1518,52 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel gl->refresh_swap_interval = TRUE; gl->format = format; gl->ref = 1; + gl->hwnd = hwnd; gl->mutable_pf = mutable_pf; - if (!known_child && !NtUserGetWindowRelative( hwnd, GW_CHILD ) && - NtUserGetAncestor( hwnd, GA_PARENT ) == NtUserGetDesktopWindow()) /* childless top-level window */ + gl->layered_type = get_gl_layered_type( hwnd ); + + if (!gl->layered_type && !drawable_needs_clipping( hwnd, known_child )) /* childless top-level window */ { + struct x11drv_win_data *data; + gl->type = DC_GL_WINDOW; - gl->window = create_client_window( hwnd, visual ); + gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, + (visual->class == PseudoColor || visual->class == GrayScale || + visual->class == DirectColor) ? AllocAll : AllocNone ); + gl->window = create_client_window( hwnd, visual, gl->colormap ); if (gl->window) gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); + if ((data = get_win_data( hwnd ))) + { + gl->fs_hack = data->fs_hack || fs_hack_get_gamma_ramp( NULL ); + if (gl->fs_hack) TRACE( "Window %p has the fullscreen hack enabled\n", hwnd ); + release_win_data( data ); + } TRACE( "%p created client %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); } #ifdef SONAME_LIBXCOMPOSITE else if(usexcomposite) { + struct x11drv_win_data *data; gl->type = DC_GL_CHILD_WIN; - gl->window = create_client_window( hwnd, visual ); + gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, + (visual->class == PseudoColor || visual->class == GrayScale || + visual->class == DirectColor) ? AllocAll : AllocNone ); + gl->window = create_client_window( hwnd, visual, gl->colormap ); + gl->swap_interval = 0; if (gl->window) { gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); pXCompositeRedirectWindow( gdi_display, gl->window, CompositeRedirectManual ); } + if ((data = get_win_data( hwnd ))) + { + gl->fs_hack = data->fs_hack || fs_hack_get_gamma_ramp( NULL ); + if (gl->fs_hack) TRACE( "Window %p has the fullscreen hack enabled\n", hwnd ); + if (gl->layered_type) detach_client_window( data, data->client_window, TRUE ); + release_win_data( data ); + } TRACE( "%p created child %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); } #endif @@ -1465,25 +1681,39 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL internal ) */ void sync_gl_drawable( HWND hwnd, BOOL known_child ) { + enum dc_gl_layered_type new_layered_type; struct gl_drawable *old, *new; + struct x11drv_win_data *data; + + TRACE( "%p\n", hwnd ); if (!(old = get_gl_drawable( hwnd, 0 ))) return; - switch (old->type) + new_layered_type = get_gl_layered_type( hwnd ); + + known_child = drawable_needs_clipping( hwnd, known_child ); + + if (old->layered_type || (known_child && old->type == DC_GL_WINDOW) + || (!known_child && old->type != DC_GL_WINDOW) + || old->layered_type != new_layered_type) { - case DC_GL_WINDOW: - if (!known_child) break; /* Still a childless top-level window */ - /* fall through */ - case DC_GL_PIXMAP_WIN: - if (!(new = create_gl_drawable( hwnd, old->format, known_child, old->mutable_pf ))) break; - mark_drawable_dirty( old, new ); - XFlush( gdi_display ); - TRACE( "Recreated GL drawable %lx to replace %lx\n", new->drawable, old->drawable ); - release_gl_drawable( new ); - break; - default: - break; + if ((new = create_gl_drawable( hwnd, old->format, known_child, old->mutable_pf ))) + { + mark_drawable_dirty( old, new ); + XFlush( gdi_display ); + TRACE( "Recreated GL drawable %lx to replace %lx\n", new->drawable, old->drawable ); + release_gl_drawable( new ); + } + } + + if (DC_GL_PIXMAP_WIN != old->type) + { + data = get_win_data( hwnd ); + old->fs_hack = data->fs_hack || fs_hack_get_gamma_ramp( NULL ) != NULL; + if (old->fs_hack) TRACE( "Window %p has the fullscreen hack enabled\n", hwnd ); + release_win_data( data ); } + release_gl_drawable( old ); } @@ -1751,6 +1981,50 @@ static BOOL glxdrv_wglCopyContext(struct wgl_context *src, struct wgl_context *d return TRUE; } +static int share_all_contexts = -1; + +static GLXContext get_common_context( GLXFBConfig fbconfig ) +{ + static GLXContext common_context; + + if (share_all_contexts == -1) + { + const char *e = getenv( "WINE_SHARE_ALL_GL_CONTEXTS" ); + const char *sgi = getenv( "SteamGameId" ); + + if (e) + share_all_contexts = !!atoi(e); + else + { + share_all_contexts = sgi && (!strcmp( sgi, "232050" ) || !strcmp( sgi, "333420" )); + if (!share_all_contexts) + { + static const WCHAR ea_desktop[] = u"EADesktop.exe"; + UNICODE_STRING *name; + DWORD len, name_len; + + name = &NtCurrentTeb()->Peb->ProcessParameters->ImagePathName; + len = name->Length / sizeof(WCHAR); + if (len && !name->Buffer[len]) --len; + name_len = sizeof(ea_desktop) / sizeof(*ea_desktop) - 1; + + if (len >= name_len) + share_all_contexts = !memcmp( name->Buffer + len - name_len, ea_desktop, + name_len * sizeof(*ea_desktop) ); + } + } + if (share_all_contexts) + FIXME( "HACK: sharing all the GL contexts.\n" ); + } + + if (!share_all_contexts) return NULL; + + if (!common_context) + common_context = pglXCreateNewContext( gdi_display, fbconfig, GLX_RGBA_TYPE, NULL, TRUE ); + + return common_context; +} + /*********************************************************************** * glxdrv_wglCreateContext */ @@ -1769,7 +2043,7 @@ static struct wgl_context *glxdrv_wglCreateContext( HDC hdc ) { ret->hdc = hdc; ret->fmt = gl->format; - ret->ctx = create_glxcontext(gdi_display, ret, NULL); + ret->ctx = create_glxcontext(gdi_display, ret, get_common_context( ret->fmt->fbconfig )); pthread_mutex_lock( &context_mutex ); list_add_head( &context_list, &ret->entry ); pthread_mutex_unlock( &context_mutex ); @@ -1779,6 +2053,34 @@ static struct wgl_context *glxdrv_wglCreateContext( HDC hdc ) return ret; } +static void fs_hack_destroy_context( struct wgl_context *ctx ) +{ + GLXContext prev_context; + GLXDrawable prev_drawable; + + if (!ctx->drawables[0]) return; + + prev_context = pglXGetCurrentContext(); + prev_drawable = pglXGetCurrentDrawable(); + pglXMakeCurrent( gdi_display, ctx->drawables[0]->drawable, ctx->ctx ); + + pglDeleteBuffers( 1, &ctx->ramp_ubo ); + pglDeleteProgram( ctx->fs_hack_gamma_pgm ); + ctx->fs_hack_gamma_pgm = 0; + + if (ctx->fs_hack_ds_renderbuffer) pglDeleteRenderbuffers( 1, &ctx->fs_hack_ds_renderbuffer ); + if (ctx->fs_hack_color_renderbuffer) pglDeleteRenderbuffers( 1, &ctx->fs_hack_color_renderbuffer ); + if (ctx->fs_hack_ds_texture) opengl_funcs.gl.p_glDeleteTextures( 1, &ctx->fs_hack_ds_texture ); + if (ctx->fs_hack_color_texture) opengl_funcs.gl.p_glDeleteTextures( 1, &ctx->fs_hack_color_texture ); + ctx->fs_hack_color_renderbuffer = ctx->fs_hack_ds_renderbuffer = 0; + ctx->fs_hack_color_texture = ctx->fs_hack_ds_texture = 0; + if (ctx->fs_hack_resolve_fbo) pglDeleteFramebuffers( 1, &ctx->fs_hack_resolve_fbo ); + if (ctx->fs_hack_fbo) pglDeleteFramebuffers( 1, &ctx->fs_hack_fbo ); + ctx->fs_hack_resolve_fbo = ctx->fs_hack_fbo = 0; + + pglXMakeCurrent( gdi_display, prev_drawable, prev_context ); +} + /*********************************************************************** * glxdrv_wglDeleteContext */ @@ -1788,6 +2090,8 @@ static BOOL glxdrv_wglDeleteContext(struct wgl_context *ctx) TRACE("(%p)\n", ctx); + fs_hack_destroy_context( ctx ); + pthread_mutex_lock( &context_mutex ); list_remove( &ctx->entry ); LIST_FOR_EACH_ENTRY( pb, &pbuffer_list, struct wgl_pbuffer, entry ) @@ -1814,6 +2118,9 @@ static BOOL glxdrv_wglDeleteContext(struct wgl_context *ctx) static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc) { if (!strncmp(lpszProc, "wgl", 3)) return NULL; + if (!strcmp( lpszProc, "glBindFramebuffer" )) return (PROC)(void *)wglBindFramebuffer; + if (!strcmp( lpszProc, "glBindFramebufferEXT" )) return (PROC)(void *)wglBindFramebufferEXT; + if (!strcmp( lpszProc, "glFramebufferTexture2D" )) return (PROC)(void *)wglFramebufferTexture2D; return pglXGetProcAddressARB((const GLubyte*)lpszProc); } @@ -1833,12 +2140,497 @@ static void set_context_drawables( struct wgl_context *ctx, struct gl_drawable * for (i = 0; i < 4; i++) release_gl_drawable( prev[i] ); } +struct fs_hack_fbconfig_attribs +{ + int render_type; + int buffer_size; + int red_size; + int green_size; + int blue_size; + int alpha_size; + int depth_size; + int stencil_size; + int doublebuffer; + int samples; +}; + +struct fs_hack_fbo_attachments_config +{ + GLint color_internalformat; + GLenum color_format; + GLenum color_type; + GLint ds_internalformat; + GLenum ds_format; + GLenum ds_type; + int samples; +}; + +static void fs_hack_get_attachments_config( struct gl_drawable *gl, struct fs_hack_fbconfig_attribs *attribs, + struct fs_hack_fbo_attachments_config *config ) +{ + if (attribs->render_type != GLX_RGBA_BIT) + FIXME( "Unsupported GLX_RENDER_TYPE %#x.\n", attribs->render_type ); + if (attribs->red_size != 8 || attribs->green_size != 8 || attribs->blue_size != 8) + FIXME( "Unsupported RGBA color sizes {%u, %u, %u, %u}.\n", attribs->red_size, + attribs->green_size, attribs->blue_size, attribs->alpha_size ); + config->color_internalformat = attribs->alpha_size ? GL_RGBA8 : GL_RGB8; + config->color_format = GL_BGRA; + config->color_type = GL_UNSIGNED_INT_8_8_8_8_REV; + if (attribs->depth_size || attribs->stencil_size) + { + if (attribs->depth_size != 24) FIXME( "Unsupported depth buffer size %u.\n", attribs->depth_size ); + if (attribs->stencil_size && attribs->stencil_size != 8) + FIXME( "Unsupported stencil buffer size %u.\n", attribs->stencil_size ); + config->ds_internalformat = attribs->stencil_size ? GL_DEPTH24_STENCIL8 : GL_DEPTH_COMPONENT24; + config->ds_format = attribs->stencil_size ? GL_DEPTH_STENCIL : GL_DEPTH_COMPONENT; + config->ds_type = attribs->stencil_size ? GL_UNSIGNED_INT_24_8 : GL_UNSIGNED_INT; + } + else + { + config->ds_internalformat = config->ds_format = config->ds_type = 0; + } + config->samples = attribs->samples; +} + +static const float *fs_hack_get_default_gamma_ramp(void) +{ + static float default_gamma_ramp[GAMMA_RAMP_SIZE * 4]; + static BOOL initialized; + unsigned int i; + + if (!initialized) + { + for (i = 0; i < GAMMA_RAMP_SIZE; i++) + default_gamma_ramp[i * 4] = default_gamma_ramp[i * 4 + 1] = default_gamma_ramp[i * 4 + 2] = i / (float)( GAMMA_RAMP_SIZE - 1 ); + initialized = TRUE; + } + return default_gamma_ramp; +} + +static const char *fs_hack_gamma_vertex_shader_src = +"#version 330\n" +"\n" +"const vec4 square[4] = vec4[4](\n" +" vec4(-1.0, -1.0, 0.0, 1.0),\n" +" vec4(-1.0, 1.0, 0.0, 1.0),\n" +" vec4(1.0, -1.0, 0.0, 1.0),\n" +" vec4(1.0, 1.0, 0.0, 1.0)\n" +");\n" +"const vec2 texsq[4] = vec2[4](\n" +" vec2(0.0, 0.0),\n" +" vec2(0.0, 1.0),\n" +" vec2(1.0, 0.0),\n" +" vec2(1.0, 1.0)\n" +");\n" +"\n" +"out vec2 texCoord;\n" +"\n" +"void main(void)\n" +"{\n" +" gl_Position = square[gl_VertexID];\n" +" texCoord = texsq[gl_VertexID];\n" +"}\n" +; + +static const char *fs_hack_gamma_frag_shader_src = +"#version 330\n" +"\n" +"uniform sampler2D tex;\n" +"in vec2 texCoord;\n" +"layout (std140) uniform ramp {\n" +" vec3 values[256];\n" +"};\n" +"\n" +"layout(location = 0) out vec4 outColor;\n" +"\n" +"vec3 color_from_index(vec3 index)\n" +"{\n" +" ivec3 i = ivec3(index);\n" +" return vec3(values[i.r].r, values[i.g].g, values[i.b].b);\n" +"}\n" +"\n" +"void main(void)\n" +"{\n" +" vec3 lookup = texture(tex, texCoord).xyz * 255.0;\n" +" vec3 lookup1, lookup2;\n" +" lookup1 = floor(lookup);\n" +" lookup2 = ceil(lookup);\n" +" outColor.xyz = mix(color_from_index(lookup1), color_from_index(lookup2), lookup - lookup1);\n" +" outColor.a = 1.0;\n" +"}\n" +; + +static void fs_hack_setup_gamma_shader( struct wgl_context *ctx, struct gl_drawable *gl ) +{ + GLint success; + GLuint vshader, fshader, program, ramp_index, tex_loc, prev_program; + char errstr[512]; + const float *default_gamma_ramp = fs_hack_get_default_gamma_ramp(); + + gl->last_gamma_serial = 0; + + if (ctx->fs_hack_gamma_pgm) return; + + opengl_funcs.gl.p_glGetIntegerv( GL_CURRENT_PROGRAM, (GLint *)&prev_program ); + /* vertex shader */ + vshader = pglCreateShader( GL_VERTEX_SHADER ); + if (vshader == 0) + { + ERR( "Failed to create gamma vertex shader\n" ); + return; + } + pglShaderSource( vshader, 1, &fs_hack_gamma_vertex_shader_src, NULL ); + pglCompileShader( vshader ); + + pglGetShaderiv( vshader, GL_COMPILE_STATUS, &success ); + if (!success) + { + pglGetShaderInfoLog( vshader, sizeof(errstr), NULL, errstr ); + ERR( "Compiling gamma vertex shader failed: %s\n", errstr ); + pglDeleteShader( vshader ); + return; + } + + /* fragment shader */ + fshader = pglCreateShader( GL_FRAGMENT_SHADER ); + if (fshader == 0) + { + ERR( "Failed to create gamma fragment shader\n" ); + pglDeleteShader( vshader ); + return; + } + pglShaderSource( fshader, 1, &fs_hack_gamma_frag_shader_src, NULL ); + pglCompileShader( fshader ); + + pglGetShaderiv( fshader, GL_COMPILE_STATUS, &success ); + if (!success) + { + pglGetShaderInfoLog( fshader, sizeof(errstr), NULL, errstr ); + ERR( "Compiling gamma fragment shader failed: %s\n", errstr ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + /* gamma program */ + program = pglCreateProgram(); + if (program == 0) + { + ERR( "Failed to create gamma program\n" ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + pglAttachShader( program, vshader ); + pglAttachShader( program, fshader ); + + pglLinkProgram( program ); + + pglGetProgramiv( program, GL_LINK_STATUS, &success ); + if (!success) + { + pglGetProgramInfoLog( program, sizeof(errstr), NULL, errstr ); + ERR( "Linking gamma shader failed: %s\n", errstr ); + pglDeleteProgram( program ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + + pglGenBuffers( 1, &ctx->ramp_ubo ); + pglBindBuffer( GL_UNIFORM_BUFFER, ctx->ramp_ubo ); + pglBufferData( GL_UNIFORM_BUFFER, sizeof(float) * 4 * GAMMA_RAMP_SIZE, default_gamma_ramp, GL_DYNAMIC_DRAW ); + + ramp_index = pglGetUniformBlockIndex( program, "ramp" ); + pglUniformBlockBinding( program, ramp_index, 0 ); + + pglUseProgram( program ); + + tex_loc = pglGetUniformLocation( program, "tex" ); + pglUniform1i( tex_loc, 0 ); + + ctx->fs_hack_gamma_pgm = program; + + pglUseProgram( prev_program ); +} + +enum fshack_texture_type +{ + FSHACK_TEXTURE_COLOUR, + FSHACK_TEXTURE_DEPTH, + FSHACK_TEXTURE_LAST, +}; + +static void gen_texture( struct wgl_context *ctx, GLuint *tex, enum fshack_texture_type type ) +{ + static const GLuint texture_names[FSHACK_TEXTURE_LAST] = + { + 65535, + 65536, + }; + static int texture_name_hack = -1; + static int once; + + if (ctx->is_core) + { + opengl_funcs.gl.p_glGenTextures( 1, tex ); + return; + } + + if (texture_name_hack == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + texture_name_hack = sgi && (!strcmp( sgi, "6020" ) || !strcmp( sgi, "2200" ) || !strcmp( sgi, "2350" )); + } + + if (!texture_name_hack || opengl_funcs.gl.p_glIsTexture( texture_names[type] )) + { + if (texture_name_hack) FIXME( "Texture %u already exists.\n", texture_names[type] ); + opengl_funcs.gl.p_glGenTextures( 1, tex ); + return; + } + /* Star Wars Jedi Knight: Jedi Academy uses texture names without allocating + * them with glGenTextures(). Trying to use a texture name which has low chances + * to overlap with what games may use. */ + if (!once++) FIXME( "Using texture name hack.\n" ); + *tex = texture_names[type]; +} + +static void fs_hack_setup_context( struct wgl_context *ctx, struct gl_drawable *gl ) +{ + GLuint prev_draw_fbo, prev_read_fbo, prev_texture, prev_renderbuffer, prev_pixel_pack_buffer; + float prev_clear_color[4], prev_clear_depth; + int prev_clear_stencil; + unsigned int i; + struct fs_hack_fbo_attachments_config config; + struct fs_hack_fbconfig_attribs attribs; + static const struct fbconfig_attribs_query + { + int attribute; + unsigned int offset; + } + queries[] = + { + {GLX_RENDER_TYPE, offsetof(struct fs_hack_fbconfig_attribs, render_type)}, + {GLX_BUFFER_SIZE, offsetof(struct fs_hack_fbconfig_attribs, buffer_size)}, + {GLX_RED_SIZE, offsetof(struct fs_hack_fbconfig_attribs, red_size)}, + {GLX_GREEN_SIZE, offsetof(struct fs_hack_fbconfig_attribs, green_size)}, + {GLX_BLUE_SIZE, offsetof(struct fs_hack_fbconfig_attribs, blue_size)}, + {GLX_ALPHA_SIZE, offsetof(struct fs_hack_fbconfig_attribs, alpha_size)}, + {GLX_DEPTH_SIZE, offsetof(struct fs_hack_fbconfig_attribs, depth_size)}, + {GLX_STENCIL_SIZE, offsetof(struct fs_hack_fbconfig_attribs, stencil_size)}, + {GLX_DOUBLEBUFFER, offsetof(struct fs_hack_fbconfig_attribs, doublebuffer)}, + {GLX_SAMPLES_ARB, offsetof(struct fs_hack_fbconfig_attribs, samples)}, + }; + BYTE *ptr = (BYTE *)&attribs; + + if (ctx->fs_hack) + { + int width, height; + RECT rect = {0}; + GLuint profile; + HWND hwnd; + + hwnd = NtUserWindowFromDC( ctx->hdc ); + NtUserGetClientRect( hwnd, &rect ); + + width = rect.right - rect.left; + height = rect.bottom - rect.top; + + TRACE( "Render buffer width:%d height:%d\n", width, height ); + + opengl_funcs.gl.p_glGetIntegerv( GL_CONTEXT_PROFILE_MASK, (GLint *)&profile ); + ctx->is_core = (profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0; + + opengl_funcs.gl.p_glGetIntegerv( GL_DRAW_FRAMEBUFFER_BINDING, (GLint *)&prev_draw_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&prev_read_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_TEXTURE_BINDING_2D, (GLint *)&prev_texture ); + opengl_funcs.gl.p_glGetIntegerv( GL_RENDERBUFFER_BINDING, (GLint *)&prev_renderbuffer ); + opengl_funcs.gl.p_glGetIntegerv( GL_PIXEL_UNPACK_BUFFER_BINDING, (GLint *)&prev_pixel_pack_buffer ); + opengl_funcs.gl.p_glGetFloatv( GL_COLOR_CLEAR_VALUE, prev_clear_color ); + opengl_funcs.gl.p_glGetFloatv( GL_DEPTH_CLEAR_VALUE, &prev_clear_depth ); + opengl_funcs.gl.p_glGetIntegerv( GL_STENCIL_CLEAR_VALUE, &prev_clear_stencil ); + TRACE( "Previous draw FBO %u, read FBO %u for ctx %p\n", prev_draw_fbo, prev_read_fbo, ctx ); + + pglBindBuffer( GL_PIXEL_UNPACK_BUFFER, 0 ); + + if (!ctx->fs_hack_fbo) + { + pglGenFramebuffers( 1, &ctx->fs_hack_fbo ); + TRACE( "Created FBO %u for fullscreen hack.\n", ctx->fs_hack_fbo ); + } + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + + for (i = 0; i < ARRAY_SIZE(queries); ++i) + pglXGetFBConfigAttrib( gdi_display, gl->format->fbconfig, queries[i].attribute, + (int *)&ptr[queries[i].offset] ); + + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); + + fs_hack_get_attachments_config( gl, &attribs, &config ); + + if (!ctx->fs_hack_color_texture) + gen_texture( ctx, &ctx->fs_hack_color_texture, FSHACK_TEXTURE_COLOUR ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_color_texture ); + opengl_funcs.gl.p_glTexImage2D( GL_TEXTURE_2D, 0, config.color_internalformat, width, + height, 0, config.color_format, config.color_type, NULL ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + ctx->fs_hack_integer ? GL_NEAREST : GL_LINEAR ); + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, prev_texture ); + TRACE( "Created texture %u for fullscreen hack.\n", ctx->fs_hack_color_texture ); + + if (config.samples) + { + gl->fs_hack_needs_resolve = TRUE; + + if (!ctx->fs_hack_resolve_fbo) + { + pglGenFramebuffers( 1, &ctx->fs_hack_resolve_fbo ); + TRACE( "Created resolve FBO %u for fullscreen hack.\n", ctx->fs_hack_resolve_fbo ); + } + + if (!ctx->fs_hack_color_renderbuffer) + pglGenRenderbuffers( 1, &ctx->fs_hack_color_renderbuffer ); + pglBindRenderbuffer( GL_RENDERBUFFER, ctx->fs_hack_color_renderbuffer ); + pglRenderbufferStorageMultisample( GL_RENDERBUFFER, config.samples, + config.color_internalformat, width, height ); + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, + ctx->fs_hack_color_renderbuffer ); + TRACE( "Created renderbuffer %u and FBO %u for fullscreen hack.\n", + ctx->fs_hack_color_renderbuffer, ctx->fs_hack_resolve_fbo ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, + ctx->fs_hack_color_texture, 0 ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); + pglBindRenderbuffer( GL_RENDERBUFFER, prev_renderbuffer ); + } + else + { + gl->fs_hack_needs_resolve = FALSE; + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, + ctx->fs_hack_color_texture, 0 ); + } + + if (config.ds_internalformat) + { + if (config.samples) + { + if (!ctx->fs_hack_ds_renderbuffer) pglGenRenderbuffers( 1, &ctx->fs_hack_ds_renderbuffer ); + pglBindRenderbuffer( GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + pglRenderbufferStorageMultisample( GL_RENDERBUFFER, config.samples, + config.ds_internalformat, width, height ); + pglBindRenderbuffer( GL_RENDERBUFFER, prev_renderbuffer ); + if (attribs.depth_size) + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + if (attribs.stencil_size) + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + TRACE( "Created DS renderbuffer %u for fullscreen hack.\n", ctx->fs_hack_ds_renderbuffer ); + } + else + { + if (!ctx->fs_hack_ds_texture) + gen_texture( ctx, &ctx->fs_hack_ds_texture, FSHACK_TEXTURE_DEPTH ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_ds_texture ); + opengl_funcs.gl.p_glTexImage2D( GL_TEXTURE_2D, 0, config.ds_internalformat, width, + height, 0, config.ds_format, config.ds_type, NULL ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, prev_texture ); + if (attribs.depth_size) + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, ctx->fs_hack_ds_texture, 0 ); + if (attribs.stencil_size) + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_TEXTURE_2D, ctx->fs_hack_ds_texture, 0 ); + TRACE( "Created DS texture %u for fullscreen hack.\n", ctx->fs_hack_ds_texture ); + } + } + + fs_hack_setup_gamma_shader( ctx, gl ); + + if (!ctx->has_been_current) opengl_funcs.gl.p_glViewport( 0, 0, width, height ); + + if (!gl->fs_hack_context_set_up) + { + if (ctx->has_been_current) + { + GLbitfield mask = GL_COLOR_BUFFER_BIT; + + if (attribs.depth_size) mask |= GL_DEPTH_BUFFER_BIT; + if (attribs.stencil_size) mask |= GL_STENCIL_BUFFER_BIT; + + pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + pglBlitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, GL_NEAREST ); + } + else + { + opengl_funcs.gl.p_glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + opengl_funcs.gl.p_glClearDepth( 1.0 ); + opengl_funcs.gl.p_glClearStencil( 0 ); + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + } + } + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + pglDrawBuffer( GL_BACK ); + if (!gl->fs_hack_context_set_up) + { + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT ); + opengl_funcs.gl.p_glClearColor( prev_clear_color[0], prev_clear_color[1], + prev_clear_color[2], prev_clear_color[3] ); + opengl_funcs.gl.p_glClearDepth( prev_clear_depth ); + opengl_funcs.gl.p_glClearStencil( prev_clear_stencil ); + } + wglBindFramebuffer( GL_DRAW_FRAMEBUFFER, prev_draw_fbo ); + wglBindFramebuffer( GL_READ_FRAMEBUFFER, prev_read_fbo ); + + ctx->setup_for.x = width; + ctx->setup_for.y = height; + gl->has_scissor_indexed = has_extension( glExtensions, "GL_ARB_viewport_array" ); + gl->has_clip_control = has_extension( glExtensions, "GL_ARB_clip_control" ); + gl->has_ati_frag_shader = !ctx->is_core && + has_extension( glExtensions, "GL_ATI_fragment_shader" ); + gl->has_fragment_program = !ctx->is_core && + has_extension( glExtensions, "GL_ARB_fragment_program" ); + gl->has_vertex_program = !ctx->is_core && + has_extension( glExtensions, "GL_ARB_vertex_program" ); + ctx->fs_hack_integer = fs_hack_is_integer(); + ctx->fs_hack_needs_resolve = gl->fs_hack_needs_resolve; + gl->fs_hack_context_set_up = TRUE; + + pglBindBuffer( GL_PIXEL_UNPACK_BUFFER, prev_pixel_pack_buffer ); + } + else + { + TRACE( "Releasing fullscreen hack texture %u and FBO %u\n", ctx->fs_hack_color_texture, ctx->fs_hack_fbo ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + ctx->current_draw_fbo = 0; + } + if (ctx->current_read_fbo == ctx->fs_hack_fbo) + { + pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + ctx->current_read_fbo = 0; + } + gl->fs_hack_context_set_up = FALSE; + } +} + /*********************************************************************** * glxdrv_wglMakeCurrent */ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) { - BOOL ret = FALSE; + BOOL ret = FALSE, setup_fs_hack = FALSE; struct gl_drawable *gl; TRACE("(%p,%p)\n", hdc, ctx); @@ -1867,10 +2659,17 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) if (ret) { NtCurrentTeb()->glContext = ctx; - ctx->has_been_current = TRUE; + if (ctx->fs_hack != gl->fs_hack || (ctx->fs_hack && ctx->drawables[0] != gl)) + setup_fs_hack = TRUE; ctx->hdc = hdc; set_context_drawables( ctx, gl, gl ); ctx->refresh_drawables = FALSE; + if (setup_fs_hack) + { + ctx->fs_hack = gl->fs_hack; + fs_hack_setup_context( ctx, gl ); + } + ctx->has_been_current = TRUE; pthread_mutex_unlock( &context_mutex ); goto done; } @@ -1884,55 +2683,609 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) return ret; } -/*********************************************************************** - * X11DRV_wglMakeContextCurrentARB - */ -static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct wgl_context *ctx ) +static void wglFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) { - BOOL ret = FALSE; - struct gl_drawable *draw_gl, *read_gl = NULL; + struct wgl_context *ctx = NtCurrentTeb()->glContext; - TRACE("(%p,%p,%p)\n", draw_hdc, read_hdc, ctx); + TRACE( "target %#x, attachment %#x, textarget %#x, texture %u, level %u.\n", target, attachment, + textarget, texture, level ); - if (!ctx) + if (ctx->fs_hack) { - pglXMakeCurrent(gdi_display, None, NULL); - NtCurrentTeb()->glContext = NULL; - return TRUE; + /* glFramebufferTexture2D should fail for default framebuffer 0. + * Let it fail and relay appropriate error instead of breaking fs_hack FBO. */ + if (ctx->current_read_fbo == ctx->fs_hack_fbo) pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); } - - if (!pglXMakeContextCurrent) return FALSE; - - if ((draw_gl = get_gl_drawable( NtUserWindowFromDC( draw_hdc ), draw_hdc ))) + pglFramebufferTexture2D( target, attachment, textarget, texture, level ); + if (ctx->fs_hack) { - read_gl = get_gl_drawable( NtUserWindowFromDC( read_hdc ), read_hdc ); - - pthread_mutex_lock( &context_mutex ); - ret = pglXMakeContextCurrent(gdi_display, draw_gl->drawable, - read_gl ? read_gl->drawable : 0, ctx->ctx); - if (ret) - { - ctx->has_been_current = TRUE; - ctx->hdc = draw_hdc; - set_context_drawables( ctx, draw_gl, read_gl ); - ctx->refresh_drawables = FALSE; - NtCurrentTeb()->glContext = ctx; - pthread_mutex_unlock( &context_mutex ); - goto done; - } - pthread_mutex_unlock( &context_mutex ); + if (ctx->current_read_fbo == ctx->fs_hack_fbo) + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_fbo ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); } - RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); -done: - release_gl_drawable( read_gl ); - release_gl_drawable( draw_gl ); - TRACE( "%p,%p,%p returning %d\n", draw_hdc, read_hdc, ctx, ret ); - return ret; } -/*********************************************************************** - * glxdrv_wglShareLists - */ +static void wglBindFramebuffer( GLenum target, GLuint framebuffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "target %#x, framebuffer %u\n", target, framebuffer ); + if (ctx->fs_hack && !framebuffer) framebuffer = ctx->fs_hack_fbo; + + if (target == GL_DRAW_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_draw_fbo = framebuffer; + if (target == GL_READ_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_read_fbo = framebuffer; + + pglBindFramebuffer( target, framebuffer ); +} + +static void wglBindFramebufferEXT( GLenum target, GLuint framebuffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "target %#x, framebuffer %u\n", target, framebuffer ); + if (ctx->fs_hack && !framebuffer) framebuffer = ctx->fs_hack_fbo; + + if (target == GL_DRAW_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_draw_fbo = framebuffer; + if (target == GL_READ_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_read_fbo = framebuffer; + + pglBindFramebufferEXT( target, framebuffer ); +} + +static void wglDrawBuffer( GLenum buffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "buffer %#x.\n", buffer ); + + if (!ctx->current_draw_fbo || (ctx->fs_hack && ctx->current_draw_fbo == ctx->fs_hack_fbo)) + ctx->drawing_to_front = (buffer == GL_FRONT || buffer == GL_FRONT_AND_BACK); + + if (ctx->fs_hack && ctx->current_draw_fbo == ctx->fs_hack_fbo) + { + TRACE( "Overriding %#x with GL_COLOR_ATTACHMENT0\n", buffer ); + buffer = GL_COLOR_ATTACHMENT0; + } + pglDrawBuffer( buffer ); +} + +static void wglReadBuffer( GLenum buffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + if (ctx->fs_hack && ctx->current_read_fbo == ctx->fs_hack_fbo) + { + TRACE( "Overriding %#x with GL_COLOR_ATTACHMENT0\n", buffer ); + buffer = GL_COLOR_ATTACHMENT0; + } + pglReadBuffer( buffer ); +} + +static BOOL resolve_fs_hack_fbo( GLuint *old_read_fbo ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + GLuint old_draw_fbo; + unsigned int cx, cy; + RECT user_rect; + HWND hwnd; + + if (!ctx || !ctx->fs_hack || !ctx->fs_hack_needs_resolve) return FALSE; + if (!ctx->fs_hack_needs_resolve) return FALSE; + if (ctx->current_read_fbo != ctx->fs_hack_fbo) return FALSE; + if (!(hwnd = NtUserWindowFromDC( ctx->hdc ))) return FALSE; + + NtUserGetClientRect( hwnd, &user_rect ); + cx = user_rect.right - user_rect.left; + cy = user_rect.bottom - user_rect.top; + + TRACE( "resolving fbo, %ux%u.\n", cx, cy ); + + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)old_read_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&old_draw_fbo ); + + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBlitFramebuffer( 0, 0, cx, cy, 0, 0, cx, cy, GL_COLOR_BUFFER_BIT, GL_NEAREST ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, old_draw_fbo ); + + return TRUE; +} + +static void wglCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "target %#x, level %d, offset %dx%d, origin %dx%d, size %dx%d.\n", + target, level, xoffset, yoffset, x, y, width, height ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +static void wglCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "target %#x, level %d, internalformat %#x, origin %dx%d, size %dx%d, border %d.\n", + target, level, internalformat, x, y, width, height, border ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglCopyTexImage2D( target, level, internalformat, x, y, width, height, border ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +static void wglReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "origin %dx%d, size %dx%d, format %#x, type %#x, data %p.\n", x, y, width, height, format, type, data ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglReadPixels( x, y, width, height, format, type, data ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +struct fs_hack_gl_state +{ + GLuint draw_fbo; + GLuint read_fbo; + GLuint program; + GLuint bound_texture; + GLint active_texture; + GLint clip_origin, clip_depth_mode; + GLuint ubo; + GLint64 ubo_size, ubo_start; + GLint viewporti[4]; + GLfloat viewportf[4]; + float clear_color[4]; + GLboolean scissor_test, cull_face, blend, alpha_test, depth_test, stencil_test; + GLboolean arb_frag, arb_vert, ati_frag, fb_srgb; + GLboolean clip_distance[8]; + GLboolean color_mask[4]; + GLuint sampler; +}; + +#define SET 0 +#define RESET 1 + +static void fs_hack_handle_enable_switch( int mode, GLenum cap, GLboolean *b, BOOL new ) +{ + if (mode == SET) + { + *b = opengl_funcs.gl.p_glIsEnabled( cap ); + if (new) opengl_funcs.gl.p_glEnable( cap ); + else opengl_funcs.gl.p_glDisable( cap ); + } + else + { + if (*b) opengl_funcs.gl.p_glEnable( cap ); + else opengl_funcs.gl.p_glDisable( cap ); + } +} + +static void fs_hack_handle_fbo_state( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_DRAW_FRAMEBUFFER_BINDING, (GLint *)&state->draw_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&state->read_fbo ); + TRACE( "Previous draw FBO %u, read FBO %u\n", state->draw_fbo, state->read_fbo ); + } + else + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, state->draw_fbo ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, state->read_fbo ); + } +} + +static void fs_hack_handle_clip_control( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (!gl->has_clip_control) return; + + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_CLIP_ORIGIN, (GLint *)&state->clip_origin ); + opengl_funcs.gl.p_glGetIntegerv( GL_CLIP_DEPTH_MODE, (GLint *)&state->clip_depth_mode ); + + pglClipControl( GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE ); + } + else + { + pglClipControl( state->clip_origin, state->clip_depth_mode ); + } +} + +static void fs_hack_handle_shaders( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (gl->has_fragment_program) + fs_hack_handle_enable_switch( mode, GL_FRAGMENT_PROGRAM_ARB, &state->arb_frag, FALSE ); + if (gl->has_vertex_program) + fs_hack_handle_enable_switch( mode, GL_VERTEX_PROGRAM_ARB, &state->arb_vert, FALSE ); + fs_hack_handle_enable_switch( mode, GL_FRAMEBUFFER_SRGB, &state->fb_srgb, FALSE ); + + if (gl->has_ati_frag_shader) + fs_hack_handle_enable_switch( mode, GL_FRAGMENT_SHADER_ATI, &state->ati_frag, FALSE ); + + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_CURRENT_PROGRAM, (GLint *)&state->program ); + + pglGetIntegeri_v( GL_UNIFORM_BUFFER_BINDING, 0, (GLint *)&state->ubo ); + pglGetInteger64i_v( GL_UNIFORM_BUFFER_START, 0, &state->ubo_start ); + pglGetInteger64i_v( GL_UNIFORM_BUFFER_SIZE, 0, &state->ubo_size ); + + opengl_funcs.gl.p_glGetIntegerv( GL_ACTIVE_TEXTURE, &state->active_texture ); + pglActiveTexture( GL_TEXTURE0 ); + opengl_funcs.gl.p_glGetIntegerv( GL_TEXTURE_BINDING_2D, (GLint *)&state->bound_texture ); + pglGetIntegeri_v( GL_SAMPLER_BINDING, 0, (GLint *)&state->sampler ); + + pglBindBufferBase( GL_UNIFORM_BUFFER, 0, ctx->ramp_ubo ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_color_texture ); + pglBindSampler( 0, 0 ); + + pglUseProgram( ctx->fs_hack_gamma_pgm ); + } + else + { + pglUseProgram( state->program ); + + pglBindSampler( 0, state->sampler ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, state->bound_texture ); + pglActiveTexture( state->active_texture ); + + pglBindBufferRange( GL_UNIFORM_BUFFER, 0, state->ubo, state->ubo_start, state->ubo_size ); + } +} + +static void fs_hack_handle_viewport( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (mode == SET) + { + if (gl->has_scissor_indexed) + { + pglGetFloati_v( GL_VIEWPORT, 0, state->viewportf ); + pglViewportIndexedf( 0, scaled_origin->x, scaled_origin->y, scaled->cx, scaled->cy ); + } + else + { + opengl_funcs.gl.p_glGetIntegerv( GL_VIEWPORT, state->viewporti ); + opengl_funcs.gl.p_glViewport( scaled_origin->x, scaled_origin->y, scaled->cx, scaled->cy ); + } + } + else + { + if (gl->has_scissor_indexed) + { + pglViewportIndexedfv( 0, state->viewportf ); + } + else + { + opengl_funcs.gl.p_glViewport( state->viewporti[0], state->viewporti[1], + state->viewporti[2], state->viewporti[3] ); + } + } +} + +static void fs_hack_handle_clear_color( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (mode == SET) + { + opengl_funcs.gl.p_glGetFloatv( GL_COLOR_CLEAR_VALUE, state->clear_color ); + opengl_funcs.gl.p_glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + } + else + { + opengl_funcs.gl.p_glClearColor( state->clear_color[0], state->clear_color[1], + state->clear_color[2], state->clear_color[3] ); + } +} + +static void fs_hack_handle_clip_distance( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + unsigned int i; + if (mode == SET) + { + for (i = 0; i < ARRAY_SIZE(state->clip_distance); ++i) + { + state->clip_distance[i] = opengl_funcs.gl.p_glIsEnabled( GL_CLIP_DISTANCE0 + i ); + opengl_funcs.gl.p_glDisable( GL_CLIP_DISTANCE0 + i ); + } + } + else + { + for (i = 0; i < ARRAY_SIZE(state->clip_distance); ++i) + { + if (state->clip_distance[i]) opengl_funcs.gl.p_glEnable( GL_CLIP_DISTANCE0 + i ); + } + } +} + +static void fs_hack_handle_color_mask( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (mode == SET) + { + pglGetBooleani_v( GL_COLOR_WRITEMASK, 0, state->color_mask ); + + pglColorMaski( 0, GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); + } + else + { + pglColorMaski( 0, state->color_mask[0], state->color_mask[1], state->color_mask[2], state->color_mask[3] ); + } +} + +static void fs_hack_handle_scissor( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + fs_hack_handle_enable_switch( mode, GL_SCISSOR_TEST, &state->scissor_test, FALSE ); +} + +static void fs_hack_handle_cull_face( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + fs_hack_handle_enable_switch( mode, GL_CULL_FACE, &state->cull_face, FALSE ); +} + +static void fs_hack_handle_blend( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + fs_hack_handle_enable_switch( mode, GL_BLEND, &state->blend, FALSE ); +} + +static void fs_hack_handle_alpha_test( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + if (ctx->is_core) return; + + fs_hack_handle_enable_switch( mode, GL_ALPHA_TEST, &state->alpha_test, FALSE ); +} + +static void fs_hack_handle_ds_test( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin ) +{ + fs_hack_handle_enable_switch( mode, GL_DEPTH_TEST, &state->depth_test, FALSE ); + fs_hack_handle_enable_switch( mode, GL_STENCIL_TEST, &state->stencil_test, FALSE ); +} + +static void fs_hack_blit_framebuffer( struct gl_drawable *gl, GLenum draw_buffer ) +{ + static const struct + { + void (*state_handler)(int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state, const SIZE *real, + const SIZE *scaled, const POINT *scaled_origin); + } + general_state_handlers[] = + { + {fs_hack_handle_fbo_state}, + {fs_hack_handle_scissor}, + {fs_hack_handle_clear_color}, + }, + draw_state_handlers[] = + { + {fs_hack_handle_clip_control}, + {fs_hack_handle_shaders}, + {fs_hack_handle_viewport}, + {fs_hack_handle_cull_face}, + {fs_hack_handle_clip_distance}, + {fs_hack_handle_color_mask}, + {fs_hack_handle_blend}, + {fs_hack_handle_alpha_test}, + {fs_hack_handle_ds_test}, + }; + struct wgl_context *ctx = NtCurrentTeb()->glContext; + SIZE scaled, src, real; + RECT user_rect = {0}, real_rect; + POINT scaled_origin; + HMONITOR monitor; + struct fs_hack_gl_state state; + struct x11drv_win_data *data; + BOOL window_fs_hack = FALSE; + const float *gamma_ramp; + LONG gamma_serial; + unsigned int i; + HWND hwnd; + + hwnd = NtUserWindowFromDC( ctx->hdc ); + monitor = fs_hack_monitor_from_hwnd( hwnd ); + + if ((data = get_win_data( hwnd ))) + { + window_fs_hack = data->fs_hack; + release_win_data( data ); + } + + if (window_fs_hack) + { + user_rect = fs_hack_current_mode( monitor ); + real_rect = fs_hack_real_mode( monitor ); + scaled = fs_hack_get_scaled_screen_size( monitor ); + } + else + { + NtUserGetClientRect( hwnd, &user_rect ); + real_rect = user_rect; + scaled.cx = user_rect.right - user_rect.left; + scaled.cy = user_rect.bottom - user_rect.top; + } + + src.cx = user_rect.right - user_rect.left; + src.cy = user_rect.bottom - user_rect.top; + real.cx = real_rect.right - real_rect.left; + real.cy = real_rect.bottom - real_rect.top; + if (gl->type != DC_GL_CHILD_WIN) + { + scaled_origin.x = user_rect.left; + scaled_origin.y = user_rect.top; + fs_hack_point_user_to_real( &scaled_origin ); + scaled_origin.x -= real_rect.left; + scaled_origin.y -= real_rect.top; + } + else + { + /* ExtEscape performs the fshack offset. */ + scaled_origin.x = 0; + scaled_origin.y = 0; + } + + gamma_ramp = fs_hack_get_gamma_ramp( &gamma_serial ); + + TRACE( "scaled:%dx%d src:%dx%d real:%dx%d user_rect:%s real_rect:%s scaled_origin:%s\n", + (int)scaled.cx, (int)scaled.cy, (int)src.cx, (int)src.cy, (int)real.cx, (int)real.cy, + wine_dbgstr_rect( &user_rect ), wine_dbgstr_rect( &real_rect ), wine_dbgstr_point( &scaled_origin ) ); + + if (ctx->setup_for.x != src.cx || ctx->setup_for.y != src.cy) fs_hack_setup_context( ctx, gl ); + + /* Can't stretch blit with multisampled renderbuffers */ + if (gl->fs_hack_needs_resolve && !gamma_ramp) + { + gamma_ramp = fs_hack_get_default_gamma_ramp(); + gamma_serial = 0; + } + + TRACE( "Stretching from FBO %u %ux%u to %ux%u\n", ctx->fs_hack_fbo, + (int)src.cx, (int)src.cy, (int)scaled.cx, (int)scaled.cy ); + + for (i = 0; i < ARRAY_SIZE(general_state_handlers); i++) + general_state_handlers[i].state_handler( SET, gl, ctx, &state, &real, &scaled, &scaled_origin ); + + if (gamma_ramp) + { + for (i = 0; i < ARRAY_SIZE(draw_state_handlers); i++) + draw_state_handlers[i].state_handler( SET, gl, ctx, &state, &real, &scaled, &scaled_origin ); + } + + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_fbo ); + + if (gl->fs_hack_needs_resolve) + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBlitFramebuffer( 0, 0, src.cx, src.cy, 0, 0, src.cx, src.cy, GL_COLOR_BUFFER_BIT, GL_NEAREST ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + } + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + + // HACK + // pglDrawBuffer( draw_buffer ); + pglDrawBuffer( GL_BACK ); + + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT ); + + if (gamma_ramp) + { + if (gamma_serial != gl->last_gamma_serial) + { + TRACE( "updating gamma ramp (serial: %u)\n", (int)gamma_serial ); + + pglBufferData( GL_UNIFORM_BUFFER, sizeof(float) * 4 * GAMMA_RAMP_SIZE, gamma_ramp, GL_DYNAMIC_DRAW ); + + gl->last_gamma_serial = gamma_serial; + } + + pglDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); + } + else + { + pglBlitFramebuffer( 0, 0, src.cx, src.cy, scaled_origin.x, scaled_origin.y, + scaled_origin.x + scaled.cx, scaled_origin.y + scaled.cy, + GL_COLOR_BUFFER_BIT, ctx->fs_hack_integer ? GL_NEAREST : GL_LINEAR ); + } + + // HACK + if (draw_buffer == GL_FRONT) pglXSwapBuffers( gdi_display, gl->drawable ); + + if (gamma_ramp) + { + for (i = 0; i < ARRAY_SIZE(draw_state_handlers); i++) + draw_state_handlers[i].state_handler( RESET, gl, ctx, &state, NULL, NULL, NULL ); + } + + for (i = 0; i < ARRAY_SIZE(general_state_handlers); i++) + general_state_handlers[i].state_handler( RESET, gl, ctx, &state, NULL, NULL, NULL ); +} + +/*********************************************************************** + * X11DRV_wglMakeContextCurrentARB + */ +static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct wgl_context *ctx ) +{ + BOOL ret = FALSE, setup_fs_hack = FALSE; + struct gl_drawable *draw_gl, *read_gl = NULL; + + TRACE("(%p,%p,%p)\n", draw_hdc, read_hdc, ctx); + + if (!ctx) + { + pglXMakeCurrent(gdi_display, None, NULL); + NtCurrentTeb()->glContext = NULL; + return TRUE; + } + + if (!pglXMakeContextCurrent) return FALSE; + + if ((draw_gl = get_gl_drawable( NtUserWindowFromDC( draw_hdc ), draw_hdc ))) + { + read_gl = get_gl_drawable( NtUserWindowFromDC( read_hdc ), read_hdc ); + + pthread_mutex_lock( &context_mutex ); + ret = pglXMakeContextCurrent(gdi_display, draw_gl->drawable, + read_gl ? read_gl->drawable : 0, ctx->ctx); + if (ret) + { + NtCurrentTeb()->glContext = ctx; + if (ctx->fs_hack != draw_gl->fs_hack || (ctx->fs_hack && ctx->drawables[0] != draw_gl)) + setup_fs_hack = TRUE; + ctx->hdc = draw_hdc; + set_context_drawables( ctx, draw_gl, read_gl ); + ctx->refresh_drawables = FALSE; + if (setup_fs_hack) + { + ctx->fs_hack = draw_gl->fs_hack; + fs_hack_setup_context( ctx, draw_gl ); + } + ctx->has_been_current = TRUE; + pthread_mutex_unlock( &context_mutex ); + goto done; + } + pthread_mutex_unlock( &context_mutex ); + } + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); +done: + release_gl_drawable( read_gl ); + release_gl_drawable( draw_gl ); + TRACE( "%p,%p,%p returning %d\n", draw_hdc, read_hdc, ctx, ret ); + return ret; +} + +/*********************************************************************** + * glxdrv_wglShareLists + */ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *dest) { struct wgl_context *keep, *clobber; @@ -1951,6 +3304,8 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de * hasn't been made current and it hasn't shared display lists before. */ + if (share_all_contexts == 1) return TRUE; + if (!dest->has_been_current && !dest->sharing) { keep = org; @@ -1978,62 +3333,224 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de return TRUE; } +static int XGetImage_handler( Display *dpy, XErrorEvent *event, void *arg ) +{ + return event->request_code == X_GetImage && event->error_code == BadMatch; +} + +static void update_window_surface(struct gl_drawable *gl, HWND hwnd) +{ + char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; + BITMAPINFO *bmi = (BITMAPINFO *)buffer; + struct window_surface *surface; + struct x11drv_win_data *data; + unsigned int y, width, height, stride, pitch; + BYTE *dst_bits, *src_bits; + XImage *image; + RECT rect; + + TRACE( "gl %p, hwnd %p, gl->layered_type %u.\n", gl, hwnd, gl->layered_type ); + + if (gl->layered_type != DC_GL_LAYERED_ATTRIBUTES || !gl->window) return; + + if (!(data = get_win_data( hwnd ))) return; + + surface = data->surface; + if (!surface) + { + TRACE( "No surface.\n" ); + release_win_data( data ); + return; + } + + rect = data->client_rect; + OffsetRect( &rect, -data->whole_rect.left, -data->whole_rect.top ); + + dst_bits = surface->funcs->get_info( surface, bmi ); + surface->funcs->lock( surface ); + + rect.right = min( rect.right, abs( bmi->bmiHeader.biWidth )); + rect.bottom = min( rect.bottom, abs( bmi->bmiHeader.biHeight )); + + width = rect.right - rect.left; + height = rect.bottom - rect.top; + + TRACE( "client_rect %s, whole_rect %s bmi %dx%d, rect %s.\n", + wine_dbgstr_rect(&data->client_rect), wine_dbgstr_rect(&data->whole_rect), + (int)bmi->bmiHeader.biWidth, (int)bmi->bmiHeader.biHeight, + wine_dbgstr_rect(&rect) ); + + X11DRV_expect_error( gdi_display, XGetImage_handler, NULL ); + image = XGetImage( gdi_display, gl->window, 0, 0, width, height, + AllPlanes, ZPixmap ); + if (X11DRV_check_error()) ERR( "XGetImage error.\n" ); + if (!image) + { + TRACE( "NULL image.\n" ); + goto done; + } + + if (image->bits_per_pixel != bmi->bmiHeader.biBitCount) + { + static unsigned int once; + + if (!once++) + FIXME("Bits per pixel does not match, image %u, bmi %u.\n", image->bits_per_pixel, bmi->bmiHeader.biBitCount); + goto done; + } + + stride = bmi->bmiHeader.biBitCount / 8; + pitch = (bmi->bmiHeader.biWidth * stride + 3) & ~3; + src_bits = (BYTE *)image->data; + for (y = 0; y < height; ++y) + memcpy( dst_bits + (y + rect.top) * pitch + rect.left * stride, + src_bits + y * image->bytes_per_line, width * stride ); + add_bounds_rect( surface->funcs->get_bounds( surface ), &rect ); + +done: + surface->funcs->unlock( surface ); + if (image) XDestroyImage( image ); + release_win_data( data ); +} + static void wglFinish(void) { - struct x11drv_escape_flush_gl_drawable escape; + struct x11drv_escape_present_drawable escape; struct gl_drawable *gl; struct wgl_context *ctx = NtCurrentTeb()->glContext; + HWND hwnd; - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; + escape.code = X11DRV_PRESENT_DRAWABLE; + escape.drawable = 0; escape.flush = FALSE; - if ((gl = get_gl_drawable( NtUserWindowFromDC( ctx->hdc ), 0 ))) + if ((gl = get_gl_drawable( (hwnd = NtUserWindowFromDC( ctx->hdc )), 0 ))) { switch (gl->type) { - case DC_GL_PIXMAP_WIN: escape.gl_drawable = gl->pixmap; break; - case DC_GL_CHILD_WIN: escape.gl_drawable = gl->window; break; + case DC_GL_PIXMAP_WIN: if (!gl->layered_type) escape.drawable = gl->pixmap; break; + case DC_GL_CHILD_WIN: if (!gl->layered_type) escape.drawable = gl->window; break; default: break; } sync_context(ctx); + + if (gl->fs_hack) + { + ctx->fs_hack = gl->fs_hack; + if (!gl->fs_hack_context_set_up) fs_hack_setup_context( ctx, gl ); + if (!gl->fs_hack_did_swapbuf || ctx->drawing_to_front) fs_hack_blit_framebuffer( gl, GL_FRONT ); + } + else if (gl->fs_hack_context_set_up) + { + ctx->fs_hack = FALSE; + fs_hack_setup_context( ctx, gl ); + } + + update_window_surface( gl, hwnd ); release_gl_drawable( gl ); } pglFinish(); - if (escape.gl_drawable) + if (escape.drawable) NtGdiExtEscape( ctx->hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); } static void wglFlush(void) { - struct x11drv_escape_flush_gl_drawable escape; + struct x11drv_escape_present_drawable escape; struct gl_drawable *gl; struct wgl_context *ctx = NtCurrentTeb()->glContext; + HWND hwnd; - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; + escape.code = X11DRV_PRESENT_DRAWABLE; + escape.drawable = 0; escape.flush = FALSE; - if ((gl = get_gl_drawable( NtUserWindowFromDC( ctx->hdc ), 0 ))) + if ((gl = get_gl_drawable( (hwnd = NtUserWindowFromDC( ctx->hdc )), 0 ))) { switch (gl->type) { - case DC_GL_PIXMAP_WIN: escape.gl_drawable = gl->pixmap; break; - case DC_GL_CHILD_WIN: escape.gl_drawable = gl->window; break; + case DC_GL_PIXMAP_WIN: if (!gl->layered_type) escape.drawable = gl->pixmap; break; + case DC_GL_CHILD_WIN: if (!gl->layered_type) escape.drawable = gl->window; break; default: break; } sync_context(ctx); + + if (gl->fs_hack) + { + ctx->fs_hack = gl->fs_hack; + if (!gl->fs_hack_context_set_up) fs_hack_setup_context( ctx, gl ); + if (!gl->fs_hack_did_swapbuf || ctx->drawing_to_front) fs_hack_blit_framebuffer( gl, GL_FRONT ); + } + else if (gl->fs_hack_context_set_up) + { + ctx->fs_hack = FALSE; + fs_hack_setup_context( ctx, gl ); + } + + update_window_surface( gl, hwnd ); release_gl_drawable( gl ); } pglFlush(); - if (escape.gl_drawable) + if (escape.drawable) NtGdiExtEscape( ctx->hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); } static const GLubyte *wglGetString(GLenum name) { + static int override_vendor = -1; + if (override_vendor == -1) + { + int fd; + char buffer[4096], *env; + int sz; + + override_vendor = 0; + if ((env = getenv("WINE_GL_VENDOR_REPORT_AMD"))) + { + override_vendor = env[0] != '0'; + } + else + { + fd = open("/proc/self/cmdline", O_RDONLY); + if (fd != -1) + { + if ((sz = read(fd, buffer, sizeof(buffer) - 1)) > 0) + { + buffer[sz] = 0; + if (strstr(buffer, "\\Paradox Launcher.exe") || strstr(buffer, "Red Tie Runner.exe")) + { + FIXME("HACK: overriding GL vendor and renderer.\n"); + override_vendor = 1; + } + } + close(fd); + } + } + } + if (override_vendor) + { + const GLubyte *s; + if (name == GL_RENDERER) + { + s = pglGetString(name); + if (s && (strstr((const char *)s, "NVIDIA") || strstr((const char *)s, "Intel"))) + { + return (const GLubyte *)"AMD Radeon Graphics"; + } + return s; + } + else if (name == GL_VENDOR) + { + s = pglGetString(name); + if (s && (strstr((const char *)s, "NVIDIA") || strstr((const char *)s, "Intel"))) + { + return (const GLubyte *)"AMD"; + } + return s; + } + } if (name == GL_EXTENSIONS && glExtensions) return (const GLubyte *)glExtensions; return pglGetString(name); } @@ -2085,6 +3602,21 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg case WGL_CONTEXT_LAYER_PLANE_ARB: break; case WGL_CONTEXT_FLAGS_ARB: + /* HACK: The Last Campfire sometimes uses an + * invalid value for WGL_CONTEXT_FLAGS_ARB, which + * triggers + * https://gitlab.freedesktop.org/xorg/lib/libx11/-/issues/152 + * on the Deck. If we see the invalid value we + * directly return an error, so that Wine doesn't + * crash. This hack can be removed once that issue + * is fixed. */ + if (attribList[1] == 0x31b3) + { + WARN("return early to avoid triggering a libX11 bug\n"); + free(ret); + release_gl_drawable(gl); + return NULL; + } pContextAttribList[0] = GLX_CONTEXT_FLAGS_ARB; pContextAttribList[1] = attribList[1]; pContextAttribList += 2; @@ -2116,7 +3648,8 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg } X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL); - ret->ctx = create_glxcontext(gdi_display, ret, hShareContext ? hShareContext->ctx : NULL); + ret->ctx = create_glxcontext(gdi_display, ret, + hShareContext ? hShareContext->ctx : get_common_context( ret->fmt->fbconfig )); XSync(gdi_display, False); if ((err = X11DRV_check_error()) || !ret->ctx) { @@ -3348,18 +4881,19 @@ static void X11DRV_WineGL_LoadExtensions(void) */ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) { - struct x11drv_escape_flush_gl_drawable escape; + struct x11drv_escape_present_drawable escape; struct gl_drawable *gl; struct wgl_context *ctx = NtCurrentTeb()->glContext; INT64 ust, msc, sbc, target_sbc = 0; + HWND hwnd; TRACE("(%p)\n", hdc); - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; + escape.code = X11DRV_PRESENT_DRAWABLE; + escape.drawable = 0; escape.flush = !pglXWaitForSbcOML; - if (!(gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc ))) + if (!(gl = get_gl_drawable( (hwnd = NtUserWindowFromDC( hdc )), hdc ))) { RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return FALSE; @@ -3377,8 +4911,8 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) { case DC_GL_PIXMAP_WIN: if (ctx) sync_context( ctx ); - escape.gl_drawable = gl->pixmap; - if (pglXCopySubBufferMESA) { + if (!gl->layered_type) escape.drawable = gl->pixmap; + if (ctx && pglXCopySubBufferMESA) { /* (glX)SwapBuffers has an implicit glFlush effect, however * GLX_MESA_copy_sub_buffer doesn't. Make sure GL is flushed before * copying */ @@ -3387,7 +4921,7 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) gl->pixmap_size.cx, gl->pixmap_size.cy ); break; } - if (pglXSwapBuffersMscOML) + if (ctx && pglXSwapBuffersMscOML) { pglFlush(); target_sbc = pglXSwapBuffersMscOML( gdi_display, gl->drawable, 0, 0, 0 ); @@ -3398,10 +4932,22 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) case DC_GL_WINDOW: case DC_GL_CHILD_WIN: if (ctx) sync_context( ctx ); - if (gl->type == DC_GL_CHILD_WIN) escape.gl_drawable = gl->window; + if (gl->type == DC_GL_CHILD_WIN && !gl->layered_type) escape.drawable = gl->window; /* fall through */ default: - if (escape.gl_drawable && pglXSwapBuffersMscOML) + if (gl->fs_hack) + { + ctx->fs_hack = gl->fs_hack; + if (!gl->fs_hack_context_set_up) fs_hack_setup_context( ctx, gl ); + fs_hack_blit_framebuffer( gl, GL_BACK ); + gl->fs_hack_did_swapbuf = TRUE; + } + else if (gl->fs_hack_context_set_up) + { + ctx->fs_hack = FALSE; + fs_hack_setup_context( ctx, gl ); + } + if (ctx && (escape.drawable || gl->layered_type) && pglXSwapBuffersMscOML) { pglFlush(); target_sbc = pglXSwapBuffersMscOML( gdi_display, gl->drawable, 0, 0, 0 ); @@ -3411,13 +4957,14 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) break; } - if (escape.gl_drawable && pglXWaitForSbcOML) + if (ctx && (escape.drawable || gl->layered_type) && pglXWaitForSbcOML) pglXWaitForSbcOML( gdi_display, gl->drawable, target_sbc, &ust, &msc, &sbc ); + update_window_surface( gl, hwnd ); release_gl_drawable( gl ); - if (escape.gl_drawable) - NtGdiExtEscape( ctx->hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); + if (escape.drawable) + NtGdiExtEscape( ctx ? ctx->hdc : hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); return TRUE; } diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 8d1da4d0ddc..33761764c74 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -27,6 +27,7 @@ #include "config.h" #include +#include #include #include @@ -35,6 +36,7 @@ #include "wine/debug.h" #include "x11drv.h" +#include "xcomposite.h" #define VK_NO_PROTOTYPES #define WINE_VK_HOST @@ -49,7 +51,7 @@ WINE_DECLARE_DEBUG_CHANNEL(fps); static pthread_mutex_t vulkan_mutex; -static XContext vulkan_hwnd_context; +static XContext swapchain_context; #define VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR 1000004000 @@ -63,6 +65,14 @@ struct wine_vk_surface VkSurfaceKHR host_surface; HWND hwnd; DWORD hwnd_thread_id; + BOOL offscreen; /* drawable is offscreen */ + VkPresentModeKHR present_mode; + BOOL gdi_blit_source; /* HACK: gdi blits from the window should work with Vulkan rendered contents. */ + BOOL other_process; + BOOL invalidated; + Colormap client_colormap; + HDC draw_dc; + unsigned int width, height; }; typedef struct VkXlibSurfaceCreateInfoKHR @@ -74,6 +84,7 @@ typedef struct VkXlibSurfaceCreateInfoKHR Window window; } VkXlibSurfaceCreateInfoKHR; +static VkResult (*pvkAcquireNextImageKHR)(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t *); static VkResult (*pvkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); static VkResult (*pvkCreateSwapchainKHR)(VkDevice, const VkSwapchainCreateInfoKHR *, const VkAllocationCallbacks *, VkSwapchainKHR *); static VkResult (*pvkCreateXlibSurfaceKHR)(VkInstance, const VkXlibSurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *); @@ -94,6 +105,9 @@ static VkResult (*pvkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint3 static VkBool32 (*pvkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice, uint32_t, Display *, VisualID); static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); +static VkResult (*pvkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout); +static VkResult (*pvkCreateFence)(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence); +static void (*pvkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator); static void *X11DRV_get_vk_device_proc_addr(const char *name); static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *name); @@ -117,6 +131,7 @@ static void wine_vk_init(void) #define LOAD_FUNCPTR(f) if (!(p##f = dlsym(vulkan_handle, #f))) goto fail #define LOAD_OPTIONAL_FUNCPTR(f) p##f = dlsym(vulkan_handle, #f) + LOAD_FUNCPTR(vkAcquireNextImageKHR); LOAD_FUNCPTR(vkCreateInstance); LOAD_FUNCPTR(vkCreateSwapchainKHR); LOAD_FUNCPTR(vkCreateXlibSurfaceKHR); @@ -137,10 +152,13 @@ static void wine_vk_init(void) LOAD_FUNCPTR(vkQueuePresentKHR); LOAD_OPTIONAL_FUNCPTR(vkGetDeviceGroupSurfacePresentModesKHR); LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDevicePresentRectanglesKHR); + LOAD_FUNCPTR(vkWaitForFences); + LOAD_FUNCPTR(vkCreateFence); + LOAD_FUNCPTR(vkDestroyFence); #undef LOAD_FUNCPTR #undef LOAD_OPTIONAL_FUNCPTR - vulkan_hwnd_context = XUniqueContext(); + swapchain_context = XUniqueContext(); return; fail: @@ -156,6 +174,7 @@ static VkResult wine_vk_instance_convert_create_info(const VkInstanceCreateInfo { unsigned int i; const char **enabled_extensions = NULL; + VkBaseOutStructure *header; dst->sType = src->sType; dst->flags = src->flags; @@ -166,6 +185,9 @@ static VkResult wine_vk_instance_convert_create_info(const VkInstanceCreateInfo dst->enabledExtensionCount = 0; dst->ppEnabledExtensionNames = NULL; + if ((header = (VkBaseOutStructure *)dst->pNext) && header->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK) + dst->pNext = header->pNext; + if (src->enabledExtensionCount > 0) { enabled_extensions = calloc(src->enabledExtensionCount, sizeof(*src->ppEnabledExtensionNames)); @@ -196,16 +218,18 @@ static VkResult wine_vk_instance_convert_create_info(const VkInstanceCreateInfo return VK_SUCCESS; } -static struct wine_vk_surface *wine_vk_surface_grab(struct wine_vk_surface *surface) +static struct wine_vk_surface *wine_vk_surface_grab( struct wine_vk_surface *surface ) { - InterlockedIncrement(&surface->ref); + int refcount = InterlockedIncrement( &surface->ref ); + TRACE( "surface %p, refcount %d.\n", surface, refcount ); return surface; } -static void wine_vk_surface_release(struct wine_vk_surface *surface) +static void wine_vk_surface_release( struct wine_vk_surface *surface ) { - if (InterlockedDecrement(&surface->ref)) - return; + int refcount = InterlockedDecrement( &surface->ref ); + TRACE( "surface %p, refcount %d.\n", surface, refcount ); + if (refcount) return; if (surface->entry.next) { @@ -214,26 +238,154 @@ static void wine_vk_surface_release(struct wine_vk_surface *surface) pthread_mutex_unlock(&vulkan_mutex); } - if (surface->window) - XDestroyWindow(gdi_display, surface->window); - + if (surface->draw_dc) + NtGdiDeleteObjectApp( surface->draw_dc ); + if (surface->client_colormap) + XFreeColormap( gdi_display, surface->client_colormap ); + destroy_client_window( surface->hwnd, surface->window ); free(surface); } -void wine_vk_surface_destroy(HWND hwnd) +static void wine_vk_surface_detach( struct wine_vk_surface *surface ) +{ + struct x11drv_win_data *data; + + TRACE( "Detaching surface %p, hwnd %p.\n", surface, surface->hwnd ); + + if ((data = get_win_data( surface->hwnd ))) + { + detach_client_window( data, surface->window, TRUE ); + release_win_data( data ); + } + + surface->hwnd_thread_id = 0; + surface->hwnd = NULL; +} + +void destroy_vk_surface( HWND hwnd ) +{ + struct wine_vk_surface *surface, *next; + + pthread_mutex_lock( &vulkan_mutex ); + LIST_FOR_EACH_ENTRY_SAFE( surface, next, &surface_list, struct wine_vk_surface, entry ) + { + if (surface->hwnd != hwnd) continue; + wine_vk_surface_detach( surface ); + } + pthread_mutex_unlock( &vulkan_mutex ); +} + +static void set_dc_drawable( HDC hdc, Drawable drawable, const RECT *rect ) +{ + struct x11drv_escape_set_drawable escape; + + escape.code = X11DRV_SET_DRAWABLE; + escape.mode = IncludeInferiors; + escape.drawable = drawable; + escape.dc_rect = *rect; + NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); +} + +static BOOL wine_vk_surface_set_offscreen( struct wine_vk_surface *surface, BOOL offscreen ) +{ +#ifdef SONAME_LIBXCOMPOSITE + if (usexcomposite) + { + if (vulkan_disable_child_window_rendering_hack) + { + FIXME("Vulkan child window rendering is supported, but it's disabled.\n"); + return TRUE; + } + + if (!surface->offscreen && offscreen) + { + FIXME( "Redirecting vulkan surface %lx offscreen, expect degraded performance.\n", surface->window ); + pXCompositeRedirectWindow( gdi_display, surface->window, CompositeRedirectManual ); + } + else if (surface->offscreen && !offscreen) + { + FIXME( "Putting vulkan surface %lx back onscreen, expect standard performance.\n", surface->window ); + pXCompositeUnredirectWindow( gdi_display, surface->window, CompositeRedirectManual ); + } + surface->offscreen = offscreen; + return TRUE; + } +#endif + + if (offscreen) FIXME( "Application requires child window rendering, which is not implemented yet!\n" ); + surface->offscreen = offscreen; + return !offscreen; +} + +void resize_vk_surfaces( HWND hwnd, Window active, int mask, XWindowChanges *changes ) +{ + struct wine_vk_surface *surface; + + pthread_mutex_lock( &vulkan_mutex ); + LIST_FOR_EACH_ENTRY( surface, &surface_list, struct wine_vk_surface, entry ) + { + if (surface->hwnd != hwnd) continue; + if (!surface->window || surface->window == active) continue; + XConfigureWindow( gdi_display, surface->window, mask, changes ); + } + pthread_mutex_unlock( &vulkan_mutex ); +} + +void sync_vk_surface( HWND hwnd, BOOL known_child ) +{ + struct wine_vk_surface *surface; + + if (vulkan_disable_child_window_rendering_hack) + { + static BOOL once = FALSE; + + if (!once++) + FIXME("Vulkan child window rendering is disabled.\n"); + else + WARN("Vulkan child window rendering is disabled.\n"); + return; + } + + pthread_mutex_lock( &vulkan_mutex ); + LIST_FOR_EACH_ENTRY( surface, &surface_list, struct wine_vk_surface, entry ) + { + if (surface->hwnd != hwnd) continue; + wine_vk_surface_set_offscreen( surface, known_child || surface->gdi_blit_source ); + } + pthread_mutex_unlock( &vulkan_mutex ); +} + +void invalidate_vk_surfaces(HWND hwnd) { struct wine_vk_surface *surface; pthread_mutex_lock(&vulkan_mutex); - if (!XFindContext(gdi_display, (XID)hwnd, vulkan_hwnd_context, (char **)&surface)) + LIST_FOR_EACH_ENTRY(surface, &surface_list, struct wine_vk_surface, entry) { - surface->hwnd_thread_id = 0; - surface->hwnd = NULL; - wine_vk_surface_release(surface); + if (surface->hwnd != hwnd) continue; + surface->invalidated = TRUE; } - XDeleteContext(gdi_display, (XID)hwnd, vulkan_hwnd_context); pthread_mutex_unlock(&vulkan_mutex); } +BOOL wine_vk_direct_window_draw( HWND hwnd ) +{ + struct wine_vk_surface *surface; + BOOL ret = FALSE; + + pthread_mutex_lock(&vulkan_mutex); + LIST_FOR_EACH_ENTRY(surface, &surface_list, struct wine_vk_surface, entry) + { + if (surface->hwnd != hwnd) continue; + if (surface->gdi_blit_source && !surface->other_process) + { + ret = TRUE; + break; + } + } + pthread_mutex_unlock(&vulkan_mutex); + return ret; +} + void vulkan_thread_detach(void) { struct wine_vk_surface *surface, *next; @@ -242,13 +394,8 @@ void vulkan_thread_detach(void) pthread_mutex_lock(&vulkan_mutex); LIST_FOR_EACH_ENTRY_SAFE(surface, next, &surface_list, struct wine_vk_surface, entry) { - if (surface->hwnd_thread_id != thread_id) - continue; - - TRACE("Detaching surface %p, hwnd %p.\n", surface, surface->hwnd); - XReparentWindow(gdi_display, surface->window, get_dummy_parent(), 0, 0); - XSync(gdi_display, False); - wine_vk_surface_destroy(surface->hwnd); + if (surface->hwnd_thread_id != thread_id) continue; + wine_vk_surface_detach( surface ); } pthread_mutex_unlock(&vulkan_mutex); } @@ -256,6 +403,9 @@ void vulkan_thread_detach(void) static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *create_info, const VkAllocationCallbacks *allocator, VkInstance *instance) { + PFN_native_vkCreateInstance native_create_instance = NULL; + void *native_create_instance_context = NULL; + VkCreateInfoWineInstanceCallback *callback; VkInstanceCreateInfo create_info_host; VkResult res; TRACE("create_info %p, allocator %p, instance %p\n", create_info, allocator, instance); @@ -263,6 +413,13 @@ static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *create_info, if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); + if ((callback = (VkCreateInfoWineInstanceCallback *)create_info->pNext) + && callback->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK) + { + native_create_instance = callback->native_create_callback; + native_create_instance_context = callback->context; + } + /* Perform a second pass on converting VkInstanceCreateInfo. Winevulkan * performed a first pass in which it handles everything except for WSI * functionality such as VK_KHR_win32_surface. Handle this now. @@ -274,7 +431,11 @@ static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *create_info, return res; } - res = pvkCreateInstance(&create_info_host, NULL /* allocator */, instance); + if (native_create_instance) + res = native_create_instance(&create_info_host, NULL /* allocator */, instance, + pvkGetInstanceProcAddr, native_create_instance_context); + else + res = pvkCreateInstance(&create_info_host, NULL /* allocator */, instance); free((void *)create_info_host.ppEnabledExtensionNames); return res; @@ -286,6 +447,8 @@ static VkResult X11DRV_vkCreateSwapchainKHR(VkDevice device, { struct wine_vk_surface *x11_surface = surface_from_handle(create_info->surface); VkSwapchainCreateInfoKHR create_info_host; + VkResult result; + TRACE("%p %p %p %p\n", device, create_info, allocator, swapchain); if (allocator) @@ -297,7 +460,57 @@ static VkResult X11DRV_vkCreateSwapchainKHR(VkDevice device, create_info_host = *create_info; create_info_host.surface = x11_surface->host_surface; - return pvkCreateSwapchainKHR(device, &create_info_host, NULL /* allocator */, swapchain); + /* force fifo when running offscreen so the acquire fence is more likely to be vsynced */ + if (x11_surface->gdi_blit_source) + create_info_host.presentMode = VK_PRESENT_MODE_IMMEDIATE_KHR; + else if (x11_surface->offscreen && create_info->presentMode == VK_PRESENT_MODE_MAILBOX_KHR) + create_info_host.presentMode = VK_PRESENT_MODE_FIFO_KHR; + x11_surface->present_mode = create_info->presentMode; + x11_surface->invalidated = FALSE; + + if ((result = pvkCreateSwapchainKHR( device, &create_info_host, NULL /* allocator */, + swapchain )) == VK_SUCCESS) + { + XSaveContext( gdi_display, (XID)(*swapchain), swapchain_context, + (char *)wine_vk_surface_grab( x11_surface ) ); + } + + return result; +} + +static BOOL disable_opwr(void) +{ + static int disable = -1; + if (disable == -1) + { + const char *e = getenv("WINE_DISABLE_VULKAN_OPWR"); + disable = e && atoi(e); + } + return disable; +} + +static void cleanup_leaked_surfaces(HWND hwnd) +{ + struct wine_vk_surface *surface, *next; + static int cleanup = -1; + + if (cleanup == -1) + { + const char *e = getenv("SteamGameId"); + cleanup = e && !strcmp(e, "379720"); + if (cleanup) + ERR("HACK.\n"); + } + + if (!cleanup) + return; + + LIST_FOR_EACH_ENTRY_SAFE(surface, next, &surface_list, struct wine_vk_surface, entry) + { + if (surface->hwnd != hwnd) + continue; + wine_vk_surface_release(surface); + } } static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance, @@ -307,19 +520,14 @@ static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance, VkResult res; VkXlibSurfaceCreateInfoKHR create_info_host; struct wine_vk_surface *x11_surface; + DWORD hwnd_pid; + RECT rect; TRACE("%p %p %p %p\n", instance, create_info, allocator, surface); if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); - /* TODO: support child window rendering. */ - if (create_info->hwnd && NtUserGetAncestor(create_info->hwnd, GA_PARENT) != NtUserGetDesktopWindow()) - { - FIXME("Application requires child window rendering, which is not implemented yet!\n"); - return VK_ERROR_INCOMPATIBLE_DRIVER; - } - x11_surface = calloc(1, sizeof(*x11_surface)); if (!x11_surface) return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -328,8 +536,57 @@ static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance, x11_surface->hwnd = create_info->hwnd; if (x11_surface->hwnd) { - x11_surface->window = create_client_window(create_info->hwnd, &default_visual); - x11_surface->hwnd_thread_id = NtUserGetWindowThread(x11_surface->hwnd, NULL); + x11_surface->hwnd_thread_id = NtUserGetWindowThread(x11_surface->hwnd, &hwnd_pid); + if (x11_surface->hwnd_thread_id && hwnd_pid != GetCurrentProcessId()) + { + XSetWindowAttributes attr; + + WARN("Other process window %p.\n", x11_surface->hwnd); + + if (disable_opwr() && x11_surface->hwnd != NtUserGetDesktopWindow()) + { + ERR("HACK: Failing surface creation for other process window %p.\n", create_info->hwnd); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto err; + } + + NtUserGetClientRect( x11_surface->hwnd, &rect ); + x11_surface->width = max( rect.right - rect.left, 1 ); + x11_surface->height = max( rect.bottom - rect.top, 1 ); + x11_surface->client_colormap = XCreateColormap( gdi_display, get_dummy_parent(), default_visual.visual, + (default_visual.class == PseudoColor || default_visual.class == GrayScale + || default_visual.class == DirectColor) ? AllocAll : AllocNone ); + attr.colormap = x11_surface->client_colormap; + attr.bit_gravity = NorthWestGravity; + attr.win_gravity = NorthWestGravity; + attr.backing_store = NotUseful; + attr.border_pixel = 0; + x11_surface->window = XCreateWindow( gdi_display, + get_dummy_parent(), + 0, 0, x11_surface->width, x11_surface->height, 0, + default_visual.depth, InputOutput, + default_visual.visual, CWBitGravity | CWWinGravity | + CWBackingStore | CWColormap | CWBorderPixel, &attr ); + if (x11_surface->window) + { + const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; + UNICODE_STRING device_str; + + XMapWindow( gdi_display, x11_surface->window ); + XSync( gdi_display, False ); + x11_surface->gdi_blit_source = TRUE; + x11_surface->other_process = TRUE; + + RtlInitUnicodeString( &device_str, displayW ); + x11_surface->draw_dc = NtGdiOpenDCW( &device_str, NULL, NULL, 0, TRUE, NULL, NULL, NULL ); + + set_dc_drawable( x11_surface->draw_dc, x11_surface->window, &rect ); + } + } + else + { + x11_surface->window = create_client_window(create_info->hwnd, &default_visual, default_colormap); + } } else { @@ -345,6 +602,38 @@ static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance, goto err; } + if (!x11_surface->gdi_blit_source && vulkan_gdi_blit_source_hack) + { + RECT rect; + + NtUserGetWindowRect( create_info->hwnd, &rect ); + if (!is_window_rect_mapped( &rect )) + { + struct x11drv_win_data *data; + + FIXME("HACK: setting gdi_blit_source for hwnd %p, surface %p.\n", x11_surface->hwnd, x11_surface); + x11_surface->gdi_blit_source = TRUE; + + if ((data = get_win_data( x11_surface->hwnd ))) + { + detach_client_window( data, x11_surface->window, TRUE ); + release_win_data( data ); + } + } + } + + if (NtUserGetAncestor( create_info->hwnd, GA_PARENT ) != NtUserGetDesktopWindow() || + NtUserGetWindowRelative( create_info->hwnd, GW_CHILD ) || + x11_surface->gdi_blit_source) + { + TRACE("hwnd %p creating offscreen child window surface\n", x11_surface->hwnd); + if (!wine_vk_surface_set_offscreen(x11_surface, TRUE)) + { + res = VK_ERROR_INCOMPATIBLE_DRIVER; + goto err; + } + } + create_info_host.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; create_info_host.pNext = NULL; create_info_host.flags = 0; /* reserved */ @@ -359,16 +648,19 @@ static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance, } pthread_mutex_lock(&vulkan_mutex); - if (x11_surface->hwnd) - { - wine_vk_surface_destroy( x11_surface->hwnd ); - XSaveContext(gdi_display, (XID)create_info->hwnd, vulkan_hwnd_context, (char *)wine_vk_surface_grab(x11_surface)); - } + cleanup_leaked_surfaces(x11_surface->hwnd); list_add_tail(&surface_list, &x11_surface->entry); pthread_mutex_unlock(&vulkan_mutex); *surface = (uintptr_t)x11_surface; + if (x11_surface->gdi_blit_source && !x11_surface->other_process) + { + /* Make sure window gets surface destroyed. */ + UINT flags = SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | + SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_STATECHANGED; + NtUserSetWindowPos( x11_surface->hwnd, 0, 0, 0, 0, 0, flags ); + } TRACE("Created surface=0x%s\n", wine_dbgstr_longlong(*surface)); return VK_SUCCESS; @@ -409,12 +701,20 @@ static void X11DRV_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface static void X11DRV_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *allocator) { + struct wine_vk_surface *surface; + TRACE("%p, 0x%s %p\n", device, wine_dbgstr_longlong(swapchain), allocator); if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); pvkDestroySwapchainKHR(device, swapchain, NULL /* allocator */); + + if (!XFindContext( gdi_display, (XID)swapchain, swapchain_context, (char **)&surface )) + { + wine_vk_surface_release( surface ); + XDeleteContext( gdi_display, (XID)swapchain, swapchain_context ); + } } static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, @@ -638,13 +938,126 @@ static VkResult X11DRV_vkGetSwapchainImagesKHR(VkDevice device, return pvkGetSwapchainImagesKHR(device, swapchain, count, images); } +static VkResult X11DRV_vkAcquireNextImageKHR( VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, + VkSemaphore semaphore, VkFence fence, uint32_t *image_index ) +{ + struct wine_vk_surface *surface; + VkFence orig_fence; + VkResult result; + BOOL wait_fence; + HDC hdc = 0; + RECT rect; + + if (XFindContext( gdi_display, (XID)swapchain, swapchain_context, (char **)&surface )) + return VK_ERROR_SURFACE_LOST_KHR; + + wait_fence = surface->offscreen && (surface->present_mode == VK_PRESENT_MODE_MAILBOX_KHR || + surface->present_mode == VK_PRESENT_MODE_FIFO_KHR || + surface->other_process); + + orig_fence = fence; + if (wait_fence && !fence) + { + VkFenceCreateInfo create_info = {.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO}; + pvkCreateFence( device, &create_info, NULL, &fence ); + } + + result = pvkAcquireNextImageKHR( device, swapchain, timeout, semaphore, fence, image_index ); + + if ((result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR) && surface->offscreen) + { + DWORD dc_flags = DCX_USESTYLE; + if (!surface->gdi_blit_source || surface->other_process) dc_flags |= DCX_CACHE; + hdc = NtUserGetDCEx( surface->hwnd, 0, dc_flags ); + } + + if (hdc) + { + if (wait_fence) pvkWaitForFences( device, 1, &fence, 0, timeout ); + + if (surface->gdi_blit_source) + { + unsigned int width, height; + + NtUserGetClientRect( surface->hwnd, &rect ); + if (surface->other_process) + { + width = max( rect.right - rect.left, 1 ); + height = max( rect.bottom - rect.top, 1 ); + if (!NtGdiStretchBlt(hdc, rect.left, rect.top, width, + height, surface->draw_dc, 0, 0, + width, height, SRCCOPY, 0)) + ERR("StretchBlt failed.\n"); + if (width != surface->width || height != surface->height) + { + TRACE("Resizing.\n"); + XMoveResizeWindow( gdi_display, surface->window, 0, 0, width, height); + set_dc_drawable( surface->draw_dc, surface->window, &rect ); + surface->width = width; + surface->height = height; + } + } + else + { + set_dc_drawable( hdc, surface->window, &rect ); + } + } + else + { + struct x11drv_escape_present_drawable escape = + { + .code = X11DRV_PRESENT_DRAWABLE, + .drawable = surface->window, + .flush = TRUE, + }; + NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (char *)&escape, 0, NULL ); + } + + NtUserReleaseDC( surface->hwnd, hdc ); + } + + if (fence != orig_fence) pvkDestroyFence( device, fence, NULL ); + + if (result == VK_SUCCESS && surface && surface->invalidated) + result = VK_SUBOPTIMAL_KHR; + + return result; +} + +static VkResult X11DRV_vkAcquireNextImage2KHR( VkDevice device, const VkAcquireNextImageInfoKHR *acquire_info, + uint32_t *image_index ) +{ + static int once; + if (!once++) FIXME( "Emulating vkAcquireNextImage2KHR, ignoring pNext.\n" ); + return X11DRV_vkAcquireNextImageKHR( device, acquire_info->swapchain, acquire_info->timeout, + acquire_info->semaphore, acquire_info->fence, image_index ); +} + static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; VkResult res; + UINT i; TRACE("%p, %p\n", queue, present_info); + for (i = 0; i < present_info->swapchainCount; i++) + { + VkSwapchainKHR swapchain = present_info->pSwapchains[i]; + struct wine_vk_surface *surface; + struct x11drv_win_data *data; + + if (!XFindContext( gdi_display, (XID)swapchain, swapchain_context, (char **)&surface ) && + !surface->gdi_blit_source && (data = get_win_data( surface->hwnd ))) + { + attach_client_window( data, surface->window ); + release_win_data( data ); + } + } + + pthread_mutex_lock( &lock ); res = pvkQueuePresentKHR(queue, present_info); + pthread_mutex_unlock( &lock ); if (TRACE_ON(fps)) { @@ -667,6 +1080,25 @@ static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR * } } + if (res == VK_SUCCESS) + { + struct wine_vk_surface *surface; + BOOL invalidated = FALSE; + unsigned int i; + + pthread_mutex_lock(&vulkan_mutex); + for (i = 0; i < present_info->swapchainCount; ++i) + { + if (!XFindContext(gdi_display, (XID)present_info->pSwapchains[i], swapchain_context, (char **)&surface) + && surface->invalidated) + { + invalidated = TRUE; + break; + } + } + pthread_mutex_unlock(&vulkan_mutex); + if (invalidated) res = VK_SUBOPTIMAL_KHR; + } return res; } @@ -679,8 +1111,106 @@ static VkSurfaceKHR X11DRV_wine_get_host_surface( VkSurfaceKHR surface ) return x11_surface->host_surface; } +static VkBool32 X11DRV_query_fs_hack( VkSurfaceKHR surface, VkExtent2D *real_sz, + VkExtent2D *user_sz, VkRect2D *dst_blit, VkFilter *filter ) +{ + struct wine_vk_surface *x11_surface = surface_from_handle( surface ); + HMONITOR monitor; + HWND hwnd; + + if (wm_is_steamcompmgr( gdi_display )) return VK_FALSE; + if (x11_surface->other_process) return VK_FALSE; + + if (x11_surface->other_process) + return VK_FALSE; + + if (!(hwnd = x11_surface->hwnd)) + { + TRACE("No window.\n"); + return VK_FALSE; + } + + monitor = fs_hack_monitor_from_hwnd( hwnd ); + if (fs_hack_enabled( monitor ) && !x11_surface->offscreen) + { + RECT real_rect = fs_hack_real_mode( monitor ); + RECT user_rect = fs_hack_current_mode( monitor ); + SIZE scaled = fs_hack_get_scaled_screen_size( monitor ); + POINT scaled_origin; + + scaled_origin.x = user_rect.left; + scaled_origin.y = user_rect.top; + fs_hack_point_user_to_real( &scaled_origin ); + scaled_origin.x -= real_rect.left; + scaled_origin.y -= real_rect.top; + + TRACE( "real_rect:%s user_rect:%s scaled:%dx%d scaled_origin:%s\n", + wine_dbgstr_rect( &real_rect ), wine_dbgstr_rect( &user_rect ), + (int)scaled.cx, (int)scaled.cy, wine_dbgstr_point( &scaled_origin ) ); + + if (real_sz) + { + real_sz->width = real_rect.right - real_rect.left; + real_sz->height = real_rect.bottom - real_rect.top; + } + + if (user_sz) + { + user_sz->width = user_rect.right - user_rect.left; + user_sz->height = user_rect.bottom - user_rect.top; + } + + if (dst_blit) + { + dst_blit->offset.x = scaled_origin.x; + dst_blit->offset.y = scaled_origin.y; + dst_blit->extent.width = scaled.cx; + dst_blit->extent.height = scaled.cy; + } + + if (filter) *filter = fs_hack_is_integer() ? VK_FILTER_NEAREST : VK_FILTER_LINEAR; + + return VK_TRUE; + } + else if (fs_hack_enabled( monitor )) + { + double scale = fs_hack_get_user_to_real_scale( monitor ); + RECT client_rect; + + NtUserGetClientRect( hwnd, &client_rect ); + + if (real_sz) + { + real_sz->width = (client_rect.right - client_rect.left) * scale; + real_sz->height = (client_rect.bottom - client_rect.top) * scale; + } + + if (user_sz) + { + user_sz->width = client_rect.right - client_rect.left; + user_sz->height = client_rect.bottom - client_rect.top; + } + + if (dst_blit) + { + dst_blit->offset.x = client_rect.left * scale; + dst_blit->offset.y = client_rect.top * scale; + dst_blit->extent.width = (client_rect.right - client_rect.left) * scale; + dst_blit->extent.height = (client_rect.bottom - client_rect.top) * scale; + } + + if (filter) *filter = fs_hack_is_integer() ? VK_FILTER_NEAREST : VK_FILTER_LINEAR; + + return VK_TRUE; + } + + return VK_FALSE; +} + static const struct vulkan_funcs vulkan_funcs = { + X11DRV_vkAcquireNextImage2KHR, + X11DRV_vkAcquireNextImageKHR, X11DRV_vkCreateInstance, X11DRV_vkCreateSwapchainKHR, X11DRV_vkCreateWin32SurfaceKHR, @@ -703,6 +1233,7 @@ static const struct vulkan_funcs vulkan_funcs = X11DRV_vkQueuePresentKHR, X11DRV_wine_get_host_surface, + X11DRV_query_fs_hack, }; static void *X11DRV_get_vk_device_proc_addr(const char *name) @@ -740,7 +1271,19 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version) return NULL; } -void wine_vk_surface_destroy(HWND hwnd) +void destroy_vk_surface( HWND hwnd ) +{ +} + +void resize_vk_surfaces( HWND hwnd, Window active, int mask, XWindowChanges *changes ) +{ +} + +void sync_vk_surface( HWND hwnd, BOOL known_child ) +{ +} + +void invalidate_vk_surfaces(HWND hwnd) { } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a9d6dbf1121..3f64774d2cb 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -26,6 +26,7 @@ #include "config.h" +#include #include #include #include @@ -53,7 +54,6 @@ #include "wine/debug.h" #include "wine/server.h" -#include "mwm.h" WINE_DEFAULT_DEBUG_CHANNEL(x11drv); WINE_DECLARE_DEBUG_CHANNEL(systray); @@ -113,6 +113,103 @@ static const WCHAR clip_window_prop[] = static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER; +static int handle_wm_name_badwindow_error( Display *dpy, XErrorEvent *event, void *arg ) +{ + if (event->error_code == BadWindow) + { + WARN( "BadWindow error when reading WM name from window %lx, ignoring.\n", event->resourceid ); + return 1; + } + + return 0; +} + +static int detect_wm(Display *dpy) +{ + Display *display = dpy ? dpy : thread_init_display(); /* DefaultRootWindow is a macro... */ + Window root = DefaultRootWindow(display), *wm_check; + Atom type; + int format, err; + unsigned long count, remaining; + char *wm_name; + char const *sgi = getenv("SteamGameId"); + + static int cached = -1; + + if(cached < 0){ + + if (XGetWindowProperty( display, root, x11drv_atom(_NET_SUPPORTING_WM_CHECK), 0, + sizeof(*wm_check)/sizeof(CARD32), False, x11drv_atom(WINDOW), + &type, &format, &count, &remaining, (unsigned char **)&wm_check ) == Success){ + if (type == x11drv_atom(WINDOW)){ + /* The window returned by _NET_SUPPORTING_WM_CHECK might be stale, + so we may get errors when asking for its properties */ + X11DRV_expect_error( display, handle_wm_name_badwindow_error, NULL ); + err = XGetWindowProperty( display, *wm_check, x11drv_atom(_NET_WM_NAME), 0, + 256/sizeof(CARD32), False, x11drv_atom(UTF8_STRING), + &type, &format, &count, &remaining, (unsigned char **)&wm_name); + + if (X11DRV_check_error() || err != Success || type != x11drv_atom(UTF8_STRING)){ + X11DRV_expect_error( display, handle_wm_name_badwindow_error, NULL ); + err = XGetWindowProperty( display, *wm_check, x11drv_atom(WM_NAME), 0, + 256/sizeof(CARD32), False, x11drv_atom(STRING), + &type, &format, &count, &remaining, (unsigned char **)&wm_name); + + if (X11DRV_check_error() || err != Success || type != x11drv_atom(STRING)) + wm_name = NULL; + } + + if(wm_name){ + TRACE("Got WM name %s\n", wm_name); + + if((strcmp(wm_name, "GNOME Shell") == 0) || + (strcmp(wm_name, "Mutter") == 0)) + cached = WINE_WM_X11_MUTTER; + else if(strcmp(wm_name, "steamcompmgr") == 0) + cached = WINE_WM_X11_STEAMCOMPMGR; + else if(strcmp(wm_name, "KWin") == 0) + cached = WINE_WM_X11_KDE; + else + cached = WINE_WM_UNKNOWN; + + XFree(wm_name); + }else{ + TRACE("WM did not set _NET_WM_NAME or WM_NAME\n"); + cached = WINE_WM_UNKNOWN; + } + }else + cached = WINE_WM_UNKNOWN; + + XFree(wm_check); + }else + cached = WINE_WM_UNKNOWN; + + /* Street Fighter V expects a certain sequence of window resizes + or gets stuck on startup. The AdjustWindowRect / WM_NCCALCSIZE + hacks confuse it completely, so let's disable them */ + if (sgi && !strcmp(sgi, "310950")) cached = WINE_WM_UNKNOWN; + + __wine_set_window_manager(cached); + } + + return cached; +} + +BOOL wm_is_mutter(Display *display) +{ + return detect_wm(display) == WINE_WM_X11_MUTTER; +} + +BOOL wm_is_kde(Display *display) +{ + return detect_wm(display) == WINE_WM_X11_KDE; +} + +BOOL wm_is_steamcompmgr(Display *display) +{ + return detect_wm(display) == WINE_WM_X11_STEAMCOMPMGR; +} + /*********************************************************************** * http://standards.freedesktop.org/startup-notification-spec */ @@ -292,6 +389,13 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl return NtUserIsWindowRectFullScreen( &data->whole_rect ); } +BOOL is_window_rect_full_virtual_screen( const RECT *rect ) +{ + RECT virtual_rect = NtUserGetVirtualScreenRect(); + return (rect->left <= virtual_rect.left && rect->right >= virtual_rect.right && + rect->top <= virtual_rect.top && rect->bottom >= virtual_rect.bottom); +} + /*********************************************************************** * get_mwm_decorations */ @@ -319,7 +423,10 @@ static unsigned long get_mwm_decorations( struct x11drv_win_data *data, if (style & WS_MAXIMIZEBOX) ret |= MWM_DECOR_MAXIMIZE; } if (ex_style & WS_EX_DLGMODALFRAME) ret |= MWM_DECOR_BORDER; - else if (style & WS_THICKFRAME) ret |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH; + else if (style & WS_THICKFRAME){ + if((style & WS_CAPTION) == WS_CAPTION) + ret |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH; + } else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) ret |= MWM_DECOR_BORDER; return ret; } @@ -362,6 +469,7 @@ static void sync_window_style( struct x11drv_win_data *data ) int mask = get_window_attributes( data, &attr ); XChangeWindowAttributes( data->display, data->whole_window, mask, &attr ); + X11DRV_XInput2_Enable( data->display, data->whole_window, attr.event_mask ); } } @@ -377,6 +485,12 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region ) HRGN hrgn = win_region; if (!data->whole_window) return; + + if (data->fs_hack) + { + ERR( "shaped windows with fs hack not supported, things may go badly\n" ); + } + data->shaped = FALSE; if (IsRectEmpty( &data->window_rect )) /* set an empty shape */ @@ -716,8 +830,9 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) { if (data->hwnd != NtUserGetDesktopWindow()) /* don't force position of desktop */ { - size_hints->x = data->whole_rect.left; - size_hints->y = data->whole_rect.top; + POINT pt = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + size_hints->x = pt.x; + size_hints->y = pt.y; size_hints->flags |= PPosition; } else size_hints->win_gravity = NorthWestGravity; @@ -737,13 +852,31 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) XFree( size_hints ); } +struct is_unmap_notify_param +{ + struct x11drv_win_data *data; + BOOL found; +}; + +static Bool is_unmap_notify( Display *display, XEvent *event, XPointer arg ) +{ + struct is_unmap_notify_param *p = (struct is_unmap_notify_param *)arg; + + if (!p->found) + p->found = event->type == UnmapNotify && + event->xany.serial >= p->data->unmapnotify_serial && + event->xany.window == p->data->whole_window; + return False; +} /*********************************************************************** * set_mwm_hints */ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_style ) { + GUITHREADINFO info = {.cbSize = sizeof(GUITHREADINFO)}; MwmHints mwm_hints; + int enable_mutter_workaround, mapped; if (data->hwnd == NtUserGetDesktopWindow()) { @@ -775,12 +908,71 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty TRACE( "%p setting mwm hints to %lx,%lx (style %x exstyle %x)\n", data->hwnd, mwm_hints.decorations, mwm_hints.functions, style, ex_style ); + enable_mutter_workaround = wm_is_mutter(data->display) && NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) && + info.hwndFocus == data->hwnd && !!data->prev_hints.decorations != !!mwm_hints.decorations && + root_window == DefaultRootWindow(data->display); + + /* workaround for mutter gitlab bug #649, we cannot trust the + * data->mapped flag as mapping is asynchronous. + */ + if (enable_mutter_workaround) + { + XWindowAttributes attr; + + mapped = data->mapped; + if (XGetWindowAttributes( data->display, data->whole_window, &attr )) + mapped = (attr.map_state != IsUnmapped); + } + mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; mwm_hints.input_mode = 0; mwm_hints.status = 0; + data->unmapnotify_serial = NextRequest( data->display ); XChangeProperty( data->display, data->whole_window, x11drv_atom(_MOTIF_WM_HINTS), x11drv_atom(_MOTIF_WM_HINTS), 32, PropModeReplace, (unsigned char*)&mwm_hints, sizeof(mwm_hints)/sizeof(long) ); + + if (enable_mutter_workaround && mapped) + { + DWORD end = NtGetTickCount() + 100; + struct is_unmap_notify_param p; + struct pollfd pfd; + XEvent event; + int timeout; + + /* workaround for mutter gitlab bug #649, wait for the map notify + * event each time the decorations are modified before modifying + * them again. + */ + p.data = data; + p.found = FALSE; + TRACE("workaround mutter bug #649, waiting for UnmapNotify\n"); + pfd.fd = ConnectionNumber(data->display); + pfd.events = POLLIN; + for (;;) + { + XCheckIfEvent( data->display, &event, is_unmap_notify, (XPointer)&p ); + if (p.found) break; + timeout = end - NtGetTickCount(); + if (timeout <= 0 || poll( &pfd, 1, timeout ) != 1) + { + WARN( "window %p/%lx unmap_notify wait timed out.\n", data->hwnd, data->whole_window ); + break; + } + } + } + + if (wm_is_mutter(data->display) && NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) && + info.hwndFocus == data->hwnd && !!data->prev_hints.decorations != !!mwm_hints.decorations) + { + LARGE_INTEGER frequency, counter; + /* workaround for mutter gitlab bug #273 */ + TRACE("workaround mutter bug, setting take_focus_back\n"); + NtQueryPerformanceCounter( &counter, &frequency ); + data->take_focus_back = 1000 * counter.QuadPart / frequency.QuadPart; + } + + data->prev_hints = mwm_hints; } @@ -868,8 +1060,19 @@ static void set_initial_wm_hints( Display *display, Window window ) /* class hints */ if ((class_hints = XAllocClassHint())) { - class_hints->res_name = process_name; - class_hints->res_class = process_name; + static char steam_proton[] = "steam_proton"; + const char *app_id = getenv("SteamAppId"); + char proton_app_class[128]; + + if(app_id && *app_id){ + snprintf(proton_app_class, sizeof(proton_app_class), "steam_app_%s", app_id); + class_hints->res_name = proton_app_class; + class_hints->res_class = proton_app_class; + }else{ + class_hints->res_name = steam_proton; + class_hints->res_class = steam_proton; + } + XSetClassHint( display, window, class_hints ); XFree( class_hints ); } @@ -1024,7 +1227,10 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) return; if (!xinerama_get_fullscreen_monitors( &data->whole_rect, monitors )) + { + ERR( "Failed to find xinerama monitors at %s\n", wine_dbgstr_rect(&data->whole_rect) ); return; + } /* If _NET_WM_FULLSCREEN_MONITORS is not set and the fullscreen monitors are spanning only one * monitor then do not set _NET_WM_FULLSCREEN_MONITORS. @@ -1040,6 +1246,38 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) && !data->net_wm_fullscreen_monitors_set) return; + /* If _NET_WM_FULLSCREEN_MONITORS is not set and the fullscreen monitors are spanning only one + * monitor then do not set _NET_WM_FULLSCREEN_MONITORS. + * + * If _NET_WM_FULLSCREEN_MONITORS is set then the property needs to be updated because it can't + * be deleted by sending a _NET_WM_FULLSCREEN_MONITORS client message to the root window + * according to the wm-spec version 1.4. Having the window spanning more than two monitors also + * needs the property set. In other cases, _NET_WM_FULLSCREEN_MONITORS doesn't need to be set. + * What's more, setting _NET_WM_FULLSCREEN_MONITORS adds a constraint on Mutter so that such a + * window can't be moved to another monitor by using the Shift+Super+Up/Down/Left/Right + * shortcut. So the property should be added only when necessary. */ + if (monitors[0] == monitors[1] && monitors[1] == monitors[2] && monitors[2] == monitors[3]) + { + unsigned long count, remaining; + BOOL prop_found = FALSE; + long *prop_data; + int format; + Atom type; + + if (!XGetWindowProperty( data->display, data->whole_window, + x11drv_atom(_NET_WM_FULLSCREEN_MONITORS), 0, ~0, False, + XA_CARDINAL, &type, &format, &count, &remaining, + (unsigned char **)&prop_data )) + { + if (type == XA_CARDINAL && format == 32 && count == 4) + prop_found = TRUE; + XFree(prop_data); + } + + if (!prop_found) + return; + } + if (!data->mapped) { XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_FULLSCREEN_MONITORS), @@ -1067,7 +1305,9 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) */ void update_net_wm_states( struct x11drv_win_data *data ) { + unsigned long net_wm_bypass_compositor = 0; UINT i, style, ex_style, new_state = 0; + HMONITOR monitor; if (!data->managed) return; if (data->whole_window == root_window) @@ -1079,18 +1319,35 @@ void update_net_wm_states( struct x11drv_win_data *data ) style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); - if (NtUserIsWindowRectFullScreen( &data->whole_rect )) + monitor = fs_hack_monitor_from_hwnd( data->hwnd ); + if ((!data->fs_hack || fs_hack_enabled( monitor )) && NtUserIsWindowRectFullScreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) new_state |= (1 << NET_WM_STATE_MAXIMIZED); else if (!(style & WS_MINIMIZE)) - new_state |= (1 << NET_WM_STATE_FULLSCREEN); + { + if (!wm_is_steamcompmgr( data->display ) || !fs_hack_enabled( monitor )) + { + /* when fs hack is enabled, we don't want steamcompmgr to resize the window to be fullscreened */ + if (is_window_rect_full_virtual_screen( &data->whole_rect )) + net_wm_bypass_compositor = 1; + new_state |= (1 << NET_WM_STATE_FULLSCREEN); + } + } } else if (style & WS_MAXIMIZE) new_state |= (1 << NET_WM_STATE_MAXIMIZED); ex_style = NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ); - if (ex_style & WS_EX_TOPMOST) + if ((ex_style & WS_EX_TOPMOST) && + /* This workaround was initially targetting some mutter and KDE issues, but + * removing it causes failure to focus out from exclusive fullscreen windows. + * + * Many games do not have any specific logic to get out of exclusive fullscreen + * mode, and we have currently no way to tell exclusive fullscreen from a window + * with topmost + fullscreen styles, so we cannot properly implement it either. + */ + !(new_state & (1 << NET_WM_STATE_FULLSCREEN))) new_state |= (1 << NET_WM_STATE_ABOVE); if (!data->add_taskbar) { @@ -1138,6 +1395,14 @@ void update_net_wm_states( struct x11drv_win_data *data ) i, data->hwnd, data->whole_window, (new_state & (1 << i)) != 0, (data->net_wm_state & (1 << i)) != 0 ); + if (i == NET_WM_STATE_FULLSCREEN) + { + data->pending_fullscreen = (new_state & (1 << i)) + && !(data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN) + && wm_is_steamcompmgr(data->display)); + TRACE( "set pending_fullscreen to: %u\n", data->pending_fullscreen ); + } + xev.xclient.data.l[0] = (new_state & (1 << i)) ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; xev.xclient.data.l[1] = X11DRV_Atoms[net_wm_state_atoms[i] - FIRST_XATOM]; xev.xclient.data.l[2] = ((net_wm_state_atoms[i] == XATOM__NET_WM_STATE_MAXIMIZED_VERT) ? @@ -1147,7 +1412,12 @@ void update_net_wm_states( struct x11drv_win_data *data ) } } data->net_wm_state = new_state; - update_net_wm_fullscreen_monitors( data ); + + if (!(style & WS_MINIMIZE)) + update_net_wm_fullscreen_monitors( data ); + + XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_BYPASS_COMPOSITOR), XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&net_wm_bypass_compositor, 1 ); } /*********************************************************************** @@ -1207,6 +1477,19 @@ static void set_xembed_flags( struct x11drv_win_data *data, unsigned long flags x11drv_atom(_XEMBED_INFO), 32, PropModeReplace, (unsigned char*)info, 2 ); } +static int skip_iconify( Display *display ) +{ + static int cached = -1; + const char *env; + + if (cached == -1) + { + FIXME( "HACK: skip_iconify.\n" ); + cached = wm_is_steamcompmgr( display ) && (env = getenv( "SteamGameId" )) && !strcmp( env, "1827980" ); + } + + return cached; +} /*********************************************************************** * map_window @@ -1232,6 +1515,9 @@ static void map_window( HWND hwnd, DWORD new_style ) update_net_wm_states( data ); sync_window_style( data ); XMapWindow( data->display, data->whole_window ); + /* Mutter always unminimizes windows when handling map requests. Restore iconic state */ + if (new_style & WS_MINIMIZE && !skip_iconify( data->display )) + XIconifyWindow( data->display, data->whole_window, data->vis.screen ); XFlush( data->display ); if (data->surface && data->vis.visualid != default_visual.visualid) data->surface->funcs->flush( data->surface ); @@ -1267,6 +1553,7 @@ static void unmap_window( HWND hwnd ) data->mapped = FALSE; data->net_wm_state = 0; + data->pending_fullscreen = FALSE; } release_win_data( data ); } @@ -1283,6 +1570,7 @@ void make_window_embedded( struct x11drv_win_data *data ) if (!data->managed) XUnmapWindow( data->display, data->whole_window ); else XWithdrawWindow( data->display, data->whole_window, data->vis.screen ); data->net_wm_state = 0; + data->pending_fullscreen = FALSE; } data->embedded = TRUE; data->managed = TRUE; @@ -1366,22 +1654,38 @@ void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, i * * Synchronize the X window position with the Windows one */ -static void sync_window_position( struct x11drv_win_data *data, +static HWND sync_window_position( struct x11drv_win_data *data, UINT swp_flags, const RECT *old_window_rect, const RECT *old_whole_rect, const RECT *old_client_rect ) { DWORD style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); DWORD ex_style = NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ); + RECT original_rect = {0}; + HWND prev_window = NULL; XWindowChanges changes; unsigned int mask = 0; - if (data->managed && data->iconic) return; + if (data->managed && data->iconic) return NULL; /* resizing a managed maximized window is not allowed */ if (!(style & WS_MAXIMIZE) || !data->managed) { - changes.width = data->whole_rect.right - data->whole_rect.left; - changes.height = data->whole_rect.bottom - data->whole_rect.top; + if (data->fs_hack) + { + HMONITOR monitor; + RECT rect; + + monitor = fs_hack_monitor_from_hwnd( data->hwnd ); + rect = fs_hack_real_mode( monitor ); + changes.width = rect.right - rect.left; + changes.height = rect.bottom - rect.top; + TRACE( "change width:%d height:%d\n", changes.width, changes.height ); + } + else + { + changes.width = data->whole_rect.right - data->whole_rect.left; + changes.height = data->whole_rect.bottom - data->whole_rect.top; + } /* if window rect is empty force size to 1x1 */ if (changes.width <= 0 || changes.height <= 0) changes.width = changes.height = 1; if (changes.width > 65535) changes.width = 65535; @@ -1402,9 +1706,10 @@ static void sync_window_position( struct x11drv_win_data *data, { /* find window that this one must be after */ HWND prev = NtUserGetWindowRelative( data->hwnd, GW_HWNDPREV ); + while (prev && !(NtUserGetWindowLongW( prev, GWL_STYLE ) & WS_VISIBLE)) prev = NtUserGetWindowRelative( prev, GW_HWNDPREV ); - if (!prev) /* top child */ + if (!(prev_window = prev)) /* top child */ { changes.stack_mode = Above; mask |= CWStackMode; @@ -1415,9 +1720,21 @@ static void sync_window_position( struct x11drv_win_data *data, set_size_hints( data, style ); set_mwm_hints( data, style, ex_style ); + /* KWin doesn't allow moving a window with _NET_WM_STATE_FULLSCREEN set. So we need to remove + * _NET_WM_STATE_FULLSCREEN before moving the window and restore it later */ + if (wm_is_kde( data->display ) && NtUserIsWindowRectFullScreen( &data->whole_rect )) + { + original_rect = data->whole_rect; + SetRectEmpty( &data->whole_rect ); + } update_net_wm_states( data ); data->configure_serial = NextRequest( data->display ); XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); + if (!IsRectEmpty( &original_rect )) + { + data->whole_rect = original_rect; + update_net_wm_states( data ); + } #ifdef HAVE_LIBXSHAPE if (IsRectEmpty( old_window_rect ) != IsRectEmpty( &data->window_rect )) sync_window_region( data, (HRGN)1 ); @@ -1438,6 +1755,8 @@ static void sync_window_position( struct x11drv_win_data *data, (int)(data->whole_rect.right - data->whole_rect.left), (int)(data->whole_rect.bottom - data->whole_rect.top), changes.sibling, mask, data->configure_serial ); + + return prev_window; } @@ -1464,11 +1783,27 @@ static void sync_client_position( struct x11drv_win_data *data, if (changes.width != old_client_rect->right - old_client_rect->left) mask |= CWWidth; if (changes.height != old_client_rect->bottom - old_client_rect->top) mask |= CWHeight; + if (data->fs_hack) + { + HMONITOR monitor; + RECT rect; + + monitor = fs_hack_monitor_from_hwnd( data->hwnd ); + rect = fs_hack_real_mode( monitor ); + changes.x = 0; + changes.y = 0; + changes.width = rect.right - rect.left; + changes.height = rect.bottom - rect.top; + mask = CWX | CWY | CWWidth | CWHeight; + TRACE( "x:%d y:%d width:%d height:%d\n", changes.x, changes.y, changes.width, changes.height ); + } + if (mask) { TRACE( "setting client win %lx pos %d,%d,%dx%d changes=%x\n", data->client_window, changes.x, changes.y, changes.width, changes.height, mask ); XConfigureWindow( gdi_display, data->client_window, mask, &changes ); + resize_vk_surfaces( data->hwnd, data->client_window, mask, &changes ); } } @@ -1586,6 +1921,66 @@ Window get_dummy_parent(void) } +/********************************************************************** + * detach_client_window + */ +void detach_client_window( struct x11drv_win_data *data, Window client_window, BOOL reparent ) +{ + if (data->client_window != client_window || !client_window) return; + data->client_window = 0; + + if (!data->whole_window) return; + + XSelectInput( data->display, client_window, 0 ); + XFlush( data->display ); /* make sure XSelectInput is disabled for client_window after this point */ + XDeleteContext( data->display, client_window, winContext ); + + if (reparent) XReparentWindow( gdi_display, client_window, get_dummy_parent(), 0, 0 ); + TRACE( "%p/%lx detached client window %lx\n", data->hwnd, data->whole_window, client_window ); +} + + +/********************************************************************** + * attach_client_window + */ +void attach_client_window( struct x11drv_win_data *data, Window client_window ) +{ + if (data->client_window == client_window || !client_window) return; + detach_client_window( data, data->client_window, TRUE ); + data->client_window = client_window; + + if (!data->whole_window) return; + + XSaveContext( data->display, client_window, winContext, (char *)data->hwnd ); + XSelectInput( data->display, client_window, ExposureMask ); + XFlush( data->display ); /* make sure XSelectInput is enabled for client_window after this point */ + + XReparentWindow( gdi_display, client_window, data->whole_window, data->client_rect.left - data->whole_rect.left, + data->client_rect.top - data->whole_rect.top ); + TRACE( "%p/%lx attached client window %lx\n", data->hwnd, data->whole_window, client_window ); +} + + +/********************************************************************** + * destroy_client_window + */ +void destroy_client_window( HWND hwnd, Window client_window ) +{ + struct x11drv_win_data *data; + + if (!client_window) return; + + if ((data = get_win_data( hwnd ))) + { + detach_client_window( data, client_window, FALSE ); + release_win_data( data ); + } + + XDestroyWindow( gdi_display, client_window ); + TRACE( "%p destroyed client window %lx\n", hwnd, client_window ); +} + + /********************************************************************** * create_dummy_client_window */ @@ -1607,12 +2002,12 @@ Window create_dummy_client_window(void) /********************************************************************** * create_client_window */ -Window create_client_window( HWND hwnd, const XVisualInfo *visual ) +Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ) { - Window dummy_parent = get_dummy_parent(); struct x11drv_win_data *data = get_win_data( hwnd ); + Window parent_window, client_window; XSetWindowAttributes attr; - Window ret; + unsigned int attr_mask; int x, y, cx, cy; if (!data) @@ -1625,49 +2020,83 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual ) data->window_rect = data->whole_rect = data->client_rect; } - if (data->client_window) - { - XDeleteContext( data->display, data->client_window, winContext ); - XReparentWindow( gdi_display, data->client_window, dummy_parent, 0, 0 ); - TRACE( "%p reparent xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); - } - - if (data->client_colormap) XFreeColormap( gdi_display, data->client_colormap ); - data->client_colormap = XCreateColormap( gdi_display, dummy_parent, visual->visual, - (visual->class == PseudoColor || - visual->class == GrayScale || - visual->class == DirectColor) ? AllocAll : AllocNone ); - attr.colormap = data->client_colormap; + attr.colormap = colormap; attr.bit_gravity = NorthWestGravity; attr.win_gravity = NorthWestGravity; attr.backing_store = NotUseful; attr.border_pixel = 0; + attr_mask = CWColormap | CWBitGravity | CWWinGravity | CWBackingStore | CWBorderPixel; x = data->client_rect.left - data->whole_rect.left; y = data->client_rect.top - data->whole_rect.top; cx = min( max( 1, data->client_rect.right - data->client_rect.left ), 65535 ); cy = min( max( 1, data->client_rect.bottom - data->client_rect.top ), 65535 ); - XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */ - ret = data->client_window = XCreateWindow( gdi_display, - data->whole_window ? data->whole_window : dummy_parent, - x, y, cx, cy, 0, default_visual.depth, InputOutput, - visual->visual, CWBitGravity | CWWinGravity | - CWBackingStore | CWColormap | CWBorderPixel, &attr ); - if (data->client_window) + if (data->fs_hack) + { + HMONITOR monitor = fs_hack_monitor_from_hwnd( hwnd ); + RECT rect = fs_hack_real_mode( monitor ); + cx = rect.right - rect.left; + cy = rect.bottom - rect.top; + + TRACE( "width:%d height:%d\n", cx, cy ); + } + + TRACE( "setting client rect: %u, %u x %ux%u\n", x, y, cx, cy ); + + /* NOTE: Creating the client windows as child of dummy parent has bad interactions with + * Steam Overlay and will cause whole_window to minimize when the overlay opens... */ + parent_window = data->whole_window ? data->whole_window : get_dummy_parent(); + if ((client_window = XCreateWindow( gdi_display, parent_window, x, y, cx, cy, 0, default_visual.depth, + InputOutput, visual->visual, attr_mask, &attr ))) { - XSaveContext( data->display, data->client_window, winContext, (char *)data->hwnd ); + XFlush( gdi_display ); /* make sure client_window is created for XSelectInput */ + XSync( data->display, False ); /* make sure client_window is known from data->display */ + + attach_client_window( data, client_window ); XMapWindow( gdi_display, data->client_window ); - if (data->whole_window) - { - XFlush( gdi_display ); /* make sure client_window is created for XSelectInput */ - XSync( data->display, False ); /* make sure client_window is known from data->display */ - XSelectInput( data->display, data->client_window, ExposureMask ); - } + TRACE( "%p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); } + release_win_data( data ); - return ret; + return client_window; +} + + +void set_hwnd_style_props( Display *display, Window window, HWND hwnd ) +{ + DWORD style = NtUserGetWindowLongW( hwnd, GWL_STYLE ), exstyle = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ); + + TRACE( "display %p, window %lx, hwnd %p\n", display, window, hwnd ); + + XChangeProperty( display, window, x11drv_atom(_WINE_HWND_STYLE), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&style, sizeof(style) / 4 ); + XChangeProperty( display, window, x11drv_atom(_WINE_HWND_EXSTYLE), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&exstyle, sizeof(exstyle) / 4 ); +} + + +void set_gamescope_overlay_prop( Display *display, Window window, HWND hwnd ) +{ + static const WCHAR class_name[] = {'X','a','l','i','a','O','v','e','r','l','a','y','B','o','x',0}; + WCHAR class_name_buf[16]; + UNICODE_STRING class_name_str; + INT ret; + + class_name_str.Buffer = class_name_buf; + class_name_str.MaximumLength = sizeof(class_name_buf); + + ret = NtUserGetClassName( hwnd, FALSE, &class_name_str ); + + if (ret && !wcscmp( class_name_buf, class_name )) { + DWORD one = 1; + + TRACE( "setting GAMESCOPE_XALIA_OVERLAY on window %lx, hwnd %p\n", window, hwnd ); + + XChangeProperty( display, window, x11drv_atom(GAMESCOPE_XALIA_OVERLAY), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&one, sizeof(one) / 4 ); + } } @@ -1706,23 +2135,43 @@ static void create_whole_window( struct x11drv_win_data *data ) mask = get_window_attributes( data, &attr ); + attr.background_pixel = XBlackPixel( data->display, data->vis.screen ); + mask |= CWBackPixel; + if (!(cx = data->whole_rect.right - data->whole_rect.left)) cx = 1; else if (cx > 65535) cx = 65535; if (!(cy = data->whole_rect.bottom - data->whole_rect.top)) cy = 1; else if (cy > 65535) cy = 65535; + if (data->fs_hack) + { + RECT rect = {0, 0, 0, 0}; + HMONITOR monitor; + + monitor = fs_hack_monitor_from_hwnd( data->hwnd ); + rect = fs_hack_real_mode( monitor ); + cx = rect.right - rect.left; + cy = rect.bottom - rect.top; + TRACE( "width:%d height:%d\n", cx, cy ); + } + pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); data->whole_window = XCreateWindow( data->display, root_window, pos.x, pos.y, cx, cy, 0, data->vis.depth, InputOutput, data->vis.visual, mask, &attr ); if (!data->whole_window) goto done; + X11DRV_XInput2_Enable( data->display, data->whole_window, attr.event_mask ); set_initial_wm_hints( data->display, data->whole_window ); set_wm_hints( data ); XSaveContext( data->display, data->whole_window, winContext, (char *)data->hwnd ); NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)data->whole_window ); + set_hwnd_style_props( data->display, data->whole_window, data->hwnd ); + + set_gamescope_overlay_prop( data->display, data->whole_window, data->hwnd ); + /* set the window text */ if (!NtUserInternalGetWindowText( data->hwnd, text, ARRAY_SIZE( text ))) text[0] = 0; sync_window_text( data->display, data->whole_window, text ); @@ -1735,6 +2184,7 @@ static void create_whole_window( struct x11drv_win_data *data ) sync_window_opacity( data->display, data->whole_window, key, alpha, layered_flags ); XFlush( data->display ); /* make sure the window exists before we start painting to it */ + XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */ done: if (win_rgn) NtGdiDeleteObjectApp( win_rgn ); @@ -1750,7 +2200,7 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des { TRACE( "win %p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); - if (data->client_window) XDeleteContext( data->display, data->client_window, winContext ); + detach_client_window( data, data->client_window, !already_destroyed ); if (!data->whole_window) { @@ -1768,12 +2218,6 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des } else { - if (data->client_window && !already_destroyed) - { - XSelectInput( data->display, data->client_window, 0 ); - XFlush( data->display ); /* make sure XSelectInput doesn't use client_window after this point */ - XReparentWindow( gdi_display, data->client_window, get_dummy_parent(), 0, 0 ); - } XDeleteContext( data->display, data->whole_window, winContext ); if (!already_destroyed) { @@ -1782,10 +2226,11 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des } } if (data->whole_colormap) XFreeColormap( data->display, data->whole_colormap ); - data->whole_window = data->client_window = 0; + data->whole_window = 0; data->whole_colormap = 0; data->wm_state = WithdrawnState; data->net_wm_state = 0; + data->pending_fullscreen = FALSE; data->mapped = FALSE; if (data->xic) { @@ -1809,7 +2254,6 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ) { Window client_window = data->client_window; - Window whole_window = data->whole_window; if (!data->use_alpha == !use_alpha) return; if (data->surface) window_surface_release( data->surface ); @@ -1817,18 +2261,14 @@ void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BO data->use_alpha = use_alpha; if (data->vis.visualid == vis->visualid) return; - data->client_window = 0; - destroy_whole_window( data, client_window != 0 /* don't destroy whole_window until reparented */ ); + client_window = data->client_window; + /* detach the client before re-creating whole_window */ + detach_client_window( data, client_window, TRUE ); + destroy_whole_window( data, FALSE ); data->vis = *vis; create_whole_window( data ); - if (!client_window) return; - /* move the client to the new parent */ - XReparentWindow( gdi_display, client_window, data->whole_window, - data->client_rect.left - data->whole_rect.left, - data->client_rect.top - data->whole_rect.top ); - data->client_window = client_window; - XSync( gdi_display, False ); /* make sure XReparentWindow requests have completed before destroying whole_window */ - XDestroyWindow( data->display, whole_window ); + /* attach the client back to the re-created whole_window */ + attach_client_window( data, client_window ); } @@ -1856,6 +2296,18 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { struct x11drv_win_data *data; DWORD changed = style->styleNew ^ style->styleOld; + HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); + BOOL need_sync_gl = FALSE; + + if (offset == GWL_STYLE && (changed & WS_CHILD)) + { + if (NtUserGetWindowRelative( parent, GW_CHILD ) || + NtUserGetAncestor( parent, GA_PARENT ) != NtUserGetDesktopWindow()) + sync_vk_surface( parent, TRUE ); + else + sync_vk_surface( parent, FALSE ); + sync_vk_surface( hwnd, style->styleNew & WS_CHILD ); + } if (hwnd == NtUserGetDesktopWindow()) return; if (!(data = get_win_data( hwnd ))) return; @@ -1866,12 +2318,15 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */ { data->layered = FALSE; + data->layered_attributes = FALSE; + need_sync_gl = TRUE; set_window_visual( data, &default_visual, FALSE ); sync_window_opacity( data->display, data->whole_window, 0, 0, 0 ); if (data->surface) set_surface_color_key( data->surface, CLR_INVALID ); } done: release_win_data( data ); + if (need_sync_gl) sync_gl_drawable( hwnd, FALSE ); } @@ -1882,6 +2337,14 @@ void X11DRV_DestroyWindow( HWND hwnd ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data; + HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); + + if (!NtUserGetWindowRelative( parent, GW_CHILD ) && + NtUserGetAncestor( parent, GA_PARENT ) == NtUserGetDesktopWindow()) + { + sync_gl_drawable( parent, FALSE ); + sync_vk_surface( parent, FALSE ); + } if (!(data = get_win_data( hwnd ))) return; @@ -1890,13 +2353,12 @@ void X11DRV_DestroyWindow( HWND hwnd ) if (thread_data->last_xic_hwnd == hwnd) thread_data->last_xic_hwnd = 0; if (data->icon_pixmap) XFreePixmap( gdi_display, data->icon_pixmap ); if (data->icon_mask) XFreePixmap( gdi_display, data->icon_mask ); - if (data->client_colormap) XFreeColormap( data->display, data->client_colormap ); free( data->icon_bits ); XDeleteContext( gdi_display, (XID)hwnd, win_data_context ); release_win_data( data ); free( data ); destroy_gl_drawable( hwnd ); - wine_vk_surface_destroy( hwnd ); + destroy_vk_surface( hwnd ); } @@ -1943,6 +2405,8 @@ void X11DRV_SetDesktopWindow( HWND hwnd ) { unsigned int width, height; + detect_wm( gdi_display ); + /* retrieve the real size of the desktop */ SERVER_START_REQ( get_window_rectangles ) { @@ -2049,12 +2513,17 @@ BOOL X11DRV_CreateWindow( HWND hwnd ) struct x11drv_thread_data *data = x11drv_init_thread_data(); XSetWindowAttributes attr; + data->xi2_rawinput_only = TRUE; + X11DRV_XInput2_Enable( data->display, None, PointerMotionMask | ButtonPressMask | ButtonReleaseMask ); + /* create the cursor clipping window */ attr.override_redirect = TRUE; attr.event_mask = StructureNotifyMask | FocusChangeMask; data->clip_window = XCreateWindow( data->display, root_window, 0, 0, 1, 1, 0, 0, InputOnly, default_visual.visual, CWOverrideRedirect | CWEventMask, &attr ); + X11DRV_XInput2_Enable( data->display, data->clip_window, attr.event_mask ); + XSelectInput( data->display, DefaultRootWindow( data->display ), PropertyChangeMask ); XFlush( data->display ); NtUserSetProp( hwnd, clip_window_prop, (HANDLE)data->clip_window ); X11DRV_DisplayDevices_RegisterEventHandlers(); @@ -2115,6 +2584,7 @@ static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *wi * that will need clipping support. */ sync_gl_drawable( parent, TRUE ); + sync_vk_surface( parent, TRUE ); display = thread_init_display(); init_clip_window(); /* make sure the clip window is initialized in this thread */ @@ -2245,7 +2715,8 @@ void X11DRV_SystrayDockInit( HWND hwnd ) sprintf( systray_buffer, "_NET_SYSTEM_TRAY_S%u", DefaultScreen( display ) ); systray_atom = XInternAtom( display, systray_buffer, False ); } - XSelectInput( display, root_window, StructureNotifyMask ); + + XSelectInput( display, DefaultRootWindow( display ), StructureNotifyMask | PropertyChangeMask ); } @@ -2530,6 +3001,7 @@ void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) destroy_whole_window( data, FALSE ); data->managed = FALSE; } + sync_vk_surface( hwnd, TRUE ); } else /* new top level window */ { @@ -2543,6 +3015,7 @@ void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) * that will need clipping support. */ sync_gl_drawable( parent, TRUE ); + sync_vk_surface( parent, TRUE ); fetch_icon_data( hwnd, 0, 0 ); } @@ -2561,6 +3034,90 @@ static inline BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rec return TRUE; } +static BOOL CALLBACK update_child_window_fshack( HWND hwnd, LPARAM lparam ); + +static void window_update_fshack( struct x11drv_win_data *data, const RECT *window_rect_virt, + const RECT *client_rect_virt, HMONITOR hmonitor, BOOL enable ) +{ + BOOL set_hints = window_rect_virt == NULL; /* don't change hints yet in X11DRV_WindowPosChanging */ + RECT window_rect_host, client_rect_host; + + if (wm_is_steamcompmgr( data->display )) return; + if (!!data->fs_hack == !!enable) return; + data->fs_hack = enable; + + if (!window_rect_virt) window_rect_virt = &data->window_rect; + if (!client_rect_virt) client_rect_virt = &data->client_rect; + + if (!enable) + { + window_rect_host = *window_rect_virt; + client_rect_host = data->client_rect; + OffsetRect( &client_rect_host, -data->whole_rect.left, -data->whole_rect.top ); + } + else + { + window_rect_host = fs_hack_real_mode( hmonitor ); + + if (data->whole_window) /* HACK: top-level window, pretend client rect covers it fully */ + client_rect_host = window_rect_host; + else + { + client_rect_host = *client_rect_virt; + NtUserClientToScreen( data->hwnd, (POINT *)&client_rect_host.left ); + NtUserClientToScreen( data->hwnd, (POINT *)&client_rect_host.right ); + fs_hack_rect_user_to_real( &client_rect_host ); + OffsetRect( &client_rect_host, -window_rect_host.left, -window_rect_host.top ); + } + } + + FIXME( "%sbling fshack for hwnd %p, mapping virt window %s, client %s to host window %s, client %s.\n", + enable ? "Ena" : "Disa", data->hwnd, wine_dbgstr_rect( window_rect_virt ), wine_dbgstr_rect( client_rect_virt ), + wine_dbgstr_rect( &window_rect_host ), wine_dbgstr_rect( &client_rect_host ) ); + + if (data->whole_window) + { + POINT top_left = *(POINT *)&window_rect_host; + RECT real_virtual; + + OffsetRect( &window_rect_host, -top_left.x, -top_left.y ); + real_virtual = fs_hack_get_real_virtual_screen(); + top_left.x -= real_virtual.left; + top_left.y -= real_virtual.top; + + if (set_hints) set_wm_hints( data ); + + window_rect_host.right = min( max( window_rect_host.right, 1 ), 65535 ); + window_rect_host.bottom = min( max( window_rect_host.bottom, 1 ), 65535 ); + XMoveResizeWindow( data->display, data->whole_window, top_left.x, top_left.y, window_rect_host.right, window_rect_host.bottom ); + + if (set_hints) update_net_wm_states( data ); + } + + if (data->client_window) + { + POINT top_left = *(POINT *)&client_rect_host; + OffsetRect( &client_rect_host, -top_left.x, -top_left.y ); + + client_rect_host.right = min( max( client_rect_host.right, 1 ), 65535 ); + client_rect_host.bottom = min( max( client_rect_host.bottom, 1 ), 65535 ); + XMoveResizeWindow( gdi_display, data->client_window, top_left.x, top_left.y, client_rect_host.right, client_rect_host.bottom ); + + sync_gl_drawable( data->hwnd, !data->whole_window ); + invalidate_vk_surfaces( data->hwnd ); + } + + NtUserEnumChildWindows( data->hwnd, update_child_window_fshack, MAKELONG(hmonitor, enable) ); +} + +static BOOL CALLBACK update_child_window_fshack( HWND hwnd, LPARAM lparam ) +{ + struct x11drv_win_data *data; + if (!(data = get_win_data( hwnd ))) return TRUE; + if (data->client_window) window_update_fshack( data, NULL, NULL, UlongToPtr(LOWORD(lparam)), HIWORD(lparam) ); + release_win_data( data ); + return TRUE; +} /*********************************************************************** * WindowPosChanging (X11DRV.@) @@ -2574,9 +3131,17 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, DWORD flags; COLORREF key; BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED; + HMONITOR monitor; if (!data && !(data = X11DRV_create_win_data( hwnd, window_rect, client_rect ))) return TRUE; + + monitor = fs_hack_monitor_from_rect( window_rect ); + if (fs_hack_enabled( monitor ) && fs_hack_is_window_rect_fullscreen( monitor, window_rect )) + window_update_fshack( data, window_rect, client_rect, monitor, TRUE ); + else + window_update_fshack( data, window_rect, client_rect, monitor, FALSE ); + /* check if we need to switch the window to managed */ if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, window_rect )) { @@ -2595,6 +3160,13 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, if (!data->whole_window && !data->embedded) goto done; if (swp_flags & SWP_HIDEWINDOW) goto done; if (data->use_alpha) goto done; + + if (wine_vk_direct_window_draw( hwnd )) + { + if (*surface) window_surface_release( *surface ); + *surface = NULL; + goto done; + } if (!get_surface_rect( visible_rect, &surface_rect )) goto done; if (*surface) window_surface_release( *surface ); @@ -2627,6 +3199,39 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, return TRUE; } +static BOOL option_increament_configure_serial(void) +{ + static int increment = -1; + if (increment == -1) + { + const char *e = getenv( "WINE_INCREMENT_CONFIGURE_SERIAL" ); + + if (e) + increment = atoi( e ); + else + increment = (e = getenv( "SteamGameId" )) && !strcmp( e, "1689910" ); + } + return increment; +} + +static void restack_windows( struct x11drv_win_data *data, HWND prev ) +{ + struct x11drv_win_data *prev_data; + + TRACE("data->hwnd %p, prev %p.\n", data->hwnd, prev); + + while (prev) + { + if (!(prev_data = get_win_data( prev ))) break; + + TRACE( "Raising window %p.\n", prev ); + + if (prev_data->whole_window && data->display == prev_data->display) + XRaiseWindow( prev_data->display, prev_data->whole_window ); + release_win_data( prev_data ); + prev = NtUserGetWindowRelative( prev, GW_HWNDPREV ); + } +} /*********************************************************************** * WindowPosChanged (X11DRV.@) @@ -2640,6 +3245,8 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, struct x11drv_win_data *data; UINT new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); RECT old_window_rect, old_whole_rect, old_client_rect; + HWND prev_window = NULL; + BOOL needs_resize; int event_type; if (!(data = get_win_data( hwnd ))) return; @@ -2700,18 +3307,22 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, sync_client_position( data, &old_client_rect, &old_whole_rect ); + needs_resize = !data->client_window && (data->client_rect.right - data->client_rect.left != + old_client_rect.right - old_client_rect.left || + data->client_rect.bottom - data->client_rect.top != + old_client_rect.bottom - old_client_rect.top); + if (!data->whole_window) { - BOOL needs_resize = (!data->client_window && - (data->client_rect.right - data->client_rect.left != - old_client_rect.right - old_client_rect.left || - data->client_rect.bottom - data->client_rect.top != - old_client_rect.bottom - old_client_rect.top)); release_win_data( data ); if (needs_resize) sync_gl_drawable( hwnd, FALSE ); return; } + set_hwnd_style_props( data->display, data->whole_window, data->hwnd ); + + if (data->fs_hack) needs_resize = TRUE; + /* check if we are currently processing an event relevant to this window */ event_type = 0; if (thread_data && @@ -2738,9 +3349,13 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, } /* don't change position if we are about to minimize or maximize a managed window */ - if (!event_type && - !(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) - sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); + if (!event_type || event_type == PropertyNotify) + { + if (!(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) + prev_window = sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); + else if (option_increament_configure_serial()) + data->configure_serial = NextRequest( data->display ); + } if ((new_style & WS_VISIBLE) && ((new_style & WS_MINIMIZE) || is_window_rect_mapped( rectWindow ))) @@ -2756,6 +3371,10 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, release_win_data( data ); if (needs_icon) fetch_icon_data( hwnd, 0, 0 ); if (needs_map) map_window( hwnd, new_style ); + + if (!(data = get_win_data( hwnd ))) return; + restack_windows( data, prev_window ); + release_win_data( data ); return; } else if ((swp_flags & SWP_STATECHANGED) && (!data->iconic != !(new_style & WS_MINIMIZE))) @@ -2764,23 +3383,64 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, data->iconic = (new_style & WS_MINIMIZE) != 0; TRACE( "changing win %p iconic state to %u\n", data->hwnd, data->iconic ); if (data->iconic) - XIconifyWindow( data->display, data->whole_window, data->vis.screen ); + { + if (!skip_iconify( data->display )) + { + /* XIconifyWindow is essentially a no-op on Gamescope but has a side effect. + * Gamescope handles wm state change to iconic and immediately changes it back to normal. + * Upon that change back we would receive WM_STATE change notification and kick the window + * out of minimized state even if the window is not focused by Gamescope (possibly breaking Win-side + * focus and leading to hangs). + * Depending on what the game is going, various things may happen if we avoid that: + * - Gamescope may change WM_STATE later when focusing our window and we will get the window out of minimized state correctly; + * - The game might have no other windows and it just decided to minimize itself + * (e. g., before opening Web browser), expecting the user to unminimize it manually which + * is not possible on Gamescope. Ideally we'd have a way to detect such a case and unminimize + * when needed, but without that just let Gamescope unminimize immediately avoiding that for + * selected game(s) only. */ + XIconifyWindow( data->display, data->whole_window, data->vis.screen ); + } + } else if (is_window_rect_mapped( rectWindow )) + { + /* whole_window could be both iconic and mapped. Since XMapWindow() doesn't do + * anything if the window is already mapped, we need to unmap it first */ + if (data->mapped) + { + if (wm_is_steamcompmgr( data->display )) + { + /* Gamescope will generate FocusOut event upon processing UnmapNotify. Ignore it. */ + data->fake_unmap_serial = NextRequest( data->display ); + } + XUnmapWindow( data->display, data->whole_window ); + } XMapWindow( data->display, data->whole_window ); + } update_net_wm_states( data ); } else { if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data ); - if (!event_type) update_net_wm_states( data ); + if (!event_type || event_type == PropertyNotify) + { + update_net_wm_states( data ); + if (!prev_window && insert_after && data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) + { + prev_window = NtUserGetWindowRelative( hwnd, GW_HWNDPREV ); + if (prev_window != insert_after) prev_window = NULL; + } + } } } + restack_windows( data, prev_window ); + XFlush( data->display ); /* make sure changes are done before we start painting again */ if (data->surface && data->vis.visualid != default_visual.visualid) data->surface->funcs->flush( data->surface ); release_win_data( data ); + if (needs_resize) sync_gl_drawable( hwnd, FALSE ); } /* check if the window icon should be hidden (i.e. moved off-screen) */ @@ -2807,6 +3467,7 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) DWORD style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data = get_win_data( hwnd ); + HMONITOR monitor; if (!data || !data->whole_window) goto done; if (style & WS_MINIMIZE) @@ -2836,7 +3497,21 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) &root, &x, &y, &width, &height, &border, &depth ); XTranslateCoordinates( thread_data->display, data->whole_window, root, 0, 0, &x, &y, &top ); pos = root_to_virtual_screen( x, y ); - X11DRV_X_to_window_rect( data, rect, pos.x, pos.y, width, height ); + monitor = fs_hack_monitor_from_rect( rect ); + if (data->fs_hack || + (fs_hack_enabled( monitor ) && + fs_hack_is_window_rect_fullscreen( monitor, rect ))) + { + MONITORINFO info = {.cbSize = sizeof(MONITORINFO)}; + NtUserGetMonitorInfo( monitor, &info ); + X11DRV_X_to_window_rect( data, rect, info.rcMonitor.left, info.rcMonitor.top, + info.rcMonitor.right - info.rcMonitor.left, + info.rcMonitor.bottom - info.rcMonitor.top ); + } + else + { + X11DRV_X_to_window_rect( data, rect, pos.x, pos.y, width, height ); + } swp &= ~(SWP_NOMOVE | SWP_NOCLIENTMOVE | SWP_NOSIZE | SWP_NOCLIENTSIZE); done: @@ -2899,6 +3574,7 @@ void X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) { struct x11drv_win_data *data = get_win_data( hwnd ); + BOOL need_sync_gl; if (data) { @@ -2909,7 +3585,9 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO if (data->surface) set_surface_color_key( data->surface, (flags & LWA_COLORKEY) ? key : CLR_INVALID ); + need_sync_gl = !data->layered || !data->layered_attributes; data->layered = TRUE; + data->layered_attributes = TRUE; if (!data->mapped) /* mapping is delayed until attributes are set */ { DWORD style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); @@ -2919,10 +3597,12 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO { release_win_data( data ); map_window( hwnd, style ); + if (need_sync_gl) sync_gl_drawable( hwnd, FALSE ); return; } } release_win_data( data ); + if (need_sync_gl) sync_gl_drawable( hwnd, FALSE ); } else { @@ -2951,12 +3631,14 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info, BITMAPINFO *bmi = (BITMAPINFO *)buffer; void *src_bits, *dst_bits; RECT rect, src_rect; + BOOL need_sync_gl; HDC hdc = 0; HBITMAP dib; BOOL mapped, ret = FALSE; if (!(data = get_win_data( hwnd ))) return FALSE; + need_sync_gl = !data->layered; data->layered = TRUE; if (!data->embedded && argb_visual.visualid) set_window_visual( data, &argb_visual, TRUE ); @@ -2986,6 +3668,8 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info, map_window( hwnd, style ); } + if (need_sync_gl) sync_gl_drawable( hwnd, FALSE ); + if (!surface) return FALSE; if (!info->hdcSrc) { @@ -3068,6 +3752,40 @@ static void taskbar_delete_tab( HWND hwnd ) release_win_data( data ); } +static void handle_window_desktop_resize( struct x11drv_win_data *data, UINT old_x, UINT old_y ) +{ + HMONITOR monitor = fs_hack_monitor_from_hwnd( data->hwnd ); + + if (fs_hack_mapping_required( monitor ) && + fs_hack_is_window_rect_fullscreen( monitor, &data->whole_rect )) + { + window_update_fshack( data, NULL, NULL, monitor, TRUE ); + return; + } + + /* update the full screen state */ + update_net_wm_states( data ); + + if (data->whole_window) + { + /* sync window position with the new virtual screen rect */ + POINT old_pos = {.x = data->whole_rect.left - old_x, .y = data->whole_rect.top - old_y}; + POINT pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + XWindowChanges changes = {.x = pos.x, .y = pos.y}; + UINT mask = 0; + + if (old_pos.x != pos.x) mask |= CWX; + if (old_pos.y != pos.y) mask |= CWY; + if (data->fs_hack) mask |= CWX | CWY; + + if (mask) XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); + } + + if (!fs_hack_mapping_required( monitor ) || + !fs_hack_is_window_rect_fullscreen( monitor, &data->whole_rect )) + window_update_fshack( data, NULL, NULL, monitor, FALSE ); +} + /********************************************************************** * X11DRV_WindowMessage (X11DRV.@) */ @@ -3089,23 +3807,7 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) case WM_X11DRV_DESKTOP_RESIZED: if ((data = get_win_data( hwnd ))) { - /* update the full screen state */ - update_net_wm_states( data ); - - if (data->whole_window) - { - /* sync window position with the new virtual screen rect */ - POINT old_pos = {.x = data->whole_rect.left - wp, .y = data->whole_rect.top - lp}; - POINT pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); - XWindowChanges changes = {.x = pos.x, .y = pos.y}; - UINT mask = 0; - - if (old_pos.x != pos.x) mask |= CWX; - if (old_pos.y != pos.y) mask |= CWY; - - if (mask) XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); - } - + handle_window_desktop_resize( data, wp, lp ); release_win_data( data ); } return 0; diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index 6f1437f14c6..7855175a29b 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -895,7 +895,7 @@ static BOOL motion_event( HWND hwnd, XEvent *event ) /* Set cursor to inverted if cursor is the eraser */ gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0); - gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(motion->time); + gMsgPacket.pkTime = x11drv_time_to_ticks(motion->time); gMsgPacket.pkSerialNumber = gSerial++; gMsgPacket.pkCursor = curnum; gMsgPacket.pkX = motion->axis_data[0]; @@ -928,7 +928,7 @@ static BOOL button_event( HWND hwnd, XEvent *event ) /* Set cursor to inverted if cursor is the eraser */ gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0); set_button_state(curnum, button->deviceid); - gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(button->time); + gMsgPacket.pkTime = x11drv_time_to_ticks(button->time); gMsgPacket.pkSerialNumber = gSerial++; gMsgPacket.pkCursor = curnum; if (button->axes_count > 0) { @@ -978,7 +978,7 @@ static BOOL proximity_event( HWND hwnd, XEvent *event ) /* Set cursor to inverted if cursor is the eraser */ gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0); gMsgPacket.pkStatus |= (event->type==proximity_out_type)?TPS_PROXIMITY:0; - gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(proximity->time); + gMsgPacket.pkTime = x11drv_time_to_ticks(proximity->time); gMsgPacket.pkSerialNumber = gSerial++; gMsgPacket.pkCursor = curnum; gMsgPacket.pkX = proximity->axis_data[0]; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c80e4b3d3c9..da610e060a6 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -68,6 +68,8 @@ typedef int Status; #include "wine/list.h" #include "wine/debug.h" +#include "mwm.h" + #define MAX_DASHLEN 16 #define WINE_XDND_VERSION 5 @@ -215,7 +217,6 @@ extern void X11DRV_NotifyIMEStatus( HWND hwnd, UINT status ); extern void X11DRV_DestroyCursorIcon( HCURSOR handle ); extern void X11DRV_SetCursor( HWND hwnd, HCURSOR handle ); extern BOOL X11DRV_SetCursorPos( INT x, INT y ); -extern BOOL X11DRV_GetCursorPos( LPPOINT pos ); extern BOOL X11DRV_ClipCursor( const RECT *clip, BOOL reset ); extern void X11DRV_SystrayDockInit( HWND systray ); extern BOOL X11DRV_SystrayDockInsert( HWND owner, UINT cx, UINT cy, void *icon ); @@ -265,7 +266,7 @@ extern void X11DRV_ThreadDetach(void); /* X11 driver internal functions */ extern void X11DRV_Xcursor_Init(void); -extern void X11DRV_XInput2_Init(void); +extern void X11DRV_XInput2_Enable( Display *display, Window window, long event_mask ); extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image, const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits, @@ -350,7 +351,7 @@ enum x11drv_escape_codes X11DRV_GET_DRAWABLE, /* get current drawable for a DC */ X11DRV_START_EXPOSURES, /* start graphics exposures */ X11DRV_END_EXPOSURES, /* end graphics exposures */ - X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */ + X11DRV_PRESENT_DRAWABLE, /* present the drawable on screen */ }; struct x11drv_escape_set_drawable @@ -369,10 +370,10 @@ struct x11drv_escape_get_drawable int pixel_format; /* internal GL pixel format */ }; -struct x11drv_escape_flush_gl_drawable +struct x11drv_escape_present_drawable { - enum x11drv_escape_codes code; /* escape code (X11DRV_FLUSH_GL_DRAWABLE) */ - Drawable gl_drawable; /* GL drawable */ + enum x11drv_escape_codes code; /* escape code (X11DRV_PRESENT_DRAWABLE) */ + Drawable drawable; /* GL / VK drawable */ BOOL flush; /* flush X11 before copying */ }; @@ -395,13 +396,12 @@ struct x11drv_thread_data Window clip_window; /* window used for cursor clipping */ BOOL clipping_cursor; /* whether thread is currently clipping the cursor */ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled } xi2_state; /* XInput2 state */ - void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */ - int xi2_device_count; XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; - int xi2_core_pointer; /* XInput2 core pointer id */ - int xi2_current_slave; /* Current slave driving the Core pointer */ + int xinput2_pointer; /* XInput2 core pointer id */ + int xi2_rawinput_only; + int xi2_active_touches; + int xi2_primary_touchid; #endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ }; @@ -448,6 +448,7 @@ extern BOOL use_primary_selection; extern BOOL use_system_cursors; extern BOOL grab_fullscreen; extern BOOL usexcomposite; +extern BOOL use_xfixes; extern BOOL managed_mode; extern BOOL decorated_mode; extern BOOL private_color_map; @@ -455,9 +456,14 @@ extern int primary_monitor; extern int copy_default_colors; extern int alloc_system_colors; extern int xrender_error_base; +extern int xfixes_event_base; extern char *process_name; extern Display *clipboard_display; extern WNDPROC client_foreign_window_proc; +extern HANDLE steam_overlay_event; +extern HANDLE steam_keyboard_event; + +extern int limit_number_of_resolutions; /* atoms */ @@ -475,6 +481,7 @@ enum x11drv_atoms XATOM_TEXT, XATOM_TIMESTAMP, XATOM_UTF8_STRING, + XATOM_STRING, XATOM_RAW_ASCENT, XATOM_RAW_DESCENT, XATOM_RAW_CAP_HEIGHT, @@ -482,6 +489,7 @@ enum x11drv_atoms XATOM_Rel_Y, XATOM_WM_PROTOCOLS, XATOM_WM_DELETE_WINDOW, + XATOM_WM_NAME, XATOM_WM_STATE, XATOM_WM_TAKE_FOCUS, XATOM_DndProtocol, @@ -492,9 +500,11 @@ enum x11drv_atoms XATOM__NET_STARTUP_INFO_BEGIN, XATOM__NET_STARTUP_INFO, XATOM__NET_SUPPORTED, + XATOM__NET_SUPPORTING_WM_CHECK, XATOM__NET_SYSTEM_TRAY_OPCODE, XATOM__NET_SYSTEM_TRAY_S0, XATOM__NET_SYSTEM_TRAY_VISUAL, + XATOM__NET_WM_BYPASS_COMPOSITOR, XATOM__NET_WM_FULLSCREEN_MONITORS, XATOM__NET_WM_ICON, XATOM__NET_WM_MOVERESIZE, @@ -520,6 +530,8 @@ enum x11drv_atoms XATOM__GTK_WORKAREAS_D0, XATOM__XEMBED, XATOM__XEMBED_INFO, + XATOM__WINE_HWND_STYLE, + XATOM__WINE_HWND_EXSTYLE, XATOM_XdndAware, XATOM_XdndEnter, XATOM_XdndPosition, @@ -543,6 +555,7 @@ enum x11drv_atoms XATOM_WCF_SYLK, XATOM_WCF_TIFF, XATOM_WCF_WAVE, + XATOM_WINDOW, XATOM_image_bmp, XATOM_image_gif, XATOM_image_jpeg, @@ -552,6 +565,9 @@ enum x11drv_atoms XATOM_text_rtf, XATOM_text_richtext, XATOM_text_uri_list, + XATOM_GAMESCOPE_FOCUSED_APP, + XATOM_GAMESCOPE_DISPLAY_EDID_PATH, + XATOM_GAMESCOPE_XALIA_OVERLAY, NB_XATOMS }; @@ -580,10 +596,13 @@ extern BOOL X11DRV_MappingNotify( HWND hWnd, XEvent *event ); extern BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *event ); extern int xinput2_opcode; +extern void x11drv_xinput2_load(void); +extern void x11drv_xinput2_init( struct x11drv_thread_data *data ); + extern Bool (*pXGetEventData)( Display *display, XEvent /*XGenericEventCookie*/ *event ); extern void (*pXFreeEventData)( Display *display, XEvent /*XGenericEventCookie*/ *event ); -extern DWORD EVENT_x11_time_to_win32_time(Time time); +extern DWORD x11drv_time_to_ticks( Time time ); /* X11 driver private messages */ enum x11drv_window_messages @@ -613,7 +632,6 @@ struct x11drv_win_data Display *display; /* display connection for the thread owning the window */ XVisualInfo vis; /* X visual used by this window */ Colormap whole_colormap; /* colormap if non-default visual */ - Colormap client_colormap; /* colormap for the client window */ HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ Window client_window; /* X window for the client area */ @@ -621,27 +639,38 @@ struct x11drv_win_data RECT whole_rect; /* X window rectangle for the whole window relative to win32 parent window client area */ RECT client_rect; /* client area relative to win32 parent window client area */ XIC xic; /* X input context */ + UINT pending_fullscreen : 1; /* HACK: pending change to fullscreen state */ UINT managed : 1; /* is window managed? */ UINT mapped : 1; /* is window mapped? (in either normal or iconic state) */ + UINT fs_hack : 1; /* is window forced / faking fullscreen? */ UINT iconic : 1; /* is window in iconic state? */ UINT embedded : 1; /* is window an XEMBED client? */ UINT shaped : 1; /* is window using a custom region shape? */ UINT layered : 1; /* is window layered and with valid attributes? */ + UINT layered_attributes : 1; + /* is layered window has leyered attributes set (or otherwise managed with UpdateLayeredWindow()? */ UINT use_alpha : 1; /* does window use an alpha channel? */ UINT skip_taskbar : 1; /* does window should be deleted from taskbar */ UINT add_taskbar : 1; /* does window should be added to taskbar regardless of style */ UINT net_wm_fullscreen_monitors_set : 1; /* is _NET_WM_FULLSCREEN_MONITORS set */ + ULONGLONG take_focus_back; int wm_state; /* current value of the WM_STATE property */ DWORD net_wm_state; /* bit mask of active x11drv_net_wm_state values */ Window embedder; /* window id of embedder */ + unsigned long unmapnotify_serial; /* serial number of last UnmapNotify event */ + unsigned long fake_unmap_serial; /* serial number of unmap before map for restoring window from minimized state in X11DRV_WindowPosChanged() */ unsigned long configure_serial; /* serial number of last configure request */ struct window_surface *surface; Pixmap icon_pixmap; Pixmap icon_mask; unsigned long *icon_bits; unsigned int icon_size; + MwmHints prev_hints; }; +extern BOOL wm_is_mutter(Display *); +extern BOOL wm_is_steamcompmgr(Display *); + extern struct x11drv_win_data *get_win_data( HWND hwnd ); extern void release_win_data( struct x11drv_win_data *data ); extern Window X11DRV_get_whole_window( HWND hwnd ); @@ -650,8 +679,12 @@ extern Window get_dummy_parent(void); extern void sync_gl_drawable( HWND hwnd, BOOL known_child ); extern void set_gl_drawable_parent( HWND hwnd, HWND parent ); extern void destroy_gl_drawable( HWND hwnd ); -extern void wine_vk_surface_destroy( HWND hwnd ); +extern void destroy_vk_surface( HWND hwnd ); +extern void sync_vk_surface( HWND hwnd, BOOL known_child ); +extern void resize_vk_surfaces( HWND hwnd, Window active, int mask, XWindowChanges *changes ); +extern void invalidate_vk_surfaces( HWND hwnd ); extern void vulkan_thread_detach(void); +extern BOOL wine_vk_direct_window_draw( HWND hwnd ); extern void wait_for_withdrawn_state( HWND hwnd, BOOL set ); extern Window init_clip_window(void); @@ -660,7 +693,10 @@ extern void read_net_wm_states( Display *display, struct x11drv_win_data *data ) extern void update_net_wm_states( struct x11drv_win_data *data ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_dummy_client_window(void); -extern Window create_client_window( HWND hwnd, const XVisualInfo *visual ); +extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); +extern void destroy_client_window( HWND hwnd, Window client_window ); +extern void detach_client_window( struct x11drv_win_data *data, Window client_window, BOOL reparent ); +extern void attach_client_window( struct x11drv_win_data *data, Window client_window ); extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ); extern void change_systray_owner( Display *display, Window systray_window ); extern HWND create_foreign_window( Display *display, Window window ); @@ -669,6 +705,25 @@ extern void init_win_context(void); extern void *file_list_to_drop_files( const void *data, size_t size, size_t *ret_size ); extern void *uri_list_to_drop_files( const void *data, size_t size, size_t *ret_size ); +extern BOOL fs_hack_enabled( HMONITOR monitor ); +extern BOOL fs_hack_mapping_required( HMONITOR monitor ); +extern BOOL fs_hack_is_integer(void); +extern HMONITOR fs_hack_monitor_from_hwnd( HWND hwnd ); +extern HMONITOR fs_hack_monitor_from_rect( const RECT *rect ); +extern BOOL fs_hack_is_window_rect_fullscreen( HMONITOR monitor, const RECT *rect ); +extern RECT fs_hack_current_mode( HMONITOR monitor ); +extern RECT fs_hack_real_mode( HMONITOR monitor ); +extern void fs_hack_point_user_to_real( POINT *pos ); +extern void fs_hack_point_real_to_user( POINT *pos ); +extern void fs_hack_rect_user_to_real( RECT *rect ); +extern void fs_hack_rgndata_user_to_real( RGNDATA *data ); +extern double fs_hack_get_user_to_real_scale( HMONITOR ); +extern SIZE fs_hack_get_scaled_screen_size( HMONITOR monitor ); +extern RECT fs_hack_get_real_virtual_screen(void); +extern void fs_hack_init(void); +extern const float *fs_hack_get_gamma_ramp( LONG *serial ); +extern void fs_hack_set_gamma_ramp( const WORD *ramp ); + static inline void mirror_rect( const RECT *window_rect, RECT *rect ) { int width = window_rect->right - window_rect->left; @@ -689,6 +744,7 @@ extern void retry_grab_clipping_window(void); extern void ungrab_clipping_window(void); extern void move_resize_window( HWND hwnd, int dir ); extern void X11DRV_InitKeyboard( Display *display ); +extern void X11DRV_InitMouse( Display *display ); extern BOOL X11DRV_ProcessEvents( DWORD mask ); extern HWND *build_hwnd_list(void); @@ -705,8 +761,11 @@ extern BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ); extern void xinerama_init( unsigned int width, unsigned int height ); extern void init_recursive_mutex( pthread_mutex_t *mutex ); +extern BOOL is_window_rect_full_virtual_screen( const RECT *rect ); + #define DEPTH_COUNT 3 extern const unsigned int *depths; +extern RECT native_screen_rect; /* Use a distinct type for the settings id, to avoid mixups other types of ids */ typedef struct { ULONG_PTR id; } x11drv_settings_id; @@ -756,6 +815,7 @@ struct x11drv_settings_handler LONG (*set_current_mode)(x11drv_settings_id id, const DEVMODEW *mode); }; +extern struct x11drv_settings_handler X11DRV_Settings_GetHandler(void); extern void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *handler); extern void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ); @@ -811,6 +871,7 @@ struct x11drv_display_device_handler void (*register_event_handlers)(void); }; +extern struct x11drv_display_device_handler X11DRV_DisplayDevices_GetHandler(void); extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler); extern void X11DRV_DisplayDevices_Init(BOOL force); extern void X11DRV_DisplayDevices_RegisterEventHandlers(void); @@ -905,6 +966,30 @@ static inline BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2 return !IsRectEmpty( dst ); } +static inline void union_rect( RECT *dest, const RECT *src1, const RECT *src2 ) +{ + if (IsRectEmpty( src1 )) + { + if (IsRectEmpty( src2 )) + { + reset_bounds( dest ); + return; + } + else *dest = *src2; + } + else + { + if (IsRectEmpty( src2 )) *dest = *src1; + else + { + dest->left = min( src1->left, src2->left ); + dest->right = max( src1->right, src2->right ); + dest->top = min( src1->top, src2->top ); + dest->bottom = max( src1->bottom, src2->bottom ); + } + } +} + /* registry helpers */ extern HKEY open_hkcu_key( const char *name ); @@ -926,4 +1011,9 @@ static inline UINT asciiz_to_unicode( WCHAR *dst, const char *src ) return (p - dst) * sizeof(WCHAR); } +extern BOOL vulkan_disable_child_window_rendering_hack; +extern BOOL vulkan_gdi_blit_source_hack; + +extern BOOL layered_window_client_hack; + #endif /* __WINE_X11DRV_H */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index d1f31081b09..b286e6cfde8 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -50,6 +50,7 @@ #include "x11drv.h" #include "winreg.h" #include "xcomposite.h" +#include "xfixes.h" #include "wine/server.h" #include "wine/debug.h" #include "wine/list.h" @@ -68,10 +69,11 @@ Atom systray_atom = 0; HWND systray_hwnd = 0; unsigned int screen_bpp; Window root_window; -BOOL usexvidmode = TRUE; +BOOL usexvidmode = FALSE; BOOL usexrandr = TRUE; BOOL usexcomposite = TRUE; -BOOL use_take_focus = TRUE; +BOOL use_xfixes = FALSE; +BOOL use_take_focus = FALSE; BOOL use_primary_selection = FALSE; BOOL use_system_cursors = TRUE; BOOL grab_fullscreen = FALSE; @@ -84,9 +86,16 @@ BOOL client_side_with_render = TRUE; BOOL shape_layered_windows = TRUE; int copy_default_colors = 128; int alloc_system_colors = 256; +int limit_number_of_resolutions = 0; int xrender_error_base = 0; +int xfixes_event_base = 0; char *process_name = NULL; WNDPROC client_foreign_window_proc = NULL; +BOOL vulkan_disable_child_window_rendering_hack = FALSE; +BOOL vulkan_gdi_blit_source_hack = FALSE; +HANDLE steam_overlay_event; +HANDLE steam_keyboard_event; +BOOL layered_window_client_hack = FALSE; static x11drv_error_callback err_callback; /* current callback for error */ static Display *err_callback_display; /* display callback is set for */ @@ -139,6 +148,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "TEXT", "TIMESTAMP", "UTF8_STRING", + "STRING", "RAW_ASCENT", "RAW_DESCENT", "RAW_CAP_HEIGHT", @@ -146,6 +156,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "Rel Y", "WM_PROTOCOLS", "WM_DELETE_WINDOW", + "WM_NAME", "WM_STATE", "WM_TAKE_FOCUS", "DndProtocol", @@ -156,9 +167,11 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_NET_STARTUP_INFO_BEGIN", "_NET_STARTUP_INFO", "_NET_SUPPORTED", + "_NET_SUPPORTING_WM_CHECK", "_NET_SYSTEM_TRAY_OPCODE", "_NET_SYSTEM_TRAY_S0", "_NET_SYSTEM_TRAY_VISUAL", + "_NET_WM_BYPASS_COMPOSITOR", "_NET_WM_FULLSCREEN_MONITORS", "_NET_WM_ICON", "_NET_WM_MOVERESIZE", @@ -184,6 +197,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_GTK_WORKAREAS_D0", "_XEMBED", "_XEMBED_INFO", + "_WINE_HWND_STYLE", + "_WINE_HWND_EXSTYLE", "XdndAware", "XdndEnter", "XdndPosition", @@ -207,6 +222,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "WCF_SYLK", "WCF_TIFF", "WCF_WAVE", + "WINDOW", "image/bmp", "image/gif", "image/jpeg", @@ -215,7 +231,10 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/plain", "text/rtf", "text/richtext", - "text/uri-list" + "text/uri-list", + "GAMESCOPE_FOCUSED_APP", + "GAMESCOPE_DISPLAY_EDID_PATH", + "GAMESCOPE_XALIA_OVERLAY", }; /*********************************************************************** @@ -314,6 +333,9 @@ static int error_handler( Display *display, XErrorEvent *error_evt ) error_evt->serial, error_evt->request_code ); assert( 0 ); } + TRACE("passing on error %d req %d:%d res 0x%lx\n", + error_evt->error_code, error_evt->request_code, + error_evt->minor_code, error_evt->resourceid); old_error_handler( display, error_evt ); return 0; } @@ -524,6 +546,9 @@ static void setup_options(void) if (!get_config_key( hkey, appkey, "AllocSystemColors", buffer, sizeof(buffer) )) alloc_system_colors = wcstol( buffer, NULL, 0 ); + if (!get_config_key( hkey, appkey, "LimitNumberOfResolutions", buffer, sizeof(buffer) )) + limit_number_of_resolutions = wcstol( buffer, NULL, 0 ); + get_config_key( hkey, appkey, "InputStyle", input_style, sizeof(input_style) ); NtClose( appkey ); @@ -589,6 +614,67 @@ static void X11DRV_XComposite_Init(void) } #endif /* defined(SONAME_LIBXCOMPOSITE) */ +#ifdef SONAME_LIBXFIXES + +#define MAKE_FUNCPTR(f) typeof(f) * p##f; +MAKE_FUNCPTR(XFixesHideCursor) +MAKE_FUNCPTR(XFixesQueryExtension) +MAKE_FUNCPTR(XFixesQueryVersion) +MAKE_FUNCPTR(XFixesCreateRegion) +MAKE_FUNCPTR(XFixesCreateRegionFromGC) +MAKE_FUNCPTR(XFixesSelectSelectionInput) +MAKE_FUNCPTR(XFixesShowCursor) +#undef MAKE_FUNCPTR + +static void x11drv_load_xfixes(void) +{ + int event, error, major = 3, minor = 0; + void *xfixes; + + if (!(xfixes = dlopen(SONAME_LIBXFIXES, RTLD_NOW))) + { + WARN("Xfixes library %s not found, disabled.\n", SONAME_LIBXFIXES); + return; + } + +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym(xfixes, #f))) \ + { \ + WARN("Xfixes function %s not found, disabled\n", #f); \ + dlclose(xfixes); \ + return; \ + } + LOAD_FUNCPTR(XFixesHideCursor) + LOAD_FUNCPTR(XFixesQueryExtension) + LOAD_FUNCPTR(XFixesQueryVersion) + LOAD_FUNCPTR(XFixesCreateRegion) + LOAD_FUNCPTR(XFixesCreateRegionFromGC) + LOAD_FUNCPTR(XFixesSelectSelectionInput) + LOAD_FUNCPTR(XFixesShowCursor) +#undef LOAD_FUNCPTR + + if (!pXFixesQueryExtension(gdi_display, &event, &error)) + { + WARN("Xfixes extension not found, disabled.\n"); + dlclose(xfixes); + return; + } + + if (!pXFixesQueryVersion(gdi_display, &major, &minor) || + major < 2) + { + WARN("Xfixes version 2.0 not found, disabled.\n"); + dlclose(xfixes); + return; + } + + TRACE("Xfixes, error %d, event %d, version %d.%d found\n", + error, event, major, minor); + use_xfixes = TRUE; + xfixes_event_base = event; +} +#endif /* SONAME_LIBXFIXES */ + static void init_visuals( Display *display, int screen ) { int count; @@ -650,6 +736,25 @@ static NTSTATUS x11drv_init( void *arg ) struct init_params *params = arg; Display *display; void *libx11 = dlopen( SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL ); + OBJECT_ATTRIBUTES attr; + WCHAR buffer[MAX_PATH]; + char path[MAX_PATH]; + UNICODE_STRING str; + + RtlInitUnicodeString( &str, buffer ); + InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, 0, NULL ); + + str.Length = sprintf( path, "\\Sessions\\%u\\BaseNamedObjects\\__wine_steamclient_GameOverlayActivated", + (int)NtCurrentTeb()->Peb->SessionId ); + ascii_to_unicode( buffer, path, str.Length + 1 ); + str.Length *= sizeof(WCHAR); + NtCreateEvent( &steam_overlay_event, EVENT_ALL_ACCESS, &attr, NotificationEvent, FALSE ); + + str.Length = sprintf( path, "\\Sessions\\%u\\BaseNamedObjects\\__wine_steamclient_KeyboardActivated", + (int)NtCurrentTeb()->Peb->SessionId ); + ascii_to_unicode( buffer, path, str.Length + 1 ); + str.Length *= sizeof(WCHAR); + NtCreateEvent( &steam_keyboard_event, EVENT_ALL_ACCESS, &attr, NotificationEvent, FALSE ); if (!libx11) { @@ -694,15 +799,55 @@ static NTSTATUS x11drv_init( void *arg ) X11DRV_XF86VM_Init(); /* initialize XRandR */ X11DRV_XRandR_Init(); +#ifdef SONAME_LIBXFIXES + x11drv_load_xfixes(); +#endif #ifdef SONAME_LIBXCOMPOSITE X11DRV_XComposite_Init(); #endif - X11DRV_XInput2_Init(); + x11drv_xinput2_load(); XkbUseExtension( gdi_display, NULL, NULL ); X11DRV_InitKeyboard( gdi_display ); + X11DRV_InitMouse( gdi_display ); if (use_xim) use_xim = xim_init( input_style ); + { + const char *e = getenv("WINE_DISABLE_FULLSCREEN_HACK"); + if (!e || *e == '\0' || *e == '0') fs_hack_init(); + } + + { + const char *sgi = getenv("SteamGameId"); + const char *e = getenv("WINE_LAYERED_WINDOW_CLIENT_HACK"); + + e = getenv("WINE_VK_GDI_BLIT_SOURCE_HACK"); + vulkan_gdi_blit_source_hack = + (sgi && ( + !strcmp(sgi, "803600") /* Disgaea 5 Complete */ + )) || + (e && *e != '\0' && *e != '0'); + + e = getenv("WINE_DISABLE_VK_CHILD_WINDOW_RENDERING_HACK"); + vulkan_disable_child_window_rendering_hack = + (sgi && ( + !strcmp(sgi, "429660") || /* Bug 21949 : Tales of Berseria video tearing */ + !strcmp(sgi, "1009290") /* Bug 21949 : SWORD ART ONLINE Alicization Lycoris video tearing */ + )) || + (e && *e != '\0' && *e != '0'); + } + + { + const char *sgi = getenv("SteamGameId"); + const char *e = getenv("WINE_LAYERED_WINDOW_CLIENT_HACK"); + layered_window_client_hack = + (sgi && ( + strcmp(sgi, "435150") == 0 || /* Divinity: Original Sin 2 launcher */ + strcmp(sgi, "227020") == 0 /* Rise of Venice launcher */ + )) || + (e && *e != '\0' && *e != '0'); + } + init_user_driver(); X11DRV_DisplayDevices_Init(FALSE); return STATUS_SUCCESS; @@ -721,6 +866,7 @@ void X11DRV_ThreadDetach(void) vulkan_thread_detach(); if (data->xim) XCloseIM( data->xim ); if (data->font_set) XFreeFontSet( data->display, data->font_set ); + XSync( gdi_display, False ); /* make sure XReparentWindow requests have completed before closing the thread display */ XCloseDisplay( data->display ); free( data ); /* clear data in case we get re-entered from user32 before the thread is truly dead */ @@ -785,6 +931,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) NtUserGetThreadInfo()->driver_data = (UINT_PTR)data; if (use_xim) xim_thread_attach( data ); + x11drv_xinput2_init( data ); return data; } diff --git a/dlls/winex11.drv/xfixes.h b/dlls/winex11.drv/xfixes.h new file mode 100644 index 00000000000..6cd4e48425b --- /dev/null +++ b/dlls/winex11.drv/xfixes.h @@ -0,0 +1,38 @@ +/* + * Wine X11DRV Xfixes interface + * + * Copyright 2021 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_XFIXES_H +#define __WINE_XFIXES_H + +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + +#ifdef SONAME_LIBXFIXES +#include +#define MAKE_FUNCPTR(f) extern typeof(f) * p##f; +MAKE_FUNCPTR(XFixesHideCursor) +MAKE_FUNCPTR(XFixesQueryExtension) +MAKE_FUNCPTR(XFixesQueryVersion) +MAKE_FUNCPTR(XFixesSelectSelectionInput) +MAKE_FUNCPTR(XFixesShowCursor) +#undef MAKE_FUNCPTR +#endif /* defined(SONAME_LIBXFIXES) */ + +#endif /* __WINE_XFIXES_H */ diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 209d63f0402..b4d675dc446 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -501,7 +501,7 @@ XIC X11DRV_get_ic( HWND hwnd ) XIC ret; if (!(data = get_win_data( hwnd ))) return 0; - x11drv_thread_data()->last_xic_hwnd = hwnd; + x11drv_init_thread_data()->last_xic_hwnd = hwnd; if (!(ret = data->xic) && (xim = x11drv_thread_data()->xim)) ret = data->xic = xic_create( xim, hwnd, data->whole_window ); release_win_data( data ); diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index f0f831cbc1d..456b4c23af8 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -126,7 +126,7 @@ static inline int query_screens(void) /* Get xinerama monitor indices required for _NET_WM_FULLSCREEN_MONITORS */ BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ) { - RECT window_rect, intersected_rect, monitor_rect; + RECT window_rect, intersected_rect, monitor_rect, virtual; BOOL ret = FALSE; POINT offset; INT i; @@ -140,11 +140,9 @@ BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ) } /* Convert window rectangle to root coordinates */ - offset = virtual_screen_to_root( rect->left, rect->top ); - window_rect.left = offset.x; - window_rect.top = offset.y; - window_rect.right = window_rect.left + rect->right - rect->left; - window_rect.bottom = window_rect.top + rect->bottom - rect->top; + window_rect = *rect; + virtual = fs_hack_get_real_virtual_screen(); + OffsetRect( &window_rect, -virtual.left, -virtual.top ); /* Compare to xinerama monitor rectangles in root coordinates */ offset.x = INT_MAX; diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index c5e47cb355c..47accf1de6d 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -32,13 +32,11 @@ #include #endif #include +#include #include "x11drv.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(xrandr); -#ifdef HAVE_XRRGETPROVIDERRESOURCES -WINE_DECLARE_DEBUG_CHANNEL(winediag); -#endif #ifdef SONAME_LIBXRANDR @@ -367,7 +365,6 @@ static BOOL is_broken_driver(void) XRRScreenResources *screen_resources; XRROutputInfo *output_info; XRRModeInfo *first_mode; - INT major, event, error; INT output_idx, i, j; BOOL only_one_mode; @@ -418,15 +415,6 @@ static BOOL is_broken_driver(void) if (!only_one_mode) continue; - - /* Check if it is NVIDIA proprietary driver */ - if (XQueryExtension( gdi_display, "NV-CONTROL", &major, &event, &error )) - { - ERR_(winediag)("Broken NVIDIA RandR detected, falling back to RandR 1.0. " - "Please consider using the Nouveau driver instead.\n"); - pXRRFreeScreenResources( screen_resources ); - return TRUE; - } } pXRRFreeScreenResources( screen_resources ); return FALSE; @@ -457,23 +445,134 @@ static void get_screen_size( XRRScreenResources *resources, unsigned int *width, } } -static unsigned int get_edid( RROutput output, unsigned char **prop ) +static unsigned int get_edid( RROutput output, unsigned char **prop, + XRROutputInfo *output_info, XRRScreenResources *screen_resources ) { - int result, actual_format; + unsigned int mwidth, mheight, i; unsigned long bytes_after, len; + unsigned char *edid, *p, c; + int result, actual_format; + XRRModeInfo *mode; Atom actual_type; + char *edid_path; + *prop = NULL; result = pXRRGetOutputProperty( gdi_display, output, x11drv_atom(EDID), 0, 128, FALSE, FALSE, AnyPropertyType, &actual_type, &actual_format, &len, - &bytes_after, prop ); + &bytes_after, &edid ); + if (result == Success && len) + { + if (!(*prop = malloc( len ))) + { + XFree( edid ); + return 0; + } + memcpy( *prop, edid, len ); + return len; + } + + edid_path = NULL; + if ((result = XGetWindowProperty( gdi_display, DefaultRootWindow(gdi_display), x11drv_atom(GAMESCOPE_DISPLAY_EDID_PATH), 0, + PATH_MAX, False, x11drv_atom(UTF8_STRING), &actual_type, &actual_format, + &len, &bytes_after, (unsigned char **)&edid_path )) == Success + && actual_type == x11drv_atom(UTF8_STRING)) + { + char buffer[4096]; + FILE *f; + + f = fopen( edid_path, "rb" ); + if (f) + { + len = fread( buffer, 1, sizeof(buffer), f ); + fclose( f ); + if (len) + { + XFree( edid_path ); + if (!(*prop = malloc( len ))) return 0; + memcpy( *prop, buffer, len ); + return len; + } + } + } + if (edid_path) XFree( edid_path ); + + WARN( "Could not retrieve EDID property for output %#lx.\n", output ); + if (!output_info->npreferred) + { + WARN( "No preferred modes for output %#lx.\n", output ); + return 0; + } + if (output_info->npreferred > 1) + WARN( "%u preferred modes for output %#lx, using first one.\n", output_info->npreferred, output ); + + for (i = 0; i < screen_resources->nmode; ++i) + if (screen_resources->modes[i].id == output_info->modes[0]) break; - if (result != Success) + if (i == screen_resources->nmode) { - WARN("Could not retrieve EDID property for output %#lx.\n", output); - *prop = NULL; + ERR("Preferred mode not found for output %#lx.\n", output); return 0; } - return len; + + mode = &screen_resources->modes[i]; + + mwidth = mode->width / 60; /* Fake ~150dpi. */ + mheight = mode->height / 60; + + edid = calloc( 1, 128 ); + *prop = edid; + *(uint64_t *)edid = 0x00ffffffffffff00; + edid[18] = 1; + edid[19] = 4; + edid[20] = 0xa0; /* Digital input, 8 bit depth. */ + edid[21] = mwidth; + edid[22] = mheight; + edid[24] = 0x6; + for (i = 0; i < 16; ++i) edid[38 + i] = 1; + + p = edid + 54; + *(uint16_t *)&p[0] = mode->dotClock / 10000; + p[2] = mode->width; + p[3] = mode->hTotal - mode->width; + p[4] = (((mode->hTotal - mode->width) >> 8) & 0xf) | (((mode->width >> 8) & 0xf) << 4); + p[5] = mode->height; + p[6] = mode->vTotal - mode->height; + p[7] = (((mode->vTotal - mode->height) >> 8) & 0xf) | (((mode->height >> 8) & 0xf) << 4); + p[8] = mode->hSyncStart - mode->width; + p[9] = mode->hSyncEnd - mode->hSyncStart; + p[10] = (((mode->vSyncStart - mode->height) & 0xf) << 4) | ((mode->vSyncEnd - mode->vSyncStart) & 0xf); + p[11] = ((((mode->hSyncStart - mode->width) >> 8) & 3) << 6) + | ((((mode->hSyncEnd - mode->hSyncStart) >> 8) & 3) << 4) + | ((((mode->vSyncStart - mode->height) >> 4) & 3) << 2) + | (((mode->vSyncEnd - mode->vSyncStart) >> 4) & 3); + p[12] = mwidth; + p[13] = mheight; + p[14] = (((mwidth >> 8) & 0xf) << 4) | ((mheight >> 8) & 0xf); + if (mode->modeFlags & RR_Interlace) + p[17] |= 0x80; + p[17] |= 3 << 3; + if (mode->modeFlags & RR_HSyncPositive) + p[17] |= 2; + if (mode->modeFlags & RR_VSyncPositive) + p[17] |= 4; + + if (mode->modeFlags & (RR_DoubleScan | RR_PixelMultiplex | RR_DoubleClock | RR_ClockDivideBy2)) + FIXME( "Unsupported flags %#lx.\n", mode->modeFlags ); + + p += 18; + p[3] = 0xfc; + strcpy( (char *)p + 5, "Default" ); + + p += 18; + p[3] = 0x10; + p += 18; + p[3] = 0x10; + + c = 0; + for (i = 0; i < 127; ++i) + c += edid[i]; + edid[127] = 256 - c; + return 128; } static void set_screen_size( int width, int height ) @@ -625,6 +724,113 @@ static BOOL is_crtc_primary( RECT primary, const XRRCrtcInfo *crtc ) crtc->y + crtc->height == primary.bottom; } +static void add_remaining_gpus_via_vulkan( struct gdi_gpu **gpus, int *count ) +{ + static const char *extensions[] = + { + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, + }; + const struct vulkan_funcs *vulkan_funcs = get_vulkan_driver( WINE_VULKAN_DRIVER_VERSION ); + PFN_vkGetPhysicalDeviceProperties2KHR pvkGetPhysicalDeviceProperties2KHR; + PFN_vkEnumeratePhysicalDevices pvkEnumeratePhysicalDevices; + uint32_t device_count; + VkPhysicalDevice *vk_physical_devices = NULL; + VkPhysicalDeviceProperties2 properties2; + VkInstanceCreateInfo create_info; + VkPhysicalDeviceIDProperties id; + VkInstance vk_instance = NULL; + INT gpu_idx, device_idx; + INT original_gpu_count = *count; + struct gdi_gpu *new_gpu; + BOOL new; + VkResult vr; + + memset( &create_info, 0, sizeof(create_info) ); + create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + create_info.enabledExtensionCount = ARRAY_SIZE(extensions); + create_info.ppEnabledExtensionNames = extensions; + vr = vulkan_funcs->p_vkCreateInstance( &create_info, NULL, &vk_instance ); + + if (vr != VK_SUCCESS) + { + WARN("Failed to create a Vulkan instance, vr %d.\n", vr); + goto done; + } + +#define LOAD_VK_FUNC(f) \ + if (!(p##f = (void *)vulkan_funcs->p_vkGetInstanceProcAddr( vk_instance, #f ))) \ + { \ + WARN("Failed to load " #f ".\n"); \ + goto done; \ + } + + LOAD_VK_FUNC(vkEnumeratePhysicalDevices) + LOAD_VK_FUNC(vkGetPhysicalDeviceProperties2KHR) +#undef LOAD_VK_FUNC + + vr = pvkEnumeratePhysicalDevices( vk_instance, &device_count, NULL ); + if (vr != VK_SUCCESS || !device_count) + { + WARN("No Vulkan device found, vr %d, device_count %d.\n", vr, device_count); + goto done; + } + + if (!(vk_physical_devices = calloc( device_count, sizeof(*vk_physical_devices) ))) + goto done; + + vr = pvkEnumeratePhysicalDevices( vk_instance, &device_count, vk_physical_devices ); + if (vr != VK_SUCCESS) + { + WARN("vkEnumeratePhysicalDevices failed, vr %d.\n", vr); + goto done; + } + + for (device_idx = 0; device_idx < device_count; ++device_idx) + { + memset( &id, 0, sizeof(id) ); + id.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; + properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; + properties2.pNext = &id; + + pvkGetPhysicalDeviceProperties2KHR( vk_physical_devices[device_idx], &properties2 ); + + /* Ignore Khronos vendor IDs */ + if (properties2.properties.vendorID >= 0x10000) + continue; + + new = TRUE; + for (gpu_idx = 0; gpu_idx < original_gpu_count; ++gpu_idx) + { + if (!memcmp( &(*gpus)[gpu_idx].vulkan_uuid, id.deviceUUID, sizeof(id.deviceUUID) )) + { + new = FALSE; + break; + } + } + + if (!new) + continue; + + *gpus = realloc( *gpus, (*count + 1) * sizeof(**gpus) ); + if (!gpus) goto done; + new_gpu = &(*gpus)[(*count)++]; + memset( new_gpu, 0, sizeof(*new_gpu) ); + new_gpu->id = -1; + + memcpy( &new_gpu->vulkan_uuid, id.deviceUUID, sizeof(id.deviceUUID) ); + new_gpu->vendor_id = properties2.properties.vendorID; + new_gpu->device_id = properties2.properties.deviceID; + ntdll_umbstowcs( properties2.properties.deviceName, -1, new_gpu->name, ARRAY_SIZE(new_gpu->name) ); + + TRACE("Added a new GPU via Vulkan: %04x:%04x %s\n", new_gpu->vendor_id, new_gpu->device_id, debugstr_w(new_gpu->name)); + } + +done: + free( vk_physical_devices ); + if (vk_instance) + vulkan_funcs->p_vkDestroyInstance( vk_instance, NULL ); +} + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProviderInfo *provider_info, @@ -772,6 +978,7 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p XRRProviderInfo *provider_info = NULL; XRRCrtcInfo *crtc_info = NULL; INT primary_provider = -1; + INT gpu_count = 0; RECT primary_rect; BOOL ret = FALSE; DWORD len; @@ -785,22 +992,17 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p if (!provider_resources) goto done; - gpus = calloc( provider_resources->nproviders ? provider_resources->nproviders : 1, sizeof(*gpus) ); - if (!gpus) - goto done; - /* Some XRandR implementations don't support providers. * In this case, report a fake one to try searching adapters in screen resources */ if (!provider_resources->nproviders) { WARN("XRandR implementation doesn't report any providers, faking one.\n"); - lstrcpyW( gpus[0].name, wine_adapterW ); - *new_gpus = gpus; - *count = 1; - ret = TRUE; - goto done; + goto fallback; } + gpus = calloc( provider_resources->nproviders, sizeof(*gpus) ); + if (!gpus) goto done; + primary_rect = get_primary_rect( screen_resources ); for (i = 0; i < provider_resources->nproviders; ++i) { @@ -834,6 +1036,7 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p /* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */ } pXRRFreeProviderInfo( provider_info ); + gpu_count++; } /* Make primary GPU the first */ @@ -844,8 +1047,29 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p gpus[primary_provider] = tmp; } +fallback: + /* Add the Vulkan only GPUs only if we need all the detailed properties */ + if (get_properties) + add_remaining_gpus_via_vulkan( &gpus, &gpu_count ); + + if (gpu_count == 0) + { + /* we need at least one for get_adapters() / get_id() */ + gpus = calloc( 1, sizeof(*gpus) ); + if (!gpus) goto done; + lstrcpyW( gpus[0].name, wine_adapterW ); + gpu_count = 1; + } + else if (gpus[0].id == -1) + { + /* the only GPUs we have are from Vulkan, mark the first one + * as main so that we can use screen resources for adapters, + * see xrandr14_get_adapters() */ + gpus[0].id = 0; + } + *new_gpus = gpus; - *count = provider_resources->nproviders; + *count = gpu_count; ret = TRUE; done: if (provider_resources) @@ -885,6 +1109,10 @@ static BOOL xrandr14_get_adapters( ULONG_PTR gpu_id, struct gdi_adapter **new_ad if (!screen_resources) goto done; + /* Vulkan-only, adapter-less GPU */ + if (gpu_id == -1) + goto done; + if (gpu_id) { provider_info = pXRRGetProviderInfo( gdi_display, screen_resources, gpu_id ); @@ -1067,7 +1295,8 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne if (!output_info->crtc || !crtc_info->mode) { monitors[monitor_count].state_flags = DISPLAY_DEVICE_ATTACHED; - monitors[monitor_count].edid_len = get_edid( adapter_id, &monitors[monitor_count].edid ); + monitors[monitor_count].edid_len = get_edid( adapter_id, &monitors[monitor_count].edid, + output_info, screen_resources ); monitor_count = 1; } /* Active monitors, need to find other monitors with the same coordinates as mirrored */ @@ -1122,7 +1351,8 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne primary_index = monitor_count; monitors[monitor_count].edid_len = get_edid( screen_resources->outputs[i], - &monitors[monitor_count].edid ); + &monitors[monitor_count].edid, + enum_output_info, screen_resources ); monitor_count++; } @@ -1166,7 +1396,7 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne for (i = 0; i < monitor_count; i++) { if (monitors[i].edid) - XFree( monitors[i].edid ); + free( monitors[i].edid ); } free( monitors ); ERR("Failed to get monitors\n"); @@ -1181,7 +1411,7 @@ static void xrandr14_free_monitors( struct gdi_monitor *monitors, int count ) for (i = 0; i < count; i++) { if (monitors[i].edid) - XFree( monitors[i].edid ); + free( monitors[i].edid ); } free( monitors ); } diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 74723915fc5..da6c15b9676 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -470,6 +470,7 @@ static void update_xrender_clipping( struct xrender_physdev *dev, HRGN rgn ) } else if ((data = X11DRV_GetRegionData( rgn, 0 ))) { + fs_hack_rgndata_user_to_real( data ); pXRenderSetPictureClipRectangles( gdi_display, dev->pict, dev->x11dev->dc_rect.left, dev->x11dev->dc_rect.top, (XRectangle *)data->Buffer, data->rdh.nCount ); @@ -1448,13 +1449,71 @@ static void multiply_alpha( Picture pict, XRenderPictFormat *format, int alpha, XFreePixmap( gdi_display, mask_pixmap ); } +/* if we are letterboxing, draw black bars */ +static void fs_hack_draw_black_bars( HMONITOR monitor, Picture dst_pict ) +{ + static const XRenderColor black = {0, 0, 0, 0xffff}; + POINT tl, br; /* top-left / bottom-right */ + RECT user_rect = fs_hack_current_mode( monitor ); + RECT real_rect = fs_hack_real_mode( monitor ); + SIZE scaled_screen = fs_hack_get_scaled_screen_size( monitor ); + XRenderPictureAttributes pa; + + /* first unclip the picture, so that we can actually draw them */ + pa.clip_mask = None; + pXRenderChangePicture( gdi_display, dst_pict, CPClipMask, &pa ); + + tl.x = user_rect.left; + tl.y = user_rect.top; + fs_hack_point_user_to_real( &tl ); + tl.x = tl.x - real_rect.left; + tl.y = tl.y - real_rect.top; + br.x = tl.x + scaled_screen.cx; + br.y = tl.y + scaled_screen.cy; + + if (tl.x > 0) + { + /* black bars left & right */ + pXRenderFillRectangle( gdi_display, PictOpSrc, dst_pict, &black, 0, 0, /* x, y */ + tl.x, real_rect.bottom - real_rect.top ); /* w, h */ + pXRenderFillRectangle( gdi_display, PictOpSrc, dst_pict, &black, br.x, 0, + real_rect.right - real_rect.left - br.x, real_rect.bottom - real_rect.top ); + } + else if (tl.y > 0) + { + /* black bars top & bottom */ + pXRenderFillRectangle( gdi_display, PictOpSrc, dst_pict, &black, 0, 0, + real_rect.right - real_rect.left, tl.y ); + pXRenderFillRectangle( gdi_display, PictOpSrc, dst_pict, &black, 0, br.y, + real_rect.right - real_rect.left, real_rect.bottom - real_rect.top - br.y ); + } +} + /* Helper function for (stretched) blitting using xrender */ -static void xrender_blit( int op, Picture src_pict, Picture mask_pict, Picture dst_pict, - int x_src, int y_src, int width_src, int height_src, - int x_dst, int y_dst, int width_dst, int height_dst, - double xscale, double yscale ) +static void xrender_blit( struct xrender_physdev *physdev, int op, Picture src_pict, Picture mask_pict, + Picture dst_pict, int x_src, int y_src, int width_src, int height_src, int x_dst, + int y_dst, int width_dst, int height_dst, double xscale, double yscale ) { int x_offset, y_offset; + HMONITOR monitor; + + monitor = fs_hack_monitor_from_hwnd( NtUserWindowFromDC( physdev->dev.hdc ) ); + if (fs_hack_mapping_required( monitor )) + { + double user_to_real_scale; + POINT p; + p.x = x_dst; + p.y = y_dst; + fs_hack_point_user_to_real( &p ); + x_dst = p.x; + y_dst = p.y; + + user_to_real_scale = fs_hack_get_user_to_real_scale( monitor ); + width_dst *= user_to_real_scale; + height_dst *= user_to_real_scale; + xscale /= user_to_real_scale; + yscale /= user_to_real_scale; + } if (width_src < 0) { @@ -1495,6 +1554,8 @@ static void xrender_blit( int op, Picture src_pict, Picture mask_pict, Picture d } pXRenderComposite( gdi_display, op, src_pict, mask_pict, dst_pict, x_offset, y_offset, 0, 0, x_dst, y_dst, width_dst, height_dst ); + + if (fs_hack_mapping_required( monitor )) fs_hack_draw_black_bars( monitor, dst_pict ); } /* Helper function for (stretched) mono->color blitting using xrender */ @@ -1654,7 +1715,7 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr if (physdev_dst->pict_format->depth == 32 && physdev_src->pict_format->depth < 32) mask_pict = get_no_alpha_mask(); - xrender_blit( PictOpSrc, src_pict, mask_pict, dst_pict, + xrender_blit( physdev_dst, PictOpSrc, src_pict, mask_pict, dst_pict, physdev_src->x11dev->dc_rect.left + src->x, physdev_src->x11dev->dc_rect.top + src->y, src->width, src->height, x_dst, y_dst, dst->width, dst->height, xscale, yscale ); @@ -1678,6 +1739,7 @@ static void xrender_put_image( Pixmap src_pixmap, Picture src_pict, Picture mask RGNDATA *clip_data = NULL; if (clip) clip_data = X11DRV_GetRegionData( clip, 0 ); + fs_hack_rgndata_user_to_real( clip_data ); x_dst = dst->x; y_dst = dst->y; dst_pict = pXRenderCreatePicture( gdi_display, drawable, dst_format, 0, NULL ); @@ -1700,7 +1762,7 @@ static void xrender_put_image( Pixmap src_pixmap, Picture src_pict, Picture mask } else xscale = yscale = 1; /* no scaling needed with a repeating source */ - xrender_blit( PictOpSrc, src_pict, mask_pict, dst_pict, src->x, src->y, src->width, src->height, + xrender_blit( physdev, PictOpSrc, src_pict, mask_pict, dst_pict, src->x, src->y, src->width, src->height, x_dst, y_dst, dst->width, dst->height, xscale, yscale ); if (drawable) pXRenderFreePicture( gdi_display, dst_pict ); @@ -1716,6 +1778,11 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, struct xrender_physdev *physdev_dst = get_xrender_dev( dst_dev ); struct xrender_physdev *physdev_src = get_xrender_dev( src_dev ); BOOL stretch = (src->width != dst->width) || (src->height != dst->height); + HMONITOR monitor; + + TRACE( "src %d,%d %dx%d vis=%s dst %d,%d %dx%d vis=%s rop=%06x\n", src->x, src->y, src->width, + src->height, wine_dbgstr_rect( &src->visrect ), dst->x, dst->y, dst->width, dst->height, + wine_dbgstr_rect( &dst->visrect ), (int)rop ); if (src_dev->funcs != dst_dev->funcs) { @@ -1727,6 +1794,9 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, if (physdev_dst->format == WXR_FORMAT_MONO && physdev_src->format != WXR_FORMAT_MONO) goto x11drv_fallback; + monitor = fs_hack_monitor_from_hwnd( NtUserWindowFromDC( dst_dev->hdc ) ); + if (fs_hack_mapping_required( monitor )) stretch = TRUE; + /* if not stretching, we only need to handle format conversion */ if (!stretch && physdev_dst->format == physdev_src->format) goto x11drv_fallback; @@ -1745,8 +1815,21 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, tmpGC = XCreateGC( gdi_display, physdev_dst->x11dev->drawable, 0, NULL ); XSetSubwindowMode( gdi_display, tmpGC, IncludeInferiors ); XSetGraphicsExposures( gdi_display, tmpGC, False ); - tmp_pixmap = XCreatePixmap( gdi_display, root_window, tmp.visrect.right - tmp.visrect.left, - tmp.visrect.bottom - tmp.visrect.top, physdev_dst->pict_format->depth ); + + if (fs_hack_mapping_required( monitor )) + { + double user_to_real_scale; + SIZE size; + + user_to_real_scale = fs_hack_get_user_to_real_scale( monitor ); + size.cx = (tmp.visrect.right - tmp.visrect.left) * user_to_real_scale; + size.cy = (tmp.visrect.bottom - tmp.visrect.top) * user_to_real_scale; + tmp_pixmap = XCreatePixmap( gdi_display, root_window, size.cx, size.cy, + physdev_dst->pict_format->depth ); + } + else tmp_pixmap = XCreatePixmap( gdi_display, root_window, tmp.visrect.right - tmp.visrect.left, + tmp.visrect.bottom - tmp.visrect.top, + physdev_dst->pict_format->depth ); xrender_stretch_blit( physdev_src, physdev_dst, tmp_pixmap, src, &tmp ); execute_rop( physdev_dst->x11dev, tmp_pixmap, tmpGC, &dst->visrect, rop ); @@ -1781,6 +1864,10 @@ static DWORD xrenderdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info, Picture src_pict, mask_pict = 0; BOOL use_repeat; + TRACE( "src %d,%d %dx%d vis=%s dst %d,%d %dx%d vis=%s rop=%06x\n", src->x, src->y, src->width, + src->height, wine_dbgstr_rect( &src->visrect ), dst->x, dst->y, dst->width, dst->height, + wine_dbgstr_rect( &dst->visrect ), (int)rop ); + dst_format = physdev->format; src_format = get_xrender_format_from_bitmapinfo( info ); if (!(pict_format = pict_formats[src_format])) goto update_format; @@ -1805,6 +1892,7 @@ static DWORD xrenderdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info, if (rop != SRCCOPY) { BOOL restore_region = add_extra_clipping_region( physdev->x11dev, clip ); + HMONITOR monitor; /* make coordinates relative to tmp pixmap */ tmp = *dst; @@ -1815,13 +1903,29 @@ static DWORD xrenderdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info, gc = XCreateGC( gdi_display, physdev->x11dev->drawable, 0, NULL ); XSetSubwindowMode( gdi_display, gc, IncludeInferiors ); XSetGraphicsExposures( gdi_display, gc, False ); - tmp_pixmap = XCreatePixmap( gdi_display, root_window, - tmp.visrect.right - tmp.visrect.left, - tmp.visrect.bottom - tmp.visrect.top, - physdev->pict_format->depth ); + + monitor = fs_hack_monitor_from_hwnd( NtUserWindowFromDC( dev->hdc ) ); + if (fs_hack_mapping_required( monitor )) + { + double user_to_real_scale; + SIZE size; + + user_to_real_scale = fs_hack_get_user_to_real_scale( monitor ); + size.cx = (tmp.visrect.right - tmp.visrect.left) * user_to_real_scale; + size.cy = (tmp.visrect.bottom - tmp.visrect.top) * user_to_real_scale; + tmp_pixmap = XCreatePixmap( gdi_display, root_window, size.cx, size.cy, + physdev->pict_format->depth ); + } + else + { + tmp_pixmap = XCreatePixmap( gdi_display, root_window, + tmp.visrect.right - tmp.visrect.left, + tmp.visrect.bottom - tmp.visrect.top, + physdev->pict_format->depth ); + } xrender_put_image( src_pixmap, src_pict, mask_pict, NULL, physdev->pict_format, - NULL, tmp_pixmap, src, &tmp, use_repeat ); + physdev, tmp_pixmap, src, &tmp, use_repeat ); execute_rop( physdev->x11dev, tmp_pixmap, gc, &dst->visrect, rop ); XFreePixmap( gdi_display, tmp_pixmap ); @@ -1898,7 +2002,7 @@ static DWORD xrenderdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct pthread_mutex_lock( &xrender_mutex ); mask_pict = get_mask_pict( func.SourceConstantAlpha * 257 ); - xrender_blit( PictOpOver, src_pict, mask_pict, dst_pict, + xrender_blit( physdev, PictOpOver, src_pict, mask_pict, dst_pict, src->x, src->y, src->width, src->height, physdev->x11dev->dc_rect.left + dst->x, physdev->x11dev->dc_rect.top + dst->y, @@ -1987,7 +2091,7 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst, pthread_mutex_lock( &xrender_mutex ); mask_pict = get_mask_pict( blendfn.SourceConstantAlpha * 257 ); - xrender_blit( PictOpOver, src_pict, mask_pict, dst_pict, + xrender_blit( physdev_dst, PictOpOver, src_pict, mask_pict, dst_pict, physdev_src->x11dev->dc_rect.left + src->x, physdev_src->x11dev->dc_rect.top + src->y, src->width, src->height, @@ -2090,7 +2194,7 @@ static BOOL xrenderdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG n dst_pict = get_xrender_picture( physdev, 0, NULL ); src_pict = pXRenderCreateLinearGradient( gdi_display, &gradient, stops, colors, 2 ); - xrender_blit( PictOpSrc, src_pict, 0, dst_pict, + xrender_blit( physdev, PictOpSrc, src_pict, 0, dst_pict, 0, 0, rc.right - rc.left, rc.bottom - rc.top, physdev->x11dev->dc_rect.left + rc.left, physdev->x11dev->dc_rect.top + rc.top, diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index fd9b1e7e8b1..a330cf9ce0e 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -550,6 +550,25 @@ void X11DRV_XF86VM_Init(void) #endif /* SONAME_LIBXXF86VM */ +static BOOL CALLBACK gammahack_UpdateWindowGamma( HWND hwnd, LPARAM lparam ) +{ + /* XXX: Technically, the ramp should only apply to windows on the given + * device, but I can't think of a situation in which that would matter. */ + + sync_gl_drawable( hwnd, FALSE ); + + return TRUE; +} + +static BOOL gamma_hack_SetGammaRamp( PHYSDEV dev, const WORD *ramp ) +{ + fs_hack_set_gamma_ramp( ramp ); + + NtUserEnumChildWindows( NtUserGetDesktopWindow(), gammahack_UpdateWindowGamma, 0 ); + + return TRUE; +} + /*********************************************************************** * GetDeviceGammaRamp */ @@ -568,7 +587,8 @@ BOOL X11DRV_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) BOOL X11DRV_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) { #ifdef SONAME_LIBXXF86VM - return X11DRV_XF86VM_SetGammaRamp(ramp); + if (!X11DRV_XF86VM_SetGammaRamp(ramp)) return gamma_hack_SetGammaRamp(dev, ramp); + return TRUE; #else return FALSE; #endif diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index e46f2023fae..695b370a810 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -306,28 +306,25 @@ void netconn_release( struct netconn *conn ) free(conn); } -DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD security_flags, CredHandle *cred_handle, - BOOL check_revocation ) +static DWORD netconn_negotiate( struct netconn *conn, WCHAR *hostname, CredHandle *cred_handle, + CtxtHandle *prev_ctx, SecBufferDesc *prev_buf, CtxtHandle *ctx ) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; BYTE *read_buf; SIZE_T read_buf_size = 2048; ULONG attrs = 0; - CtxtHandle ctx; SSIZE_T size; - const CERT_CONTEXT *cert; SECURITY_STATUS status; - DWORD res = ERROR_SUCCESS; const DWORD isc_req_flags = ISC_REQ_ALLOCATE_MEMORY|ISC_REQ_USE_SESSION_KEY|ISC_REQ_CONFIDENTIALITY |ISC_REQ_SEQUENCE_DETECT|ISC_REQ_REPLAY_DETECT|ISC_REQ_MANUAL_CRED_VALIDATION; if (!(read_buf = malloc( read_buf_size ))) return ERROR_OUTOFMEMORY; - memset( &ctx, 0, sizeof(ctx) ); - status = InitializeSecurityContextW(cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, - &ctx, &out_desc, &attrs, NULL); + status = InitializeSecurityContextW(cred_handle, prev_ctx, hostname, isc_req_flags, 0, 0, prev_buf, 0, + ctx, &out_desc, &attrs, NULL); + if (!ctx) ctx = prev_ctx; assert(status != SEC_E_OK); @@ -340,7 +337,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur size = sock_send(conn->socket, out_buf.pvBuffer, out_buf.cbBuffer, NULL); if(size != out_buf.cbBuffer) { ERR("send failed\n"); - res = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; break; } @@ -384,63 +381,73 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur in_bufs[0].cbBuffer += size; in_bufs[0].pvBuffer = read_buf; - status = InitializeSecurityContextW(cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, + status = InitializeSecurityContextW(cred_handle, ctx, hostname, isc_req_flags, 0, 0, &in_desc, 0, NULL, &out_desc, &attrs, NULL); TRACE( "InitializeSecurityContext ret %#lx\n", status ); + if(status == SEC_E_OK && in_bufs[1].BufferType == SECBUFFER_EXTRA) + FIXME("SECBUFFER_EXTRA not supported\n"); + } - if(status == SEC_E_OK) { - if(in_bufs[1].BufferType == SECBUFFER_EXTRA) - FIXME("SECBUFFER_EXTRA not supported\n"); + free(read_buf); - status = QueryContextAttributesW(&ctx, SECPKG_ATTR_STREAM_SIZES, &conn->ssl_sizes); - if(status != SEC_E_OK) { - WARN("Could not get sizes\n"); - break; - } + return status; +} - status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); - if(status == SEC_E_OK) { - res = netconn_verify_cert(cert, hostname, security_flags, check_revocation); - CertFreeCertificateContext(cert); - if(res != ERROR_SUCCESS) { - WARN( "cert verify failed: %lu\n", res ); - break; - } - }else { - WARN("Could not get cert\n"); - break; - } +DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD security_flags, CredHandle *cred_handle, + BOOL check_revocation ) +{ + CtxtHandle ctx = {0}; + const CERT_CONTEXT *cert; + SECURITY_STATUS status; + DWORD res = ERROR_SUCCESS; - conn->ssl_read_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); - if(!conn->ssl_read_buf) { - res = ERROR_OUTOFMEMORY; - break; - } - conn->ssl_write_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); - if(!conn->ssl_write_buf) { - res = ERROR_OUTOFMEMORY; - break; - } - } + status = netconn_negotiate(conn, hostname, cred_handle, NULL, NULL, &ctx); + if(status != SEC_E_OK || res != ERROR_SUCCESS) + goto failed; + + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_STREAM_SIZES, &conn->ssl_sizes); + if(status != SEC_E_OK) { + WARN("Could not get sizes\n"); + goto failed; } - free(read_buf); + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); + if(status != SEC_E_OK) { + WARN("Could not get cert\n"); + goto failed; + } - if(status != SEC_E_OK || res != ERROR_SUCCESS) { - WARN( "Failed to initialize security context: %#lx\n", status ); - free(conn->ssl_read_buf); - conn->ssl_read_buf = NULL; - free(conn->ssl_write_buf); - conn->ssl_write_buf = NULL; - DeleteSecurityContext(&ctx); - return ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + res = netconn_verify_cert(cert, hostname, security_flags, check_revocation); + CertFreeCertificateContext(cert); + if(res != ERROR_SUCCESS) { + WARN( "cert verify failed: %lu\n", res ); + goto failed; } + conn->ssl_read_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); + if(!conn->ssl_read_buf) { + res = ERROR_OUTOFMEMORY; + goto failed; + } + conn->ssl_write_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); + if(!conn->ssl_write_buf) { + res = ERROR_OUTOFMEMORY; + goto failed; + } TRACE("established SSL connection\n"); conn->secure = TRUE; conn->ssl_ctx = ctx; return ERROR_SUCCESS; + +failed: + WARN( "Failed to initialize security context: %#lx\n", status ); + free(conn->ssl_read_buf); + conn->ssl_read_buf = NULL; + free(conn->ssl_write_buf); + conn->ssl_write_buf = NULL; + DeleteSecurityContext(&ctx); + return ERROR_WINHTTP_SECURE_CHANNEL_ERROR; } static DWORD send_ssl_chunk( struct netconn *conn, const void *msg, size_t size, WSAOVERLAPPED *ovr ) @@ -555,8 +562,23 @@ static DWORD read_ssl_chunk( struct netconn *conn, void *buf, SIZE_T buf_size, S break; case SEC_I_RENEGOTIATE: + { + SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}; + SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}; + TRACE("renegotiate\n"); - return ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED; + + for(i = 0; i < ARRAY_SIZE(bufs); i++) { + if(bufs[i].BufferType == SECBUFFER_EXTRA) { + out_buf.cbBuffer = bufs[i].cbBuffer; + out_buf.pvBuffer = bufs[i].pvBuffer; + } + } + + res = netconn_negotiate(conn, conn->host->hostname, NULL, &conn->ssl_ctx, &out_desc, NULL); + if (res != SEC_E_OK) return res; + continue; + } case SEC_I_CONTEXT_EXPIRED: TRACE("context expired\n"); diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 84af8e58988..17621af8647 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -43,6 +43,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhttp); #define DEFAULT_KEEP_ALIVE_TIMEOUT 30000 +#define ACTUAL_DEFAULT_RECEIVE_RESPONSE_TIMEOUT 21000 + +static int request_receive_response_timeout( struct request *req ) +{ + if (req->receive_response_timeout == -1) return ACTUAL_DEFAULT_RECEIVE_RESPONSE_TIMEOUT; + return req->receive_response_timeout; +} + static const WCHAR *attribute_table[] = { L"Mime-Version", /* WINHTTP_QUERY_MIME_VERSION = 0 */ @@ -257,6 +265,16 @@ static BOOL cancel_queue( struct queue *queue ) return cancelled; } +static void task_send_callback( void *ctx, BOOL abort ) +{ + struct send_callback *s = ctx; + + if (abort) return; + + TRACE( "running %p\n", ctx ); + send_callback( s->task_hdr.obj, s->status, s->info, s->buflen ); +} + static void free_header( struct header *header ) { free( header->field ); @@ -1648,7 +1666,7 @@ static DWORD open_connection( struct request *request ) return ret; } netconn_set_timeout( netconn, TRUE, request->send_timeout ); - netconn_set_timeout( netconn, FALSE, request->receive_response_timeout ); + netconn_set_timeout( netconn, FALSE, request_receive_response_timeout( request )); request->netconn = netconn; @@ -1686,7 +1704,7 @@ static DWORD open_connection( struct request *request ) TRACE("using connection %p\n", netconn); netconn_set_timeout( netconn, TRUE, request->send_timeout ); - netconn_set_timeout( netconn, FALSE, request->receive_response_timeout ); + netconn_set_timeout( netconn, FALSE, request_receive_response_timeout( request )); request->netconn = netconn; } @@ -1904,7 +1922,7 @@ static DWORD refill_buffer( struct request *request, BOOL notify ) static void finished_reading( struct request *request ) { - BOOL close = FALSE, notify; + BOOL close = FALSE, close_request_headers; WCHAR connection[20]; DWORD size = sizeof(connection); @@ -1919,18 +1937,16 @@ static void finished_reading( struct request *request ) } else if (!wcscmp( request->version, L"HTTP/1.0" )) close = TRUE; - if (close) + size = sizeof(connection); + close_request_headers = + (!query_headers( request, WINHTTP_QUERY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, NULL, connection, &size, NULL ) + || !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, NULL, connection, &size, NULL )) + && !wcsicmp( connection, L"close" ); + if (close || close_request_headers) { - size = sizeof(connection); - notify = (!query_headers( request, WINHTTP_QUERY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, - NULL, connection, &size, NULL ) - || !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, - NULL, connection, &size, NULL )) - && !wcsicmp( connection, L"close" ); - - if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 0 ); + if (close_request_headers) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 0 ); netconn_release( request->netconn ); - if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 0 ); + if (close_request_headers) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 0 ); } else cache_connection( request->netconn ); @@ -2319,7 +2335,7 @@ static DWORD send_request( struct request *request, const WCHAR *headers, DWORD if (!chunked && content_length <= optional_len) { - netconn_set_timeout( request->netconn, FALSE, request->receive_response_timeout ); + netconn_set_timeout( request->netconn, FALSE, request_receive_response_timeout( request )); request->read_reply_status = read_reply( request ); if (request->state == REQUEST_RESPONSE_STATE_READ_RESPONSE_QUEUED) request->state = REQUEST_RESPONSE_STATE_READ_RESPONSE_QUEUED_REPLY_RECEIVED; @@ -2922,7 +2938,7 @@ static DWORD receive_response( struct request *request ) } /* fallthrough */ case REQUEST_RESPONSE_STATE_READ_RESPONSE_QUEUED_REQUEST_SENT: - netconn_set_timeout( request->netconn, FALSE, request->receive_response_timeout ); + netconn_set_timeout( request->netconn, FALSE, request_receive_response_timeout( request )); request->read_reply_status = read_reply( request ); request->state = REQUEST_RESPONSE_STATE_REPLY_RECEIVED; break; @@ -3052,9 +3068,12 @@ static DWORD query_data_ready( struct request *request ) return count; } -static BOOL skip_async_queue( struct request *request ) +static BOOL skip_async_queue( struct request *request, BOOL *wont_block, DWORD to_read ) { - return request->hdr.recursion_count < 3 && (end_of_read_data( request ) || query_data_ready( request )); + if (!request->read_chunked) + to_read = min( to_read, request->content_length - request->content_read ); + *wont_block = end_of_read_data( request ) || query_data_ready( request ) >= to_read; + return request->hdr.recursion_count < 3 && *wont_block; } static DWORD query_data_available( struct request *request, DWORD *available, BOOL async ) @@ -3106,6 +3125,7 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) DWORD ret; struct request *request; BOOL async; + BOOL wont_block = FALSE; TRACE("%p, %p\n", hrequest, available); @@ -3121,7 +3141,44 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) return FALSE; } - if ((async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) && !skip_async_queue( request )) + if (!(async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) || skip_async_queue( request, &wont_block, 1 )) + { + ret = query_data_available( request, available, async ); + } + else if (wont_block) + { + /* Data available but recursion limit reached, only queue callback. */ + struct send_callback *s; + + if (!(s = malloc( sizeof(*s) ))) + { + release_object( &request->hdr ); + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + + if (!(ret = query_data_available( request, &s->count, FALSE ))) + { + if (available) *available = s->count; + s->status = WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE; + s->info = &s->count; + s->buflen = sizeof(s->count); + } + else + { + s->result.dwResult = API_QUERY_DATA_AVAILABLE; + s->result.dwError = ret; + s->status = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR; + s->info = &s->result; + s->buflen = sizeof(s->result); + } + + if ((ret = queue_task( &request->queue, task_send_callback, &s->task_hdr, &request->hdr ))) + free( s ); + else + ret = ERROR_IO_PENDING; + } + else { struct query_data *q; @@ -3139,7 +3196,6 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) else ret = ERROR_IO_PENDING; } - else ret = query_data_available( request, available, async ); release_object( &request->hdr ); SetLastError( ret ); @@ -3165,6 +3221,7 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW DWORD ret; struct request *request; BOOL async; + BOOL wont_block = FALSE; TRACE( "%p, %p, %lu, %p\n", hrequest, buffer, to_read, read ); @@ -3180,7 +3237,44 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW return FALSE; } - if ((async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) && !skip_async_queue( request )) + if (!(async = request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) || skip_async_queue( request, &wont_block, to_read )) + { + ret = read_data( request, buffer, to_read, read, async ); + } + else if (wont_block) + { + /* Data available but recursion limit reached, only queue callback. */ + struct send_callback *s; + + if (!(s = malloc( sizeof(*s) ))) + { + release_object( &request->hdr ); + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + + if (!(ret = read_data( request, buffer, to_read, &s->count, FALSE ))) + { + if (read) *read = s->count; + s->status = WINHTTP_CALLBACK_STATUS_READ_COMPLETE; + s->info = buffer; + s->buflen = s->count; + } + else + { + s->result.dwResult = API_READ_DATA; + s->result.dwError = ret; + s->status = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR; + s->info = &s->result; + s->buflen = sizeof(s->result); + } + + if ((ret = queue_task( &request->queue, task_send_callback, &s->task_hdr, &request->hdr ))) + free( s ); + else + ret = ERROR_IO_PENDING; + } + else { struct read_data *r; @@ -3199,7 +3293,6 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DW else ret = ERROR_IO_PENDING; } - else ret = read_data( request, buffer, to_read, read, async ); release_object( &request->hdr ); SetLastError( ret ); diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 78319f0df5c..3e67c439bb5 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -1904,6 +1904,9 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex break; case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: + { + DWORD len; + if (!context->read_from_callback) { SetEvent( context->wait ); @@ -1920,15 +1923,23 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex "got %lu, thread %#lx\n", context->recursion_count, GetCurrentThreadId() ); context->max_recursion_query = max( context->max_recursion_query, context->recursion_count ); InterlockedIncrement( &context->recursion_count ); - ret = WinHttpReadData( context->request, &b, 1, NULL ); + b = 0xff; + len = 0xdeadbeef; + ret = WinHttpReadData( context->request, &b, 1, &len ); err = GetLastError(); ok( ret, "failed to read data, GetLastError() %lu\n", err ); ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "got %lu\n", err ); + ok( b != 0xff, "got %#x.\n", b ); + ok( len == 1, "got %lu.\n", len ); if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; + } case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: + { + static DWORD len; + if (!buflen) { SetEvent( context->wait ); @@ -1939,13 +1950,19 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex context->max_recursion_read = max( context->max_recursion_read, context->recursion_count ); context->read_from_callback = TRUE; InterlockedIncrement( &context->recursion_count ); - ret = WinHttpQueryDataAvailable( context->request, NULL ); + len = 0xdeadbeef; + /* Use static variable len here so write to it doesn't destroy the stack on old Windows which + * doesn't set the value at once. */ + ret = WinHttpQueryDataAvailable( context->request, &len ); err = GetLastError(); ok( ret, "failed to query data available, GetLastError() %lu\n", err ); ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "got %lu\n", err ); + ok( len != 0xdeadbeef || broken( len == 0xdeadbeef ) /* Win7 */, "got %lu.\n", len ); if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; + } + case WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE: if (!context->headers_available && context->call_receive_response_status == WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 09abc4c5854..2c3f1791898 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2197,6 +2197,12 @@ static const char okmsg[] = "Server: winetest\r\n" "\r\n"; +static const char okmsg_length0[] = +"HTTP/1.1 200 OK\r\n" +"Server: winetest\r\n" +"Content-length: 0\r\n" +"\r\n"; + static const char notokmsg[] = "HTTP/1.1 400 Bad Request\r\n" "\r\n"; @@ -2318,6 +2324,24 @@ static void create_websocket_accept(const char *key, char *buf, unsigned int buf CryptBinaryToStringA( (BYTE *)sha1, sizeof(sha1), CRYPT_STRING_BASE64, buf, &len); } +static int server_receive_request(int c, char *buffer, size_t buffer_size) +{ + int i, r; + + memset(buffer, 0, buffer_size); + for(i = 0; i < buffer_size - 1; i++) + { + r = recv(c, &buffer[i], 1, 0); + if (r != 1) + break; + if (i < 4) continue; + if (buffer[i - 2] == '\n' && buffer[i] == '\n' && + buffer[i - 3] == '\r' && buffer[i - 1] == '\r') + break; + } + return r; +} + static DWORD CALLBACK server_thread(LPVOID param) { struct server_info *si = param; @@ -2351,18 +2375,7 @@ static DWORD CALLBACK server_thread(LPVOID param) do { if (c == -1) c = accept(s, NULL, NULL); - - memset(buffer, 0, sizeof buffer); - for(i = 0; i < sizeof buffer - 1; i++) - { - r = recv(c, &buffer[i], 1, 0); - if (r != 1) - break; - if (i < 4) continue; - if (buffer[i - 2] == '\n' && buffer[i] == '\n' && - buffer[i - 3] == '\r' && buffer[i - 1] == '\r') - break; - } + server_receive_request(c, buffer, sizeof(buffer)); if (strstr(buffer, "GET /basic")) { send(c, okmsg, sizeof okmsg - 1, 0); @@ -2558,6 +2571,23 @@ static DWORD CALLBACK server_thread(LPVOID param) } send(c, okmsg, sizeof(okmsg) - 1, 0); } + + if (strstr(buffer, "GET /cached")) + { + send(c, okmsg_length0, sizeof okmsg_length0 - 1, 0); + r = server_receive_request(c, buffer, sizeof(buffer)); + ok(r > 0, "got %d.\n", r); + ok(!!strstr(buffer, "GET /cached"), "request not found.\n"); + send(c, okmsg_length0, sizeof okmsg_length0 - 1, 0); + r = server_receive_request(c, buffer, sizeof(buffer)); + ok(!r, "got %d, buffer[0] %d.\n", r, buffer[0]); + } + if (strstr(buffer, "GET /notcached")) + { + send(c, okmsg, sizeof okmsg - 1, 0); + r = server_receive_request(c, buffer, sizeof(buffer)); + ok(!r, "got %d, buffer[0] %d.\n", r, buffer[0] ); + } shutdown(c, 2); closesocket(c); c = -1; @@ -5822,6 +5852,65 @@ static void test_client_cert_authentication(void) WinHttpCloseHandle( ses ); } +static void test_connection_cache(int port) +{ + HINTERNET ses, con, req; + DWORD status, size; + char buffer[256]; + BOOL ret; + + ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %lu\n", GetLastError()); + + con = WinHttpConnect(ses, L"localhost", port, 0); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError()); + + req = WinHttpOpenRequest(con, L"GET", L"/cached", NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %lu\n", GetLastError()); + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %lu\n", GetLastError()); + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %lu\n", GetLastError()); + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status); + ret = WinHttpReadData(req, buffer, sizeof buffer, &size); + ok(ret, "failed to read data %lu\n", GetLastError()); + ok(!size, "got size %lu.\n", size); + WinHttpCloseHandle(req); + + req = WinHttpOpenRequest(con, L"GET", L"/cached", NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %lu\n", GetLastError()); + ret = WinHttpSendRequest(req, L"Connection: close", ~0ul, NULL, 0, 0, 0); + ok(ret, "failed to send request %lu\n", GetLastError()); + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %lu\n", GetLastError()); + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status); + ret = WinHttpReadData(req, buffer, sizeof buffer, &size); + ok(ret, "failed to read data %lu\n", GetLastError()); + ok(!size, "got size %lu.\n", size); + WinHttpCloseHandle(req); + + req = WinHttpOpenRequest(con, L"GET", L"/notcached", NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %lu\n", GetLastError()); + ret = WinHttpSendRequest(req, L"Connection: close", ~0ul, NULL, 0, 0, 0); + ok(ret, "failed to send request %lu\n", GetLastError()); + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %lu\n", GetLastError()); + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status); + WinHttpCloseHandle(req); + + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); +} + START_TEST (winhttp) { struct server_info si; @@ -5889,6 +5978,7 @@ START_TEST (winhttp) test_passport_auth(si.port); test_websocket(si.port); test_redirect(si.port); + test_connection_cache(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, NULL, L"/quit"); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 0bf1c5bc6b0..80ce2614ca1 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -312,6 +312,19 @@ struct task_header volatile LONG completion_sent; }; +struct send_callback +{ + struct task_header task_hdr; + DWORD status; + void *info; + DWORD buflen; + union + { + WINHTTP_ASYNC_RESULT result; + DWORD count; + }; +}; + struct send_request { struct task_header task_hdr; diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index d5bfb5ad11c..7d59ab92c41 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -34,6 +34,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintypes); +static const struct +{ + const WCHAR *name; + unsigned int max_major; +} +present_contracts[] = +{ + { L"Windows.Foundation.UniversalApiContract", 10, }, +}; + +static BOOLEAN is_api_contract_present( const HSTRING hname, unsigned int version ) +{ + const WCHAR *name = WindowsGetStringRawBuffer( hname, NULL ); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(present_contracts); ++i) + if (!wcsicmp( name, present_contracts[i].name )) return version <= present_contracts[i].max_major; + + return FALSE; +} + struct wintypes { IActivationFactory IActivationFactory_iface; @@ -280,13 +301,13 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsEnumNamedValuePresent static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajor( IApiInformationStatics *iface, HSTRING contract_name, UINT16 major_version, BOOLEAN *value) { - FIXME("iface %p, contract_name %s, major_version %u, value %p stub!\n", iface, + FIXME("iface %p, contract_name %s, major_version %u, value %p semi-stub.\n", iface, debugstr_hstring(contract_name), major_version, value); if (!contract_name) return E_INVALIDARG; - *value = FALSE; + *value = is_api_contract_present( contract_name, major_version ); return S_OK; } diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index dd6401c212b..0703582d325 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -33,12 +33,23 @@ static void test_IApiInformationStatics(void) { + static const struct + { + const WCHAR *name; + unsigned int max_major; + } + present_contracts[] = + { + { L"Windows.Foundation.UniversalApiContract", 10, }, + }; + static const WCHAR *class_name = L"Windows.Foundation.Metadata.ApiInformation"; IAgileObject *agile_object = NULL, *tmp_agile_object = NULL; IInspectable *inspectable = NULL, *tmp_inspectable = NULL; IApiInformationStatics *statics = NULL; IActivationFactory *factory = NULL; HSTRING str, str2; + unsigned int i, j; BOOLEAN ret; HRESULT hr; @@ -424,6 +435,21 @@ static void test_IApiInformationStatics(void) WindowsDeleteString(str); + /* Test API contracts presence. */ + for (i = 0; i < ARRAY_SIZE(present_contracts); ++i) + { + hr = WindowsCreateString(present_contracts[i].name, wcslen(present_contracts[i].name), &str); + ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr); + for (j = 0; j <= present_contracts[i].max_major; ++j) + { + ret = FALSE; + hr = IApiInformationStatics_IsApiContractPresentByMajor(statics, str, i, &ret); + ok(hr == S_OK, "IsApiContractPresentByMajor failed, hr %#lx, i %u, major %u.\n", hr, i, j); + ok(ret == TRUE, "IsApiContractPresentByMajor returned FALSE, i %u, major %u.\n", i, j); + } + WindowsDeleteString(str); + } + IApiInformationStatics_Release(statics); IAgileObject_Release(agile_object); IInspectable_Release(inspectable); diff --git a/dlls/wmvcore/async_reader.c b/dlls/wmvcore/async_reader.c index 3a8556a5f0a..76e749be690 100644 --- a/dlls/wmvcore/async_reader.c +++ b/dlls/wmvcore/async_reader.c @@ -60,12 +60,30 @@ struct async_op struct sample { + struct list entry; INSSBuffer *buffer; QWORD pts, duration; DWORD flags, output; WORD stream; }; +struct stream +{ + struct async_reader *reader; + WORD number; + + HANDLE read_thread; + bool read_requested; + CONDITION_VARIABLE read_cv; + struct list read_samples; + HRESULT read_result; + + bool dedicated_delivery_thread; + HANDLE deliver_thread; + struct list deliver_samples; + CONDITION_VARIABLE deliver_cv; +}; + struct async_reader { IWMReader IWMReader_iface; @@ -79,6 +97,7 @@ struct async_reader LONG refcount; IWMSyncReader2 *reader; + IWMProfile3 *profile; CRITICAL_SECTION cs; @@ -94,6 +113,9 @@ struct async_reader CRITICAL_SECTION callback_cs; CONDITION_VARIABLE callback_cv; + DWORD stream_count; + struct stream *streams; + bool running; struct list async_ops; @@ -293,31 +315,252 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp TRACE("Callback returned %#lx.\n", hr); + list_remove(&sample->entry); INSSBuffer_Release(sample->buffer); + free(sample); +} + +static void stream_request_read(struct stream *stream) +{ + stream->read_result = E_PENDING; + stream->read_requested = true; + WakeConditionVariable(&stream->read_cv); +} + +static void stream_request_deliver(struct async_reader *reader, struct sample *sample) +{ + struct stream *stream = reader->streams + sample->output; + + list_remove(&sample->entry); + list_add_tail(&stream->deliver_samples, &sample->entry); + WakeConditionVariable(&stream->deliver_cv); +} + +static DWORD WINAPI stream_deliver_thread(void *arg) +{ + struct stream *stream = arg; + struct async_reader *reader = stream->reader; + struct list *entry; + + TRACE("reader %p, number %u\n", reader, stream->number); + + EnterCriticalSection(&reader->callback_cs); + + while (reader->running) + { + if (list_empty(&stream->deliver_samples)) + { + SleepConditionVariableCS(&stream->deliver_cv, &reader->callback_cs, INFINITE); + continue; + } + + while ((entry = list_head(&stream->deliver_samples))) + { + struct sample *sample = LIST_ENTRY(entry, struct sample, entry); + async_reader_deliver_sample(reader, sample); + } + + WakeConditionVariable(&reader->callback_cv); + } + + LeaveCriticalSection(&reader->callback_cs); + + TRACE("Reader is stopping; exiting.\n"); + return 0; } -static void callback_thread_run(struct async_reader *reader) +static DWORD WINAPI stream_read_thread(void *arg) { + struct stream *stream = arg; + struct async_reader *reader = stream->reader; + struct sample *sample; + HRESULT hr; + + TRACE("reader %p, number %u\n", reader, stream->number); + + EnterCriticalSection(&reader->callback_cs); + + while (reader->running) + { + if (!stream->read_requested) + { + SleepConditionVariableCS(&stream->read_cv, &reader->callback_cs, INFINITE); + continue; + } + + if (!(sample = calloc(1, sizeof(*sample)))) + { + WARN("Failed to allocate memory for sample.\n"); + continue; + } + + while (stream->read_requested) + { + stream->read_requested = false; + + if (sample->buffer) + INSSBuffer_Release(sample->buffer); + sample->buffer = NULL; + + LeaveCriticalSection(&reader->callback_cs); + hr = IWMSyncReader2_GetNextSample(reader->reader, stream->number, + &sample->buffer, &sample->pts, &sample->duration, + &sample->flags, &sample->output, &sample->stream); + EnterCriticalSection(&reader->callback_cs); + } + + if (SUCCEEDED(stream->read_result = hr)) + { + TRACE("Got stream %u buffer with pts %I64d.\n", stream->number, sample->pts); + list_add_tail(&stream->read_samples, &sample->entry); + } + else + { + WARN("Failed to get stream %u sample, hr %#lx.\n", stream->number, stream->read_result); + free(sample); + } + + WakeConditionVariable(&reader->callback_cv); + } + + LeaveCriticalSection(&reader->callback_cs); + + TRACE("Reader is stopping; exiting.\n"); + return 0; +} + +static void stream_flush_samples(struct stream *stream) +{ + struct sample *sample, *next; + + LIST_FOR_EACH_ENTRY_SAFE(sample, next, &stream->read_samples, struct sample, entry) + { + list_remove(&sample->entry); + INSSBuffer_Release(sample->buffer); + free(sample); + } + + LIST_FOR_EACH_ENTRY_SAFE(sample, next, &stream->deliver_samples, struct sample, entry) + { + list_remove(&sample->entry); + INSSBuffer_Release(sample->buffer); + free(sample); + } +} + +static void stream_close(struct stream *stream) +{ + if (stream->read_thread) + { + WakeConditionVariable(&stream->read_cv); + WaitForSingleObject(stream->read_thread, INFINITE); + CloseHandle(stream->read_thread); + stream->read_thread = NULL; + } + + if (stream->deliver_thread) + { + WakeConditionVariable(&stream->deliver_cv); + WaitForSingleObject(stream->deliver_thread, INFINITE); + CloseHandle(stream->deliver_thread); + stream->deliver_thread = NULL; + } + + stream_flush_samples(stream); +} + +static HRESULT stream_open(struct stream *stream, struct async_reader *reader, WORD number) +{ + if (stream->read_thread) + return S_OK; + + stream->number = number; + stream->reader = reader; + list_init(&stream->read_samples); + list_init(&stream->deliver_samples); + + if (!(stream->read_thread = CreateThread(NULL, 0, stream_read_thread, stream, 0, NULL))) + return E_OUTOFMEMORY; + + if (!(stream->deliver_thread = CreateThread(NULL, 0, stream_deliver_thread, stream, 0, NULL))) + { + stream_close(stream); + return E_OUTOFMEMORY; + } + + return S_OK; +} + +static HRESULT async_reader_get_next_sample(struct async_reader *reader, + struct stream **out_stream, struct sample **out_sample) +{ + struct sample *sample, *first_sample = NULL; + struct stream *stream, *first_stream = NULL; + WMT_STREAM_SELECTION selection; + BOOL pending = FALSE; + struct list *entry; + DWORD i; + + for (i = 0; i < reader->stream_count; ++i) + { + stream = reader->streams + i; + + if (!list_empty(&stream->deliver_samples)) + pending = TRUE; + if (FAILED(IWMSyncReader2_GetStreamSelected(reader->reader, i + 1, &selection)) + || selection == WMT_OFF) + continue; + if (!(entry = list_head(&stream->read_samples))) + { + if (stream->read_result == E_PENDING) + return E_PENDING; + continue; + } + + sample = LIST_ENTRY(entry, struct sample, entry); + if (!first_sample || first_sample->pts > sample->pts) + { + first_stream = stream; + first_sample = sample; + } + } + + if (!first_sample) + return pending ? E_PENDING : NS_E_NO_MORE_SAMPLES; + + TRACE("Found first stream %u with pts %I64d.\n", first_stream->number, first_sample->pts); + *out_sample = first_sample; + *out_stream = first_stream; + return S_OK; +} + +static void async_reader_deliver_samples(struct async_reader *reader) +{ + static const DWORD zero; + IWMReaderCallbackAdvanced *callback_advanced = reader->callback_advanced; IWMReaderCallback *callback = reader->callback; - static const DWORD zero; HRESULT hr = S_OK; + TRACE("reader %p\n", reader); + while (reader->running && list_empty(&reader->async_ops)) { - struct sample sample; + struct stream *stream; + struct sample *sample; - LeaveCriticalSection(&reader->callback_cs); - hr = IWMSyncReader2_GetNextSample(reader->reader, 0, &sample.buffer, &sample.pts, - &sample.duration, &sample.flags, &sample.output, &sample.stream); - EnterCriticalSection(&reader->callback_cs); - if (hr != S_OK) + if (FAILED(hr = async_reader_get_next_sample(reader, &stream, &sample))) break; - if (async_reader_wait_pts(reader, sample.pts)) - async_reader_deliver_sample(reader, &sample); - else - INSSBuffer_Release(sample.buffer); + stream_request_read(stream); + + if (async_reader_wait_pts(reader, sample->pts)) + { + if (!stream->dedicated_delivery_thread) + async_reader_deliver_sample(reader, sample); + else + stream_request_deliver(reader, sample); + } } if (hr == NS_E_NO_MORE_SAMPLES) @@ -325,6 +568,8 @@ static void callback_thread_run(struct async_reader *reader) BOOL user_clock = reader->user_clock; QWORD user_time = reader->user_time; + TRACE("No more streams samples, sending EOF notifications.\n"); + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(callback, WMT_END_OF_STREAMING, S_OK, @@ -342,25 +587,27 @@ static void callback_thread_run(struct async_reader *reader) } EnterCriticalSection(&reader->callback_cs); - - TRACE("Reached end of stream; exiting.\n"); } - else if (hr != S_OK) + else if (hr == E_PENDING) { - ERR("Failed to get sample, hr %#lx.\n", hr); + TRACE("Waiting for more streams samples.\n"); } } static DWORD WINAPI async_reader_callback_thread(void *arg) { - struct async_reader *reader = arg; static const DWORD zero; + + struct async_reader *reader = arg; struct list *entry; HRESULT hr = S_OK; + DWORD i; IWMReaderCallback_OnStatus(reader->callback, WMT_OPENED, S_OK, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); + TRACE("reader %p\n", reader); + EnterCriticalSection(&reader->callback_cs); while (reader->running) @@ -379,19 +626,28 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) if (SUCCEEDED(hr)) hr = IWMSyncReader2_SetRange(reader->reader, op->u.start.start, op->u.start.duration); if (SUCCEEDED(hr)) + { reader->clock_start = get_current_time(reader); + for (i = 0; i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + stream_flush_samples(stream); + stream_request_read(stream); + } + } + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); EnterCriticalSection(&reader->callback_cs); - - if (SUCCEEDED(hr)) - callback_thread_run(reader); break; } case ASYNC_OP_STOP: + if (SUCCEEDED(hr)) + reader->clock_start = 0; + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STOPPED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); @@ -412,6 +668,9 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) free(op); } + if (reader->clock_start) + async_reader_deliver_samples(reader); + if (reader->running && list_empty(&reader->async_ops)) SleepConditionVariableCS(&reader->callback_cv, &reader->callback_cs, INFINITE); } @@ -425,6 +684,7 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) static void async_reader_close(struct async_reader *reader) { struct async_op *op, *next; + int i; if (reader->callback_thread) { @@ -439,6 +699,15 @@ static void async_reader_close(struct async_reader *reader) free(op); } + for (i = 0; reader->streams && i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + stream_close(stream); + } + free(reader->streams); + reader->streams = NULL; + reader->stream_count = 0; + if (reader->allocator) IWMReaderAllocatorEx_Release(reader->allocator); reader->allocator = NULL; @@ -456,6 +725,7 @@ static void async_reader_close(struct async_reader *reader) static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback *callback, void *context) { HRESULT hr = E_OUTOFMEMORY; + DWORD i; IWMReaderCallback_AddRef((reader->callback = callback)); reader->context = context; @@ -470,7 +740,24 @@ static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback reader->callback_advanced = NULL; } + if (FAILED(hr = IWMProfile3_GetStreamCount(reader->profile, &reader->stream_count))) + goto error; + + if (!(reader->streams = calloc(reader->stream_count, sizeof(*reader->streams)))) + { + hr = E_OUTOFMEMORY; + goto error; + } + reader->running = true; + + for (i = 0; i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + if (FAILED(hr = stream_open(stream, reader, i + 1))) + goto error; + } + if (!(reader->callback_thread = CreateThread(NULL, 0, async_reader_callback_thread, reader, 0, NULL))) goto error; @@ -1043,9 +1330,34 @@ static HRESULT WINAPI WMReaderAdvanced2_GetOutputSetting(IWMReaderAdvanced6 *ifa static HRESULT WINAPI WMReaderAdvanced2_SetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num, const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD length) { - struct async_reader *This = impl_from_IWMReaderAdvanced6(iface); - FIXME("(%p)->(%lu %s %#x %p %u)\n", This, output_num, debugstr_w(name), type, value, length); - return E_NOTIMPL; + struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); + struct stream *stream; + HRESULT hr = E_NOTIMPL; + + FIXME("reader %p, output_num %lu, name %s, type %u, value %p, length %u semi-stub!\n", + reader, output_num, debugstr_w(name), type, value, length); + + EnterCriticalSection(&reader->cs); + + if (!reader->streams) + { + LeaveCriticalSection(&reader->cs); + return E_UNEXPECTED; + } + + stream = reader->streams + output_num; + + EnterCriticalSection(&reader->callback_cs); + if (!wcscmp(name, L"DedicatedDeliveryThread")) + { + stream->dedicated_delivery_thread = *(BOOL *)value; + hr = S_OK; + } + LeaveCriticalSection(&reader->callback_cs); + + LeaveCriticalSection(&reader->cs); + + return hr; } static HRESULT WINAPI WMReaderAdvanced2_Preroll(IWMReaderAdvanced6 *iface, QWORD start, QWORD duration, float rate) @@ -1923,6 +2235,10 @@ static HRESULT WINAPI async_reader_create(IWMReader **reader) (void **)&object->reader))) goto failed; IWMReader_Release(&object->IWMReader_iface); + if (FAILED(hr = IUnknown_QueryInterface(object->reader_inner, &IID_IWMProfile3, + (void **)&object->profile))) + goto failed; + IWMReader_Release(&object->IWMReader_iface); InitializeCriticalSection(&object->cs); object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": async_reader.cs"); diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index 482f1297b28..daa89b84dfc 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -524,6 +524,12 @@ typedef struct ULONG Flags; } SYSTEM_CACHE_INFORMATION32; +typedef struct +{ + ULONG ProcessId; + UNICODE_STRING32 ImageName; +} SYSTEM_PROCESS_ID_INFORMATION32; + typedef struct { ULONG OwnerPid; diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index db51948057f..5a0624968c9 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -593,6 +593,19 @@ NTSTATUS WINAPI wow64_NtSetContextThread( UINT *args ) } +/********************************************************************** + * wow64___wine_dbg_ftrace + */ +NTSTATUS WINAPI wow64___wine_dbg_ftrace( UINT *args ) +{ + const char *str = get_ptr( &args ); + ULONG len = get_ulong( &args ); + ULONG ctx = get_ulong( &args ); + + return __wine_dbg_ftrace( (char *)str, len, ctx ); +} + + /********************************************************************** * wow64_NtSetDebugFilterState */ diff --git a/dlls/wow64/system.c b/dlls/wow64/system.c index 7130039e07a..c3012dc2492 100644 --- a/dlls/wow64/system.c +++ b/dlls/wow64/system.c @@ -406,6 +406,24 @@ NTSTATUS WINAPI wow64_NtQuerySystemInformation( UINT *args ) } return status; + case SystemProcessIdInformation: + { + SYSTEM_PROCESS_ID_INFORMATION32 *info32 = ptr; + SYSTEM_PROCESS_ID_INFORMATION info; + + if (retlen) *retlen = sizeof(*info32); + if (len < sizeof(*info32)) return STATUS_INFO_LENGTH_MISMATCH; + + info.ProcessId = ULongToHandle( info32->ProcessId ); + unicode_str_32to64( &info.ImageName, &info32->ImageName ); + if (!(status = NtQuerySystemInformation( class, &info, sizeof(info), NULL ))) + { + info32->ImageName.MaximumLength = info.ImageName.MaximumLength; + info32->ImageName.Length = info.ImageName.Length; + } + return status; + } + case SystemHandleInformation: /* SYSTEM_HANDLE_INFORMATION */ if (len >= sizeof(SYSTEM_HANDLE_INFORMATION32)) { @@ -809,3 +827,21 @@ NTSTATUS WINAPI wow64_NtWow64GetNativeSystemInformation( UINT *args ) return STATUS_INVALID_INFO_CLASS; } } + + +/********************************************************************** + * wow64___wine_set_unix_env + */ +NTSTATUS WINAPI wow64___wine_set_unix_env( UINT *args ) +{ + const char *var = get_ptr( &args ); + const char *val = get_ptr( &args ); + + return __wine_set_unix_env( var, val ); +} + +BOOL WINAPI __wine_needs_override_large_address_aware(void); +NTSTATUS WINAPI wow64___wine_needs_override_large_address_aware( UINT * args ) +{ + return __wine_needs_override_large_address_aware(); +} diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 44b422ef62c..a1ff594f5d3 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3058,6 +3058,16 @@ NTSTATUS WINAPI wow64_NtUserGetTitleBarInfo( UINT *args ) return NtUserGetTitleBarInfo( hwnd, info ); } +NTSTATUS WINAPI wow64_NtUserGetTouchInputInfo( UINT *args ) +{ + HTOUCHINPUT handle = get_handle( &args ); + UINT count = get_ulong( &args ); + TOUCHINPUT *ptr = get_ptr( &args ); + int size = get_ulong( &args ); + + return NtUserGetTouchInputInfo( handle, count, ptr, size ); +} + NTSTATUS WINAPI wow64_NtUserGetUpdateRect( UINT *args ) { HWND hwnd = get_handle( &args ); @@ -3226,6 +3236,14 @@ NTSTATUS WINAPI wow64_NtUserIsMouseInPointerEnabled( UINT *args ) return NtUserIsMouseInPointerEnabled(); } +NTSTATUS WINAPI wow64_NtUserIsTouchWindow( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + ULONG *flags = get_ptr( &args ); + + return NtUserIsTouchWindow( hwnd, flags ); +} + NTSTATUS WINAPI wow64_NtUserKillTimer( UINT *args ) { HWND hwnd = get_handle( &args ); diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c index c19f8430d98..b74de9ffa8e 100644 --- a/dlls/ws2_32/protocol.c +++ b/dlls/ws2_32/protocol.c @@ -148,6 +148,25 @@ static int dns_only_query( const char *node, const struct addrinfo *hints, struc return 0; } +static BOOL eac_download_hack(void) +{ + static int eac_download_hack_enabled = -1; + char str[64]; + + if (eac_download_hack_enabled == -1) + { + if (GetEnvironmentVariableA("WINE_DISABLE_EAC_ALT_DOWNLOAD", str, sizeof(str))) + eac_download_hack_enabled = !!atoi(str); + else + eac_download_hack_enabled = GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) + && !strcmp(str, "626690"); + + if (eac_download_hack_enabled) + ERR("HACK: failing download-alt.easyanticheat.net resolution.\n"); + } + return eac_download_hack_enabled; +} + /*********************************************************************** * getaddrinfo (ws2_32.@) */ @@ -169,6 +188,12 @@ int WINAPI getaddrinfo( const char *node, const char *service, if (node) { + if (eac_download_hack() && !strcmp(node, "download-alt.easyanticheat.net")) + { + SetLastError(WSAHOST_NOT_FOUND); + return WSAHOST_NOT_FOUND; + } + if (!node[0]) { if (!(fqdn = get_fqdn())) return WSA_NOT_ENOUGH_MEMORY; @@ -927,6 +952,12 @@ struct hostent * WINAPI gethostbyname( const char *name ) return NULL; } + if (eac_download_hack() && name && !strcmp(name, "download-alt.easyanticheat.net")) + { + SetLastError( WSAHOST_NOT_FOUND ); + return NULL; + } + if ((ret = WS_CALL( gethostname, ¶ms ))) { SetLastError( ret ); diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index c2345c1fa60..c61e91ba708 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -3106,17 +3106,51 @@ static test_setup tests [] = } }; +struct send_udp_thread_param +{ + int sock; + HANDLE start_event; +}; + +static DWORD WINAPI send_udp_thread( void *param ) +{ + struct send_udp_thread_param *p = param; + static const TIMEVAL timeout_zero = {0}; + static char buf[256]; + fd_set writefds; + unsigned int i; + int ret; + + WaitForSingleObject( p->start_event, INFINITE ); + for (i = 0; i < 256; ++i) + { + FD_ZERO(&writefds); + FD_SET(p->sock, &writefds); + ret = select( 1, NULL, &writefds, NULL, &timeout_zero ); + ok( ret == 1, "got %d, i %u.\n", ret, i ); + ret = send( p->sock, buf, sizeof(buf), 0 ); + ok( ret == sizeof(buf), "got %d, error %u, i %u.\n", ret, WSAGetLastError(), i ); + } + + return 0; +} + static void test_UDP(void) { /* This function tests UDP sendto() and recvfrom(). UDP is unreliable, so it is possible that this test fails due to dropped packets. */ /* peer 0 receives data from all other peers */ + static const TIMEVAL timeout_zero = {0}; struct sock_info peer[NUM_UDP_PEERS]; char buf[16]; int ss, i, n_recv, n_sent, ret; struct sockaddr_in addr; int sock; + struct send_udp_thread_param udp_thread_param; + HANDLE thread; + fd_set writefds; + memset (buf,0,sizeof(buf)); for ( i = NUM_UDP_PEERS - 1; i >= 0; i-- ) { @@ -3174,6 +3208,26 @@ static void test_UDP(void) ok( ret == sizeof(buf), "got %d, error %u.\n", ret, WSAGetLastError() ); } + /* Test sending packets in parallel (mostly a regression test for Wine async handling race conditions). */ + set_blocking( sock, FALSE ); + + udp_thread_param.sock = sock; + udp_thread_param.start_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + thread = CreateThread( NULL, 0, send_udp_thread, &udp_thread_param, 0, NULL ); + SetEvent( udp_thread_param.start_event ); + for (i = 0; i < 256; ++i) + { + ret = send( sock, buf, sizeof(buf), 0 ); + ok( ret == sizeof(buf), "got %d, error %u, i %u.\n", ret, WSAGetLastError(), i ); + FD_ZERO(&writefds); + FD_SET(sock, &writefds); + ret = select( 1, NULL, &writefds, NULL, &timeout_zero ); + ok( ret == 1, "got %d, i %u.\n", ret, i ); + } + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); + CloseHandle( udp_thread_param.start_event ); + closesocket(sock); } @@ -7918,6 +7972,7 @@ static void test_write_watch(void) ok( count == 9 || !count /* Win 11 */, "wrong count %Iu\n", count ); ok( !base[0], "data set\n" ); + base[0x1000] = 1; send(src, "test message", sizeof("test message"), 0); ret = GetOverlappedResult( (HANDLE)dest, &ov, &bytesReturned, TRUE ); @@ -7926,10 +7981,19 @@ static void test_write_watch(void) ok( !memcmp( base, "test ", 5 ), "wrong data %s\n", base ); ok( !memcmp( base + 0x4000, "message", 8 ), "wrong data %s\n", base + 0x4000 ); + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, " GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine_if( count == 3 ) ok( count == 1, "wrong count %Iu\n", count ); + todo_wine_if( count == 3 ) ok( results[0] == base + 0x1000, "got page %Iu.\n", ((char *)results[0] - base) / 0x1000 ); + + base[0x2000] = 1; count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 4 ) ok( count == 2, "wrong count %Iu\n", count ); + todo_wine_if( count == 4 ) ok( results[0] == base + 0x1000, "got page %Iu.\n", ((char *)results[0] - base) / 0x1000 ); + todo_wine_if( count == 4 ) ok( results[1] == base + 0x2000, "got page %Iu.\n", ((char *)results[1] - base) / 0x1000 ); memset( base, 0, size ); count = 64; @@ -7960,7 +8024,7 @@ static void test_write_watch(void) count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 2 ) ok( count == 0, "wrong count %Iu\n", count ); memset( base, 0, size ); count = 64; @@ -7989,7 +8053,7 @@ static void test_write_watch(void) count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 1 ) ok( count == 0, "wrong count %Iu\n", count ); } WSACloseEvent( event ); closesocket( dest ); diff --git a/dlls/x3daudio1_0/Makefile.in b/dlls/x3daudio1_0/Makefile.in index d3c2cbe6743..ab5af4ac64c 100644 --- a/dlls/x3daudio1_0/Makefile.in +++ b/dlls/x3daudio1_0/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_1/Makefile.in b/dlls/x3daudio1_1/Makefile.in index 8dfccce11d8..6b25e3909d4 100644 --- a/dlls/x3daudio1_1/Makefile.in +++ b/dlls/x3daudio1_1/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_2/Makefile.in b/dlls/x3daudio1_2/Makefile.in index 699aac41317..150028ad434 100644 --- a/dlls/x3daudio1_2/Makefile.in +++ b/dlls/x3daudio1_2/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_3/Makefile.in b/dlls/x3daudio1_3/Makefile.in index 093fe118089..c87c19da479 100644 --- a/dlls/x3daudio1_3/Makefile.in +++ b/dlls/x3daudio1_3/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_4/Makefile.in b/dlls/x3daudio1_4/Makefile.in index c67d6535a4d..a3319b81c87 100644 --- a/dlls/x3daudio1_4/Makefile.in +++ b/dlls/x3daudio1_4/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_5/Makefile.in b/dlls/x3daudio1_5/Makefile.in index 471e2c6b052..3b548bf9548 100644 --- a/dlls/x3daudio1_5/Makefile.in +++ b/dlls/x3daudio1_5/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_6/Makefile.in b/dlls/x3daudio1_6/Makefile.in index 7fb6f052729..956c3691204 100644 --- a/dlls/x3daudio1_6/Makefile.in +++ b/dlls/x3daudio1_6/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in index fd22a260f07..b906e9146a5 100644 --- a/dlls/x3daudio1_7/Makefile.in +++ b/dlls/x3daudio1_7/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/xactengine2_0/Makefile.in b/dlls/xactengine2_0/Makefile.in index 2064afadc3d..ea57370f978 100644 --- a/dlls/xactengine2_0/Makefile.in +++ b/dlls/xactengine2_0/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0200 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_4/Makefile.in b/dlls/xactengine2_4/Makefile.in index b61774d6693..4771318e118 100644 --- a/dlls/xactengine2_4/Makefile.in +++ b/dlls/xactengine2_4/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0204 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_7/Makefile.in b/dlls/xactengine2_7/Makefile.in index bd91161fd2c..faae6a20d47 100644 --- a/dlls/xactengine2_7/Makefile.in +++ b/dlls/xactengine2_7/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0207 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_9/Makefile.in b/dlls/xactengine2_9/Makefile.in index 10e0578a82c..016efa9c76f 100644 --- a/dlls/xactengine2_9/Makefile.in +++ b/dlls/xactengine2_9/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0209 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in index b944a7d5a7a..a52a282fdf2 100644 --- a/dlls/xactengine3_0/Makefile.in +++ b/dlls/xactengine3_0/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0300 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in index 410ac6ce4f2..6f2466d7f25 100644 --- a/dlls/xactengine3_1/Makefile.in +++ b/dlls/xactengine3_1/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0301 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in index 32d855dd2c3..70c3491ce4a 100644 --- a/dlls/xactengine3_2/Makefile.in +++ b/dlls/xactengine3_2/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0302 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in index 650b577a16c..47795dcdf61 100644 --- a/dlls/xactengine3_3/Makefile.in +++ b/dlls/xactengine3_3/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0303 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in index 1fad4f2f4c4..fa459af88ca 100644 --- a/dlls/xactengine3_4/Makefile.in +++ b/dlls/xactengine3_4/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0304 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in index 1e74124da75..bb1a25e9ca0 100644 --- a/dlls/xactengine3_5/Makefile.in +++ b/dlls/xactengine3_5/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0305 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in index 12861dbfad9..3bc68714461 100644 --- a/dlls/xactengine3_6/Makefile.in +++ b/dlls/xactengine3_6/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0306 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in index e9b815b9b6a..8883b860c1c 100644 --- a/dlls/xactengine3_7/Makefile.in +++ b/dlls/xactengine3_7/Makefile.in @@ -3,6 +3,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0307 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xapofx1_1/Makefile.in b/dlls/xapofx1_1/Makefile.in index 81e2e5ae95b..19ca4c103b3 100644 --- a/dlls/xapofx1_1/Makefile.in +++ b/dlls/xapofx1_1/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ xapo.c \ diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in index 63534142460..88532c05aa4 100644 --- a/dlls/xapofx1_2/Makefile.in +++ b/dlls/xapofx1_2/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xapofx1_3/Makefile.in b/dlls/xapofx1_3/Makefile.in index e0c2a17f9e2..49223bf9504 100644 --- a/dlls/xapofx1_3/Makefile.in +++ b/dlls/xapofx1_3/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ xapo.c \ diff --git a/dlls/xapofx1_4/Makefile.in b/dlls/xapofx1_4/Makefile.in index 43dde8f047e..19881955d1c 100644 --- a/dlls/xapofx1_4/Makefile.in +++ b/dlls/xapofx1_4/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xapofx1_5/Makefile.in b/dlls/xapofx1_5/Makefile.in index fb534286626..d3586b26d34 100644 --- a/dlls/xapofx1_5/Makefile.in +++ b/dlls/xapofx1_5/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xaudio2_0/Makefile.in b/dlls/xaudio2_0/Makefile.in index 64a0efd3925..b7b969445df 100644 --- a/dlls/xaudio2_0/Makefile.in +++ b/dlls/xaudio2_0/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in index ebfe545f31e..0b5a7c148b0 100644 --- a/dlls/xaudio2_1/Makefile.in +++ b/dlls/xaudio2_1/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_2/Makefile.in b/dlls/xaudio2_2/Makefile.in index 3bc76019aff..7daefa0d1d7 100644 --- a/dlls/xaudio2_2/Makefile.in +++ b/dlls/xaudio2_2/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_3/Makefile.in b/dlls/xaudio2_3/Makefile.in index dec87cf0bcd..bbb5796f3fc 100644 --- a/dlls/xaudio2_3/Makefile.in +++ b/dlls/xaudio2_3/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in index 37c0a361a7a..4ceba7d7145 100644 --- a/dlls/xaudio2_4/Makefile.in +++ b/dlls/xaudio2_4/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_5/Makefile.in b/dlls/xaudio2_5/Makefile.in index 75ec4a32d4e..39bc137f5a3 100644 --- a/dlls/xaudio2_5/Makefile.in +++ b/dlls/xaudio2_5/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_6/Makefile.in b/dlls/xaudio2_6/Makefile.in index ba84d189fc4..5cbb89528e0 100644 --- a/dlls/xaudio2_6/Makefile.in +++ b/dlls/xaudio2_6/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in index 0d88bfe6dd3..f219420bda2 100644 --- a/dlls/xaudio2_7/Makefile.in +++ b/dlls/xaudio2_7/Makefile.in @@ -3,6 +3,8 @@ MODULE = xaudio2_7.dll IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c \ xapo.c \ diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 2b3102d21fe..70d9ec78aee 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -837,7 +837,9 @@ static void test_submix(IXAudio2 *xa) HRESULT hr; IXAudio2MasteringVoice *master; XAUDIO2_VOICE_DETAILS details; - IXAudio2SubmixVoice *sub; + IXAudio2SubmixVoice *sub, *sub2; + XAUDIO2_SEND_DESCRIPTOR send_desc = { 0 }; + XAUDIO2_VOICE_SENDS sends = {1, &send_desc }; IXAudio2_StopEngine(xa); @@ -855,6 +857,26 @@ static void test_submix(IXAudio2 *xa) ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels); ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate); + hr = IXAudio2_CreateSubmixVoice(xa, &sub2, 2, 44100, 0, 0, NULL, NULL); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + send_desc.pOutputVoice = (IXAudio2Voice *)sub2; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + IXAudio2SubmixVoice_DestroyVoice(sub2); + IXAudio2SubmixVoice_GetVoiceDetails(sub2, &details); + + sends.SendCount = 0; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + IXAudio2SubmixVoice_DestroyVoice(sub2); + if (0) + { + IXAudio2SubmixVoice_GetVoiceDetails(sub2, &details); + } + IXAudio2SubmixVoice_DestroyVoice(sub); IXAudio2MasteringVoice_DestroyVoice(master); } diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index b821e9667b7..a58beb7b538 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -499,7 +499,11 @@ static const FAudioEngineCallback FAudioEngineCallback_Vtbl = { static inline void destroy_voice(XA2VoiceImpl *This) { - FAudioVoice_DestroyVoice(This->faudio_voice); + if (FAILED(FAudioVoice_DestroyVoiceSafeEXT(This->faudio_voice))) + { + ERR("Destroying voice %p failed.\n", This); + return; + } free_effect_chain(This->effect_chain); This->effect_chain = NULL; This->in_use = FALSE; diff --git a/dlls/xaudio2_8/Makefile.in b/dlls/xaudio2_8/Makefile.in index b5406fe7fd0..f4a15960e2e 100644 --- a/dlls/xaudio2_8/Makefile.in +++ b/dlls/xaudio2_8/Makefile.in @@ -5,6 +5,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c \ xapo.c \ diff --git a/dlls/xaudio2_9/Makefile.in b/dlls/xaudio2_9/Makefile.in index 1db3ea4e9c0..9dd1795006b 100644 --- a/dlls/xaudio2_9/Makefile.in +++ b/dlls/xaudio2_9/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ x3daudio.c \ diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index e69553fba16..594010f8770 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -122,19 +122,8 @@ static struct xinput_controller controllers[XUSER_MAX_COUNT] = static HMODULE xinput_instance; static HANDLE start_event; static HANDLE update_event; - -static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) -{ - int i; - - *free_slot = XUSER_MAX_COUNT; - for (i = XUSER_MAX_COUNT; i > 0; i--) - { - if (!controllers[i - 1].device) *free_slot = i - 1; - else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; - } - return FALSE; -} +static HANDLE steam_overlay_event; +static HANDLE steam_keyboard_event; static void check_value_caps(struct xinput_controller *controller, USHORT usage, HIDP_VALUE_CAPS *caps) { @@ -337,7 +326,40 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO return ERROR_SUCCESS; } -static void controller_destroy(struct xinput_controller *controller, BOOL already_removed); +static void controller_disable(struct xinput_controller *controller) +{ + XINPUT_VIBRATION state = {0}; + + if (!controller->enabled) return; + if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); + controller->enabled = FALSE; + + CancelIoEx(controller->device, &controller->hid.read_ovl); + WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE); + SetEvent(update_event); +} + +static void controller_destroy(struct xinput_controller *controller, BOOL already_removed) +{ + EnterCriticalSection(&controller->crit); + + if (controller->device) + { + TRACE("removing device %s from index %Iu\n", debugstr_w(controller->device_path), controller - controllers); + + if (!already_removed) controller_disable(controller); + CloseHandle(controller->device); + controller->device = NULL; + + free(controller->hid.input_report_buf); + free(controller->hid.output_report_buf); + free(controller->hid.feature_report_buf); + HidD_FreePreparsedData(controller->hid.preparsed); + memset(&controller->hid, 0, sizeof(controller->hid)); + } + + LeaveCriticalSection(&controller->crit); +} static void controller_enable(struct xinput_controller *controller) { @@ -357,19 +379,6 @@ static void controller_enable(struct xinput_controller *controller) else SetEvent(update_event); } -static void controller_disable(struct xinput_controller *controller) -{ - XINPUT_VIBRATION state = {0}; - - if (!controller->enabled) return; - if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); - controller->enabled = FALSE; - - CancelIoEx(controller->device, &controller->hid.read_ovl); - WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE); - SetEvent(update_event); -} - static BOOL controller_init(struct xinput_controller *controller, PHIDP_PREPARSED_DATA preparsed, HIDP_CAPS *caps, HANDLE device, const WCHAR *device_path) { @@ -453,21 +462,17 @@ static BOOL device_is_overridden(HANDLE device) return disable; } -static BOOL try_add_device(const WCHAR *device_path) +static void open_device_at_index(const WCHAR *device_path, int index) { SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; PHIDP_PREPARSED_DATA preparsed; HIDP_CAPS caps; NTSTATUS status; HANDLE device; - int i; - - if (find_opened_device(device_path, &i)) return TRUE; /* already opened */ - if (i == XUSER_MAX_COUNT) return FALSE; /* no more slots */ device = CreateFileW(device_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); - if (device == INVALID_HANDLE_VALUE) return TRUE; + if (device == INVALID_HANDLE_VALUE) return; preparsed = NULL; if (!HidD_GetPreparsedData(device, &preparsed)) @@ -481,13 +486,60 @@ static BOOL try_add_device(const WCHAR *device_path) WARN("ignoring HID device, unsupported usage %04x:%04x\n", caps.UsagePage, caps.Usage); else if (device_is_overridden(device)) WARN("ignoring HID device, overridden for dinput\n"); - else if (!controller_init(&controllers[i], preparsed, &caps, device, device_path)) + else if (!controller_init(&controllers[index], preparsed, &caps, device, device_path)) WARN("ignoring HID device, failed to initialize\n"); else - return TRUE; + { + TRACE("opened device %s at index %u\n", debugstr_w(device_path), index); + return; + } CloseHandle(device); HidD_FreePreparsedData(preparsed); +} + +static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) +{ + int i; + + *free_slot = XUSER_MAX_COUNT; + for (i = XUSER_MAX_COUNT; i > 0; i--) + { + if (!controllers[i - 1].device) *free_slot = i - 1; + else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; + } + + /* CW-Bug-Id: #20528 Keep steam virtual controller ordered, swap existing controllers out of the slot */ + if ((swscanf(device_path, L"\\\\?\\hid#vid_045e&pid_028e&xi_%02x#", &i) == 1 || + swscanf(device_path, L"\\\\?\\HID#VID_045E&PID_028E&XI_%02X#", &i) == 1) && + i > 0 && i <= XUSER_MAX_COUNT && *free_slot != i - 1) + { + controller_destroy(&controllers[i - 1], TRUE); + if (*free_slot != XUSER_MAX_COUNT) open_device_at_index(controllers[i - 1].device_path, *free_slot); + *free_slot = i - 1; + } + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if ((swscanf(device_path, L"\\\\?\\hid#vid_28de&pid_11ff&xi_%02u#", &i) == 1 || + swscanf(device_path, L"\\\\?\\HID#VID_28DE&PID_11FF&XI_%02u#", &i) == 1) && + i < XUSER_MAX_COUNT && *free_slot != i) + { + controller_destroy(&controllers[i], TRUE); + if (*free_slot != XUSER_MAX_COUNT) open_device_at_index(controllers[i].device_path, *free_slot); + *free_slot = i; + } + + return FALSE; +} + +static BOOL try_add_device(const WCHAR *device_path) +{ + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; + int i; + + if (find_opened_device(device_path, &i)) return TRUE; /* already opened */ + if (i == XUSER_MAX_COUNT) return FALSE; /* no more slots */ + open_device_at_index(device_path, i); return TRUE; } @@ -525,26 +577,6 @@ static void update_controller_list(void) SetupDiDestroyDeviceInfoList(set); } -static void controller_destroy(struct xinput_controller *controller, BOOL already_removed) -{ - EnterCriticalSection(&controller->crit); - - if (controller->device) - { - if (!already_removed) controller_disable(controller); - CloseHandle(controller->device); - controller->device = NULL; - - free(controller->hid.input_report_buf); - free(controller->hid.output_report_buf); - free(controller->hid.feature_report_buf); - HidD_FreePreparsedData(controller->hid.preparsed); - memset(&controller->hid, 0, sizeof(controller->hid)); - } - - LeaveCriticalSection(&controller->crit); -} - static LONG sign_extend(ULONG value, const HIDP_VALUE_CAPS *caps) { UINT sign = 1 << (caps->BitSize - 1); @@ -741,6 +773,9 @@ static BOOL WINAPI start_update_thread_once( INIT_ONCE *once, void *param, void if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (void*)hid_update_thread_proc, &module)) WARN("Failed to increase module's reference count, error: %lu\n", GetLastError()); + steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); + steam_keyboard_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_KeyboardActivated"); + start_event = CreateEventA(NULL, FALSE, FALSE, NULL); if (!start_event) ERR("failed to create start event, error %lu\n", GetLastError()); @@ -827,7 +862,9 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION *vib if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; - ret = HID_set_state(&controllers[index], vibration); + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0) ret = ERROR_SUCCESS; + else if (WaitForSingleObject(steam_keyboard_event, 0) == WAIT_OBJECT_0) ret = ERROR_SUCCESS; + else ret = HID_set_state(&controllers[index], vibration); controller_unlock(&controllers[index]); @@ -845,7 +882,10 @@ static DWORD xinput_get_state(DWORD index, XINPUT_STATE *state) if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; - *state = controllers[index].state; + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0) memset(state, 0, sizeof(*state)); + else if (WaitForSingleObject(steam_keyboard_event, 0) == WAIT_OBJECT_0) memset(state, 0, sizeof(*state)); + else *state = controllers[index].state; + controller_unlock(&controllers[index]); return ERROR_SUCCESS; @@ -1086,25 +1126,15 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetKeystroke(DWORD index, DWORD reserved, P DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilities(DWORD index, DWORD flags, XINPUT_CAPABILITIES *capabilities) { - TRACE("index %lu, flags %#lx, capabilities %p.\n", index, flags, capabilities); - - start_update_thread(); - - if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; - - if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; - - if (flags & XINPUT_FLAG_GAMEPAD && controllers[index].caps.SubType != XINPUT_DEVSUBTYPE_GAMEPAD) - { - controller_unlock(&controllers[index]); - return ERROR_DEVICE_NOT_CONNECTED; - } + XINPUT_CAPABILITIES_EX caps_ex; + DWORD ret; - memcpy(capabilities, &controllers[index].caps, sizeof(*capabilities)); + TRACE("index %lu, flags %#lx, capabilities %p.\n", index, flags, capabilities); - controller_unlock(&controllers[index]); + ret = XInputGetCapabilitiesEx(0, index, flags, &caps_ex); + if (!ret) *capabilities = caps_ex.Capabilities; - return ERROR_SUCCESS; + return ret; } DWORD WINAPI DECLSPEC_HOTPATCH XInputGetDSoundAudioDeviceGuids(DWORD index, GUID *render_guid, GUID *capture_guid) @@ -1129,3 +1159,35 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetBatteryInformation(DWORD index, BYTE typ return ERROR_NOT_SUPPORTED; } + +DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilitiesEx(DWORD unk, DWORD index, DWORD flags, XINPUT_CAPABILITIES_EX *caps) +{ + DWORD ret = ERROR_SUCCESS; + HIDD_ATTRIBUTES attr; + + TRACE("unk %lu, index %lu, flags %#lx, capabilities %p.\n", unk, index, flags, caps); + + start_update_thread(); + + if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; + + if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; + + if (flags & XINPUT_FLAG_GAMEPAD && controllers[index].caps.SubType != XINPUT_DEVSUBTYPE_GAMEPAD) + ret = ERROR_DEVICE_NOT_CONNECTED; + else if (!HidD_GetAttributes(controllers[index].device, &attr)) + ret = ERROR_DEVICE_NOT_CONNECTED; + else + { + caps->Capabilities = controllers[index].caps; + caps->VendorId = attr.VendorID; + caps->ProductId = attr.ProductID; + caps->VersionNumber = attr.VersionNumber; + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + caps->unk2 = index; + } + + controller_unlock(&controllers[index]); + + return ret; +} diff --git a/dlls/xinput1_4/xinput1_4.spec b/dlls/xinput1_4/xinput1_4.spec index 8c3f4c0cd73..22c511237dd 100644 --- a/dlls/xinput1_4/xinput1_4.spec +++ b/dlls/xinput1_4/xinput1_4.spec @@ -7,3 +7,4 @@ 8 stdcall XInputGetKeystroke(long long ptr) 10 stub XInputGetAudioDeviceIds(long ptr ptr ptr ptr) 100 stdcall XInputGetStateEx(long ptr) +108 stdcall XInputGetCapabilitiesEx(long long long ptr) diff --git a/include/Makefile.in b/include/Makefile.in index d4a166e265c..7149a364db8 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -345,6 +345,7 @@ SOURCES = \ highlevelmonitorconfigurationapi.h \ hlguids.h \ hlink.idl \ + holographicspaceinterop.idl \ hrtfapoapi.idl \ hstring.idl \ htiface.idl \ diff --git a/include/appmodel.h b/include/appmodel.h index 8c219e8080a..cab001f60c7 100644 --- a/include/appmodel.h +++ b/include/appmodel.h @@ -89,6 +89,10 @@ LONG WINAPI AppPolicyGetProcessTerminationMethod(HANDLE token, AppPolicyProcessT LONG WINAPI AppPolicyGetShowDeveloperDiagnostic(HANDLE token, AppPolicyShowDeveloperDiagnostic *policy); LONG WINAPI AppPolicyGetThreadInitializationType(HANDLE token, AppPolicyThreadInitializationType *policy); LONG WINAPI AppPolicyGetWindowingModel(HANDLE processToken, AppPolicyWindowingModel *policy); +LONG WINAPI GetPackagePath(const PACKAGE_ID *package_id, const UINT32 reserved, UINT32 *length, WCHAR *path); +LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, + UINT32 *buffer_length, WCHAR *buffer); +LONG WINAPI PackageFullNameFromId(const PACKAGE_ID *package_id, UINT32 *length, WCHAR *full_name); LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 *buffer_length, BYTE *buffer); #if defined(__cplusplus) diff --git a/include/bcrypt.h b/include/bcrypt.h index 7f768f61679..11a607f9f61 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -58,6 +58,7 @@ typedef LONG NTSTATUS; #define BCRYPT_PADDING_SCHEMES L"PaddingSchemes" #define BCRYPT_PROVIDER_HANDLE L"ProviderHandle" #define BCRYPT_SIGNATURE_LENGTH L"SignatureLength" +#define BCRYPT_PUBLIC_KEY_LENGTH L"PublicKeyLength" #define BCRYPT_OPAQUE_KEY_BLOB L"OpaqueKeyBlob" #define BCRYPT_KEY_DATA_BLOB L"KeyDataBlob" @@ -118,6 +119,8 @@ typedef LONG NTSTATUS; #define BCRYPT_KDF_TLS_PRF L"TLS_PRF" #define BCRYPT_KDF_SP80056A_CONCAT L"SP800_56A_CONCAT" #define BCRYPT_KDF_RAW_SECRET L"TRUNCATE" + +#define BCRYPT_DH_PARAMETERS L"DHParameters" #else static const WCHAR BCRYPT_ALGORITHM_NAME[] = {'A','l','g','o','r','i','t','h','m','N','a','m','e',0}; static const WCHAR BCRYPT_AUTH_TAG_LENGTH[] = {'A','u','t','h','T','a','g','L','e','n','g','t','h',0}; @@ -136,6 +139,7 @@ static const WCHAR BCRYPT_OBJECT_LENGTH[] = {'O','b','j','e','c','t','L','e','n' static const WCHAR BCRYPT_PADDING_SCHEMES[] = {'P','a','d','d','i','n','g','S','c','h','e','m','e','s',0}; static const WCHAR BCRYPT_PROVIDER_HANDLE[] = {'P','r','o','v','i','d','e','r','H','a','n','d','l','e',0}; static const WCHAR BCRYPT_SIGNATURE_LENGTH[] = {'S','i','g','n','a','t','u','r','e','L','e','n','g','t','h',0}; +static const WCHAR BCRYPT_PUBLIC_KEY_LENGTH[] = {'P','u','b','l','i','c','K','e','y','L','e','n','g','t','h',0}; static const WCHAR BCRYPT_OPAQUE_KEY_BLOB[] = {'O','p','a','q','u','e','K','e','y','B','l','o','b',0}; static const WCHAR BCRYPT_KEY_DATA_BLOB[] = {'K','e','y','D','a','t','a','B','l','o','b',0}; @@ -198,6 +202,7 @@ static const WCHAR BCRYPT_KDF_HMAC[] = {'H','M','A','C',0}; static const WCHAR BCRYPT_KDF_TLS_PRF[] = {'T','L','S','_','P','R','F',0}; static const WCHAR BCRYPT_KDF_SP80056A_CONCAT[] = {'S','P','8','0','0','_','5','6','A','_','C','O','N','C','A','T',0}; static const WCHAR BCRYPT_KDF_RAW_SECRET[] = {'T','R','U','N','C','A','T','E',0}; +#define BCRYPT_DH_PARAMETERS u"DHParameters" #endif #define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345 @@ -398,6 +403,15 @@ typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER ULONG cbKeyData; } BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER; +typedef struct _BCRYPT_DH_PARAMETER_HEADER +{ + ULONG cbLength; + ULONG dwMagic; + ULONG cbKeyLength; +} BCRYPT_DH_PARAMETER_HEADER; + +#define BCRYPT_DH_PARAMETERS_MAGIC 0x4d504844 + #define KDF_HASH_ALGORITHM 0x00000000 #define KDF_SECRET_PREPEND 0x00000001 #define KDF_SECRET_APPEND 0x00000002 diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index a0bb89a2a67..ee1846b0e97 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -26,6 +26,7 @@ #endif #include +#include /* cfgmgr32 doesn't use the normal convention, it adds an underscore before A/W */ #ifdef WINE_NO_UNICODE_MACROS @@ -312,6 +313,7 @@ CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_ExW(PCWSTR,PWCHAR,ULONG,ULONG,HMACH #define CM_Get_Device_ID_List_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Ex) CMAPI CONFIGRET WINAPI CM_Get_Device_ID_Size(PULONG,DEVINST,ULONG); CMAPI CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex(PULONG,DEVINST,ULONG,HMACHINE); +CMAPI CONFIGRET WINAPI CM_Get_Device_Interface_PropertyW(LPCWSTR,const DEVPROPKEY*,DEVPROPTYPE*,PBYTE,PULONG,ULONG); CMAPI CONFIGRET WINAPI CM_Get_DevNode_Status(PULONG,PULONG,DEVINST,ULONG); CMAPI CONFIGRET WINAPI CM_Get_DevNode_Status_Ex(PULONG,PULONG,DEVINST,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_Sibling(PDEVINST,DEVINST,ULONG); diff --git a/include/config.h.in b/include/config.h.in deleted file mode 100644 index cda76fcfe2e..00000000000 --- a/include/config.h.in +++ /dev/null @@ -1,836 +0,0 @@ -/* include/config.h.in. Generated from configure.ac by autoheader. */ - -#ifndef __WINE_CONFIG_H -#define __WINE_CONFIG_H - -/* Define to the file extension for executables. */ -#undef EXEEXT - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_NAMESER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_USER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CAPI20_H - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_CL_CL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUPS_CUPS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUPS_PPD_H - -/* Define to 1 if you have the `dladdr1' function. */ -#undef HAVE_DLADDR1 - -/* Define to 1 if you have the `dlinfo' function. */ -#undef HAVE_DLINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_EGL_EGL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ELF_H - -/* Define to 1 if you have the `epoll_create' function. */ -#undef HAVE_EPOLL_CREATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define if FreeType 2 is installed */ -#undef HAVE_FREETYPE - -/* Define to 1 if you have the `fstatfs' function. */ -#undef HAVE_FSTATFS - -/* Define to 1 if you have the header file. */ -#undef HAVE_FT2BUILD_H - -/* Define to 1 if the system has the type `FT_TrueTypeEngineType'. */ -#undef HAVE_FT_TRUETYPEENGINETYPE - -/* Define to 1 if you have the `futimens' function. */ -#undef HAVE_FUTIMENS - -/* Define to 1 if you have the `futimes' function. */ -#undef HAVE_FUTIMES - -/* Define to 1 if you have the `futimesat' function. */ -#undef HAVE_FUTIMESAT - -/* Define to 1 if you have the `getaddrinfo' function. */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if you have the `getattrlist' function. */ -#undef HAVE_GETATTRLIST - -/* Define to 1 if you have the `getauxval' function. */ -#undef HAVE_GETAUXVAL - -/* Define to 1 if you have the `getifaddrs' function. */ -#undef HAVE_GETIFADDRS - -/* Define to 1 if you have the `getrandom' function. */ -#undef HAVE_GETRANDOM - -/* Define to 1 if you have the header file. */ -#undef HAVE_GETTEXT_PO_H - -/* Define to 1 if you have the `gnutls_cipher_init' function. */ -#undef HAVE_GNUTLS_CIPHER_INIT - -/* Define if we have the libgphoto2_port development environment */ -#undef HAVE_GPHOTO2_PORT - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_EXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IFADDRS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `kqueue' function. */ -#undef HAVE_KQUEUE - -/* Define to 1 if you have the header file. */ -#undef HAVE_KRB5_KRB5_H - -/* Define to 1 if you have the `gettextpo' library (-lgettextpo). */ -#undef HAVE_LIBGETTEXTPO - -/* Define to 1 if you have the `procstat' library (-lprocstat). */ -#undef HAVE_LIBPROCSTAT - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBPROCSTAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBPROC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBUDEV_H - -/* Define to 1 if you have the `unwind' library (-lunwind). */ -#undef HAVE_LIBUNWIND - -/* Define if you have the X Shape extension */ -#undef HAVE_LIBXSHAPE - -/* Define if you have the X Shm extension */ -#undef HAVE_LIBXXSHM - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CAPI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CDROM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_FILTER_H - -/* Define if Linux-style gethostbyname_r and gethostbyaddr_r are available */ -#undef HAVE_LINUX_GETHOSTBYNAME_R_6 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_HDREG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_HIDRAW_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_INPUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IPX_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IRDA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_RTNETLINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_SERIAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_UCDROM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_VIDEODEV2_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_WIRELESS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LWP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_CPU_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_SYSARCH_H - -/* Define to 1 if you have the `mach_continuous_time' function. */ -#undef HAVE_MACH_CONTINUOUS_TIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_O_LOADER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MNTENT_H - -/* Define if MTLDevice protocol has registryID property. */ -#undef HAVE_MTLDEVICE_REGISTRYID - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET6_IP6_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_ICMP6_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_ICMP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IF_ETHER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_PCB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_SYSTM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_ICMP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_FSM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_UDP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_UDP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETIPX_IPX_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_ARP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_DL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_ROUTE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENCL_OPENCL_H - -/* Define to 1 if `numaudioengines' is a member of `oss_sysinfo'. */ -#undef HAVE_OSS_SYSINFO_NUMAUDIOENGINES - -/* Define to 1 if you have the header file. */ -#undef HAVE_PCAP_PCAP_H - -/* Define to 1 if you have the `pipe2' function. */ -#undef HAVE_PIPE2 - -/* Define to 1 if you have the `port_create' function. */ -#undef HAVE_PORT_CREATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_PORT_H - -/* Define to 1 if you have the `posix_fadvise' function. */ -#undef HAVE_POSIX_FADVISE - -/* Define to 1 if you have the `posix_fallocate' function. */ -#undef HAVE_POSIX_FALLOCATE - -/* Define to 1 if you have the `prctl' function. */ -#undef HAVE_PRCTL - -/* Define to 1 if you have the `proc_pidinfo' function. */ -#undef HAVE_PROC_PIDINFO - -/* Define to 1 if you have the `pthread_getthreadid_np' function. */ -#undef HAVE_PTHREAD_GETTHREADID_NP - -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_NP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if the system has the type `request_sense'. */ -#undef HAVE_REQUEST_SENSE - -/* Define if you have the resolver library and header */ -#undef HAVE_RESOLV - -/* Define to 1 if you have the header file. */ -#undef HAVE_RESOLV_H - -/* Define to 1 if you have the `res_getservers' function. */ -#undef HAVE_RES_GETSERVERS - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `sched_setaffinity' function. */ -#undef HAVE_SCHED_SETAFFINITY - -/* Define to 1 if you have the `sched_yield' function. */ -#undef HAVE_SCHED_YIELD - -/* Define to 1 if `cmd' is a member of `scsireq_t'. */ -#undef HAVE_SCSIREQ_T_CMD - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SCSI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SCSI_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SDL_H - -/* Define to 1 if you have the `setproctitle' function. */ -#undef HAVE_SETPROCTITLE - -/* Define to 1 if you have the `setprogname' function. */ -#undef HAVE_SETPROGNAME - -/* Define to 1 if `interface_id' is a member of `sg_io_hdr_t'. */ -#undef HAVE_SG_IO_HDR_T_INTERFACE_ID - -/* Define to 1 if `si_fd' is a member of `siginfo_t'. */ -#undef HAVE_SIGINFO_T_SI_FD - -/* Define to 1 if you have the `sigprocmask' function. */ -#undef HAVE_SIGPROCMASK - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if `icp6s_error' is a member of `struct icmp6stat'. */ -#undef HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR - -/* Define to 1 if `icps_error' is a member of `struct icmpstat'. */ -#undef HAVE_STRUCT_ICMPSTAT_ICPS_ERROR - -/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */ -#undef HAVE_STRUCT_IFREQ_IFR_HWADDR - -/* Define to 1 if `ipi6_addr' is a member of `struct in6_pktinfo'. */ -#undef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR - -/* Define to 1 if `ip6s_total' is a member of `struct ip6stat'. */ -#undef HAVE_STRUCT_IP6STAT_IP6S_TOTAL - -/* Define to 1 if `ips_total' is a member of `struct ipstat'. */ -#undef HAVE_STRUCT_IPSTAT_IPS_TOTAL - -/* Define to 1 if `ips_total' is a member of `struct ip_stats'. */ -#undef HAVE_STRUCT_IP_STATS_IPS_TOTAL - -/* Define to 1 if `msg_accrights' is a member of `struct msghdr'. */ -#undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS - -/* Define to 1 if `mt_blkno' is a member of `struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_BLKNO - -/* Define to 1 if `mt_blksiz' is a member of `struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_BLKSIZ - -/* Define to 1 if `mt_gstat' is a member of `struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_GSTAT - -/* Define to 1 if `sin6_scope_id' is a member of `struct sockaddr_in6'. */ -#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID - -/* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */ -#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN - -/* Define to 1 if `st_atim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIM - -/* Define to 1 if `st_atimespec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIMESPEC - -/* Define to 1 if `st_birthtim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIM - -/* Define to 1 if `st_birthtime' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIME - -/* Define to 1 if `st_birthtimespec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC - -/* Define to 1 if `st_ctim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_CTIM - -/* Define to 1 if `st_ctimespec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_CTIMESPEC - -/* Define to 1 if `st_mtim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIM - -/* Define to 1 if `st_mtimespec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIMESPEC - -/* Define to 1 if `__st_birthtim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT___ST_BIRTHTIM - -/* Define to 1 if `__st_birthtime' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT___ST_BIRTHTIME - -/* Define to 1 if `mem_unit' is a member of `struct sysinfo'. */ -#undef HAVE_STRUCT_SYSINFO_MEM_UNIT - -/* Define to 1 if `totalram' is a member of `struct sysinfo'. */ -#undef HAVE_STRUCT_SYSINFO_TOTALRAM - -/* Define to 1 if `tcps_connattempt' is a member of `struct tcpstat'. */ -#undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT - -/* Define to 1 if `tcps_connattempt' is a member of `struct tcp_stats'. */ -#undef HAVE_STRUCT_TCP_STATS_TCPS_CONNATTEMPT - -/* Define to 1 if `udps_ipackets' is a member of `struct udpstat'. */ -#undef HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS - -/* Define to 1 if the system has the type `struct xinpgen'. */ -#undef HAVE_STRUCT_XINPGEN - -/* Define to 1 if `_u._ext.nscount6' is a member of `struct __res_state'. */ -#undef HAVE_STRUCT___RES_STATE__U__EXT_NSCOUNT6 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSCALL_H - -/* Define to 1 if you have the `sysinfo' function. */ -#undef HAVE_SYSINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ATTR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_AUXV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_CDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_CONF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EPOLL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EVENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EXTATTR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FILIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_INOTIFY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IPC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_LINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MODEM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MOUNT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MTIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PTRACE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_QUEUE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RANDOM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SCSIIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SHM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SIGNAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKETVAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STATFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STATVFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STRTIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCALL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSINFO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_THR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UCONTEXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_USER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UTSNAME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VNODE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_XATTR_H - -/* Define to 1 if you have the `tcdrain' function. */ -#undef HAVE_TCDRAIN - -/* Define to 1 if you have the `thr_kill2' function. */ -#undef HAVE_THR_KILL2 - -/* Define to 1 if you have the `udev' library (-ludev). */ -#undef HAVE_UDEV - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_MEMCHECK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_VALGRIND_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_SHAPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XF86VMODE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XF86VMPROTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XFIXES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XINERAMA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XINPUT2_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XRANDR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XRENDER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XSHM_H - -/* Define to 1 if `xcookie' is a member of `XEvent'. */ -#undef HAVE_XEVENT_XCOOKIE - -/* Define to 1 if `callback' is a member of `XICCallback'. */ -#undef HAVE_XICCALLBACK_CALLBACK - -/* Define to 1 if you have the header file. */ -#undef HAVE_XKBCOMMON_XKBCOMMON_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_XKBCOMMON_XKBREGISTRY_H - -/* Define if Xrender has the XRenderCreateLinearGradient function */ -#undef HAVE_XRENDERCREATELINEARGRADIENT - -/* Define if Xrender has the XRenderSetPictureTransform function */ -#undef HAVE_XRENDERSETPICTURETRANSFORM - -/* Define if Xrandr has the XRRGetProviderResources function */ -#undef HAVE_XRRGETPROVIDERRESOURCES - -/* Define to 1 if you have the `__builtin_popcount' built-in function. */ -#undef HAVE___BUILTIN_POPCOUNT - -/* Define to 1 if you have the `__clear_cache' (potentially built-in) - function. */ -#undef HAVE___CLEAR_CACHE - -/* Define to 1 if `major', `minor', and `makedev' are declared in . - */ -#undef MAJOR_IN_MKDEV - -/* Define to 1 if `major', `minor', and `makedev' are declared in - . */ -#undef MAJOR_IN_SYSMACROS - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to the soname of the libcups library. */ -#undef SONAME_LIBCUPS - -/* Define to the soname of the libdbus-1 library. */ -#undef SONAME_LIBDBUS_1 - -/* Define to the soname of the libEGL library. */ -#undef SONAME_LIBEGL - -/* Define to the soname of the libfontconfig library. */ -#undef SONAME_LIBFONTCONFIG - -/* Define to the soname of the libfreetype library. */ -#undef SONAME_LIBFREETYPE - -/* Define to the soname of the libGL library. */ -#undef SONAME_LIBGL - -/* Define to the soname of the libGLESv2 library. */ -#undef SONAME_LIBGLESV2 - -/* Define to the soname of the libgnutls library. */ -#undef SONAME_LIBGNUTLS - -/* Define to the soname of the libgssapi_krb5 library. */ -#undef SONAME_LIBGSSAPI_KRB5 - -/* Define to the soname of the libkrb5 library. */ -#undef SONAME_LIBKRB5 - -/* Define to the soname of the libMoltenVK library. */ -#undef SONAME_LIBMOLTENVK - -/* Define to the soname of the libnetapi library. */ -#undef SONAME_LIBNETAPI - -/* Define to the soname of the libodbc library. */ -#undef SONAME_LIBODBC - -/* Define to the soname of the libOSMesa library. */ -#undef SONAME_LIBOSMESA - -/* Define to the soname of the libSDL2 library. */ -#undef SONAME_LIBSDL2 - -/* Define to the soname of the libv4l2 library. */ -#undef SONAME_LIBV4L2 - -/* Define to the soname of the libvulkan library. */ -#undef SONAME_LIBVULKAN - -/* Define to the soname of the libX11 library. */ -#undef SONAME_LIBX11 - -/* Define to the soname of the libXcomposite library. */ -#undef SONAME_LIBXCOMPOSITE - -/* Define to the soname of the libXcursor library. */ -#undef SONAME_LIBXCURSOR - -/* Define to the soname of the libXext library. */ -#undef SONAME_LIBXEXT - -/* Define to the soname of the libXfixes library. */ -#undef SONAME_LIBXFIXES - -/* Define to the soname of the libXi library. */ -#undef SONAME_LIBXI - -/* Define to the soname of the libXinerama library. */ -#undef SONAME_LIBXINERAMA - -/* Define to the soname of the libXrandr library. */ -#undef SONAME_LIBXRANDR - -/* Define to the soname of the libXrender library. */ -#undef SONAME_LIBXRENDER - -/* Define to the soname of the libXxf86vm library. */ -#undef SONAME_LIBXXF86VM - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#undef STDC_HEADERS - -/* Define if xattr functions take additional arguments (macOS) */ -#undef XATTR_ADDITIONAL_OPTIONS - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define to 1 to enable GNU extensions on Linux */ -#undef _GNU_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to 64 to enable 64-bit time_t on Linux */ -#undef _TIME_BITS - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -#endif /* __WINE_CONFIG_H */ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 54b9e6aa199..73c06f6802d 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1837,6 +1837,7 @@ NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION, void**); NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION); NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**); NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE); +NTSTATUS WINAPI ObOpenObjectByPointer(void *,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,HANDLE*); void WINAPI ObUnRegisterCallbacks(void*); NTSTATUS WINAPI PoCallDriver(DEVICE_OBJECT*,IRP*); diff --git a/include/docobjectservice.idl b/include/docobjectservice.idl index 4e931351b49..cfa007c75eb 100644 --- a/include/docobjectservice.idl +++ b/include/docobjectservice.idl @@ -17,23 +17,25 @@ */ import "objidl.idl"; +#ifndef NO_MSHTML_IMPORT import "mshtml.idl"; +#endif [ - local, + /* local, CXHACK 15579 */ object, uuid(3050f801-98b5-11cf-bb82-00aa00bdce0b) ] interface IDocObjectService : IUnknown { HRESULT FireBeforeNavigate2( - [in] IDispatch *pDispatch, - [in] LPCWSTR lpszUrl, + [in, optional] IDispatch *pDispatch, + [in, string, unique] LPCWSTR lpszUrl, [in] DWORD dwFlags, - [in] LPCWSTR lpszFrameName, - [in] BYTE *pPostData, + [in, string, unique] LPCWSTR lpszFrameName, + [in, unique, size_is(cbPostData)] BYTE *pPostData, [in] DWORD cbPostData, - [in] LPCWSTR lpszHeaders, + [in, string, unique] LPCWSTR lpszHeaders, [in] BOOL fPlayNavSound, [out] BOOL *pfCancel); diff --git a/include/holographicspaceinterop.idl b/include/holographicspaceinterop.idl new file mode 100644 index 00000000000..913f60bc7a0 --- /dev/null +++ b/include/holographicspaceinterop.idl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "inspectable.idl"; + +[ + uuid(5c4ee536-6a98-4b86-a170-587013d6fd4b), +] +interface IHolographicSpaceInterop : IInspectable +{ + HRESULT CreateForWindow( [in] HWND window, [in] REFIID iid, [out, iid_is(iid)] void **holographic_space); +} diff --git a/include/mmreg.h b/include/mmreg.h index 1b19e1f068f..a8b0056064e 100644 --- a/include/mmreg.h +++ b/include/mmreg.h @@ -645,6 +645,22 @@ typedef struct mpeg1waveformat_tag { typedef MPEG1WAVEFORMAT *PMPEG1WAVEFORMAT, *NPMPEG1WAVEFORMAT, *LPMPEG1WAVEFORMAT; +typedef struct heaacwaveinfo_tag +{ + WAVEFORMATEX wfx; + WORD wPayloadType; + WORD wAudioProfileLevelIndication; + WORD wStructType; + WORD wReserved1; + DWORD dwReserved2; +} HEAACWAVEINFO, *PHEAACWAVEINFO; + +typedef struct heaacwaveformat_tag +{ + HEAACWAVEINFO wfInfo; + BYTE pbAudioSpecificConfig[1]; +} HEAACWAVEFORMAT, *PHEAACWAVEFORMAT; + #define ACM_MPEG_LAYER1 0x0001 #define ACM_MPEG_LAYER2 0x0002 #define ACM_MPEG_LAYER3 0x0004 diff --git a/include/mshtmhst.idl b/include/mshtmhst.idl index 6cc500ed7a9..efc51c6a5da 100644 --- a/include/mshtmhst.idl +++ b/include/mshtmhst.idl @@ -163,7 +163,7 @@ typedef enum tagDOCHOSTUIFLAG object, uuid(BD3F23C0-D43E-11CF-893B-00AA00BDCE1A), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface IDocHostUIHandler : IUnknown { @@ -237,7 +237,7 @@ cpp_quote("DEFINE_GUID(CGID_DocHostCommandHandler,0xf38bc242,0xb950,0x11d1,0x89, object, uuid(3050F6D0-98b5-11CF-BB82-00AA00BDCE0B), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface IDocHostUIHandler2 : IDocHostUIHandler { @@ -253,7 +253,7 @@ interface IDocHostUIHandler2 : IDocHostUIHandler object, uuid(3050f3f0-98b5-11cf-bb82-00aa00bdce0b), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface ICustomDoc : IUnknown { diff --git a/include/mshtml.idl b/include/mshtml.idl index 2a1fccba6be..7fb245f5d5c 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -30353,7 +30353,11 @@ interface IElementBehaviorFactory : IUnknown } /* library MSHTML */ +#ifdef MSHTML_MARSHALING_HACK +#define IOleCommandTarget IUnknown +#else interface IOleCommandTarget; +#endif /***************************************************************************** * IHTMLPrivateWindow interface @@ -30361,7 +30365,7 @@ interface IOleCommandTarget; [ object, uuid(3050f6dc-98b5-11cf-bb82-00aa00bdce0b), - local + /* local, CXHACK 15579 */ ] interface IHTMLPrivateWindow : IUnknown { @@ -30370,7 +30374,7 @@ interface IHTMLPrivateWindow : IUnknown HRESULT SetPICSTarget(IOleCommandTarget *cmdtrg); HRESULT PICSComplete(int arg); HRESULT FindWindowByName(LPCWSTR name, IHTMLWindow2 **ret); - HRESULT GetAddressBarUrl(BSTR *url); + HRESULT GetAddressBarUrl([out, retval] BSTR *url); } /***************************************************************************** @@ -30379,7 +30383,7 @@ interface IHTMLPrivateWindow : IUnknown [ object, uuid(3050f804-98b5-11cf-bb82-00aa00bdce0b), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv : IUnknown { @@ -30394,7 +30398,7 @@ interface IWebBrowserPriv : IUnknown [ object, uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv2IE8 : IUnknown { @@ -30416,7 +30420,7 @@ interface IWebBrowserPriv2IE8 : IUnknown [ object, uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv2IE9 : IUnknown { @@ -30424,3 +30428,7 @@ interface IWebBrowserPriv2IE9 : IUnknown VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment, DWORD unused); /* Probably more */ } + +#ifdef MSHTML_MARSHALING_HACK +#undef IOleCommandTarget +#endif diff --git a/include/msxml2.idl b/include/msxml2.idl index ede4113ecbf..85bb6a5b0cb 100644 --- a/include/msxml2.idl +++ b/include/msxml2.idl @@ -1612,15 +1612,6 @@ coclass FreeThreadedDOMDocument40 [default, source] dispinterface XMLDOMDocumentEvents; } -[ - uuid(88d96a06-f192-11d4-a65f-0040963251e5), -] -coclass FreeThreadedDOMDocument60 -{ - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; -} - [ helpstring("Free threaded XML DOM Document"), progid("Msxml2.FreeThreadedDOMDocument"), @@ -1662,14 +1653,6 @@ coclass XMLHTTP40 [default] interface IXMLHTTPRequest; } -[ - uuid(88d96a0a-f192-11d4-a65f-0040963251e5) -] -coclass XMLHTTP60 -{ - [default] interface IXMLHTTPRequest; -} - [ helpstring("XML HTTP"), progid("Msxml2.XMLHTTP"), @@ -1702,14 +1685,6 @@ coclass ServerXMLHTTP40 [default] interface IServerXMLHTTPRequest2; } -[ - uuid(88d96a0b-f192-11d4-a65f-0040963251e5) -] -coclass ServerXMLHTTP60 -{ - [default] interface IServerXMLHTTPRequest2; -} - [ helpstring("Server XML HTTP"), progid("Msxml2.ServerXMLHTTP"), @@ -1750,14 +1725,6 @@ coclass XMLSchemaCache40 [default] interface IXMLDOMSchemaCollection2; } -[ - uuid(88d96a07-f192-11d4-a65f-0040963251e5) -] -coclass XMLSchemaCache60 -{ - [default] interface IXMLDOMSchemaCollection2; -} - [ helpstring("XML Schema Cache"), progid("Msxml2.XMLSchemaCache"), @@ -1798,14 +1765,6 @@ coclass XSLTemplate40 [default] interface IXSLTemplate; } -[ - uuid(88d96a08-f192-11d4-a65f-0040963251e5) -] -coclass XSLTemplate60 -{ - [default] interface IXSLTemplate; -} - [ helpstring("XSL Template"), progid("Msxml2.XSLTemplate"), @@ -3297,15 +3256,6 @@ coclass SAXXMLReader40 interface ISAXXMLReader; } -[ - uuid(88d96a0c-f192-11d4-a65f-0040963251e5) -] -coclass SAXXMLReader60 -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; -} - [ helpstring("SAX XML Reader"), progid("Msxml2.SAXXMLReader"), @@ -3380,26 +3330,6 @@ coclass MXHTMLWriter40 interface IVBSAXLexicalHandler; } -[ - uuid(88d96a10-f192-11d4-a65f-0040963251e5) -] -coclass MXHTMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -} - [ helpstring("MXXMLWriter 3.0"), progid("Msxml2.MXXMLWriter.3.0"), @@ -3444,26 +3374,6 @@ coclass MXXMLWriter40 interface IVBSAXLexicalHandler; } -[ - uuid(88d96a0f-f192-11d4-a65f-0040963251e5) -] -coclass MXXMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -} - [ helpstring("MXXMLWriter"), progid("Msxml2.MXXMLWriter"), @@ -3506,15 +3416,6 @@ coclass MXNamespaceManager40 interface IMXNamespaceManager; } -[ - uuid(88d96a11-f192-11d4-a65f-0040963251e5) -] -coclass MXNamespaceManager60 -{ - [default] interface IVBMXNamespaceManager; - interface IMXNamespaceManager; -} - [ helpstring("SAXAttributes 3.0"), progid("Msxml2.SAXAttributes.3.0"), @@ -3539,16 +3440,6 @@ coclass SAXAttributes40 interface ISAXAttributes; } -[ - uuid(88d96a0e-f192-11d4-a65f-0040963251e5) -] -coclass SAXAttributes60 -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -} - [ helpstring("SAXAttributes"), progid("Msxml2.SAXAttributes"), diff --git a/include/msxml6.idl b/include/msxml6.idl index d4a5c490243..b2d8bd3b337 100644 --- a/include/msxml6.idl +++ b/include/msxml6.idl @@ -1715,17 +1715,6 @@ interface ISAXDeclHandler : IUnknown [in] int nSystemId); } -[ - helpstring("Free Threaded XML HTTP Request class 6.0"), - progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), - threading(both), - uuid(88d96a09-f192-11d4-a65f-0040963251e5) -] -coclass FreeThreadedXMLHTTP60 -{ - [default] interface IXMLHTTPRequest2; -} - [ object, local, @@ -3054,24 +3043,23 @@ interface ISchemaNotation; } __msxml6_ReferenceRemainingTypes__; [ - helpstring("XML DOM Document 6.0"), - progid("Msxml2.DOMDocument.6.0"), + helpstring("Free Threaded XML HTTP Request class 6.0"), + progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), threading(both), - uuid(88d96a05-f192-11d4-a65f-0040963251e5) + uuid(88d96a09-f192-11d4-a65f-0040963251e5) ] -coclass DOMDocument60 +coclass FreeThreadedXMLHTTP60 { - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; + [default] interface IXMLHTTPRequest2; } [ - helpstring("Free threaded XML DOM Document 6.0"), - progid("Msxml2.FreeThreadedDOMDocument.6.0"), + helpstring("XML DOM Document 6.0"), + progid("Msxml2.DOMDocument.6.0"), threading(both), - uuid(88d96a06-f192-11d4-a65f-0040963251e5), + uuid(88d96a05-f192-11d4-a65f-0040963251e5) ] -coclass FreeThreadedDOMDocument60 +coclass DOMDocument60 { [default] interface IXMLDOMDocument3; [default, source] dispinterface XMLDOMDocumentEvents; @@ -3182,6 +3170,18 @@ coclass XSLTemplate60 [default] interface IXSLTemplate; } +[ + helpstring("Free threaded XML DOM Document 6.0"), + progid("Msxml2.FreeThreadedDOMDocument.6.0"), + threading(both), + uuid(88d96a06-f192-11d4-a65f-0040963251e5), +] +coclass FreeThreadedDOMDocument60 +{ + [default] interface IXMLDOMDocument3; + [default, source] dispinterface XMLDOMDocumentEvents; +} + [ helpstring("XML HTTP 6.0"), progid("Msxml2.XMLHTTP.6.0"), diff --git a/include/ncrypt.h b/include/ncrypt.h index 9fc2cb5b171..7a1769c8bd9 100644 --- a/include/ncrypt.h +++ b/include/ncrypt.h @@ -58,6 +58,21 @@ typedef struct NCryptKeyName { DWORD dwFlags; } NCryptKeyName; +typedef struct __NCRYPT_SUPPORTED_LENGTHS { + DWORD dwMinLength; + DWORD dwMaxLength; + DWORD dwIncrement; + DWORD dwDefaultLength; +} NCRYPT_SUPPORTED_LENGTHS; + +typedef struct __NCRYPT_UI_POLICY { + DWORD dwVersion; + DWORD dwFlags; + LPCWSTR pszCreationTitle; + LPCWSTR pszFriendlyName; + LPCWSTR pszDescription; +} NCRYPT_UI_POLICY; + typedef ULONG_PTR NCRYPT_HANDLE; typedef ULONG_PTR NCRYPT_PROV_HANDLE; typedef ULONG_PTR NCRYPT_KEY_HANDLE; @@ -76,6 +91,17 @@ typedef ULONG_PTR NCRYPT_SECRET_HANDLE; #define NCRYPT_PAD_OAEP_FLAG 0x00000004 #define NCRYPT_PAD_PSS_FLAG 0x00000008 +#define NCRYPT_ALLOW_DECRYPT_FLAG 0x00000001 +#define NCRYPT_ALLOW_SIGNING_FLAG 0x00000002 +#define NCRYPT_ALLOW_KEY_AGREEMENT_FLAG 0x00000004 +#define NCRYPT_ALLOW_KEY_IMPORT_FLAG 0x00000008 +#define NCRYPT_ALLOW_ALL_USAGES 0x00ffffff + +#define NCRYPT_ALLOW_EXPORT_FLAG 0x00000001 +#define NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG 0x00000002 +#define NCRYPT_ALLOW_ARCHIVING_FLAG 0x00000004 +#define NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG 0x00000008 + #define NCRYPT_NAME_PROPERTY L"Name" #define NCRYPT_UNIQUE_NAME_PROPERTY L"Unique Name" #define NCRYPT_ALGORITHM_PROPERTY L"Algorithm Name" diff --git a/include/ntuser.h b/include/ntuser.h index f23249ace5a..bf65f214bc2 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -87,6 +87,7 @@ struct ntuser_thread_info UINT default_imc; /* default input context */ UINT64 client_imm; /* client IMM thread info */ UINT64 wmchar_data; /* client data for WM_CHAR mappings */ + UINT64 vulkan_data; /* used by winevulkan for tls */ }; static inline struct ntuser_thread_info *NtUserGetThreadInfo(void) @@ -489,6 +490,8 @@ enum wine_internal_message WM_WINE_KEYBOARD_LL_HOOK, WM_WINE_MOUSE_LL_HOOK, WM_WINE_UPDATEWINDOWSTATE, + WM_WINE_GETSCROLLBARINFO, + WM_WINE_GETSCROLLINFO, WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_CLIPCURSOR = 0x80001ff0, /* internal driver notification messages */ WM_WINE_SETCURSOR, @@ -671,6 +674,7 @@ W32KAPI ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process ); W32KAPI HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert ); W32KAPI HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); W32KAPI BOOL WINAPI NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ); +W32KAPI BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ); W32KAPI INT WINAPI NtUserGetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase ); W32KAPI BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size ); W32KAPI BOOL WINAPI NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase ); @@ -688,6 +692,7 @@ W32KAPI BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); W32KAPI BOOL WINAPI NtUserIsMouseInPointerEnabled(void); W32KAPI BOOL WINAPI NtUserInvalidateRect( HWND hwnd, const RECT *rect, BOOL erase ); W32KAPI BOOL WINAPI NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase ); +W32KAPI BOOL WINAPI NtUserIsTouchWindow( HWND hwnd, ULONG *flags ); W32KAPI BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ); W32KAPI BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd ); W32KAPI BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt ); @@ -892,6 +897,7 @@ enum NtUserCallOneParam_SetCaretBlinkTime, NtUserCallOneParam_SetProcessDefaultLayout, NtUserCallOneParam_SetKeyboardAutoRepeat, + NtUserCallOneParam_UnregisterTouchWindow, /* temporary exports */ NtUserGetDeskPattern, }; @@ -1018,6 +1024,7 @@ enum NtUserCallTwoParam_GetMonitorInfo, NtUserCallTwoParam_GetSystemMetricsForDpi, NtUserCallTwoParam_MonitorFromRect, + NtUserCallTwoParam_RegisterTouchWindow, NtUserCallTwoParam_SetCaretPos, NtUserCallTwoParam_SetIconParam, NtUserCallTwoParam_UnhookWindowsHook, @@ -1230,6 +1237,7 @@ enum NtUserCallHwndParam_SetMDIClientInfo, NtUserCallHwndParam_SetWindowContextHelpId, NtUserCallHwndParam_ShowOwnedPopups, + NtUserCallHwndParam_EnumChildWindows, /* temporary exports */ NtUserSetWindowStyle, }; @@ -1400,7 +1408,39 @@ static inline BOOL NtUserShowOwnedPopups( HWND hwnd, BOOL show ) return NtUserCallHwndParam( hwnd, show, NtUserCallHwndParam_ShowOwnedPopups ); } +struct enum_child_windows_params +{ + WNDENUMPROC proc; + LPARAM lparam; +}; + +static inline BOOL NtUserEnumChildWindows( HWND hwnd, WNDENUMPROC proc, LPARAM lparam ) +{ + struct enum_child_windows_params params = {.proc = proc, .lparam = lparam}; + return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_EnumChildWindows ); +} + /* Wine extensions */ W32KAPI BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); +/* HACK: We use some WM specific hacks in user32 and we need the user + * driver to export that information. */ + +#define WINE_WM_UNKNOWN 0 +#define WINE_WM_X11_MUTTER 1 +#define WINE_WM_X11_STEAMCOMPMGR 2 +#define WINE_WM_X11_KDE 3 + +static inline LONG_PTR __wine_get_window_manager(void) +{ + static const WCHAR __wine_window_managerW[] = {'_','_','w','i','n','e','_','w','i','n','d','o','w','_','m','a','n','a','g','e','r',0}; + return (LONG_PTR)NtUserGetProp(NtUserGetDesktopWindow(), __wine_window_managerW); +} + +static inline void __wine_set_window_manager(LONG_PTR window_manager) +{ + static const WCHAR __wine_window_managerW[] = {'_','_','w','i','n','e','_','w','i','n','d','o','w','_','m','a','n','a','g','e','r',0}; + NtUserSetProp(NtUserGetDesktopWindow(), __wine_window_managerW, (HANDLE)window_manager); +} + #endif /* _NTUSER_ */ diff --git a/include/sapi.idl b/include/sapi.idl index 16b8348d73b..6a593eb6b18 100644 --- a/include/sapi.idl +++ b/include/sapi.idl @@ -1293,7 +1293,7 @@ library SpeechLib coclass SpObjectToken { interface ISpObjectToken; - [default] interface ISpDataKey; + [default] interface ISpeechObjectToken; } [ diff --git a/include/shdeprecated.idl b/include/shdeprecated.idl index c8bb3fd9bf0..bb0559578e9 100644 --- a/include/shdeprecated.idl +++ b/include/shdeprecated.idl @@ -186,7 +186,7 @@ cpp_quote("#define HLNF_ALLOW_AUTONAVIGATE 0x20000000") cpp_quote("#define HLNF_NEWWINDOWSMANAGED 0x80000000") [ - local, + /* local, CXHACK 15579 */ object, uuid(02ba3b52-0547-11d1-b833-00c04fc9b31f) ] @@ -220,7 +220,7 @@ interface IBrowserService : IUnknown HRESULT IEGetDisplayName( [in] PCIDLIST_ABSOLUTE pidl, - [out, size_is(INTERNET_MAX_URL_LENGTH)] LPWSTR pwszName, + [out, size_is(300)] LPWSTR pwszName, [in] UINT uFlags); HRESULT IEParseDisplayName( diff --git a/include/windows.devices.haptics.idl b/include/windows.devices.haptics.idl index c056ab4941c..506525a6d3c 100644 --- a/include/windows.devices.haptics.idl +++ b/include/windows.devices.haptics.idl @@ -30,7 +30,10 @@ namespace Windows.Devices.Haptics { runtimeclass SimpleHapticsController; declare { + interface Windows.Foundation.Collections.IIterator; + interface Windows.Foundation.Collections.IIterable; interface Windows.Foundation.Collections.IVectorView; + interface Windows.Foundation.Collections.IVector; interface Windows.Foundation.Collections.IVectorView; } diff --git a/include/wine/debug.h b/include/wine/debug.h index ce5e141ccb7..f5aa9f7dbc7 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -114,6 +114,7 @@ extern DECLSPEC_EXPORT const char * __cdecl __wine_dbg_strdup( const char *str ) extern DECLSPEC_EXPORT int __cdecl __wine_dbg_output( const char *str ); extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *function ); +extern unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ); /* * Exported definitions and macros @@ -129,6 +130,18 @@ extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cl # define __wine_dbg_cdecl #endif +static inline unsigned int __wine_dbg_cdecl __wine_dbg_ftrace_printf( unsigned int ctx, const char *format, ...) +{ + char buffer[256]; + + va_list args; + + va_start( args, format ); + vsnprintf( buffer, sizeof(buffer), format, args ); + va_end( args ); + return __wine_dbg_ftrace(buffer, sizeof(buffer), ctx); +} + static const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) __WINE_PRINTF_ATTR(1,0); static inline const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) { @@ -548,6 +561,16 @@ static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbg #define MESSAGE WINE_MESSAGE +#define FTRACE(...) do { if (TRACE_ON(ftrace)) __wine_dbg_ftrace_printf( -1, __VA_ARGS__ ); } while (0) + +#define FTRACE_BLOCK_START(...) do { \ + unsigned int ctx = TRACE_ON(ftrace) ? __wine_dbg_ftrace_printf( 0, __VA_ARGS__ ) : 0; \ + do { + +#define FTRACE_BLOCK_END() } while (0); \ + if (TRACE_ON(ftrace)) __wine_dbg_ftrace_printf( ctx, "" ); \ + } while (0); + #endif /* __WINESRC__ */ #ifdef __cplusplus diff --git a/include/wine/server.h b/include/wine/server.h index 87b43c7e63f..a673ce96101 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -26,6 +26,7 @@ #include #include #include +#include /* client communication functions */ @@ -47,6 +48,7 @@ struct __server_request_info unsigned int data_count; /* count of request data pointers */ void *reply_data; /* reply data pointer */ struct __server_iovec data[__SERVER_MAX_DATA]; /* request variable size data */ + const char *name; }; NTSYSAPI unsigned int CDECL wine_server_call( void *req_ptr ); @@ -127,6 +129,7 @@ static inline void *wine_server_get_ptr( client_ptr_t ptr ) struct type##_request * const req = &__req.u.req.type##_request; \ const struct type##_reply * const reply = &__req.u.reply.type##_reply; \ memset( &__req.u.req, 0, sizeof(__req.u.req) ); \ + __req.name = #type; \ __req.u.req.request_header.req = REQ_##type; \ __req.data_count = 0; \ (void)reply; \ diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 1b4cc3f7657..c5abca26757 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -120,6 +120,7 @@ void strmbase_sink_cleanup(struct strmbase_sink *pin); struct strmbase_filter { IBaseFilter IBaseFilter_iface; + IPropertyBag IPropertyBag_iface; IUnknown IUnknown_inner; IUnknown *outer_unk; LONG refcount; diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h deleted file mode 100644 index a8bf4ad4df0..00000000000 --- a/include/wine/vulkan.h +++ /dev/null @@ -1,13855 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_H -#define __WINE_VULKAN_H - -#include -#include - -/* Define WINE_VK_HOST to get 'host' headers. */ -#ifdef WINE_VK_HOST -#define VKAPI_CALL -#define WINE_VK_ALIGN(x) -#endif - -#ifndef VKAPI_CALL -#define VKAPI_CALL __stdcall -#endif - -#ifndef VKAPI_PTR -#define VKAPI_PTR VKAPI_CALL -#endif - -#ifndef WINE_VK_ALIGN -#define WINE_VK_ALIGN DECLSPEC_ALIGN -#endif - -#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 -#define VK_UUID_SIZE 16 -#define VK_LUID_SIZE 8 -#define VK_LUID_SIZE_KHR VK_LUID_SIZE -#define VK_MAX_EXTENSION_NAME_SIZE 256 -#define VK_MAX_DESCRIPTION_SIZE 256 -#define VK_MAX_MEMORY_TYPES 32 -#define VK_MAX_MEMORY_HEAPS 16 -#define VK_LOD_CLAMP_NONE 1000.0F -#define VK_REMAINING_MIP_LEVELS (~0U) -#define VK_REMAINING_ARRAY_LAYERS (~0U) -#define VK_REMAINING_3D_SLICES_EXT (~0U) -#define VK_WHOLE_SIZE (~0ULL) -#define VK_ATTACHMENT_UNUSED (~0U) -#define VK_TRUE 1 -#define VK_FALSE 0 -#define VK_QUEUE_FAMILY_IGNORED (~0U) -#define VK_QUEUE_FAMILY_EXTERNAL (~1U) -#define VK_QUEUE_FAMILY_EXTERNAL_KHR VK_QUEUE_FAMILY_EXTERNAL -#define VK_QUEUE_FAMILY_FOREIGN_EXT (~2U) -#define VK_SUBPASS_EXTERNAL (~0U) -#define VK_MAX_DEVICE_GROUP_SIZE 32 -#define VK_MAX_DEVICE_GROUP_SIZE_KHR VK_MAX_DEVICE_GROUP_SIZE -#define VK_MAX_DRIVER_NAME_SIZE 256 -#define VK_MAX_DRIVER_NAME_SIZE_KHR VK_MAX_DRIVER_NAME_SIZE -#define VK_MAX_DRIVER_INFO_SIZE 256 -#define VK_MAX_DRIVER_INFO_SIZE_KHR VK_MAX_DRIVER_INFO_SIZE -#define VK_SHADER_UNUSED_KHR (~0U) -#define VK_SHADER_UNUSED_NV VK_SHADER_UNUSED_KHR -#define VK_MAX_GLOBAL_PRIORITY_SIZE_KHR 16 -#define VK_MAX_GLOBAL_PRIORITY_SIZE_EXT VK_MAX_GLOBAL_PRIORITY_SIZE_KHR -#define VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT 32 -#define VK_SHADER_INDEX_UNUSED_AMDX (~0U) -#define VK_KHR_SURFACE_SPEC_VERSION 25 -#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 -#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" -#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_NV_GLSL_SHADER_SPEC_VERSION 1 -#define VK_NV_GLSL_SHADER_EXTENSION_NAME "VK_NV_glsl_shader" -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION 1 -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME "VK_EXT_depth_range_unrestricted" -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 3 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" -#define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 -#define VK_IMG_FILTER_CUBIC_EXTENSION_NAME "VK_IMG_filter_cubic" -#define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 -#define VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME "VK_AMD_rasterization_order" -#define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 -#define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" -#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 -#define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" -#define VK_AMD_GCN_SHADER_SPEC_VERSION 1 -#define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" -#define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 -#define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" -#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1 -#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback" -#define VK_NVX_BINARY_IMPORT_SPEC_VERSION 1 -#define VK_NVX_BINARY_IMPORT_EXTENSION_NAME "VK_NVX_binary_import" -#define VK_NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION 2 -#define VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME "VK_NVX_image_view_handle" -#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 2 -#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" -#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 2 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" -#define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 -#define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION 1 -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME "VK_AMD_texture_gather_bias_lod" -#define VK_AMD_SHADER_INFO_SPEC_VERSION 1 -#define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" -#define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 -#define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" -#define VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION 2 -#define VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME "VK_NV_corner_sampled_image" -#define VK_KHR_MULTIVIEW_SPEC_VERSION 1 -#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview" -#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 -#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 2 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" -#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 4 -#define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 3 -#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" -#define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1 -#define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters" -#define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot" -#define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" -#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_SPEC_VERSION 1 -#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME "VK_EXT_texture_compression_astc_hdr" -#define VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION 1 -#define VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME "VK_EXT_astc_decode_mode" -#define VK_EXT_PIPELINE_ROBUSTNESS_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_pipeline_robustness" -#define VK_KHR_MAINTENANCE1_SPEC_VERSION VK_KHR_MAINTENANCE_1_SPEC_VERSION -#define VK_KHR_MAINTENANCE1_EXTENSION_NAME VK_KHR_MAINTENANCE_1_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_1_SPEC_VERSION 2 -#define VK_KHR_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_maintenance1" -#define VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION 1 -#define VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHR_device_group_creation" -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" -#define VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHR_external_memory" -#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" -#define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" -#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 -#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" -#define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 2 -#define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering" -#define VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION 1 -#define VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME "VK_KHR_shader_float16_int8" -#define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 -#define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" -#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 2 -#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" -#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 -#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" -#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION -#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME -#define VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME "VK_NV_viewport_array2" -#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 2 -#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" -#define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 -#define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" -#define VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable" -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 4 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" -#define VK_EXT_HDR_METADATA_SPEC_VERSION 2 -#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" -#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1 -#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer" -#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1 -#define VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME "VK_KHR_create_renderpass2" -#define VK_IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION 1 -#define VK_IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME "VK_IMG_relaxed_line_rasterization" -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_fence_capabilities" -#define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" -#define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1 -#define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query" -#define VK_KHR_MAINTENANCE2_SPEC_VERSION VK_KHR_MAINTENANCE_2_SPEC_VERSION -#define VK_KHR_MAINTENANCE2_EXTENSION_NAME VK_KHR_MAINTENANCE_2_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_2_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_2_EXTENSION_NAME "VK_KHR_maintenance2" -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" -#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 -#define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" -#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 -#define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" -#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 -#define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" -#define VK_EXT_DEBUG_UTILS_SPEC_VERSION 2 -#define VK_EXT_DEBUG_UTILS_EXTENSION_NAME "VK_EXT_debug_utils" -#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 2 -#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION 1 -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME "VK_KHR_storage_buffer_storage_class" -#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 2 -#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" -#define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 -#define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" -#define VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION 1 -#define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block" -#define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 -#define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" -#define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 -#define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" -#define VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" -#define VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION 1 -#define VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME "VK_KHR_image_format_list" -#define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 -#define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME "VK_NV_fragment_coverage_to_color" -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION 1 -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME "VK_NV_framebuffer_mixed_samples" -#define VK_NV_FILL_RECTANGLE_SPEC_VERSION 1 -#define VK_NV_FILL_RECTANGLE_EXTENSION_NAME "VK_NV_fill_rectangle" -#define VK_NV_SHADER_SM_BUILTINS_SPEC_VERSION 1 -#define VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME "VK_NV_shader_sm_builtins" -#define VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION 1 -#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 14 -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" -#define VK_KHR_BIND_MEMORY_2_SPEC_VERSION 1 -#define VK_KHR_BIND_MEMORY_2_EXTENSION_NAME "VK_KHR_bind_memory2" -#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" -#define VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION 2 -#define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing" -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" -#define VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION 3 -#define VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME "VK_NV_shading_rate_image" -#define VK_NV_RAY_TRACING_SPEC_VERSION 3 -#define VK_NV_RAY_TRACING_EXTENSION_NAME "VK_NV_ray_tracing" -#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION 2 -#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME "VK_NV_representative_fragment_test" -#define VK_KHR_MAINTENANCE3_SPEC_VERSION VK_KHR_MAINTENANCE_3_SPEC_VERSION -#define VK_KHR_MAINTENANCE3_EXTENSION_NAME VK_KHR_MAINTENANCE_3_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_3_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_3_EXTENSION_NAME "VK_KHR_maintenance3" -#define VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 -#define VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_KHR_draw_indirect_count" -#define VK_EXT_FILTER_CUBIC_SPEC_VERSION 3 -#define VK_EXT_FILTER_CUBIC_EXTENSION_NAME "VK_EXT_filter_cubic" -#define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION 4 -#define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_EXTENSION_NAME "VK_QCOM_render_pass_shader_resolve" -#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 -#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" -#define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_SPEC_VERSION 1 -#define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME "VK_KHR_shader_subgroup_extended_types" -#define VK_KHR_8BIT_STORAGE_SPEC_VERSION 1 -#define VK_KHR_8BIT_STORAGE_EXTENSION_NAME "VK_KHR_8bit_storage" -#define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" -#define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 -#define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" -#define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1 -#define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64" -#define VK_KHR_SHADER_CLOCK_SPEC_VERSION 1 -#define VK_KHR_SHADER_CLOCK_EXTENSION_NAME "VK_KHR_shader_clock" -#define VK_AMD_PIPELINE_COMPILER_CONTROL_SPEC_VERSION 1 -#define VK_AMD_PIPELINE_COMPILER_CONTROL_EXTENSION_NAME "VK_AMD_pipeline_compiler_control" -#define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 2 -#define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" -#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 2 -#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" -#define VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION 1 -#define VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME "VK_KHR_global_priority" -#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION 1 -#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME "VK_AMD_memory_overallocation_behavior" -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 3 -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" -#define VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME "VK_EXT_pipeline_creation_feedback" -#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1 -#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties" -#define VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION 4 -#define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls" -#define VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION 1 -#define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" -#define VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION 1 -#define VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME "VK_KHR_depth_stencil_resolve" -#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION 1 -#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME "VK_KHR_swapchain_mutable_format" -#define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 -#define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives" -#define VK_NV_MESH_SHADER_SPEC_VERSION 1 -#define VK_NV_MESH_SHADER_EXTENSION_NAME "VK_NV_mesh_shader" -#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric" -#define VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION 2 -#define VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME "VK_NV_shader_image_footprint" -#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 2 -#define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive" -#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2 -#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints" -#define VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION 2 -#define VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME "VK_KHR_timeline_semaphore" -#define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_SPEC_VERSION 1 -#define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME "VK_INTEL_shader_integer_functions2" -#define VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION 2 -#define VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME "VK_INTEL_performance_query" -#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 3 -#define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" -#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 2 -#define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info" -#define VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION 1 -#define VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME "VK_KHR_shader_terminate_invocation" -#define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 2 -#define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map" -#define VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION 1 -#define VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME "VK_EXT_scalar_block_layout" -#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION -#define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME -#define VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION 1 -#define VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" -#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 1 -#define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string" -#define VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION 2 -#define VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME "VK_EXT_subgroup_size_control" -#define VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION 2 -#define VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME "VK_KHR_fragment_shading_rate" -#define VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION 1 -#define VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME "VK_AMD_shader_core_properties2" -#define VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION 1 -#define VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME "VK_AMD_device_coherent_memory" -#define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION 1 -#define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME "VK_EXT_shader_image_atomic_int64" -#define VK_KHR_SPIRV_1_4_SPEC_VERSION 1 -#define VK_KHR_SPIRV_1_4_EXTENSION_NAME "VK_KHR_spirv_1_4" -#define VK_EXT_MEMORY_BUDGET_SPEC_VERSION 1 -#define VK_EXT_MEMORY_BUDGET_EXTENSION_NAME "VK_EXT_memory_budget" -#define VK_EXT_MEMORY_PRIORITY_SPEC_VERSION 1 -#define VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME "VK_EXT_memory_priority" -#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION 1 -#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME "VK_NV_dedicated_allocation_image_aliasing" -#define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION 1 -#define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME "VK_KHR_separate_depth_stencil_layouts" -#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2 -#define VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_EXT_buffer_device_address" -#define VK_EXT_TOOLING_INFO_SPEC_VERSION 1 -#define VK_EXT_TOOLING_INFO_EXTENSION_NAME "VK_EXT_tooling_info" -#define VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION 1 -#define VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME "VK_EXT_separate_stencil_usage" -#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 6 -#define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" -#define VK_KHR_PRESENT_WAIT_SPEC_VERSION 1 -#define VK_KHR_PRESENT_WAIT_EXTENSION_NAME "VK_KHR_present_wait" -#define VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION 1 -#define VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_NV_cooperative_matrix" -#define VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION 1 -#define VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME "VK_NV_coverage_reduction_mode" -#define VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION 1 -#define VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME "VK_EXT_fragment_shader_interlock" -#define VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION 1 -#define VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME "VK_EXT_ycbcr_image_arrays" -#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME "VK_KHR_uniform_buffer_standard_layout" -#define VK_EXT_PROVOKING_VERTEX_SPEC_VERSION 1 -#define VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME "VK_EXT_provoking_vertex" -#define VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 1 -#define VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_KHR_buffer_device_address" -#define VK_EXT_LINE_RASTERIZATION_SPEC_VERSION 1 -#define VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME "VK_EXT_line_rasterization" -#define VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME "VK_EXT_shader_atomic_float" -#define VK_EXT_HOST_QUERY_RESET_SPEC_VERSION 1 -#define VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME "VK_EXT_host_query_reset" -#define VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION 1 -#define VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_EXT_index_type_uint8" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION 1 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_extended_dynamic_state" -#define VK_KHR_DEFERRED_HOST_OPERATIONS_SPEC_VERSION 4 -#define VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME "VK_KHR_deferred_host_operations" -#define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_SPEC_VERSION 1 -#define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME "VK_KHR_pipeline_executable_properties" -#define VK_EXT_HOST_IMAGE_COPY_SPEC_VERSION 1 -#define VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME "VK_EXT_host_image_copy" -#define VK_KHR_MAP_MEMORY_2_SPEC_VERSION 1 -#define VK_KHR_MAP_MEMORY_2_EXTENSION_NAME "VK_KHR_map_memory2" -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME "VK_EXT_shader_atomic_float2" -#define VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_surface_maintenance1" -#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_swapchain_maintenance1" -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION 1 -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME "VK_EXT_shader_demote_to_helper_invocation" -#define VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 -#define VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NV_device_generated_commands" -#define VK_NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION 1 -#define VK_NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME "VK_NV_inherited_viewport_scissor" -#define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION 1 -#define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME "VK_KHR_shader_integer_dot_product" -#define VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION 1 -#define VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME "VK_EXT_texel_buffer_alignment" -#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 3 -#define VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME "VK_QCOM_render_pass_transform" -#define VK_EXT_DEPTH_BIAS_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME "VK_EXT_depth_bias_control" -#define VK_EXT_ROBUSTNESS_2_SPEC_VERSION 1 -#define VK_EXT_ROBUSTNESS_2_EXTENSION_NAME "VK_EXT_robustness2" -#define VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION 12 -#define VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME "VK_EXT_custom_border_color" -#define VK_GOOGLE_USER_TYPE_SPEC_VERSION 1 -#define VK_GOOGLE_USER_TYPE_EXTENSION_NAME "VK_GOOGLE_user_type" -#define VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION 1 -#define VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME "VK_KHR_pipeline_library" -#define VK_NV_PRESENT_BARRIER_SPEC_VERSION 1 -#define VK_NV_PRESENT_BARRIER_EXTENSION_NAME "VK_NV_present_barrier" -#define VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION 1 -#define VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME "VK_KHR_shader_non_semantic_info" -#define VK_KHR_PRESENT_ID_SPEC_VERSION 1 -#define VK_KHR_PRESENT_ID_EXTENSION_NAME "VK_KHR_present_id" -#define VK_EXT_PRIVATE_DATA_SPEC_VERSION 1 -#define VK_EXT_PRIVATE_DATA_EXTENSION_NAME "VK_EXT_private_data" -#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION 3 -#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME "VK_EXT_pipeline_creation_cache_control" -#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION 2 -#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME "VK_NV_device_diagnostics_config" -#define VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION 2 -#define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops" -#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2 -#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch" -#define VK_NV_LOW_LATENCY_SPEC_VERSION 1 -#define VK_NV_LOW_LATENCY_EXTENSION_NAME "VK_NV_low_latency" -#define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1 -#define VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME "VK_KHR_synchronization2" -#define VK_EXT_DESCRIPTOR_BUFFER_SPEC_VERSION 1 -#define VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME "VK_EXT_descriptor_buffer" -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION 1 -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME "VK_EXT_graphics_pipeline_library" -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_SPEC_VERSION 1 -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_EXTENSION_NAME "VK_AMD_shader_early_and_late_fragment_tests" -#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 -#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_KHR_fragment_shader_barycentric" -#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_SPEC_VERSION 1 -#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME "VK_KHR_shader_subgroup_uniform_control_flow" -#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_SPEC_VERSION 1 -#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_EXTENSION_NAME "VK_KHR_zero_initialize_workgroup_memory" -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME "VK_NV_fragment_shading_rate_enums" -#define VK_NV_RAY_TRACING_MOTION_BLUR_SPEC_VERSION 1 -#define VK_NV_RAY_TRACING_MOTION_BLUR_EXTENSION_NAME "VK_NV_ray_tracing_motion_blur" -#define VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION 1 -#define VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME "VK_EXT_ycbcr_2plane_444_formats" -#define VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION 1 -#define VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME "VK_EXT_fragment_density_map2" -#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 1 -#define VK_QCOM_ROTATED_COPY_COMMANDS_EXTENSION_NAME "VK_QCOM_rotated_copy_commands" -#define VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION 1 -#define VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_image_robustness" -#define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME "VK_KHR_workgroup_memory_explicit_layout" -#define VK_KHR_COPY_COMMANDS_2_SPEC_VERSION 1 -#define VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME "VK_KHR_copy_commands2" -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SPEC_VERSION 1 -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME "VK_EXT_image_compression_control" -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION 2 -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout" -#define VK_EXT_4444_FORMATS_SPEC_VERSION 1 -#define VK_EXT_4444_FORMATS_EXTENSION_NAME "VK_EXT_4444_formats" -#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 2 -#define VK_EXT_DEVICE_FAULT_EXTENSION_NAME "VK_EXT_device_fault" -#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 -#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_ARM_rasterization_order_attachment_access" -#define VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION 1 -#define VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME "VK_EXT_rgba10x6_formats" -#define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 -#define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_VALVE_mutable_descriptor_type" -#define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2 -#define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_vertex_input_dynamic_state" -#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_SPEC_VERSION 1 -#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_EXTENSION_NAME "VK_EXT_device_address_binding_report" -#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control" -#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION 1 -#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME "VK_EXT_primitive_topology_list_restart" -#define VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION 2 -#define VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME "VK_KHR_format_feature_flags2" -#define VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION 3 -#define VK_HUAWEI_SUBPASS_SHADING_EXTENSION_NAME "VK_HUAWEI_subpass_shading" -#define VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION 1 -#define VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAME "VK_HUAWEI_invocation_mask" -#define VK_EXT_PIPELINE_PROPERTIES_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME "VK_EXT_pipeline_properties" -#define VK_EXT_FRAME_BOUNDARY_SPEC_VERSION 1 -#define VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME "VK_EXT_frame_boundary" -#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1 -#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME "VK_EXT_multisampled_render_to_single_sampled" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION 1 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME "VK_EXT_extended_dynamic_state2" -#define VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION 1 -#define VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME "VK_EXT_color_write_enable" -#define VK_EXT_PRIMITIVES_GENERATED_QUERY_SPEC_VERSION 1 -#define VK_EXT_PRIMITIVES_GENERATED_QUERY_EXTENSION_NAME "VK_EXT_primitives_generated_query" -#define VK_KHR_RAY_TRACING_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_ray_tracing_maintenance1" -#define VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION 1 -#define VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME "VK_EXT_global_priority_query" -#define VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION 1 -#define VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME "VK_EXT_image_view_min_lod" -#define VK_EXT_MULTI_DRAW_SPEC_VERSION 1 -#define VK_EXT_MULTI_DRAW_EXTENSION_NAME "VK_EXT_multi_draw" -#define VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION 1 -#define VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_2d_view_of_3d" -#define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1 -#define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration" -#define VK_EXT_SHADER_TILE_IMAGE_SPEC_VERSION 1 -#define VK_EXT_SHADER_TILE_IMAGE_EXTENSION_NAME "VK_EXT_shader_tile_image" -#define VK_EXT_OPACITY_MICROMAP_SPEC_VERSION 2 -#define VK_EXT_OPACITY_MICROMAP_EXTENSION_NAME "VK_EXT_opacity_micromap" -#define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1 -#define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 3 -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" -#define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 -#define VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME "VK_EXT_border_color_swizzle" -#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION 1 -#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME "VK_EXT_pageable_device_local_memory" -#define VK_KHR_MAINTENANCE_4_SPEC_VERSION 2 -#define VK_KHR_MAINTENANCE_4_EXTENSION_NAME "VK_KHR_maintenance4" -#define VK_ARM_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 -#define VK_ARM_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_ARM_shader_core_properties" -#define VK_ARM_SCHEDULING_CONTROLS_SPEC_VERSION 1 -#define VK_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME "VK_ARM_scheduling_controls" -#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_SPEC_VERSION 1 -#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_sliced_view_of_3d" -#define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION 1 -#define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME "VK_VALVE_descriptor_set_host_mapping" -#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME "VK_EXT_depth_clamp_zero_one" -#define VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION 1 -#define VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME "VK_EXT_non_seamless_cube_map" -#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 1 -#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME "VK_QCOM_fragment_density_map_offset" -#define VK_NV_COPY_MEMORY_INDIRECT_SPEC_VERSION 1 -#define VK_NV_COPY_MEMORY_INDIRECT_EXTENSION_NAME "VK_NV_copy_memory_indirect" -#define VK_NV_MEMORY_DECOMPRESSION_SPEC_VERSION 1 -#define VK_NV_MEMORY_DECOMPRESSION_EXTENSION_NAME "VK_NV_memory_decompression" -#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_SPEC_VERSION 2 -#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_EXTENSION_NAME "VK_NV_device_generated_commands_compute" -#define VK_NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION 1 -#define VK_NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME "VK_NV_linear_color_attachment" -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_SPEC_VERSION 1 -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_EXTENSION_NAME "VK_EXT_image_compression_control_swapchain" -#define VK_QCOM_IMAGE_PROCESSING_SPEC_VERSION 1 -#define VK_QCOM_IMAGE_PROCESSING_EXTENSION_NAME "VK_QCOM_image_processing" -#define VK_EXT_NESTED_COMMAND_BUFFER_SPEC_VERSION 1 -#define VK_EXT_NESTED_COMMAND_BUFFER_EXTENSION_NAME "VK_EXT_nested_command_buffer" -#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXTENSION_NAME "VK_EXT_external_memory_acquire_unmodified" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_SPEC_VERSION 2 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME "VK_EXT_extended_dynamic_state3" -#define VK_EXT_SUBPASS_MERGE_FEEDBACK_SPEC_VERSION 2 -#define VK_EXT_SUBPASS_MERGE_FEEDBACK_EXTENSION_NAME "VK_EXT_subpass_merge_feedback" -#define VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION 1 -#define VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME "VK_EXT_shader_module_identifier" -#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 -#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_EXT_rasterization_order_attachment_access" -#define VK_NV_OPTICAL_FLOW_SPEC_VERSION 1 -#define VK_NV_OPTICAL_FLOW_EXTENSION_NAME "VK_NV_optical_flow" -#define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 1 -#define VK_EXT_LEGACY_DITHERING_EXTENSION_NAME "VK_EXT_legacy_dithering" -#define VK_EXT_PIPELINE_PROTECTED_ACCESS_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME "VK_EXT_pipeline_protected_access" -#define VK_KHR_MAINTENANCE_5_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_5_EXTENSION_NAME "VK_KHR_maintenance5" -#define VK_KHR_RAY_TRACING_POSITION_FETCH_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_POSITION_FETCH_EXTENSION_NAME "VK_KHR_ray_tracing_position_fetch" -#define VK_EXT_SHADER_OBJECT_SPEC_VERSION 1 -#define VK_EXT_SHADER_OBJECT_EXTENSION_NAME "VK_EXT_shader_object" -#define VK_QCOM_TILE_PROPERTIES_SPEC_VERSION 1 -#define VK_QCOM_TILE_PROPERTIES_EXTENSION_NAME "VK_QCOM_tile_properties" -#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_SPEC_VERSION 1 -#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_EXTENSION_NAME "VK_QCOM_multiview_per_view_viewports" -#define VK_NV_RAY_TRACING_INVOCATION_REORDER_SPEC_VERSION 1 -#define VK_NV_RAY_TRACING_INVOCATION_REORDER_EXTENSION_NAME "VK_NV_ray_tracing_invocation_reorder" -#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_SPEC_VERSION 1 -#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_EXTENSION_NAME "VK_NV_extended_sparse_address_space" -#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 -#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type" -#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 2 -#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings" -#define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2 -#define VK_ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME "VK_ARM_shader_core_builtins" -#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_EXTENSION_NAME "VK_EXT_pipeline_library_group_handles" -#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_SPEC_VERSION 1 -#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_EXTENSION_NAME "VK_EXT_dynamic_rendering_unused_attachments" -#define VK_NV_LOW_LATENCY_2_SPEC_VERSION 2 -#define VK_NV_LOW_LATENCY_2_EXTENSION_NAME "VK_NV_low_latency2" -#define VK_KHR_COOPERATIVE_MATRIX_SPEC_VERSION 2 -#define VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_KHR_cooperative_matrix" -#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 -#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_EXTENSION_NAME "VK_QCOM_multiview_per_view_render_areas" -#define VK_QCOM_IMAGE_PROCESSING_2_SPEC_VERSION 1 -#define VK_QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME "VK_QCOM_image_processing2" -#define VK_QCOM_FILTER_CUBIC_WEIGHTS_SPEC_VERSION 1 -#define VK_QCOM_FILTER_CUBIC_WEIGHTS_EXTENSION_NAME "VK_QCOM_filter_cubic_weights" -#define VK_QCOM_YCBCR_DEGAMMA_SPEC_VERSION 1 -#define VK_QCOM_YCBCR_DEGAMMA_EXTENSION_NAME "VK_QCOM_ycbcr_degamma" -#define VK_QCOM_FILTER_CUBIC_CLAMP_SPEC_VERSION 1 -#define VK_QCOM_FILTER_CUBIC_CLAMP_EXTENSION_NAME "VK_QCOM_filter_cubic_clamp" -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION 1 -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_dynamic_state" -#define VK_MSFT_LAYERED_DRIVER_SPEC_VERSION 1 -#define VK_MSFT_LAYERED_DRIVER_EXTENSION_NAME "VK_MSFT_layered_driver" -#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_SPEC_VERSION 1 -#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME "VK_NV_descriptor_pool_overallocation" -#define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 -#define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" -#define VK_KHR_RAY_TRACING_PIPELINE_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME "VK_KHR_ray_tracing_pipeline" -#define VK_KHR_RAY_QUERY_SPEC_VERSION 1 -#define VK_KHR_RAY_QUERY_EXTENSION_NAME "VK_KHR_ray_query" -#define VK_EXT_MESH_SHADER_SPEC_VERSION 1 -#define VK_EXT_MESH_SHADER_EXTENSION_NAME "VK_EXT_mesh_shader" - -#define VK_MAKE_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) -#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ - ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) -#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) -#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) -#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) -#define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VKSC_API_VARIANT 1 -#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0) -#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0) -#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0) -#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0) -#define VKSC_API_VERSION_1_0 VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, 0) -#define VK_HEADER_VERSION 272 -#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; -#define VK_USE_64_BIT_PTR_DEFINES 0 - -#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE - #if (VK_USE_64_BIT_PTR_DEFINES==1) - #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)) - #define VK_NULL_HANDLE nullptr - #else - #define VK_NULL_HANDLE ((void*)0) - #endif - #else - #define VK_NULL_HANDLE 0ULL - #endif -#endif -#ifndef VK_NULL_HANDLE - #define VK_NULL_HANDLE 0 -#endif - -#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE - #if (VK_USE_64_BIT_PTR_DEFINES==1) - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; - #else - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; - #endif -#endif -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) -VK_DEFINE_HANDLE(VkCommandBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeferredOperationKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) -typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; -VK_DEFINE_HANDLE(VkDevice) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNV) -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPerformanceConfigurationINTEL) -VK_DEFINE_HANDLE(VkPhysicalDevice) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot) -typedef VkPrivateDataSlot VkPrivateDataSlotEXT; -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) -VK_DEFINE_HANDLE(VkQueue) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) -typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) - -struct AHardwareBuffer; -struct ANativeWindow; -struct CAMetalLayer; -struct IOSurfaceRef; -struct MTLBuffer_id; -struct MTLCommandQueue_id; -struct MTLDevice_id; -struct MTLSharedEvent_id; -struct MTLTexture_id; -typedef uint32_t VkBool32; -typedef uint64_t VkDeviceAddress; -typedef uint64_t VkDeviceSize; -typedef uint32_t VkFlags; -typedef uint64_t VkFlags64; -typedef void* VkRemoteAddressNV; -typedef uint32_t VkSampleMask; - -typedef VkFlags VkAccelerationStructureCreateFlagsKHR; -typedef VkFlags VkAccelerationStructureMotionInfoFlagsNV; -typedef VkFlags VkAccelerationStructureMotionInstanceFlagsNV; -typedef VkFlags VkAccessFlags; -typedef VkFlags64 VkAccessFlags2; -typedef VkAccessFlags2 VkAccessFlags2KHR; -typedef VkFlags VkAcquireProfilingLockFlagsKHR; -typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; -typedef VkFlags VkAttachmentDescriptionFlags; -typedef VkFlags VkBufferCreateFlags; -typedef VkFlags VkBufferUsageFlags; -typedef VkFlags64 VkBufferUsageFlags2KHR; -typedef VkFlags VkBufferViewCreateFlags; -typedef VkFlags VkBuildAccelerationStructureFlagsKHR; -typedef VkBuildAccelerationStructureFlagsKHR VkBuildAccelerationStructureFlagsNV; -typedef VkFlags VkBuildMicromapFlagsEXT; -typedef VkFlags VkColorComponentFlags; -typedef VkFlags VkCommandBufferResetFlags; -typedef VkFlags VkCommandBufferUsageFlags; -typedef VkFlags VkCommandPoolCreateFlags; -typedef VkFlags VkCommandPoolResetFlags; -typedef VkFlags VkCommandPoolTrimFlags; -typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; -typedef VkFlags VkCompositeAlphaFlagsKHR; -typedef VkFlags VkConditionalRenderingFlagsEXT; -typedef VkFlags VkCullModeFlags; -typedef VkFlags VkDebugReportFlagsEXT; -typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; -typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; -typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; -typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; -typedef VkFlags VkDependencyFlags; -typedef VkFlags VkDescriptorBindingFlags; -typedef VkDescriptorBindingFlags VkDescriptorBindingFlagsEXT; -typedef VkFlags VkDescriptorPoolCreateFlags; -typedef VkFlags VkDescriptorPoolResetFlags; -typedef VkFlags VkDescriptorSetLayoutCreateFlags; -typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; -typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; -typedef VkFlags VkDeviceAddressBindingFlagsEXT; -typedef VkFlags VkDeviceCreateFlags; -typedef VkFlags VkDeviceDiagnosticsConfigFlagsNV; -typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; -typedef VkFlags VkDeviceMemoryReportFlagsEXT; -typedef VkFlags VkDeviceQueueCreateFlags; -typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; -typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT; -typedef VkFlags VkDisplayModeCreateFlagsKHR; -typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; -typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; -typedef VkFlags VkEventCreateFlags; -typedef VkFlags VkExportMetalObjectTypeFlagsEXT; -typedef VkFlags VkExternalFenceFeatureFlags; -typedef VkExternalFenceFeatureFlags VkExternalFenceFeatureFlagsKHR; -typedef VkFlags VkExternalFenceHandleTypeFlags; -typedef VkExternalFenceHandleTypeFlags VkExternalFenceHandleTypeFlagsKHR; -typedef VkFlags VkExternalMemoryFeatureFlags; -typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; -typedef VkFlags VkExternalMemoryFeatureFlagsNV; -typedef VkFlags VkExternalMemoryHandleTypeFlags; -typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; -typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; -typedef VkFlags VkExternalSemaphoreFeatureFlags; -typedef VkExternalSemaphoreFeatureFlags VkExternalSemaphoreFeatureFlagsKHR; -typedef VkFlags VkExternalSemaphoreHandleTypeFlags; -typedef VkExternalSemaphoreHandleTypeFlags VkExternalSemaphoreHandleTypeFlagsKHR; -typedef VkFlags VkFenceCreateFlags; -typedef VkFlags VkFenceImportFlags; -typedef VkFenceImportFlags VkFenceImportFlagsKHR; -typedef VkFlags VkFormatFeatureFlags; -typedef VkFlags64 VkFormatFeatureFlags2; -typedef VkFormatFeatureFlags2 VkFormatFeatureFlags2KHR; -typedef VkFlags VkFrameBoundaryFlagsEXT; -typedef VkFlags VkFramebufferCreateFlags; -typedef VkFlags VkGeometryFlagsKHR; -typedef VkGeometryFlagsKHR VkGeometryFlagsNV; -typedef VkFlags VkGeometryInstanceFlagsKHR; -typedef VkGeometryInstanceFlagsKHR VkGeometryInstanceFlagsNV; -typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; -typedef VkFlags VkHeadlessSurfaceCreateFlagsEXT; -typedef VkFlags VkHostImageCopyFlagsEXT; -typedef VkFlags VkIOSSurfaceCreateFlagsMVK; -typedef VkFlags VkImageAspectFlags; -typedef VkFlags VkImageCompressionFixedRateFlagsEXT; -typedef VkFlags VkImageCompressionFlagsEXT; -typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA; -typedef VkFlags VkImageCreateFlags; -typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA; -typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA; -typedef VkFlags VkImageUsageFlags; -typedef VkFlags VkImageViewCreateFlags; -typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNV; -typedef VkFlags VkIndirectStateFlagsNV; -typedef VkFlags VkInstanceCreateFlags; -typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; -typedef VkFlags VkMemoryAllocateFlags; -typedef VkMemoryAllocateFlags VkMemoryAllocateFlagsKHR; -typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV; -typedef VkFlags VkMemoryHeapFlags; -typedef VkFlags VkMemoryMapFlags; -typedef VkFlags VkMemoryPropertyFlags; -typedef VkFlags VkMemoryUnmapFlagsKHR; -typedef VkFlags VkMetalSurfaceCreateFlagsEXT; -typedef VkFlags VkMicromapCreateFlagsEXT; -typedef VkFlags VkOpticalFlowExecuteFlagsNV; -typedef VkFlags VkOpticalFlowGridSizeFlagsNV; -typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; -typedef VkFlags VkOpticalFlowUsageFlagsNV; -typedef VkFlags VkPeerMemoryFeatureFlags; -typedef VkPeerMemoryFeatureFlags VkPeerMemoryFeatureFlagsKHR; -typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR; -typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; -typedef VkFlags VkPipelineCacheCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; -typedef VkFlags VkPipelineCompilerControlFlagsAMD; -typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; -typedef VkFlags VkPipelineCoverageReductionStateCreateFlagsNV; -typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; -typedef VkFlags VkPipelineCreateFlags; -typedef VkFlags64 VkPipelineCreateFlags2KHR; -typedef VkFlags VkPipelineCreationFeedbackFlags; -typedef VkPipelineCreationFeedbackFlags VkPipelineCreationFeedbackFlagsEXT; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; -typedef VkFlags VkPipelineDynamicStateCreateFlags; -typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; -typedef VkFlags VkPipelineLayoutCreateFlags; -typedef VkFlags VkPipelineMultisampleStateCreateFlags; -typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; -typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT; -typedef VkFlags VkPipelineRasterizationStateCreateFlags; -typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT; -typedef VkFlags VkPipelineShaderStageCreateFlags; -typedef VkFlags VkPipelineStageFlags; -typedef VkFlags64 VkPipelineStageFlags2; -typedef VkPipelineStageFlags2 VkPipelineStageFlags2KHR; -typedef VkFlags VkPipelineTessellationStateCreateFlags; -typedef VkFlags VkPipelineVertexInputStateCreateFlags; -typedef VkFlags VkPipelineViewportStateCreateFlags; -typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; -typedef VkFlags VkPresentGravityFlagsEXT; -typedef VkFlags VkPresentScalingFlagsEXT; -typedef VkFlags VkPrivateDataSlotCreateFlags; -typedef VkPrivateDataSlotCreateFlags VkPrivateDataSlotCreateFlagsEXT; -typedef VkFlags VkQueryControlFlags; -typedef VkFlags VkQueryPipelineStatisticFlags; -typedef VkFlags VkQueryPoolCreateFlags; -typedef VkFlags VkQueryResultFlags; -typedef VkFlags VkQueueFlags; -typedef VkFlags VkRefreshObjectFlagsKHR; -typedef VkFlags VkRenderPassCreateFlags; -typedef VkFlags VkRenderingFlags; -typedef VkRenderingFlags VkRenderingFlagsKHR; -typedef VkFlags VkResolveModeFlags; -typedef VkResolveModeFlags VkResolveModeFlagsKHR; -typedef VkFlags VkSampleCountFlags; -typedef VkFlags VkSamplerCreateFlags; -typedef VkFlags VkScreenSurfaceCreateFlagsQNX; -typedef VkFlags VkSemaphoreCreateFlags; -typedef VkFlags VkSemaphoreImportFlags; -typedef VkSemaphoreImportFlags VkSemaphoreImportFlagsKHR; -typedef VkFlags VkSemaphoreWaitFlags; -typedef VkSemaphoreWaitFlags VkSemaphoreWaitFlagsKHR; -typedef VkFlags VkShaderCorePropertiesFlagsAMD; -typedef VkFlags VkShaderCreateFlagsEXT; -typedef VkFlags VkShaderModuleCreateFlags; -typedef VkFlags VkShaderStageFlags; -typedef VkFlags VkSparseImageFormatFlags; -typedef VkFlags VkSparseMemoryBindFlags; -typedef VkFlags VkStencilFaceFlags; -typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP; -typedef VkFlags VkSubgroupFeatureFlags; -typedef VkFlags VkSubmitFlags; -typedef VkSubmitFlags VkSubmitFlagsKHR; -typedef VkFlags VkSubpassDescriptionFlags; -typedef VkFlags VkSurfaceCounterFlagsEXT; -typedef VkFlags VkSurfaceTransformFlagsKHR; -typedef VkFlags VkSwapchainCreateFlagsKHR; -typedef VkFlags VkSwapchainImageUsageFlagsANDROID; -typedef VkFlags VkToolPurposeFlags; -typedef VkToolPurposeFlags VkToolPurposeFlagsEXT; -typedef VkFlags VkValidationCacheCreateFlagsEXT; -typedef VkFlags VkViSurfaceCreateFlagsNN; -typedef VkFlags VkVideoBeginCodingFlagsKHR; -typedef VkFlags VkVideoCapabilityFlagsKHR; -typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; -typedef VkFlags VkVideoCodecOperationFlagsKHR; -typedef VkFlags VkVideoCodingControlFlagsKHR; -typedef VkFlags VkVideoComponentBitDepthFlagsKHR; -typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; -typedef VkFlags VkVideoDecodeFlagsKHR; -typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; -typedef VkFlags VkVideoDecodeUsageFlagsKHR; -typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; -typedef VkFlags VkVideoEncodeContentFlagsKHR; -typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; -typedef VkFlags VkVideoEncodeFlagsKHR; -typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT; -typedef VkFlags VkVideoEncodeH264RateControlFlagsEXT; -typedef VkFlags VkVideoEncodeH264StdFlagsEXT; -typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT; -typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT; -typedef VkFlags VkVideoEncodeH265RateControlFlagsEXT; -typedef VkFlags VkVideoEncodeH265StdFlagsEXT; -typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT; -typedef VkFlags VkVideoEncodeRateControlFlagsKHR; -typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; -typedef VkFlags VkVideoEncodeUsageFlagsKHR; -typedef VkFlags VkVideoEndCodingFlagsKHR; -typedef VkFlags VkVideoSessionCreateFlagsKHR; -typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; -typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; -typedef VkFlags VkWin32SurfaceCreateFlagsKHR; -typedef VkFlags VkXcbSurfaceCreateFlagsKHR; -typedef VkFlags VkXlibSurfaceCreateFlagsKHR; - -typedef enum VkAccelerationStructureBuildTypeKHR -{ - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureBuildTypeKHR; - -typedef enum VkAccelerationStructureCompatibilityKHR -{ - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureCompatibilityKHR; - -typedef enum VkAccelerationStructureCreateFlagBitsKHR -{ - VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x00000001, - VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0x00000004, - VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, - VK_ACCELERATION_STRUCTURE_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureCreateFlagBitsKHR; - -typedef enum VkAccelerationStructureMemoryRequirementsTypeNV -{ - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV = 0, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV = 1, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV = 2, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureMemoryRequirementsTypeNV; - -typedef enum VkAccelerationStructureMotionInstanceTypeNV -{ - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV = 0, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV = 1, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV = 2, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureMotionInstanceTypeNV; - -typedef enum VkAccelerationStructureTypeKHR -{ - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR = 0, - VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR = 1, - VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR = 2, - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV = VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, - VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV = VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, - VK_ACCELERATION_STRUCTURE_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureTypeKHR; -typedef VkAccelerationStructureTypeKHR VkAccelerationStructureTypeNV; - -typedef enum VkAccessFlagBits -{ - VK_ACCESS_NONE = 0, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, - VK_ACCESS_INDEX_READ_BIT = 0x00000002, - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, - VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, - VK_ACCESS_SHADER_READ_BIT = 0x00000020, - VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, - VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, - VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, - VK_ACCESS_HOST_READ_BIT = 0x00002000, - VK_ACCESS_HOST_WRITE_BIT = 0x00004000, - VK_ACCESS_MEMORY_READ_BIT = 0x00008000, - VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, - VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000, - VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000, - VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, - VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000, - VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000, - VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000, - VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000, - VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000, - VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000, - VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000, - VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000, - VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR, - VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR, - VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, - VK_ACCESS_NONE_KHR = VK_ACCESS_NONE, - VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkAccessFlagBits; - -typedef VkFlags64 VkAccessFlagBits2; - -static const VkAccessFlagBits2 VK_ACCESS_2_NONE = 0ull; -static const VkAccessFlagBits2 VK_ACCESS_2_NONE_KHR = 0ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT = 0x00000001ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 0x00000001ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT = 0x00000002ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT_KHR = 0x00000002ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR = 0x00000004ull; -static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT = 0x00000008ull; -static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT_KHR = 0x00000008ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT = 0x00000010ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR = 0x00000010ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT = 0x00000020ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT_KHR = 0x00000020ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT = 0x00000040ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT_KHR = 0x00000040ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT = 0x00000080ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR = 0x00000080ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR = 0x00000100ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR = 0x00000200ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR = 0x00000400ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT = 0x00000800ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT_KHR = 0x00000800ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT = 0x00001000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR = 0x00001000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT = 0x00002000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT_KHR = 0x00002000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT = 0x00004000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT_KHR = 0x00004000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT = 0x00008000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT_KHR = 0x00008000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT = 0x00010000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT_KHR = 0x00010000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT = 0x100000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR = 0x100000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 0x200000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 0x200000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 0x400000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI = 0x8000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR = 0x10000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT = 0x20000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV = 0x40000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV = 0x80000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_READ_BIT_EXT = 0x100000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0x200000000000ull; -typedef VkAccessFlagBits2 VkAccessFlagBits2KHR; - -typedef enum VkAcquireProfilingLockFlagBitsKHR -{ - VK_ACQUIRE_PROFILING_LOCK_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkAcquireProfilingLockFlagBitsKHR; - -typedef enum VkAttachmentDescriptionFlagBits -{ - VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, - VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkAttachmentDescriptionFlagBits; - -typedef enum VkAttachmentLoadOp -{ - VK_ATTACHMENT_LOAD_OP_LOAD = 0, - VK_ATTACHMENT_LOAD_OP_CLEAR = 1, - VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, - VK_ATTACHMENT_LOAD_OP_NONE_EXT = 1000400000, - VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7fffffff, -} VkAttachmentLoadOp; - -typedef enum VkAttachmentStoreOp -{ - VK_ATTACHMENT_STORE_OP_STORE = 0, - VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, - VK_ATTACHMENT_STORE_OP_NONE = 1000301000, - VK_ATTACHMENT_STORE_OP_NONE_KHR = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_NONE_QCOM = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_NONE_EXT = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7fffffff, -} VkAttachmentStoreOp; - -typedef enum VkBlendFactor -{ - VK_BLEND_FACTOR_ZERO = 0, - VK_BLEND_FACTOR_ONE = 1, - VK_BLEND_FACTOR_SRC_COLOR = 2, - VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - VK_BLEND_FACTOR_DST_COLOR = 4, - VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - VK_BLEND_FACTOR_SRC_ALPHA = 6, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - VK_BLEND_FACTOR_DST_ALPHA = 8, - VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - VK_BLEND_FACTOR_CONSTANT_COLOR = 10, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - VK_BLEND_FACTOR_SRC1_COLOR = 15, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - VK_BLEND_FACTOR_SRC1_ALPHA = 17, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, - VK_BLEND_FACTOR_MAX_ENUM = 0x7fffffff, -} VkBlendFactor; - -typedef enum VkBlendOp -{ - VK_BLEND_OP_ADD = 0, - VK_BLEND_OP_SUBTRACT = 1, - VK_BLEND_OP_REVERSE_SUBTRACT = 2, - VK_BLEND_OP_MIN = 3, - VK_BLEND_OP_MAX = 4, - VK_BLEND_OP_ZERO_EXT = 1000148000, - VK_BLEND_OP_SRC_EXT = 1000148001, - VK_BLEND_OP_DST_EXT = 1000148002, - VK_BLEND_OP_SRC_OVER_EXT = 1000148003, - VK_BLEND_OP_DST_OVER_EXT = 1000148004, - VK_BLEND_OP_SRC_IN_EXT = 1000148005, - VK_BLEND_OP_DST_IN_EXT = 1000148006, - VK_BLEND_OP_SRC_OUT_EXT = 1000148007, - VK_BLEND_OP_DST_OUT_EXT = 1000148008, - VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, - VK_BLEND_OP_DST_ATOP_EXT = 1000148010, - VK_BLEND_OP_XOR_EXT = 1000148011, - VK_BLEND_OP_MULTIPLY_EXT = 1000148012, - VK_BLEND_OP_SCREEN_EXT = 1000148013, - VK_BLEND_OP_OVERLAY_EXT = 1000148014, - VK_BLEND_OP_DARKEN_EXT = 1000148015, - VK_BLEND_OP_LIGHTEN_EXT = 1000148016, - VK_BLEND_OP_COLORDODGE_EXT = 1000148017, - VK_BLEND_OP_COLORBURN_EXT = 1000148018, - VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, - VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, - VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, - VK_BLEND_OP_EXCLUSION_EXT = 1000148022, - VK_BLEND_OP_INVERT_EXT = 1000148023, - VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, - VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, - VK_BLEND_OP_LINEARBURN_EXT = 1000148026, - VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, - VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, - VK_BLEND_OP_PINLIGHT_EXT = 1000148029, - VK_BLEND_OP_HARDMIX_EXT = 1000148030, - VK_BLEND_OP_HSL_HUE_EXT = 1000148031, - VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, - VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, - VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, - VK_BLEND_OP_PLUS_EXT = 1000148035, - VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, - VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, - VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, - VK_BLEND_OP_MINUS_EXT = 1000148039, - VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, - VK_BLEND_OP_CONTRAST_EXT = 1000148041, - VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, - VK_BLEND_OP_RED_EXT = 1000148043, - VK_BLEND_OP_GREEN_EXT = 1000148044, - VK_BLEND_OP_BLUE_EXT = 1000148045, - VK_BLEND_OP_MAX_ENUM = 0x7fffffff, -} VkBlendOp; - -typedef enum VkBlendOverlapEXT -{ - VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, - VK_BLEND_OVERLAP_DISJOINT_EXT = 1, - VK_BLEND_OVERLAP_CONJOINT_EXT = 2, - VK_BLEND_OVERLAP_EXT_MAX_ENUM = 0x7fffffff, -} VkBlendOverlapEXT; - -typedef enum VkBlockMatchWindowCompareModeQCOM -{ - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM = 0, - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM = 1, - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_QCOM_MAX_ENUM = 0x7fffffff, -} VkBlockMatchWindowCompareModeQCOM; - -typedef enum VkBorderColor -{ - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, - VK_BORDER_COLOR_FLOAT_CUSTOM_EXT = 1000287003, - VK_BORDER_COLOR_INT_CUSTOM_EXT = 1000287004, - VK_BORDER_COLOR_MAX_ENUM = 0x7fffffff, -} VkBorderColor; - -typedef enum VkBufferCreateFlagBits -{ - VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000010, - VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000020, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkBufferCreateFlagBits; - -typedef enum VkBufferUsageFlagBits -{ - VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, - VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, - VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400, - VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800, - VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 0x00020000, - VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000, - VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000, - VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000, - VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000, - VK_BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000, - VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT = 0x01000000, - VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000, - VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, - VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkBufferUsageFlagBits; - -typedef VkFlags64 VkBufferUsageFlagBits2KHR; - -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR = 0x00000001ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR = 0x00000002ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000004ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000008ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR = 0x00000010ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR = 0x00000020ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR = 0x00000040ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR = 0x00000080ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR = 0x00000100ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RAY_TRACING_BIT_NV = 0x00000400ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR = 0x00004000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR = 0x00020000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT = 0x01000000ull; -static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000ull; - -typedef enum VkBuildAccelerationStructureFlagBitsKHR -{ - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR = 0x00000001, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR = 0x00000002, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR = 0x00000004, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = 0x00000008, - VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR = 0x00000010, - VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV = 0x00000020, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT = 0x00000040, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000080, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT = 0x00000100, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR = 0x00000800, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkBuildAccelerationStructureFlagBitsKHR; -typedef VkBuildAccelerationStructureFlagBitsKHR VkBuildAccelerationStructureFlagBitsNV; - -typedef enum VkBuildAccelerationStructureModeKHR -{ - VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR = 0, - VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR = 1, - VK_BUILD_ACCELERATION_STRUCTURE_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkBuildAccelerationStructureModeKHR; - -typedef enum VkBuildMicromapFlagBitsEXT -{ - VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT = 0x00000001, - VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0x00000002, - VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0x00000004, - VK_BUILD_MICROMAP_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkBuildMicromapFlagBitsEXT; - -typedef enum VkBuildMicromapModeEXT -{ - VK_BUILD_MICROMAP_MODE_BUILD_EXT = 0, - VK_BUILD_MICROMAP_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkBuildMicromapModeEXT; - -typedef enum VkChromaLocation -{ - VK_CHROMA_LOCATION_COSITED_EVEN = 0, - VK_CHROMA_LOCATION_MIDPOINT = 1, - VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, - VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, - VK_CHROMA_LOCATION_MAX_ENUM = 0x7fffffff, -} VkChromaLocation; -typedef VkChromaLocation VkChromaLocationKHR; - -typedef enum VkCoarseSampleOrderTypeNV -{ - VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV = 0, - VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV = 1, - VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV = 2, - VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV = 3, - VK_COARSE_SAMPLE_ORDER_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkCoarseSampleOrderTypeNV; - -typedef enum VkColorComponentFlagBits -{ - VK_COLOR_COMPONENT_R_BIT = 0x00000001, - VK_COLOR_COMPONENT_G_BIT = 0x00000002, - VK_COLOR_COMPONENT_B_BIT = 0x00000004, - VK_COLOR_COMPONENT_A_BIT = 0x00000008, - VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkColorComponentFlagBits; - -typedef enum VkColorSpaceKHR -{ - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, - VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, - VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104003, - VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, - VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, - VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, - VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, - VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, - VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, - VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, - VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, - VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, - VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, - VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, - VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT, - VK_COLOR_SPACE_KHR_MAX_ENUM = 0x7fffffff, -} VkColorSpaceKHR; - -typedef enum VkCommandBufferLevel -{ - VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, - VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, - VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7fffffff, -} VkCommandBufferLevel; - -typedef enum VkCommandBufferResetFlagBits -{ - VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandBufferResetFlagBits; - -typedef enum VkCommandBufferUsageFlagBits -{ - VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, - VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, - VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, - VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandBufferUsageFlagBits; - -typedef enum VkCommandPoolCreateFlagBits -{ - VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, - VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0x00000004, - VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandPoolCreateFlagBits; - -typedef enum VkCommandPoolResetFlagBits -{ - VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandPoolResetFlagBits; - -typedef enum VkCompareOp -{ - VK_COMPARE_OP_NEVER = 0, - VK_COMPARE_OP_LESS = 1, - VK_COMPARE_OP_EQUAL = 2, - VK_COMPARE_OP_LESS_OR_EQUAL = 3, - VK_COMPARE_OP_GREATER = 4, - VK_COMPARE_OP_NOT_EQUAL = 5, - VK_COMPARE_OP_GREATER_OR_EQUAL = 6, - VK_COMPARE_OP_ALWAYS = 7, - VK_COMPARE_OP_MAX_ENUM = 0x7fffffff, -} VkCompareOp; - -typedef enum VkComponentSwizzle -{ - VK_COMPONENT_SWIZZLE_IDENTITY = 0, - VK_COMPONENT_SWIZZLE_ZERO = 1, - VK_COMPONENT_SWIZZLE_ONE = 2, - VK_COMPONENT_SWIZZLE_R = 3, - VK_COMPONENT_SWIZZLE_G = 4, - VK_COMPONENT_SWIZZLE_B = 5, - VK_COMPONENT_SWIZZLE_A = 6, - VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7fffffff, -} VkComponentSwizzle; - -typedef enum VkComponentTypeKHR -{ - VK_COMPONENT_TYPE_FLOAT16_KHR = 0, - VK_COMPONENT_TYPE_FLOAT32_KHR = 1, - VK_COMPONENT_TYPE_FLOAT64_KHR = 2, - VK_COMPONENT_TYPE_SINT8_KHR = 3, - VK_COMPONENT_TYPE_SINT16_KHR = 4, - VK_COMPONENT_TYPE_SINT32_KHR = 5, - VK_COMPONENT_TYPE_SINT64_KHR = 6, - VK_COMPONENT_TYPE_UINT8_KHR = 7, - VK_COMPONENT_TYPE_UINT16_KHR = 8, - VK_COMPONENT_TYPE_UINT32_KHR = 9, - VK_COMPONENT_TYPE_UINT64_KHR = 10, - VK_COMPONENT_TYPE_FLOAT16_NV = VK_COMPONENT_TYPE_FLOAT16_KHR, - VK_COMPONENT_TYPE_FLOAT32_NV = VK_COMPONENT_TYPE_FLOAT32_KHR, - VK_COMPONENT_TYPE_FLOAT64_NV = VK_COMPONENT_TYPE_FLOAT64_KHR, - VK_COMPONENT_TYPE_SINT8_NV = VK_COMPONENT_TYPE_SINT8_KHR, - VK_COMPONENT_TYPE_SINT16_NV = VK_COMPONENT_TYPE_SINT16_KHR, - VK_COMPONENT_TYPE_SINT32_NV = VK_COMPONENT_TYPE_SINT32_KHR, - VK_COMPONENT_TYPE_SINT64_NV = VK_COMPONENT_TYPE_SINT64_KHR, - VK_COMPONENT_TYPE_UINT8_NV = VK_COMPONENT_TYPE_UINT8_KHR, - VK_COMPONENT_TYPE_UINT16_NV = VK_COMPONENT_TYPE_UINT16_KHR, - VK_COMPONENT_TYPE_UINT32_NV = VK_COMPONENT_TYPE_UINT32_KHR, - VK_COMPONENT_TYPE_UINT64_NV = VK_COMPONENT_TYPE_UINT64_KHR, - VK_COMPONENT_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkComponentTypeKHR; -typedef VkComponentTypeKHR VkComponentTypeNV; - -typedef enum VkCompositeAlphaFlagBitsKHR -{ - VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, - VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, - VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, - VK_COMPOSITE_ALPHA_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkCompositeAlphaFlagBitsKHR; - -typedef enum VkConditionalRenderingFlagBitsEXT -{ - VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT = 0x00000001, - VK_CONDITIONAL_RENDERING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkConditionalRenderingFlagBitsEXT; - -typedef enum VkConservativeRasterizationModeEXT -{ - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, - VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, - VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, - VK_CONSERVATIVE_RASTERIZATION_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkConservativeRasterizationModeEXT; - -typedef enum VkCopyAccelerationStructureModeKHR -{ - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR = 0, - VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR = 1, - VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR = 2, - VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR = 3, - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR, - VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR, - VK_COPY_ACCELERATION_STRUCTURE_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkCopyAccelerationStructureModeKHR; -typedef VkCopyAccelerationStructureModeKHR VkCopyAccelerationStructureModeNV; - -typedef enum VkCopyMicromapModeEXT -{ - VK_COPY_MICROMAP_MODE_CLONE_EXT = 0, - VK_COPY_MICROMAP_MODE_SERIALIZE_EXT = 1, - VK_COPY_MICROMAP_MODE_DESERIALIZE_EXT = 2, - VK_COPY_MICROMAP_MODE_COMPACT_EXT = 3, - VK_COPY_MICROMAP_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkCopyMicromapModeEXT; - -typedef enum VkCoverageModulationModeNV -{ - VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, - VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, - VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, - VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, - VK_COVERAGE_MODULATION_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkCoverageModulationModeNV; - -typedef enum VkCoverageReductionModeNV -{ - VK_COVERAGE_REDUCTION_MODE_MERGE_NV = 0, - VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV = 1, - VK_COVERAGE_REDUCTION_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkCoverageReductionModeNV; - -typedef enum VkCubicFilterWeightsQCOM -{ - VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM = 0, - VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM = 1, - VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM = 2, - VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM = 3, - VK_CUBIC_FILTER_WEIGHTS_QCOM_MAX_ENUM = 0x7fffffff, -} VkCubicFilterWeightsQCOM; - -typedef enum VkCullModeFlagBits -{ - VK_CULL_MODE_NONE = 0, - VK_CULL_MODE_FRONT_BIT = 0x00000001, - VK_CULL_MODE_BACK_BIT = 0x00000002, - VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, - VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCullModeFlagBits; - -typedef enum VkDebugReportFlagBitsEXT -{ - VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, - VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, - VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, - VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, - VK_DEBUG_REPORT_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugReportFlagBitsEXT; - -typedef enum VkDebugReportObjectTypeEXT -{ - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT = 1000029000, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, - VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV_EXT = 1000307000, - VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV_EXT = 1000307001, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugReportObjectTypeEXT; - -typedef enum VkDebugUtilsMessageSeverityFlagBitsEXT -{ - VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT = 0x00000001, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0x00000010, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0x00000100, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0x00001000, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugUtilsMessageSeverityFlagBitsEXT; - -typedef enum VkDebugUtilsMessageTypeFlagBitsEXT -{ - VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001, - VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002, - VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004, - VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0x00000008, - VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugUtilsMessageTypeFlagBitsEXT; - -typedef enum VkDependencyFlagBits -{ - VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, - VK_DEPENDENCY_VIEW_LOCAL_BIT = 0x00000002, - VK_DEPENDENCY_DEVICE_GROUP_BIT = 0x00000004, - VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT = 0x00000008, - VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR = VK_DEPENDENCY_VIEW_LOCAL_BIT, - VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT, - VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDependencyFlagBits; - -typedef enum VkDepthBiasRepresentationEXT -{ - VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORMAT_EXT = 0, - VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT = 1, - VK_DEPTH_BIAS_REPRESENTATION_FLOAT_EXT = 2, - VK_DEPTH_BIAS_REPRESENTATION_EXT_MAX_ENUM = 0x7fffffff, -} VkDepthBiasRepresentationEXT; - -typedef enum VkDescriptorBindingFlagBits -{ - VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT = 0x00000001, - VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT = 0x00000002, - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT = 0x00000004, - VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = 0x00000008, - VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, - VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, - VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, - VK_DESCRIPTOR_BINDING_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorBindingFlagBits; -typedef VkDescriptorBindingFlagBits VkDescriptorBindingFlagBitsEXT; - -typedef enum VkDescriptorPoolCreateFlagBits -{ - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, - VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0x00000002, - VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0x00000004, - VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV = 0x00000008, - VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV = 0x00000010, - VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, - VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT, - VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorPoolCreateFlagBits; - -typedef enum VkDescriptorSetLayoutCreateFlagBits -{ - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT = 0x00000002, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT = 0x00000004, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00000010, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0x00000020, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00000080, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorSetLayoutCreateFlagBits; - -typedef enum VkDescriptorType -{ - VK_DESCRIPTOR_TYPE_SAMPLER = 0, - VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, - VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, - VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, - VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, - VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, - VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, - VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK = 1000138000, - VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000, - VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, - VK_DESCRIPTOR_TYPE_MUTABLE_EXT = 1000351000, - VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM = 1000440000, - VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM = 1000440001, - VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, - VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = VK_DESCRIPTOR_TYPE_MUTABLE_EXT, - VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7fffffff, -} VkDescriptorType; - -typedef enum VkDescriptorUpdateTemplateType -{ - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7fffffff, -} VkDescriptorUpdateTemplateType; -typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; - -typedef enum VkDeviceAddressBindingFlagBitsEXT -{ - VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0x00000001, - VK_DEVICE_ADDRESS_BINDING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceAddressBindingFlagBitsEXT; - -typedef enum VkDeviceAddressBindingTypeEXT -{ - VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT = 0, - VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT = 1, - VK_DEVICE_ADDRESS_BINDING_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceAddressBindingTypeEXT; - -typedef enum VkDeviceDiagnosticsConfigFlagBitsNV -{ - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV = 0x00000001, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV = 0x00000002, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV = 0x00000004, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV = 0x00000008, - VK_DEVICE_DIAGNOSTICS_CONFIG_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkDeviceDiagnosticsConfigFlagBitsNV; - -typedef enum VkDeviceFaultAddressTypeEXT -{ - VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT = 0, - VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT = 1, - VK_DEVICE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT = 2, - VK_DEVICE_FAULT_ADDRESS_TYPE_EXECUTE_INVALID_EXT = 3, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_UNKNOWN_EXT = 4, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_INVALID_EXT = 5, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_FAULT_EXT = 6, - VK_DEVICE_FAULT_ADDRESS_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceFaultAddressTypeEXT; - -typedef enum VkDeviceFaultVendorBinaryHeaderVersionEXT -{ - VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT = 1, - VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceFaultVendorBinaryHeaderVersionEXT; - -typedef enum VkDeviceGroupPresentModeFlagBitsKHR -{ - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 0x00000001, - VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 0x00000002, - VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0x00000004, - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0x00000008, - VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkDeviceGroupPresentModeFlagBitsKHR; - -typedef enum VkDeviceQueueCreateFlagBits -{ - VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, - VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDeviceQueueCreateFlagBits; - -typedef enum VkDiscardRectangleModeEXT -{ - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, - VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, - VK_DISCARD_RECTANGLE_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkDiscardRectangleModeEXT; - -typedef enum VkDriverId -{ - VK_DRIVER_ID_AMD_PROPRIETARY = 1, - VK_DRIVER_ID_AMD_OPEN_SOURCE = 2, - VK_DRIVER_ID_MESA_RADV = 3, - VK_DRIVER_ID_NVIDIA_PROPRIETARY = 4, - VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS = 5, - VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA = 6, - VK_DRIVER_ID_IMAGINATION_PROPRIETARY = 7, - VK_DRIVER_ID_QUALCOMM_PROPRIETARY = 8, - VK_DRIVER_ID_ARM_PROPRIETARY = 9, - VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10, - VK_DRIVER_ID_GGP_PROPRIETARY = 11, - VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12, - VK_DRIVER_ID_MESA_LLVMPIPE = 13, - VK_DRIVER_ID_MOLTENVK = 14, - VK_DRIVER_ID_COREAVI_PROPRIETARY = 15, - VK_DRIVER_ID_JUICE_PROPRIETARY = 16, - VK_DRIVER_ID_VERISILICON_PROPRIETARY = 17, - VK_DRIVER_ID_MESA_TURNIP = 18, - VK_DRIVER_ID_MESA_V3DV = 19, - VK_DRIVER_ID_MESA_PANVK = 20, - VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21, - VK_DRIVER_ID_MESA_VENUS = 22, - VK_DRIVER_ID_MESA_DOZEN = 23, - VK_DRIVER_ID_MESA_NVK = 24, - VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, - VK_DRIVER_ID_MESA_AGXV = 26, - VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, - VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, - VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, - VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR = VK_DRIVER_ID_NVIDIA_PROPRIETARY, - VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR = VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, - VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, - VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR = VK_DRIVER_ID_IMAGINATION_PROPRIETARY, - VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR = VK_DRIVER_ID_QUALCOMM_PROPRIETARY, - VK_DRIVER_ID_ARM_PROPRIETARY_KHR = VK_DRIVER_ID_ARM_PROPRIETARY, - VK_DRIVER_ID_GOOGLE_SWIFTSHADER_KHR = VK_DRIVER_ID_GOOGLE_SWIFTSHADER, - VK_DRIVER_ID_GGP_PROPRIETARY_KHR = VK_DRIVER_ID_GGP_PROPRIETARY, - VK_DRIVER_ID_BROADCOM_PROPRIETARY_KHR = VK_DRIVER_ID_BROADCOM_PROPRIETARY, - VK_DRIVER_ID_MAX_ENUM = 0x7fffffff, -} VkDriverId; -typedef VkDriverId VkDriverIdKHR; - -typedef enum VkDynamicState -{ - VK_DYNAMIC_STATE_VIEWPORT = 0, - VK_DYNAMIC_STATE_SCISSOR = 1, - VK_DYNAMIC_STATE_LINE_WIDTH = 2, - VK_DYNAMIC_STATE_DEPTH_BIAS = 3, - VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, - VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, - VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT = 1000099001, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT = 1000099002, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, - VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004, - VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006, - VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000, - VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, - VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000, - VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = 1000259000, - VK_DYNAMIC_STATE_CULL_MODE = 1000267000, - VK_DYNAMIC_STATE_FRONT_FACE = 1000267001, - VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = 1000267002, - VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT = 1000267003, - VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT = 1000267004, - VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE = 1000267005, - VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE = 1000267006, - VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE = 1000267007, - VK_DYNAMIC_STATE_DEPTH_COMPARE_OP = 1000267008, - VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE = 1000267009, - VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE = 1000267010, - VK_DYNAMIC_STATE_STENCIL_OP = 1000267011, - VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000, - VK_DYNAMIC_STATE_VERTEX_INPUT_EXT = 1000352000, - VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000, - VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE = 1000377001, - VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE = 1000377002, - VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003, - VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004, - VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000, - VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002, - VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003, - VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004, - VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005, - VK_DYNAMIC_STATE_SAMPLE_MASK_EXT = 1000455006, - VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT = 1000455007, - VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT = 1000455008, - VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT = 1000455009, - VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010, - VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011, - VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012, - VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013, - VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014, - VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015, - VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT = 1000455016, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT = 1000455017, - VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT = 1000455018, - VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT = 1000455019, - VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT = 1000455020, - VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT = 1000455021, - VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT = 1000455022, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV = 1000455023, - VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV = 1000455024, - VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV = 1000455025, - VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV = 1000455026, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV = 1000455027, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV = 1000455028, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV = 1000455029, - VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV = 1000455030, - VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031, - VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032, - VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000, - VK_DYNAMIC_STATE_CULL_MODE_EXT = VK_DYNAMIC_STATE_CULL_MODE, - VK_DYNAMIC_STATE_FRONT_FACE_EXT = VK_DYNAMIC_STATE_FRONT_FACE, - VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, - VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT, - VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT, - VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE, - VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE, - VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE, - VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP, - VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE, - VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE, - VK_DYNAMIC_STATE_STENCIL_OP_EXT = VK_DYNAMIC_STATE_STENCIL_OP, - VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT = VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE, - VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE, - VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, - VK_DYNAMIC_STATE_MAX_ENUM = 0x7fffffff, -} VkDynamicState; - -typedef enum VkEventCreateFlagBits -{ - VK_EVENT_CREATE_DEVICE_ONLY_BIT = 0x00000001, - VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR = VK_EVENT_CREATE_DEVICE_ONLY_BIT, - VK_EVENT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkEventCreateFlagBits; - -typedef enum VkExternalFenceFeatureFlagBits -{ - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0x00000001, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalFenceFeatureFlagBits; -typedef VkExternalFenceFeatureFlagBits VkExternalFenceFeatureFlagBitsKHR; - -typedef enum VkExternalFenceHandleTypeFlagBits -{ - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000008, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalFenceHandleTypeFlagBits; -typedef VkExternalFenceHandleTypeFlagBits VkExternalFenceHandleTypeFlagBitsKHR; - -typedef enum VkExternalMemoryFeatureFlagBits -{ - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalMemoryFeatureFlagBits; -typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; - -typedef enum VkExternalMemoryHandleTypeFlagBits -{ - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalMemoryHandleTypeFlagBits; -typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; - -typedef enum VkExternalSemaphoreFeatureFlagBits -{ - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0x00000001, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalSemaphoreFeatureFlagBits; -typedef VkExternalSemaphoreFeatureFlagBits VkExternalSemaphoreFeatureFlagBitsKHR; - -typedef enum VkExternalSemaphoreHandleTypeFlagBits -{ - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 0x00000008, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000010, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalSemaphoreHandleTypeFlagBits; -typedef VkExternalSemaphoreHandleTypeFlagBits VkExternalSemaphoreHandleTypeFlagBitsKHR; - -typedef enum VkFenceCreateFlagBits -{ - VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, - VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFenceCreateFlagBits; - -typedef enum VkFenceImportFlagBits -{ - VK_FENCE_IMPORT_TEMPORARY_BIT = 0x00000001, - VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = VK_FENCE_IMPORT_TEMPORARY_BIT, - VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFenceImportFlagBits; -typedef VkFenceImportFlagBits VkFenceImportFlagBitsKHR; - -typedef enum VkFilter -{ - VK_FILTER_NEAREST = 0, - VK_FILTER_LINEAR = 1, - VK_FILTER_CUBIC_EXT = 1000015000, - VK_FILTER_CUBIC_IMG = VK_FILTER_CUBIC_EXT, - VK_FILTER_MAX_ENUM = 0x7fffffff, -} VkFilter; - -typedef enum VkFormat -{ - VK_FORMAT_UNDEFINED = 0, - VK_FORMAT_R4G4_UNORM_PACK8 = 1, - VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, - VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, - VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, - VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, - VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, - VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, - VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, - VK_FORMAT_R8_UNORM = 9, - VK_FORMAT_R8_SNORM = 10, - VK_FORMAT_R8_USCALED = 11, - VK_FORMAT_R8_SSCALED = 12, - VK_FORMAT_R8_UINT = 13, - VK_FORMAT_R8_SINT = 14, - VK_FORMAT_R8_SRGB = 15, - VK_FORMAT_R8G8_UNORM = 16, - VK_FORMAT_R8G8_SNORM = 17, - VK_FORMAT_R8G8_USCALED = 18, - VK_FORMAT_R8G8_SSCALED = 19, - VK_FORMAT_R8G8_UINT = 20, - VK_FORMAT_R8G8_SINT = 21, - VK_FORMAT_R8G8_SRGB = 22, - VK_FORMAT_R8G8B8_UNORM = 23, - VK_FORMAT_R8G8B8_SNORM = 24, - VK_FORMAT_R8G8B8_USCALED = 25, - VK_FORMAT_R8G8B8_SSCALED = 26, - VK_FORMAT_R8G8B8_UINT = 27, - VK_FORMAT_R8G8B8_SINT = 28, - VK_FORMAT_R8G8B8_SRGB = 29, - VK_FORMAT_B8G8R8_UNORM = 30, - VK_FORMAT_B8G8R8_SNORM = 31, - VK_FORMAT_B8G8R8_USCALED = 32, - VK_FORMAT_B8G8R8_SSCALED = 33, - VK_FORMAT_B8G8R8_UINT = 34, - VK_FORMAT_B8G8R8_SINT = 35, - VK_FORMAT_B8G8R8_SRGB = 36, - VK_FORMAT_R8G8B8A8_UNORM = 37, - VK_FORMAT_R8G8B8A8_SNORM = 38, - VK_FORMAT_R8G8B8A8_USCALED = 39, - VK_FORMAT_R8G8B8A8_SSCALED = 40, - VK_FORMAT_R8G8B8A8_UINT = 41, - VK_FORMAT_R8G8B8A8_SINT = 42, - VK_FORMAT_R8G8B8A8_SRGB = 43, - VK_FORMAT_B8G8R8A8_UNORM = 44, - VK_FORMAT_B8G8R8A8_SNORM = 45, - VK_FORMAT_B8G8R8A8_USCALED = 46, - VK_FORMAT_B8G8R8A8_SSCALED = 47, - VK_FORMAT_B8G8R8A8_UINT = 48, - VK_FORMAT_B8G8R8A8_SINT = 49, - VK_FORMAT_B8G8R8A8_SRGB = 50, - VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, - VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, - VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, - VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, - VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, - VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, - VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, - VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, - VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, - VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, - VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, - VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, - VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, - VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, - VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, - VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, - VK_FORMAT_R16_UNORM = 70, - VK_FORMAT_R16_SNORM = 71, - VK_FORMAT_R16_USCALED = 72, - VK_FORMAT_R16_SSCALED = 73, - VK_FORMAT_R16_UINT = 74, - VK_FORMAT_R16_SINT = 75, - VK_FORMAT_R16_SFLOAT = 76, - VK_FORMAT_R16G16_UNORM = 77, - VK_FORMAT_R16G16_SNORM = 78, - VK_FORMAT_R16G16_USCALED = 79, - VK_FORMAT_R16G16_SSCALED = 80, - VK_FORMAT_R16G16_UINT = 81, - VK_FORMAT_R16G16_SINT = 82, - VK_FORMAT_R16G16_SFLOAT = 83, - VK_FORMAT_R16G16B16_UNORM = 84, - VK_FORMAT_R16G16B16_SNORM = 85, - VK_FORMAT_R16G16B16_USCALED = 86, - VK_FORMAT_R16G16B16_SSCALED = 87, - VK_FORMAT_R16G16B16_UINT = 88, - VK_FORMAT_R16G16B16_SINT = 89, - VK_FORMAT_R16G16B16_SFLOAT = 90, - VK_FORMAT_R16G16B16A16_UNORM = 91, - VK_FORMAT_R16G16B16A16_SNORM = 92, - VK_FORMAT_R16G16B16A16_USCALED = 93, - VK_FORMAT_R16G16B16A16_SSCALED = 94, - VK_FORMAT_R16G16B16A16_UINT = 95, - VK_FORMAT_R16G16B16A16_SINT = 96, - VK_FORMAT_R16G16B16A16_SFLOAT = 97, - VK_FORMAT_R32_UINT = 98, - VK_FORMAT_R32_SINT = 99, - VK_FORMAT_R32_SFLOAT = 100, - VK_FORMAT_R32G32_UINT = 101, - VK_FORMAT_R32G32_SINT = 102, - VK_FORMAT_R32G32_SFLOAT = 103, - VK_FORMAT_R32G32B32_UINT = 104, - VK_FORMAT_R32G32B32_SINT = 105, - VK_FORMAT_R32G32B32_SFLOAT = 106, - VK_FORMAT_R32G32B32A32_UINT = 107, - VK_FORMAT_R32G32B32A32_SINT = 108, - VK_FORMAT_R32G32B32A32_SFLOAT = 109, - VK_FORMAT_R64_UINT = 110, - VK_FORMAT_R64_SINT = 111, - VK_FORMAT_R64_SFLOAT = 112, - VK_FORMAT_R64G64_UINT = 113, - VK_FORMAT_R64G64_SINT = 114, - VK_FORMAT_R64G64_SFLOAT = 115, - VK_FORMAT_R64G64B64_UINT = 116, - VK_FORMAT_R64G64B64_SINT = 117, - VK_FORMAT_R64G64B64_SFLOAT = 118, - VK_FORMAT_R64G64B64A64_UINT = 119, - VK_FORMAT_R64G64B64A64_SINT = 120, - VK_FORMAT_R64G64B64A64_SFLOAT = 121, - VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, - VK_FORMAT_D16_UNORM = 124, - VK_FORMAT_X8_D24_UNORM_PACK32 = 125, - VK_FORMAT_D32_SFLOAT = 126, - VK_FORMAT_S8_UINT = 127, - VK_FORMAT_D16_UNORM_S8_UINT = 128, - VK_FORMAT_D24_UNORM_S8_UINT = 129, - VK_FORMAT_D32_SFLOAT_S8_UINT = 130, - VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, - VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, - VK_FORMAT_BC2_UNORM_BLOCK = 135, - VK_FORMAT_BC2_SRGB_BLOCK = 136, - VK_FORMAT_BC3_UNORM_BLOCK = 137, - VK_FORMAT_BC3_SRGB_BLOCK = 138, - VK_FORMAT_BC4_UNORM_BLOCK = 139, - VK_FORMAT_BC4_SNORM_BLOCK = 140, - VK_FORMAT_BC5_UNORM_BLOCK = 141, - VK_FORMAT_BC5_SNORM_BLOCK = 142, - VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, - VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, - VK_FORMAT_BC7_UNORM_BLOCK = 145, - VK_FORMAT_BC7_SRGB_BLOCK = 146, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, - VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, - VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, - VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, - VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, - VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, - VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, - VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, - VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, - VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, - VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, - VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000, - VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001, - VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002, - VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003, - VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004, - VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005, - VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006, - VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007, - VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008, - VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009, - VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010, - VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011, - VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012, - VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013, - VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000, - VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006, - VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016, - VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026, - VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027, - VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033, - VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 = 1000330001, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 = 1000330002, - VK_FORMAT_G16_B16R16_2PLANE_444_UNORM = 1000330003, - VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000, - VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001, - VK_FORMAT_R16G16_S10_5_NV = 1000464000, - VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR = 1000470000, - VK_FORMAT_A8_UNORM_KHR = 1000470001, - VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK, - VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK, - VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK, - VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK, - VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK, - VK_FORMAT_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM, - VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, - VK_FORMAT_R10X6_UNORM_PACK16_KHR = VK_FORMAT_R10X6_UNORM_PACK16, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_R12X4_UNORM_PACK16_KHR = VK_FORMAT_R12X4_UNORM_PACK16, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_G16B16G16R16_422_UNORM_KHR = VK_FORMAT_G16B16G16R16_422_UNORM, - VK_FORMAT_B16G16R16G16_422_UNORM_KHR = VK_FORMAT_B16G16R16G16_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, - VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM, - VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16, - VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16, - VK_FORMAT_MAX_ENUM = 0x7fffffff, -} VkFormat; - -typedef enum VkFormatFeatureFlagBits -{ - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, - VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, - VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, - VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, - VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, - VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, - VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, - VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000, - VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, - VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, - VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000, - VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, - VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, - VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFormatFeatureFlagBits; - -typedef VkFlags64 VkFormatFeatureFlagBits2; - -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0x00000001ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 0x00000001ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 0x00000002ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 0x00000002ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 0x00000004ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000008ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000010ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000010ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 0x00000020ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 0x00000040ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 0x00000040ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 0x00000080ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 0x00000080ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 0x00000100ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 0x00000200ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 0x00000400ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 0x00000400ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 0x00000800ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 0x00000800ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 0x00001000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 0x00002000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 0x00004000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 0x00004000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 0x00008000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 0x00008000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 0x00010000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 0x00400000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 0x00400000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 0x00800000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 0x80000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 0x80000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 0x100000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM = 0x400000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM = 0x800000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM = 0x1000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM = 0x2000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV = 0x10000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV = 0x20000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV = 0x40000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT = 0x400000000000ull; -typedef VkFormatFeatureFlagBits2 VkFormatFeatureFlagBits2KHR; - -typedef enum VkFragmentShadingRateCombinerOpKHR -{ - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR = 0, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR = 1, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR = 2, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR = 3, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR = 4, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KHR_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateCombinerOpKHR; - -typedef enum VkFragmentShadingRateNV -{ - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 1, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 4, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 5, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 6, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 9, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 10, - VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 11, - VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 12, - VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 13, - VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 14, - VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV = 15, - VK_FRAGMENT_SHADING_RATE_NV_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateNV; - -typedef enum VkFragmentShadingRateTypeNV -{ - VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV = 0, - VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV = 1, - VK_FRAGMENT_SHADING_RATE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateTypeNV; - -typedef enum VkFrameBoundaryFlagBitsEXT -{ - VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT = 0x00000001, - VK_FRAME_BOUNDARY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkFrameBoundaryFlagBitsEXT; - -typedef enum VkFramebufferCreateFlagBits -{ - VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT = 0x00000001, - VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR = VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, - VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFramebufferCreateFlagBits; - -typedef enum VkFrontFace -{ - VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, - VK_FRONT_FACE_CLOCKWISE = 1, - VK_FRONT_FACE_MAX_ENUM = 0x7fffffff, -} VkFrontFace; - -typedef enum VkGeometryFlagBitsKHR -{ - VK_GEOMETRY_OPAQUE_BIT_KHR = 0x00000001, - VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = 0x00000002, - VK_GEOMETRY_OPAQUE_BIT_NV = VK_GEOMETRY_OPAQUE_BIT_KHR, - VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV = VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR, - VK_GEOMETRY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryFlagBitsKHR; -typedef VkGeometryFlagBitsKHR VkGeometryFlagBitsNV; - -typedef enum VkGeometryInstanceFlagBitsKHR -{ - VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR = 0x00000001, - VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR = 0x00000002, - VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR = 0x00000004, - VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0x00000008, - VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0x00000010, - VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000020, - VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR, - VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR, - VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV = VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV = VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryInstanceFlagBitsKHR; -typedef VkGeometryInstanceFlagBitsKHR VkGeometryInstanceFlagBitsNV; - -typedef enum VkGeometryTypeKHR -{ - VK_GEOMETRY_TYPE_TRIANGLES_KHR = 0, - VK_GEOMETRY_TYPE_AABBS_KHR = 1, - VK_GEOMETRY_TYPE_INSTANCES_KHR = 2, - VK_GEOMETRY_TYPE_TRIANGLES_NV = VK_GEOMETRY_TYPE_TRIANGLES_KHR, - VK_GEOMETRY_TYPE_AABBS_NV = VK_GEOMETRY_TYPE_AABBS_KHR, - VK_GEOMETRY_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryTypeKHR; -typedef VkGeometryTypeKHR VkGeometryTypeNV; - -typedef enum VkGraphicsPipelineLibraryFlagBitsEXT -{ - VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0x00000001, - VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0x00000002, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0x00000004, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0x00000008, - VK_GRAPHICS_PIPELINE_LIBRARY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkGraphicsPipelineLibraryFlagBitsEXT; - -typedef enum VkHostImageCopyFlagBitsEXT -{ - VK_HOST_IMAGE_COPY_MEMCPY_EXT = 0x00000001, - VK_HOST_IMAGE_COPY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkHostImageCopyFlagBitsEXT; - -typedef enum VkImageAspectFlagBits -{ - VK_IMAGE_ASPECT_NONE = 0, - VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, - VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, - VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, - VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, - VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010, - VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020, - VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040, - VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, - VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, - VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT, - VK_IMAGE_ASPECT_NONE_KHR = VK_IMAGE_ASPECT_NONE, - VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageAspectFlagBits; - -typedef enum VkImageCompressionFixedRateFlagBitsEXT -{ - VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT = 0, - VK_IMAGE_COMPRESSION_FIXED_RATE_1BPC_BIT_EXT = 0x00000001, - VK_IMAGE_COMPRESSION_FIXED_RATE_2BPC_BIT_EXT = 0x00000002, - VK_IMAGE_COMPRESSION_FIXED_RATE_3BPC_BIT_EXT = 0x00000004, - VK_IMAGE_COMPRESSION_FIXED_RATE_4BPC_BIT_EXT = 0x00000008, - VK_IMAGE_COMPRESSION_FIXED_RATE_5BPC_BIT_EXT = 0x00000010, - VK_IMAGE_COMPRESSION_FIXED_RATE_6BPC_BIT_EXT = 0x00000020, - VK_IMAGE_COMPRESSION_FIXED_RATE_7BPC_BIT_EXT = 0x00000040, - VK_IMAGE_COMPRESSION_FIXED_RATE_8BPC_BIT_EXT = 0x00000080, - VK_IMAGE_COMPRESSION_FIXED_RATE_9BPC_BIT_EXT = 0x00000100, - VK_IMAGE_COMPRESSION_FIXED_RATE_10BPC_BIT_EXT = 0x00000200, - VK_IMAGE_COMPRESSION_FIXED_RATE_11BPC_BIT_EXT = 0x00000400, - VK_IMAGE_COMPRESSION_FIXED_RATE_12BPC_BIT_EXT = 0x00000800, - VK_IMAGE_COMPRESSION_FIXED_RATE_13BPC_BIT_EXT = 0x00001000, - VK_IMAGE_COMPRESSION_FIXED_RATE_14BPC_BIT_EXT = 0x00002000, - VK_IMAGE_COMPRESSION_FIXED_RATE_15BPC_BIT_EXT = 0x00004000, - VK_IMAGE_COMPRESSION_FIXED_RATE_16BPC_BIT_EXT = 0x00008000, - VK_IMAGE_COMPRESSION_FIXED_RATE_17BPC_BIT_EXT = 0x00010000, - VK_IMAGE_COMPRESSION_FIXED_RATE_18BPC_BIT_EXT = 0x00020000, - VK_IMAGE_COMPRESSION_FIXED_RATE_19BPC_BIT_EXT = 0x00040000, - VK_IMAGE_COMPRESSION_FIXED_RATE_20BPC_BIT_EXT = 0x00080000, - VK_IMAGE_COMPRESSION_FIXED_RATE_21BPC_BIT_EXT = 0x00100000, - VK_IMAGE_COMPRESSION_FIXED_RATE_22BPC_BIT_EXT = 0x00200000, - VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT = 0x00400000, - VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT = 0x00800000, - VK_IMAGE_COMPRESSION_FIXED_RATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkImageCompressionFixedRateFlagBitsEXT; - -typedef enum VkImageCompressionFlagBitsEXT -{ - VK_IMAGE_COMPRESSION_DEFAULT_EXT = 0, - VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT = 0x00000001, - VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT = 0x00000002, - VK_IMAGE_COMPRESSION_DISABLED_EXT = 0x00000004, - VK_IMAGE_COMPRESSION_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkImageCompressionFlagBitsEXT; - -typedef enum VkImageCreateFlagBits -{ - VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 0x00000020, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 0x00000040, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 0x00000080, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100, - VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, - VK_IMAGE_CREATE_ALIAS_BIT = 0x00000400, - VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800, - VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, - VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000, - VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x00004000, - VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM = 0x00008000, - VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00010000, - VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0x00020000, - VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0x00040000, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, - VK_IMAGE_CREATE_DISJOINT_BIT_KHR = VK_IMAGE_CREATE_DISJOINT_BIT, - VK_IMAGE_CREATE_ALIAS_BIT_KHR = VK_IMAGE_CREATE_ALIAS_BIT, - VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageCreateFlagBits; - -typedef enum VkImageLayout -{ - VK_IMAGE_LAYOUT_UNDEFINED = 0, - VK_IMAGE_LAYOUT_GENERAL = 1, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, - VK_IMAGE_LAYOUT_PREINITIALIZED = 8, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, - VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 1000164003, - VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL = 1000241000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL = 1000241001, - VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL = 1000241002, - VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL = 1000241003, - VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL = 1000314000, - VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL = 1000314001, - VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT = 1000339000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_MAX_ENUM = 0x7fffffff, -} VkImageLayout; - -typedef enum VkImageTiling -{ - VK_IMAGE_TILING_OPTIMAL = 0, - VK_IMAGE_TILING_LINEAR = 1, - VK_IMAGE_TILING_MAX_ENUM = 0x7fffffff, -} VkImageTiling; - -typedef enum VkImageType -{ - VK_IMAGE_TYPE_1D = 0, - VK_IMAGE_TYPE_2D = 1, - VK_IMAGE_TYPE_3D = 2, - VK_IMAGE_TYPE_MAX_ENUM = 0x7fffffff, -} VkImageType; - -typedef enum VkImageUsageFlagBits -{ - VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, - VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, - VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00000100, - VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, - VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI = 0x00040000, - VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x00080000, - VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0x00100000, - VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM = 0x00200000, - VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT = 0x00400000, - VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageUsageFlagBits; - -typedef enum VkImageViewCreateFlagBits -{ - VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001, - VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0x00000002, - VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000004, - VK_IMAGE_VIEW_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageViewCreateFlagBits; - -typedef enum VkImageViewType -{ - VK_IMAGE_VIEW_TYPE_1D = 0, - VK_IMAGE_VIEW_TYPE_2D = 1, - VK_IMAGE_VIEW_TYPE_3D = 2, - VK_IMAGE_VIEW_TYPE_CUBE = 3, - VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, - VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, - VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7fffffff, -} VkImageViewType; - -typedef enum VkIndexType -{ - VK_INDEX_TYPE_UINT16 = 0, - VK_INDEX_TYPE_UINT32 = 1, - VK_INDEX_TYPE_NONE_KHR = 1000165000, - VK_INDEX_TYPE_UINT8_EXT = 1000265000, - VK_INDEX_TYPE_NONE_NV = VK_INDEX_TYPE_NONE_KHR, - VK_INDEX_TYPE_MAX_ENUM = 0x7fffffff, -} VkIndexType; - -typedef enum VkIndirectCommandsLayoutUsageFlagBitsNV -{ - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV = 0x00000001, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV = 0x00000002, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV = 0x00000004, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsLayoutUsageFlagBitsNV; - -typedef enum VkIndirectCommandsTokenTypeNV -{ - VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV = 0, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV = 1, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV = 2, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV = 3, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV = 4, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV = 5, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV = 6, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV = 7, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV = 1000328000, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NV = 1000428003, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NV = 1000428004, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsTokenTypeNV; - -typedef enum VkIndirectStateFlagBitsNV -{ - VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV = 0x00000001, - VK_INDIRECT_STATE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectStateFlagBitsNV; - -typedef enum VkInstanceCreateFlagBits -{ - VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001, - VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkInstanceCreateFlagBits; - -typedef enum VkInternalAllocationType -{ - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, - VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7fffffff, -} VkInternalAllocationType; - -typedef enum VkLatencyMarkerNV -{ - VK_LATENCY_MARKER_SIMULATION_START_NV = 0, - VK_LATENCY_MARKER_SIMULATION_END_NV = 1, - VK_LATENCY_MARKER_RENDERSUBMIT_START_NV = 2, - VK_LATENCY_MARKER_RENDERSUBMIT_END_NV = 3, - VK_LATENCY_MARKER_PRESENT_START_NV = 4, - VK_LATENCY_MARKER_PRESENT_END_NV = 5, - VK_LATENCY_MARKER_INPUT_SAMPLE_NV = 6, - VK_LATENCY_MARKER_TRIGGER_FLASH_NV = 7, - VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV = 8, - VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV = 9, - VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV = 10, - VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV = 11, - VK_LATENCY_MARKER_NV_MAX_ENUM = 0x7fffffff, -} VkLatencyMarkerNV; - -typedef enum VkLayerSettingTypeEXT -{ - VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0, - VK_LAYER_SETTING_TYPE_INT32_EXT = 1, - VK_LAYER_SETTING_TYPE_INT64_EXT = 2, - VK_LAYER_SETTING_TYPE_UINT32_EXT = 3, - VK_LAYER_SETTING_TYPE_UINT64_EXT = 4, - VK_LAYER_SETTING_TYPE_FLOAT32_EXT = 5, - VK_LAYER_SETTING_TYPE_FLOAT64_EXT = 6, - VK_LAYER_SETTING_TYPE_STRING_EXT = 7, - VK_LAYER_SETTING_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkLayerSettingTypeEXT; - -typedef enum VkLayeredDriverUnderlyingApiMSFT -{ - VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT = 0, - VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT = 1, - VK_LAYERED_DRIVER_UNDERLYING_API_MSFT_MAX_ENUM = 0x7fffffff, -} VkLayeredDriverUnderlyingApiMSFT; - -typedef enum VkLineRasterizationModeEXT -{ - VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT = 0, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT = 1, - VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT = 2, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT = 3, - VK_LINE_RASTERIZATION_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkLineRasterizationModeEXT; - -typedef enum VkLogicOp -{ - VK_LOGIC_OP_CLEAR = 0, - VK_LOGIC_OP_AND = 1, - VK_LOGIC_OP_AND_REVERSE = 2, - VK_LOGIC_OP_COPY = 3, - VK_LOGIC_OP_AND_INVERTED = 4, - VK_LOGIC_OP_NO_OP = 5, - VK_LOGIC_OP_XOR = 6, - VK_LOGIC_OP_OR = 7, - VK_LOGIC_OP_NOR = 8, - VK_LOGIC_OP_EQUIVALENT = 9, - VK_LOGIC_OP_INVERT = 10, - VK_LOGIC_OP_OR_REVERSE = 11, - VK_LOGIC_OP_COPY_INVERTED = 12, - VK_LOGIC_OP_OR_INVERTED = 13, - VK_LOGIC_OP_NAND = 14, - VK_LOGIC_OP_SET = 15, - VK_LOGIC_OP_MAX_ENUM = 0x7fffffff, -} VkLogicOp; - -typedef enum VkMemoryAllocateFlagBits -{ - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 0x00000001, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = 0x00000002, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000004, - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryAllocateFlagBits; -typedef VkMemoryAllocateFlagBits VkMemoryAllocateFlagBitsKHR; - -typedef VkFlags64 VkMemoryDecompressionMethodFlagBitsNV; - -static const VkMemoryDecompressionMethodFlagBitsNV VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0x00000001ull; - -typedef enum VkMemoryHeapFlagBits -{ - VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0x00000002, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, - VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryHeapFlagBits; - -typedef enum VkMemoryOverallocationBehaviorAMD -{ - VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD = 0, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD = 1, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD = 2, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_AMD_MAX_ENUM = 0x7fffffff, -} VkMemoryOverallocationBehaviorAMD; - -typedef enum VkMemoryPropertyFlagBits -{ - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, - VK_MEMORY_PROPERTY_PROTECTED_BIT = 0x00000020, - VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD = 0x00000040, - VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD = 0x00000080, - VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryPropertyFlagBits; - -typedef enum VkMicromapCreateFlagBitsEXT -{ - VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0x00000001, - VK_MICROMAP_CREATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkMicromapCreateFlagBitsEXT; - -typedef enum VkMicromapTypeEXT -{ - VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0, - VK_MICROMAP_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkMicromapTypeEXT; - -typedef enum VkObjectType -{ - VK_OBJECT_TYPE_UNKNOWN = 0, - VK_OBJECT_TYPE_INSTANCE = 1, - VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, - VK_OBJECT_TYPE_DEVICE = 3, - VK_OBJECT_TYPE_QUEUE = 4, - VK_OBJECT_TYPE_SEMAPHORE = 5, - VK_OBJECT_TYPE_COMMAND_BUFFER = 6, - VK_OBJECT_TYPE_FENCE = 7, - VK_OBJECT_TYPE_DEVICE_MEMORY = 8, - VK_OBJECT_TYPE_BUFFER = 9, - VK_OBJECT_TYPE_IMAGE = 10, - VK_OBJECT_TYPE_EVENT = 11, - VK_OBJECT_TYPE_QUERY_POOL = 12, - VK_OBJECT_TYPE_BUFFER_VIEW = 13, - VK_OBJECT_TYPE_IMAGE_VIEW = 14, - VK_OBJECT_TYPE_SHADER_MODULE = 15, - VK_OBJECT_TYPE_PIPELINE_CACHE = 16, - VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, - VK_OBJECT_TYPE_RENDER_PASS = 18, - VK_OBJECT_TYPE_PIPELINE = 19, - VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, - VK_OBJECT_TYPE_SAMPLER = 21, - VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, - VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, - VK_OBJECT_TYPE_FRAMEBUFFER = 24, - VK_OBJECT_TYPE_COMMAND_POOL = 25, - VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, - VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, - VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, - VK_OBJECT_TYPE_CU_MODULE_NVX = 1000029000, - VK_OBJECT_TYPE_CU_FUNCTION_NVX = 1000029001, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000, - VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, - VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000, - VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, - VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, - VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL = 1000210000, - VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR = 1000268000, - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV = 1000277000, - VK_OBJECT_TYPE_PRIVATE_DATA_SLOT = 1000295000, - VK_OBJECT_TYPE_CUDA_MODULE_NV = 1000307000, - VK_OBJECT_TYPE_CUDA_FUNCTION_NV = 1000307001, - VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000, - VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000, - VK_OBJECT_TYPE_SHADER_EXT = 1000482000, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, - VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, - VK_OBJECT_TYPE_MAX_ENUM = 0x7fffffff, -} VkObjectType; - -typedef enum VkOpacityMicromapFormatEXT -{ - VK_OPACITY_MICROMAP_FORMAT_2_STATE_EXT = 1, - VK_OPACITY_MICROMAP_FORMAT_4_STATE_EXT = 2, - VK_OPACITY_MICROMAP_FORMAT_EXT_MAX_ENUM = 0x7fffffff, -} VkOpacityMicromapFormatEXT; - -typedef enum VkOpacityMicromapSpecialIndexEXT -{ - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE_EXT = -4, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT_EXT = -3, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE_EXT = -2, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT_EXT = -1, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_EXT_MAX_ENUM = 0x7fffffff, -} VkOpacityMicromapSpecialIndexEXT; - -typedef enum VkOpticalFlowExecuteFlagBitsNV -{ - VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_EXECUTE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowExecuteFlagBitsNV; - -typedef enum VkOpticalFlowGridSizeFlagBitsNV -{ - VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_GRID_SIZE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowGridSizeFlagBitsNV; - -typedef enum VkOpticalFlowPerformanceLevelNV -{ - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV = 1, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV = 2, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV = 3, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowPerformanceLevelNV; - -typedef enum VkOpticalFlowSessionBindingPointNV -{ - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV = 1, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV = 2, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_HINT_NV = 3, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV = 4, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_FLOW_VECTOR_NV = 5, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_COST_NV = 6, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_COST_NV = 7, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_GLOBAL_FLOW_NV = 8, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowSessionBindingPointNV; - -typedef enum VkOpticalFlowSessionCreateFlagBitsNV -{ - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0x00000010, - VK_OPTICAL_FLOW_SESSION_CREATE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowSessionCreateFlagBitsNV; - -typedef enum VkOpticalFlowUsageFlagBitsNV -{ - VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_USAGE_HINT_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0x00000010, - VK_OPTICAL_FLOW_USAGE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowUsageFlagBitsNV; - -typedef enum VkOutOfBandQueueTypeNV -{ - VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV = 0, - VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV = 1, - VK_OUT_OF_BAND_QUEUE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkOutOfBandQueueTypeNV; - -typedef enum VkPeerMemoryFeatureFlagBits -{ - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 0x00000001, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 0x00000002, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0x00000004, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0x00000008, - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT, - VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPeerMemoryFeatureFlagBits; -typedef VkPeerMemoryFeatureFlagBits VkPeerMemoryFeatureFlagBitsKHR; - -typedef enum VkPerformanceConfigurationTypeINTEL -{ - VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL = 0, - VK_PERFORMANCE_CONFIGURATION_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceConfigurationTypeINTEL; - -typedef enum VkPerformanceCounterDescriptionFlagBitsKHR -{ - VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR = 0x00000001, - VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR = 0x00000002, - VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR, - VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR, - VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterDescriptionFlagBitsKHR; - -typedef enum VkPerformanceCounterScopeKHR -{ - VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR = 0, - VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR = 1, - VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR = 2, - VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, - VK_QUERY_SCOPE_RENDER_PASS_KHR = VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, - VK_QUERY_SCOPE_COMMAND_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR, - VK_PERFORMANCE_COUNTER_SCOPE_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterScopeKHR; - -typedef enum VkPerformanceCounterStorageKHR -{ - VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR = 0, - VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR = 1, - VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR = 2, - VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR = 3, - VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR = 4, - VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR = 5, - VK_PERFORMANCE_COUNTER_STORAGE_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterStorageKHR; - -typedef enum VkPerformanceCounterUnitKHR -{ - VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0, - VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR = 1, - VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR = 2, - VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR = 3, - VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR = 4, - VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR = 5, - VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR = 6, - VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR = 7, - VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR = 8, - VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR = 9, - VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR = 10, - VK_PERFORMANCE_COUNTER_UNIT_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterUnitKHR; - -typedef enum VkPerformanceOverrideTypeINTEL -{ - VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL = 0, - VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL = 1, - VK_PERFORMANCE_OVERRIDE_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceOverrideTypeINTEL; - -typedef enum VkPerformanceParameterTypeINTEL -{ - VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL = 0, - VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL = 1, - VK_PERFORMANCE_PARAMETER_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceParameterTypeINTEL; - -typedef enum VkPerformanceValueTypeINTEL -{ - VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL = 0, - VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL = 1, - VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL = 2, - VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL = 3, - VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL = 4, - VK_PERFORMANCE_VALUE_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceValueTypeINTEL; - -typedef enum VkPhysicalDeviceSchedulingControlsFlagBitsARM -{ - VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001, - VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FLAG_BITS_ARM_MAX_ENUM = 0x7fffffff, -} VkPhysicalDeviceSchedulingControlsFlagBitsARM; - -typedef enum VkPhysicalDeviceType -{ - VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, - VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, - VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, - VK_PHYSICAL_DEVICE_TYPE_CPU = 4, - VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7fffffff, -} VkPhysicalDeviceType; - -typedef enum VkPipelineBindPoint -{ - VK_PIPELINE_BIND_POINT_GRAPHICS = 0, - VK_PIPELINE_BIND_POINT_COMPUTE = 1, - VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR = 1000165000, - VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI = 1000369003, - VK_PIPELINE_BIND_POINT_RAY_TRACING_NV = VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, - VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7fffffff, -} VkPipelineBindPoint; - -typedef enum VkPipelineCacheCreateFlagBits -{ - VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001, - VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, - VK_PIPELINE_CACHE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCacheCreateFlagBits; - -typedef enum VkPipelineCacheHeaderVersion -{ - VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, - VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7fffffff, -} VkPipelineCacheHeaderVersion; - -typedef enum VkPipelineColorBlendStateCreateFlagBits -{ - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT = 0x00000001, - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT, - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineColorBlendStateCreateFlagBits; - -typedef enum VkPipelineCompilerControlFlagBitsAMD -{ - VK_PIPELINE_COMPILER_CONTROL_FLAG_BITS_AMD_MAX_ENUM = 0x7fffffff, -} VkPipelineCompilerControlFlagBitsAMD; - -typedef enum VkPipelineCreateFlagBits -{ - VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, - VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, - VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008, - VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 0x00000010, - VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV = 0x00000020, - VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR = 0x00000040, - VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080, - VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 0x00000100, - VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT = 0x00000200, - VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400, - VK_PIPELINE_CREATE_LIBRARY_BIT_KHR = 0x00000800, - VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x00001000, - VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x00020000, - VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00040000, - VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000, - VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000, - VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000, - VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000, - VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000, - VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000, - VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000, - VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000, - VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000, - VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, - VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, - VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, - VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT, - VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCreateFlagBits; - -typedef VkFlags64 VkPipelineCreateFlagBits2KHR; - -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR = 0x00000001ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR = 0x00000002ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR = 0x00000004ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = 0x00000008ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR = 0x00000010ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV = 0x00000020ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR = 0x00000040ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR = 0x00000100ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR = 0x00000200ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR = 0x00000800ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x00001000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x00020000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV = 0x00040000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000ull; -static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000ull; - -typedef enum VkPipelineCreationFeedbackFlagBits -{ - VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT = 0x00000001, - VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 0x00000002, - VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 0x00000004, - VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT, - VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT, - VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT, - VK_PIPELINE_CREATION_FEEDBACK_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCreationFeedbackFlagBits; -typedef VkPipelineCreationFeedbackFlagBits VkPipelineCreationFeedbackFlagBitsEXT; - -typedef enum VkPipelineDepthStencilStateCreateFlagBits -{ - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000001, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000002, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineDepthStencilStateCreateFlagBits; - -typedef enum VkPipelineExecutableStatisticFormatKHR -{ - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR = 0, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR = 1, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR = 2, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR = 3, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_KHR_MAX_ENUM = 0x7fffffff, -} VkPipelineExecutableStatisticFormatKHR; - -typedef enum VkPipelineLayoutCreateFlagBits -{ - VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT = 0x00000002, - VK_PIPELINE_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineLayoutCreateFlagBits; - -typedef enum VkPipelineRobustnessBufferBehaviorEXT -{ - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT = 0, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT = 1, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT = 2, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT = 3, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_EXT_MAX_ENUM = 0x7fffffff, -} VkPipelineRobustnessBufferBehaviorEXT; - -typedef enum VkPipelineRobustnessImageBehaviorEXT -{ - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT = 0, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT = 1, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT = 2, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT = 3, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_EXT_MAX_ENUM = 0x7fffffff, -} VkPipelineRobustnessImageBehaviorEXT; - -typedef enum VkPipelineShaderStageCreateFlagBits -{ - VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001, - VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0x00000002, - VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT, - VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT, - VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineShaderStageCreateFlagBits; - -typedef enum VkPipelineStageFlagBits -{ - VK_PIPELINE_STAGE_NONE = 0, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, - VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, - VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, - VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV = 0x00020000, - VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000, - VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT = 0x00080000, - VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT = 0x00100000, - VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR = 0x00200000, - VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000, - VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000, - VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000, - VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000, - VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR, - VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, - VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT, - VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT, - VK_PIPELINE_STAGE_NONE_KHR = VK_PIPELINE_STAGE_NONE, - VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineStageFlagBits; - -typedef VkFlags64 VkPipelineStageFlagBits2; - -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE = 0ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE_KHR = 0ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT = 0x00000001ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR = 0x00000001ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT = 0x00000002ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR = 0x00000002ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT = 0x00000004ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR = 0x00000004ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT = 0x00000008ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR = 0x00000008ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR = 0x00000010ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR = 0x00000020ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT = 0x00000040ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR = 0x00000040ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT = 0x00000080ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR = 0x00000080ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT = 0x00000100ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR = 0x00000100ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT = 0x00000200ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR = 0x00000200ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR = 0x00000400ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT = 0x00000800ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR = 0x00000800ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT = 0x00002000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR = 0x00002000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT = 0x00004000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT_KHR = 0x00004000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT = 0x00008000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR = 0x00008000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT = 0x00010000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR = 0x00010000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV = 0x00080000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT = 0x00080000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0x00100000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT = 0x00100000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR = 0x00200000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV = 0x00200000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV = 0x00400000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR = 0x10000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV = 0x20000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT = 0x40000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT = 0x100000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT_KHR = 0x100000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT = 0x200000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR = 0x200000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT = 0x400000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT_KHR = 0x400000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT = 0x800000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 0x800000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT = 0x1000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR = 0x1000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT = 0x2000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 0x2000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 0x4000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI = 0x8000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0x20000000000ull; -typedef VkPipelineStageFlagBits2 VkPipelineStageFlagBits2KHR; - -typedef enum VkPointClippingBehavior -{ - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1, - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, - VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM = 0x7fffffff, -} VkPointClippingBehavior; -typedef VkPointClippingBehavior VkPointClippingBehaviorKHR; - -typedef enum VkPolygonMode -{ - VK_POLYGON_MODE_FILL = 0, - VK_POLYGON_MODE_LINE = 1, - VK_POLYGON_MODE_POINT = 2, - VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, - VK_POLYGON_MODE_MAX_ENUM = 0x7fffffff, -} VkPolygonMode; - -typedef enum VkPresentGravityFlagBitsEXT -{ - VK_PRESENT_GRAVITY_MIN_BIT_EXT = 0x00000001, - VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0x00000002, - VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0x00000004, - VK_PRESENT_GRAVITY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkPresentGravityFlagBitsEXT; - -typedef enum VkPresentModeKHR -{ - VK_PRESENT_MODE_IMMEDIATE_KHR = 0, - VK_PRESENT_MODE_MAILBOX_KHR = 1, - VK_PRESENT_MODE_FIFO_KHR = 2, - VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, - VK_PRESENT_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkPresentModeKHR; - -typedef enum VkPresentScalingFlagBitsEXT -{ - VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT = 0x00000001, - VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0x00000002, - VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0x00000004, - VK_PRESENT_SCALING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkPresentScalingFlagBitsEXT; - -typedef enum VkPrimitiveTopology -{ - VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, - VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, - VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7fffffff, -} VkPrimitiveTopology; - -typedef enum VkProvokingVertexModeEXT -{ - VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT = 0, - VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT = 1, - VK_PROVOKING_VERTEX_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkProvokingVertexModeEXT; - -typedef enum VkQueryControlFlagBits -{ - VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, - VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryControlFlagBits; - -typedef enum VkQueryPipelineStatisticFlagBits -{ - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, - VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, - VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, - VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, - VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT = 0x00000800, - VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0x00001000, - VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0x00002000, - VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryPipelineStatisticFlagBits; - -typedef enum VkQueryPoolSamplingModeINTEL -{ - VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL = 0, - VK_QUERY_POOL_SAMPLING_MODE_INTEL_MAX_ENUM = 0x7fffffff, -} VkQueryPoolSamplingModeINTEL; - -typedef enum VkQueryResultFlagBits -{ - VK_QUERY_RESULT_64_BIT = 0x00000001, - VK_QUERY_RESULT_WAIT_BIT = 0x00000002, - VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, - VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, - VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryResultFlagBits; - -typedef enum VkQueryType -{ - VK_QUERY_TYPE_OCCLUSION = 0, - VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, - VK_QUERY_TYPE_TIMESTAMP = 2, - VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004, - VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR = 1000150000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR = 1000150001, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, - VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL = 1000210000, - VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000, - VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR = 1000386000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR = 1000386001, - VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT = 1000396000, - VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT = 1000396001, - VK_QUERY_TYPE_MAX_ENUM = 0x7fffffff, -} VkQueryType; - -typedef enum VkQueueFlagBits -{ - VK_QUEUE_GRAPHICS_BIT = 0x00000001, - VK_QUEUE_COMPUTE_BIT = 0x00000002, - VK_QUEUE_TRANSFER_BIT = 0x00000004, - VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, - VK_QUEUE_PROTECTED_BIT = 0x00000010, - VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0x00000100, - VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueueFlagBits; - -typedef enum VkQueueGlobalPriorityKHR -{ - VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR = 128, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR = 256, - VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR = 512, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR = 1024, - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR, - VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR, - VK_QUEUE_GLOBAL_PRIORITY_KHR_MAX_ENUM = 0x7fffffff, -} VkQueueGlobalPriorityKHR; -typedef VkQueueGlobalPriorityKHR VkQueueGlobalPriorityEXT; - -typedef enum VkRasterizationOrderAMD -{ - VK_RASTERIZATION_ORDER_STRICT_AMD = 0, - VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, - VK_RASTERIZATION_ORDER_AMD_MAX_ENUM = 0x7fffffff, -} VkRasterizationOrderAMD; - -typedef enum VkRayTracingInvocationReorderModeNV -{ - VK_RAY_TRACING_INVOCATION_REORDER_MODE_NONE_NV = 0, - VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_NV = 1, - VK_RAY_TRACING_INVOCATION_REORDER_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkRayTracingInvocationReorderModeNV; - -typedef enum VkRayTracingShaderGroupTypeKHR -{ - VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR = 0, - VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR = 1, - VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR = 2, - VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkRayTracingShaderGroupTypeKHR; -typedef VkRayTracingShaderGroupTypeKHR VkRayTracingShaderGroupTypeNV; - -typedef enum VkRenderPassCreateFlagBits -{ - VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM = 0x00000002, - VK_RENDER_PASS_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkRenderPassCreateFlagBits; - -typedef enum VkRenderingFlagBits -{ - VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0x00000001, - VK_RENDERING_SUSPENDING_BIT = 0x00000002, - VK_RENDERING_RESUMING_BIT = 0x00000004, - VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008, - VK_RENDERING_CONTENTS_INLINE_BIT_EXT = 0x00000010, - VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, - VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT, - VK_RENDERING_RESUMING_BIT_KHR = VK_RENDERING_RESUMING_BIT, - VK_RENDERING_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkRenderingFlagBits; -typedef VkRenderingFlagBits VkRenderingFlagBitsKHR; - -typedef enum VkResolveModeFlagBits -{ - VK_RESOLVE_MODE_NONE = 0, - VK_RESOLVE_MODE_SAMPLE_ZERO_BIT = 0x00000001, - VK_RESOLVE_MODE_AVERAGE_BIT = 0x00000002, - VK_RESOLVE_MODE_MIN_BIT = 0x00000004, - VK_RESOLVE_MODE_MAX_BIT = 0x00000008, - VK_RESOLVE_MODE_NONE_KHR = VK_RESOLVE_MODE_NONE, - VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, - VK_RESOLVE_MODE_AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT, - VK_RESOLVE_MODE_MIN_BIT_KHR = VK_RESOLVE_MODE_MIN_BIT, - VK_RESOLVE_MODE_MAX_BIT_KHR = VK_RESOLVE_MODE_MAX_BIT, - VK_RESOLVE_MODE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkResolveModeFlagBits; -typedef VkResolveModeFlagBits VkResolveModeFlagBitsKHR; - -typedef enum VkResult -{ - VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, - VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS = -1000257000, - VK_ERROR_NOT_PERMITTED_KHR = -1000174001, - VK_ERROR_FRAGMENTATION = -1000161000, - VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003, - VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000, - VK_ERROR_INVALID_SHADER_NV = -1000012000, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_ERROR_UNKNOWN = -13, - VK_ERROR_FRAGMENTED_POOL = -12, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_THREAD_IDLE_KHR = 1000268000, - VK_THREAD_DONE_KHR = 1000268001, - VK_OPERATION_DEFERRED_KHR = 1000268002, - VK_OPERATION_NOT_DEFERRED_KHR = 1000268003, - VK_PIPELINE_COMPILE_REQUIRED = 1000297000, - VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, - VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, - VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, - VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION, - VK_ERROR_NOT_PERMITTED_EXT = VK_ERROR_NOT_PERMITTED_KHR, - VK_ERROR_INVALID_DEVICE_ADDRESS_EXT = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, - VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, - VK_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, - VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, - VK_RESULT_MAX_ENUM = 0x7fffffff, -} VkResult; - -typedef enum VkSampleCountFlagBits -{ - VK_SAMPLE_COUNT_1_BIT = 0x00000001, - VK_SAMPLE_COUNT_2_BIT = 0x00000002, - VK_SAMPLE_COUNT_4_BIT = 0x00000004, - VK_SAMPLE_COUNT_8_BIT = 0x00000008, - VK_SAMPLE_COUNT_16_BIT = 0x00000010, - VK_SAMPLE_COUNT_32_BIT = 0x00000020, - VK_SAMPLE_COUNT_64_BIT = 0x00000040, - VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSampleCountFlagBits; - -typedef enum VkSamplerAddressMode -{ - VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, - VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, - VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerAddressMode; - -typedef enum VkSamplerCreateFlagBits -{ - VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0x00000001, - VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT = 0x00000002, - VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT = 0x00000004, - VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, - VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0x00000010, - VK_SAMPLER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSamplerCreateFlagBits; - -typedef enum VkSamplerMipmapMode -{ - VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, - VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, - VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerMipmapMode; - -typedef enum VkSamplerReductionMode -{ - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = 0, - VK_SAMPLER_REDUCTION_MODE_MIN = 1, - VK_SAMPLER_REDUCTION_MODE_MAX = 2, - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM = 1000521000, - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, - VK_SAMPLER_REDUCTION_MODE_MIN_EXT = VK_SAMPLER_REDUCTION_MODE_MIN, - VK_SAMPLER_REDUCTION_MODE_MAX_EXT = VK_SAMPLER_REDUCTION_MODE_MAX, - VK_SAMPLER_REDUCTION_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerReductionMode; -typedef VkSamplerReductionMode VkSamplerReductionModeEXT; - -typedef enum VkSamplerYcbcrModelConversion -{ - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7fffffff, -} VkSamplerYcbcrModelConversion; -typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; - -typedef enum VkSamplerYcbcrRange -{ - VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, - VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7fffffff, -} VkSamplerYcbcrRange; -typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; - -typedef enum VkScopeKHR -{ - VK_SCOPE_DEVICE_KHR = 1, - VK_SCOPE_WORKGROUP_KHR = 2, - VK_SCOPE_SUBGROUP_KHR = 3, - VK_SCOPE_QUEUE_FAMILY_KHR = 5, - VK_SCOPE_DEVICE_NV = VK_SCOPE_DEVICE_KHR, - VK_SCOPE_WORKGROUP_NV = VK_SCOPE_WORKGROUP_KHR, - VK_SCOPE_SUBGROUP_NV = VK_SCOPE_SUBGROUP_KHR, - VK_SCOPE_QUEUE_FAMILY_NV = VK_SCOPE_QUEUE_FAMILY_KHR, - VK_SCOPE_KHR_MAX_ENUM = 0x7fffffff, -} VkScopeKHR; -typedef VkScopeKHR VkScopeNV; - -typedef enum VkSemaphoreImportFlagBits -{ - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0x00000001, - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT, - VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSemaphoreImportFlagBits; -typedef VkSemaphoreImportFlagBits VkSemaphoreImportFlagBitsKHR; - -typedef enum VkSemaphoreType -{ - VK_SEMAPHORE_TYPE_BINARY = 0, - VK_SEMAPHORE_TYPE_TIMELINE = 1, - VK_SEMAPHORE_TYPE_BINARY_KHR = VK_SEMAPHORE_TYPE_BINARY, - VK_SEMAPHORE_TYPE_TIMELINE_KHR = VK_SEMAPHORE_TYPE_TIMELINE, - VK_SEMAPHORE_TYPE_MAX_ENUM = 0x7fffffff, -} VkSemaphoreType; -typedef VkSemaphoreType VkSemaphoreTypeKHR; - -typedef enum VkSemaphoreWaitFlagBits -{ - VK_SEMAPHORE_WAIT_ANY_BIT = 0x00000001, - VK_SEMAPHORE_WAIT_ANY_BIT_KHR = VK_SEMAPHORE_WAIT_ANY_BIT, - VK_SEMAPHORE_WAIT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSemaphoreWaitFlagBits; -typedef VkSemaphoreWaitFlagBits VkSemaphoreWaitFlagBitsKHR; - -typedef enum VkShaderCodeTypeEXT -{ - VK_SHADER_CODE_TYPE_BINARY_EXT = 0, - VK_SHADER_CODE_TYPE_SPIRV_EXT = 1, - VK_SHADER_CODE_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkShaderCodeTypeEXT; - -typedef enum VkShaderCorePropertiesFlagBitsAMD -{ - VK_SHADER_CORE_PROPERTIES_FLAG_BITS_AMD_MAX_ENUM = 0x7fffffff, -} VkShaderCorePropertiesFlagBitsAMD; - -typedef enum VkShaderCreateFlagBitsEXT -{ - VK_SHADER_CREATE_LINK_STAGE_BIT_EXT = 0x00000001, - VK_SHADER_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000002, - VK_SHADER_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = 0x00000004, - VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT = 0x00000008, - VK_SHADER_CREATE_DISPATCH_BASE_BIT_EXT = 0x00000010, - VK_SHADER_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_EXT = 0x00000020, - VK_SHADER_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00000040, - VK_SHADER_CREATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkShaderCreateFlagBitsEXT; - -typedef enum VkShaderFloatControlsIndependence -{ - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY = 0, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL = 1, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE = 2, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_MAX_ENUM = 0x7fffffff, -} VkShaderFloatControlsIndependence; -typedef VkShaderFloatControlsIndependence VkShaderFloatControlsIndependenceKHR; - -typedef enum VkShaderGroupShaderKHR -{ - VK_SHADER_GROUP_SHADER_GENERAL_KHR = 0, - VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR = 1, - VK_SHADER_GROUP_SHADER_ANY_HIT_KHR = 2, - VK_SHADER_GROUP_SHADER_INTERSECTION_KHR = 3, - VK_SHADER_GROUP_SHADER_KHR_MAX_ENUM = 0x7fffffff, -} VkShaderGroupShaderKHR; - -typedef enum VkShaderInfoTypeAMD -{ - VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, - VK_SHADER_INFO_TYPE_BINARY_AMD = 1, - VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, - VK_SHADER_INFO_TYPE_AMD_MAX_ENUM = 0x7fffffff, -} VkShaderInfoTypeAMD; - -typedef enum VkShaderStageFlagBits -{ - VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, - VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, - VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, - VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001f, - VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, - VK_SHADER_STAGE_TASK_BIT_EXT = 0x00000040, - VK_SHADER_STAGE_MESH_BIT_EXT = 0x00000080, - VK_SHADER_STAGE_RAYGEN_BIT_KHR = 0x00000100, - VK_SHADER_STAGE_ANY_HIT_BIT_KHR = 0x00000200, - VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR = 0x00000400, - VK_SHADER_STAGE_MISS_BIT_KHR = 0x00000800, - VK_SHADER_STAGE_INTERSECTION_BIT_KHR = 0x00001000, - VK_SHADER_STAGE_CALLABLE_BIT_KHR = 0x00002000, - VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI = 0x00004000, - VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0x00080000, - VK_SHADER_STAGE_RAYGEN_BIT_NV = VK_SHADER_STAGE_RAYGEN_BIT_KHR, - VK_SHADER_STAGE_ANY_HIT_BIT_NV = VK_SHADER_STAGE_ANY_HIT_BIT_KHR, - VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR, - VK_SHADER_STAGE_MISS_BIT_NV = VK_SHADER_STAGE_MISS_BIT_KHR, - VK_SHADER_STAGE_INTERSECTION_BIT_NV = VK_SHADER_STAGE_INTERSECTION_BIT_KHR, - VK_SHADER_STAGE_CALLABLE_BIT_NV = VK_SHADER_STAGE_CALLABLE_BIT_KHR, - VK_SHADER_STAGE_TASK_BIT_NV = VK_SHADER_STAGE_TASK_BIT_EXT, - VK_SHADER_STAGE_MESH_BIT_NV = VK_SHADER_STAGE_MESH_BIT_EXT, - VK_SHADER_STAGE_ALL = 0x7fffffff, -} VkShaderStageFlagBits; - -typedef enum VkShadingRatePaletteEntryNV -{ - VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = 0, - VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV = 1, - VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV = 2, - VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV = 3, - VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV = 4, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV = 5, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV = 6, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV = 7, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV = 8, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV = 9, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV = 10, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV = 11, - VK_SHADING_RATE_PALETTE_ENTRY_NV_MAX_ENUM = 0x7fffffff, -} VkShadingRatePaletteEntryNV; - -typedef enum VkSharingMode -{ - VK_SHARING_MODE_EXCLUSIVE = 0, - VK_SHARING_MODE_CONCURRENT = 1, - VK_SHARING_MODE_MAX_ENUM = 0x7fffffff, -} VkSharingMode; - -typedef enum VkSparseImageFormatFlagBits -{ - VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, - VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, - VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, - VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSparseImageFormatFlagBits; - -typedef enum VkSparseMemoryBindFlagBits -{ - VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, - VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSparseMemoryBindFlagBits; - -typedef enum VkStencilFaceFlagBits -{ - VK_STENCIL_FACE_FRONT_BIT = 0x00000001, - VK_STENCIL_FACE_BACK_BIT = 0x00000002, - VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, - VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK, - VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkStencilFaceFlagBits; - -typedef enum VkStencilOp -{ - VK_STENCIL_OP_KEEP = 0, - VK_STENCIL_OP_ZERO = 1, - VK_STENCIL_OP_REPLACE = 2, - VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, - VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, - VK_STENCIL_OP_INVERT = 5, - VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, - VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, - VK_STENCIL_OP_MAX_ENUM = 0x7fffffff, -} VkStencilOp; - -typedef enum VkStructureType -{ - VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, - VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, - VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, - VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, - VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, - VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, - VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, - VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, - VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, - VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, - VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, - VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, - VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, - VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES = 49, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES = 50, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES = 51, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES = 52, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES = 53, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES = 54, - VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, - VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, - VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002, - VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX = 1000029000, - VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX = 1000029001, - VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX = 1000029002, - VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = 1000030000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = 1000030001, - VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, - VK_STRUCTURE_TYPE_RENDERING_INFO = 1000044000, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO = 1000044001, - VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO = 1000044002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES = 1000044003, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO = 1000044004, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = 1000044008, - VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX = 1000044009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, - VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, - VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES = 1000063000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = 1000066000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = 1000067000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = 1000067001, - VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT = 1000068000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT = 1000068001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT = 1000068002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, - VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, - VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT = 1000081000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT = 1000081001, - VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT = 1000081002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES = 1000082000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000, - VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, - VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001, - VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES = 1000108000, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO = 1000108001, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO = 1000108002, - VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO = 1000108003, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 = 1000109000, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 = 1000109001, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 = 1000109002, - VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 = 1000109003, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 = 1000109004, - VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO = 1000109005, - VK_STRUCTURE_TYPE_SUBPASS_END_INFO = 1000109006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG = 1000110000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR = 1000116000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR = 1000116001, - VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR = 1000116002, - VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = 1000116003, - VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = 1000116004, - VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = 1000116005, - VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = 1000116006, - VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR = 1000116007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, - VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = 1000120000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001, - VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000128000, - VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT = 1000128001, - VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = 1000128002, - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000128003, - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES = 1000130000, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO = 1000130001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES = 1000138000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES = 1000138001, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK = 1000138002, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO = 1000138003, - VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, - VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, - VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, - VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, - VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO = 1000147000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR = 1000150000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR = 1000150002, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR = 1000150003, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR = 1000150004, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR = 1000150005, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR = 1000150006, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR = 1000150007, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR = 1000150009, - VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR = 1000150010, - VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR = 1000150011, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR = 1000150012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR = 1000150013, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR = 1000150014, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR = 1000150015, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR = 1000150016, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = 1000150017, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR = 1000150018, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR = 1000150020, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV = 1000154000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV = 1000154001, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, - VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, - VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO = 1000161000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES = 1000161001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES = 1000161002, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO = 1000161003, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT = 1000161004, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV = 1000164000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV = 1000164001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV = 1000164002, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV = 1000164005, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV = 1000165000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV = 1000165001, - VK_STRUCTURE_TYPE_GEOMETRY_NV = 1000165003, - VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV = 1000165004, - VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV = 1000165005, - VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV = 1000165006, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV = 1000165007, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV = 1000165008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV = 1000165009, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV = 1000165011, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV = 1000165012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = 1000166000, - VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT = 1000170000, - VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT = 1000170001, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR = 1000174000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES = 1000175000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES = 1000177000, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, - VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES = 1000180000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000, - VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, - VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO = 1000192000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES = 1000196000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES = 1000197000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES = 1000199000, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE = 1000199001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR = 1000203000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = 1000205000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002, - VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES = 1000207000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES = 1000207001, - VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO = 1000207002, - VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO = 1000207003, - VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO = 1000207004, - VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO = 1000207005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL = 1000209000, - VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL = 1000210000, - VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL = 1000210001, - VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL = 1000210002, - VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL = 1000210003, - VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL = 1000210004, - VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL = 1000210005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES = 1000211000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES = 1000215000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 1000218000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 1000218001, - VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = 1000218002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES = 1000221000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES = 1000225000, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO = 1000225001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES = 1000225002, - VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000226000, - VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = 1000226001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = 1000226002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR = 1000226003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR = 1000226004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD = 1000227000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD = 1000229000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT = 1000234000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 1000237000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 1000238000, - VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV = 1000240000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES = 1000241000, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT = 1000241001, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT = 1000241002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT = 1000244000, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO = 1000244001, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES = 1000245000, - VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO = 1000246000, - VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = 1000247000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR = 1000248000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV = 1000250000, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV = 1000250001, - VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV = 1000250002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT = 1000251000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT = 1000252000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES = 1000253000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT = 1000254000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT = 1000254001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT = 1000254002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES = 1000257000, - VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO = 1000257002, - VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO = 1000257003, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO = 1000257004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT = 1000259000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT = 1000259001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT = 1000259002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT = 1000260000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES = 1000261000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT = 1000265000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT = 1000267000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR = 1000269000, - VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR = 1000269001, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR = 1000269002, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR = 1000269003, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = 1000269004, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = 1000269005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT = 1000270000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT = 1000270001, - VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT = 1000270002, - VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT = 1000270003, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT = 1000270004, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT = 1000270005, - VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT = 1000270006, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT = 1000270007, - VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT = 1000270008, - VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT = 1000270009, - VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR = 1000271000, - VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR = 1000271001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT = 1000274002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT = 1000275000, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT = 1000275001, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT = 1000275002, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT = 1000275003, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT = 1000275004, - VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT = 1000275005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES = 1000276000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV = 1000277000, - VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV = 1000277001, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV = 1000277002, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV = 1000277003, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV = 1000277004, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV = 1000277005, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV = 1000277006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV = 1000277007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV = 1000278000, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV = 1000278001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES = 1000280000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES = 1000280001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT = 1000281000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES = 1000281001, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = 1000282000, - VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = 1000282001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT = 1000283000, - VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT = 1000283001, - VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT = 1000283002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT = 1000286000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT = 1000286001, - VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT = 1000287000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT = 1000287001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT = 1000287002, - VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR = 1000290000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV = 1000292000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV = 1000292001, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV = 1000292002, - VK_STRUCTURE_TYPE_PRESENT_ID_KHR = 1000294000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = 1000294001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES = 1000295000, - VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO = 1000295001, - VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO = 1000295002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES = 1000297000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000, - VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001, - VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV = 1000307000, - VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV = 1000307001, - VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV = 1000307002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV = 1000307003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV = 1000307004, - VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV = 1000310000, - VK_STRUCTURE_TYPE_MEMORY_BARRIER_2 = 1000314000, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 = 1000314001, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 = 1000314002, - VK_STRUCTURE_TYPE_DEPENDENCY_INFO = 1000314003, - VK_STRUCTURE_TYPE_SUBMIT_INFO_2 = 1000314004, - VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO = 1000314005, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO = 1000314006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES = 1000314007, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008, - VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT = 1000316000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT = 1000316001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT = 1000316002, - VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT = 1000316003, - VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT = 1000316004, - VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316005, - VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316006, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316007, - VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316008, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316009, - VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT = 1000316010, - VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT = 1000316011, - VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT = 1000316012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT = 1000320000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT = 1000320001, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT = 1000320002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD = 1000321000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR = 1000322000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR = 1000323000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES = 1000325000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV = 1000326000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV = 1000326001, - VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV = 1000326002, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV = 1000327000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV = 1000327001, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV = 1000327002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT = 1000328000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT = 1000328001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT = 1000330000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT = 1000332000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT = 1000332001, - VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM = 1000333000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES = 1000335000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR = 1000336000, - VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2 = 1000337000, - VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2 = 1000337001, - VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 = 1000337002, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 = 1000337003, - VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 = 1000337004, - VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 = 1000337005, - VK_STRUCTURE_TYPE_BUFFER_COPY_2 = 1000337006, - VK_STRUCTURE_TYPE_IMAGE_COPY_2 = 1000337007, - VK_STRUCTURE_TYPE_IMAGE_BLIT_2 = 1000337008, - VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 = 1000337009, - VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2 = 1000337010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT = 1000338000, - VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT = 1000338001, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR = 1000338002, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR = 1000338003, - VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT = 1000338004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT = 1000339000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT = 1000341000, - VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT = 1000341001, - VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT = 1000341002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT = 1000342000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT = 1000344000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR = 1000347000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR = 1000347001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR = 1000348013, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, - VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000, - VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001, - VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT = 1000352002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT = 1000354000, - VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT = 1000354001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = 1000356000, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 = 1000360000, - VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI = 1000369000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI = 1000369001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI = 1000369002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI = 1000370000, - VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT = 1000375000, - VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT = 1000375001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000, - VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001, - VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT = 1000377000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT = 1000381000, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT = 1000381001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT = 1000382000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR = 1000386000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR = 1000388000, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = 1000388001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT = 1000391000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT = 1000391001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT = 1000392000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT = 1000392001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT = 1000393000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT = 1000395000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT = 1000395001, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT = 1000396000, - VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT = 1000396001, - VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT = 1000396002, - VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT = 1000396003, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT = 1000396004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT = 1000396005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT = 1000396006, - VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT = 1000396007, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT = 1000396008, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT = 1000396009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI = 1000404002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, - VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES = 1000413000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES = 1000413001, - VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS = 1000413002, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS = 1000413003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM = 1000415000, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM = 1000417000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM = 1000417001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM = 1000417002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT = 1000418000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT = 1000418001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE = 1000420000, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE = 1000420001, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001, - VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV = 1000426000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV = 1000426001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV = 1000427000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV = 1000427001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV = 1000428000, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV = 1000428001, - VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV = 1000428002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = 1000430000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT = 1000437000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT = 1000451000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT = 1000451001, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT = 1000453000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT = 1000458000, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT = 1000458001, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT = 1000458002, - VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT = 1000458003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT = 1000462000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT = 1000462001, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT = 1000462002, - VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT = 1000462003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV = 1000464000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV = 1000464001, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV = 1000464002, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV = 1000464003, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV = 1000464004, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV = 1000464005, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR = 1000470000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR = 1000470001, - VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR = 1000470003, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR = 1000470004, - VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR = 1000470005, - VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR = 1000470006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR = 1000481000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, - VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM = 1000484000, - VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV = 1000492000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, - VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT = 1000496000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT = 1000499000, - VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV = 1000505000, - VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV = 1000505001, - VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV = 1000505002, - VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV = 1000505003, - VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV = 1000505004, - VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV = 1000505005, - VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV = 1000505006, - VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV = 1000505007, - VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV = 1000505008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR = 1000506000, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, - VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM = 1000518000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM = 1000518001, - VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM = 1000518002, - VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM = 1000519000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM = 1000519001, - VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM = 1000519002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM = 1000520000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INFO, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, - VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO, - VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, - VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR = VK_STRUCTURE_TYPE_SUBPASS_END_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, - VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, - VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO, - VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, - VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, - VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO, - VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES, - VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO, - VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES, - VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, - VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, - VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES, - VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, - VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2, - VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_IMAGE_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, - VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT, - VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, - VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, - VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, - VK_STRUCTURE_TYPE_SHADER_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7fffffff, -} VkStructureType; - -typedef enum VkSubgroupFeatureFlagBits -{ - VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, - VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, - VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, - VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, - VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, - VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, - VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, - VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, - VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, - VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubgroupFeatureFlagBits; - -typedef enum VkSubmitFlagBits -{ - VK_SUBMIT_PROTECTED_BIT = 0x00000001, - VK_SUBMIT_PROTECTED_BIT_KHR = VK_SUBMIT_PROTECTED_BIT, - VK_SUBMIT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubmitFlagBits; -typedef VkSubmitFlagBits VkSubmitFlagBitsKHR; - -typedef enum VkSubpassContents -{ - VK_SUBPASS_CONTENTS_INLINE = 0, - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, - VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT = 1000451000, - VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7fffffff, -} VkSubpassContents; - -typedef enum VkSubpassDescriptionFlagBits -{ - VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM = 0x00000004, - VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM = 0x00000008, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT = 0x00000010, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000020, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000040, - VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000080, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubpassDescriptionFlagBits; - -typedef enum VkSubpassMergeStatusEXT -{ - VK_SUBPASS_MERGE_STATUS_MERGED_EXT = 0, - VK_SUBPASS_MERGE_STATUS_DISALLOWED_EXT = 1, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SIDE_EFFECTS_EXT = 2, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SAMPLES_MISMATCH_EXT = 3, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_VIEWS_MISMATCH_EXT = 4, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_ALIASING_EXT = 5, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPENDENCIES_EXT = 6, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INCOMPATIBLE_INPUT_ATTACHMENT_EXT = 7, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_TOO_MANY_ATTACHMENTS_EXT = 8, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INSUFFICIENT_STORAGE_EXT = 9, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPTH_STENCIL_COUNT_EXT = 10, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_RESOLVE_ATTACHMENT_REUSE_EXT = 11, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SINGLE_SUBPASS_EXT = 12, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_UNSPECIFIED_EXT = 13, - VK_SUBPASS_MERGE_STATUS_EXT_MAX_ENUM = 0x7fffffff, -} VkSubpassMergeStatusEXT; - -typedef enum VkSurfaceTransformFlagBitsKHR -{ - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, - VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, - VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, - VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, - VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, - VK_SURFACE_TRANSFORM_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkSurfaceTransformFlagBitsKHR; - -typedef enum VkSwapchainCreateFlagBitsKHR -{ - VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, - VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, - VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0x00000004, - VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0x00000008, - VK_SWAPCHAIN_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkSwapchainCreateFlagBitsKHR; - -typedef enum VkSystemAllocationScope -{ - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, - VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, - VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7fffffff, -} VkSystemAllocationScope; - -typedef enum VkTessellationDomainOrigin -{ - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1, - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, - VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM = 0x7fffffff, -} VkTessellationDomainOrigin; -typedef VkTessellationDomainOrigin VkTessellationDomainOriginKHR; - -typedef enum VkTimeDomainEXT -{ - VK_TIME_DOMAIN_DEVICE_EXT = 0, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3, - VK_TIME_DOMAIN_EXT_MAX_ENUM = 0x7fffffff, -} VkTimeDomainEXT; - -typedef enum VkToolPurposeFlagBits -{ - VK_TOOL_PURPOSE_VALIDATION_BIT = 0x00000001, - VK_TOOL_PURPOSE_PROFILING_BIT = 0x00000002, - VK_TOOL_PURPOSE_TRACING_BIT = 0x00000004, - VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT = 0x00000008, - VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT = 0x00000010, - VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0x00000020, - VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0x00000040, - VK_TOOL_PURPOSE_VALIDATION_BIT_EXT = VK_TOOL_PURPOSE_VALIDATION_BIT, - VK_TOOL_PURPOSE_PROFILING_BIT_EXT = VK_TOOL_PURPOSE_PROFILING_BIT, - VK_TOOL_PURPOSE_TRACING_BIT_EXT = VK_TOOL_PURPOSE_TRACING_BIT, - VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT, - VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT, - VK_TOOL_PURPOSE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkToolPurposeFlagBits; -typedef VkToolPurposeFlagBits VkToolPurposeFlagBitsEXT; - -typedef enum VkValidationCacheHeaderVersionEXT -{ - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, - VK_VALIDATION_CACHE_HEADER_VERSION_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationCacheHeaderVersionEXT; - -typedef enum VkValidationCheckEXT -{ - VK_VALIDATION_CHECK_ALL_EXT = 0, - VK_VALIDATION_CHECK_SHADERS_EXT = 1, - VK_VALIDATION_CHECK_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationCheckEXT; - -typedef enum VkValidationFeatureDisableEXT -{ - VK_VALIDATION_FEATURE_DISABLE_ALL_EXT = 0, - VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT = 1, - VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT = 2, - VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT = 3, - VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT = 4, - VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT = 5, - VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT = 6, - VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT = 7, - VK_VALIDATION_FEATURE_DISABLE_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationFeatureDisableEXT; - -typedef enum VkValidationFeatureEnableEXT -{ - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT = 0, - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT = 1, - VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT = 2, - VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT = 3, - VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT = 4, - VK_VALIDATION_FEATURE_ENABLE_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationFeatureEnableEXT; - -typedef enum VkVendorId -{ - VK_VENDOR_ID_VIV = 0x00010001, - VK_VENDOR_ID_VSI = 0x00010002, - VK_VENDOR_ID_KAZAN = 0x00010003, - VK_VENDOR_ID_CODEPLAY = 0x00010004, - VK_VENDOR_ID_MESA = 0x00010005, - VK_VENDOR_ID_POCL = 0x00010006, - VK_VENDOR_ID_MOBILEYE = 0x00010007, - VK_VENDOR_ID_MAX_ENUM = 0x7fffffff, -} VkVendorId; - -typedef enum VkVertexInputRate -{ - VK_VERTEX_INPUT_RATE_VERTEX = 0, - VK_VERTEX_INPUT_RATE_INSTANCE = 1, - VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7fffffff, -} VkVertexInputRate; - -typedef enum VkViewportCoordinateSwizzleNV -{ - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, - VK_VIEWPORT_COORDINATE_SWIZZLE_NV_MAX_ENUM = 0x7fffffff, -} VkViewportCoordinateSwizzleNV; - -typedef void* (VKAPI_PTR * PFN_vkAllocationFunction)( - void *pUserData, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); -typedef VkBool32 (VKAPI_PTR * PFN_vkDebugReportCallbackEXT)( - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char *pLayerPrefix, - const char *pMessage, - void *pUserData); -typedef struct VkDebugUtilsMessengerCallbackDataEXT VkDebugUtilsMessengerCallbackDataEXT; -typedef VkBool32 (VKAPI_PTR * PFN_vkDebugUtilsMessengerCallbackEXT)( - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageTypes, - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, - void *pUserData); -typedef void (VKAPI_PTR * PFN_vkFreeFunction)( - void *pUserData, - void *pMemory); -typedef void (VKAPI_PTR * PFN_vkInternalAllocationNotification)( - void *pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); -typedef void (VKAPI_PTR * PFN_vkInternalFreeNotification)( - void *pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); -typedef void* (VKAPI_PTR * PFN_vkReallocationFunction)( - void *pUserData, - void *pOriginal, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); -typedef void (VKAPI_PTR * PFN_vkVoidFunction)( -void); - -typedef struct VkAabbPositionsKHR -{ - float minX; - float minY; - float minZ; - float maxX; - float maxY; - float maxZ; -} VkAabbPositionsKHR; -typedef VkAabbPositionsKHR VkAabbPositionsNV; - -typedef struct VkAccelerationStructureBuildRangeInfoKHR -{ - uint32_t primitiveCount; - uint32_t primitiveOffset; - uint32_t firstVertex; - uint32_t transformOffset; -} VkAccelerationStructureBuildRangeInfoKHR; - -typedef struct VkAccelerationStructureBuildSizesInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) accelerationStructureSize; - VkDeviceSize WINE_VK_ALIGN(8) updateScratchSize; - VkDeviceSize WINE_VK_ALIGN(8) buildScratchSize; -} VkAccelerationStructureBuildSizesInfoKHR; - -typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) accelerationStructure; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructureNV; -} VkAccelerationStructureCaptureDescriptorDataInfoEXT; - -typedef struct VkAccelerationStructureCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureCreateFlagsKHR createFlags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkAccelerationStructureTypeKHR type; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkAccelerationStructureCreateInfoKHR; - -typedef struct VkAccelerationStructureDeviceAddressInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) accelerationStructure; -} VkAccelerationStructureDeviceAddressInfoKHR; - -typedef struct VkAccelerationStructureMemoryRequirementsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureMemoryRequirementsTypeNV type; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructure; -} VkAccelerationStructureMemoryRequirementsInfoNV; - -typedef struct VkAccelerationStructureMotionInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t maxInstances; - VkAccelerationStructureMotionInfoFlagsNV flags; -} VkAccelerationStructureMotionInfoNV; - -typedef struct VkAccelerationStructureVersionInfoKHR -{ - VkStructureType sType; - const void *pNext; - const uint8_t *pVersionData; -} VkAccelerationStructureVersionInfoKHR; - -typedef struct VkAcquireNextImageInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint64_t WINE_VK_ALIGN(8) timeout; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - VkFence WINE_VK_ALIGN(8) fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHR; - -typedef struct VkAcquireProfilingLockInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAcquireProfilingLockFlagsKHR flags; - uint64_t WINE_VK_ALIGN(8) timeout; -} VkAcquireProfilingLockInfoKHR; - -typedef struct VkAllocationCallbacks -{ - void *pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; -} VkAllocationCallbacks; - -typedef struct VkApplicationInfo -{ - VkStructureType sType; - const void *pNext; - const char *pApplicationName; - uint32_t applicationVersion; - const char *pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo; - -typedef struct VkAttachmentDescription -{ - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription; - -typedef struct VkAttachmentDescription2 -{ - VkStructureType sType; - const void *pNext; - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription2; -typedef VkAttachmentDescription2 VkAttachmentDescription2KHR; - -typedef struct VkAttachmentDescriptionStencilLayout -{ - VkStructureType sType; - void *pNext; - VkImageLayout stencilInitialLayout; - VkImageLayout stencilFinalLayout; -} VkAttachmentDescriptionStencilLayout; -typedef VkAttachmentDescriptionStencilLayout VkAttachmentDescriptionStencilLayoutKHR; - -typedef struct VkAttachmentReference -{ - uint32_t attachment; - VkImageLayout layout; -} VkAttachmentReference; - -typedef struct VkAttachmentReference2 -{ - VkStructureType sType; - const void *pNext; - uint32_t attachment; - VkImageLayout layout; - VkImageAspectFlags aspectMask; -} VkAttachmentReference2; -typedef VkAttachmentReference2 VkAttachmentReference2KHR; - -typedef struct VkAttachmentReferenceStencilLayout -{ - VkStructureType sType; - void *pNext; - VkImageLayout stencilLayout; -} VkAttachmentReferenceStencilLayout; -typedef VkAttachmentReferenceStencilLayout VkAttachmentReferenceStencilLayoutKHR; - -typedef struct VkAttachmentSampleCountInfoAMD -{ - VkStructureType sType; - const void *pNext; - uint32_t colorAttachmentCount; - const VkSampleCountFlagBits *pColorAttachmentSamples; - VkSampleCountFlagBits depthStencilAttachmentSamples; -} VkAttachmentSampleCountInfoAMD; -typedef VkAttachmentSampleCountInfoAMD VkAttachmentSampleCountInfoNV; - -typedef struct VkBaseInStructure -{ - VkStructureType sType; - const struct VkBaseInStructure *pNext; -} VkBaseInStructure; - -typedef struct VkBaseOutStructure -{ - VkStructureType sType; - struct VkBaseOutStructure *pNext; -} VkBaseOutStructure; - -typedef struct VkBindAccelerationStructureMemoryInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructure; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; -} VkBindAccelerationStructureMemoryInfoNV; - -typedef struct VkBindBufferMemoryDeviceGroupInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfo; -typedef VkBindBufferMemoryDeviceGroupInfo VkBindBufferMemoryDeviceGroupInfoKHR; - -typedef struct VkBindBufferMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; -} VkBindBufferMemoryInfo; -typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; - -typedef struct VkBindImageMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; -} VkBindImageMemoryInfo; -typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; - -typedef struct VkBindImageMemorySwapchainInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHR; - -typedef struct VkBindImagePlaneMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfo; -typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; - -typedef struct VkBindIndexBufferIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - VkIndexType indexType; -} VkBindIndexBufferIndirectCommandNV; - -typedef struct VkBindPipelineIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) pipelineAddress; -} VkBindPipelineIndirectCommandNV; - -typedef struct VkBindShaderGroupIndirectCommandNV -{ - uint32_t groupIndex; -} VkBindShaderGroupIndirectCommandNV; - -typedef struct VkBindVertexBufferIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - uint32_t stride; -} VkBindVertexBufferIndirectCommandNV; - -typedef struct VkBlitImageCubicWeightsInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkBlitImageCubicWeightsInfoQCOM; - -typedef struct VkBufferCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferCaptureDescriptorDataInfoEXT; - -typedef struct VkBufferCopy -{ - VkDeviceSize WINE_VK_ALIGN(8) srcOffset; - VkDeviceSize WINE_VK_ALIGN(8) dstOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferCopy; - -typedef struct VkBufferCopy2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) srcOffset; - VkDeviceSize WINE_VK_ALIGN(8) dstOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferCopy2; -typedef VkBufferCopy2 VkBufferCopy2KHR; - -typedef struct VkBufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferCreateFlags flags; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; -} VkBufferCreateInfo; - -typedef struct VkBufferDeviceAddressCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkBufferDeviceAddressCreateInfoEXT; - -typedef struct VkBufferDeviceAddressInfo -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferDeviceAddressInfo; -typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoKHR; -typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoEXT; - -typedef struct VkBufferMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferMemoryBarrier; - -typedef struct VkBufferMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferMemoryBarrier2; -typedef VkBufferMemoryBarrier2 VkBufferMemoryBarrier2KHR; - -typedef struct VkBufferMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferMemoryRequirementsInfo2; -typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; - -typedef struct VkBufferOpaqueCaptureAddressCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) opaqueCaptureAddress; -} VkBufferOpaqueCaptureAddressCreateInfo; -typedef VkBufferOpaqueCaptureAddressCreateInfo VkBufferOpaqueCaptureAddressCreateInfoKHR; - -typedef struct VkBufferUsageFlags2CreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBufferUsageFlags2KHR WINE_VK_ALIGN(8) usage; -} VkBufferUsageFlags2CreateInfoKHR; - -typedef struct VkBufferViewCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferViewCreateFlags flags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkFormat format; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) range; -} VkBufferViewCreateInfo; - -typedef struct VkCalibratedTimestampInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkTimeDomainEXT timeDomain; -} VkCalibratedTimestampInfoEXT; - -typedef struct VkCheckpointData2NV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) stage; - void *pCheckpointMarker; -} VkCheckpointData2NV; - -typedef struct VkCheckpointDataNV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlagBits stage; - void *pCheckpointMarker; -} VkCheckpointDataNV; - -typedef union VkClearColorValue -{ - float float32[4]; - int32_t int32[4]; - uint32_t uint32[4]; -} VkClearColorValue; - -typedef struct VkClearDepthStencilValue -{ - float depth; - uint32_t stencil; -} VkClearDepthStencilValue; - -typedef union VkClearValue -{ - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -} VkClearValue; - -typedef struct VkCoarseSampleLocationNV -{ - uint32_t pixelX; - uint32_t pixelY; - uint32_t sample; -} VkCoarseSampleLocationNV; - -typedef struct VkCoarseSampleOrderCustomNV -{ - VkShadingRatePaletteEntryNV shadingRate; - uint32_t sampleCount; - uint32_t sampleLocationCount; - const VkCoarseSampleLocationNV *pSampleLocations; -} VkCoarseSampleOrderCustomNV; - -typedef struct VkColorBlendAdvancedEXT -{ - VkBlendOp advancedBlendOp; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; - VkBool32 clampResults; -} VkColorBlendAdvancedEXT; - -typedef struct VkColorBlendEquationEXT -{ - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; -} VkColorBlendEquationEXT; - -typedef struct VkCommandBufferAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandPool WINE_VK_ALIGN(8) commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo; - -typedef struct VkCommandBufferInheritanceConditionalRenderingInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 conditionalRenderingEnable; -} VkCommandBufferInheritanceConditionalRenderingInfoEXT; - -typedef struct VkCommandBufferInheritanceInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; - VkFramebuffer WINE_VK_ALIGN(8) framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo; - -typedef struct VkCommandBufferInheritanceRenderingInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderingFlags flags; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; - VkSampleCountFlagBits rasterizationSamples; -} VkCommandBufferInheritanceRenderingInfo; -typedef VkCommandBufferInheritanceRenderingInfo VkCommandBufferInheritanceRenderingInfoKHR; - -typedef struct VkCommandBufferSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -} VkCommandBufferSubmitInfo; -typedef VkCommandBufferSubmitInfo VkCommandBufferSubmitInfoKHR; - -typedef struct VkCommandPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo; - -typedef struct VkComponentMapping -{ - VkComponentSwizzle r; - VkComponentSwizzle g; - VkComponentSwizzle b; - VkComponentSwizzle a; -} VkComponentMapping; - -typedef struct VkComputePipelineIndirectBufferInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceAddress WINE_VK_ALIGN(8) pipelineDeviceAddressCaptureReplay; -} VkComputePipelineIndirectBufferInfoNV; - -typedef struct VkConditionalRenderingBeginInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkConditionalRenderingFlagsEXT flags; -} VkConditionalRenderingBeginInfoEXT; - -typedef struct VkConformanceVersion -{ - uint8_t major; - uint8_t minor; - uint8_t subminor; - uint8_t patch; -} VkConformanceVersion; -typedef VkConformanceVersion VkConformanceVersionKHR; - -typedef struct VkCooperativeMatrixPropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; -} VkCooperativeMatrixPropertiesKHR; - -typedef struct VkCooperativeMatrixPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeNV AType; - VkComponentTypeNV BType; - VkComponentTypeNV CType; - VkComponentTypeNV DType; - VkScopeNV scope; -} VkCooperativeMatrixPropertiesNV; - -typedef struct VkCopyAccelerationStructureInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) src; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureInfoKHR; - -typedef struct VkCopyBufferInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) srcBuffer; - VkBuffer WINE_VK_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferCopy2 *pRegions; -} VkCopyBufferInfo2; -typedef VkCopyBufferInfo2 VkCopyBufferInfo2KHR; - -typedef struct VkCopyCommandTransformInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkCopyCommandTransformInfoQCOM; - -typedef struct VkCopyDescriptorSet -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSet WINE_VK_ALIGN(8) srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet WINE_VK_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet; - -typedef struct VkCopyMemoryIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - VkDeviceAddress WINE_VK_ALIGN(8) dstAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkCopyMemoryIndirectCommandNV; - -typedef struct VkCopyMicromapInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapEXT WINE_VK_ALIGN(8) src; - VkMicromapEXT WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapInfoEXT; - -typedef struct VkCuFunctionCreateInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkCuModuleNVX WINE_VK_ALIGN(8) module; - const char *pName; -} VkCuFunctionCreateInfoNVX; - -typedef struct VkCuLaunchInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkCuFunctionNVX WINE_VK_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - size_t paramCount; - const void * const *pParams; - size_t extraCount; - const void * const *pExtras; -} VkCuLaunchInfoNVX; - -typedef struct VkCuModuleCreateInfoNVX -{ - VkStructureType sType; - const void *pNext; - size_t dataSize; - const void *pData; -} VkCuModuleCreateInfoNVX; - -typedef struct VkCudaFunctionCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCudaModuleNV WINE_VK_ALIGN(8) module; - const char *pName; -} VkCudaFunctionCreateInfoNV; - -typedef struct VkCudaLaunchInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCudaFunctionNV WINE_VK_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - size_t paramCount; - const void * const *pParams; - size_t extraCount; - const void * const *pExtras; -} VkCudaLaunchInfoNV; - -typedef struct VkCudaModuleCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - size_t dataSize; - const void *pData; -} VkCudaModuleCreateInfoNV; - -typedef struct VkDebugMarkerMarkerInfoEXT -{ - VkStructureType sType; - const void *pNext; - const char *pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT; - -typedef struct VkDebugMarkerObjectNameInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t WINE_VK_ALIGN(8) object; - const char *pObjectName; -} VkDebugMarkerObjectNameInfoEXT; - -typedef struct VkDebugMarkerObjectTagInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t WINE_VK_ALIGN(8) object; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkDebugMarkerObjectTagInfoEXT; - -typedef struct VkDebugReportCallbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - void *pUserData; -} VkDebugReportCallbackCreateInfoEXT; - -typedef struct VkDebugUtilsLabelEXT -{ - VkStructureType sType; - const void *pNext; - const char *pLabelName; - float color[4]; -} VkDebugUtilsLabelEXT; - -typedef struct VkDebugUtilsMessengerCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugUtilsMessengerCreateFlagsEXT flags; - VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageType; - PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; - void *pUserData; -} VkDebugUtilsMessengerCreateInfoEXT; - -typedef struct VkDebugUtilsObjectNameInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkObjectType objectType; - uint64_t WINE_VK_ALIGN(8) objectHandle; - const char *pObjectName; -} VkDebugUtilsObjectNameInfoEXT; - -typedef struct VkDebugUtilsObjectTagInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkObjectType objectType; - uint64_t WINE_VK_ALIGN(8) objectHandle; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkDebugUtilsObjectTagInfoEXT; - -typedef struct VkDecompressMemoryRegionNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - VkDeviceAddress WINE_VK_ALIGN(8) dstAddress; - VkDeviceSize WINE_VK_ALIGN(8) compressedSize; - VkDeviceSize WINE_VK_ALIGN(8) decompressedSize; - VkMemoryDecompressionMethodFlagsNV WINE_VK_ALIGN(8) decompressionMethod; -} VkDecompressMemoryRegionNV; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV; - -typedef struct VkDedicatedAllocationImageCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV; - -typedef struct VkDepthBiasInfoEXT -{ - VkStructureType sType; - const void *pNext; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -} VkDepthBiasInfoEXT; - -typedef struct VkDepthBiasRepresentationInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDepthBiasRepresentationEXT depthBiasRepresentation; - VkBool32 depthBiasExact; -} VkDepthBiasRepresentationInfoEXT; - -typedef struct VkDescriptorAddressInfoEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) address; - VkDeviceSize WINE_VK_ALIGN(8) range; - VkFormat format; -} VkDescriptorAddressInfoEXT; - -typedef struct VkDescriptorBufferBindingInfoEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) address; - VkBufferUsageFlags usage; -} VkDescriptorBufferBindingInfoEXT; - -typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT -{ - VkStructureType sType; - void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT; - -typedef struct VkDescriptorBufferInfo -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) range; -} VkDescriptorBufferInfo; - -typedef struct VkDescriptorImageInfo -{ - VkSampler WINE_VK_ALIGN(8) sampler; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo; - -typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t maxInlineUniformBlockBindings; -} VkDescriptorPoolInlineUniformBlockCreateInfo; -typedef VkDescriptorPoolInlineUniformBlockCreateInfo VkDescriptorPoolInlineUniformBlockCreateInfoEXT; - -typedef struct VkDescriptorPoolSize -{ - VkDescriptorType type; - uint32_t descriptorCount; -} VkDescriptorPoolSize; - -typedef struct VkDescriptorSetAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorPool WINE_VK_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSetLayout *pSetLayouts; -} VkDescriptorSetAllocateInfo; - -typedef struct VkDescriptorSetBindingReferenceVALVE -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; - uint32_t binding; -} VkDescriptorSetBindingReferenceVALVE; - -typedef struct VkDescriptorSetLayoutBinding -{ - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - const VkSampler *pImmutableSamplers; -} VkDescriptorSetLayoutBinding; - -typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t bindingCount; - const VkDescriptorBindingFlags *pBindingFlags; -} VkDescriptorSetLayoutBindingFlagsCreateInfo; -typedef VkDescriptorSetLayoutBindingFlagsCreateInfo VkDescriptorSetLayoutBindingFlagsCreateInfoEXT; - -typedef struct VkDescriptorSetLayoutCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const VkDescriptorSetLayoutBinding *pBindings; -} VkDescriptorSetLayoutCreateInfo; - -typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE -{ - VkStructureType sType; - void *pNext; - size_t descriptorOffset; - uint32_t descriptorSize; -} VkDescriptorSetLayoutHostMappingInfoVALVE; - -typedef struct VkDescriptorSetLayoutSupport -{ - VkStructureType sType; - void *pNext; - VkBool32 supported; -} VkDescriptorSetLayoutSupport; -typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; - -typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t descriptorSetCount; - const uint32_t *pDescriptorCounts; -} VkDescriptorSetVariableDescriptorCountAllocateInfo; -typedef VkDescriptorSetVariableDescriptorCountAllocateInfo VkDescriptorSetVariableDescriptorCountAllocateInfoEXT; - -typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupport -{ - VkStructureType sType; - void *pNext; - uint32_t maxVariableDescriptorCount; -} VkDescriptorSetVariableDescriptorCountLayoutSupport; -typedef VkDescriptorSetVariableDescriptorCountLayoutSupport VkDescriptorSetVariableDescriptorCountLayoutSupportEXT; - -typedef struct VkDescriptorUpdateTemplateEntry -{ - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - size_t offset; - size_t stride; -} VkDescriptorUpdateTemplateEntry; -typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; - -typedef struct VkDeviceAddressBindingCallbackDataEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceAddressBindingFlagsEXT flags; - VkDeviceAddress WINE_VK_ALIGN(8) baseAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceAddressBindingTypeEXT bindingType; -} VkDeviceAddressBindingCallbackDataEXT; - -typedef struct VkDeviceBufferMemoryRequirements -{ - VkStructureType sType; - const void *pNext; - const VkBufferCreateInfo *pCreateInfo; -} VkDeviceBufferMemoryRequirements; -typedef VkDeviceBufferMemoryRequirements VkDeviceBufferMemoryRequirementsKHR; - -typedef struct VkDeviceDiagnosticsConfigCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceDiagnosticsConfigFlagsNV flags; -} VkDeviceDiagnosticsConfigCreateInfoNV; - -typedef struct VkDeviceFaultAddressInfoEXT -{ - VkDeviceFaultAddressTypeEXT addressType; - VkDeviceAddress WINE_VK_ALIGN(8) reportedAddress; - VkDeviceSize WINE_VK_ALIGN(8) addressPrecision; -} VkDeviceFaultAddressInfoEXT; - -typedef struct VkDeviceFaultCountsEXT -{ - VkStructureType sType; - void *pNext; - uint32_t addressInfoCount; - uint32_t vendorInfoCount; - VkDeviceSize WINE_VK_ALIGN(8) vendorBinarySize; -} VkDeviceFaultCountsEXT; - -typedef struct VkDeviceFaultVendorBinaryHeaderVersionOneEXT -{ - uint32_t headerSize; - VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion; - uint32_t vendorID; - uint32_t deviceID; - uint32_t driverVersion; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - uint32_t applicationNameOffset; - uint32_t applicationVersion; - uint32_t engineNameOffset; - uint32_t engineVersion; - uint32_t apiVersion; -} VkDeviceFaultVendorBinaryHeaderVersionOneEXT; - -typedef struct VkDeviceFaultVendorInfoEXT -{ - char description[VK_MAX_DESCRIPTION_SIZE]; - uint64_t WINE_VK_ALIGN(8) vendorFaultCode; - uint64_t WINE_VK_ALIGN(8) vendorFaultData; -} VkDeviceFaultVendorInfoEXT; - -typedef struct VkDeviceGroupBindSparseInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfo; -typedef VkDeviceGroupBindSparseInfo VkDeviceGroupBindSparseInfoKHR; - -typedef struct VkDeviceGroupCommandBufferBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfo; -typedef VkDeviceGroupCommandBufferBeginInfo VkDeviceGroupCommandBufferBeginInfoKHR; - -typedef struct VkDeviceGroupDeviceCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t physicalDeviceCount; - const VkPhysicalDevice *pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfo; -typedef VkDeviceGroupDeviceCreateInfo VkDeviceGroupDeviceCreateInfoKHR; - -typedef struct VkDeviceGroupPresentCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupPresentCapabilitiesKHR; - -typedef struct VkDeviceGroupPresentInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const uint32_t *pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHR mode; -} VkDeviceGroupPresentInfoKHR; - -typedef struct VkDeviceGroupSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const uint32_t *pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - const uint32_t *pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - const uint32_t *pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfo; -typedef VkDeviceGroupSubmitInfo VkDeviceGroupSubmitInfoKHR; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupSwapchainCreateInfoKHR; - -typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; -} VkDeviceMemoryOpaqueCaptureAddressInfo; -typedef VkDeviceMemoryOpaqueCaptureAddressInfo VkDeviceMemoryOpaqueCaptureAddressInfoKHR; - -typedef struct VkDeviceMemoryOverallocationCreateInfoAMD -{ - VkStructureType sType; - const void *pNext; - VkMemoryOverallocationBehaviorAMD overallocationBehavior; -} VkDeviceMemoryOverallocationCreateInfoAMD; - -typedef union VkDeviceOrHostAddressConstKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - const void *hostAddress; -} VkDeviceOrHostAddressConstKHR; - -typedef union VkDeviceOrHostAddressKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - void *hostAddress; -} VkDeviceOrHostAddressKHR; - -typedef struct VkDevicePrivateDataCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t privateDataSlotRequestCount; -} VkDevicePrivateDataCreateInfo; -typedef VkDevicePrivateDataCreateInfo VkDevicePrivateDataCreateInfoEXT; - -typedef struct VkDeviceQueueCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float *pQueuePriorities; -} VkDeviceQueueCreateInfo; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkQueueGlobalPriorityKHR globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfoKHR; -typedef VkDeviceQueueGlobalPriorityCreateInfoKHR VkDeviceQueueGlobalPriorityCreateInfoEXT; - -typedef struct VkDeviceQueueInfo2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueIndex; -} VkDeviceQueueInfo2; - -typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM -{ - VkStructureType sType; - void *pNext; - uint32_t shaderCoreCount; -} VkDeviceQueueShaderCoreControlCreateInfoARM; - -typedef struct VkDispatchIndirectCommand -{ - uint32_t x; - uint32_t y; - uint32_t z; -} VkDispatchIndirectCommand; - -typedef struct VkDrawIndexedIndirectCommand -{ - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -} VkDrawIndexedIndirectCommand; - -typedef struct VkDrawIndirectCommand -{ - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -} VkDrawIndirectCommand; - -typedef struct VkDrawMeshTasksIndirectCommandEXT -{ - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -} VkDrawMeshTasksIndirectCommandEXT; - -typedef struct VkDrawMeshTasksIndirectCommandNV -{ - uint32_t taskCount; - uint32_t firstTask; -} VkDrawMeshTasksIndirectCommandNV; - -typedef struct VkEventCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo; - -typedef struct VkExportFenceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalFenceHandleTypeFlags handleTypes; -} VkExportFenceCreateInfo; -typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; - -typedef struct VkExportMemoryAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExportMemoryAllocateInfo; -typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; - -typedef struct VkExportMemoryWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - const SECURITY_ATTRIBUTES *pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR; - -typedef struct VkExportSemaphoreCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalSemaphoreHandleTypeFlags handleTypes; -} VkExportSemaphoreCreateInfo; -typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; - -typedef struct VkExtensionProperties -{ - char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef struct VkExtent2D -{ - uint32_t width; - uint32_t height; -} VkExtent2D; - -typedef struct VkExtent3D -{ - uint32_t width; - uint32_t height; - uint32_t depth; -} VkExtent3D; - -typedef struct VkExternalFenceProperties -{ - VkStructureType sType; - void *pNext; - VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlags compatibleHandleTypes; - VkExternalFenceFeatureFlags externalFenceFeatures; -} VkExternalFenceProperties; -typedef VkExternalFenceProperties VkExternalFencePropertiesKHR; - -typedef struct VkExternalMemoryAcquireUnmodifiedEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 acquireUnmodifiedMemory; -} VkExternalMemoryAcquireUnmodifiedEXT; - -typedef struct VkExternalMemoryBufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryBufferCreateInfo; -typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; - -typedef struct VkExternalMemoryImageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryImageCreateInfo; -typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; - -typedef struct VkExternalMemoryProperties -{ - VkExternalMemoryFeatureFlags externalMemoryFeatures; - VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlags compatibleHandleTypes; -} VkExternalMemoryProperties; -typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; - -typedef struct VkExternalSemaphoreProperties -{ - VkStructureType sType; - void *pNext; - VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; - VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; -} VkExternalSemaphoreProperties; -typedef VkExternalSemaphoreProperties VkExternalSemaphorePropertiesKHR; - -typedef struct VkFenceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo; - -typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 filterCubic; - VkBool32 filterCubicMinmax; -} VkFilterCubicImageViewImageFormatPropertiesEXT; - -typedef struct VkFormatProperties -{ - VkFormatFeatureFlags linearTilingFeatures; - VkFormatFeatureFlags optimalTilingFeatures; - VkFormatFeatureFlags bufferFeatures; -} VkFormatProperties; - -typedef struct VkFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkFormatProperties formatProperties; -} VkFormatProperties2; -typedef VkFormatProperties2 VkFormatProperties2KHR; - -typedef struct VkFormatProperties3 -{ - VkStructureType sType; - void *pNext; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) linearTilingFeatures; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) optimalTilingFeatures; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) bufferFeatures; -} VkFormatProperties3; -typedef VkFormatProperties3 VkFormatProperties3KHR; - -typedef struct VkFragmentShadingRateAttachmentInfoKHR -{ - VkStructureType sType; - const void *pNext; - const VkAttachmentReference2 *pFragmentShadingRateAttachment; - VkExtent2D shadingRateAttachmentTexelSize; -} VkFragmentShadingRateAttachmentInfoKHR; - -typedef struct VkFrameBoundaryEXT -{ - VkStructureType sType; - const void *pNext; - VkFrameBoundaryFlagsEXT flags; - uint64_t WINE_VK_ALIGN(8) frameID; - uint32_t imageCount; - const VkImage *pImages; - uint32_t bufferCount; - const VkBuffer *pBuffers; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkFrameBoundaryEXT; - -typedef struct VkFramebufferAttachmentImageInfo -{ - VkStructureType sType; - const void *pNext; - VkImageCreateFlags flags; - VkImageUsageFlags usage; - uint32_t width; - uint32_t height; - uint32_t layerCount; - uint32_t viewFormatCount; - const VkFormat *pViewFormats; -} VkFramebufferAttachmentImageInfo; -typedef VkFramebufferAttachmentImageInfo VkFramebufferAttachmentImageInfoKHR; - -typedef struct VkFramebufferAttachmentsCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentImageInfoCount; - const VkFramebufferAttachmentImageInfo *pAttachmentImageInfos; -} VkFramebufferAttachmentsCreateInfo; -typedef VkFramebufferAttachmentsCreateInfo VkFramebufferAttachmentsCreateInfoKHR; - -typedef struct VkFramebufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFramebufferCreateFlags flags; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t attachmentCount; - const VkImageView *pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo; - -typedef struct VkFramebufferMixedSamplesCombinationNV -{ - VkStructureType sType; - void *pNext; - VkCoverageReductionModeNV coverageReductionMode; - VkSampleCountFlagBits rasterizationSamples; - VkSampleCountFlags depthStencilSamples; - VkSampleCountFlags colorSamples; -} VkFramebufferMixedSamplesCombinationNV; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV WINE_VK_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkGeneratedCommandsMemoryRequirementsInfoNV; - -typedef struct VkGeometryAABBNV -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) aabbData; - uint32_t numAABBs; - uint32_t stride; - VkDeviceSize WINE_VK_ALIGN(8) offset; -} VkGeometryAABBNV; - -typedef struct VkGeometryTrianglesNV -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) vertexData; - VkDeviceSize WINE_VK_ALIGN(8) vertexOffset; - uint32_t vertexCount; - VkDeviceSize WINE_VK_ALIGN(8) vertexStride; - VkFormat vertexFormat; - VkBuffer WINE_VK_ALIGN(8) indexData; - VkDeviceSize WINE_VK_ALIGN(8) indexOffset; - uint32_t indexCount; - VkIndexType indexType; - VkBuffer WINE_VK_ALIGN(8) transformData; - VkDeviceSize WINE_VK_ALIGN(8) transformOffset; -} VkGeometryTrianglesNV; - -typedef struct VkGraphicsPipelineLibraryCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkGraphicsPipelineLibraryFlagsEXT flags; -} VkGraphicsPipelineLibraryCreateInfoEXT; - -typedef struct VkHostImageCopyDevicePerformanceQueryEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 optimalDeviceAccess; - VkBool32 identicalMemoryLayout; -} VkHostImageCopyDevicePerformanceQueryEXT; - -typedef struct VkImageCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageCaptureDescriptorDataInfoEXT; - -typedef struct VkImageCompressionControlEXT -{ - VkStructureType sType; - const void *pNext; - VkImageCompressionFlagsEXT flags; - uint32_t compressionControlPlaneCount; - VkImageCompressionFixedRateFlagsEXT *pFixedRateFlags; -} VkImageCompressionControlEXT; - -typedef struct VkImageCompressionPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkImageCompressionFlagsEXT imageCompressionFlags; - VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags; -} VkImageCompressionPropertiesEXT; - -typedef struct VkImageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo; - -typedef struct VkImageFormatListCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t viewFormatCount; - const VkFormat *pViewFormats; -} VkImageFormatListCreateInfo; -typedef VkImageFormatListCreateInfo VkImageFormatListCreateInfoKHR; - -typedef struct VkImageFormatProperties -{ - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize WINE_VK_ALIGN(8) maxResourceSize; -} VkImageFormatProperties; - -typedef struct VkImageFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkImageFormatProperties WINE_VK_ALIGN(8) imageFormatProperties; -} VkImageFormatProperties2; -typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; - -typedef struct VkImageMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageMemoryRequirementsInfo2; -typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; - -typedef struct VkImagePlaneMemoryRequirementsInfo -{ - VkStructureType sType; - const void *pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfo; -typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; - -typedef struct VkImageSparseMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageSparseMemoryRequirementsInfo2; -typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR; - -typedef struct VkImageStencilUsageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageUsageFlags stencilUsage; -} VkImageStencilUsageCreateInfo; -typedef VkImageStencilUsageCreateInfo VkImageStencilUsageCreateInfoEXT; - -typedef struct VkImageSubresource -{ - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t arrayLayer; -} VkImageSubresource; - -typedef struct VkImageSubresource2KHR -{ - VkStructureType sType; - void *pNext; - VkImageSubresource imageSubresource; -} VkImageSubresource2KHR; -typedef VkImageSubresource2KHR VkImageSubresource2EXT; - -typedef struct VkImageSubresourceLayers -{ - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceLayers; - -typedef struct VkImageSubresourceRange -{ - VkImageAspectFlags aspectMask; - uint32_t baseMipLevel; - uint32_t levelCount; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceRange; - -typedef struct VkImageSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; -} VkImageSwapchainCreateInfoKHR; - -typedef struct VkImageViewASTCDecodeModeEXT -{ - VkStructureType sType; - const void *pNext; - VkFormat decodeMode; -} VkImageViewASTCDecodeModeEXT; - -typedef struct VkImageViewAddressPropertiesNVX -{ - VkStructureType sType; - void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkImageViewAddressPropertiesNVX; - -typedef struct VkImageViewCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; -} VkImageViewCaptureDescriptorDataInfoEXT; - -typedef struct VkImageViewCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageViewCreateFlags flags; - VkImage WINE_VK_ALIGN(8) image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo; - -typedef struct VkImageViewHandleInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkDescriptorType descriptorType; - VkSampler WINE_VK_ALIGN(8) sampler; -} VkImageViewHandleInfoNVX; - -typedef struct VkImageViewMinLodCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - float minLod; -} VkImageViewMinLodCreateInfoEXT; - -typedef struct VkImageViewSlicedCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t sliceOffset; - uint32_t sliceCount; -} VkImageViewSlicedCreateInfoEXT; - -typedef struct VkImageViewUsageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfo; -typedef VkImageViewUsageCreateInfo VkImageViewUsageCreateInfoKHR; - -typedef struct VkImportMemoryHostPointerInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - void *pHostPointer; -} VkImportMemoryHostPointerInfoEXT; - -typedef struct VkImportMemoryWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR; - -typedef struct VkIndirectCommandsLayoutTokenNV -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsTokenTypeNV tokenType; - uint32_t stream; - uint32_t offset; - uint32_t vertexBindingUnit; - VkBool32 vertexDynamicStride; - VkPipelineLayout WINE_VK_ALIGN(8) pushconstantPipelineLayout; - VkShaderStageFlags pushconstantShaderStageFlags; - uint32_t pushconstantOffset; - uint32_t pushconstantSize; - VkIndirectStateFlagsNV indirectStateFlags; - uint32_t indexTypeCount; - const VkIndexType *pIndexTypes; - const uint32_t *pIndexTypeValues; -} VkIndirectCommandsLayoutTokenNV; - -typedef struct VkIndirectCommandsStreamNV -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; -} VkIndirectCommandsStreamNV; - -typedef struct VkInitializePerformanceApiInfoINTEL -{ - VkStructureType sType; - const void *pNext; - void *pUserData; -} VkInitializePerformanceApiInfoINTEL; - -typedef struct VkInputAttachmentAspectReference -{ - uint32_t subpass; - uint32_t inputAttachmentIndex; - VkImageAspectFlags aspectMask; -} VkInputAttachmentAspectReference; -typedef VkInputAttachmentAspectReference VkInputAttachmentAspectReferenceKHR; - -typedef struct VkInstanceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkInstanceCreateFlags flags; - const VkApplicationInfo *pApplicationInfo; - uint32_t enabledLayerCount; - const char * const*ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const*ppEnabledExtensionNames; -} VkInstanceCreateInfo; - -typedef struct VkLatencySleepInfoNV -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) signalSemaphore; - uint64_t WINE_VK_ALIGN(8) value; -} VkLatencySleepInfoNV; - -typedef struct VkLatencySleepModeInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 lowLatencyMode; - VkBool32 lowLatencyBoost; - uint32_t minimumIntervalUs; -} VkLatencySleepModeInfoNV; - -typedef struct VkLatencySubmissionPresentIdNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; -} VkLatencySubmissionPresentIdNV; - -typedef struct VkLatencySurfaceCapabilitiesNV -{ - VkStructureType sType; - const void *pNext; - uint32_t presentModeCount; - VkPresentModeKHR *pPresentModes; -} VkLatencySurfaceCapabilitiesNV; - -typedef struct VkLatencyTimingsFrameReportNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; - uint64_t WINE_VK_ALIGN(8) inputSampleTimeUs; - uint64_t WINE_VK_ALIGN(8) simStartTimeUs; - uint64_t WINE_VK_ALIGN(8) simEndTimeUs; - uint64_t WINE_VK_ALIGN(8) renderSubmitStartTimeUs; - uint64_t WINE_VK_ALIGN(8) renderSubmitEndTimeUs; - uint64_t WINE_VK_ALIGN(8) presentStartTimeUs; - uint64_t WINE_VK_ALIGN(8) presentEndTimeUs; - uint64_t WINE_VK_ALIGN(8) driverStartTimeUs; - uint64_t WINE_VK_ALIGN(8) driverEndTimeUs; - uint64_t WINE_VK_ALIGN(8) osRenderQueueStartTimeUs; - uint64_t WINE_VK_ALIGN(8) osRenderQueueEndTimeUs; - uint64_t WINE_VK_ALIGN(8) gpuRenderStartTimeUs; - uint64_t WINE_VK_ALIGN(8) gpuRenderEndTimeUs; -} VkLatencyTimingsFrameReportNV; - -typedef struct VkLayerProperties -{ - char layerName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - uint32_t implementationVersion; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkLayerProperties; - -typedef struct VkLayerSettingEXT -{ - const char *pLayerName; - const char *pSettingName; - VkLayerSettingTypeEXT type; - uint32_t valueCount; - const void *pValues; -} VkLayerSettingEXT; - -typedef struct VkLayerSettingsCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t settingCount; - const VkLayerSettingEXT *pSettings; -} VkLayerSettingsCreateInfoEXT; - -typedef struct VkMappedMemoryRange -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkMappedMemoryRange; - -typedef struct VkMemoryAllocateFlagsInfo -{ - VkStructureType sType; - const void *pNext; - VkMemoryAllocateFlags flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfo; -typedef VkMemoryAllocateFlagsInfo VkMemoryAllocateFlagsInfoKHR; - -typedef struct VkMemoryAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo; - -typedef struct VkMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier; - -typedef struct VkMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; -} VkMemoryBarrier2; -typedef VkMemoryBarrier2 VkMemoryBarrier2KHR; - -typedef struct VkMemoryDedicatedAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkMemoryDedicatedAllocateInfo; -typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; - -typedef struct VkMemoryDedicatedRequirements -{ - VkStructureType sType; - void *pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirements; -typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; - -typedef struct VkMemoryGetWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkMemoryGetWin32HandleInfoKHR; - -typedef struct VkMemoryHeap -{ - VkDeviceSize WINE_VK_ALIGN(8) size; - VkMemoryHeapFlags flags; -} VkMemoryHeap; - -typedef struct VkMemoryHostPointerPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t memoryTypeBits; -} VkMemoryHostPointerPropertiesEXT; - -typedef struct VkMemoryMapInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkMemoryMapFlags flags; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkMemoryMapInfoKHR; - -typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) opaqueCaptureAddress; -} VkMemoryOpaqueCaptureAddressAllocateInfo; -typedef VkMemoryOpaqueCaptureAddressAllocateInfo VkMemoryOpaqueCaptureAddressAllocateInfoKHR; - -typedef struct VkMemoryPriorityAllocateInfoEXT -{ - VkStructureType sType; - const void *pNext; - float priority; -} VkMemoryPriorityAllocateInfoEXT; - -typedef struct VkMemoryRequirements -{ - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceSize WINE_VK_ALIGN(8) alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements; - -typedef struct VkMemoryRequirements2 -{ - VkStructureType sType; - void *pNext; - VkMemoryRequirements WINE_VK_ALIGN(8) memoryRequirements; -} VkMemoryRequirements2; -typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; - - -typedef struct VkMemoryType -{ - VkMemoryPropertyFlags propertyFlags; - uint32_t heapIndex; -} VkMemoryType; - -typedef struct VkMemoryUnmapInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkMemoryUnmapFlagsKHR flags; - VkDeviceMemory WINE_VK_ALIGN(8) memory; -} VkMemoryUnmapInfoKHR; - -typedef struct VkMemoryWin32HandlePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t memoryTypeBits; -} VkMemoryWin32HandlePropertiesKHR; - -typedef struct VkMicromapBuildSizesInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) micromapSize; - VkDeviceSize WINE_VK_ALIGN(8) buildScratchSize; - VkBool32 discardable; -} VkMicromapBuildSizesInfoEXT; - -typedef struct VkMicromapCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapCreateFlagsEXT createFlags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkMicromapTypeEXT type; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkMicromapCreateInfoEXT; - -typedef struct VkMicromapTriangleEXT -{ - uint32_t dataOffset; - uint16_t subdivisionLevel; - uint16_t format; -} VkMicromapTriangleEXT; - -typedef struct VkMicromapUsageEXT -{ - uint32_t count; - uint32_t subdivisionLevel; - uint32_t format; -} VkMicromapUsageEXT; - -typedef struct VkMicromapVersionInfoEXT -{ - VkStructureType sType; - const void *pNext; - const uint8_t *pVersionData; -} VkMicromapVersionInfoEXT; - -typedef struct VkMultiDrawIndexedInfoEXT -{ - uint32_t firstIndex; - uint32_t indexCount; - int32_t vertexOffset; -} VkMultiDrawIndexedInfoEXT; - -typedef struct VkMultiDrawInfoEXT -{ - uint32_t firstVertex; - uint32_t vertexCount; -} VkMultiDrawInfoEXT; - -typedef struct VkMultisamplePropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT; - -typedef struct VkMultisampledRenderToSingleSampledInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 multisampledRenderToSingleSampledEnable; - VkSampleCountFlagBits rasterizationSamples; -} VkMultisampledRenderToSingleSampledInfoEXT; - -typedef struct VkMultiviewPerViewAttributesInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkBool32 perViewAttributes; - VkBool32 perViewAttributesPositionXOnly; -} VkMultiviewPerViewAttributesInfoNVX; - -typedef struct VkMutableDescriptorTypeListEXT -{ - uint32_t descriptorTypeCount; - const VkDescriptorType *pDescriptorTypes; -} VkMutableDescriptorTypeListEXT; -typedef VkMutableDescriptorTypeListEXT VkMutableDescriptorTypeListVALVE; - -typedef struct VkOffset2D -{ - int32_t x; - int32_t y; -} VkOffset2D; - -typedef struct VkOffset3D -{ - int32_t x; - int32_t y; - int32_t z; -} VkOffset3D; - -typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - const void *opaqueCaptureDescriptorData; -} VkOpaqueCaptureDescriptorDataCreateInfoEXT; - -typedef struct VkOpticalFlowImageFormatInfoNV -{ - VkStructureType sType; - const void *pNext; - VkOpticalFlowUsageFlagsNV usage; -} VkOpticalFlowImageFormatInfoNV; - -typedef struct VkOpticalFlowImageFormatPropertiesNV -{ - VkStructureType sType; - const void *pNext; - VkFormat format; -} VkOpticalFlowImageFormatPropertiesNV; - -typedef struct VkOpticalFlowSessionCreateInfoNV -{ - VkStructureType sType; - void *pNext; - uint32_t width; - uint32_t height; - VkFormat imageFormat; - VkFormat flowVectorFormat; - VkFormat costFormat; - VkOpticalFlowGridSizeFlagsNV outputGridSize; - VkOpticalFlowGridSizeFlagsNV hintGridSize; - VkOpticalFlowPerformanceLevelNV performanceLevel; - VkOpticalFlowSessionCreateFlagsNV flags; -} VkOpticalFlowSessionCreateInfoNV; - -typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV -{ - VkStructureType sType; - void *pNext; - uint32_t id; - uint32_t size; - const void *pPrivateData; -} VkOpticalFlowSessionCreatePrivateDataInfoNV; - -typedef struct VkOutOfBandQueueTypeInfoNV -{ - VkStructureType sType; - const void *pNext; - VkOutOfBandQueueTypeNV queueType; -} VkOutOfBandQueueTypeInfoNV; - -typedef struct VkPerformanceConfigurationAcquireInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkPerformanceConfigurationTypeINTEL type; -} VkPerformanceConfigurationAcquireInfoINTEL; - -typedef struct VkPerformanceCounterDescriptionKHR -{ - VkStructureType sType; - void *pNext; - VkPerformanceCounterDescriptionFlagsKHR flags; - char name[VK_MAX_DESCRIPTION_SIZE]; - char category[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkPerformanceCounterDescriptionKHR; - -typedef struct VkPerformanceCounterKHR -{ - VkStructureType sType; - void *pNext; - VkPerformanceCounterUnitKHR unit; - VkPerformanceCounterScopeKHR scope; - VkPerformanceCounterStorageKHR storage; - uint8_t uuid[VK_UUID_SIZE]; -} VkPerformanceCounterKHR; - -typedef union VkPerformanceCounterResultKHR -{ - int32_t int32; - int64_t int64; - uint32_t uint32; - uint64_t WINE_VK_ALIGN(8) uint64; - float float32; - double float64; -} VkPerformanceCounterResultKHR; - -typedef struct VkPerformanceMarkerInfoINTEL -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) marker; -} VkPerformanceMarkerInfoINTEL; - -typedef struct VkPerformanceOverrideInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkPerformanceOverrideTypeINTEL type; - VkBool32 enable; - uint64_t WINE_VK_ALIGN(8) parameter; -} VkPerformanceOverrideInfoINTEL; - -typedef struct VkPerformanceQueryReservationInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxPerformanceQueriesPerPool; -} VkPerformanceQueryReservationInfoKHR; - -typedef struct VkPerformanceQuerySubmitInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t counterPassIndex; -} VkPerformanceQuerySubmitInfoKHR; - -typedef struct VkPerformanceStreamMarkerInfoINTEL -{ - VkStructureType sType; - const void *pNext; - uint32_t marker; -} VkPerformanceStreamMarkerInfoINTEL; - -typedef union VkPerformanceValueDataINTEL -{ - uint32_t value32; - uint64_t WINE_VK_ALIGN(8) value64; - float valueFloat; - VkBool32 valueBool; - const char *valueString; -} VkPerformanceValueDataINTEL; - -typedef struct VkPerformanceValueINTEL -{ - VkPerformanceValueTypeINTEL type; - VkPerformanceValueDataINTEL WINE_VK_ALIGN(8) data; -} VkPerformanceValueINTEL; - -typedef struct VkPhysicalDevice16BitStorageFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeatures; -typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; - -typedef struct VkPhysicalDevice4444FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 formatA4R4G4B4; - VkBool32 formatA4B4G4R4; -} VkPhysicalDevice4444FormatsFeaturesEXT; - -typedef struct VkPhysicalDevice8BitStorageFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; -} VkPhysicalDevice8BitStorageFeatures; -typedef VkPhysicalDevice8BitStorageFeatures VkPhysicalDevice8BitStorageFeaturesKHR; - -typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 decodeModeSharedExponent; -} VkPhysicalDeviceASTCDecodeFeaturesEXT; - -typedef struct VkPhysicalDeviceAccelerationStructureFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 accelerationStructure; - VkBool32 accelerationStructureCaptureReplay; - VkBool32 accelerationStructureIndirectBuild; - VkBool32 accelerationStructureHostCommands; - VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind; -} VkPhysicalDeviceAccelerationStructureFeaturesKHR; - -typedef struct VkPhysicalDeviceAccelerationStructurePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) maxGeometryCount; - uint64_t WINE_VK_ALIGN(8) maxInstanceCount; - uint64_t WINE_VK_ALIGN(8) maxPrimitiveCount; - uint32_t maxPerStageDescriptorAccelerationStructures; - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - uint32_t maxDescriptorSetAccelerationStructures; - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures; - uint32_t minAccelerationStructureScratchOffsetAlignment; -} VkPhysicalDeviceAccelerationStructurePropertiesKHR; - -typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 reportAddressBinding; -} VkPhysicalDeviceAddressBindingReportFeaturesEXT; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 attachmentFeedbackLoopDynamicState; -} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 attachmentFeedbackLoopLayout; -} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; - -typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 borderColorSwizzle; - VkBool32 borderColorSwizzleFromImage; -} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeatures; -typedef VkPhysicalDeviceBufferDeviceAddressFeatures VkPhysicalDeviceBufferDeviceAddressFeaturesKHR; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeaturesEXT; -typedef VkPhysicalDeviceBufferDeviceAddressFeaturesEXT VkPhysicalDeviceBufferAddressFeaturesEXT; - -typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 clustercullingShader; - VkBool32 multiviewClusterCullingShader; -} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI -{ - VkStructureType sType; - void *pNext; - uint32_t maxWorkGroupCount[3]; - uint32_t maxWorkGroupSize[3]; - uint32_t maxOutputClusterCount; - VkDeviceSize WINE_VK_ALIGN(8) indirectBufferOffsetAlignment; -} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; - -typedef struct VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 clusterShadingRate; -} VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceCoherentMemory; -} VkPhysicalDeviceCoherentMemoryFeaturesAMD; - -typedef struct VkPhysicalDeviceColorWriteEnableFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 colorWriteEnable; -} VkPhysicalDeviceColorWriteEnableFeaturesEXT; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 computeDerivativeGroupQuads; - VkBool32 computeDerivativeGroupLinear; -} VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; - -typedef struct VkPhysicalDeviceConditionalRenderingFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 conditionalRendering; - VkBool32 inheritedConditionalRendering; -} VkPhysicalDeviceConditionalRenderingFeaturesEXT; - -typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT -{ - VkStructureType sType; - void *pNext; - float primitiveOverestimationSize; - float maxExtraPrimitiveOverestimationSize; - float extraPrimitiveOverestimationSizeGranularity; - VkBool32 primitiveUnderestimation; - VkBool32 conservativePointAndLineRasterization; - VkBool32 degenerateTrianglesRasterized; - VkBool32 degenerateLinesRasterized; - VkBool32 fullyCoveredFragmentShaderInputVariable; - VkBool32 conservativeRasterizationPostDepthCoverage; -} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesKHR; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesNV; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesKHR; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesNV; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 indirectCopy; -} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkQueueFlags supportedQueues; -} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV; - -typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cornerSampledImage; -} VkPhysicalDeviceCornerSampledImageFeaturesNV; - -typedef struct VkPhysicalDeviceCoverageReductionModeFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 coverageReductionMode; -} VkPhysicalDeviceCoverageReductionModeFeaturesNV; - -typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 cubicRangeClamp; -} VkPhysicalDeviceCubicClampFeaturesQCOM; - -typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 selectableCubicWeights; -} VkPhysicalDeviceCubicWeightsFeaturesQCOM; - -typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cudaKernelLaunchFeatures; -} VkPhysicalDeviceCudaKernelLaunchFeaturesNV; - -typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t computeCapabilityMinor; - uint32_t computeCapabilityMajor; -} VkPhysicalDeviceCudaKernelLaunchPropertiesNV; - -typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 customBorderColors; - VkBool32 customBorderColorWithoutFormat; -} VkPhysicalDeviceCustomBorderColorFeaturesEXT; - -typedef struct VkPhysicalDeviceCustomBorderColorPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxCustomBorderColorSamplers; -} VkPhysicalDeviceCustomBorderColorPropertiesEXT; - -typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 dedicatedAllocationImageAliasing; -} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - -typedef struct VkPhysicalDeviceDepthBiasControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthBiasControl; - VkBool32 leastRepresentableValueForceUnormRepresentation; - VkBool32 floatRepresentation; - VkBool32 depthBiasExact; -} VkPhysicalDeviceDepthBiasControlFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClampZeroOne; -} VkPhysicalDeviceDepthClampZeroOneFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClipControl; -} VkPhysicalDeviceDepthClipControlFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClipEnableFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClipEnable; -} VkPhysicalDeviceDepthClipEnableFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthStencilResolveProperties -{ - VkStructureType sType; - void *pNext; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; -} VkPhysicalDeviceDepthStencilResolveProperties; -typedef VkPhysicalDeviceDepthStencilResolveProperties VkPhysicalDeviceDepthStencilResolvePropertiesKHR; - -typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - size_t combinedImageSamplerDensityMapDescriptorSize; -} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorBuffer; - VkBool32 descriptorBufferCaptureReplay; - VkBool32 descriptorBufferImageLayoutIgnored; - VkBool32 descriptorBufferPushDescriptors; -} VkPhysicalDeviceDescriptorBufferFeaturesEXT; - -typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 combinedImageSamplerDescriptorSingleArray; - VkBool32 bufferlessPushDescriptors; - VkBool32 allowSamplerImageViewPostSubmitCreation; - VkDeviceSize WINE_VK_ALIGN(8) descriptorBufferOffsetAlignment; - uint32_t maxDescriptorBufferBindings; - uint32_t maxResourceDescriptorBufferBindings; - uint32_t maxSamplerDescriptorBufferBindings; - uint32_t maxEmbeddedImmutableSamplerBindings; - uint32_t maxEmbeddedImmutableSamplers; - size_t bufferCaptureReplayDescriptorDataSize; - size_t imageCaptureReplayDescriptorDataSize; - size_t imageViewCaptureReplayDescriptorDataSize; - size_t samplerCaptureReplayDescriptorDataSize; - size_t accelerationStructureCaptureReplayDescriptorDataSize; - size_t samplerDescriptorSize; - size_t combinedImageSamplerDescriptorSize; - size_t sampledImageDescriptorSize; - size_t storageImageDescriptorSize; - size_t uniformTexelBufferDescriptorSize; - size_t robustUniformTexelBufferDescriptorSize; - size_t storageTexelBufferDescriptorSize; - size_t robustStorageTexelBufferDescriptorSize; - size_t uniformBufferDescriptorSize; - size_t robustUniformBufferDescriptorSize; - size_t storageBufferDescriptorSize; - size_t robustStorageBufferDescriptorSize; - size_t inputAttachmentDescriptorSize; - size_t accelerationStructureDescriptorSize; - VkDeviceSize WINE_VK_ALIGN(8) maxSamplerDescriptorBufferRange; - VkDeviceSize WINE_VK_ALIGN(8) maxResourceDescriptorBufferRange; - VkDeviceSize WINE_VK_ALIGN(8) samplerDescriptorBufferAddressSpaceSize; - VkDeviceSize WINE_VK_ALIGN(8) resourceDescriptorBufferAddressSpaceSize; - VkDeviceSize WINE_VK_ALIGN(8) descriptorBufferAddressSpaceSize; -} VkPhysicalDeviceDescriptorBufferPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorIndexingFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; -} VkPhysicalDeviceDescriptorIndexingFeatures; -typedef VkPhysicalDeviceDescriptorIndexingFeatures VkPhysicalDeviceDescriptorIndexingFeaturesEXT; - -typedef struct VkPhysicalDeviceDescriptorIndexingProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; -} VkPhysicalDeviceDescriptorIndexingProperties; -typedef VkPhysicalDeviceDescriptorIndexingProperties VkPhysicalDeviceDescriptorIndexingPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorPoolOverallocation; -} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV; - -typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorSetHostMapping; -} VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceGeneratedCompute; - VkBool32 deviceGeneratedComputePipelines; - VkBool32 deviceGeneratedComputeCaptureReplay; -} VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceGeneratedCommands; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t maxGraphicsShaderGroupCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsStreamCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsStreamStride; - uint32_t minSequencesCountBufferOffsetAlignment; - uint32_t minSequencesIndexBufferOffsetAlignment; - uint32_t minIndirectCommandsBufferOffsetAlignment; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - -typedef struct VkPhysicalDeviceDiagnosticsConfigFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 diagnosticsConfig; -} VkPhysicalDeviceDiagnosticsConfigFeaturesNV; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT; - -typedef struct VkPhysicalDeviceDriverProperties -{ - VkStructureType sType; - void *pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; -} VkPhysicalDeviceDriverProperties; -typedef VkPhysicalDeviceDriverProperties VkPhysicalDeviceDriverPropertiesKHR; - -typedef struct VkPhysicalDeviceDynamicRenderingFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicRendering; -} VkPhysicalDeviceDynamicRenderingFeatures; -typedef VkPhysicalDeviceDynamicRenderingFeatures VkPhysicalDeviceDynamicRenderingFeaturesKHR; - -typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicRenderingUnusedAttachments; -} VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT; - -typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 exclusiveScissor; -} VkPhysicalDeviceExclusiveScissorFeaturesNV; - -typedef struct VkPhysicalDeviceExtendedDynamicState2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState2; - VkBool32 extendedDynamicState2LogicOp; - VkBool32 extendedDynamicState2PatchControlPoints; -} VkPhysicalDeviceExtendedDynamicState2FeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState3TessellationDomainOrigin; - VkBool32 extendedDynamicState3DepthClampEnable; - VkBool32 extendedDynamicState3PolygonMode; - VkBool32 extendedDynamicState3RasterizationSamples; - VkBool32 extendedDynamicState3SampleMask; - VkBool32 extendedDynamicState3AlphaToCoverageEnable; - VkBool32 extendedDynamicState3AlphaToOneEnable; - VkBool32 extendedDynamicState3LogicOpEnable; - VkBool32 extendedDynamicState3ColorBlendEnable; - VkBool32 extendedDynamicState3ColorBlendEquation; - VkBool32 extendedDynamicState3ColorWriteMask; - VkBool32 extendedDynamicState3RasterizationStream; - VkBool32 extendedDynamicState3ConservativeRasterizationMode; - VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize; - VkBool32 extendedDynamicState3DepthClipEnable; - VkBool32 extendedDynamicState3SampleLocationsEnable; - VkBool32 extendedDynamicState3ColorBlendAdvanced; - VkBool32 extendedDynamicState3ProvokingVertexMode; - VkBool32 extendedDynamicState3LineRasterizationMode; - VkBool32 extendedDynamicState3LineStippleEnable; - VkBool32 extendedDynamicState3DepthClipNegativeOneToOne; - VkBool32 extendedDynamicState3ViewportWScalingEnable; - VkBool32 extendedDynamicState3ViewportSwizzle; - VkBool32 extendedDynamicState3CoverageToColorEnable; - VkBool32 extendedDynamicState3CoverageToColorLocation; - VkBool32 extendedDynamicState3CoverageModulationMode; - VkBool32 extendedDynamicState3CoverageModulationTableEnable; - VkBool32 extendedDynamicState3CoverageModulationTable; - VkBool32 extendedDynamicState3CoverageReductionMode; - VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable; - VkBool32 extendedDynamicState3ShadingRateImageEnable; -} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicPrimitiveTopologyUnrestricted; -} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState; -} VkPhysicalDeviceExtendedDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedSparseAddressSpace; -} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) extendedSparseAddressSpaceSize; - VkImageUsageFlags extendedSparseImageUsageFlags; - VkBufferUsageFlags extendedSparseBufferUsageFlags; -} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; - -typedef struct VkPhysicalDeviceExternalBufferInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalBufferInfo; -typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; - -typedef struct VkPhysicalDeviceExternalFenceInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalFenceHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalFenceInfo; -typedef VkPhysicalDeviceExternalFenceInfo VkPhysicalDeviceExternalFenceInfoKHR; - -typedef struct VkPhysicalDeviceExternalImageFormatInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalImageFormatInfo; -typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; - -typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) minImportedHostPointerAlignment; -} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalSemaphoreInfo; -typedef VkPhysicalDeviceExternalSemaphoreInfo VkPhysicalDeviceExternalSemaphoreInfoKHR; - -typedef struct VkPhysicalDeviceFaultFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceFault; - VkBool32 deviceFaultVendorBinary; -} VkPhysicalDeviceFaultFeaturesEXT; - -typedef struct VkPhysicalDeviceFeatures -{ - VkBool32 robustBufferAccess; - VkBool32 fullDrawIndexUint32; - VkBool32 imageCubeArray; - VkBool32 independentBlend; - VkBool32 geometryShader; - VkBool32 tessellationShader; - VkBool32 sampleRateShading; - VkBool32 dualSrcBlend; - VkBool32 logicOp; - VkBool32 multiDrawIndirect; - VkBool32 drawIndirectFirstInstance; - VkBool32 depthClamp; - VkBool32 depthBiasClamp; - VkBool32 fillModeNonSolid; - VkBool32 depthBounds; - VkBool32 wideLines; - VkBool32 largePoints; - VkBool32 alphaToOne; - VkBool32 multiViewport; - VkBool32 samplerAnisotropy; - VkBool32 textureCompressionETC2; - VkBool32 textureCompressionASTC_LDR; - VkBool32 textureCompressionBC; - VkBool32 occlusionQueryPrecise; - VkBool32 pipelineStatisticsQuery; - VkBool32 vertexPipelineStoresAndAtomics; - VkBool32 fragmentStoresAndAtomics; - VkBool32 shaderTessellationAndGeometryPointSize; - VkBool32 shaderImageGatherExtended; - VkBool32 shaderStorageImageExtendedFormats; - VkBool32 shaderStorageImageMultisample; - VkBool32 shaderStorageImageReadWithoutFormat; - VkBool32 shaderStorageImageWriteWithoutFormat; - VkBool32 shaderUniformBufferArrayDynamicIndexing; - VkBool32 shaderSampledImageArrayDynamicIndexing; - VkBool32 shaderStorageBufferArrayDynamicIndexing; - VkBool32 shaderStorageImageArrayDynamicIndexing; - VkBool32 shaderClipDistance; - VkBool32 shaderCullDistance; - VkBool32 shaderFloat64; - VkBool32 shaderInt64; - VkBool32 shaderInt16; - VkBool32 shaderResourceResidency; - VkBool32 shaderResourceMinLod; - VkBool32 sparseBinding; - VkBool32 sparseResidencyBuffer; - VkBool32 sparseResidencyImage2D; - VkBool32 sparseResidencyImage3D; - VkBool32 sparseResidency2Samples; - VkBool32 sparseResidency4Samples; - VkBool32 sparseResidency8Samples; - VkBool32 sparseResidency16Samples; - VkBool32 sparseResidencyAliased; - VkBool32 variableMultisampleRate; - VkBool32 inheritedQueries; -} VkPhysicalDeviceFeatures; - -typedef struct VkPhysicalDeviceFeatures2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures2; -typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; - -typedef struct VkPhysicalDeviceFloatControlsProperties -{ - VkStructureType sType; - void *pNext; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; -} VkPhysicalDeviceFloatControlsProperties; -typedef VkPhysicalDeviceFloatControlsProperties VkPhysicalDeviceFloatControlsPropertiesKHR; - -typedef struct VkPhysicalDeviceFragmentDensityMap2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMapDeferred; -} VkPhysicalDeviceFragmentDensityMap2FeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 subsampledLoads; - VkBool32 subsampledCoarseReconstructionEarlyAccess; - uint32_t maxSubsampledArrayLayers; - uint32_t maxDescriptorSetSubsampledSamplers; -} VkPhysicalDeviceFragmentDensityMap2PropertiesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMap; - VkBool32 fragmentDensityMapDynamic; - VkBool32 fragmentDensityMapNonSubsampledImages; -} VkPhysicalDeviceFragmentDensityMapFeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMapOffset; -} VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent2D fragmentDensityOffsetGranularity; -} VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - -typedef struct VkPhysicalDeviceFragmentDensityMapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkExtent2D minFragmentDensityTexelSize; - VkExtent2D maxFragmentDensityTexelSize; - VkBool32 fragmentDensityInvocations; -} VkPhysicalDeviceFragmentDensityMapPropertiesEXT; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShaderBarycentric; -} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR; -typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 triStripVertexOrderIndependentOfProvokingVertex; -} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - -typedef struct VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShaderSampleInterlock; - VkBool32 fragmentShaderPixelInterlock; - VkBool32 fragmentShaderShadingRateInterlock; -} VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShadingRateEnums; - VkBool32 supersampleFragmentShadingRates; - VkBool32 noInvocationFragmentShadingRates; -} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; -} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - -typedef struct VkPhysicalDeviceFragmentShadingRateFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineFragmentShadingRate; - VkBool32 primitiveFragmentShadingRate; - VkBool32 attachmentFragmentShadingRate; -} VkPhysicalDeviceFragmentShadingRateFeaturesKHR; - -typedef struct VkPhysicalDeviceFragmentShadingRateKHR -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlags sampleCounts; - VkExtent2D fragmentSize; -} VkPhysicalDeviceFragmentShadingRateKHR; - -typedef struct VkPhysicalDeviceFragmentShadingRatePropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkExtent2D minFragmentShadingRateAttachmentTexelSize; - VkExtent2D maxFragmentShadingRateAttachmentTexelSize; - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - VkBool32 primitiveFragmentShadingRateWithMultipleViewports; - VkBool32 layeredShadingRateAttachments; - VkBool32 fragmentShadingRateNonTrivialCombinerOps; - VkExtent2D maxFragmentSize; - uint32_t maxFragmentSizeAspectRatio; - uint32_t maxFragmentShadingRateCoverageSamples; - VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples; - VkBool32 fragmentShadingRateWithShaderDepthStencilWrites; - VkBool32 fragmentShadingRateWithSampleMask; - VkBool32 fragmentShadingRateWithShaderSampleMask; - VkBool32 fragmentShadingRateWithConservativeRasterization; - VkBool32 fragmentShadingRateWithFragmentShaderInterlock; - VkBool32 fragmentShadingRateWithCustomSampleLocations; - VkBool32 fragmentShadingRateStrictMultiplyCombiner; -} VkPhysicalDeviceFragmentShadingRatePropertiesKHR; - -typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 frameBoundary; -} VkPhysicalDeviceFrameBoundaryFeaturesEXT; - -typedef struct VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 globalPriorityQuery; -} VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR; -typedef VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 graphicsPipelineLibrary; -} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 graphicsPipelineLibraryFastLinking; - VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; -} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - -typedef struct VkPhysicalDeviceGroupProperties -{ - VkStructureType sType; - void *pNext; - uint32_t physicalDeviceCount; - VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupProperties; -typedef VkPhysicalDeviceGroupProperties VkPhysicalDeviceGroupPropertiesKHR; - -typedef struct VkPhysicalDeviceHostImageCopyFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 hostImageCopy; -} VkPhysicalDeviceHostImageCopyFeaturesEXT; - -typedef struct VkPhysicalDeviceHostImageCopyPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t copySrcLayoutCount; - VkImageLayout *pCopySrcLayouts; - uint32_t copyDstLayoutCount; - VkImageLayout *pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceHostImageCopyPropertiesEXT; - -typedef struct VkPhysicalDeviceHostQueryResetFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 hostQueryReset; -} VkPhysicalDeviceHostQueryResetFeatures; -typedef VkPhysicalDeviceHostQueryResetFeatures VkPhysicalDeviceHostQueryResetFeaturesEXT; - -typedef struct VkPhysicalDeviceIDProperties -{ - VkStructureType sType; - void *pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDProperties; -typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; - -typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 image2DViewOf3D; - VkBool32 sampler2DViewOf3D; -} VkPhysicalDeviceImage2DViewOf3DFeaturesEXT; - -typedef struct VkPhysicalDeviceImageCompressionControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageCompressionControl; -} VkPhysicalDeviceImageCompressionControlFeaturesEXT; - -typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageCompressionControlSwapchain; -} VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - -typedef struct VkPhysicalDeviceImageFormatInfo2 -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo2; -typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; - -typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 textureBlockMatch2; -} VkPhysicalDeviceImageProcessing2FeaturesQCOM; - -typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent2D maxBlockMatchWindow; -} VkPhysicalDeviceImageProcessing2PropertiesQCOM; - -typedef struct VkPhysicalDeviceImageProcessingFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 textureSampleWeighted; - VkBool32 textureBoxFilter; - VkBool32 textureBlockMatch; -} VkPhysicalDeviceImageProcessingFeaturesQCOM; - -typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM -{ - VkStructureType sType; - void *pNext; - uint32_t maxWeightFilterPhases; - VkExtent2D maxWeightFilterDimension; - VkExtent2D maxBlockMatchRegion; - VkExtent2D maxBoxFilterBlockSize; -} VkPhysicalDeviceImageProcessingPropertiesQCOM; - -typedef struct VkPhysicalDeviceImageRobustnessFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 robustImageAccess; -} VkPhysicalDeviceImageRobustnessFeatures; -typedef VkPhysicalDeviceImageRobustnessFeatures VkPhysicalDeviceImageRobustnessFeaturesEXT; - -typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageSlicedViewOf3D; -} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT; - -typedef struct VkPhysicalDeviceImageViewImageFormatInfoEXT -{ - VkStructureType sType; - void *pNext; - VkImageViewType imageViewType; -} VkPhysicalDeviceImageViewImageFormatInfoEXT; - -typedef struct VkPhysicalDeviceImageViewMinLodFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 minLod; -} VkPhysicalDeviceImageViewMinLodFeaturesEXT; - -typedef struct VkPhysicalDeviceImagelessFramebufferFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 imagelessFramebuffer; -} VkPhysicalDeviceImagelessFramebufferFeatures; -typedef VkPhysicalDeviceImagelessFramebufferFeatures VkPhysicalDeviceImagelessFramebufferFeaturesKHR; - -typedef struct VkPhysicalDeviceIndexTypeUint8FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 indexTypeUint8; -} VkPhysicalDeviceIndexTypeUint8FeaturesEXT; - -typedef struct VkPhysicalDeviceInheritedViewportScissorFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 inheritedViewportScissor2D; -} VkPhysicalDeviceInheritedViewportScissorFeaturesNV; - -typedef struct VkPhysicalDeviceInlineUniformBlockFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; -} VkPhysicalDeviceInlineUniformBlockFeatures; -typedef VkPhysicalDeviceInlineUniformBlockFeatures VkPhysicalDeviceInlineUniformBlockFeaturesEXT; - -typedef struct VkPhysicalDeviceInlineUniformBlockProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; -} VkPhysicalDeviceInlineUniformBlockProperties; -typedef VkPhysicalDeviceInlineUniformBlockProperties VkPhysicalDeviceInlineUniformBlockPropertiesEXT; - -typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 invocationMask; -} VkPhysicalDeviceInvocationMaskFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT -{ - VkStructureType sType; - void *pNext; - VkLayeredDriverUnderlyingApiMSFT underlyingAPI; -} VkPhysicalDeviceLayeredDriverPropertiesMSFT; - -typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 legacyDithering; -} VkPhysicalDeviceLegacyDitheringFeaturesEXT; - -typedef struct VkPhysicalDeviceLimits -{ - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize WINE_VK_ALIGN(8) bufferImageGranularity; - VkDeviceSize WINE_VK_ALIGN(8) sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - size_t minMemoryMapAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minTexelBufferOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minUniformBufferOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyRowPitchAlignment; - VkDeviceSize WINE_VK_ALIGN(8) nonCoherentAtomSize; -} VkPhysicalDeviceLimits; - -typedef struct VkPhysicalDeviceLineRasterizationFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; -} VkPhysicalDeviceLineRasterizationFeaturesEXT; - -typedef struct VkPhysicalDeviceLineRasterizationPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t lineSubPixelPrecisionBits; -} VkPhysicalDeviceLineRasterizationPropertiesEXT; - -typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 linearColorAttachment; -} VkPhysicalDeviceLinearColorAttachmentFeaturesNV; - -typedef struct VkPhysicalDeviceMaintenance3Properties -{ - VkStructureType sType; - void *pNext; - uint32_t maxPerSetDescriptors; - VkDeviceSize WINE_VK_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceMaintenance3Properties; -typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; - -typedef struct VkPhysicalDeviceMaintenance4Features -{ - VkStructureType sType; - void *pNext; - VkBool32 maintenance4; -} VkPhysicalDeviceMaintenance4Features; -typedef VkPhysicalDeviceMaintenance4Features VkPhysicalDeviceMaintenance4FeaturesKHR; - -typedef struct VkPhysicalDeviceMaintenance4Properties -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceMaintenance4Properties; -typedef VkPhysicalDeviceMaintenance4Properties VkPhysicalDeviceMaintenance4PropertiesKHR; - -typedef struct VkPhysicalDeviceMaintenance5FeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 maintenance5; -} VkPhysicalDeviceMaintenance5FeaturesKHR; - -typedef struct VkPhysicalDeviceMaintenance5PropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; -} VkPhysicalDeviceMaintenance5PropertiesKHR; - -typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) heapBudget[VK_MAX_MEMORY_HEAPS]; - VkDeviceSize WINE_VK_ALIGN(8) heapUsage[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryBudgetPropertiesEXT; - -typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 memoryDecompression; -} VkPhysicalDeviceMemoryDecompressionFeaturesNV; - -typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkMemoryDecompressionMethodFlagsNV WINE_VK_ALIGN(8) decompressionMethods; - uint64_t WINE_VK_ALIGN(8) maxDecompressionIndirectCount; -} VkPhysicalDeviceMemoryDecompressionPropertiesNV; - -typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 memoryPriority; -} VkPhysicalDeviceMemoryPriorityFeaturesEXT; - -typedef struct VkPhysicalDeviceMemoryProperties -{ - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap WINE_VK_ALIGN(8) memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties; - -typedef struct VkPhysicalDeviceMemoryProperties2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceMemoryProperties WINE_VK_ALIGN(8) memoryProperties; -} VkPhysicalDeviceMemoryProperties2; -typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 taskShader; - VkBool32 meshShader; - VkBool32 multiviewMeshShader; - VkBool32 primitiveFragmentShadingRateMeshShader; - VkBool32 meshShaderQueries; -} VkPhysicalDeviceMeshShaderFeaturesEXT; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 taskShader; - VkBool32 meshShader; -} VkPhysicalDeviceMeshShaderFeaturesNV; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxTaskWorkGroupTotalCount; - uint32_t maxTaskWorkGroupCount[3]; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskPayloadSize; - uint32_t maxTaskSharedMemorySize; - uint32_t maxTaskPayloadAndSharedMemorySize; - uint32_t maxMeshWorkGroupTotalCount; - uint32_t maxMeshWorkGroupCount[3]; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshSharedMemorySize; - uint32_t maxMeshPayloadAndSharedMemorySize; - uint32_t maxMeshOutputMemorySize; - uint32_t maxMeshPayloadAndOutputMemorySize; - uint32_t maxMeshOutputComponents; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshOutputLayers; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; - uint32_t maxPreferredTaskWorkGroupInvocations; - uint32_t maxPreferredMeshWorkGroupInvocations; - VkBool32 prefersLocalInvocationVertexOutput; - VkBool32 prefersLocalInvocationPrimitiveOutput; - VkBool32 prefersCompactVertexOutput; - VkBool32 prefersCompactPrimitiveOutput; -} VkPhysicalDeviceMeshShaderPropertiesEXT; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t maxDrawMeshTasksCount; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskTotalMemorySize; - uint32_t maxTaskOutputCount; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshTotalMemorySize; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; -} VkPhysicalDeviceMeshShaderPropertiesNV; - -typedef struct VkPhysicalDeviceMultiDrawFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 multiDraw; -} VkPhysicalDeviceMultiDrawFeaturesEXT; - -typedef struct VkPhysicalDeviceMultiDrawPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxMultiDrawCount; -} VkPhysicalDeviceMultiDrawPropertiesEXT; - -typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 multisampledRenderToSingleSampled; -} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - -typedef struct VkPhysicalDeviceMultiviewFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeatures; -typedef VkPhysicalDeviceMultiviewFeatures VkPhysicalDeviceMultiviewFeaturesKHR; - -typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 multiviewPerViewRenderAreas; -} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; - -typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 multiviewPerViewViewports; -} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM; - -typedef struct VkPhysicalDeviceMultiviewProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewProperties; -typedef VkPhysicalDeviceMultiviewProperties VkPhysicalDeviceMultiviewPropertiesKHR; - -typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 mutableDescriptorType; -} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT; -typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - -typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 nestedCommandBuffer; - VkBool32 nestedCommandBufferRendering; - VkBool32 nestedCommandBufferSimultaneousUse; -} VkPhysicalDeviceNestedCommandBufferFeaturesEXT; - -typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxCommandBufferNestingLevel; -} VkPhysicalDeviceNestedCommandBufferPropertiesEXT; - -typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 nonSeamlessCubeMap; -} VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - -typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 micromap; - VkBool32 micromapCaptureReplay; - VkBool32 micromapHostCommands; -} VkPhysicalDeviceOpacityMicromapFeaturesEXT; - -typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxOpacity2StateSubdivisionLevel; - uint32_t maxOpacity4StateSubdivisionLevel; -} VkPhysicalDeviceOpacityMicromapPropertiesEXT; - -typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 opticalFlow; -} VkPhysicalDeviceOpticalFlowFeaturesNV; - -typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes; - VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes; - VkBool32 hintSupported; - VkBool32 costSupported; - VkBool32 bidirectionalFlowSupported; - VkBool32 globalFlowSupported; - uint32_t minWidth; - uint32_t minHeight; - uint32_t maxWidth; - uint32_t maxHeight; - uint32_t maxNumRegionsOfInterest; -} VkPhysicalDeviceOpticalFlowPropertiesNV; - -typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t pciDomain; - uint32_t pciBus; - uint32_t pciDevice; - uint32_t pciFunction; -} VkPhysicalDevicePCIBusInfoPropertiesEXT; - -typedef struct VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pageableDeviceLocalMemory; -} VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - -typedef struct VkPhysicalDevicePerformanceQueryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 performanceCounterQueryPools; - VkBool32 performanceCounterMultipleQueryPools; -} VkPhysicalDevicePerformanceQueryFeaturesKHR; - -typedef struct VkPhysicalDevicePerformanceQueryPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 allowCommandBufferQueryCopies; -} VkPhysicalDevicePerformanceQueryPropertiesKHR; - -typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineCreationCacheControl; -} VkPhysicalDevicePipelineCreationCacheControlFeatures; -typedef VkPhysicalDevicePipelineCreationCacheControlFeatures VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineExecutableInfo; -} VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - -typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineLibraryGroupHandles; -} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT; - -typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelinePropertiesIdentifier; -} VkPhysicalDevicePipelinePropertiesFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineProtectedAccess; -} VkPhysicalDevicePipelineProtectedAccessFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineRobustnessFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineRobustness; -} VkPhysicalDevicePipelineRobustnessFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineRobustnessPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehaviorEXT defaultRobustnessImages; -} VkPhysicalDevicePipelineRobustnessPropertiesEXT; - -typedef struct VkPhysicalDevicePointClippingProperties -{ - VkStructureType sType; - void *pNext; - VkPointClippingBehavior pointClippingBehavior; -} VkPhysicalDevicePointClippingProperties; -typedef VkPhysicalDevicePointClippingProperties VkPhysicalDevicePointClippingPropertiesKHR; - -typedef struct VkPhysicalDevicePresentBarrierFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrier; -} VkPhysicalDevicePresentBarrierFeaturesNV; - -typedef struct VkPhysicalDevicePresentIdFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 presentId; -} VkPhysicalDevicePresentIdFeaturesKHR; - -typedef struct VkPhysicalDevicePresentWaitFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 presentWait; -} VkPhysicalDevicePresentWaitFeaturesKHR; - -typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 primitiveTopologyListRestart; - VkBool32 primitiveTopologyPatchListRestart; -} VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - -typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 primitivesGeneratedQuery; - VkBool32 primitivesGeneratedQueryWithRasterizerDiscard; - VkBool32 primitivesGeneratedQueryWithNonZeroStreams; -} VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - -typedef struct VkPhysicalDevicePrivateDataFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 privateData; -} VkPhysicalDevicePrivateDataFeatures; -typedef VkPhysicalDevicePrivateDataFeatures VkPhysicalDevicePrivateDataFeaturesEXT; - -typedef struct VkPhysicalDeviceProtectedMemoryFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeatures; - -typedef struct VkPhysicalDeviceProtectedMemoryProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryProperties; - -typedef struct VkPhysicalDeviceProvokingVertexFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 provokingVertexLast; - VkBool32 transformFeedbackPreservesProvokingVertex; -} VkPhysicalDeviceProvokingVertexFeaturesEXT; - -typedef struct VkPhysicalDeviceProvokingVertexPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 provokingVertexModePerPipeline; - VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex; -} VkPhysicalDeviceProvokingVertexPropertiesEXT; - -typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorPropertiesKHR; - -typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 formatRgba10x6WithoutYCbCrSampler; -} VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT; - -typedef struct VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 rasterizationOrderColorAttachmentAccess; - VkBool32 rasterizationOrderDepthAttachmentAccess; - VkBool32 rasterizationOrderStencilAttachmentAccess; -} VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; -typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM; - -typedef struct VkPhysicalDeviceRayQueryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayQuery; -} VkPhysicalDeviceRayQueryFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingInvocationReorder; -} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint; -} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV; - -typedef struct VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingMaintenance1; - VkBool32 rayTracingPipelineTraceRaysIndirect2; -} VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingMotionBlurFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingMotionBlur; - VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect; -} VkPhysicalDeviceRayTracingMotionBlurFeaturesNV; - -typedef struct VkPhysicalDeviceRayTracingPipelineFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingPipeline; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - VkBool32 rayTracingPipelineTraceRaysIndirect; - VkBool32 rayTraversalPrimitiveCulling; -} VkPhysicalDeviceRayTracingPipelineFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingPipelinePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRayRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint32_t shaderGroupHandleCaptureReplaySize; - uint32_t maxRayDispatchInvocationCount; - uint32_t shaderGroupHandleAlignment; - uint32_t maxRayHitAttributeSize; -} VkPhysicalDeviceRayTracingPipelinePropertiesKHR; - -typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingPositionFetch; -} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint64_t WINE_VK_ALIGN(8) maxGeometryCount; - uint64_t WINE_VK_ALIGN(8) maxInstanceCount; - uint64_t WINE_VK_ALIGN(8) maxTriangleCount; - uint32_t maxDescriptorSetAccelerationStructures; -} VkPhysicalDeviceRayTracingPropertiesNV; - -typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG -{ - VkStructureType sType; - void *pNext; - VkBool32 relaxedLineRasterization; -} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG; - -typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 representativeFragmentTest; -} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV; - -typedef struct VkPhysicalDeviceRobustness2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 robustBufferAccess2; - VkBool32 robustImageAccess2; - VkBool32 nullDescriptor; -} VkPhysicalDeviceRobustness2FeaturesEXT; - -typedef struct VkPhysicalDeviceRobustness2PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) robustStorageBufferAccessSizeAlignment; - VkDeviceSize WINE_VK_ALIGN(8) robustUniformBufferAccessSizeAlignment; -} VkPhysicalDeviceRobustness2PropertiesEXT; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxProperties; -typedef VkPhysicalDeviceSamplerFilterMinmaxProperties VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeatures; -typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; - -typedef struct VkPhysicalDeviceScalarBlockLayoutFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 scalarBlockLayout; -} VkPhysicalDeviceScalarBlockLayoutFeatures; -typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLayoutFeaturesEXT; - -typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM -{ - VkStructureType sType; - void *pNext; - VkBool32 schedulingControls; -} VkPhysicalDeviceSchedulingControlsFeaturesARM; - -typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceSchedulingControlsFlagsARM WINE_VK_ALIGN(8) schedulingControlsFlags; -} VkPhysicalDeviceSchedulingControlsPropertiesARM; - -typedef struct VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 separateDepthStencilLayouts; -} VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures; -typedef VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferFloat16Atomics; - VkBool32 shaderBufferFloat16AtomicAdd; - VkBool32 shaderBufferFloat16AtomicMinMax; - VkBool32 shaderBufferFloat32AtomicMinMax; - VkBool32 shaderBufferFloat64AtomicMinMax; - VkBool32 shaderSharedFloat16Atomics; - VkBool32 shaderSharedFloat16AtomicAdd; - VkBool32 shaderSharedFloat16AtomicMinMax; - VkBool32 shaderSharedFloat32AtomicMinMax; - VkBool32 shaderSharedFloat64AtomicMinMax; - VkBool32 shaderImageFloat32AtomicMinMax; - VkBool32 sparseImageFloat32AtomicMinMax; -} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; - -typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferFloat32Atomics; - VkBool32 shaderBufferFloat32AtomicAdd; - VkBool32 shaderBufferFloat64Atomics; - VkBool32 shaderBufferFloat64AtomicAdd; - VkBool32 shaderSharedFloat32Atomics; - VkBool32 shaderSharedFloat32AtomicAdd; - VkBool32 shaderSharedFloat64Atomics; - VkBool32 shaderSharedFloat64AtomicAdd; - VkBool32 shaderImageFloat32Atomics; - VkBool32 shaderImageFloat32AtomicAdd; - VkBool32 sparseImageFloat32Atomics; - VkBool32 sparseImageFloat32AtomicAdd; -} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderAtomicInt64Features -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; -} VkPhysicalDeviceShaderAtomicInt64Features; -typedef VkPhysicalDeviceShaderAtomicInt64Features VkPhysicalDeviceShaderAtomicInt64FeaturesKHR; - -typedef struct VkPhysicalDeviceShaderClockFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupClock; - VkBool32 shaderDeviceClock; -} VkPhysicalDeviceShaderClockFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderCoreBuiltins; -} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) shaderCoreMask; - uint32_t shaderCoreCount; - uint32_t shaderWarpsPerCore; -} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM; - -typedef struct VkPhysicalDeviceShaderCoreProperties2AMD -{ - VkStructureType sType; - void *pNext; - VkShaderCorePropertiesFlagsAMD shaderCoreFeatures; - uint32_t activeComputeUnitCount; -} VkPhysicalDeviceShaderCoreProperties2AMD; - -typedef struct VkPhysicalDeviceShaderCorePropertiesAMD -{ - VkStructureType sType; - void *pNext; - uint32_t shaderEngineCount; - uint32_t shaderArraysPerEngineCount; - uint32_t computeUnitsPerShaderArray; - uint32_t simdPerComputeUnit; - uint32_t wavefrontsPerSimd; - uint32_t wavefrontSize; - uint32_t sgprsPerSimd; - uint32_t minSgprAllocation; - uint32_t maxSgprAllocation; - uint32_t sgprAllocationGranularity; - uint32_t vgprsPerSimd; - uint32_t minVgprAllocation; - uint32_t maxVgprAllocation; - uint32_t vgprAllocationGranularity; -} VkPhysicalDeviceShaderCorePropertiesAMD; - -typedef struct VkPhysicalDeviceShaderCorePropertiesARM -{ - VkStructureType sType; - void *pNext; - uint32_t pixelRate; - uint32_t texelRate; - uint32_t fmaRate; -} VkPhysicalDeviceShaderCorePropertiesARM; - -typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderDemoteToHelperInvocation; -} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures; -typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; - - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceShaderDrawParametersFeatures; -typedef VkPhysicalDeviceShaderDrawParametersFeatures VkPhysicalDeviceShaderDrawParameterFeatures; - -typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderEarlyAndLateFragmentTests; -} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - -typedef struct VkPhysicalDeviceShaderFloat16Int8Features -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; -} VkPhysicalDeviceShaderFloat16Int8Features; -typedef VkPhysicalDeviceShaderFloat16Int8Features VkPhysicalDeviceShaderFloat16Int8FeaturesKHR; -typedef VkPhysicalDeviceShaderFloat16Int8Features VkPhysicalDeviceFloat16Int8FeaturesKHR; - -typedef struct VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderImageInt64Atomics; - VkBool32 sparseImageInt64Atomics; -} VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - -typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 imageFootprint; -} VkPhysicalDeviceShaderImageFootprintFeaturesNV; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderIntegerDotProduct; -} VkPhysicalDeviceShaderIntegerDotProductFeatures; -typedef VkPhysicalDeviceShaderIntegerDotProductFeatures VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; -} VkPhysicalDeviceShaderIntegerDotProductProperties; -typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR; - -typedef struct VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderIntegerFunctions2; -} VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderModuleIdentifier; -} VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE]; -} VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT; - -typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderObject; -} VkPhysicalDeviceShaderObjectFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint8_t shaderBinaryUUID[VK_UUID_SIZE]; - uint32_t shaderBinaryVersion; -} VkPhysicalDeviceShaderObjectPropertiesEXT; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSMBuiltins; -} VkPhysicalDeviceShaderSMBuiltinsFeaturesNV; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t shaderSMCount; - uint32_t shaderWarpsPerSM; -} VkPhysicalDeviceShaderSMBuiltinsPropertiesNV; - -typedef struct VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupExtendedTypes; -} VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures; -typedef VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupUniformControlFlow; -} VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTerminateInvocation; -} VkPhysicalDeviceShaderTerminateInvocationFeatures; -typedef VkPhysicalDeviceShaderTerminateInvocationFeatures VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTileImageColorReadAccess; - VkBool32 shaderTileImageDepthReadAccess; - VkBool32 shaderTileImageStencilReadAccess; -} VkPhysicalDeviceShaderTileImageFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTileImageCoherentReadAccelerated; - VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; - VkBool32 shaderTileImageReadFromHelperInvocation; -} VkPhysicalDeviceShaderTileImagePropertiesEXT; - -typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shadingRateImage; - VkBool32 shadingRateCoarseSampleOrder; -} VkPhysicalDeviceShadingRateImageFeaturesNV; - -typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV -{ - VkStructureType sType; - void *pNext; - VkExtent2D shadingRateTexelSize; - uint32_t shadingRatePaletteSize; - uint32_t shadingRateMaxCoarseSamples; -} VkPhysicalDeviceShadingRateImagePropertiesNV; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo2 -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo2; -typedef VkPhysicalDeviceSparseImageFormatInfo2 VkPhysicalDeviceSparseImageFormatInfo2KHR; - -typedef struct VkPhysicalDeviceSparseProperties -{ - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; - -typedef struct VkPhysicalDeviceSubgroupProperties -{ - VkStructureType sType; - void *pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlags supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupProperties; - -typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; -} VkPhysicalDeviceSubgroupSizeControlFeatures; -typedef VkPhysicalDeviceSubgroupSizeControlFeatures VkPhysicalDeviceSubgroupSizeControlFeaturesEXT; - -typedef struct VkPhysicalDeviceSubgroupSizeControlProperties -{ - VkStructureType sType; - void *pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; -} VkPhysicalDeviceSubgroupSizeControlProperties; -typedef VkPhysicalDeviceSubgroupSizeControlProperties VkPhysicalDeviceSubgroupSizeControlPropertiesEXT; - -typedef struct VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 subpassMergeFeedback; -} VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - -typedef struct VkPhysicalDeviceSubpassShadingFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 subpassShading; -} VkPhysicalDeviceSubpassShadingFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceSubpassShadingPropertiesHUAWEI -{ - VkStructureType sType; - void *pNext; - uint32_t maxSubpassShadingWorkgroupSizeAspectRatio; -} VkPhysicalDeviceSubpassShadingPropertiesHUAWEI; - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR -{ - VkStructureType sType; - const void *pNext; - VkSurfaceKHR WINE_VK_ALIGN(8) surface; -} VkPhysicalDeviceSurfaceInfo2KHR; - -typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 swapchainMaintenance1; -} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT; - -typedef struct VkPhysicalDeviceSynchronization2Features -{ - VkStructureType sType; - void *pNext; - VkBool32 synchronization2; -} VkPhysicalDeviceSynchronization2Features; -typedef VkPhysicalDeviceSynchronization2Features VkPhysicalDeviceSynchronization2FeaturesKHR; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 texelBufferAlignment; -} VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; -} VkPhysicalDeviceTexelBufferAlignmentProperties; -typedef VkPhysicalDeviceTexelBufferAlignmentProperties VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT; - -typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 textureCompressionASTC_HDR; -} VkPhysicalDeviceTextureCompressionASTCHDRFeatures; -typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT; - -typedef struct VkPhysicalDeviceTilePropertiesFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 tileProperties; -} VkPhysicalDeviceTilePropertiesFeaturesQCOM; - -typedef struct VkPhysicalDeviceTimelineSemaphoreFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 timelineSemaphore; -} VkPhysicalDeviceTimelineSemaphoreFeatures; -typedef VkPhysicalDeviceTimelineSemaphoreFeatures VkPhysicalDeviceTimelineSemaphoreFeaturesKHR; - -typedef struct VkPhysicalDeviceTimelineSemaphoreProperties -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) maxTimelineSemaphoreValueDifference; -} VkPhysicalDeviceTimelineSemaphoreProperties; -typedef VkPhysicalDeviceTimelineSemaphoreProperties VkPhysicalDeviceTimelineSemaphorePropertiesKHR; - -typedef struct VkPhysicalDeviceToolProperties -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_EXTENSION_NAME_SIZE]; - char version[VK_MAX_EXTENSION_NAME_SIZE]; - VkToolPurposeFlags purposes; - char description[VK_MAX_DESCRIPTION_SIZE]; - char layer[VK_MAX_EXTENSION_NAME_SIZE]; -} VkPhysicalDeviceToolProperties; -typedef VkPhysicalDeviceToolProperties VkPhysicalDeviceToolPropertiesEXT; - -typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 transformFeedback; - VkBool32 geometryStreams; -} VkPhysicalDeviceTransformFeedbackFeaturesEXT; - -typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxTransformFeedbackStreams; - uint32_t maxTransformFeedbackBuffers; - VkDeviceSize WINE_VK_ALIGN(8) maxTransformFeedbackBufferSize; - uint32_t maxTransformFeedbackStreamDataSize; - uint32_t maxTransformFeedbackBufferDataSize; - uint32_t maxTransformFeedbackBufferDataStride; - VkBool32 transformFeedbackQueries; - VkBool32 transformFeedbackStreamsLinesTriangles; - VkBool32 transformFeedbackRasterizationStreamSelect; - VkBool32 transformFeedbackDraw; -} VkPhysicalDeviceTransformFeedbackPropertiesEXT; - -typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 uniformBufferStandardLayout; -} VkPhysicalDeviceUniformBufferStandardLayoutFeatures; -typedef VkPhysicalDeviceUniformBufferStandardLayoutFeatures VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR; - - -typedef struct VkPhysicalDeviceVariablePointersFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointersFeatures; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointersFeaturesKHR; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeaturesKHR; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeatures; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxVertexAttribDivisor; -} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; - -typedef struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 vertexInputDynamicState; -} VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceVulkan11Features -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; - VkBool32 protectedMemory; - VkBool32 samplerYcbcrConversion; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceVulkan11Features; - -typedef struct VkPhysicalDeviceVulkan11Properties -{ - VkStructureType sType; - void *pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; - uint32_t subgroupSize; - VkShaderStageFlags subgroupSupportedStages; - VkSubgroupFeatureFlags subgroupSupportedOperations; - VkBool32 subgroupQuadOperationsInAllStages; - VkPointClippingBehavior pointClippingBehavior; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; - VkBool32 protectedNoFault; - uint32_t maxPerSetDescriptors; - VkDeviceSize WINE_VK_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceVulkan11Properties; - -typedef struct VkPhysicalDeviceVulkan12Features -{ - VkStructureType sType; - void *pNext; - VkBool32 samplerMirrorClampToEdge; - VkBool32 drawIndirectCount; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; - VkBool32 descriptorIndexing; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; - VkBool32 samplerFilterMinmax; - VkBool32 scalarBlockLayout; - VkBool32 imagelessFramebuffer; - VkBool32 uniformBufferStandardLayout; - VkBool32 shaderSubgroupExtendedTypes; - VkBool32 separateDepthStencilLayouts; - VkBool32 hostQueryReset; - VkBool32 timelineSemaphore; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; - VkBool32 shaderOutputViewportIndex; - VkBool32 shaderOutputLayer; - VkBool32 subgroupBroadcastDynamicId; -} VkPhysicalDeviceVulkan12Features; - -typedef struct VkPhysicalDeviceVulkan12Properties -{ - VkStructureType sType; - void *pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; - uint64_t WINE_VK_ALIGN(8) maxTimelineSemaphoreValueDifference; - VkSampleCountFlags framebufferIntegerColorSampleCounts; -} VkPhysicalDeviceVulkan12Properties; - -typedef struct VkPhysicalDeviceVulkan13Features -{ - VkStructureType sType; - void *pNext; - VkBool32 robustImageAccess; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; - VkBool32 pipelineCreationCacheControl; - VkBool32 privateData; - VkBool32 shaderDemoteToHelperInvocation; - VkBool32 shaderTerminateInvocation; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; - VkBool32 synchronization2; - VkBool32 textureCompressionASTC_HDR; - VkBool32 shaderZeroInitializeWorkgroupMemory; - VkBool32 dynamicRendering; - VkBool32 shaderIntegerDotProduct; - VkBool32 maintenance4; -} VkPhysicalDeviceVulkan13Features; - -typedef struct VkPhysicalDeviceVulkan13Properties -{ - VkStructureType sType; - void *pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - uint32_t maxInlineUniformTotalSize; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - VkDeviceSize WINE_VK_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceVulkan13Properties; - -typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; -} VkPhysicalDeviceVulkanMemoryModelFeatures; -typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; - -typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 workgroupMemoryExplicitLayout; - VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout; - VkBool32 workgroupMemoryExplicitLayout8BitAccess; - VkBool32 workgroupMemoryExplicitLayout16BitAccess; -} VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - -typedef struct VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcr2plane444Formats; -} VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - -typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcrDegamma; -} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM; - -typedef struct VkPhysicalDeviceYcbcrImageArraysFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcrImageArrays; -} VkPhysicalDeviceYcbcrImageArraysFeaturesEXT; - -typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderZeroInitializeWorkgroupMemory; -} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; -typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR; - -typedef struct VkPipelineCacheCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void *pInitialData; -} VkPipelineCacheCreateInfo; - -typedef struct VkPipelineCacheHeaderVersionOne -{ - uint32_t headerSize; - VkPipelineCacheHeaderVersion headerVersion; - uint32_t vendorID; - uint32_t deviceID; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; -} VkPipelineCacheHeaderVersionOne; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT; - -typedef struct VkPipelineColorBlendAttachmentState -{ - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; - -typedef struct VkPipelineColorBlendStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - const VkPipelineColorBlendAttachmentState *pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo; - -typedef struct VkPipelineColorWriteCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentCount; - const VkBool32 *pColorWriteEnables; -} VkPipelineColorWriteCreateInfoEXT; - -typedef struct VkPipelineCompilerControlCreateInfoAMD -{ - VkStructureType sType; - const void *pNext; - VkPipelineCompilerControlFlagsAMD compilerControlFlags; -} VkPipelineCompilerControlCreateInfoAMD; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - const float *pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV; - -typedef struct VkPipelineCoverageReductionStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageReductionStateCreateFlagsNV flags; - VkCoverageReductionModeNV coverageReductionMode; -} VkPipelineCoverageReductionStateCreateInfoNV; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV; - -typedef struct VkPipelineCreateFlags2CreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags2KHR WINE_VK_ALIGN(8) flags; -} VkPipelineCreateFlags2CreateInfoKHR; - -typedef struct VkPipelineCreationFeedback -{ - VkPipelineCreationFeedbackFlags flags; - uint64_t WINE_VK_ALIGN(8) duration; -} VkPipelineCreationFeedback; -typedef VkPipelineCreationFeedback VkPipelineCreationFeedbackEXT; - -typedef struct VkPipelineCreationFeedbackCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreationFeedback *pPipelineCreationFeedback; - uint32_t pipelineStageCreationFeedbackCount; - VkPipelineCreationFeedback *pPipelineStageCreationFeedbacks; -} VkPipelineCreationFeedbackCreateInfo; -typedef VkPipelineCreationFeedbackCreateInfo VkPipelineCreationFeedbackCreateInfoEXT; - -typedef struct VkPipelineDynamicStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const VkDynamicState *pDynamicStates; -} VkPipelineDynamicStateCreateInfo; - -typedef struct VkPipelineExecutableInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; - uint32_t executableIndex; -} VkPipelineExecutableInfoKHR; - -typedef struct VkPipelineExecutableInternalRepresentationKHR -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkBool32 isText; - size_t dataSize; - void *pData; -} VkPipelineExecutableInternalRepresentationKHR; - -typedef struct VkPipelineExecutablePropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags stages; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t subgroupSize; -} VkPipelineExecutablePropertiesKHR; - -typedef union VkPipelineExecutableStatisticValueKHR -{ - VkBool32 b32; - int64_t i64; - uint64_t WINE_VK_ALIGN(8) u64; - double f64; -} VkPipelineExecutableStatisticValueKHR; - -typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkFragmentShadingRateTypeNV shadingRateType; - VkFragmentShadingRateNV shadingRate; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateEnumStateCreateInfoNV; - -typedef struct VkPipelineFragmentShadingRateStateCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkExtent2D fragmentSize; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateStateCreateInfoKHR; - -typedef struct VkPipelineIndirectDeviceAddressInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkPipelineIndirectDeviceAddressInfoNV; - - -typedef struct VkPipelineInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkPipelineInfoKHR; -typedef VkPipelineInfoKHR VkPipelineInfoEXT; - -typedef struct VkPipelineInputAssemblyStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo; - -typedef struct VkPipelineLibraryCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t libraryCount; - const VkPipeline *pLibraries; -} VkPipelineLibraryCreateInfoKHR; - -typedef struct VkPipelineMultisampleStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - const VkSampleMask *pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo; - -typedef struct VkPipelinePropertiesIdentifierEXT -{ - VkStructureType sType; - void *pNext; - uint8_t pipelineIdentifier[VK_UUID_SIZE]; -} VkPipelinePropertiesIdentifierEXT; - -typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - float extraPrimitiveOverestimationSize; -} VkPipelineRasterizationConservativeStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationDepthClipStateCreateFlagsEXT flags; - VkBool32 depthClipEnable; -} VkPipelineRasterizationDepthClipStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationLineStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkLineRasterizationModeEXT lineRasterizationMode; - VkBool32 stippledLineEnable; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -} VkPipelineRasterizationLineStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkProvokingVertexModeEXT provokingVertexMode; -} VkPipelineRasterizationProvokingVertexStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD -{ - VkStructureType sType; - const void *pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD; - -typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationStateStreamCreateFlagsEXT flags; - uint32_t rasterizationStream; -} VkPipelineRasterizationStateStreamCreateInfoEXT; - -typedef struct VkPipelineRenderingCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkPipelineRenderingCreateInfo; -typedef VkPipelineRenderingCreateInfo VkPipelineRenderingCreateInfoKHR; - -typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 representativeFragmentTestEnable; -} VkPipelineRepresentativeFragmentTestStateCreateInfoNV; - -typedef struct VkPipelineRobustnessCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRobustnessBufferBehaviorEXT storageBuffers; - VkPipelineRobustnessBufferBehaviorEXT uniformBuffers; - VkPipelineRobustnessBufferBehaviorEXT vertexInputs; - VkPipelineRobustnessImageBehaviorEXT images; -} VkPipelineRobustnessCreateInfoEXT; - -typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t identifierSize; - const uint8_t *pIdentifier; -} VkPipelineShaderStageModuleIdentifierCreateInfoEXT; - -typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo -{ - VkStructureType sType; - void *pNext; - uint32_t requiredSubgroupSize; -} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkShaderRequiredSubgroupSizeCreateInfoEXT; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkTessellationDomainOrigin domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfo; -typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellationDomainOriginStateCreateInfoKHR; - -typedef struct VkPipelineTessellationStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo; - -typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders; -} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV; - -typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 negativeOneToOne; -} VkPipelineViewportDepthClipControlCreateInfoEXT; - -typedef struct VkPresentIdKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const uint64_t *pPresentIds; -} VkPresentIdKHR; - -typedef struct VkPresentInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - uint32_t swapchainCount; - const VkSwapchainKHR *pSwapchains; - const uint32_t *pImageIndices; - VkResult *pResults; -} VkPresentInfoKHR; - -typedef struct VkPrivateDataSlotCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPrivateDataSlotCreateFlags flags; -} VkPrivateDataSlotCreateInfo; -typedef VkPrivateDataSlotCreateInfo VkPrivateDataSlotCreateInfoEXT; - -typedef struct VkProtectedSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfo; - -typedef struct VkPushConstantRange -{ - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; - -typedef struct VkQueryLowLatencySupportNV -{ - VkStructureType sType; - const void *pNext; - void *pQueriedLowLatencyData; -} VkQueryLowLatencySupportNV; - -typedef struct VkQueryPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo; - -typedef struct VkQueryPoolPerformanceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t queueFamilyIndex; - uint32_t counterIndexCount; - const uint32_t *pCounterIndices; -} VkQueryPoolPerformanceCreateInfoKHR; - -typedef struct VkQueryPoolPerformanceQueryCreateInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkQueryPoolSamplingModeINTEL performanceCountersSampling; -} VkQueryPoolPerformanceQueryCreateInfoINTEL; -typedef VkQueryPoolPerformanceQueryCreateInfoINTEL VkQueryPoolCreateInfoINTEL; - -typedef struct VkQueueFamilyCheckpointProperties2NV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) checkpointExecutionStageMask; -} VkQueueFamilyCheckpointProperties2NV; - -typedef struct VkQueueFamilyCheckpointPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags checkpointExecutionStageMask; -} VkQueueFamilyCheckpointPropertiesNV; - -typedef struct VkQueueFamilyGlobalPriorityPropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t priorityCount; - VkQueueGlobalPriorityKHR priorities[VK_MAX_GLOBAL_PRIORITY_SIZE_KHR]; -} VkQueueFamilyGlobalPriorityPropertiesKHR; -typedef VkQueueFamilyGlobalPriorityPropertiesKHR VkQueueFamilyGlobalPriorityPropertiesEXT; - -typedef struct VkQueueFamilyProperties -{ - VkQueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - VkExtent3D minImageTransferGranularity; -} VkQueueFamilyProperties; - -typedef struct VkQueueFamilyProperties2 -{ - VkStructureType sType; - void *pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties2; -typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; - -typedef struct VkRayTracingPipelineInterfaceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxPipelineRayPayloadSize; - uint32_t maxPipelineRayHitAttributeSize; -} VkRayTracingPipelineInterfaceCreateInfoKHR; - -typedef struct VkRayTracingShaderGroupCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; - const void *pShaderGroupCaptureReplayHandle; -} VkRayTracingShaderGroupCreateInfoKHR; - -typedef struct VkRayTracingShaderGroupCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; -} VkRayTracingShaderGroupCreateInfoNV; - -typedef struct VkRect2D -{ - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; - -typedef struct VkRectLayerKHR -{ - VkOffset2D offset; - VkExtent2D extent; - uint32_t layer; -} VkRectLayerKHR; - -typedef struct VkReleaseSwapchainImagesInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint32_t imageIndexCount; - const uint32_t *pImageIndices; -} VkReleaseSwapchainImagesInfoEXT; - -typedef struct VkRenderPassAttachmentBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentCount; - const VkImageView *pAttachments; -} VkRenderPassAttachmentBeginInfo; -typedef VkRenderPassAttachmentBeginInfo VkRenderPassAttachmentBeginInfoKHR; - -typedef struct VkRenderPassBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - VkFramebuffer WINE_VK_ALIGN(8) framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue *pClearValues; -} VkRenderPassBeginInfo; - -typedef struct VkRenderPassCreationControlEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 disallowMerging; -} VkRenderPassCreationControlEXT; - -typedef struct VkRenderPassCreationFeedbackInfoEXT -{ - uint32_t postMergeSubpassCount; -} VkRenderPassCreationFeedbackInfoEXT; - -typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkAttachmentReference fragmentDensityMapAttachment; -} VkRenderPassFragmentDensityMapCreateInfoEXT; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t aspectReferenceCount; - const VkInputAttachmentAspectReference *pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfo; -typedef VkRenderPassInputAttachmentAspectCreateInfo VkRenderPassInputAttachmentAspectCreateInfoKHR; - -typedef struct VkRenderPassMultiviewCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t subpassCount; - const uint32_t *pViewMasks; - uint32_t dependencyCount; - const int32_t *pViewOffsets; - uint32_t correlationMaskCount; - const uint32_t *pCorrelationMasks; -} VkRenderPassMultiviewCreateInfo; -typedef VkRenderPassMultiviewCreateInfo VkRenderPassMultiviewCreateInfoKHR; - -typedef struct VkRenderPassSubpassFeedbackInfoEXT -{ - VkSubpassMergeStatusEXT subpassMergeStatus; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t postMergeIndex; -} VkRenderPassSubpassFeedbackInfoEXT; - -typedef struct VkRenderPassTransformBeginInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkRenderPassTransformBeginInfoQCOM; - -typedef struct VkRenderingAreaInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkRenderingAreaInfoKHR; - -typedef struct VkRenderingAttachmentInfo -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkResolveModeFlagBits resolveMode; - VkImageView WINE_VK_ALIGN(8) resolveImageView; - VkImageLayout resolveImageLayout; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkClearValue clearValue; -} VkRenderingAttachmentInfo; -typedef VkRenderingAttachmentInfo VkRenderingAttachmentInfoKHR; - -typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkRenderingFragmentDensityMapAttachmentInfoEXT; - -typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkExtent2D shadingRateAttachmentTexelSize; -} VkRenderingFragmentShadingRateAttachmentInfoKHR; - -typedef struct VkRenderingInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderingFlags flags; - VkRect2D renderArea; - uint32_t layerCount; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkRenderingAttachmentInfo *pColorAttachments; - const VkRenderingAttachmentInfo *pDepthAttachment; - const VkRenderingAttachmentInfo *pStencilAttachment; -} VkRenderingInfo; -typedef VkRenderingInfo VkRenderingInfoKHR; - -typedef struct VkSRTDataNV -{ - float sx; - float a; - float b; - float pvx; - float sy; - float c; - float pvy; - float sz; - float pvz; - float qx; - float qy; - float qz; - float qw; - float tx; - float ty; - float tz; -} VkSRTDataNV; - -typedef struct VkSampleLocationEXT -{ - float x; - float y; -} VkSampleLocationEXT; - -typedef struct VkSampleLocationsInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - const VkSampleLocationEXT *pSampleLocations; -} VkSampleLocationsInfoEXT; - -typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkExtent2D windowExtent; - VkBlockMatchWindowCompareModeQCOM windowCompareMode; -} VkSamplerBlockMatchWindowCreateInfoQCOM; - -typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkComponentMapping components; - VkBool32 srgb; -} VkSamplerBorderColorComponentMappingCreateInfoEXT; - -typedef struct VkSamplerCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSampler WINE_VK_ALIGN(8) sampler; -} VkSamplerCaptureDescriptorDataInfoEXT; - -typedef struct VkSamplerCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo; - -typedef struct VkSamplerCubicWeightsCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkSamplerCubicWeightsCreateInfoQCOM; - -typedef struct VkSamplerCustomBorderColorCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkClearColorValue customBorderColor; - VkFormat format; -} VkSamplerCustomBorderColorCreateInfoEXT; - -typedef struct VkSamplerReductionModeCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerReductionMode reductionMode; -} VkSamplerReductionModeCreateInfo; -typedef VkSamplerReductionModeCreateInfo VkSamplerReductionModeCreateInfoEXT; - -typedef struct VkSamplerYcbcrConversionCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkSamplerYcbcrModelConversion ycbcrModel; - VkSamplerYcbcrRange ycbcrRange; - VkComponentMapping components; - VkChromaLocation xChromaOffset; - VkChromaLocation yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfo; -typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; - -typedef struct VkSamplerYcbcrConversionImageFormatProperties -{ - VkStructureType sType; - void *pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatProperties; -typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; - -typedef struct VkSamplerYcbcrConversionInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerYcbcrConversion WINE_VK_ALIGN(8) conversion; -} VkSamplerYcbcrConversionInfo; -typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; - -typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 enableYDegamma; - VkBool32 enableCbCrDegamma; -} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; - -typedef struct VkSemaphoreCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo; - -typedef struct VkSemaphoreSignalInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - uint64_t WINE_VK_ALIGN(8) value; -} VkSemaphoreSignalInfo; -typedef VkSemaphoreSignalInfo VkSemaphoreSignalInfoKHR; - -typedef struct VkSemaphoreSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - uint64_t WINE_VK_ALIGN(8) value; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) stageMask; - uint32_t deviceIndex; -} VkSemaphoreSubmitInfo; -typedef VkSemaphoreSubmitInfo VkSemaphoreSubmitInfoKHR; - -typedef struct VkSemaphoreTypeCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreType semaphoreType; - uint64_t WINE_VK_ALIGN(8) initialValue; -} VkSemaphoreTypeCreateInfo; -typedef VkSemaphoreTypeCreateInfo VkSemaphoreTypeCreateInfoKHR; - -typedef struct VkSemaphoreWaitInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreWaitFlags flags; - uint32_t semaphoreCount; - const VkSemaphore *pSemaphores; - const uint64_t *pValues; -} VkSemaphoreWaitInfo; -typedef VkSemaphoreWaitInfo VkSemaphoreWaitInfoKHR; - -typedef struct VkSetLatencyMarkerInfoNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; - VkLatencyMarkerNV marker; -} VkSetLatencyMarkerInfoNV; - -typedef struct VkSetStateFlagsIndirectCommandNV -{ - uint32_t data; -} VkSetStateFlagsIndirectCommandNV; - -typedef struct VkShaderModuleCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t *pCode; -} VkShaderModuleCreateInfo; - -typedef struct VkShaderModuleIdentifierEXT -{ - VkStructureType sType; - void *pNext; - uint32_t identifierSize; - uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT]; -} VkShaderModuleIdentifierEXT; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkValidationCacheEXT WINE_VK_ALIGN(8) validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT; - -typedef struct VkShaderResourceUsageAMD -{ - uint32_t numUsedVgprs; - uint32_t numUsedSgprs; - uint32_t ldsSizePerLocalWorkGroup; - size_t ldsUsageSizeInBytes; - size_t scratchMemUsageInBytes; -} VkShaderResourceUsageAMD; - -typedef struct VkShaderStatisticsInfoAMD -{ - VkShaderStageFlags shaderStageMask; - VkShaderResourceUsageAMD resourceUsage; - uint32_t numPhysicalVgprs; - uint32_t numPhysicalSgprs; - uint32_t numAvailableVgprs; - uint32_t numAvailableSgprs; - uint32_t computeWorkGroupSize[3]; -} VkShaderStatisticsInfoAMD; - -typedef struct VkShadingRatePaletteNV -{ - uint32_t shadingRatePaletteEntryCount; - const VkShadingRatePaletteEntryNV *pShadingRatePaletteEntries; -} VkShadingRatePaletteNV; - -typedef struct VkSparseImageFormatProperties -{ - VkImageAspectFlags aspectMask; - VkExtent3D imageGranularity; - VkSparseImageFormatFlags flags; -} VkSparseImageFormatProperties; - -typedef struct VkSparseImageFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties2; -typedef VkSparseImageFormatProperties2 VkSparseImageFormatProperties2KHR; - -typedef struct VkSparseImageMemoryBind -{ - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind; - -typedef struct VkSparseImageMemoryBindInfo -{ - VkImage WINE_VK_ALIGN(8) image; - uint32_t bindCount; - const VkSparseImageMemoryBind *pBinds; -} VkSparseImageMemoryBindInfo; - -typedef struct VkSparseImageMemoryRequirements -{ - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailSize; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailOffset; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailStride; -} VkSparseImageMemoryRequirements; - -typedef struct VkSparseImageMemoryRequirements2 -{ - VkStructureType sType; - void *pNext; - VkSparseImageMemoryRequirements WINE_VK_ALIGN(8) memoryRequirements; -} VkSparseImageMemoryRequirements2; -typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR; - -typedef struct VkSparseMemoryBind -{ - VkDeviceSize WINE_VK_ALIGN(8) resourceOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind; - -typedef struct VkSpecializationMapEntry -{ - uint32_t constantID; - uint32_t offset; - size_t size; -} VkSpecializationMapEntry; - -typedef struct VkStencilOpState -{ - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; - -typedef struct VkStridedDeviceAddressRegionKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) stride; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkStridedDeviceAddressRegionKHR; - -typedef struct VkSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - const VkPipelineStageFlags *pWaitDstStageMask; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; - uint32_t signalSemaphoreCount; - const VkSemaphore *pSignalSemaphores; -} VkSubmitInfo; - -typedef struct VkSubmitInfo2 -{ - VkStructureType sType; - const void *pNext; - VkSubmitFlags flags; - uint32_t waitSemaphoreInfoCount; - const VkSemaphoreSubmitInfo *pWaitSemaphoreInfos; - uint32_t commandBufferInfoCount; - const VkCommandBufferSubmitInfo *pCommandBufferInfos; - uint32_t signalSemaphoreInfoCount; - const VkSemaphoreSubmitInfo *pSignalSemaphoreInfos; -} VkSubmitInfo2; -typedef VkSubmitInfo2 VkSubmitInfo2KHR; - -typedef struct VkSubpassBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkSubpassContents contents; -} VkSubpassBeginInfo; -typedef VkSubpassBeginInfo VkSubpassBeginInfoKHR; - -typedef struct VkSubpassDependency -{ - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; -} VkSubpassDependency; - -typedef struct VkSubpassDependency2 -{ - VkStructureType sType; - const void *pNext; - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; - int32_t viewOffset; -} VkSubpassDependency2; -typedef VkSubpassDependency2 VkSubpassDependency2KHR; - -typedef struct VkSubpassDescription -{ - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const VkAttachmentReference *pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference *pColorAttachments; - const VkAttachmentReference *pResolveAttachments; - const VkAttachmentReference *pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t *pPreserveAttachments; -} VkSubpassDescription; - -typedef struct VkSubpassDescription2 -{ - VkStructureType sType; - const void *pNext; - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t viewMask; - uint32_t inputAttachmentCount; - const VkAttachmentReference2 *pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference2 *pColorAttachments; - const VkAttachmentReference2 *pResolveAttachments; - const VkAttachmentReference2 *pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t *pPreserveAttachments; -} VkSubpassDescription2; -typedef VkSubpassDescription2 VkSubpassDescription2KHR; - -typedef struct VkSubpassDescriptionDepthStencilResolve -{ - VkStructureType sType; - const void *pNext; - VkResolveModeFlagBits depthResolveMode; - VkResolveModeFlagBits stencilResolveMode; - const VkAttachmentReference2 *pDepthStencilResolveAttachment; -} VkSubpassDescriptionDepthStencilResolve; -typedef VkSubpassDescriptionDepthStencilResolve VkSubpassDescriptionDepthStencilResolveKHR; - -typedef struct VkSubpassEndInfo -{ - VkStructureType sType; - const void *pNext; -} VkSubpassEndInfo; -typedef VkSubpassEndInfo VkSubpassEndInfoKHR; - -typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM -{ - VkStructureType sType; - const void *pNext; - uint32_t fragmentDensityOffsetCount; - const VkOffset2D *pFragmentDensityOffsets; -} VkSubpassFragmentDensityMapOffsetEndInfoQCOM; - -typedef struct VkSubpassResolvePerformanceQueryEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 optimal; -} VkSubpassResolvePerformanceQueryEXT; - -typedef struct VkSubpassSampleLocationsEXT -{ - uint32_t subpassIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkSubpassSampleLocationsEXT; - -typedef struct VkSubpassShadingPipelineCreateInfoHUAWEI -{ - VkStructureType sType; - void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; -} VkSubpassShadingPipelineCreateInfoHUAWEI; - -typedef struct VkSubresourceHostMemcpySizeEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkSubresourceHostMemcpySizeEXT; - -typedef struct VkSubresourceLayout -{ - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceSize WINE_VK_ALIGN(8) rowPitch; - VkDeviceSize WINE_VK_ALIGN(8) arrayPitch; - VkDeviceSize WINE_VK_ALIGN(8) depthPitch; -} VkSubresourceLayout; - -typedef struct VkSubresourceLayout2KHR -{ - VkStructureType sType; - void *pNext; - VkSubresourceLayout WINE_VK_ALIGN(8) subresourceLayout; -} VkSubresourceLayout2KHR; -typedef VkSubresourceLayout2KHR VkSubresourceLayout2EXT; - -typedef struct VkSurfaceCapabilitiesKHR -{ - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; - -typedef struct VkSurfaceCapabilitiesPresentBarrierNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrierSupported; -} VkSurfaceCapabilitiesPresentBarrierNV; - -typedef struct VkSurfaceFormatKHR -{ - VkFormat format; - VkColorSpaceKHR colorSpace; -} VkSurfaceFormatKHR; - -typedef struct VkSurfacePresentModeCompatibilityEXT -{ - VkStructureType sType; - void *pNext; - uint32_t presentModeCount; - VkPresentModeKHR *pPresentModes; -} VkSurfacePresentModeCompatibilityEXT; - -typedef struct VkSurfacePresentModeEXT -{ - VkStructureType sType; - void *pNext; - VkPresentModeKHR presentMode; -} VkSurfacePresentModeEXT; - -typedef struct VkSurfacePresentScalingCapabilitiesEXT -{ - VkStructureType sType; - void *pNext; - VkPresentScalingFlagsEXT supportedPresentScaling; - VkPresentGravityFlagsEXT supportedPresentGravityX; - VkPresentGravityFlagsEXT supportedPresentGravityY; - VkExtent2D minScaledImageExtent; - VkExtent2D maxScaledImageExtent; -} VkSurfacePresentScalingCapabilitiesEXT; - -typedef struct VkSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR WINE_VK_ALIGN(8) surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR WINE_VK_ALIGN(8) oldSwapchain; -} VkSwapchainCreateInfoKHR; - -typedef struct VkSwapchainLatencyCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 latencyModeEnable; -} VkSwapchainLatencyCreateInfoNV; - -typedef struct VkSwapchainPresentBarrierCreateInfoNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrierEnable; -} VkSwapchainPresentBarrierCreateInfoNV; - -typedef struct VkSwapchainPresentFenceInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkFence *pFences; -} VkSwapchainPresentFenceInfoEXT; - -typedef struct VkSwapchainPresentModeInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkPresentModeKHR *pPresentModes; -} VkSwapchainPresentModeInfoEXT; - -typedef struct VkSwapchainPresentModesCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t presentModeCount; - const VkPresentModeKHR *pPresentModes; -} VkSwapchainPresentModesCreateInfoEXT; - -typedef struct VkSwapchainPresentScalingCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPresentScalingFlagsEXT scalingBehavior; - VkPresentGravityFlagsEXT presentGravityX; - VkPresentGravityFlagsEXT presentGravityY; -} VkSwapchainPresentScalingCreateInfoEXT; - -typedef struct VkTextureLODGatherFormatPropertiesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD; - -typedef struct VkTilePropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent3D tileSize; - VkExtent2D apronSize; - VkOffset2D origin; -} VkTilePropertiesQCOM; - -typedef struct VkTimelineSemaphoreSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreValueCount; - const uint64_t *pWaitSemaphoreValues; - uint32_t signalSemaphoreValueCount; - const uint64_t *pSignalSemaphoreValues; -} VkTimelineSemaphoreSubmitInfo; -typedef VkTimelineSemaphoreSubmitInfo VkTimelineSemaphoreSubmitInfoKHR; - -typedef struct VkTraceRaysIndirectCommand2KHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) raygenShaderRecordAddress; - VkDeviceSize WINE_VK_ALIGN(8) raygenShaderRecordSize; - VkDeviceAddress WINE_VK_ALIGN(8) missShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) missShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) missShaderBindingTableStride; - VkDeviceAddress WINE_VK_ALIGN(8) hitShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) hitShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) hitShaderBindingTableStride; - VkDeviceAddress WINE_VK_ALIGN(8) callableShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) callableShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) callableShaderBindingTableStride; - uint32_t width; - uint32_t height; - uint32_t depth; -} VkTraceRaysIndirectCommand2KHR; - -typedef struct VkTraceRaysIndirectCommandKHR -{ - uint32_t width; - uint32_t height; - uint32_t depth; -} VkTraceRaysIndirectCommandKHR; - -typedef struct VkTransformMatrixKHR -{ - float matrix[3][4]; -} VkTransformMatrixKHR; -typedef VkTransformMatrixKHR VkTransformMatrixNV; - -typedef struct VkValidationCacheCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkValidationCacheCreateFlagsEXT flags; - size_t initialDataSize; - const void *pInitialData; -} VkValidationCacheCreateInfoEXT; - -typedef struct VkValidationFeaturesEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t enabledValidationFeatureCount; - const VkValidationFeatureEnableEXT *pEnabledValidationFeatures; - uint32_t disabledValidationFeatureCount; - const VkValidationFeatureDisableEXT *pDisabledValidationFeatures; -} VkValidationFeaturesEXT; - -typedef struct VkValidationFlagsEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t disabledValidationCheckCount; - const VkValidationCheckEXT *pDisabledValidationChecks; -} VkValidationFlagsEXT; - -typedef struct VkVertexInputAttributeDescription -{ - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription; - -typedef struct VkVertexInputAttributeDescription2EXT -{ - VkStructureType sType; - void *pNext; - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription2EXT; - -typedef struct VkVertexInputBindingDescription -{ - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkVertexInputBindingDescription2EXT -{ - VkStructureType sType; - void *pNext; - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; - uint32_t divisor; -} VkVertexInputBindingDescription2EXT; - -typedef struct VkVertexInputBindingDivisorDescriptionEXT -{ - uint32_t binding; - uint32_t divisor; -} VkVertexInputBindingDivisorDescriptionEXT; - -typedef struct VkViewport -{ - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; -} VkViewport; - -typedef struct VkViewportSwizzleNV -{ - VkViewportCoordinateSwizzleNV x; - VkViewportCoordinateSwizzleNV y; - VkViewportCoordinateSwizzleNV z; - VkViewportCoordinateSwizzleNV w; -} VkViewportSwizzleNV; - -typedef struct VkViewportWScalingNV -{ - float xcoeff; - float ycoeff; -} VkViewportWScalingNV; - -typedef struct VkWin32SurfaceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkWin32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; -} VkWin32SurfaceCreateInfoKHR; - -typedef struct VkWriteDescriptorSet -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSet WINE_VK_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo *pImageInfo; - const VkDescriptorBufferInfo *pBufferInfo; - const VkBufferView *pTexelBufferView; -} VkWriteDescriptorSet; - -typedef struct VkWriteDescriptorSetAccelerationStructureKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureKHR; - -typedef struct VkWriteDescriptorSetAccelerationStructureNV -{ - VkStructureType sType; - const void *pNext; - uint32_t accelerationStructureCount; - const VkAccelerationStructureNV *pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureNV; - -typedef struct VkWriteDescriptorSetInlineUniformBlock -{ - VkStructureType sType; - const void *pNext; - uint32_t dataSize; - const void *pData; -} VkWriteDescriptorSetInlineUniformBlock; -typedef VkWriteDescriptorSetInlineUniformBlock VkWriteDescriptorSetInlineUniformBlockEXT; - -typedef struct VkXYColorEXT -{ - float x; - float y; -} VkXYColorEXT; - -typedef struct VkAccelerationStructureGeometryAabbsDataKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; - VkDeviceSize WINE_VK_ALIGN(8) stride; -} VkAccelerationStructureGeometryAabbsDataKHR; - -typedef struct VkAccelerationStructureGeometryInstancesDataKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 arrayOfPointers; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; -} VkAccelerationStructureGeometryInstancesDataKHR; - -typedef struct VkAccelerationStructureGeometryMotionTrianglesDataNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) vertexData; -} VkAccelerationStructureGeometryMotionTrianglesDataNV; - -typedef struct VkAccelerationStructureGeometryTrianglesDataKHR -{ - VkStructureType sType; - const void *pNext; - VkFormat vertexFormat; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) vertexData; - VkDeviceSize WINE_VK_ALIGN(8) vertexStride; - uint32_t maxVertex; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) indexData; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) transformData; -} VkAccelerationStructureGeometryTrianglesDataKHR; - -typedef struct VkAccelerationStructureInstanceKHR -{ - VkTransformMatrixKHR transform; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureInstanceKHR; -typedef VkAccelerationStructureInstanceKHR VkAccelerationStructureInstanceNV; - -typedef struct VkAccelerationStructureMatrixMotionInstanceNV -{ - VkTransformMatrixKHR transformT0; - VkTransformMatrixKHR transformT1; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureMatrixMotionInstanceNV; - -typedef struct VkAccelerationStructureSRTMotionInstanceNV -{ - VkSRTDataNV transformT0; - VkSRTDataNV transformT1; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureSRTMotionInstanceNV; - -typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT -{ - VkStructureType sType; - void *pNext; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) indexBuffer; - VkDeviceSize WINE_VK_ALIGN(8) indexStride; - uint32_t baseTriangle; - uint32_t usageCountsCount; - const VkMicromapUsageEXT *pUsageCounts; - const VkMicromapUsageEXT * const*ppUsageCounts; - VkMicromapEXT WINE_VK_ALIGN(8) micromap; -} VkAccelerationStructureTrianglesOpacityMicromapEXT; - -typedef struct VkAttachmentSampleLocationsEXT -{ - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT; - -typedef struct VkBindImageMemoryDeviceGroupInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; - uint32_t splitInstanceBindRegionCount; - const VkRect2D *pSplitInstanceBindRegions; -} VkBindImageMemoryDeviceGroupInfo; -typedef VkBindImageMemoryDeviceGroupInfo VkBindImageMemoryDeviceGroupInfoKHR; - -typedef struct VkBufferImageCopy -{ - VkDeviceSize WINE_VK_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy; - -typedef struct VkBufferImageCopy2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy2; -typedef VkBufferImageCopy2 VkBufferImageCopy2KHR; - -typedef struct VkClearAttachment -{ - VkImageAspectFlags aspectMask; - uint32_t colorAttachment; - VkClearValue clearValue; -} VkClearAttachment; - -typedef struct VkClearRect -{ - VkRect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkClearRect; - -typedef struct VkCommandBufferBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandBufferUsageFlags flags; - const VkCommandBufferInheritanceInfo *pInheritanceInfo; -} VkCommandBufferBeginInfo; - -typedef struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkSurfaceTransformFlagBitsKHR transform; - VkRect2D renderArea; -} VkCommandBufferInheritanceRenderPassTransformInfoQCOM; - -typedef struct VkCommandBufferInheritanceViewportScissorInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 viewportScissor2D; - uint32_t viewportDepthCount; - const VkViewport *pViewportDepths; -} VkCommandBufferInheritanceViewportScissorInfoNV; - -typedef struct VkCopyAccelerationStructureToMemoryInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) src; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureToMemoryInfoKHR; - -typedef struct VkCopyBufferToImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) srcBuffer; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkBufferImageCopy2 *pRegions; -} VkCopyBufferToImageInfo2; -typedef VkCopyBufferToImageInfo2 VkCopyBufferToImageInfo2KHR; - -typedef struct VkCopyImageToBufferInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer WINE_VK_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferImageCopy2 *pRegions; -} VkCopyImageToBufferInfo2; -typedef VkCopyImageToBufferInfo2 VkCopyImageToBufferInfo2KHR; - -typedef struct VkCopyMemoryToAccelerationStructureInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) src; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyMemoryToAccelerationStructureInfoKHR; - -typedef struct VkCopyMemoryToImageIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkCopyMemoryToImageIndirectCommandNV; - -typedef struct VkCopyMemoryToMicromapInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) src; - VkMicromapEXT WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMemoryToMicromapInfoEXT; - -typedef struct VkCopyMicromapToMemoryInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapEXT WINE_VK_ALIGN(8) src; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapToMemoryInfoEXT; - -typedef struct VkDebugUtilsMessengerCallbackDataEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugUtilsMessengerCallbackDataFlagsEXT flags; - const char *pMessageIdName; - int32_t messageIdNumber; - const char *pMessage; - uint32_t queueLabelCount; - const VkDebugUtilsLabelEXT *pQueueLabels; - uint32_t cmdBufLabelCount; - const VkDebugUtilsLabelEXT *pCmdBufLabels; - uint32_t objectCount; - const VkDebugUtilsObjectNameInfoEXT *pObjects; -} VkDebugUtilsMessengerCallbackDataEXT; - -typedef union VkDescriptorDataEXT -{ - const VkSampler *pSampler; - const VkDescriptorImageInfo *pCombinedImageSampler; - const VkDescriptorImageInfo *pInputAttachmentImage; - const VkDescriptorImageInfo *pSampledImage; - const VkDescriptorImageInfo *pStorageImage; - const VkDescriptorAddressInfoEXT *pUniformTexelBuffer; - const VkDescriptorAddressInfoEXT *pStorageTexelBuffer; - const VkDescriptorAddressInfoEXT *pUniformBuffer; - const VkDescriptorAddressInfoEXT *pStorageBuffer; - VkDeviceAddress WINE_VK_ALIGN(8) accelerationStructure; -} VkDescriptorDataEXT; - -typedef struct VkDescriptorGetInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDescriptorType type; - VkDescriptorDataEXT WINE_VK_ALIGN(8) data; -} VkDescriptorGetInfoEXT; - -typedef struct VkDescriptorPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - const VkDescriptorPoolSize *pPoolSizes; -} VkDescriptorPoolCreateInfo; - -typedef struct VkDescriptorUpdateTemplateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorUpdateTemplateCreateFlags flags; - uint32_t descriptorUpdateEntryCount; - const VkDescriptorUpdateTemplateEntry *pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateType templateType; - VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout WINE_VK_ALIGN(8) pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfo; -typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; - -typedef struct VkDeviceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const VkDeviceQueueCreateInfo *pQueueCreateInfos; - uint32_t enabledLayerCount; - const char * const*ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const*ppEnabledExtensionNames; - const VkPhysicalDeviceFeatures *pEnabledFeatures; -} VkDeviceCreateInfo; - -typedef struct VkDeviceFaultInfoEXT -{ - VkStructureType sType; - void *pNext; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkDeviceFaultAddressInfoEXT *pAddressInfos; - VkDeviceFaultVendorInfoEXT *pVendorInfos; - void *pVendorBinaryData; -} VkDeviceFaultInfoEXT; - -typedef struct VkDeviceGroupRenderPassBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const VkRect2D *pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfo; -typedef VkDeviceGroupRenderPassBeginInfo VkDeviceGroupRenderPassBeginInfoKHR; - -typedef struct VkDeviceImageMemoryRequirements -{ - VkStructureType sType; - const void *pNext; - const VkImageCreateInfo *pCreateInfo; - VkImageAspectFlagBits planeAspect; -} VkDeviceImageMemoryRequirements; -typedef VkDeviceImageMemoryRequirements VkDeviceImageMemoryRequirementsKHR; - -typedef struct VkDeviceImageSubresourceInfoKHR -{ - VkStructureType sType; - const void *pNext; - const VkImageCreateInfo *pCreateInfo; - const VkImageSubresource2KHR *pSubresource; -} VkDeviceImageSubresourceInfoKHR; - -typedef struct VkExternalBufferProperties -{ - VkStructureType sType; - void *pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalBufferProperties; -typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; - -typedef struct VkExternalImageFormatProperties -{ - VkStructureType sType; - void *pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalImageFormatProperties; -typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; - -typedef struct VkGeneratedCommandsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV WINE_VK_ALIGN(8) indirectCommandsLayout; - uint32_t streamCount; - const VkIndirectCommandsStreamNV *pStreams; - uint32_t sequencesCount; - VkBuffer WINE_VK_ALIGN(8) preprocessBuffer; - VkDeviceSize WINE_VK_ALIGN(8) preprocessOffset; - VkDeviceSize WINE_VK_ALIGN(8) preprocessSize; - VkBuffer WINE_VK_ALIGN(8) sequencesCountBuffer; - VkDeviceSize WINE_VK_ALIGN(8) sequencesCountOffset; - VkBuffer WINE_VK_ALIGN(8) sequencesIndexBuffer; - VkDeviceSize WINE_VK_ALIGN(8) sequencesIndexOffset; -} VkGeneratedCommandsInfoNV; - -typedef struct VkGeometryDataNV -{ - VkGeometryTrianglesNV WINE_VK_ALIGN(8) triangles; - VkGeometryAABBNV WINE_VK_ALIGN(8) aabbs; -} VkGeometryDataNV; - -typedef struct VkGeometryNV -{ - VkStructureType sType; - const void *pNext; - VkGeometryTypeKHR geometryType; - VkGeometryDataNV WINE_VK_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkGeometryNV; - -typedef struct VkGetLatencyMarkerInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t timingCount; - VkLatencyTimingsFrameReportNV *pTimings; -} VkGetLatencyMarkerInfoNV; - -typedef struct VkHdrMetadataEXT -{ - VkStructureType sType; - const void *pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT; - -typedef struct VkHostImageLayoutTransitionInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkImageLayout oldLayout; - VkImageLayout newLayout; - VkImageSubresourceRange subresourceRange; -} VkHostImageLayoutTransitionInfoEXT; - -typedef struct VkImageBlit -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit; - -typedef struct VkImageBlit2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit2; -typedef VkImageBlit2 VkImageBlit2KHR; - -typedef struct VkImageCopy -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy; - -typedef struct VkImageCopy2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy2; -typedef VkImageCopy2 VkImageCopy2KHR; - -typedef struct VkImageMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage WINE_VK_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; - -typedef struct VkImageMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage WINE_VK_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier2; -typedef VkImageMemoryBarrier2 VkImageMemoryBarrier2KHR; - -typedef struct VkImageResolve -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve; - -typedef struct VkImageResolve2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve2; -typedef VkImageResolve2 VkImageResolve2KHR; - -typedef struct VkImageToMemoryCopyEXT -{ - VkStructureType sType; - const void *pNext; - void *pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkImageToMemoryCopyEXT; - -typedef struct VkImageViewSampleWeightCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkOffset2D filterCenter; - VkExtent2D filterSize; - uint32_t numPhases; -} VkImageViewSampleWeightCreateInfoQCOM; - -typedef struct VkIndirectCommandsLayoutCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsLayoutUsageFlagsNV flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t tokenCount; - const VkIndirectCommandsLayoutTokenNV *pTokens; - uint32_t streamCount; - const uint32_t *pStreamStrides; -} VkIndirectCommandsLayoutCreateInfoNV; - -typedef struct VkMemoryToImageCopyEXT -{ - VkStructureType sType; - const void *pNext; - const void *pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkMemoryToImageCopyEXT; - -typedef struct VkMicromapBuildInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapTypeEXT type; - VkBuildMicromapFlagsEXT flags; - VkBuildMicromapModeEXT mode; - VkMicromapEXT WINE_VK_ALIGN(8) dstMicromap; - uint32_t usageCountsCount; - const VkMicromapUsageEXT *pUsageCounts; - const VkMicromapUsageEXT * const*ppUsageCounts; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) scratchData; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) triangleArray; - VkDeviceSize WINE_VK_ALIGN(8) triangleArrayStride; -} VkMicromapBuildInfoEXT; - -typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM -{ - VkStructureType sType; - const void *pNext; - uint32_t perViewRenderAreaCount; - const VkRect2D *pPerViewRenderAreas; -} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; - -typedef struct VkMutableDescriptorTypeCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t mutableDescriptorTypeListCount; - const VkMutableDescriptorTypeListEXT *pMutableDescriptorTypeLists; -} VkMutableDescriptorTypeCreateInfoEXT; -typedef VkMutableDescriptorTypeCreateInfoEXT VkMutableDescriptorTypeCreateInfoVALVE; - -typedef struct VkOpticalFlowExecuteInfoNV -{ - VkStructureType sType; - void *pNext; - VkOpticalFlowExecuteFlagsNV flags; - uint32_t regionCount; - const VkRect2D *pRegions; -} VkOpticalFlowExecuteInfoNV; - -typedef struct VkPhysicalDeviceProperties -{ - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits WINE_VK_ALIGN(8) limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkPhysicalDeviceProperties2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceProperties WINE_VK_ALIGN(8) properties; -} VkPhysicalDeviceProperties2; -typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; - -typedef struct VkPipelineDepthStencilStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - const VkRect2D *pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT; - -typedef struct VkPipelineExecutableStatisticKHR -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkPipelineExecutableStatisticFormatKHR format; - VkPipelineExecutableStatisticValueKHR WINE_VK_ALIGN(8) value; -} VkPipelineExecutableStatisticKHR; - -typedef struct VkPipelineLayoutCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT; - -typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t vertexBindingDivisorCount; - const VkVertexInputBindingDivisorDescriptionEXT *pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfoEXT; - -typedef struct VkPipelineVertexInputStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription *pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription *pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; - -typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t exclusiveScissorCount; - const VkRect2D *pExclusiveScissors; -} VkPipelineViewportExclusiveScissorStateCreateInfoNV; - -typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 shadingRateImageEnable; - uint32_t viewportCount; - const VkShadingRatePaletteNV *pShadingRatePalettes; -} VkPipelineViewportShadingRateImageStateCreateInfoNV; - -typedef struct VkPipelineViewportStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport *pViewports; - uint32_t scissorCount; - const VkRect2D *pScissors; -} VkPipelineViewportStateCreateInfo; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - const VkViewportSwizzleNV *pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - const VkViewportWScalingNV *pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV; - -typedef struct VkPresentRegionKHR -{ - uint32_t rectangleCount; - const VkRectLayerKHR *pRectangles; -} VkPresentRegionKHR; - -typedef struct VkPresentRegionsKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkPresentRegionKHR *pRegions; -} VkPresentRegionsKHR; - -typedef struct VkRenderPassCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription *pAttachments; - uint32_t subpassCount; - const VkSubpassDescription *pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency *pDependencies; -} VkRenderPassCreateInfo; - -typedef struct VkRenderPassCreateInfo2 -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription2 *pAttachments; - uint32_t subpassCount; - const VkSubpassDescription2 *pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency2 *pDependencies; - uint32_t correlatedViewMaskCount; - const uint32_t *pCorrelatedViewMasks; -} VkRenderPassCreateInfo2; -typedef VkRenderPassCreateInfo2 VkRenderPassCreateInfo2KHR; - -typedef struct VkRenderPassCreationFeedbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreationFeedbackInfoEXT *pRenderPassFeedback; -} VkRenderPassCreationFeedbackCreateInfoEXT; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentInitialSampleLocationsCount; - const VkAttachmentSampleLocationsEXT *pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - const VkSubpassSampleLocationsEXT *pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT; - -typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkRenderPassSubpassFeedbackInfoEXT *pSubpassFeedback; -} VkRenderPassSubpassFeedbackCreateInfoEXT; - -typedef struct VkResolveImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageResolve2 *pRegions; -} VkResolveImageInfo2; -typedef VkResolveImageInfo2 VkResolveImageInfo2KHR; - -typedef struct VkSparseBufferMemoryBindInfo -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - uint32_t bindCount; - const VkSparseMemoryBind *pBinds; -} VkSparseBufferMemoryBindInfo; - -typedef struct VkSparseImageOpaqueMemoryBindInfo -{ - VkImage WINE_VK_ALIGN(8) image; - uint32_t bindCount; - const VkSparseMemoryBind *pBinds; -} VkSparseImageOpaqueMemoryBindInfo; - -typedef struct VkSpecializationInfo -{ - uint32_t mapEntryCount; - const VkSpecializationMapEntry *pMapEntries; - size_t dataSize; - const void *pData; -} VkSpecializationInfo; - -typedef struct VkSurfaceCapabilities2KHR -{ - VkStructureType sType; - void *pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR; - -typedef struct VkSurfaceFormat2KHR -{ - VkStructureType sType; - void *pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR; - -typedef union VkAccelerationStructureGeometryDataKHR -{ - VkAccelerationStructureGeometryTrianglesDataKHR WINE_VK_ALIGN(8) triangles; - VkAccelerationStructureGeometryAabbsDataKHR WINE_VK_ALIGN(8) aabbs; - VkAccelerationStructureGeometryInstancesDataKHR WINE_VK_ALIGN(8) instances; -} VkAccelerationStructureGeometryDataKHR; - -typedef struct VkAccelerationStructureGeometryKHR -{ - VkStructureType sType; - const void *pNext; - VkGeometryTypeKHR geometryType; - VkAccelerationStructureGeometryDataKHR WINE_VK_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkAccelerationStructureGeometryKHR; - -typedef struct VkAccelerationStructureInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureTypeNV type; - VkBuildAccelerationStructureFlagsNV flags; - uint32_t instanceCount; - uint32_t geometryCount; - const VkGeometryNV *pGeometries; -} VkAccelerationStructureInfoNV; - -typedef union VkAccelerationStructureMotionInstanceDataNV -{ - VkAccelerationStructureInstanceKHR WINE_VK_ALIGN(8) staticInstance; - VkAccelerationStructureMatrixMotionInstanceNV WINE_VK_ALIGN(8) matrixMotionInstance; - VkAccelerationStructureSRTMotionInstanceNV WINE_VK_ALIGN(8) srtMotionInstance; -} VkAccelerationStructureMotionInstanceDataNV; - -typedef struct VkAccelerationStructureMotionInstanceNV -{ - VkAccelerationStructureMotionInstanceTypeNV type; - VkAccelerationStructureMotionInstanceFlagsNV flags; - VkAccelerationStructureMotionInstanceDataNV WINE_VK_ALIGN(8) data; -} VkAccelerationStructureMotionInstanceNV; - -typedef struct VkBindSparseInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - uint32_t bufferBindCount; - const VkSparseBufferMemoryBindInfo *pBufferBinds; - uint32_t imageOpaqueBindCount; - const VkSparseImageOpaqueMemoryBindInfo *pImageOpaqueBinds; - uint32_t imageBindCount; - const VkSparseImageMemoryBindInfo *pImageBinds; - uint32_t signalSemaphoreCount; - const VkSemaphore *pSignalSemaphores; -} VkBindSparseInfo; - -typedef struct VkBlitImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageBlit2 *pRegions; - VkFilter filter; -} VkBlitImageInfo2; -typedef VkBlitImageInfo2 VkBlitImageInfo2KHR; - -typedef struct VkCopyImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy2 *pRegions; -} VkCopyImageInfo2; -typedef VkCopyImageInfo2 VkCopyImageInfo2KHR; - -typedef struct VkCopyImageToImageInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlagsEXT flags; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy2 *pRegions; -} VkCopyImageToImageInfoEXT; - -typedef struct VkCopyImageToMemoryInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlagsEXT flags; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - uint32_t regionCount; - const VkImageToMemoryCopyEXT *pRegions; -} VkCopyImageToMemoryInfoEXT; - -typedef struct VkCopyMemoryToImageInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlagsEXT flags; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkMemoryToImageCopyEXT *pRegions; -} VkCopyMemoryToImageInfoEXT; - -typedef struct VkDependencyInfo -{ - VkStructureType sType; - const void *pNext; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - const VkMemoryBarrier2 *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier2 *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier2 *pImageMemoryBarriers; -} VkDependencyInfo; -typedef VkDependencyInfo VkDependencyInfoKHR; - -typedef struct VkPipelineShaderStageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule WINE_VK_ALIGN(8) module; - const char *pName; - const VkSpecializationInfo *pSpecializationInfo; -} VkPipelineShaderStageCreateInfo; - -typedef struct VkRayTracingPipelineCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - uint32_t groupCount; - const VkRayTracingShaderGroupCreateInfoKHR *pGroups; - uint32_t maxPipelineRayRecursionDepth; - const VkPipelineLibraryCreateInfoKHR *pLibraryInfo; - const VkRayTracingPipelineInterfaceCreateInfoKHR *pLibraryInterface; - const VkPipelineDynamicStateCreateInfo *pDynamicState; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoKHR; - -typedef struct VkRayTracingPipelineCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - uint32_t groupCount; - const VkRayTracingShaderGroupCreateInfoNV *pGroups; - uint32_t maxRecursionDepth; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoNV; - -typedef struct VkShaderCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkShaderCreateFlagsEXT flags; - VkShaderStageFlagBits stage; - VkShaderStageFlags nextStage; - VkShaderCodeTypeEXT codeType; - size_t codeSize; - const void *pCode; - const char *pName; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; - const VkSpecializationInfo *pSpecializationInfo; -} VkShaderCreateInfoEXT; - -typedef struct VkAccelerationStructureBuildGeometryInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureTypeKHR type; - VkBuildAccelerationStructureFlagsKHR flags; - VkBuildAccelerationStructureModeKHR mode; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) srcAccelerationStructure; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dstAccelerationStructure; - uint32_t geometryCount; - const VkAccelerationStructureGeometryKHR *pGeometries; - const VkAccelerationStructureGeometryKHR * const*ppGeometries; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) scratchData; -} VkAccelerationStructureBuildGeometryInfoKHR; - -typedef struct VkAccelerationStructureCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) compactedSize; - VkAccelerationStructureInfoNV info; -} VkAccelerationStructureCreateInfoNV; - -typedef struct VkComputePipelineCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo WINE_VK_ALIGN(8) stage; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo; - -typedef struct VkGraphicsPipelineCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - const VkPipelineVertexInputStateCreateInfo *pVertexInputState; - const VkPipelineInputAssemblyStateCreateInfo *pInputAssemblyState; - const VkPipelineTessellationStateCreateInfo *pTessellationState; - const VkPipelineViewportStateCreateInfo *pViewportState; - const VkPipelineRasterizationStateCreateInfo *pRasterizationState; - const VkPipelineMultisampleStateCreateInfo *pMultisampleState; - const VkPipelineDepthStencilStateCreateInfo *pDepthStencilState; - const VkPipelineColorBlendStateCreateInfo *pColorBlendState; - const VkPipelineDynamicStateCreateInfo *pDynamicState; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo; - -typedef struct VkGraphicsShaderGroupCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - const VkPipelineVertexInputStateCreateInfo *pVertexInputState; - const VkPipelineTessellationStateCreateInfo *pTessellationState; -} VkGraphicsShaderGroupCreateInfoNV; - -typedef struct VkGraphicsPipelineShaderGroupsCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t groupCount; - const VkGraphicsShaderGroupCreateInfoNV *pGroups; - uint32_t pipelineCount; - const VkPipeline *pPipelines; -} VkGraphicsPipelineShaderGroupsCreateInfoNV; - -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice, const VkAcquireNextImageInfoKHR *, uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquirePerformanceConfigurationINTEL)(VkDevice, const VkPerformanceConfigurationAcquireInfoINTEL *, VkPerformanceConfigurationINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice, const VkAcquireProfilingLockInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice, const VkCommandBufferAllocateInfo *, VkCommandBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice, const VkDescriptorSetAllocateInfo *, VkDescriptorSet *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice, const VkMemoryAllocateInfo *, const VkAllocationCallbacks *, VkDeviceMemory *); -typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer, const VkCommandBufferBeginInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindAccelerationStructureMemoryNV)(VkDevice, uint32_t, const VkBindAccelerationStructureMemoryInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice, VkImage, VkDeviceMemory, VkDeviceSize); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindOpticalFlowSessionImageNV)(VkDevice, VkOpticalFlowSessionNV, VkOpticalFlowSessionBindingPointNV, VkImageView, VkImageLayout); -typedef VkResult (VKAPI_PTR *PFN_vkBuildAccelerationStructuresKHR)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); -typedef VkResult (VKAPI_PTR *PFN_vkBuildMicromapsEXT)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkMicromapBuildInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginConditionalRenderingEXT)(VkCommandBuffer, const VkConditionalRenderingBeginInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer, const VkRenderPassBeginInfo *, VkSubpassContents); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass2)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass2KHR)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRendering)(VkCommandBuffer, const VkRenderingInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderingKHR)(VkCommandBuffer, const VkRenderingInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBuffersEXT)(VkCommandBuffer, uint32_t, const VkDescriptorBufferBindingInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkDescriptorSet *, uint32_t, const uint32_t *); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkIndexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer2KHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, VkIndexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindInvocationMaskHUAWEI)(VkCommandBuffer, VkImageView, VkImageLayout); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipelineShaderGroupNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBindShadersEXT)(VkCommandBuffer, uint32_t, const VkShaderStageFlagBits *, const VkShaderEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBindShadingRateImageNV)(VkCommandBuffer, VkImageView, VkImageLayout); -typedef void (VKAPI_PTR *PFN_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers2)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers2EXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageBlit *, VkFilter); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2)(VkCommandBuffer, const VkBlitImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2KHR)(VkCommandBuffer, const VkBlitImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructureNV)(VkCommandBuffer, const VkAccelerationStructureInfoNV *, VkBuffer, VkDeviceSize, VkBool32, VkAccelerationStructureNV, VkAccelerationStructureNV, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructuresIndirectKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkDeviceAddress *, const uint32_t *, const uint32_t * const*); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructuresKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); -typedef void (VKAPI_PTR *PFN_vkCmdBuildMicromapsEXT)(VkCommandBuffer, uint32_t, const VkMicromapBuildInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer, uint32_t, const VkClearAttachment *, uint32_t, const VkClearRect *); -typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearColorValue *, uint32_t, const VkImageSubresourceRange *); -typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearDepthStencilValue *, uint32_t, const VkImageSubresourceRange *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureKHR)(VkCommandBuffer, const VkCopyAccelerationStructureInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureNV)(VkCommandBuffer, VkAccelerationStructureNV, VkAccelerationStructureNV, VkCopyAccelerationStructureModeKHR); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureToMemoryKHR)(VkCommandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer, VkBuffer, VkBuffer, uint32_t, const VkBufferCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2)(VkCommandBuffer, const VkCopyBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2KHR)(VkCommandBuffer, const VkCopyBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer, VkBuffer, VkImage, VkImageLayout, uint32_t, const VkBufferImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2KHR)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2)(VkCommandBuffer, const VkCopyImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2KHR)(VkCommandBuffer, const VkCopyImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer, VkImage, VkImageLayout, VkBuffer, uint32_t, const VkBufferImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2KHR)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToAccelerationStructureKHR)(VkCommandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToImageIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t, VkImage, VkImageLayout, const VkImageSubresourceLayers *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToMicromapEXT)(VkCommandBuffer, const VkCopyMemoryToMicromapInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapEXT)(VkCommandBuffer, const VkCopyMicromapInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapToMemoryEXT)(VkCommandBuffer, const VkCopyMicromapToMemoryInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t, VkBuffer, VkDeviceSize, VkDeviceSize, VkQueryResultFlags); -typedef void (VKAPI_PTR *PFN_vkCmdCuLaunchKernelNVX)(VkCommandBuffer, const VkCuLaunchInfoNVX *); -typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer, const VkCudaLaunchInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryIndirectCountNV)(VkCommandBuffer, VkDeviceAddress, VkDeviceAddress, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryNV)(VkCommandBuffer, uint32_t, const VkDecompressMemoryRegionNV *); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHR)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer, uint32_t, uint32_t, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksEXT)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksNV)(VkCommandBuffer, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMultiEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawInfoEXT *, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMultiIndexedEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawIndexedInfoEXT *, uint32_t, uint32_t, uint32_t, const int32_t *); -typedef void (VKAPI_PTR *PFN_vkCmdEndConditionalRenderingEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndDebugUtilsLabelEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdEndQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass2)(VkCommandBuffer, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass2KHR)(VkCommandBuffer, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdEndRendering)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderingKHR)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer, uint32_t, const VkCommandBuffer *); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteGeneratedCommandsNV)(VkCommandBuffer, VkBool32, const VkGeneratedCommandsInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdInsertDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer, VkSubpassContents); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass2)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass2KHR)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdOpticalFlowExecuteNV)(VkCommandBuffer, VkOpticalFlowSessionNV, const VkOpticalFlowExecuteInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2)(VkCommandBuffer, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2KHR)(VkCommandBuffer, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPreprocessGeneratedCommandsNV)(VkCommandBuffer, const VkGeneratedCommandsInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, uint32_t, uint32_t, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer, VkDescriptorUpdateTemplate, VkPipelineLayout, uint32_t, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2KHR)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); -typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageResolve *); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2)(VkCommandBuffer, const VkResolveImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2KHR)(VkCommandBuffer, const VkResolveImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToCoverageEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToOneEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)(VkCommandBuffer, VkImageAspectFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer, const float[4]); -typedef void (VKAPI_PTR *PFN_vkCmdSetCheckpointNV)(VkCommandBuffer, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoarseSampleOrderNV)(VkCommandBuffer, VkCoarseSampleOrderTypeNV, uint32_t, const VkCoarseSampleOrderCustomNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendAdvancedEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendAdvancedEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendEquationEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteEnableEXT)(VkCommandBuffer, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorComponentFlags *); -typedef void (VKAPI_PTR *PFN_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer, VkConservativeRasterizationModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationModeNV)(VkCommandBuffer, VkCoverageModulationModeNV); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableNV)(VkCommandBuffer, uint32_t, const float *); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer, VkCoverageReductionModeNV); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorLocationNV)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetCullMode)(VkCommandBuffer, VkCullModeFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetCullModeEXT)(VkCommandBuffer, VkCullModeFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer, float, float, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias2EXT)(VkCommandBuffer, const VkDepthBiasInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBiasEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBiasEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer, float, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipNegativeOneToOneEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthCompareOp)(VkCommandBuffer, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthCompareOpEXT)(VkCommandBuffer, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthWriteEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthWriteEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsetsEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const uint32_t *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHR)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleModeEXT)(VkCommandBuffer, VkDiscardRectangleModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2KHR)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorEnableNV)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateEnumNV)(VkCommandBuffer, VkFragmentShadingRateNV, const VkFragmentShadingRateCombinerOpKHR[2]); -typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateKHR)(VkCommandBuffer, const VkExtent2D *, const VkFragmentShadingRateCombinerOpKHR[2]); -typedef void (VKAPI_PTR *PFN_vkCmdSetFrontFace)(VkCommandBuffer, VkFrontFace); -typedef void (VKAPI_PTR *PFN_vkCmdSetFrontFaceEXT)(VkCommandBuffer, VkFrontFace); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineRasterizationModeEXT)(VkCommandBuffer, VkLineRasterizationModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEXT)(VkCommandBuffer, uint32_t, uint16_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEXT)(VkCommandBuffer, VkLogicOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPatchControlPointsEXT)(VkCommandBuffer, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceMarkerINTEL)(VkCommandBuffer, const VkPerformanceMarkerInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceOverrideINTEL)(VkCommandBuffer, const VkPerformanceOverrideInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceStreamMarkerINTEL)(VkCommandBuffer, const VkPerformanceStreamMarkerInfoINTEL *); -typedef void (VKAPI_PTR *PFN_vkCmdSetPolygonModeEXT)(VkCommandBuffer, VkPolygonMode); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveRestartEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveRestartEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveTopology)(VkCommandBuffer, VkPrimitiveTopology); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveTopologyEXT)(VkCommandBuffer, VkPrimitiveTopology); -typedef void (VKAPI_PTR *PFN_vkCmdSetProvokingVertexModeEXT)(VkCommandBuffer, VkProvokingVertexModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer, VkSampleCountFlagBits); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizerDiscardEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizerDiscardEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetRayTracingPipelineStackSizeKHR)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetRepresentativeFragmentTestEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer, const VkSampleLocationsInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleMaskEXT)(VkCommandBuffer, VkSampleCountFlagBits, const VkSampleMask *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissorWithCount)(VkCommandBuffer, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissorWithCountEXT)(VkCommandBuffer, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetShadingRateImageEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilOp)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilOpEXT)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer, VkTessellationDomainOrigin); -typedef void (VKAPI_PTR *PFN_vkCmdSetVertexInputEXT)(VkCommandBuffer, uint32_t, const VkVertexInputBindingDescription2EXT *, uint32_t, const VkVertexInputAttributeDescription2EXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer, uint32_t, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportShadingRatePaletteNV)(VkCommandBuffer, uint32_t, uint32_t, const VkShadingRatePaletteNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportSwizzleNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportSwizzleNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportWScalingNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWithCount)(VkCommandBuffer, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWithCountEXT)(VkCommandBuffer, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSubpassShadingHUAWEI)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysIndirect2KHR)(VkCommandBuffer, VkDeviceAddress); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysIndirectKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, VkDeviceAddress); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdUpdatePipelineIndirectBufferNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer, uint32_t, const VkEvent *, VkPipelineStageFlags, VkPipelineStageFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2KHR)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructuresPropertiesNV)(VkCommandBuffer, uint32_t, const VkAccelerationStructureNV *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer, VkPipelineStageFlags2, VkBuffer, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer, VkPipelineStageFlagBits, VkBuffer, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteMicromapsPropertiesEXT)(VkCommandBuffer, uint32_t, const VkMicromapEXT *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2KHR)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCompileDeferredNV)(VkDevice, VkPipeline, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCopyAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyAccelerationStructureToMemoryKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureToMemoryInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToImageEXT)(VkDevice, const VkCopyImageToImageInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToMemoryEXT)(VkDevice, const VkCopyImageToMemoryInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToAccelerationStructureInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToImageEXT)(VkDevice, const VkCopyMemoryToImageInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToMicromapInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapToMemoryEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapToMemoryInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureKHR)(VkDevice, const VkAccelerationStructureCreateInfoKHR *, const VkAllocationCallbacks *, VkAccelerationStructureKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureNV)(VkDevice, const VkAccelerationStructureCreateInfoNV *, const VkAllocationCallbacks *, VkAccelerationStructureNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice, const VkBufferCreateInfo *, const VkAllocationCallbacks *, VkBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice, const VkBufferViewCreateInfo *, const VkAllocationCallbacks *, VkBufferView *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice, const VkCommandPoolCreateInfo *, const VkAllocationCallbacks *, VkCommandPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice, VkPipelineCache, uint32_t, const VkComputePipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCuFunctionNVX)(VkDevice, const VkCuFunctionCreateInfoNVX *, const VkAllocationCallbacks *, VkCuFunctionNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCuModuleNVX)(VkDevice, const VkCuModuleCreateInfoNVX *, const VkAllocationCallbacks *, VkCuModuleNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice, const VkCudaFunctionCreateInfoNV *, const VkAllocationCallbacks *, VkCudaFunctionNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice, const VkCudaModuleCreateInfoNV *, const VkAllocationCallbacks *, VkCudaModuleNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance, const VkDebugReportCallbackCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugReportCallbackEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugUtilsMessengerEXT)(VkInstance, const VkDebugUtilsMessengerCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugUtilsMessengerEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDeferredOperationKHR)(VkDevice, const VkAllocationCallbacks *, VkDeferredOperationKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice, const VkDescriptorPoolCreateInfo *, const VkAllocationCallbacks *, VkDescriptorPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, const VkAllocationCallbacks *, VkDescriptorSetLayout *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice, const VkDeviceCreateInfo *, const VkAllocationCallbacks *, VkDevice *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice, const VkEventCreateInfo *, const VkAllocationCallbacks *, VkEvent *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice, const VkFenceCreateInfo *, const VkAllocationCallbacks *, VkFence *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice, const VkFramebufferCreateInfo *, const VkAllocationCallbacks *, VkFramebuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice, VkPipelineCache, uint32_t, const VkGraphicsPipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice, const VkImageCreateInfo *, const VkAllocationCallbacks *, VkImage *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice, const VkImageViewCreateInfo *, const VkAllocationCallbacks *, VkImageView *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNV)(VkDevice, const VkIndirectCommandsLayoutCreateInfoNV *, const VkAllocationCallbacks *, VkIndirectCommandsLayoutNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateMicromapEXT)(VkDevice, const VkMicromapCreateInfoEXT *, const VkAllocationCallbacks *, VkMicromapEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateOpticalFlowSessionNV)(VkDevice, const VkOpticalFlowSessionCreateInfoNV *, const VkAllocationCallbacks *, VkOpticalFlowSessionNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice, const VkPipelineCacheCreateInfo *, const VkAllocationCallbacks *, VkPipelineCache *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice, const VkPipelineLayoutCreateInfo *, const VkAllocationCallbacks *, VkPipelineLayout *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlot)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlotEXT)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice, const VkQueryPoolCreateInfo *, const VkAllocationCallbacks *, VkQueryPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRayTracingPipelinesKHR)(VkDevice, VkDeferredOperationKHR, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoKHR *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRayTracingPipelinesNV)(VkDevice, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoNV *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice, const VkRenderPassCreateInfo *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass2)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass2KHR)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice, const VkSamplerCreateInfo *, const VkAllocationCallbacks *, VkSampler *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice, const VkSemaphoreCreateInfo *, const VkAllocationCallbacks *, VkSemaphore *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice, const VkShaderModuleCreateInfo *, const VkAllocationCallbacks *, VkShaderModule *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShadersEXT)(VkDevice, uint32_t, const VkShaderCreateInfoEXT *, const VkAllocationCallbacks *, VkShaderEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice, const VkSwapchainCreateInfoKHR *, const VkAllocationCallbacks *, VkSwapchainKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice, const VkValidationCacheCreateInfoEXT *, const VkAllocationCallbacks *, VkValidationCacheEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance, const VkWin32SurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice, const VkDebugMarkerObjectNameInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice, const VkDebugMarkerObjectTagInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance, VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *); -typedef VkResult (VKAPI_PTR *PFN_vkDeferredOperationJoinKHR)(VkDevice, VkDeferredOperationKHR); -typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureKHR)(VkDevice, VkAccelerationStructureKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureNV)(VkDevice, VkAccelerationStructureNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice, VkBuffer, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice, VkBufferView, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice, VkCommandPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCuFunctionNVX)(VkDevice, VkCuFunctionNVX, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCuModuleNVX)(VkDevice, VkCuModuleNVX, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice, VkCudaFunctionNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice, VkCudaModuleNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance, VkDebugReportCallbackEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugUtilsMessengerEXT)(VkInstance, VkDebugUtilsMessengerEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDeferredOperationKHR)(VkDevice, VkDeferredOperationKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice, VkDescriptorPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice, VkEvent, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice, VkFence, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice, VkFramebuffer, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice, VkImage, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice, VkImageView, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNV)(VkDevice, VkIndirectCommandsLayoutNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyMicromapEXT)(VkDevice, VkMicromapEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyOpticalFlowSessionNV)(VkDevice, VkOpticalFlowSessionNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice, VkPipeline, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice, VkPipelineCache, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice, VkPipelineLayout, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlot)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlotEXT)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice, VkQueryPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice, VkRenderPass, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice, VkSampler, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice, VkSemaphore, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderEXT)(VkDevice, VkShaderEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice, VkShaderModule, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice, VkValidationCacheEXT, const VkAllocationCallbacks *); -typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice); -typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice, const char *, uint32_t *, VkExtensionProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice, uint32_t *, VkLayerProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t *, VkLayerProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHR)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice, uint32_t, uint32_t *, VkPerformanceCounterKHR *, VkPerformanceCounterDescriptionKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance, uint32_t *, VkPhysicalDevice *); -typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); -typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice, VkCommandPool, uint32_t, const VkCommandBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice, VkDescriptorPool, uint32_t, const VkDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice, VkDeviceMemory, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureBuildSizesKHR)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkAccelerationStructureBuildGeometryInfoKHR *, const uint32_t *, VkAccelerationStructureBuildSizesInfoKHR *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetAccelerationStructureDeviceAddressKHR)(VkDevice, const VkAccelerationStructureDeviceAddressInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureHandleNV)(VkDevice, VkAccelerationStructureNV, size_t, void *); -typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureMemoryRequirementsNV)(VkDevice, const VkAccelerationStructureMemoryRequirementsInfoNV *, VkMemoryRequirements2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *, void *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddress)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddressEXT)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice, VkBuffer, VkMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureAddress)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkBufferCaptureDescriptorDataInfoEXT *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice, uint32_t, const VkCalibratedTimestampInfoEXT *, uint64_t *, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice, VkCudaModuleNV, size_t *, void *); -typedef uint32_t (VKAPI_PTR *PFN_vkGetDeferredOperationMaxConcurrencyKHR)(VkDevice, VkDeferredOperationKHR); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeferredOperationResultKHR)(VkDevice, VkDeferredOperationKHR); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorEXT)(VkDevice, const VkDescriptorGetInfoEXT *, size_t, void *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetHostMappingVALVE)(VkDevice, VkDescriptorSet, void **); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)(VkDevice, VkDescriptorSetLayout, uint32_t, VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE)(VkDevice, const VkDescriptorSetBindingReferenceVALVE *, VkDescriptorSetLayoutHostMappingInfoVALVE *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSizeEXT)(VkDevice, VkDescriptorSetLayout, VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupportKHR)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)(VkDevice, const VkAccelerationStructureVersionInfoKHR *, VkAccelerationStructureCompatibilityKHR *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirements)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirementsKHR)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceFaultInfoEXT)(VkDevice, VkDeviceFaultCountsEXT *, VkDeviceFaultInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice, VkDeviceGroupPresentCapabilitiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSubresourceLayoutKHR)(VkDevice, const VkDeviceImageSubresourceInfoKHR *, VkSubresourceLayout2KHR *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMicromapCompatibilityEXT)(VkDevice, const VkMicromapVersionInfoEXT *, VkAccelerationStructureCompatibilityKHR *); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice, const char *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice, uint32_t, uint32_t, VkQueue *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue2)(VkDevice, const VkDeviceQueueInfo2 *, VkQueue *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI)(VkDevice, VkRenderPass, VkExtent2D *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDynamicRenderingTilePropertiesQCOM)(VkDevice, const VkRenderingInfo *, VkTilePropertiesQCOM *); -typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice, VkEvent); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkGetFramebufferTilePropertiesQCOM)(VkDevice, VkFramebuffer, uint32_t *, VkTilePropertiesQCOM *); -typedef void (VKAPI_PTR *PFN_vkGetGeneratedCommandsMemoryRequirementsNV)(VkDevice, const VkGeneratedCommandsMemoryRequirementsInfoNV *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageCaptureDescriptorDataInfoEXT *, void *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice, VkImage, uint32_t *, VkSparseImageMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2EXT)(VkDevice, VkImage, const VkImageSubresource2KHR *, VkSubresourceLayout2KHR *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2KHR)(VkDevice, VkImage, const VkImageSubresource2KHR *, VkSubresourceLayout2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *); -typedef uint32_t (VKAPI_PTR *PFN_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageViewCaptureDescriptorDataInfoEXT *, void *); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance, const char *); -typedef void (VKAPI_PTR *PFN_vkGetLatencyTimingsNV)(VkDevice, VkSwapchainKHR, VkGetLatencyMarkerInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice, const VkMemoryGetWin32HandleInfoKHR *, HANDLE *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice, VkExternalMemoryHandleTypeFlagBits, HANDLE, VkMemoryWin32HandlePropertiesKHR *); -typedef void (VKAPI_PTR *PFN_vkGetMicromapBuildSizesEXT)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkMicromapBuildInfoEXT *, VkMicromapBuildSizesInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice, uint32_t *, VkTimeDomainEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesNV *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice, VkPhysicalDeviceFeatures *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice, VkFormat, VkFormatProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceFragmentShadingRateKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice, VkSampleCountFlagBits, VkMultisamplePropertiesEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)(VkPhysicalDevice, const VkOpticalFlowImageFormatInfoNV *, uint32_t *, VkOpticalFlowImageFormatPropertiesNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice, VkPhysicalDeviceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *, uint32_t *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkSampleCountFlagBits, VkImageUsageFlags, VkImageTiling, uint32_t *, VkSparseImageFormatProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)(VkPhysicalDevice, uint32_t *, VkFramebufferMixedSamplesCombinationNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolProperties)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolPropertiesEXT)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice, VkPipelineCache, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutableInternalRepresentationsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableInternalRepresentationKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutablePropertiesKHR)(VkDevice, const VkPipelineInfoKHR *, uint32_t *, VkPipelineExecutablePropertiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutableStatisticsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableStatisticKHR *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetPipelineIndirectDeviceAddressNV)(VkDevice, const VkPipelineIndirectDeviceAddressInfoNV *); -typedef void (VKAPI_PTR *PFN_vkGetPipelineIndirectMemoryRequirementsNV)(VkDevice, const VkComputePipelineCreateInfo *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelinePropertiesEXT)(VkDevice, const VkPipelineInfoEXT *, VkBaseOutStructure *); -typedef void (VKAPI_PTR *PFN_vkGetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); -typedef void (VKAPI_PTR *PFN_vkGetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice, VkQueryPool, uint32_t, uint32_t, size_t, void *, VkDeviceSize, VkQueryResultFlags); -typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointData2NV)(VkQueue, uint32_t *, VkCheckpointData2NV *); -typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointDataNV)(VkQueue, uint32_t *, VkCheckpointDataNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupHandlesNV)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkDeviceSize (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupStackSizeKHR)(VkDevice, VkPipeline, uint32_t, VkShaderGroupShaderKHR); -typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice, VkRenderPass, VkExtent2D *); -typedef void (VKAPI_PTR *PFN_vkGetRenderingAreaGranularityKHR)(VkDevice, const VkRenderingAreaInfoKHR *, VkExtent2D *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkSamplerCaptureDescriptorDataInfoEXT *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValue)(VkDevice, VkSemaphore, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValueKHR)(VkDevice, VkSemaphore, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice, VkShaderEXT, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice, VkPipeline, VkShaderStageFlagBits, VkShaderInfoTypeAMD, size_t *, void *); -typedef void (VKAPI_PTR *PFN_vkGetShaderModuleCreateInfoIdentifierEXT)(VkDevice, const VkShaderModuleCreateInfo *, VkShaderModuleIdentifierEXT *); -typedef void (VKAPI_PTR *PFN_vkGetShaderModuleIdentifierEXT)(VkDevice, VkShaderModule, VkShaderModuleIdentifierEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); -typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice, VkValidationCacheEXT, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkInitializePerformanceApiINTEL)(VkDevice, const VkInitializePerformanceApiInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); -typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void **); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory2KHR)(VkDevice, const VkMemoryMapInfoKHR *, void **); -typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice, VkPipelineCache, uint32_t, const VkPipelineCache *); -typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice, VkValidationCacheEXT, uint32_t, const VkValidationCacheEXT *); -typedef void (VKAPI_PTR *PFN_vkQueueBeginDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue, uint32_t, const VkBindSparseInfo *, VkFence); -typedef void (VKAPI_PTR *PFN_vkQueueEndDebugUtilsLabelEXT)(VkQueue); -typedef void (VKAPI_PTR *PFN_vkQueueInsertDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkQueueNotifyOutOfBandNV)(VkQueue, const VkOutOfBandQueueTypeInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSetPerformanceConfigurationINTEL)(VkQueue, VkPerformanceConfigurationINTEL); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue, uint32_t, const VkSubmitInfo *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2KHR)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue); -typedef VkResult (VKAPI_PTR *PFN_vkReleasePerformanceConfigurationINTEL)(VkDevice, VkPerformanceConfigurationINTEL); -typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice); -typedef VkResult (VKAPI_PTR *PFN_vkReleaseSwapchainImagesEXT)(VkDevice, const VkReleaseSwapchainImagesInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer, VkCommandBufferResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice, VkCommandPool, VkCommandPoolResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice, VkEvent); -typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice, uint32_t, const VkFence *); -typedef void (VKAPI_PTR *PFN_vkResetQueryPool)(VkDevice, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkResetQueryPoolEXT)(VkDevice, VkQueryPool, uint32_t, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectNameEXT)(VkDevice, const VkDebugUtilsObjectNameInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectTagEXT)(VkDevice, const VkDebugUtilsObjectTagInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkSetDeviceMemoryPriorityEXT)(VkDevice, VkDeviceMemory, float); -typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice, VkEvent); -typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice, uint32_t, const VkSwapchainKHR *, const VkHdrMetadataEXT *); -typedef void (VKAPI_PTR *PFN_vkSetLatencyMarkerNV)(VkDevice, VkSwapchainKHR, const VkSetLatencyMarkerInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkSetLatencySleepModeNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepModeInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphore)(VkDevice, const VkSemaphoreSignalInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphoreKHR)(VkDevice, const VkSemaphoreSignalInfo *); -typedef void (VKAPI_PTR *PFN_vkSubmitDebugUtilsMessageEXT)(VkInstance, VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkTransitionImageLayoutEXT)(VkDevice, uint32_t, const VkHostImageLayoutTransitionInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkTrimCommandPool)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); -typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); -typedef void (VKAPI_PTR *PFN_vkUninitializePerformanceApiINTEL)(VkDevice); -typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice, VkDeviceMemory); -typedef VkResult (VKAPI_PTR *PFN_vkUnmapMemory2KHR)(VkDevice, const VkMemoryUnmapInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice, uint32_t, const VkWriteDescriptorSet *, uint32_t, const VkCopyDescriptorSet *); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice, uint32_t, const VkFence *, VkBool32, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForPresentKHR)(VkDevice, VkSwapchainKHR, uint64_t, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitSemaphores)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitSemaphoresKHR)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWriteAccelerationStructuresPropertiesKHR)(VkDevice, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, size_t, void *, size_t); -typedef VkResult (VKAPI_PTR *PFN_vkWriteMicromapsPropertiesEXT)(VkDevice, uint32_t, const VkMicromapEXT *, VkQueryType, size_t, void *, size_t); - -#ifndef VK_NO_PROTOTYPES -VkResult VKAPI_CALL vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, uint32_t *pImageIndex); -VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex); -VkResult VKAPI_CALL vkAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo, VkPerformanceConfigurationINTEL *pConfiguration); -VkResult VKAPI_CALL vkAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR *pInfo); -VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); -VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets); -VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); -VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo); -VkResult VKAPI_CALL vkBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV *pBindInfos); -VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); -VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); -VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindOpticalFlowSessionImageNV(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout); -VkResult VKAPI_CALL vkBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos); -VkResult VKAPI_CALL vkBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos); -void VKAPI_CALL vkCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin); -void VKAPI_CALL vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); -void VKAPI_CALL vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index); -void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents); -void VKAPI_CALL vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo); -void VKAPI_CALL vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo); -void VKAPI_CALL vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo); -void VKAPI_CALL vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo); -void VKAPI_CALL vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets); -void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplersEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set); -void VKAPI_CALL vkCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos); -void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets); -void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); -void VKAPI_CALL vkCmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); -void VKAPI_CALL vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); -void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -void VKAPI_CALL vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex); -void VKAPI_CALL vkCmdBindShadersEXT(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits *pStages, const VkShaderEXT *pShaders); -void VKAPI_CALL vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); -void VKAPI_CALL vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes); -void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets); -void VKAPI_CALL vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides); -void VKAPI_CALL vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides); -void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter); -void VKAPI_CALL vkCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo); -void VKAPI_CALL vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo); -void VKAPI_CALL vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset); -void VKAPI_CALL vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t * const*ppMaxPrimitiveCounts); -void VKAPI_CALL vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos); -void VKAPI_CALL vkCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos); -void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects); -void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); -void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); -void VKAPI_CALL vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode); -void VKAPI_CALL vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions); -void VKAPI_CALL vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo); -void VKAPI_CALL vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo); -void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo); -void VKAPI_CALL vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo); -void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo); -void VKAPI_CALL vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo); -void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo); -void VKAPI_CALL vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo); -void VKAPI_CALL vkCmdCopyMemoryIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride); -void VKAPI_CALL vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyMemoryToImageIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers *pImageSubresources); -void VKAPI_CALL vkCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); -void VKAPI_CALL vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX *pLaunchInfo); -void VKAPI_CALL vkCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV *pLaunchInfo); -void VKAPI_CALL vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo); -void VKAPI_CALL vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo); -void VKAPI_CALL vkCmdDecompressMemoryIndirectCountNV(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride); -void VKAPI_CALL vkCmdDecompressMemoryNV(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV *pDecompressMemoryRegions); -void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -void VKAPI_CALL vkCmdDrawClusterHUAWEI(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); -void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride); -void VKAPI_CALL vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); -void VKAPI_CALL vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawInfoEXT *pVertexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride); -void VKAPI_CALL vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawIndexedInfoEXT *pIndexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride, const int32_t *pVertexOffset); -void VKAPI_CALL vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); -void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdEndRendering(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets); -void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -void VKAPI_CALL vkCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo); -void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); -void VKAPI_CALL vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); -void VKAPI_CALL vkCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdOpticalFlowExecuteNV(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV *pExecuteInfo); -void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); -void VKAPI_CALL vkCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo); -void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues); -void VKAPI_CALL vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites); -void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData); -void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -void VKAPI_CALL vkCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask); -void VKAPI_CALL vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask); -void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions); -void VKAPI_CALL vkCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo); -void VKAPI_CALL vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo); -void VKAPI_CALL vkCmdSetAlphaToCoverageEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable); -void VKAPI_CALL vkCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable); -void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask); -void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); -void VKAPI_CALL vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void *pCheckpointMarker); -void VKAPI_CALL vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders); -void VKAPI_CALL vkCmdSetColorBlendAdvancedEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT *pColorBlendAdvanced); -void VKAPI_CALL vkCmdSetColorBlendEnableEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32 *pColorBlendEnables); -void VKAPI_CALL vkCmdSetColorBlendEquationEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT *pColorBlendEquations); -void VKAPI_CALL vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32 *pColorWriteEnables); -void VKAPI_CALL vkCmdSetColorWriteMaskEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags *pColorWriteMasks); -void VKAPI_CALL vkCmdSetConservativeRasterizationModeEXT(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode); -void VKAPI_CALL vkCmdSetCoverageModulationModeNV(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode); -void VKAPI_CALL vkCmdSetCoverageModulationTableEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable); -void VKAPI_CALL vkCmdSetCoverageModulationTableNV(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float *pCoverageModulationTable); -void VKAPI_CALL vkCmdSetCoverageReductionModeNV(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode); -void VKAPI_CALL vkCmdSetCoverageToColorEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable); -void VKAPI_CALL vkCmdSetCoverageToColorLocationNV(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation); -void VKAPI_CALL vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); -void VKAPI_CALL vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); -void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); -void VKAPI_CALL vkCmdSetDepthBias2EXT(VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT *pDepthBiasInfo); -void VKAPI_CALL vkCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable); -void VKAPI_CALL vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable); -void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); -void VKAPI_CALL vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable); -void VKAPI_CALL vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable); -void VKAPI_CALL vkCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); -void VKAPI_CALL vkCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable); -void VKAPI_CALL vkCmdSetDepthClipNegativeOneToOneEXT(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne); -void VKAPI_CALL vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp); -void VKAPI_CALL vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp); -void VKAPI_CALL vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); -void VKAPI_CALL vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); -void VKAPI_CALL vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); -void VKAPI_CALL vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); -void VKAPI_CALL vkCmdSetDescriptorBufferOffsetsEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t *pBufferIndices, const VkDeviceSize *pOffsets); -void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask); -void VKAPI_CALL vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask); -void VKAPI_CALL vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles); -void VKAPI_CALL vkCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable); -void VKAPI_CALL vkCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode); -void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -void VKAPI_CALL vkCmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables); -void VKAPI_CALL vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors); -void VKAPI_CALL vkCmdSetExtraPrimitiveOverestimationSizeEXT(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize); -void VKAPI_CALL vkCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); -void VKAPI_CALL vkCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D *pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); -void VKAPI_CALL vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace); -void VKAPI_CALL vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace); -void VKAPI_CALL vkCmdSetLineRasterizationModeEXT(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode); -void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); -void VKAPI_CALL vkCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable); -void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); -void VKAPI_CALL vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp); -void VKAPI_CALL vkCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable); -void VKAPI_CALL vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints); -VkResult VKAPI_CALL vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL *pMarkerInfo); -VkResult VKAPI_CALL vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL *pOverrideInfo); -VkResult VKAPI_CALL vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo); -void VKAPI_CALL vkCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode); -void VKAPI_CALL vkCmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable); -void VKAPI_CALL vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable); -void VKAPI_CALL vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); -void VKAPI_CALL vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); -void VKAPI_CALL vkCmdSetProvokingVertexModeEXT(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode); -void VKAPI_CALL vkCmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples); -void VKAPI_CALL vkCmdSetRasterizationStreamEXT(VkCommandBuffer commandBuffer, uint32_t rasterizationStream); -void VKAPI_CALL vkCmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable); -void VKAPI_CALL vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable); -void VKAPI_CALL vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize); -void VKAPI_CALL vkCmdSetRepresentativeFragmentTestEnableNV(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable); -void VKAPI_CALL vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT *pSampleLocationsInfo); -void VKAPI_CALL vkCmdSetSampleLocationsEnableEXT(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable); -void VKAPI_CALL vkCmdSetSampleMaskEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask *pSampleMask); -void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetShadingRateImageEnableNV(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable); -void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); -void VKAPI_CALL vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp); -void VKAPI_CALL vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp); -void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); -void VKAPI_CALL vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable); -void VKAPI_CALL vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable); -void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); -void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin); -void VKAPI_CALL vkCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions); -void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes); -void VKAPI_CALL vkCmdSetViewportSwizzleNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV *pViewportSwizzles); -void VKAPI_CALL vkCmdSetViewportWScalingEnableNV(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable); -void VKAPI_CALL vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings); -void VKAPI_CALL vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress); -void VKAPI_CALL vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress); -void VKAPI_CALL vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth); -void VKAPI_CALL vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth); -void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData); -void VKAPI_CALL vkCmdUpdatePipelineIndirectBufferNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); -void VKAPI_CALL vkCmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos); -void VKAPI_CALL vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos); -void VKAPI_CALL vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); -void VKAPI_CALL vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); -void VKAPI_CALL vkCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); -VkResult VKAPI_CALL vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader); -VkResult VKAPI_CALL vkCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfoEXT *pCopyImageToImageInfo); -VkResult VKAPI_CALL vkCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfoEXT *pCopyImageToMemoryInfo); -VkResult VKAPI_CALL vkCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfoEXT *pCopyMemoryToImageInfo); -VkResult VKAPI_CALL vkCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT *pInfo); -VkResult VKAPI_CALL vkCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT *pInfo); -VkResult VKAPI_CALL vkCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT *pInfo); -VkResult VKAPI_CALL vkCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure); -VkResult VKAPI_CALL vkCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure); -VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer); -VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView); -VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool); -VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateCuFunctionNVX(VkDevice device, const VkCuFunctionCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuFunctionNVX *pFunction); -VkResult VKAPI_CALL vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuModuleNVX *pModule); -VkResult VKAPI_CALL vkCreateCudaFunctionNV(VkDevice device, const VkCudaFunctionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaFunctionNV *pFunction); -VkResult VKAPI_CALL vkCreateCudaModuleNV(VkDevice device, const VkCudaModuleCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaModuleNV *pModule); -VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback); -VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger); -VkResult VKAPI_CALL vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation); -VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool); -VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout); -VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate); -VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate); -VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); -VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent); -VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence); -VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer); -VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); -VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView); -VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutNV *pIndirectCommandsLayout); -VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance); -VkResult VKAPI_CALL vkCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap); -VkResult VKAPI_CALL vkCreateOpticalFlowSessionNV(VkDevice device, const VkOpticalFlowSessionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkOpticalFlowSessionNV *pSession); -VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache); -VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout); -VkResult VKAPI_CALL vkCreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot); -VkResult VKAPI_CALL vkCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot); -VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool); -VkResult VKAPI_CALL vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler); -VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion); -VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion); -VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore); -VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule); -VkResult VKAPI_CALL vkCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders); -VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); -VkResult VKAPI_CALL vkCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkValidationCacheEXT *pValidationCache); -VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo); -VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo); -void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage); -VkResult VKAPI_CALL vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation); -void VKAPI_CALL vkDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCudaFunctionNV(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCudaModuleNV(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyOpticalFlowSessionNV(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyShaderEXT(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks *pAllocator); -VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device); -VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer); -VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t *pApiVersion); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pCounterCount, VkPerformanceCounterKHR *pCounters, VkPerformanceCounterDescriptionKHR *pCounterDescriptions); -VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices); -VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); -void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets); -void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo); -VkDeviceAddress VKAPI_CALL vkGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR *pInfo); -VkResult VKAPI_CALL vkGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void *pData); -void VKAPI_CALL vkGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2KHR *pMemoryRequirements); -VkResult VKAPI_CALL vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements); -void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -uint64_t VKAPI_CALL vkGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -uint64_t VKAPI_CALL vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkResult VKAPI_CALL vkGetBufferOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -VkResult VKAPI_CALL vkGetCudaModuleCacheNV(VkDevice device, VkCudaModuleNV module, size_t *pCacheSize, void *pCacheData); -uint32_t VKAPI_CALL vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation); -VkResult VKAPI_CALL vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation); -void VKAPI_CALL vkGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, void *pDescriptor); -void VKAPI_CALL vkGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void **ppData); -void VKAPI_CALL vkGetDescriptorSetLayoutBindingOffsetEXT(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize *pOffset); -void VKAPI_CALL vkGetDescriptorSetLayoutHostMappingInfoVALVE(VkDevice device, const VkDescriptorSetBindingReferenceVALVE *pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping); -void VKAPI_CALL vkGetDescriptorSetLayoutSizeEXT(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize *pLayoutSizeInBytes); -void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport); -void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport); -void VKAPI_CALL vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility); -void VKAPI_CALL vkGetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceBufferMemoryRequirementsKHR(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultCountsEXT *pFaultCounts, VkDeviceFaultInfoEXT *pFaultInfo); -void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures); -void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures); -VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities); -VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes); -void VKAPI_CALL vkGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSubresourceLayoutKHR(VkDevice device, const VkDeviceImageSubresourceInfoKHR *pInfo, VkSubresourceLayout2KHR *pLayout); -void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes); -uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo); -uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo); -void VKAPI_CALL vkGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility); -PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName); -void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue); -void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue); -VkResult VKAPI_CALL vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device, VkRenderPass renderpass, VkExtent2D *pMaxWorkgroupSize); -VkResult VKAPI_CALL vkGetDynamicRenderingTilePropertiesQCOM(VkDevice device, const VkRenderingInfo *pRenderingInfo, VkTilePropertiesQCOM *pProperties); -VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event); -VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence); -VkResult VKAPI_CALL vkGetFramebufferTilePropertiesQCOM(VkDevice device, VkFramebuffer framebuffer, uint32_t *pPropertiesCount, VkTilePropertiesQCOM *pProperties); -void VKAPI_CALL vkGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetImageOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT *pInfo, void *pData); -void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout); -void VKAPI_CALL vkGetImageSubresourceLayout2EXT(VkDevice device, VkImage image, const VkImageSubresource2KHR *pSubresource, VkSubresourceLayout2KHR *pLayout); -void VKAPI_CALL vkGetImageSubresourceLayout2KHR(VkDevice device, VkImage image, const VkImageSubresource2KHR *pSubresource, VkSubresourceLayout2KHR *pLayout); -VkResult VKAPI_CALL vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties); -uint32_t VKAPI_CALL vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo); -VkResult VKAPI_CALL vkGetImageViewOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT *pInfo, void *pData); -PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName); -void VKAPI_CALL vkGetLatencyTimingsNV(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo); -VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties); -VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *pGetWin32HandleInfo, HANDLE *pHandle); -VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties); -void VKAPI_CALL vkGetMicromapBuildSizesEXT(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT *pBuildInfo, VkMicromapBuildSizesInfoEXT *pSizeInfo); -VkResult VKAPI_CALL vkGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL *pValue); -VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainEXT *pTimeDomains); -VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesKHR *pProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesNV *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t *pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT *pMultisampleProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceOpticalFlowImageFormatsNV(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo, uint32_t *pFormatCount, VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pRectCount, VkRect2D *pRects); -void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo, uint32_t *pNumPasses); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t *pCombinationCount, VkFramebufferMixedSamplesCombinationNV *pCombinations); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported); -VkResult VKAPI_CALL vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties); -VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); -VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations); -VkResult VKAPI_CALL vkGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR *pPipelineInfo, uint32_t *pExecutableCount, VkPipelineExecutablePropertiesKHR *pProperties); -VkResult VKAPI_CALL vkGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pStatisticCount, VkPipelineExecutableStatisticKHR *pStatistics); -VkDeviceAddress VKAPI_CALL vkGetPipelineIndirectDeviceAddressNV(VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV *pInfo); -void VKAPI_CALL vkGetPipelineIndirectMemoryRequirementsNV(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties); -void VKAPI_CALL vkGetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData); -void VKAPI_CALL vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData); -VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags); -void VKAPI_CALL vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointData2NV *pCheckpointData); -void VKAPI_CALL vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointDataNV *pCheckpointData); -VkResult VKAPI_CALL vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkResult VKAPI_CALL vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkResult VKAPI_CALL vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkDeviceSize VKAPI_CALL vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader); -void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity); -void VKAPI_CALL vkGetRenderingAreaGranularityKHR(VkDevice device, const VkRenderingAreaInfoKHR *pRenderingAreaInfo, VkExtent2D *pGranularity); -VkResult VKAPI_CALL vkGetSamplerOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkResult VKAPI_CALL vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); -VkResult VKAPI_CALL vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); -VkResult VKAPI_CALL vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t *pInfoSize, void *pInfo); -void VKAPI_CALL vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, VkShaderModuleIdentifierEXT *pIdentifier); -void VKAPI_CALL vkGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT *pIdentifier); -VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages); -VkResult VKAPI_CALL vkGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo); -VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); -VkResult VKAPI_CALL vkLatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV *pSleepInfo); -VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); -VkResult VKAPI_CALL vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData); -VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches); -VkResult VKAPI_CALL vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT *pSrcCaches); -void VKAPI_CALL vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo); -VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence); -void VKAPI_CALL vkQueueEndDebugUtilsLabelEXT(VkQueue queue); -void VKAPI_CALL vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo); -VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo); -VkResult VKAPI_CALL vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration); -VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue); -VkResult VKAPI_CALL vkReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration); -void VKAPI_CALL vkReleaseProfilingLockKHR(VkDevice device); -VkResult VKAPI_CALL vkReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo); -VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); -VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); -VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); -VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event); -VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences); -void VKAPI_CALL vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -void VKAPI_CALL vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo); -VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo); -void VKAPI_CALL vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority); -VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event); -void VKAPI_CALL vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata); -void VKAPI_CALL vkSetLatencyMarkerNV(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo); -VkResult VKAPI_CALL vkSetLatencySleepModeNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV *pSleepModeInfo); -VkResult VKAPI_CALL vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data); -VkResult VKAPI_CALL vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data); -VkResult VKAPI_CALL vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo); -VkResult VKAPI_CALL vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo); -void VKAPI_CALL vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData); -VkResult VKAPI_CALL vkTransitionImageLayoutEXT(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfoEXT *pTransitions); -void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); -void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); -void VKAPI_CALL vkUninitializePerformanceApiINTEL(VkDevice device); -void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory); -VkResult VKAPI_CALL vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo); -void VKAPI_CALL vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData); -void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData); -void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies); -VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout); -VkResult VKAPI_CALL vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout); -VkResult VKAPI_CALL vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout); -VkResult VKAPI_CALL vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout); -VkResult VKAPI_CALL vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, size_t dataSize, void *pData, size_t stride); -VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, size_t dataSize, void *pData, size_t stride); -#endif /* VK_NO_PROTOTYPES */ - -#endif /* __WINE_VULKAN_H */ diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h deleted file mode 100644 index 116c379528b..00000000000 --- a/include/wine/vulkan_driver.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2023 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_DRIVER_H -#define __WINE_VULKAN_DRIVER_H - -/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ -#define WINE_VULKAN_DRIVER_VERSION 11 - -struct vulkan_funcs -{ - /* Vulkan global functions. These are the only calls at this point a graphics driver - * needs to provide. Other function calls will be provided indirectly by dispatch - * tables part of dispatchable Vulkan objects such as VkInstance or vkDevice. - */ - VkResult (*p_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); - VkResult (*p_vkCreateSwapchainKHR)(VkDevice, const VkSwapchainCreateInfoKHR *, const VkAllocationCallbacks *, VkSwapchainKHR *); - VkResult (*p_vkCreateWin32SurfaceKHR)(VkInstance, const VkWin32SurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *); - void (*p_vkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); - void (*p_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); - void (*p_vkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); - VkResult (*p_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); - VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); - void * (*p_vkGetDeviceProcAddr)(VkDevice, const char *); - void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *); - VkResult (*p_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *); - VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *); - VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *); - VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); - VkResult (*p_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); - VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); - - /* winevulkan specific functions */ - VkSurfaceKHR (*p_wine_get_host_surface)(VkSurfaceKHR); -}; - -static inline void *get_vulkan_driver_device_proc_addr( - const struct vulkan_funcs *vulkan_funcs, const char *name) -{ - if (!name || name[0] != 'v' || name[1] != 'k') return NULL; - - name += 2; - - if (!strcmp(name, "CreateSwapchainKHR")) - return vulkan_funcs->p_vkCreateSwapchainKHR; - if (!strcmp(name, "DestroySwapchainKHR")) - return vulkan_funcs->p_vkDestroySwapchainKHR; - if (!strcmp(name, "GetDeviceGroupSurfacePresentModesKHR")) - return vulkan_funcs->p_vkGetDeviceGroupSurfacePresentModesKHR; - if (!strcmp(name, "GetDeviceProcAddr")) - return vulkan_funcs->p_vkGetDeviceProcAddr; - if (!strcmp(name, "GetSwapchainImagesKHR")) - return vulkan_funcs->p_vkGetSwapchainImagesKHR; - if (!strcmp(name, "QueuePresentKHR")) - return vulkan_funcs->p_vkQueuePresentKHR; - - return NULL; -} - -static inline void *get_vulkan_driver_instance_proc_addr( - const struct vulkan_funcs *vulkan_funcs, VkInstance instance, const char *name) -{ - if (!name || name[0] != 'v' || name[1] != 'k') return NULL; - - name += 2; - - if (!strcmp(name, "CreateInstance")) - return vulkan_funcs->p_vkCreateInstance; - if (!strcmp(name, "EnumerateInstanceExtensionProperties")) - return vulkan_funcs->p_vkEnumerateInstanceExtensionProperties; - - if (!instance) return NULL; - - if (!strcmp(name, "CreateWin32SurfaceKHR")) - return vulkan_funcs->p_vkCreateWin32SurfaceKHR; - if (!strcmp(name, "DestroyInstance")) - return vulkan_funcs->p_vkDestroyInstance; - if (!strcmp(name, "DestroySurfaceKHR")) - return vulkan_funcs->p_vkDestroySurfaceKHR; - if (!strcmp(name, "GetInstanceProcAddr")) - return vulkan_funcs->p_vkGetInstanceProcAddr; - if (!strcmp(name, "GetPhysicalDevicePresentRectanglesKHR")) - return vulkan_funcs->p_vkGetPhysicalDevicePresentRectanglesKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2KHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceCapabilities2KHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceFormats2KHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormats2KHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfacePresentModesKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceSupportKHR; - if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) - return vulkan_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR; - - name -= 2; - - return get_vulkan_driver_device_proc_addr(vulkan_funcs, name); -} - -#endif /* __WINE_VULKAN_DRIVER_H */ diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h index 93ebe7d7f46..0f3ade153f2 100644 --- a/include/wine/wgl_driver.h +++ b/include/wine/wgl_driver.h @@ -7,7 +7,7 @@ #define WINE_GLAPI #endif -#define WINE_WGL_DRIVER_VERSION 23 +#define WINE_WGL_DRIVER_VERSION 24 struct wgl_context; struct wgl_pbuffer; diff --git a/include/winnt.h b/include/winnt.h index 20db9a8aabd..7f2a5f7b18b 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1470,6 +1470,14 @@ typedef struct _XSTATE_CONFIGURATION ULONG64 EnabledUserVisibleSupervisorFeatures; } XSTATE_CONFIGURATION, *PXSTATE_CONFIGURATION; +typedef struct _XSAVE_AREA_HEADER +{ + DWORD64 Mask; + DWORD64 CompactionMask; + DWORD64 Reserved2[6]; +} +XSAVE_AREA_HEADER, *PXSAVE_AREA_HEADER; + typedef struct _YMMCONTEXT { M128A Ymm0; @@ -1515,6 +1523,11 @@ typedef struct _CONTEXT_EX #endif } CONTEXT_EX, *PCONTEXT_EX; +#define CONTEXT_EXCEPTION_ACTIVE 0x08000000 +#define CONTEXT_SERVICE_ACTIVE 0x10000000 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000 + #define CONTEXT_ARM 0x0200000 #define CONTEXT_ARM_CONTROL (CONTEXT_ARM | 0x00000001) #define CONTEXT_ARM_INTEGER (CONTEXT_ARM | 0x00000002) @@ -6056,6 +6069,7 @@ typedef struct _RTL_CRITICAL_SECTION { #define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO 0x1000000 #define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN 0x2000000 #define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT 0x4000000 +#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO 0x10000000 #define RTL_CRITICAL_SECTION_ALL_FLAG_BITS 0xFF000000 #define RTL_CRITICAL_SECTION_FLAG_RESERVED (RTL_CRITICAL_SECTION_ALL_FLAG_BITS & ~0x7000000) diff --git a/include/winternl.h b/include/winternl.h index ff8756211a1..d151719f898 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2991,6 +2991,12 @@ typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION UCHAR TableBuffer[1]; } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION; +typedef struct _SYSTEM_PROCESS_ID_INFORMATION +{ + void *ProcessId; + UNICODE_STRING ImageName; +} SYSTEM_PROCESS_ID_INFORMATION, *PSYSTEM_PROCESS_ID_INFORMATION; + typedef struct _TIME_FIELDS { CSHORT Year; CSHORT Month; @@ -3589,7 +3595,19 @@ typedef enum _SYSDBG_COMMAND { SysDbgReadMsr, SysDbgWriteMsr, SysDbgReadBusData, - SysDbgWriteBusData + SysDbgWriteBusData, + SysDbgCheckLowMemory, + SysDbgEnableKernelDebugger, + SysDbgDisableKernelDebugger, + SysDbgGetAutoKdEnable, + SysDbgSetAutoKdEnable, + SysDbgGetPrintBufferSize, + SysDbgSetPrintBufferSize, + SysDbgGetKdUmExceptionEnable, + SysDbgSetKdUmExceptionEnable, + SysDbgGetTriageDump, + SysDbgGetKdBlockEnable, + SysDbgSetKdBlockEnable, } SYSDBG_COMMAND, *PSYSDBG_COMMAND; typedef struct _CPTABLEINFO @@ -5087,6 +5105,7 @@ NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PC /* Wine internal functions */ +NTSYSAPI NTSTATUS WINAPI __wine_set_unix_env( const char *var, const char *val ); NTSYSAPI NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, UINT disposition ); NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size ); diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index a6f350ea2fc..7e91015f19e 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -72,6 +72,21 @@ coclass CWMAEncMediaObject {} ] coclass AACMFTEncoder {} +[ + uuid(01f36ce2-0907-4d8b-979d-f151be91c883) +] +coclass CFrameRateConvertDmo {} + +[ + uuid(1ea1ea14-48f4-4054-ad1a-e8aee10ac805) +] +coclass CResizerDMO {} + +[ + uuid(798059f0-89ca-4160-b325-aeb48efe4f9a) +] +coclass CColorControlDmo {} + [ uuid(98230571-0087-4204-b020-3282538e57d3) ] diff --git a/include/xinput.h b/include/xinput.h index f7c291630cb..96efae1858d 100644 --- a/include/xinput.h +++ b/include/xinput.h @@ -210,6 +210,16 @@ typedef struct _XINPUT_CAPABILITIES { XINPUT_VIBRATION Vibration; } XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; +typedef struct _XINPUT_CAPABILITIES_EX +{ + XINPUT_CAPABILITIES Capabilities; + WORD VendorId; + WORD ProductId; + WORD VersionNumber; + WORD unk1; + DWORD unk2; +} XINPUT_CAPABILITIES_EX, *PXINPUT_CAPABILITIES_EX; + /* * Defines the structure for a joystick input event which is * retrieved using the function XInputGetKeystroke @@ -237,6 +247,7 @@ DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*); DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*); DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE); DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*); +DWORD WINAPI XInputGetCapabilitiesEx(DWORD, DWORD, DWORD, XINPUT_CAPABILITIES_EX*); DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*); DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*); diff --git a/libs/faudio/include/FAudio.h b/libs/faudio/include/FAudio.h index 1a873ca2064..16837c39dbf 100644 --- a/libs/faudio/include/FAudio.h +++ b/libs/faudio/include/FAudio.h @@ -1064,6 +1064,11 @@ FAUDIOAPI void FAudioVoice_GetOutputMatrix( /* Removes this voice from the audio graph and frees memory. */ FAUDIOAPI void FAudioVoice_DestroyVoice(FAudioVoice *voice); +/* + * Returns S_OK on success and E_FAIL if voice could not be destroyed (e. g., because it is in use). + */ +FAUDIOAPI uint32_t FAudioVoice_DestroyVoiceSafeEXT(FAudioVoice *voice); + /* FAudioSourceVoice Interface */ /* Starts processing for a source voice. diff --git a/libs/faudio/src/FAudio.c b/libs/faudio/src/FAudio.c index 9366ad58208..67cbfb770e4 100644 --- a/libs/faudio/src/FAudio.c +++ b/libs/faudio/src/FAudio.c @@ -2265,11 +2265,71 @@ void FAudioVoice_GetOutputMatrix( LOG_API_EXIT(voice->audio) } -void FAudioVoice_DestroyVoice(FAudioVoice *voice) +static uint32_t check_for_sends_to_voice(FAudioVoice *voice) { + FAudio *audio = voice->audio; + uint32_t ret = 0; + FAudioSourceVoice *source; + FAudioSubmixVoice *submix; + LinkedList *list; uint32_t i; + + FAudio_PlatformLockMutex(audio->sourceLock); + list = audio->sources; + while (list != NULL) + { + source = (FAudioSourceVoice*) list->entry; + for (i = 0; i < source->sends.SendCount; i += 1) + if (source->sends.pSends[i].pOutputVoice == voice) + { + ret = 0x80004005; /* E_FAIL */ + break; + } + if (ret) + break; + list = list->next; + } + FAudio_PlatformUnlockMutex(audio->sourceLock); + + if (ret) + return ret; + + FAudio_PlatformLockMutex(audio->submixLock); + list = audio->submixes; + while (list != NULL) + { + submix = (FAudioSubmixVoice*) list->entry; + for (i = 0; i < submix->sends.SendCount; i += 1) + if (submix->sends.pSends[i].pOutputVoice == voice) + { + ret = 0x80004005; /* E_FAIL */ + break; + } + if (ret) + break; + list = list->next; + } + FAudio_PlatformUnlockMutex(audio->submixLock); + + return ret; +} + +uint32_t FAudioVoice_DestroyVoiceSafeEXT(FAudioVoice *voice) +{ + uint32_t i, ret; LOG_API_ENTER(voice->audio) + if ((ret = check_for_sends_to_voice(voice))) + { + LOG_ERROR( + voice->audio, + "Voice %p is an output for other voice(s)", + voice + ) + LOG_API_EXIT(voice->audio) + return ret; + } + /* TODO: Check for dependencies and remove from audio graph first! */ FAudio_OPERATIONSET_ClearAllForVoice(voice); @@ -2443,6 +2503,12 @@ void FAudioVoice_DestroyVoice(FAudioVoice *voice) LOG_API_EXIT(voice->audio) FAudio_Release(voice->audio); voice->audio->pFree(voice); + return 0; +} + +void FAudioVoice_DestroyVoice(FAudioVoice *voice) +{ + FAudioVoice_DestroyVoiceSafeEXT(voice); } /* FAudioSourceVoice Interface */ diff --git a/libs/faudio/src/FAudio_internal.c b/libs/faudio/src/FAudio_internal.c index f0d46cfa4b6..7ce57d52a16 100644 --- a/libs/faudio/src/FAudio_internal.c +++ b/libs/faudio/src/FAudio_internal.c @@ -212,9 +212,9 @@ void LinkedList_RemoveEntry( FAudioFreeFunc pFree ) { LinkedList *latest, *prev; + FAudio_PlatformLockMutex(lock); latest = *start; prev = latest; - FAudio_PlatformLockMutex(lock); while (latest != NULL) { if (latest->entry == toRemove) diff --git a/libs/faudio/src/FAudio_platform_win32.c b/libs/faudio/src/FAudio_platform_win32.c index c45b4a2f4f2..01a3a84d5e0 100644 --- a/libs/faudio/src/FAudio_platform_win32.c +++ b/libs/faudio/src/FAudio_platform_win32.c @@ -1300,6 +1300,7 @@ static void FAudio_INTERNAL_DecodeWMAMF( uint32_t FAudio_WMADEC_init(FAudioSourceVoice *voice, uint32_t type) { static const uint8_t fake_codec_data[16] = {0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + uint8_t fake_codec_data_wma3[18] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0}; const FAudioWaveFormatExtensible *wfx = (FAudioWaveFormatExtensible *)voice->src.format; struct FAudioWMADEC *impl; MFT_OUTPUT_STREAM_INFO info = {0}; @@ -1361,11 +1362,17 @@ uint32_t FAudio_WMADEC_init(FAudioSourceVoice *voice, uint32_t type) FAudio_assert(!FAILED(hr) && "Failed set input block align!"); break; case FAUDIO_FORMAT_WMAUDIO3: + *(uint16_t *)fake_codec_data_wma3 = voice->src.format->wBitsPerSample; + for (i = 0; i < voice->src.format->nChannels; i++) + { + fake_codec_data_wma3[2] <<= 1; + fake_codec_data_wma3[2] |= 1; + } hr = IMFMediaType_SetBlob( media_type, &MF_MT_USER_DATA, - (void *)&wfx->Samples, - wfx->Format.cbSize + (void *)fake_codec_data_wma3, + sizeof(fake_codec_data_wma3) ); FAudio_assert(!FAILED(hr) && "Failed set codec private data!"); hr = IMFMediaType_SetGUID( diff --git a/libs/strmbase/filter.c b/libs/strmbase/filter.c index ee41611a198..97157478e20 100644 --- a/libs/strmbase/filter.c +++ b/libs/strmbase/filter.c @@ -226,6 +226,8 @@ static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, v { *out = &filter->IBaseFilter_iface; } + else if (IsEqualIID(iid, &IID_IPropertyBag)) + *out = &filter->IPropertyBag_iface; else { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -509,6 +511,51 @@ static const IBaseFilterVtbl filter_vtbl = filter_QueryVendorInfo, }; +static inline struct strmbase_filter *impl_from_IPropertyBag(IPropertyBag *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_filter, IPropertyBag_iface); +} + +static HRESULT WINAPI property_bag_QueryInterface(IPropertyBag *iface, REFIID iid, void **out) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_QueryInterface(filter->outer_unk, iid, out); +} + +static ULONG WINAPI property_bag_AddRef(IPropertyBag *iface) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_AddRef(filter->outer_unk); +} + +static ULONG WINAPI property_bag_Release(IPropertyBag *iface) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_Release(filter->outer_unk); +} + +static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value, + IErrorLog *error_log) +{ + FIXME("iface %p, prop_name %s, value %p, error_log %p stub!\n", iface, debugstr_w(prop_name), value, error_log); + return E_NOTIMPL; +} + +static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value) +{ + FIXME("iface %p, prop_name %s, value %p stub!\n", iface, debugstr_w(prop_name), value); + return S_OK; +} + +static const IPropertyBagVtbl property_bag_vtbl = +{ + property_bag_QueryInterface, + property_bag_AddRef, + property_bag_Release, + property_bag_Read, + property_bag_Write, +}; + VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) { InterlockedIncrement(&filter->pin_version); @@ -520,6 +567,7 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, memset(filter, 0, sizeof(*filter)); filter->IBaseFilter_iface.lpVtbl = &filter_vtbl; + filter->IPropertyBag_iface.lpVtbl = &property_bag_vtbl; filter->IUnknown_inner.lpVtbl = &filter_inner_vtbl; filter->outer_unk = outer ? outer : &filter->IUnknown_inner; filter->refcount = 1; diff --git a/loader/main.c b/loader/main.c index c258e025183..5a208cc048c 100644 --- a/loader/main.c +++ b/loader/main.c @@ -38,7 +38,8 @@ extern char **environ; -/* the preloader will set this variable */ +/* the preloader will set these variables */ +__attribute((visibility("default"))) struct r_debug *wine_r_debug = NULL; const __attribute((visibility("default"))) struct wine_preload_info *wine_main_preload_info = NULL; /* canonicalize path and return its directory name */ diff --git a/loader/preloader.c b/loader/preloader.c index d0551bae63a..f27d6df8c17 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -79,12 +79,16 @@ #ifdef HAVE_ELF_H # include #endif + +/* define _r_debug so we can re-define it as r_debug_extended */ +#define _r_debug no_r_debug; #ifdef HAVE_LINK_H # include #endif #ifdef HAVE_SYS_LINK_H # include #endif +#undef _r_debug #include "wine/asm.h" #include "main.h" @@ -1387,6 +1391,39 @@ static void set_process_name( int argc, char *argv[] ) for (i = 1; i < argc; i++) argv[i] -= off; } +struct wld_r_debug_extended +{ + struct r_debug base; + struct wld_r_debug_extended *r_next; +}; + +/* GDB integration, _r_debug_state is *required* for GDB to hook the preloader */ +__attribute((visibility("default"))) void _r_debug_state(void) {} +__attribute((visibility("default"))) struct wld_r_debug_extended _r_debug = {{0}}; + +/* sets the preloader r_debug address into DT_DEBUG */ +static void init_r_debug( struct wld_auxv *av ) +{ + ElfW(Phdr) *phdr, *ph; + ElfW(Dyn) *dyn = NULL; + char *l_addr; + int phnum; + + _r_debug.base.r_version = 2; + _r_debug.base.r_brk = (ElfW(Addr))_r_debug_state; + + if (!(phnum = get_auxiliary( av, AT_PHNUM, 0 ))) return; + if (!(phdr = (void *)get_auxiliary( av, AT_PHDR, 0 ))) return; + l_addr = (char *)phdr - sizeof(ElfW(Ehdr)); + _r_debug.base.r_ldbase = (ElfW(Addr))l_addr; + + for (ph = phdr; ph < &phdr[phnum]; ++ph) if (ph->p_type == PT_DYNAMIC) break; + if (ph >= &phdr[phnum]) return; + + dyn = (void *)(ph->p_vaddr + l_addr); + while (dyn->d_tag != DT_DEBUG && dyn->d_tag != DT_NULL) dyn++; + if (dyn->d_tag == DT_DEBUG) dyn->d_un.d_ptr = (uintptr_t)&_r_debug; +} /* * wld_start @@ -1403,6 +1440,7 @@ void* wld_start( void **stack ) struct wld_auxv new_av[8], delete_av[3], *av; struct wld_link_map main_binary_map, ld_so_map; struct wine_preload_info **wine_main_preload_info; + struct r_debug *ld_so_r_debug, **wine_r_debug; pargc = *stack; argv = (char **)pargc + 1; @@ -1432,6 +1470,8 @@ void* wld_start( void **stack ) dump_auxiliary( av ); #endif + init_r_debug( av ); + /* reserve memory that Wine needs */ if (reserve) preload_reserve( reserve ); for (i = 0; preload_info[i].size; i++) @@ -1470,6 +1510,17 @@ void* wld_start( void **stack ) interp = (char *)main_binary_map.l_addr + main_binary_map.l_interp; map_so_lib( interp, &ld_so_map ); + /* expose ld.so _r_debug as a separate namespace in r_next */ + ld_so_r_debug = find_symbol( &ld_so_map, "_r_debug", STT_OBJECT ); + if (ld_so_r_debug) _r_debug.r_next = (struct wld_r_debug_extended *)ld_so_r_debug; + else wld_printf( "_r_debug not found in ld.so\n" ); + + _r_debug_state(); /* notify GDB that _r_debug is ready */ + + wine_r_debug = find_symbol( &main_binary_map, "wine_r_debug", STT_OBJECT ); + if (wine_r_debug) *wine_r_debug = &_r_debug.base; + else wld_printf( "wine_r_debug not found\n" ); + /* store pointer to the preload info into the appropriate main binary variable */ wine_main_preload_info = find_symbol( &main_binary_map, "wine_main_preload_info", STT_OBJECT ); if (wine_main_preload_info) *wine_main_preload_info = preload_info; diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 40549bb34aa..1e5b16a53a6 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -89,13 +89,17 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages,\ Printing,\ Services, \ SessionMgr,\ Tapi,\ ThemeManager,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + NVIDIANGX, \ + ProtonOverrides,\ + SteamClient [DefaultInstall.ntamd64] RegisterDlls=RegisterDllsSection @@ -114,13 +118,17 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages.ntamd64,\ Printing,\ Services, \ SessionMgr,\ Tapi,\ ThemeManager,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + NVIDIANGX, \ + ProtonOverrides,\ + SteamClient.ntamd64 [DefaultInstall.ntarm64] RegisterDlls=RegisterDllsSection @@ -139,6 +147,7 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages.ntarm64,\ Printing,\ Services, \ SessionMgr,\ @@ -158,9 +167,13 @@ AddReg=\ DirectX,\ MCI,\ Misc,\ + Packages.wow64,\ Tapi,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + NVIDIANGX, \ + ProtonOverrides,\ + SteamClient.ntamd64 [Wow64Install.ntarm] RegisterDlls=RegisterDllsSection @@ -196,6 +209,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.NT.Services] AddService=BITS,0,BITSService @@ -216,6 +230,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.ntamd64.Services] AddService=BITS,0,BITSService @@ -236,6 +251,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.ntarm64.Services] AddService=BITS,0,BITSService @@ -256,6 +272,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [Strings] MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions" @@ -264,6 +281,8 @@ CurrentVersion="Software\Microsoft\Windows\CurrentVersion" CurrentVersionNT="Software\Microsoft\Windows NT\CurrentVersion" FontSubStr="Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" Control="System\CurrentControlSet\Control" +FontsNT="Software\Microsoft\Windows NT\CurrentVersion\Fonts" +Packages="Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Packages" [Classes] HKCR,.chm,,2,"chm.file" @@ -332,6 +351,7 @@ HKCR,ftp\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,http\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,https\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,mailto\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" +HKCR,steam\shell\open\command,,,"""%16426%\Steam\Steam.exe"" -- ""%1""" [ContentIndex] HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}" @@ -359,7 +379,7 @@ HKCU,%CurrentVersion%\Run,,16 HKCU,%CurrentVersionNT%\Winlogon,,16 HKLM,%CurrentVersion%,"CommonFilesDir",,"%16427%" HKLM,%CurrentVersion%,"FirstInstallDateTime",1,21,81,7c,23 -HKLM,%CurrentVersion%,"ProductId",,"12345-oem-0000001-54321" +HKLM,%CurrentVersion%,"ProductId",,"00330-50000-00000-AAOEM" HKLM,%CurrentVersion%,"ProgramFilesDir",,"%16422%" HKLM,%CurrentVersion%,"ProgramFilesPath",0x20000,"%%ProgramFiles%%" HKLM,%CurrentVersion%,"RegisteredOrganization",2,"" @@ -384,7 +404,7 @@ HKLM,%CurrentVersion%\Shell Extensions\Approved,,16 HKLM,%CurrentVersion%\Time Zones,"SymbolicLinkValue",0x60000,"\Registry\Machine\%CurrentVersionNT%\Time Zones" HKLM,%CurrentVersion%\Uninstall,,16 HKLM,%CurrentVersionNT%,"InstallDate",0x10003,1273299354 -HKLM,%CurrentVersionNT%,"ProductId",,"12345-oem-0000001-54321" +HKLM,%CurrentVersionNT%,"ProductId",,"00330-50000-00000-AAOEM" HKLM,%CurrentVersionNT%,"RegisteredOrganization",2,"" HKLM,%CurrentVersionNT%,"RegisteredOwner",2,"" HKLM,%CurrentVersionNT%,"SystemRoot",,"%10%" @@ -414,6 +434,9 @@ HKLM,%CurrentVersionNT%\Ports,,16 HKLM,%CurrentVersionNT%\Print,,16 HKLM,%CurrentVersionNT%\ProfileList,,16 HKLM,%CurrentVersionNT%\Winlogon,"Shell",,"explorer.exe" +;; App specific heap debug flags +HKLM,%CurrentVersionNT%\Image File Execution Options\ChaosCode.exe,GlobalFlag,0x00040002,0x00000020 +HKLM,%CurrentVersionNT%\Image File Execution Options\Crysis2Remastered.exe,GlobalFlag,0x00040002,0x00000020 [CurrentVersionWow64.ntamd64] HKLM,%CurrentVersion%,"ProgramFilesDir (x86)",,"%16426%" @@ -441,6 +464,7 @@ HKLM,%CurrentVersionNT%\AeDebug,"Debugger",2,"winedbg --auto %ld %ld" HKLM,%CurrentVersionNT%\AeDebug,"Auto",2,"1" HKCU,Software\Wine\Debug,"RelayExclude",2,"ntdll.RtlEnterCriticalSection;ntdll.RtlTryEnterCriticalSection;ntdll.RtlLeaveCriticalSection;kernel32.48;kernel32.49;kernel32.94;kernel32.95;kernel32.96;kernel32.97;kernel32.98;kernel32.TlsGetValue;kernel32.TlsSetValue;kernel32.FlsGetValue;kernel32.FlsSetValue;kernel32.SetLastError" HKCU,Software\Wine\Debug,"RelayFromExclude",2,"winex11.drv;winemac.drv;user32;gdi32;advapi32;kernel32" +HKCU,Software\Wine\WineDbg,"ShowCrashDialog",0x00010003,0x00000000 [DirectX] HKLM,Software\Microsoft\DirectX,"Version",,"4.09.00.0904" @@ -490,6 +514,51 @@ HKLM,%Control%\Session Manager\Environment,"windir",0x00020000,"%SystemRoot%" HKLM,%Control%\Session Manager\Environment,"winsysdir",,"%11%" HKLM,%Control%\Session Manager\Memory Management,PagingFiles,,"%24%\pagefile.sys 27 77" HKLM,%Control%\Session Manager\Memory Management,WriteWatch,0x00040002,1 +;;KnownDLLs +HKLM,%Control%\Session Manager\KnownDLLs,"_wow64cpu",,"wow64cpu.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"_wowarmhw",,"wowarmhw.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"_xtajit",,"_xtajit.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"advapi32",,"advapi32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"clbcatq",,"clbcatq.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"combase",,"combase.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"COMDLG32",,"COMDLG32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"coml2",,"coml2.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"DifxApi",,"difxapi.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdi32",,"gdi32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdiplus",,"gdiplus.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"IMAGEHLP",,"IMAGEHLP.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"IMM32",,"IMM32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"kernel32",,"kernel32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"MSCTF",,"MSCTF.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"MSVCRT",,"MSVCRT.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"NORMALIZ",,"NORMALIZ.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"NSI",,"NSI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"ole32",,"ole32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"OLEAUT32",,"OLEAUT32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"PSAPI",,"PSAPI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"rpcrt4",,"rpcrt4.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"sechost",,"sechost.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"Setupapi",,"Setupapi.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHCORE",,"SHCORE.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHELL32",,"SHELL32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHLWAPI",,"SHLWAPI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"user32",,"user32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"wow64",,"wow64.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"wow64win",,"wow64win.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WS2_32",,"WS2_32.dll" +;;KnownDLLs not present in registry on Windows but present in \\KnownDLLs directory +HKLM,%Control%\Session Manager\KnownDLLs,"ucrtbase",,"ucrtbase.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"msvcp_win",,"msvcp_win.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"bcrypt",,"bcrypt.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"COMCTL32",,"COMCTL32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"cfgmgr32",,"cfgmgr32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"ntdll",,"ntdll.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"bcryptPrimitives",,"bcryptPrimitives.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"win32u",,"win32u.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdi32full",,"gdi32full.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WINTRUST",,"WINTRUST.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"CRYPT32",,"CRYPT32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WLDAP32",,"WLDAP32.dll" [Fonts] HKLM,%FontSubStr%,"Arial Baltic,186",,"Arial,186" @@ -512,6 +581,29 @@ HKLM,%FontSubStr%,"Times New Roman CYR,204",,"Times New Roman,204" HKLM,%FontSubStr%,"Times New Roman Greek,161",,"Times New Roman,161" HKLM,%FontSubStr%,"Times New Roman TUR,162",,"Times New Roman,162" HKLM,System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts,"LogPixels",0x10003,0x00000060 +HKLM,%FontsNT%,"Arial (TrueType)",,"arial.ttf" +HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" +HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" +HKLM,%FontsNT%,"Courier New Bold (TrueType)",,"courbd.ttf" +HKLM,%FontsNT%,"Malgun Gothic (TrueType)",,"malgun.ttf" +HKLM,%FontsNT%,"Marlett (TrueType)",,"marlett.ttf" +HKLM,%FontsNT%,"Microsoft Sans Serif (TrueType)",,"micross.ttf" +HKLM,%FontsNT%,"MS Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"MS PGothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"MS UI Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"Microsoft YaHei (TrueType)",,"msyh.ttf" +HKLM,%FontsNT%,"Nirmala UI (TrueType)",,"nirmala.ttf" +HKLM,%FontsNT%,"SimSun (TrueType)",,"simsun.ttc" +HKLM,%FontsNT%,"NSimSun (TrueType)",,"simsun.ttc" +HKLM,%FontsNT%,"Symbol (TrueType)",,"symbol.ttf" +HKLM,%FontsNT%,"Tahoma (TrueType)",,"tahoma.ttf" +HKLM,%FontsNT%,"Tahoma Bold (TrueType)",,"tahomabd.ttf" +HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" +HKLM,%FontsNT%,"Webdings (TrueType)",,"webdings.ttf" +HKLM,%FontsNT%,"Wingdings (TrueType)",,"wingdings.ttf" +HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" +HKCU,Software\Wine\Fonts\Replacements,"Verdana",,"Times New Roman" +HKCU,Software\Wine\Fonts\Replacements,"Segoe UI",,"Times New Roman" [MCI] HKLM,%Mci32Str%,"AVIVideo",,"mciavi32.dll" @@ -632,6 +724,18 @@ HKCU,Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserCho HKLM,"Software\Microsoft\OLE","EnableDCOM",,"Y" HKLM,"Software\Microsoft\OLE","EnableRemoteConnect",,"N" +[Packages] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x86__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + +[Packages.ntamd64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x64__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + +[Packages.wow64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x86__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\syswow64" + +[Packages.arm64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_arm64__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + [Printing] HKLM,%Control%\Print\Monitors\Local Port,"Driver",2,"localspl.dll" HKLM,%Control%\Print\Printers,"DefaultSpoolDirectory",2,"%11%\spool\printers" @@ -2348,6 +2452,15 @@ LoadOrderGroup="System Bus Extender" [NsiProxyServiceKeys] HKR,,"Tag",0x10001,1 +[SharedGpuResourcesService] +Description="Shared GPU Resources Manager Service" +DisplayName="Shared GPU Resources Manager" +ServiceBinary="%12%\sharedgpures.sys" +ServiceType=1 +StartType=2 +ErrorControl=1 +LoadOrderGroup="System Bus Extender" + [RpcSsService] Description="RPC service" DisplayName="Remote Procedure Call (RPC)" @@ -2492,7 +2605,6 @@ StartType=3 ErrorControl=1 [Services] -HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" HKLM,"System\CurrentControlSet\Services\Eventlog\Application",,16 HKLM,"System\CurrentControlSet\Services\Eventlog\System","Sources",0x10000,"" HKLM,"System\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath",,"%12%\etc" @@ -2507,15 +2619,17 @@ HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0 HKLM,%CurrentVersionNT%,"CurrentBuild",2,"19043" HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"19043" HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free" -HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\ +HKLM,%CurrentVersionNT%,"DigitalProductId",2,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKLM,%CurrentVersionNT%,"DisplayVersion",2,"21H1" HKLM,%CurrentVersionNT%,"EditionId",2,"Professional" HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro" +HKLM,%CurrentVersionNT%,"ReleaseId",,"2009" HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT" HKLM,%Control%\Windows,"CSDVersion",0x10003,0 HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT" @@ -2702,3 +2816,88 @@ EtcFiles = 12,etc InfFiles = 17 NlsFiles = 11 SortFiles = 10,globalization\sorting + +[SteamClient] +HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" +HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" +HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16422%\Steam\steamclient.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16422%\Steam" + +[SteamClient.ntamd64] +HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" +HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" +HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16426%\Steam\steamclient.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll64",,"%16426%\Steam\steamclient64.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16426%\Steam" +HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" + +[NVIDIANGX] +HKLM,Software\NVIDIA Corporation\Global\NGXCore,"FullPath",,"C:\Windows\System32" + +[ProtonOverrides] +HKLM,Software\Khronos\OpenXR\1,"ActiveRuntime",,"C:\openxr\wineopenxr64.json" +;;Likely want *80 and *90 too, but those require removing Wine's manifest files. +HKCU,Software\Wine\DllOverrides,"atl100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-conio-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-heap-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-locale-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-math-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-runtime-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-stdio-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-time-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"concrt140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140_atomic_wait",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"ucrtbase",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" +HKCU,Software\Wine\DllOverrides,"nvcuda",0x2,"disabled" +;;App-specific overrides to limit the number of resolutions +HKCU,Software\Wine\AppDefaults\DarkSoulsIII.exe\X11 Driver,"LimitNumberOfResolutions",0x2,"32" +HKCU,Software\Wine\AppDefaults\sekiro.exe\X11 Driver,"LimitNumberOfResolutions",0x2,"32" +HKCU,Software\Wine\AppDefaults\NieRAutomata.exe\X11 Driver,"LimitNumberOfResolutions",0x2,"32" +HKCU,Software\Wine\AppDefaults\SpellForce.exe\X11 Driver,"LimitNumberOfResolutions",0x2,"16" +;;Other app-specific overrides +HKCU,Software\Wine\AppDefaults\Pentiment.exe\DllOverrides,"SpeechSynthesisWrapper",,"disabled" +HKCU,Software\Wine\AppDefaults\Maine-Win64-Shipping.exe\DllOverrides,"SpeechSynthWrapper",0x2,"disabled" +HKCU,Software\Wine\AppDefaults\rayne1.exe\DllOverrides,"d3d8",,"native" +HKCU,Software\Wine\AppDefaults\rayne2.exe\DllOverrides,"d3d8",,"native" +HKCU,Software\Wine\AppDefaults\RDR2.exe\DllOverrides,"vulkan-1",,"native" +HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"amd_ags_x64",,"disabled" +;;App-specific overrides for atiadlxx.dll. +HKCU,Software\Wine\AppDefaults\s2_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\s2_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\h1_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\h1_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\iw7_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\Paradox Launcher.exe\DllOverrides,,4, +HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\msedgewebview2.exe,"Version",,"win81" +HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\Spider-Man.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\RiftApart.exe\DllOverrides,"atiadlxx",,"builtin" +HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Height",0x10001,480 +HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Width",0x10001,640 diff --git a/programs/belauncher/Makefile.in b/programs/belauncher/Makefile.in new file mode 100644 index 00000000000..927983f7423 --- /dev/null +++ b/programs/belauncher/Makefile.in @@ -0,0 +1,7 @@ +MODULE = belauncher.exe +IMPORTS = shlwapi shcore + +EXTRADLLFLAGS = -mwindows -municode + +SOURCES = \ + main.c \ diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c new file mode 100644 index 00000000000..213378fd108 --- /dev/null +++ b/programs/belauncher/main.c @@ -0,0 +1,182 @@ +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(belauncher); + +int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) +{ + char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe = NULL, *be_arg = NULL; + WCHAR path[MAX_PATH], *p, config_path[MAX_PATH], game_exeW[MAX_PATH], **argvW; + LARGE_INTEGER launcher_cfg_size; + unsigned char battleye_status; + int game_exe_len, arg_len, path_len; + PROCESS_INFORMATION pi; + HANDLE launcher_cfg; + LPWSTR launch_cmd; + STARTUPINFOW si = {0}; + int i, argc; + DWORD size; + BOOL wow64; + + battleye_status = 0x3; /* Starting */ + _write(1, &battleye_status, 1); + + *path = 0; + if ((size = GetEnvironmentVariableW(L"PROTON_ORIG_LAUNCHER_NAME", path, ARRAY_SIZE(path))) && size <= ARRAY_SIZE(path)) + { + WINE_TRACE("PROTON_ORIG_LAUNCHER_NAME %s.\n", wine_dbgstr_w(path)); + + for (p = path + wcslen(path); p != path; --p) + if (*p == '\\') break; + if (*p == '\\') + ++p; + *p = 0; + } + + wcscpy(config_path, path); + wcscat(config_path, L"Battleye\\BELauncher.ini"); + launcher_cfg = CreateFileW(config_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (launcher_cfg == INVALID_HANDLE_VALUE) + { + *path = 0; + launcher_cfg = CreateFileW(L"Battleye\\BELauncher.ini", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + } + if (launcher_cfg == INVALID_HANDLE_VALUE) + { + WINE_ERR("BELauncher.ini not found.\n"); + goto start_failed; + } + + if(!GetFileSizeEx(launcher_cfg, &launcher_cfg_size) || launcher_cfg_size.u.HighPart) + { + CloseHandle(launcher_cfg); + goto start_failed; + } + + configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart); + + if (!ReadFile(launcher_cfg, configs, launcher_cfg_size.u.LowPart, &size, NULL) || size != launcher_cfg_size.u.LowPart) + { + CloseHandle(launcher_cfg); + HeapFree( GetProcessHeap(), 0, configs ); + goto start_failed; + } + + CloseHandle(launcher_cfg); + + config = configs; + do + { + if (!strncmp(config, "32BitExe=", 9)) + arch_32_exe = config + 9; + + if (!strncmp(config, "64BitExe=", 9)) + arch_64_exe = config + 9; + + if (!strncmp(config, "BEArg=", 6)) + be_arg = config + 6; + } + while ((config = strchr(config, '\n')) && *(config++)); + + *game_exeW = 0; + game_exe_len = 0; + + if ((argvW = CommandLineToArgvW(cmdline, &argc))) + { + for (i = 0; i < argc; ++i) + { + if (!wcscmp(argvW[i], L"-exe") && i < argc - 1) + { + wcscpy(game_exeW, argvW[i + 1]); + game_exe_len = wcslen(game_exeW); + break; + } + } + } + + if (!*game_exeW) + { + if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) + game_exe = arch_64_exe; + else if (arch_32_exe) + game_exe = arch_32_exe; + else + { + HeapFree( GetProcessHeap(), 0, configs ); + WINE_ERR("Failed to find game executable name from BattlEye config.\n"); + goto start_failed; + } + + if (strchr(game_exe, '\r')) + *(strchr(game_exe, '\r')) = 0; + if (strchr(game_exe, '\n')) + *(strchr(game_exe, '\n')) = 0; + game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, game_exeW, ARRAY_SIZE(game_exeW)); + if (!game_exe_len) + { + WINE_ERR("Failed to convert game_exe %s.\n", wine_dbgstr_a(game_exe)); + goto start_failed; + } + --game_exe_len; + } + + if (!be_arg) arg_len = 0; + else + { + if (strchr(be_arg, '\r')) + *(strchr(be_arg, '\r')) = 0; + if (strchr(be_arg, '\n')) + *(strchr(be_arg, '\n')) = 0; + arg_len = MultiByteToWideChar(CP_ACP, 0, be_arg, -1, NULL, 0) - 1; + } + + WINE_TRACE("Launching game executable %s for BattlEye.\n", game_exe); + battleye_status = 0x9; /* Launching Game */ + _write(1, &battleye_status, 1); + + if (PathIsRelativeW(game_exeW)) + path_len = wcslen(path); + else + path_len = 0; + + launch_cmd = HeapAlloc(GetProcessHeap(), 0, (path_len + game_exe_len + 1 + wcslen(cmdline) + 1 + arg_len + 1) * sizeof(WCHAR)); + + memcpy(launch_cmd, path, path_len * sizeof(*path)); + + memcpy(launch_cmd + path_len, game_exeW, game_exe_len * sizeof(*launch_cmd)); + launch_cmd[path_len + game_exe_len] = ' '; + + wcscpy(launch_cmd + path_len + game_exe_len + 1, cmdline); + launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = ' '; + + if (!MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1)) + launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = 0; + + WINE_TRACE("game_exe %s, cmdline %s.\n", wine_dbgstr_w(game_exeW), wine_dbgstr_w(cmdline)); + WINE_TRACE("path %s, be_arg %s.\n", wine_dbgstr_w(path), wine_dbgstr_a(be_arg)); + WINE_TRACE("launch_cmd %s.\n", wine_dbgstr_w(launch_cmd)); + + if (!CreateProcessW(NULL, launch_cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) + { + WINE_ERR("CreateProcessW failed.\n"); + battleye_status = 0xA; /* Launch Failed */ + _write(1, &battleye_status, 1); + return GetLastError(); + } + HeapFree( GetProcessHeap(), 0, launch_cmd ); + + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hProcess); + return 0; + +start_failed: + WINE_ERR("Failed.\n"); + battleye_status = 0x4; /* Start Failed */ + _write(1, &battleye_status, 1); + return 0; +} diff --git a/programs/dotnetfx35/Makefile.in b/programs/dotnetfx35/Makefile.in new file mode 100644 index 00000000000..91d0876db61 --- /dev/null +++ b/programs/dotnetfx35/Makefile.in @@ -0,0 +1,7 @@ +MODULE = dotnetfx35.exe +IMPORTS = + +EXTRADLLFLAGS = -mwindows -mno-cygwin + +SOURCES = \ + main.c diff --git a/programs/dotnetfx35/main.c b/programs/dotnetfx35/main.c new file mode 100644 index 00000000000..cd6df5bcf41 --- /dev/null +++ b/programs/dotnetfx35/main.c @@ -0,0 +1,32 @@ +/* + * Fake dotnetfx35.exe installer + * + * Copyright 2020 Rémi Bernon + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dotnetfx); + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + FIXME("stub!"); + return 0; +} diff --git a/programs/dxdiag/main.c b/programs/dxdiag/main.c index b6ea5306d06..47909dcf2c6 100644 --- a/programs/dxdiag/main.c +++ b/programs/dxdiag/main.c @@ -72,7 +72,13 @@ static BOOL process_file_name(const WCHAR *cmdline, enum output_type output_type endptr = cmdline + lstrlenW(cmdline); len = endptr - cmdline; - if (len == 0 || len >= filename_len) + if (len == 0) + { + *filename = 0; + return TRUE; + } + + if (len >= filename_len) return FALSE; memcpy(filename, cmdline, len * sizeof(WCHAR)); diff --git a/programs/dxdiag/output.c b/programs/dxdiag/output.c index a8eb733ba4b..63d091395b0 100644 --- a/programs/dxdiag/output.c +++ b/programs/dxdiag/output.c @@ -149,8 +149,12 @@ static BOOL output_text_information(struct dxdiag_information *dxdiag_info, cons fill_system_text_output_table(dxdiag_info, output_table[0].fields); - hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (filename && *filename) + hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + else + hFile = GetStdHandle(STD_OUTPUT_HANDLE); + if (hFile == INVALID_HANDLE_VALUE) { WINE_ERR("File creation failed, last error %lu\n", GetLastError()); @@ -207,7 +211,7 @@ static HRESULT save_xml_document(IXMLDOMDocument *xmldoc, const WCHAR *filename) VARIANT destVar; HRESULT hr; - if (!bstr) + if (!bstr || !filename || !*filename) return E_OUTOFMEMORY; V_VT(&destVar) = VT_BSTR; diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 9a58f13d887..fe50586184f 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -1009,6 +1009,78 @@ static inline BOOL is_whitespace(WCHAR c) return c == ' ' || c == '\t'; } +static HANDLE start_tabtip_process(void) +{ + static const WCHAR tabtip_started_event[] = L"TABTIP_STARTED_EVENT"; + PROCESS_INFORMATION pi; + STARTUPINFOW si = { sizeof(si) }; + HANDLE wait_handles[2]; + + if (!CreateProcessW(L"C:\\windows\\system32\\tabtip.exe", NULL, + NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) + { + WINE_ERR("Couldn't start tabtip.exe: error %lu\n", GetLastError()); + return FALSE; + } + CloseHandle(pi.hThread); + + wait_handles[0] = CreateEventW(NULL, TRUE, FALSE, tabtip_started_event); + wait_handles[1] = pi.hProcess; + + /* wait for the event to become available or the process to exit */ + if ((WaitForMultipleObjects(2, wait_handles, FALSE, INFINITE)) == WAIT_OBJECT_0 + 1) + { + DWORD exit_code; + GetExitCodeProcess(pi.hProcess, &exit_code); + WINE_ERR("Unexpected termination of tabtip.exe - exit code %ld\n", exit_code); + CloseHandle(wait_handles[0]); + return pi.hProcess; + } + + CloseHandle(wait_handles[0]); + return pi.hProcess; +} + +static void start_xalia_process(void) +{ + PROCESS_INFORMATION pi; + STARTUPINFOW si = { sizeof(si) }; + WCHAR use_envvar[2]; + LPWSTR path; + LPCWSTR path_suffix = L"/../xalia/xalia.exe"; + DWORD ret, buffersize; + + /* check if xalia is enabled */ + ret = GetEnvironmentVariableW(L"PROTON_USE_XALIA", use_envvar, ARRAY_SIZE(use_envvar)); + if (!ret || (ret <= ARRAY_SIZE(use_envvar) && lstrcmpW(use_envvar, L"0") == 0)) + return; + + /* locate xalia.exe */ + ret = GetEnvironmentVariableW(L"WINEDATADIR", NULL, 0); + if (ret == 0) + return; + + buffersize = ret + lstrlenW(path_suffix); + path = HeapAlloc(GetProcessHeap(), 0, buffersize * sizeof(*path)); + + GetEnvironmentVariableW(L"WINEDATADIR", path, ret); + if (!memcmp(path, L"\\??\\", 8)) path[1] = '\\'; /* change \??\ into \\?\ */ + lstrcatW(path, path_suffix); + + /* setup environment */ + SetEnvironmentVariableW(L"XALIA_WINE_SYSTEM_PROCESS", L"1"); + + if (!CreateProcessW(path, NULL, + NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) + { + WINE_ERR("Couldn't start xalia.exe: error %lu\n", GetLastError()); + return; + } + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + return; +} + /* main desktop management function */ void manage_desktop( WCHAR *arg ) { @@ -1016,6 +1088,7 @@ void manage_desktop( WCHAR *arg ) GUID guid; MSG msg; HWND hwnd; + HANDLE tabtip = NULL; unsigned int width, height; WCHAR *cmdline = NULL, *driver = NULL; WCHAR *p = arg; @@ -1133,6 +1206,11 @@ void manage_desktop( WCHAR *arg ) /* run the desktop message loop */ if (hwnd) { + /* FIXME: hack, run tabtip.exe on startup. */ + tabtip = start_tabtip_process(); + + start_xalia_process(); + TRACE( "desktop message loop starting on hwnd %p\n", hwnd ); while (GetMessageW( &msg, 0, 0, 0 )) DispatchMessageW( &msg ); TRACE( "desktop message loop exiting for hwnd %p\n", hwnd ); @@ -1140,6 +1218,13 @@ void manage_desktop( WCHAR *arg ) if (pShellDDEInit) pShellDDEInit( FALSE ); + if (tabtip) + { + TerminateProcess( tabtip, 0 ); + WaitForSingleObject( tabtip, INFINITE ); + CloseHandle( tabtip ); + } + ExitProcess( 0 ); } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index b012d3ffe72..54f1abbb30f 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -33,6 +33,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(systray); +#define TRAY_MINIMIZE_ALL 419 +#define TRAY_MINIMIZE_ALL_UNDO 416 + struct notify_data /* platform-independent format for NOTIFYICONDATA */ { LONG hWnd; @@ -1059,7 +1062,15 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP break; case WM_COMMAND: - if (HIWORD(wparam) == BN_CLICKED) click_taskbar_button( (HWND)lparam ); + if (HIWORD(wparam) == BN_CLICKED) + { + if (LOWORD(wparam) == TRAY_MINIMIZE_ALL || LOWORD(wparam) == TRAY_MINIMIZE_ALL_UNDO) + { + FIXME( "Shell command %u is not supported.\n", LOWORD(wparam) ); + break; + } + click_taskbar_button( (HWND)lparam ); + } break; case WM_CONTEXTMENU: @@ -1153,7 +1164,7 @@ void initialize_systray( BOOL using_root, BOOL arg_enable_shell ) else { SIZE size = get_window_size(); - tray_window = CreateWindowExW( 0, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, + tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, size.cx, size.cy, 0, 0, 0, 0 ); NtUserMessageCall( tray_window, WINE_SYSTRAY_DOCK_INIT, 0, 0, NULL, NtUserSystemTrayCall, FALSE ); } diff --git a/programs/getminidump/Makefile.in b/programs/getminidump/Makefile.in new file mode 100644 index 00000000000..56d148dfb9d --- /dev/null +++ b/programs/getminidump/Makefile.in @@ -0,0 +1,7 @@ +MODULE = getminidump.exe +IMPORTS = shcore dbghelp + +EXTRADLLFLAGS = -mwindows -municode + +SOURCES = \ + main.c diff --git a/programs/getminidump/main.c b/programs/getminidump/main.c new file mode 100644 index 00000000000..3cc5010797a --- /dev/null +++ b/programs/getminidump/main.c @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include +#include +#include + +int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, WCHAR *cmdline, int nCmdShow) +{ + HANDLE process, dumpfile; + WCHAR **argv, *ptr; + DWORD pid; + int argc; + BOOL ret; + + argv = CommandLineToArgvW(cmdline, &argc); + if (argc < 1) return 1; + + ptr = argv[0]; + if (ptr[0] == '0' && towlower(ptr[1]) == 'x') + pid = wcstoul(ptr, NULL, 16); + else + pid = wcstoul(ptr, NULL, 10); + + process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); + if (!process) + return 2; + + dumpfile = CreateFileW(L"minidump.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (dumpfile == INVALID_HANDLE_VALUE) + { + CloseHandle(process); + return 3; + } + + ret = MiniDumpWriteDump(process, pid, dumpfile, MiniDumpNormal | MiniDumpWithFullMemory, NULL, NULL, NULL); + + CloseHandle(dumpfile); + CloseHandle(process); + + return ret ? 0 : 4; +} diff --git a/programs/powershell/main.c b/programs/powershell/main.c index eb9a64ff0ec..25a4d13d340 100644 --- a/programs/powershell/main.c +++ b/programs/powershell/main.c @@ -24,10 +24,25 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { int i; - WINE_FIXME("stub:"); + WINE_FIXME("stub.\n"); for (i = 0; i < argc; i++) - WINE_FIXME(" %s", wine_dbgstr_w(argv[i])); - WINE_FIXME("\n"); + { + WINE_FIXME("argv[%d] %s\n", i, wine_dbgstr_w(argv[i])); + if (!wcsicmp(argv[i], L"-command") && i < argc - 1 && !wcscmp(argv[i + 1], L"-")) + { + char command[4096], *p; + ++i; + while (fgets(command, sizeof(command), stdin)) + { + WINE_FIXME("command %s.\n", debugstr_a(command)); + p = command; + while (*p && !isspace(*p)) ++p; + *p = 0; + if (!stricmp(command, "exit")) + break; + } + } + } return 0; } diff --git a/programs/tabtip/Makefile.in b/programs/tabtip/Makefile.in new file mode 100644 index 00000000000..5070b74fc4c --- /dev/null +++ b/programs/tabtip/Makefile.in @@ -0,0 +1,7 @@ +MODULE = tabtip.exe +IMPORTS = ole32 user32 uiautomationcore shell32 oleaut32 + +EXTRADLLFLAGS = -mconsole -municode + +SOURCES = \ + tabtip.c diff --git a/programs/tabtip/tabtip.c b/programs/tabtip/tabtip.c new file mode 100644 index 00000000000..8a413aa29ce --- /dev/null +++ b/programs/tabtip/tabtip.c @@ -0,0 +1,438 @@ +/* + * Copyright 2021 Connor McAdams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windows.h" +#define COBJMACROS +#include +#include "uiautomation.h" +#include "ole2.h" +#include "strsafe.h" +#include "oleacc.h" +#include "shellapi.h" +#include +#include + +#include "wine/debug.h" +#ifndef UNICODE +#define UNICODE +#endif + +WINE_DEFAULT_DEBUG_CHANNEL(tabtip); + +static BOOL keyboard_up; +static BOOL use_steam_osk; +static unsigned int steam_app_id; + +struct str_id_pair { + int id; + const char *str; +}; + +static const struct str_id_pair uia_control_type_id_strs[] = { + { UIA_ButtonControlTypeId, "UIA_ButtonControlTypeId", }, + { UIA_CalendarControlTypeId, "UIA_CalendarControlTypeId", }, + { UIA_CheckBoxControlTypeId, "UIA_CheckBoxControlTypeId", }, + { UIA_ComboBoxControlTypeId, "UIA_ComboBoxControlTypeId", }, + { UIA_EditControlTypeId, "UIA_EditControlTypeId", }, + { UIA_HyperlinkControlTypeId, "UIA_HyperlinkControlTypeId", }, + { UIA_ImageControlTypeId, "UIA_ImageControlTypeId", }, + { UIA_ListItemControlTypeId, "UIA_ListItemControlTypeId", }, + { UIA_ListControlTypeId, "UIA_ListControlTypeId", }, + { UIA_MenuControlTypeId, "UIA_MenuControlTypeId", }, + { UIA_MenuBarControlTypeId, "UIA_MenuBarControlTypeId", }, + { UIA_MenuItemControlTypeId, "UIA_MenuItemControlTypeId", }, + { UIA_ProgressBarControlTypeId, "UIA_ProgressBarControlTypeId", }, + { UIA_RadioButtonControlTypeId, "UIA_RadioButtonControlTypeId", }, + { UIA_ScrollBarControlTypeId, "UIA_ScrollBarControlTypeId", }, + { UIA_SliderControlTypeId, "UIA_SliderControlTypeId", }, + { UIA_SpinnerControlTypeId, "UIA_SpinnerControlTypeId", }, + { UIA_StatusBarControlTypeId, "UIA_StatusBarControlTypeId", }, + { UIA_TabControlTypeId, "UIA_TabControlTypeId", }, + { UIA_TabItemControlTypeId, "UIA_TabItemControlTypeId", }, + { UIA_TextControlTypeId, "UIA_TextControlTypeId", }, + { UIA_ToolBarControlTypeId, "UIA_ToolBarControlTypeId", }, + { UIA_ToolTipControlTypeId, "UIA_ToolTipControlTypeId", }, + { UIA_TreeControlTypeId, "UIA_TreeControlTypeId", }, + { UIA_TreeItemControlTypeId, "UIA_TreeItemControlTypeId", }, + { UIA_CustomControlTypeId, "UIA_CustomControlTypeId", }, + { UIA_GroupControlTypeId, "UIA_GroupControlTypeId", }, + { UIA_ThumbControlTypeId, "UIA_ThumbControlTypeId", }, + { UIA_DataGridControlTypeId, "UIA_DataGridControlTypeId", }, + { UIA_DataItemControlTypeId, "UIA_DataItemControlTypeId", }, + { UIA_DocumentControlTypeId, "UIA_DocumentControlTypeId", }, + { UIA_SplitButtonControlTypeId, "UIA_SplitButtonControlTypeId", }, + { UIA_WindowControlTypeId, "UIA_WindowControlTypeId", }, + { UIA_PaneControlTypeId, "UIA_PaneControlTypeId", }, + { UIA_HeaderControlTypeId, "UIA_HeaderControlTypeId", }, + { UIA_HeaderItemControlTypeId, "UIA_HeaderItemControlTypeId", }, + { UIA_TableControlTypeId, "UIA_TableControlTypeId", }, + { UIA_TitleBarControlTypeId, "UIA_TitleBarControlTypeId", }, + { UIA_SeparatorControlTypeId, "UIA_SeparatorControlTypeId", }, + { UIA_SemanticZoomControlTypeId, "UIA_SemanticZoomControlTypeId", }, + { UIA_AppBarControlTypeId, "UIA_AppBarControlTypeId", }, +}; + +static int __cdecl str_id_pair_compare(const void *a, const void *b) +{ + const int *id = a; + const struct str_id_pair *pair = b; + + return ((*id) > pair->id) - ((*id) < pair->id); +} + +#define get_str_for_id(id, id_pair) \ + get_str_from_id_pair( (id), (id_pair), (ARRAY_SIZE(id_pair)) ) +static const char *get_str_from_id_pair(int id, const struct str_id_pair *id_pair, int id_pair_size) +{ + const struct str_id_pair *pair; + + if ((pair = bsearch(&id, id_pair, id_pair_size, sizeof(*pair), str_id_pair_compare))) + return pair->str; + + return ""; +} + +static const WCHAR tabtip_window_class_name[] = L"IPTip_Main_Window"; +static LRESULT CALLBACK tabtip_win_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + return DefWindowProcW(hwnd, msg, wparam, lparam); +} + +#define MAX_LINK_BUF 4096 +struct osk_link_data { + WCHAR link_buf[MAX_LINK_BUF]; + WCHAR *link_buf_pos; + int args_count; +}; + +static void osk_link_init(struct osk_link_data *data, const WCHAR *link) +{ + data->link_buf_pos = data->link_buf; + data->link_buf_pos += wsprintfW(data->link_buf, L"%s", link); + data->args_count = 0; +} + +#define MAX_ARG_BUF 512 +static const WCHAR max_int_arg_str[] = L"=-0000000000"; +static const WCHAR separator_arg_start_str[] = L"?"; +static const WCHAR separator_arg_cont_str[] = L"&"; +static const int max_separator_str_len = max(ARRAY_SIZE(separator_arg_start_str), ARRAY_SIZE(separator_arg_cont_str)); +static void osk_link_add_int_arg(struct osk_link_data *data, const WCHAR *arg, int arg_val) +{ + const WCHAR *separator_str = !data->args_count ? separator_arg_start_str : separator_arg_cont_str; + WCHAR arg_buf[MAX_ARG_BUF] = { 0 }; + int arg_buf_len; + + if ((lstrlenW(arg) + ARRAY_SIZE(max_int_arg_str)) >= MAX_ARG_BUF) + { + ERR("Arg would overflow buffer, suggest upping argument buffer size.\n"); + return; + } + + arg_buf_len = wsprintfW(arg_buf, L"%s=%d", arg, arg_val); + if ((arg_buf_len + (MAX_LINK_BUF - (data->link_buf_pos - data->link_buf)) + max_separator_str_len) >= MAX_LINK_BUF) + { + ERR("Adding another arg would overflow buffer, suggest upping link buffer size.\n"); + return; + } + + data->link_buf_pos += wsprintfW(data->link_buf_pos, L"%s%s", separator_str, arg_buf); + data->args_count++; +} + +/* + * IUIAutomationFocusChangedEventHandler vtbl. + */ +static HRESULT WINAPI FocusChangedHandler_QueryInterface(IUIAutomationFocusChangedEventHandler *iface, + REFIID riid, void **ppv) +{ + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUIAutomationFocusChangedEventHandler) || IsEqualIID(riid, &IID_IUnknown)) + *ppv = iface; + else + return E_NOINTERFACE; + + IUIAutomationFocusChangedEventHandler_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI FocusChangedHandler_AddRef(IUIAutomationFocusChangedEventHandler* iface) +{ + return 2; +} + +static ULONG WINAPI FocusChangedHandler_Release(IUIAutomationFocusChangedEventHandler* iface) +{ + return 1; +} + +static HRESULT WINAPI FocusChangedHandler_HandleFocusChangedEvent(IUIAutomationFocusChangedEventHandler *iface, + IUIAutomationElement *sender) +{ + BOOL is_readonly, has_kbd_focus; + struct osk_link_data link_data = { 0 }; + RECT rect = { 0 }; + BSTR name = NULL; + int control_type; + HRESULT hr; + VARIANT v; + + WINE_TRACE("sender %p\n", sender); + + /* Should never happen, handle it anyways just in case. */ + if (!sender) + return S_OK; + + hr = IUIAutomationElement_get_CachedBoundingRectangle(sender, &rect); + if (FAILED(hr)) WINE_ERR("Failed to get cached bounding rect, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedControlType(sender, &control_type); + if (FAILED(hr)) WINE_ERR("Failed to get cached control type, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedName(sender, &name); + if (FAILED(hr)) WINE_ERR("Failed to get cached name, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedHasKeyboardFocus(sender, &has_kbd_focus); + if (FAILED(hr)) WINE_ERR("Failed to get cached has keyboard focus property, hr %#lx\n", hr); + + VariantInit(&v); + hr = IUIAutomationElement_GetCachedPropertyValueEx(sender, UIA_ValueIsReadOnlyPropertyId, TRUE, &v); + if (FAILED(hr)) WINE_ERR("Failed to get cached property value for UIA_ValueIsReadOnlyPropertyId, hr %#lx\n", hr); + is_readonly = ((V_VT(&v) == VT_BOOL) && (V_BOOL(&v) == VARIANT_TRUE)); + VariantClear(&v); + + if (use_steam_osk && (control_type == UIA_EditControlTypeId) && has_kbd_focus && !is_readonly) + { + osk_link_init(&link_data, L"steam://open/keyboard"); + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + if (rect.left || rect.top || rect.right || rect.bottom) + { + osk_link_add_int_arg(&link_data, L"XPosition", rect.left); + osk_link_add_int_arg(&link_data, L"YPosition", rect.top); + osk_link_add_int_arg(&link_data, L"Width", (rect.right - rect.left)); + osk_link_add_int_arg(&link_data, L"Height", (rect.bottom - rect.top)); + osk_link_add_int_arg(&link_data, L"Mode", 0); + } + + WINE_TRACE("Keyboard up!\n"); + keyboard_up = TRUE; + } + else if (keyboard_up) + { + osk_link_init(&link_data, L"steam://close/keyboard"); + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + + WINE_TRACE("Keyboard down!\n"); + keyboard_up = FALSE; + } + + if (use_steam_osk && link_data.link_buf_pos && (link_data.link_buf_pos != link_data.link_buf)) + ShellExecuteW(NULL, NULL, link_data.link_buf, NULL, NULL, SW_SHOWNOACTIVATE); + + WINE_TRACE("name %s, control_type %d (%s), rect %s, has_kbd_focus %d, is_readonly %d\n", wine_dbgstr_w(name), + control_type, get_str_for_id(control_type, uia_control_type_id_strs), wine_dbgstr_rect(&rect), + has_kbd_focus, is_readonly); + SysFreeString(name); + + return S_OK; +} + +static const IUIAutomationFocusChangedEventHandlerVtbl FocusChangedHandlerVtbl = { + FocusChangedHandler_QueryInterface, + FocusChangedHandler_AddRef, + FocusChangedHandler_Release, + FocusChangedHandler_HandleFocusChangedEvent, +}; + +static IUIAutomationFocusChangedEventHandler FocusChangedHandler = { &FocusChangedHandlerVtbl }; + +static const int uia_cache_props[] = { UIA_BoundingRectanglePropertyId, UIA_ControlTypePropertyId, UIA_NamePropertyId, + UIA_HasKeyboardFocusPropertyId, UIA_ValueIsReadOnlyPropertyId, }; +static HRESULT add_uia_event_handler(IUIAutomation **uia_iface) +{ + IUIAutomationCacheRequest *cache_req = NULL; + IUIAutomationCondition *true_cond = NULL; + HRESULT hr; + int i; + + hr = CoCreateInstance(&CLSID_CUIAutomation8, NULL, CLSCTX_INPROC_SERVER, &IID_IUIAutomation, (void **)uia_iface); + if (FAILED(hr)) + { + ERR("Failed to create IUIAutomation interface, hr %#lx\n", hr); + return hr; + } + + hr = IUIAutomation_CreateCacheRequest(*uia_iface, &cache_req); + if (FAILED(hr)) + goto exit; + + hr = IUIAutomation_CreateTrueCondition(*uia_iface, &true_cond); + if (FAILED(hr)) + goto exit; + + hr = IUIAutomationCacheRequest_put_TreeFilter(cache_req, true_cond); + if (FAILED(hr)) + goto exit; + + for (i = 0; i < ARRAY_SIZE(uia_cache_props); i++) + { + hr = IUIAutomationCacheRequest_AddProperty(cache_req, uia_cache_props[i]); + if (FAILED(hr)) + { + ERR("Failed to add prop_id %d to cache req, hr %#lx\n", uia_cache_props[i], hr); + goto exit; + } + } + + hr = IUIAutomation_AddFocusChangedEventHandler(*uia_iface, cache_req, &FocusChangedHandler); + if (FAILED(hr)) + ERR("Failed to add focus changed event handler, hr %#lx\n", hr); + +exit: + if (cache_req) + IUIAutomationCacheRequest_Release(cache_req); + if (true_cond) + IUIAutomationCondition_Release(true_cond); + + return hr; +} + +static const char *osk_disable_appids[] = { + "1182900", /* A Plague Tale: Requiem */ + "752590", /* A Plague Tale: Innocence */ +}; + +static void tabtip_use_osk_check(void) +{ + const char *var = getenv("SteamDeck"); + + if (var && !strcmp(var, "1")) + use_steam_osk = TRUE; + else + use_steam_osk = FALSE; + + if ((var = getenv("SteamAppId"))) + { + int i; + + for (i = 0; i < ARRAY_SIZE(osk_disable_appids); i++) + { + if (!strcmp(var, osk_disable_appids[i])) + { + WINE_TRACE("Disabling OSK auto-popup for appid %s\n", var); + use_steam_osk = FALSE; + break; + } + } + steam_app_id = strtol(var, NULL, 10); + } + + WINE_TRACE("use_steam_osk=%d\n", use_steam_osk); +} + +int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) +{ + HANDLE wine_exit_event, started_event; + IUIAutomation *uia_iface = NULL; + WNDCLASSW wc = { }; + int ret = 0; + HWND hwnd; + + keyboard_up = FALSE; + tabtip_use_osk_check(); + + wine_exit_event = started_event = NULL; + NtSetInformationProcess( GetCurrentProcess(), ProcessWineMakeProcessSystem, + &wine_exit_event, sizeof(HANDLE *) ); + started_event = CreateEventW(NULL, TRUE, FALSE, L"TABTIP_STARTED_EVENT"); + if (!wine_exit_event || !started_event) + { + ERR("Failed to create event handles!\n"); + ret = -1; + goto exit; + } + + if (FAILED(CoInitializeEx(NULL, COINIT_MULTITHREADED))) + { + ERR("CoInitialize failed!\n"); + ret = -1; + goto exit; + } + + SetEvent(started_event); + + if (FAILED(add_uia_event_handler(&uia_iface))) + { + ret = -1; + goto exit; + } + + wc.lpfnWndProc = tabtip_win_proc; + wc.hInstance = hInstance; + wc.lpszClassName = tabtip_window_class_name; + RegisterClassW(&wc); + + hwnd = CreateWindowExW(0, tabtip_window_class_name, + L"Input", WS_OVERLAPPEDWINDOW, 4, 4, 0, 0, NULL, + NULL, hInstance, NULL); + + if (!hwnd) + { + ERR("Failed to create hwnd!\n"); + UnregisterClassW(tabtip_window_class_name, hInstance); + ret = -1; + goto exit; + } + + while (MsgWaitForMultipleObjects(1, &wine_exit_event, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) + { + BOOL quit = FALSE; + MSG msg; + + while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) + { + switch (msg.message) + { + case WM_QUIT: /* Unlikely to ever happen, but handle anyways. */ + quit = TRUE; + break; + + default: + TranslateMessage(&msg); + DispatchMessageW(&msg); + break; + } + } + + if (quit) + break; + } + +exit: + if (uia_iface) + { + IUIAutomation_RemoveAllEventHandlers(uia_iface); + IUIAutomation_Release(uia_iface); + } + + CoUninitialize(); + if (wine_exit_event) CloseHandle(wine_exit_event); + if (started_event) CloseHandle(started_event); + + return ret; +} diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in index 7c61102c40e..6ffab89d2da 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -1,6 +1,6 @@ MODULE = wineboot.exe IMPORTS = uuid advapi32 ws2_32 kernelbase -DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev +DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev crypt32 EXTRADLLFLAGS = -mconsole diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index c16446cf289..ff6bd6cc38c 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,7 @@ #include #include #include +#include #include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(wineboot); @@ -193,10 +195,27 @@ static DWORD set_reg_value_dword( HKEY hkey, const WCHAR *name, DWORD value ) #if defined(__i386__) || defined(__x86_64__) +extern UINT64 WINAPI do_xgetbv( unsigned int cx); +#ifdef __i386__ +__ASM_STDCALL_FUNC( do_xgetbv, 4, + "movl 4(%esp),%ecx\n\t" + "xgetbv\n\t" + "ret $4" ) +#else +__ASM_GLOBAL_FUNC( do_xgetbv, + "xgetbv\n\t" + "shlq $32,%rdx\n\t" + "orq %rdx,%rax\n\t" + "ret" ) +#endif + static void initialize_xstate_features(struct _KUSER_SHARED_DATA *data) { + static const ULONG64 wine_xstate_supported_features = 0xfc; /* XSTATE_AVX, XSTATE_MPX_BNDREGS, XSTATE_MPX_BNDCSR, + * XSTATE_AVX512_KMASK, XSTATE_AVX512_ZMM_H, XSTATE_AVX512_ZMM */ XSTATE_CONFIGURATION *xstate = &data->XState; - unsigned int i; + ULONG64 supported_mask; + unsigned int i, off; int regs[4]; if (!data->ProcessorFeatures[PF_AVX_INSTRUCTIONS_AVAILABLE]) @@ -215,29 +234,40 @@ static void initialize_xstate_features(struct _KUSER_SHARED_DATA *data) __cpuidex(regs, 0xd, 0); TRACE("XSAVE details %#x, %#x, %#x, %#x.\n", regs[0], regs[1], regs[2], regs[3]); - if (!(regs[0] & XSTATE_AVX)) + supported_mask = ((ULONG64)regs[3] << 32) | regs[0]; + supported_mask &= do_xgetbv(0) & wine_xstate_supported_features; + if (!(supported_mask >> 2)) return; - xstate->EnabledFeatures = (1 << XSTATE_LEGACY_FLOATING_POINT) | (1 << XSTATE_LEGACY_SSE) | (1 << XSTATE_AVX); + xstate->EnabledFeatures = (1 << XSTATE_LEGACY_FLOATING_POINT) | (1 << XSTATE_LEGACY_SSE) | supported_mask; xstate->EnabledVolatileFeatures = xstate->EnabledFeatures; - xstate->Size = sizeof(XSAVE_FORMAT) + sizeof(XSTATE); xstate->AllFeatureSize = regs[1]; - xstate->AllFeatures[0] = offsetof(XSAVE_FORMAT, XmmRegisters); - xstate->AllFeatures[1] = sizeof(M128A) * 16; - xstate->AllFeatures[2] = sizeof(YMMCONTEXT); - - for (i = 0; i < 3; ++i) - xstate->Features[i].Size = xstate->AllFeatures[i]; - - xstate->Features[1].Offset = xstate->Features[0].Size; - xstate->Features[2].Offset = sizeof(XSAVE_FORMAT) + offsetof(XSTATE, YmmContext); __cpuidex(regs, 0xd, 1); xstate->OptimizedSave = regs[0] & 1; xstate->CompactionEnabled = !!(regs[0] & 2); - __cpuidex(regs, 0xd, 2); - TRACE("XSAVE feature 2 %#x, %#x, %#x, %#x.\n", regs[0], regs[1], regs[2], regs[3]); + xstate->Features[0].Size = xstate->AllFeatures[0] = offsetof(XSAVE_FORMAT, XmmRegisters); + xstate->Features[1].Size = xstate->AllFeatures[1] = sizeof(M128A) * 16; + xstate->Features[1].Offset = xstate->Features[0].Size; + off = sizeof(XSAVE_FORMAT) + sizeof(XSAVE_AREA_HEADER); + supported_mask >>= 2; + for (i = 2; supported_mask; ++i, supported_mask >>= 1) + { + if (!(supported_mask & 1)) continue; + __cpuidex( regs, 0xd, i ); + xstate->Features[i].Offset = regs[1]; + xstate->Features[i].Size = xstate->AllFeatures[i] = regs[0]; + if (regs[2] & 2) + { + xstate->AlignedFeatures |= (ULONG64)1 << i; + off = (off + 63) & ~63; + } + off += xstate->Features[i].Size; + TRACE("xstate[%d] offset %lu, size %lu, aligned %d.\n", i, xstate->Features[i].Offset, xstate->Features[i].Size, !!(regs[2] & 2)); + } + xstate->Size = xstate->CompactionEnabled ? off : xstate->Features[i - 1].Offset + xstate->Features[i - 1].Size; + TRACE("xstate size %lu, compacted %d, optimized %d.\n", xstate->Size, xstate->CompactionEnabled, xstate->OptimizedSave); } static BOOL is_tsc_trusted_by_the_kernel(void) @@ -332,7 +362,13 @@ static UINT64 read_tsc_frequency(void) } while (error > 500 && --retries); - if (!retries) WARN( "TSC frequency calibration failed, unstable TSC?\n" ); + if (!retries) + { + FIXME( "TSC frequency calibration failed, unstable TSC?"); + FIXME( "time0 %I64u ns, time1 %I64u ns\n", time0 * 100, time1 * 100 ); + FIXME( "tsc2 - tsc0 %I64u, tsc3 - tsc1 %I64u\n", tsc2 - tsc0, tsc3 - tsc1 ); + FIXME( "freq0 %I64u Hz, freq2 %I64u Hz, error %I64u ppm\n", freq0, freq1, error ); + } else { freq = (freq0 + freq1) / 2; @@ -1425,37 +1461,6 @@ static BOOL start_services_process(void) return TRUE; } -static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) -{ - switch (msg) - { - case WM_INITDIALOG: - { - DWORD len; - WCHAR *buffer, text[1024]; - const WCHAR *name = (WCHAR *)lp; - HICON icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 48, 48, LR_SHARED ); - SendDlgItemMessageW( hwnd, IDC_WAITICON, STM_SETICON, (WPARAM)icon, 0 ); - SendDlgItemMessageW( hwnd, IDC_WAITTEXT, WM_GETTEXT, 1024, (LPARAM)text ); - len = lstrlenW(text) + lstrlenW(name) + 1; - buffer = malloc( len * sizeof(WCHAR) ); - swprintf( buffer, len, text, name ); - SendDlgItemMessageW( hwnd, IDC_WAITTEXT, WM_SETTEXT, 0, (LPARAM)buffer ); - free( buffer ); - } - break; - } - return 0; -} - -static HWND show_wait_window(void) -{ - HWND hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0, - wait_dlgproc, (LPARAM)prettyprint_configdir() ); - ShowWindow( hwnd, SW_SHOWNORMAL ); - return hwnd; -} - static HANDLE start_rundll32( const WCHAR *inf_path, const WCHAR *install, WORD machine ) { WCHAR app[MAX_PATH + ARRAY_SIZE(L"\\rundll32.exe" )]; @@ -1573,6 +1578,55 @@ static void update_user_profile(void) LocalFree(sid); } +static void update_win_version(void) +{ + static const WCHAR win10_buildW[] = L"19043"; + static const WCHAR win10_ntW[] = L"6.3"; + + HKEY cv_h; + DWORD type, sz; + WCHAR current_version[256]; + + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &cv_h) == ERROR_SUCCESS){ + /* get the current windows version */ + sz = sizeof(current_version); + if(RegQueryValueExW(cv_h, L"CurrentVersion", NULL, &type, (BYTE *)current_version, &sz) == ERROR_SUCCESS && + type == REG_SZ){ + if(!wcscmp(current_version, L"6.3") || !wcscmp(current_version, L"10.0")){ + RegSetValueExW(cv_h, L"CurrentVersion", 0, REG_SZ, (const BYTE *)win10_ntW, sizeof(win10_ntW)); + RegSetValueExW(cv_h, L"CurrentBuild", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + RegSetValueExW(cv_h, L"CurrentBuildNumber", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + } + } + RegCloseKey(cv_h); + } + + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Wow6432Node\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &cv_h) == ERROR_SUCCESS){ + /* get the current windows version */ + sz = sizeof(current_version); + if(RegQueryValueExW(cv_h, L"CurrentVersion", NULL, &type, (BYTE *)current_version, &sz) == ERROR_SUCCESS && + type == REG_SZ){ + if(!wcscmp(current_version, L"6.3") || !wcscmp(current_version, L"10.0")){ + RegSetValueExW(cv_h, L"CurrentVersion", 0, REG_SZ, (const BYTE *)win10_ntW, sizeof(win10_ntW)); + RegSetValueExW(cv_h, L"CurrentBuild", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + RegSetValueExW(cv_h, L"CurrentBuildNumber", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + } + } + RegCloseKey(cv_h); + } +} + +static void update_root_certs(void) +{ + HCERTSTORE store; + + store = CertOpenStore( CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, CERT_STORE_OPEN_EXISTING_FLAG + | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE, L"Root"); + CertCloseStore( store, 0 ); +} + /* execute rundll32 on the wine.inf file if necessary */ static void update_wineprefix( BOOL force ) { @@ -1606,7 +1660,6 @@ static void update_wineprefix( BOOL force ) if ((process = start_rundll32( inf_path, L"PreInstall", IMAGE_FILE_MACHINE_TARGET_HOST ))) { - HWND hwnd = show_wait_window(); for (;;) { if (process) @@ -1627,10 +1680,11 @@ static void update_wineprefix( BOOL force ) process = start_rundll32( inf_path, L"Wow64Install", machines[count].Machine ); count++; } - DestroyWindow( hwnd ); } install_root_pnp_devices(); update_user_profile(); + update_win_version(); + update_root_certs(); WINE_MESSAGE( "wine: configuration in %s has been updated.\n", debugstr_w(prettyprint_configdir()) ); } @@ -1732,6 +1786,52 @@ static void usage( int status ) exit( status ); } +static void create_digitalproductid(void) +{ + BYTE digital_product_id[0xa4]; + char product_id[256]; + LSTATUS status; + unsigned int i; + DWORD size; + DWORD type; + HKEY key; + + if ((status = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &key ))) + return; + size = sizeof(product_id); + status = RegQueryValueExA( key, "ProductId", NULL, &type, (BYTE *)product_id, &size ); + if (status) goto done; + if (!size) goto done; + if (product_id[size - 1]) + { + if (size == sizeof(product_id)) goto done; + product_id[size++] = 0; + } + + if (!RegQueryValueExA( key, "DigitalProductId", NULL, &type, NULL, &size ) && size == sizeof(digital_product_id)) + { + if (RegQueryValueExA( key, "DigitalProductId", NULL, &type, digital_product_id, &size )) + goto done; + for (i = 0; i < size; ++i) + if (digital_product_id[i]) break; + if (i < size) goto done; + } + + memset( digital_product_id, 0, sizeof(digital_product_id) ); + *(DWORD *)digital_product_id = sizeof(digital_product_id); + digital_product_id[4] = 3; + strcpy( (char *)digital_product_id + 8, product_id ); + *(DWORD *)(digital_product_id + 0x20) = 0x0cec; + *(DWORD *)(digital_product_id + 0x34) = 0x0cec; + strcpy( (char *)digital_product_id + 0x24, "[TH] X19-99481" ); + digital_product_id[0x42] = 8; + RtlGenRandom( digital_product_id + 0x38, 0x18 ); + RegSetValueExA( key, "DigitalProductId", 0, REG_BINARY, digital_product_id, sizeof(digital_product_id) ); +done: + RegCloseKey( key ); +} + int __cdecl main( int argc, char *argv[] ) { /* First, set the current directory to SystemRoot */ @@ -1842,6 +1942,7 @@ int __cdecl main( int argc, char *argv[] ) } if (init || update) update_wineprefix( update ); + create_digitalproductid(); create_volatile_environment_registry_key(); ProcessRunKeys( HKEY_LOCAL_MACHINE, L"RunOnce", TRUE, TRUE ); diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c index 24416070152..738930e39a6 100644 --- a/programs/winebrowser/main.c +++ b/programs/winebrowser/main.c @@ -63,6 +63,17 @@ static char *strdup_unixcp( const WCHAR *str ) return ret; } +static void restore_system_environment(void) +{ + const char* orig_ld_path = getenv("ORIG_LD_LIBRARY_PATH"); + + if (orig_ld_path) + { + __wine_set_unix_env("LD_LIBRARY_PATH", orig_ld_path); + __wine_set_unix_env("ORIG_LD_LIBRARY_PATH", NULL); + } +} + /* try to launch a unix app from a comma separated string of app names */ static int launch_app( const WCHAR *candidates, const WCHAR *argv1 ) { @@ -72,6 +83,11 @@ static int launch_app( const WCHAR *candidates, const WCHAR *argv1 ) if (!(cmdline = strdup_unixcp( argv1 ))) return 1; + /* PROTON HACK: Restore ORIG_LD_LIBRARY_PATH to LD_LIBRARY_PATH. + * System programs may not work correctly with our libraries, in + * particular gio on Ubuntu 19.04 is broken by our libgio. */ + restore_system_environment(); + while (*candidates) { WCHAR **args = CommandLineToArgvW( candidates, &count ); diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index c65b9bfae67..74c935f42db 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -311,6 +311,8 @@ extern DWORD dbg_curr_tid; extern dbg_ctx_t dbg_context; extern BOOL dbg_interactiveP; extern HANDLE dbg_houtput; +extern HANDLE dbg_crash_report_file; +extern BOOL dbg_use_wine_dbg_output; struct dbg_internal_var { diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 17578857133..23652b77726 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "debugger.h" #include "psapi.h" @@ -816,6 +818,48 @@ static HANDLE create_temp_file(void) NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0 ); } +static HANDLE create_crash_report_file(void) +{ + const char *dir = getenv("WINE_CRASH_REPORT_DIR"); + const char *sgi; + char timestr[32]; + char name[MAX_PATH], *c; + time_t t; + struct tm lt; + + if(!dir || dir[0] == 0) + return INVALID_HANDLE_VALUE; + + strcpy(name, dir); + + for(c = name + 1; *c; ++c){ + if(*c == '/'){ + *c = 0; + CreateDirectoryA(name, NULL); + *c = '/'; + } + } + CreateDirectoryA(name, NULL); + + sgi = getenv("SteamGameId"); + + t = time(NULL); + lt = *localtime(&t); + strftime(timestr, ARRAY_SIZE(timestr), "%Y-%m-%d_%H:%M:%S", <); + + /* /path/to/crash/reports/2021-05-18_13:21:15_appid-976310_crash.log */ + snprintf(name, ARRAY_SIZE(name), + "%s%s/%s_appid-%s_crash.log", + dir[0] == '/' ? "Z:/" : "", + dir, + timestr, + sgi ? sgi : "0" + ); + + return CreateFileA( name, GENERIC_WRITE, FILE_SHARE_READ, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); +} + /****************************************************************** * dbg_active_attach * @@ -907,6 +951,10 @@ enum dbg_start dbg_active_auto(int argc, char* argv[]) if (event) thread = display_crash_details( event ); if (thread) dbg_houtput = output = create_temp_file(); break; + case TRUE: + dbg_use_wine_dbg_output = TRUE; + dbg_crash_report_file = create_crash_report_file(); + break; } input = parser_generate_command_file("echo Modules:", "info share", diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 92fa77429f6..7769d20481d 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -82,6 +82,8 @@ DWORD dbg_curr_pid = 0; dbg_ctx_t dbg_context; BOOL dbg_interactiveP = FALSE; HANDLE dbg_houtput = 0; +HANDLE dbg_crash_report_file = INVALID_HANDLE_VALUE; +BOOL dbg_use_wine_dbg_output = FALSE; static struct list dbg_process_list = LIST_INIT(dbg_process_list); @@ -94,6 +96,9 @@ static void dbg_outputA(const char* buffer, int len) DWORD w, i; + if (dbg_use_wine_dbg_output) + __wine_dbg_output(buffer); + while (len > 0) { unsigned int count = min( len, sizeof(line_buff) - line_pos ); @@ -107,7 +112,10 @@ static void dbg_outputA(const char* buffer, int len) if (len > 0) i = line_pos; /* buffer is full, flush anyway */ else break; } - WriteFile(dbg_houtput, line_buff, i, &w, NULL); + if (!dbg_use_wine_dbg_output) + WriteFile(dbg_houtput, line_buff, i, &w, NULL); + if (dbg_crash_report_file != INVALID_HANDLE_VALUE) + WriteFile(dbg_crash_report_file, line_buff, i, &w, NULL); memmove( line_buff, line_buff + i, line_pos - i ); line_pos -= i; } diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 36569fa9d5f..6d34fa687ad 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1082,7 +1082,8 @@ static HRESULT platform_write_icon(IStream *icoStream, ICONDIRENTRY *iconDirEntr LARGE_INTEGER zero; *nativeIdentifier = compute_native_identifier(exeIndex, icoPathW, destFilename); - iconsDir = heap_wprintf(L"%s\\icons\\hicolor", xdg_data_dir); + iconsDir = heap_wprintf(L"%s", L"c:\\proton_shortcuts\\icons"); + create_directories(iconsDir); for (i = 0; i < numEntries; i++) { @@ -1264,7 +1265,7 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const char *workdir_unix; int needs_chmod = FALSE; const WCHAR *name; - const WCHAR *prefix = _wgetenv( L"WINECONFIGDIR" ); + WCHAR *shortcuts_dir; WINE_TRACE("(%s,%s,%s,%s,%s,%s,%s,%s,%s)\n", wine_dbgstr_w(link), wine_dbgstr_w(location), wine_dbgstr_w(linkname), wine_dbgstr_w(path), wine_dbgstr_w(args), @@ -1272,11 +1273,12 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const wine_dbgstr_w(wmclass)); name = PathFindFileNameW( linkname ); - if (!location) - { - location = heap_wprintf(L"%s\\%s.desktop", xdg_desktop_dir, name); - needs_chmod = TRUE; - } + + shortcuts_dir = heap_wprintf(L"%s", L"c:\\proton_shortcuts"); + create_directories(shortcuts_dir); + location = heap_wprintf(L"%s\\%s.desktop", shortcuts_dir, name); + heap_free(shortcuts_dir); + needs_chmod = TRUE; file = _wfopen( location, L"wb" ); if (file == NULL) @@ -1285,13 +1287,8 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const fprintf(file, "[Desktop Entry]\n"); fprintf(file, "Name=%s\n", wchars_to_utf8_chars(name)); fprintf(file, "Exec=" ); - if (prefix) - { - char *path = wine_get_unix_file_name( prefix ); - fprintf(file, "env WINEPREFIX=\"%s\" ", path); - heap_free( path ); - } - fprintf(file, "wine %s", escape(path)); + + fprintf(file, "%s", escape(path)); if (args) fprintf(file, " %s", escape(args) ); fputc( '\n', file ); fprintf(file, "Type=Application\n"); @@ -1323,100 +1320,6 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const return TRUE; } -static BOOL write_directory_entry(const WCHAR *directory, const WCHAR *location) -{ - FILE *file; - - WINE_TRACE("(%s,%s)\n", wine_dbgstr_w(directory), wine_dbgstr_w(location)); - - file = _wfopen( location, L"wb" ); - if (file == NULL) - return FALSE; - - fprintf(file, "[Desktop Entry]\n"); - fprintf(file, "Type=Directory\n"); - if (wcscmp(directory, L"wine") == 0) - { - fprintf(file, "Name=Wine\n"); - fprintf(file, "Icon=wine\n"); - } - else - { - fprintf(file, "Name=%s\n", wchars_to_utf8_chars(directory)); - fprintf(file, "Icon=folder\n"); - } - - fclose(file); - return TRUE; -} - -static BOOL write_menu_file(const WCHAR *windows_link, const WCHAR *link) -{ - WCHAR tempfilename[MAX_PATH]; - FILE *tempfile = NULL; - WCHAR *filename, *lastEntry, *menuPath; - int i; - int count = 0; - BOOL ret = FALSE; - - WINE_TRACE("(%s)\n", wine_dbgstr_w(link)); - - GetTempFileNameW( xdg_menu_dir, L"mnu", 0, tempfilename ); - if (!(tempfile = _wfopen( tempfilename, L"wb" ))) return FALSE; - - fprintf(tempfile, "\n"); - fprintf(tempfile, "\n"); - fprintf(tempfile, " Applications\n"); - - filename = heap_wprintf(L"wine\\%s.desktop", link); - lastEntry = filename; - for (i = 0; filename[i]; i++) - { - if (filename[i] == '\\') - { - WCHAR *dir_file_name; - const char *prefix = count ? "" : "wine-"; - - filename[i] = 0; - fprintf(tempfile, " \n"); - fprintf(tempfile, " %s%s\n", - prefix, wchars_to_xml_text(filename)); - fprintf(tempfile, " %s%s.directory\n", - prefix, wchars_to_xml_text(filename)); - dir_file_name = heap_wprintf(L"%s\\desktop-directories\\%s%s.directory", - xdg_data_dir, count ? L"" : L"wine-", filename); - if (GetFileAttributesW( dir_file_name ) == INVALID_FILE_ATTRIBUTES) - write_directory_entry(lastEntry, dir_file_name); - free(dir_file_name); - filename[i] = '-'; - lastEntry = &filename[i+1]; - ++count; - } - } - filename[i] = 0; - - fprintf(tempfile, " \n"); - fprintf(tempfile, " %s\n", wchars_to_xml_text(filename)); - fprintf(tempfile, " \n"); - for (i = 0; i < count; i++) - fprintf(tempfile, " \n"); - fprintf(tempfile, "\n"); - - menuPath = heap_wprintf(L"%s\\%s", xdg_menu_dir, filename); - lstrcpyW(menuPath + lstrlenW(menuPath) - lstrlenW(L".desktop"), L".menu"); - - fclose(tempfile); - ret = MoveFileExW( tempfilename, menuPath, MOVEFILE_REPLACE_EXISTING ); - if (ret) - register_menus_entry(menuPath, windows_link); - else - DeleteFileW( tempfilename ); - free(filename); - free(menuPath); - return ret; -} - static BOOL write_menu_entry(const WCHAR *windows_link, const WCHAR *link, const WCHAR *path, const WCHAR *args, const WCHAR *descr, const WCHAR *workdir, const WCHAR *icon, const WCHAR *wmclass) { @@ -1446,12 +1349,6 @@ static BOOL write_menu_entry(const WCHAR *windows_link, const WCHAR *link, const goto end; } - if (!write_menu_file(windows_link, link)) - { - WINE_WARN("couldn't make menu file %s\n", wine_dbgstr_w(filename)); - ret = FALSE; - } - end: free(desktopPath); free(filename); @@ -2864,20 +2761,7 @@ static BOOL init_xdg(void) static BOOL associations_enabled(void) { - BOOL ret = TRUE; - HKEY hkey; - BYTE buf[32]; - DWORD len; - - if ((hkey = open_associations_reg_key())) - { - len = sizeof(buf); - if (!RegQueryValueExA(hkey, "Enable", NULL, NULL, buf, &len)) - ret = IS_OPTION_TRUE(buf[0]); - RegCloseKey( hkey ); - } - - return ret; + return FALSE; } /*********************************************************************** diff --git a/server/Makefile.in b/server/Makefile.in index 7b46b924c46..a98615cce72 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -11,9 +11,11 @@ SOURCES = \ debugger.c \ device.c \ directory.c \ + esync.c \ event.c \ fd.c \ file.c \ + fsync.c \ handle.c \ hook.c \ mach.c \ diff --git a/server/async.c b/server/async.c index 9cb251df5ce..fa21285bc05 100644 --- a/server/async.c +++ b/server/async.c @@ -77,6 +77,8 @@ static const struct object_ops async_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ async_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ async_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -551,6 +553,16 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota } } +int async_queue_has_waiting_asyncs( struct async_queue *queue ) +{ + struct async *async; + + LIST_FOR_EACH_ENTRY( async, &queue->queue, struct async, queue_entry ) + if (!async->unknown_status) return 1; + + return 0; +} + /* check if an async operation is waiting to be alerted */ int async_waiting( struct async_queue *queue ) { @@ -676,6 +688,8 @@ static const struct object_ops iosb_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/atom.c b/server/atom.c index ff0799f5880..6b95a546597 100644 --- a/server/atom.c +++ b/server/atom.c @@ -79,6 +79,8 @@ static const struct object_ops atom_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/change.c b/server/change.c index 843e495411c..8a97b66409d 100644 --- a/server/change.c +++ b/server/change.c @@ -112,6 +112,8 @@ static const struct object_ops dir_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + default_fd_get_esync_fd, /* get_esync_fd */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ @@ -324,39 +326,17 @@ static struct fd *dir_get_fd( struct object *obj ) return (struct fd *)grab_object( dir->fd ); } -static int get_dir_unix_fd( struct dir *dir ) -{ - return get_unix_fd( dir->fd ); -} - static struct security_descriptor *dir_get_sd( struct object *obj ) { struct dir *dir = (struct dir *)obj; - int unix_fd; - struct stat st; struct security_descriptor *sd; - assert( obj->ops == &dir_ops ); - - unix_fd = get_dir_unix_fd( dir ); - - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) - return obj->sd; + struct fd *fd; - /* mode and uid the same? if so, no need to re-generate security descriptor */ - if (obj->sd && - (st.st_mode & (S_IRWXU|S_IRWXO)) == (dir->mode & (S_IRWXU|S_IRWXO)) && - (st.st_uid == dir->uid)) - return obj->sd; - - sd = mode_to_sd( st.st_mode, - security_unix_uid_to_sid( st.st_uid ), - token_get_primary_group( current->process->token )); - if (!sd) return obj->sd; + assert( obj->ops == &dir_ops ); - dir->mode = st.st_mode; - dir->uid = st.st_uid; - free( obj->sd ); - obj->sd = sd; + fd = dir_get_fd( obj ); + sd = get_file_sd( obj, fd, &dir->mode, &dir->uid ); + release_object( fd ); return sd; } @@ -364,48 +344,15 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ) { struct dir *dir = (struct dir *)obj; - const struct sid *owner; - struct stat st; - mode_t mode; - int unix_fd; + struct fd *fd; + int ret; assert( obj->ops == &dir_ops ); - unix_fd = get_dir_unix_fd( dir ); - - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; - - if (set_info & OWNER_SECURITY_INFORMATION) - { - owner = sd_get_owner( sd ); - if (!owner) - { - set_error( STATUS_INVALID_SECURITY_DESCR ); - return 0; - } - if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) - { - /* FIXME: get Unix uid and call fchown */ - } - } - else if (obj->sd) - owner = sd_get_owner( obj->sd ); - else - owner = token_get_owner( current->process->token ); - - if (set_info & DACL_SECURITY_INFORMATION) - { - /* keep the bits that we don't map to access rights in the ACL */ - mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); - mode |= sd_to_mode( sd, owner ); - - if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1) - { - file_set_error(); - return 0; - } - } - return 1; + fd = dir_get_fd( obj ); + ret = set_file_sd( obj, fd, &dir->mode, &dir->uid, sd, set_info ); + release_object( fd ); + return ret; } static struct change_record *get_first_change_record( struct dir *dir ) @@ -1133,7 +1080,8 @@ static void dir_add_to_existing_notify( struct dir *dir ) #endif /* HAVE_SYS_INOTIFY_H */ -struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ) +struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ) { struct dir *dir; @@ -1153,6 +1101,11 @@ struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ) dir->client_process = NULL; set_fd_user( fd, &dir_fd_ops, &dir->obj ); + if (sd) dir_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION ); + dir_add_to_existing_notify( dir ); return &dir->obj; diff --git a/server/clipboard.c b/server/clipboard.c index 8118a467dd8..f24924eafa5 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -76,6 +76,8 @@ static const struct object_ops clipboard_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/completion.c b/server/completion.c index 6933195e72d..3ed7b2ff2a3 100644 --- a/server/completion.c +++ b/server/completion.c @@ -30,7 +30,7 @@ #include #include - +#include #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -40,7 +40,8 @@ #include "file.h" #include "handle.h" #include "request.h" - +#include "esync.h" +#include "fsync.h" static const WCHAR completion_name[] = {'I','o','C','o','m','p','l','e','t','i','o','n'}; @@ -56,15 +57,62 @@ struct type_descr completion_type = }, }; +struct completion; + +struct completion_wait +{ + struct object obj; + struct completion *completion; + struct list queue; + unsigned int depth; + int esync_fd; + unsigned int fsync_idx; +}; + struct completion { - struct object obj; - struct list queue; - unsigned int depth; + struct object obj; + struct completion_wait *wait; +}; + +static void completion_wait_dump( struct object*, int ); +static int completion_wait_signaled( struct object *obj, struct wait_queue_entry *entry ); +static void completion_wait_satisfied( struct object *obj, struct wait_queue_entry *entry ); +static int completion_wait_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int completion_wait_get_fsync_idx( struct object *obj, enum fsync_type *type ); +static void completion_wait_destroy( struct object * ); + +static const struct object_ops completion_wait_ops = +{ + sizeof(struct completion_wait), /* size */ + &no_type, /* type */ + completion_wait_dump, /* dump */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ + completion_wait_signaled, /* signaled */ + completion_wait_get_esync_fd, /* get_esync_fd */ + completion_wait_get_fsync_idx, /* get_fsync_idx */ + completion_wait_satisfied, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + default_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + no_get_full_name, /* get_full_name */ + no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ + no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_close_handle, /* close_handle */ + completion_wait_destroy /* destroy */ }; static void completion_dump( struct object*, int ); -static int completion_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int completion_add_queue( struct object *obj, struct wait_queue_entry *entry ); +static void completion_remove_queue( struct object *obj, struct wait_queue_entry *entry ); +static int completion_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int completion_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void completion_destroy( struct object * ); static const struct object_ops completion_ops = @@ -72,9 +120,11 @@ static const struct object_ops completion_ops = sizeof(struct completion), /* size */ &completion_type, /* type */ completion_dump, /* dump */ - add_queue, /* add_queue */ - remove_queue, /* remove_queue */ - completion_signaled, /* signaled */ + completion_add_queue, /* add_queue */ + completion_remove_queue, /* remove_queue */ + NULL, /* signaled */ + completion_get_esync_fd, /* get_esync_fd */ + completion_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -100,30 +150,118 @@ struct comp_msg unsigned int status; }; -static void completion_destroy( struct object *obj) +static void completion_wait_destroy( struct object *obj) { - struct completion *completion = (struct completion *) obj; + struct completion_wait *wait = (struct completion_wait *)obj; struct comp_msg *tmp, *next; - LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &completion->queue, struct comp_msg, queue_entry ) + LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &wait->queue, struct comp_msg, queue_entry ) { free( tmp ); } + + if (do_esync()) + close( wait->esync_fd ); + + if (wait->fsync_idx) fsync_free_shm_idx( wait->fsync_idx ); +} + +static void completion_wait_dump( struct object *obj, int verbose ) +{ + struct completion_wait *wait = (struct completion_wait *)obj; + + assert( obj->ops == &completion_wait_ops ); + fprintf( stderr, "Completion depth=%u\n", wait->depth ); +} + +static int completion_wait_signaled( struct object *obj, struct wait_queue_entry *entry ) +{ + struct completion_wait *wait = (struct completion_wait *)obj; + + assert( obj->ops == &completion_wait_ops ); + return !wait->completion || !list_empty( &wait->queue ); +} + +static int completion_wait_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct completion_wait *wait = (struct completion_wait *)obj; + + *type = ESYNC_MANUAL_SERVER; + return wait->esync_fd; +} + +static unsigned int completion_wait_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct completion_wait *wait = (struct completion_wait *)obj; + + assert( obj->ops == &completion_wait_ops ); + *type = FSYNC_MANUAL_SERVER; + return wait->fsync_idx; +} + +static void completion_wait_satisfied( struct object *obj, struct wait_queue_entry *entry ) +{ + struct completion_wait *wait = (struct completion_wait *)obj; + struct thread *thread; + + assert( obj->ops == &completion_wait_ops ); + if (wait->completion) + { + thread = get_wait_queue_thread( entry ); + if (thread->locked_completion) release_object( thread->locked_completion ); + thread->locked_completion = grab_object( obj ); + } + else make_wait_abandoned( entry ); } static void completion_dump( struct object *obj, int verbose ) { - struct completion *completion = (struct completion *) obj; + struct completion *completion = (struct completion *)obj; assert( obj->ops == &completion_ops ); - fprintf( stderr, "Completion depth=%u\n", completion->depth ); + completion->wait->obj.ops->dump( &completion->wait->obj, verbose ); } -static int completion_signaled( struct object *obj, struct wait_queue_entry *entry ) +static int completion_add_queue( struct object *obj, struct wait_queue_entry *entry ) { struct completion *completion = (struct completion *)obj; - return !list_empty( &completion->queue ); + assert( obj->ops == &completion_ops ); + return completion->wait->obj.ops->add_queue( &completion->wait->obj, entry ); +} + +static void completion_remove_queue( struct object *obj, struct wait_queue_entry *entry ) +{ + struct completion *completion = (struct completion *)obj; + + assert( obj->ops == &completion_ops ); + completion->wait->obj.ops->remove_queue( &completion->wait->obj, entry ); +} + +static int completion_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct completion *completion = (struct completion *)obj; + + assert( obj->ops == &completion_ops ); + return completion->wait->obj.ops->get_esync_fd( &completion->wait->obj, type ); +} + +static unsigned int completion_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct completion *completion = (struct completion *)obj; + + assert( obj->ops == &completion_ops ); + return completion->wait->obj.ops->get_fsync_idx( &completion->wait->obj, type ); +} + +static void completion_destroy( struct object *obj ) +{ + struct completion *completion = (struct completion *)obj; + + assert( obj->ops == &completion_ops ); + completion->wait->completion = NULL; + wake_up( &completion->wait->obj, 0 ); + release_object( &completion->wait->obj ); } static struct completion *create_completion( struct object *root, const struct unicode_str *name, @@ -132,15 +270,26 @@ static struct completion *create_completion( struct object *root, const struct u { struct completion *completion; - if ((completion = create_named_object( root, &completion_ops, name, attr, sd ))) + if (!(completion = create_named_object( root, &completion_ops, name, attr, sd ))) return NULL; + if (get_error() == STATUS_OBJECT_NAME_EXISTS) return completion; + if (!(completion->wait = alloc_object( &completion_wait_ops ))) { - if (get_error() != STATUS_OBJECT_NAME_EXISTS) - { - list_init( &completion->queue ); - completion->depth = 0; - } + release_object( completion ); + set_error( STATUS_NO_MEMORY ); + return NULL; } + completion->wait->completion = completion; + list_init( &completion->wait->queue ); + completion->wait->depth = 0; + completion->wait->fsync_idx = 0; + + if (do_fsync()) + completion->wait->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + completion->wait->esync_fd = esync_create_fd( 0, 0 ); + return completion; } @@ -162,9 +311,10 @@ void add_completion( struct completion *completion, apc_param_t ckey, apc_param_ msg->status = status; msg->information = information; - list_add_tail( &completion->queue, &msg->queue_entry ); - completion->depth++; - wake_up( &completion->obj, 1 ); + list_add_tail( &completion->wait->queue, &msg->queue_entry ); + completion->wait->depth++; + + wake_up( &completion->wait->obj, 1 ); } /* create a completion */ @@ -212,28 +362,65 @@ DECL_HANDLER(add_completion) /* get completion from completion port */ DECL_HANDLER(remove_completion) { - struct completion* completion = get_completion_obj( current->process, req->handle, IO_COMPLETION_MODIFY_STATE ); + struct completion* completion; + struct completion_wait *wait; struct list *entry; struct comp_msg *msg; - if (!completion) return; + if (req->waited && (wait = (struct completion_wait *)current->locked_completion)) + current->locked_completion = NULL; + else + { + if (current->locked_completion) + { + release_object( current->locked_completion ); + current->locked_completion = NULL; + } + completion = get_completion_obj( current->process, req->handle, IO_COMPLETION_MODIFY_STATE ); + if (!completion) return; + + wait = (struct completion_wait *)grab_object( completion->wait ); + release_object( completion ); + } - entry = list_head( &completion->queue ); + assert( wait->obj.ops == &completion_wait_ops ); + + entry = list_head( &wait->queue ); if (!entry) - set_error( STATUS_PENDING ); + { + if (wait->completion) + { + if (do_fsync() || do_esync()) + { + /* completion_wait_satisfied is not called, so lock completion here. */ + current->locked_completion = grab_object( wait ); + } + set_error( STATUS_PENDING ); + } + else set_error( STATUS_ABANDONED_WAIT_0 ); + } else { list_remove( entry ); - completion->depth--; + wait->depth--; msg = LIST_ENTRY( entry, struct comp_msg, queue_entry ); reply->ckey = msg->ckey; reply->cvalue = msg->cvalue; reply->status = msg->status; reply->information = msg->information; free( msg ); + + if (!completion_wait_signaled( &wait->obj, NULL )) + { + if (do_fsync()) + fsync_clear( &wait->obj ); + + if (do_esync()) + esync_clear( wait->esync_fd ); + } } - release_object( completion ); + release_object( wait ); } /* get queue depth for completion port */ @@ -243,7 +430,7 @@ DECL_HANDLER(query_completion) if (!completion) return; - reply->depth = completion->depth; + reply->depth = completion->wait->depth; release_object( completion ); } diff --git a/server/console.c b/server/console.c index b64283baf4a..9084e5a3828 100644 --- a/server/console.c +++ b/server/console.c @@ -41,6 +41,8 @@ #include "wincon.h" #include "winternl.h" #include "wine/condrv.h" +#include "esync.h" +#include "fsync.h" struct screen_buffer; @@ -81,6 +83,8 @@ static const struct object_ops console_ops = console_add_queue, /* add_queue */ remove_queue, /* remove_queue */ console_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_get_fd, /* get_fd */ @@ -130,20 +134,24 @@ struct console_host_ioctl struct console_server { - struct object obj; /* object header */ - struct fd *fd; /* pseudo-fd for ioctls */ - struct console *console; /* attached console */ - struct list queue; /* ioctl queue */ - struct list read_queue; /* blocking read queue */ + struct object obj; /* object header */ + struct fd *fd; /* pseudo-fd for ioctls */ + struct console *console; /* attached console */ + struct list queue; /* ioctl queue */ + struct list read_queue; /* blocking read queue */ unsigned int busy : 1; /* flag if server processing an ioctl */ unsigned int once_input : 1; /* flag if input thread has already been requested */ - int term_fd; /* UNIX terminal fd */ - struct termios termios; /* original termios */ + int term_fd; /* UNIX terminal fd */ + struct termios termios; /* original termios */ + int esync_fd; + unsigned int fsync_idx; }; static void console_server_dump( struct object *obj, int verbose ); static void console_server_destroy( struct object *obj ); static int console_server_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int console_server_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int console_server_get_fsync_idx( struct object *obj, enum fsync_type *type ); static struct fd *console_server_get_fd( struct object *obj ); static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr, struct object *root ); @@ -158,6 +166,8 @@ static const struct object_ops console_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ console_server_signaled, /* signaled */ + console_server_get_esync_fd, /* get_esync_fd */ + console_server_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_server_get_fd, /* get_fd */ @@ -227,6 +237,8 @@ static const struct object_ops screen_buffer_ops = screen_buffer_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ screen_buffer_get_fd, /* get_fd */ @@ -276,6 +288,8 @@ static const struct object_ops console_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -313,6 +327,8 @@ static const struct object_ops console_input_ops = console_input_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_input_get_fd, /* get_fd */ @@ -370,6 +386,8 @@ static const struct object_ops console_output_ops = console_output_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_output_get_fd, /* get_fd */ @@ -428,6 +446,8 @@ static const struct object_ops console_connection_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_connection_get_fd, /* get_fd */ @@ -590,6 +610,10 @@ static void disconnect_console_server( struct console_server *server ) list_remove( &call->entry ); console_host_ioctl_terminate( call, STATUS_CANCELLED ); } + if (do_fsync()) + fsync_clear( &server->obj ); + if (do_esync()) + esync_clear( server->esync_fd ); while (!list_empty( &server->read_queue )) { struct console_host_ioctl *call = LIST_ENTRY( list_head( &server->read_queue ), struct console_host_ioctl, entry ); @@ -872,6 +896,8 @@ static void console_server_destroy( struct object *obj ) assert( obj->ops == &console_server_ops ); disconnect_console_server( server ); if (server->fd) release_object( server->fd ); + if (do_esync()) close( server->esync_fd ); + if (server->fsync_idx) fsync_free_shm_idx( server->fsync_idx ); } static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, @@ -913,6 +939,20 @@ static int console_server_signaled( struct object *obj, struct wait_queue_entry return !server->console || !list_empty( &server->queue ); } +static int console_server_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct console_server *server = (struct console_server*)obj; + *type = ESYNC_MANUAL_SERVER; + return server->esync_fd; +} + +static unsigned int console_server_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct console_server *server = (struct console_server*)obj; + *type = FSYNC_MANUAL_SERVER; + return server->fsync_idx; +} + static struct fd *console_server_get_fd( struct object* obj ) { struct console_server *server = (struct console_server*)obj; @@ -944,6 +984,14 @@ static struct object *create_console_server( void ) return NULL; } allow_fd_caching(server->fd); + server->esync_fd = -1; + server->fsync_idx = 0; + + if (do_fsync()) + server->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + server->esync_fd = esync_create_fd( 0, 0 ); return &server->obj; } @@ -1557,6 +1605,10 @@ DECL_HANDLER(get_next_console_request) /* set result of previous ioctl */ ioctl = LIST_ENTRY( list_head( &server->queue ), struct console_host_ioctl, entry ); list_remove( &ioctl->entry ); + if (do_fsync() && list_empty( &server->queue )) + fsync_clear( &server->obj ); + if (do_esync() && list_empty( &server->queue )) + esync_clear( server->esync_fd ); } if (ioctl) @@ -1642,6 +1694,10 @@ DECL_HANDLER(get_next_console_request) { set_error( STATUS_PENDING ); } + if (do_fsync() && list_empty( &server->queue )) + fsync_clear( &server->obj ); + if (do_esync() && list_empty( &server->queue )) + esync_clear( server->esync_fd ); release_object( server ); } diff --git a/server/debugger.c b/server/debugger.c index 48adb244b09..b0cd35604d2 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -86,6 +86,8 @@ static const struct object_ops debug_event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ debug_event_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -114,6 +116,8 @@ static const struct object_ops debug_obj_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ debug_obj_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/device.c b/server/device.c index 436dac6bfe9..7e9911efb6a 100644 --- a/server/device.c +++ b/server/device.c @@ -38,6 +38,8 @@ #include "handle.h" #include "request.h" #include "process.h" +#include "esync.h" +#include "fsync.h" /* IRP object */ @@ -66,6 +68,8 @@ static const struct object_ops irp_call_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* satisfied */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -92,10 +96,14 @@ struct device_manager struct list requests; /* list of pending irps across all devices */ struct irp_call *current_call; /* call currently executed on client side */ struct wine_rb_tree kernel_objects; /* map of objects that have client side pointer associated */ + int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; }; static void device_manager_dump( struct object *obj, int verbose ); static int device_manager_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int device_manager_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int device_manager_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void device_manager_destroy( struct object *obj ); static const struct object_ops device_manager_ops = @@ -106,6 +114,8 @@ static const struct object_ops device_manager_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ device_manager_signaled, /* signaled */ + device_manager_get_esync_fd, /* get_esync_fd */ + device_manager_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -163,6 +173,8 @@ static const struct object_ops device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -215,6 +227,8 @@ static const struct object_ops device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ device_file_get_fd, /* get_fd */ @@ -747,6 +761,12 @@ static void delete_file( struct device_file *file ) /* terminate all pending requests */ LIST_FOR_EACH_ENTRY_SAFE( irp, next, &file->requests, struct irp_call, dev_entry ) { + if (do_fsync() && file->device->manager && list_empty( &file->device->manager->requests )) + fsync_clear( &file->device->manager->obj ); + + if (do_esync() && file->device->manager && list_empty( &file->device->manager->requests )) + esync_clear( file->device->manager->esync_fd ); + list_remove( &irp->mgr_entry ); set_irp_result( irp, STATUS_FILE_DELETED, NULL, 0, 0 ); } @@ -782,6 +802,20 @@ static int device_manager_signaled( struct object *obj, struct wait_queue_entry return !list_empty( &manager->requests ); } +static int device_manager_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct device_manager *manager = (struct device_manager *)obj; + *type = ESYNC_MANUAL_SERVER; + return manager->esync_fd; +} + +static unsigned int device_manager_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct device_manager *manager = (struct device_manager *)obj; + *type = FSYNC_MANUAL_SERVER; + return manager->fsync_idx; +} + static void device_manager_destroy( struct object *obj ) { struct device_manager *manager = (struct device_manager *)obj; @@ -816,6 +850,10 @@ static void device_manager_destroy( struct object *obj ) assert( !irp->file && !irp->async ); release_object( irp ); } + + if (do_esync()) + close( manager->esync_fd ); + if (manager->fsync_idx) fsync_free_shm_idx( manager->fsync_idx ); } static struct device_manager *create_device_manager(void) @@ -828,6 +866,13 @@ static struct device_manager *create_device_manager(void) list_init( &manager->devices ); list_init( &manager->requests ); wine_rb_init( &manager->kernel_objects, compare_kernel_object ); + manager->fsync_idx = 0; + + if (do_fsync()) + manager->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + manager->esync_fd = esync_create_fd( 0, 0 ); } return manager; } @@ -1017,6 +1062,12 @@ DECL_HANDLER(get_next_device_request) /* we already own the object if it's only on manager queue */ if (irp->file) grab_object( irp ); manager->current_call = irp; + + if (do_fsync() && list_empty( &manager->requests )) + fsync_clear( &manager->obj ); + + if (do_esync() && list_empty( &manager->requests )) + esync_clear( manager->esync_fd ); } else close_handle( current->process, reply->next ); } diff --git a/server/directory.c b/server/directory.c index 23d7eb0a2b7..878941cddbf 100644 --- a/server/directory.c +++ b/server/directory.c @@ -37,6 +37,7 @@ #include "process.h" #include "file.h" #include "unicode.h" +#include "user.h" #define HASH_SIZE 7 /* default hash size */ @@ -69,6 +70,8 @@ static const struct object_ops object_type_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -119,6 +122,8 @@ static const struct object_ops directory_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -277,6 +282,37 @@ struct object *get_directory_obj( struct process *process, obj_handle_t handle ) return get_handle_obj( process, handle, 0, &directory_ops ); } +struct object *create_desktop_map_directory( struct winstation *winstation ) +{ + static const WCHAR dir_desktop_mapsW[] = {'_','_','w','i','n','e','_','d','e','s','k','t','o','p','_','m','a','p','p','i','n','g','s'}; + static const struct unicode_str dir_desktop_maps_str = {dir_desktop_mapsW, sizeof(dir_desktop_mapsW)}; + struct object *root; + struct directory *mapping_root, *ret; + const struct unicode_str winsta_name = {winstation->obj.name->name, winstation->obj.name->len}; + + root = winstation->obj.name->parent; + mapping_root = create_directory( root, &dir_desktop_maps_str, OBJ_OPENIF, HASH_SIZE, NULL ); + ret = create_directory( &mapping_root->obj, &winsta_name, OBJ_OPENIF, HASH_SIZE, NULL ); + release_object( &mapping_root->obj ); + + return &ret->obj; +} + +struct object *create_thread_map_directory( void ) +{ + static const WCHAR dir_kernelW[] = {'K','e','r','n','e','l','O','b','j','e','c','t','s'}; + static const WCHAR dir_thread_mapsW[] = {'_','_','w','i','n','e','_','t','h','r','e','a','d','_','m','a','p','p','i','n','g','s'}; + static const struct unicode_str dir_kernel_str = {dir_kernelW, sizeof(dir_kernelW)}; + static const struct unicode_str dir_thread_maps_str = {dir_thread_mapsW, sizeof(dir_thread_mapsW)}; + struct directory *mapping_root, *ret; + + mapping_root = create_directory( &root_directory->obj, &dir_kernel_str, OBJ_OPENIF, HASH_SIZE, NULL ); + ret = create_directory( &mapping_root->obj, &dir_thread_maps_str, OBJ_OPENIF, HASH_SIZE, NULL ); + release_object( &mapping_root->obj ); + + return &ret->obj; +} + /* Global initialization */ static void create_session( unsigned int id ) diff --git a/server/esync.c b/server/esync.c new file mode 100644 index 00000000000..a5164435ed6 --- /dev/null +++ b/server/esync.c @@ -0,0 +1,591 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + + +#include +#include +#include +#include +#ifdef HAVE_SYS_EVENTFD_H +# include +#endif +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "handle.h" +#include "request.h" +#include "file.h" +#include "esync.h" +#include "fsync.h" + +int do_esync(void) +{ +#ifdef HAVE_SYS_EVENTFD_H + static int do_esync_cached = -1; + + if (do_esync_cached == -1) + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")) && !do_fsync(); + + return do_esync_cached; +#else + return 0; +#endif +} + +static char shm_name[29]; +static int shm_fd; +static off_t shm_size; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static void shm_cleanup(void) +{ + close( shm_fd ); + if (shm_unlink( shm_name ) == -1) + perror( "shm_unlink" ); +} + +void esync_init(void) +{ + struct stat st; + + if (fstat( config_dir_fd, &st ) == -1) + fatal_error( "cannot stat config dir\n" ); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-esync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-esync", (unsigned long)st.st_ino ); + + shm_unlink( shm_name ); + + shm_fd = shm_open( shm_name, O_RDWR | O_CREAT | O_EXCL, 0644 ); + if (shm_fd == -1) + perror( "shm_open" ); + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; + + shm_size = pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + perror( "ftruncate" ); + + fprintf( stderr, "esync: up and running.\n" ); + + atexit( shm_cleanup ); +} + +static struct list mutex_list = LIST_INIT(mutex_list); + +struct esync +{ + struct object obj; /* object header */ + int fd; /* eventfd file descriptor */ + enum esync_type type; + unsigned int shm_idx; /* index into the shared memory section */ + struct list mutex_entry; /* entry in the mutex list (if applicable) */ +}; + +static void esync_dump( struct object *obj, int verbose ); +static int esync_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int esync_map_access( struct object *obj, unsigned int access ); +static void esync_destroy( struct object *obj ); + +const struct object_ops esync_ops = +{ + sizeof(struct esync), /* size */ + &no_type, /* type */ + esync_dump, /* dump */ + no_add_queue, /* add_queue */ + NULL, /* remove_queue */ + NULL, /* signaled */ + esync_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ + NULL, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + esync_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + default_get_full_name, /* get_full_name */ + no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_close_handle, /* close_handle */ + esync_destroy /* destroy */ +}; + +static void esync_dump( struct object *obj, int verbose ) +{ + struct esync *esync = (struct esync *)obj; + assert( obj->ops == &esync_ops ); + fprintf( stderr, "esync fd=%d\n", esync->fd ); +} + +static int esync_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct esync *esync = (struct esync *)obj; + *type = esync->type; + return esync->fd; +} + +static unsigned int esync_map_access( struct object *obj, unsigned int access ) +{ + /* Sync objects have the same flags. */ + if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | EVENT_QUERY_STATE; + if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE; + if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE; + if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + +static void esync_destroy( struct object *obj ) +{ + struct esync *esync = (struct esync *)obj; + if (esync->type == ESYNC_MUTEX) + list_remove( &esync->mutex_entry ); + close( esync->fd ); +} + +static int type_matches( enum esync_type type1, enum esync_type type2 ) +{ + return (type1 == type2) || + ((type1 == ESYNC_AUTO_EVENT || type1 == ESYNC_MANUAL_EVENT) && + (type2 == ESYNC_AUTO_EVENT || type2 == ESYNC_MANUAL_EVENT)); +} + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + fprintf( stderr, "esync: couldn't expand shm_addrs array to size %d\n", entry + 1 ); + + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + { + fprintf( stderr, "esync: failed to map page %d (offset %#lx): ", entry, entry * pagesize ); + perror( "mmap" ); + } + + if (debug_level) + fprintf( stderr, "esync: Mapping page %d at %p.\n", entry, addr ); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + return (void *)((unsigned long)shm_addrs[entry] + offset); +} + +struct semaphore +{ + int max; + int count; +}; +C_ASSERT(sizeof(struct semaphore) == 8); + +struct mutex +{ + DWORD tid; + int count; /* recursion count */ +}; +C_ASSERT(sizeof(struct mutex) == 8); + +struct event +{ + int signaled; + int locked; +}; +C_ASSERT(sizeof(struct event) == 8); + +struct esync *create_esync( struct object *root, const struct unicode_str *name, + unsigned int attr, int initval, int max, enum esync_type type, + const struct security_descriptor *sd ) +{ +#ifdef HAVE_SYS_EVENTFD_H + struct esync *esync; + + if ((esync = create_named_object( root, &esync_ops, name, attr, sd ))) + { + if (get_error() != STATUS_OBJECT_NAME_EXISTS) + { + int flags = EFD_CLOEXEC | EFD_NONBLOCK; + + if (type == ESYNC_SEMAPHORE) + flags |= EFD_SEMAPHORE; + + /* initialize it if it didn't already exist */ + esync->fd = eventfd( initval, flags ); + if (esync->fd == -1) + { + perror( "eventfd" ); + file_set_error(); + release_object( esync ); + return NULL; + } + esync->type = type; + + /* Use the fd as index, since that'll be unique across all + * processes, but should hopefully end up also allowing reuse. */ + esync->shm_idx = esync->fd + 1; /* we keep index 0 reserved */ + while (esync->shm_idx * 8 >= shm_size) + { + /* Better expand the shm section. */ + shm_size += pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + { + fprintf( stderr, "esync: couldn't expand %s to size %ld: ", + shm_name, (long)shm_size ); + perror( "ftruncate" ); + } + } + + /* Initialize the shared memory portion. We want to do this on the + * server side to avoid a potential though unlikely race whereby + * the same object is opened and used between the time it's created + * and the time its shared memory portion is initialized. */ + switch (type) + { + case ESYNC_SEMAPHORE: + { + struct semaphore *semaphore = get_shm( esync->shm_idx ); + semaphore->max = max; + semaphore->count = initval; + break; + } + case ESYNC_AUTO_EVENT: + case ESYNC_MANUAL_EVENT: + { + struct event *event = get_shm( esync->shm_idx ); + event->signaled = initval ? 1 : 0; + event->locked = 0; + break; + } + case ESYNC_MUTEX: + { + struct mutex *mutex = get_shm( esync->shm_idx ); + mutex->tid = initval ? 0 : current->id; + mutex->count = initval ? 0 : 1; + list_add_tail( &mutex_list, &esync->mutex_entry ); + break; + } + default: + assert( 0 ); + } + } + else + { + /* validate the type */ + if (!type_matches( type, esync->type )) + { + release_object( &esync->obj ); + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return NULL; + } + } + } + return esync; +#else + /* FIXME: Provide a fallback implementation using pipe(). */ + set_error( STATUS_NOT_IMPLEMENTED ); + return NULL; +#endif +} + +/* Create a file descriptor for an existing handle. + * Caller must close the handle when it's done; it's not linked to an esync + * server object in any way. */ +int esync_create_fd( int initval, int flags ) +{ +#ifdef HAVE_SYS_EVENTFD_H + int fd; + + fd = eventfd( initval, flags | EFD_CLOEXEC | EFD_NONBLOCK ); + if (fd == -1) + perror( "eventfd" ); + + return fd; +#else + return -1; +#endif +} + +/* Wake up a specific fd. */ +void esync_wake_fd( int fd ) +{ + static const uint64_t value = 1; + + if (write( fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); +} + +/* Wake up a server-side esync object. */ +void esync_wake_up( struct object *obj ) +{ + enum esync_type dummy; + int fd; + + if (obj->ops->get_esync_fd) + { + fd = obj->ops->get_esync_fd( obj, &dummy ); + esync_wake_fd( fd ); + } +} + +void esync_clear( int fd ) +{ + uint64_t value; + + /* we don't care about the return value */ + read( fd, &value, sizeof(value) ); +} + +static inline void small_pause(void) +{ +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + +/* Server-side event support. */ +void esync_set_event( struct esync *esync ) +{ + static const uint64_t value = 1; + struct event *event = get_shm( esync->shm_idx ); + + assert( esync->obj.ops == &esync_ops ); + assert( event != NULL ); + + if (debug_level) + fprintf( stderr, "esync_set_event() fd=%d\n", esync->fd ); + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (__sync_val_compare_and_swap( &event->locked, 0, 1 )) + small_pause(); + } + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + { + if (write( esync->fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); + } + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } +} + +void esync_reset_event( struct esync *esync ) +{ + static uint64_t value = 1; + struct event *event = get_shm( esync->shm_idx ); + + assert( esync->obj.ops == &esync_ops ); + assert( event != NULL ); + + if (debug_level) + fprintf( stderr, "esync_reset_event() fd=%d\n", esync->fd ); + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (__sync_val_compare_and_swap( &event->locked, 0, 1 )) + small_pause(); + } + + /* Only bother signaling the fd if we weren't already signaled. */ + if (__atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST )) + { + /* we don't care about the return value */ + read( esync->fd, &value, sizeof(value) ); + } + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } +} + +void esync_abandon_mutexes( struct thread *thread ) +{ + struct esync *esync; + + LIST_FOR_EACH_ENTRY( esync, &mutex_list, struct esync, mutex_entry ) + { + struct mutex *mutex = get_shm( esync->shm_idx ); + + if (mutex->tid == thread->id) + { + if (debug_level) + fprintf( stderr, "esync_abandon_mutexes() fd=%d\n", esync->fd ); + mutex->tid = ~0; + mutex->count = 0; + esync_wake_fd( esync->fd ); + } + } +} + +DECL_HANDLER(create_esync) +{ + struct esync *esync; + struct unicode_str name; + struct object *root; + const struct security_descriptor *sd; + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); + + if (!do_esync()) + { + set_error( STATUS_NOT_IMPLEMENTED ); + return; + } + + if (!req->type) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + + if (!objattr) return; + + if ((esync = create_esync( root, &name, objattr->attributes, req->initval, req->max, req->type, sd ))) + { + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, esync, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, esync, + req->access, objattr->attributes ); + + reply->type = esync->type; + reply->shm_idx = esync->shm_idx; + send_client_fd( current->process, esync->fd, reply->handle ); + release_object( esync ); + } + + if (root) release_object( root ); +} + +DECL_HANDLER(open_esync) +{ + struct unicode_str name = get_req_unicode_str(); + + reply->handle = open_object( current->process, req->rootdir, req->access, + &esync_ops, &name, req->attributes ); + + /* send over the fd */ + if (reply->handle) + { + struct esync *esync; + + if (!(esync = (struct esync *)get_handle_obj( current->process, reply->handle, + 0, &esync_ops ))) + return; + + if (!type_matches( req->type, esync->type )) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + release_object( esync ); + return; + } + + reply->type = esync->type; + reply->shm_idx = esync->shm_idx; + + send_client_fd( current->process, esync->fd, reply->handle ); + release_object( esync ); + } +} + +/* Retrieve a file descriptor for an esync object which will be signaled by the + * server. The client should only read from (i.e. wait on) this object. */ +DECL_HANDLER(get_esync_fd) +{ + struct object *obj; + enum esync_type type; + int fd; + + if (!(obj = get_handle_obj( current->process, req->handle, SYNCHRONIZE, NULL ))) + return; + + if (obj->ops->get_esync_fd) + { + fd = obj->ops->get_esync_fd( obj, &type ); + reply->type = type; + if (obj->ops == &esync_ops) + { + struct esync *esync = (struct esync *)obj; + reply->shm_idx = esync->shm_idx; + } + else + reply->shm_idx = 0; + send_client_fd( current->process, fd, req->handle ); + } + else + { + if (debug_level) + { + fprintf( stderr, "%04x: esync: can't wait on object: ", current->id ); + obj->ops->dump( obj, 0 ); + } + set_error( STATUS_NOT_IMPLEMENTED ); + } + + release_object( obj ); +} + +/* Return the fd used for waiting on user APCs. */ +DECL_HANDLER(get_esync_apc_fd) +{ + send_client_fd( current->process, current->esync_apc_fd, current->id ); +} diff --git a/server/esync.h b/server/esync.h new file mode 100644 index 00000000000..d39f4efa3ec --- /dev/null +++ b/server/esync.h @@ -0,0 +1,35 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +extern int do_esync(void); +void esync_init(void); +int esync_create_fd( int initval, int flags ); +void esync_wake_fd( int fd ); +void esync_wake_up( struct object *obj ); +void esync_clear( int fd ); + +struct esync; + +extern const struct object_ops esync_ops; +void esync_set_event( struct esync *esync ); +void esync_reset_event( struct esync *esync ); +void esync_abandon_mutexes( struct thread *thread ); diff --git a/server/event.c b/server/event.c index f1b79b1b35e..b93a9960ad2 100644 --- a/server/event.c +++ b/server/event.c @@ -35,6 +35,8 @@ #include "thread.h" #include "request.h" #include "security.h" +#include "esync.h" +#include "fsync.h" static const WCHAR event_name[] = {'E','v','e','n','t'}; @@ -56,13 +58,18 @@ struct event struct list kernel_object; /* list of kernel object pointers */ int manual_reset; /* is it a manual reset event? */ int signaled; /* event has been signaled */ + int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; }; static void event_dump( struct object *obj, int verbose ); static int event_signaled( struct object *obj, struct wait_queue_entry *entry ); static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ); +static int event_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int event_get_fsync_idx( struct object *obj, enum fsync_type *type ); static int event_signal( struct object *obj, unsigned int access); static struct list *event_get_kernel_obj_list( struct object *obj ); +static void event_destroy( struct object *obj ); static const struct object_ops event_ops = { @@ -72,6 +79,8 @@ static const struct object_ops event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ event_signaled, /* signaled */ + event_get_esync_fd, /* get_esync_fd */ + event_get_fsync_idx, /* get_fsync_idx */ event_satisfied, /* satisfied */ event_signal, /* signal */ no_get_fd, /* get_fd */ @@ -85,7 +94,7 @@ static const struct object_ops event_ops = no_open_file, /* open_file */ event_get_kernel_obj_list, /* get_kernel_obj_list */ no_close_handle, /* close_handle */ - no_destroy /* destroy */ + event_destroy /* destroy */ }; @@ -119,6 +128,8 @@ static const struct object_ops keyed_event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ keyed_event_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -150,6 +161,13 @@ struct event *create_event( struct object *root, const struct unicode_str *name, list_init( &event->kernel_object ); event->manual_reset = manual_reset; event->signaled = initial_state; + event->fsync_idx = 0; + + if (do_fsync()) + event->fsync_idx = fsync_alloc_shm( initial_state, 0 ); + + if (do_esync()) + event->esync_fd = esync_create_fd( initial_state, 0 ); } } return event; @@ -157,6 +175,14 @@ struct event *create_event( struct object *root, const struct unicode_str *name, struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ) { + struct object *obj; + + if (do_fsync() && (obj = get_handle_obj( process, handle, access, &fsync_ops))) + return (struct event *)obj; /* even though it's not an event */ + + if (do_esync() && (obj = get_handle_obj( process, handle, access, &esync_ops))) + return (struct event *)obj; /* even though it's not an event */ + return (struct event *)get_handle_obj( process, handle, access, &event_ops ); } @@ -166,10 +192,25 @@ static void pulse_event( struct event *event ) /* wake up all waiters if manual reset, a single one otherwise */ wake_up( &event->obj, !event->manual_reset ); event->signaled = 0; + + if (do_fsync()) + fsync_clear( &event->obj ); } void set_event( struct event *event ) { + if (do_fsync() && event->obj.ops == &fsync_ops) + { + fsync_set_event( (struct fsync *)event ); + return; + } + + if (do_esync() && event->obj.ops == &esync_ops) + { + esync_set_event( (struct esync *)event ); + return; + } + event->signaled = 1; /* wake up all waiters if manual reset, a single one otherwise */ wake_up( &event->obj, !event->manual_reset ); @@ -177,7 +218,24 @@ void set_event( struct event *event ) void reset_event( struct event *event ) { + if (do_fsync() && event->obj.ops == &fsync_ops) + { + fsync_reset_event( (struct fsync *)event ); + return; + } + + if (do_esync() && event->obj.ops == &esync_ops) + { + esync_reset_event( (struct esync *)event ); + return; + } event->signaled = 0; + + if (do_fsync()) + fsync_clear( &event->obj ); + + if (do_esync()) + esync_clear( event->esync_fd ); } static void event_dump( struct object *obj, int verbose ) @@ -195,6 +253,20 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry ) return event->signaled; } +static int event_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct event *event = (struct event *)obj; + *type = event->manual_reset ? ESYNC_MANUAL_SERVER : ESYNC_AUTO_SERVER; + return event->esync_fd; +} + +static unsigned int event_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct event *event = (struct event *)obj; + *type = FSYNC_MANUAL_SERVER; + return event->fsync_idx; +} + static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct event *event = (struct event *)obj; @@ -223,6 +295,15 @@ static struct list *event_get_kernel_obj_list( struct object *obj ) return &event->kernel_object; } +static void event_destroy( struct object *obj ) +{ + struct event *event = (struct event *)obj; + + if (do_esync()) + close( event->esync_fd ); + if (event->fsync_idx) fsync_free_shm_idx( event->fsync_idx ); +} + struct keyed_event *create_keyed_event( struct object *root, const struct unicode_str *name, unsigned int attr, const struct security_descriptor *sd ) { diff --git a/server/fd.c b/server/fd.c index 8576882aaa9..36e4697e33b 100644 --- a/server/fd.c +++ b/server/fd.c @@ -96,6 +96,8 @@ #include "handle.h" #include "process.h" #include "request.h" +#include "esync.h" +#include "fsync.h" #include "winternl.h" #include "winioctl.h" @@ -156,6 +158,8 @@ struct fd struct completion *completion; /* completion object attached to this fd */ apc_param_t comp_key; /* completion key to set in completion events */ unsigned int comp_flags; /* completion flags */ + int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; /* fsync shm index */ }; static void fd_dump( struct object *obj, int verbose ); @@ -169,6 +173,8 @@ static const struct object_ops fd_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -210,6 +216,8 @@ static const struct object_ops device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -250,6 +258,8 @@ static const struct object_ops inode_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -292,6 +302,8 @@ static const struct object_ops file_lock_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ file_lock_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -1565,6 +1577,10 @@ static void fd_destroy( struct object *obj ) if (fd->unix_fd != -1) close( fd->unix_fd ); free( fd->unix_name ); } + + if (do_esync()) + close( fd->esync_fd ); + if (fd->fsync_idx) fsync_free_shm_idx( fd->fsync_idx ); } /* check if the desired access is possible without violating */ @@ -1683,12 +1699,20 @@ static struct fd *alloc_fd_object(void) fd->poll_index = -1; fd->completion = NULL; fd->comp_flags = 0; + fd->esync_fd = -1; + fd->fsync_idx = 0; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); list_init( &fd->inode_entry ); list_init( &fd->locks ); + if (do_esync()) + fd->esync_fd = esync_create_fd( 1, 0 ); + + if (do_fsync()) + fd->fsync_idx = fsync_alloc_shm( 1, 0 ); + if ((fd->poll_index = add_poll_user( fd )) == -1) { release_object( fd ); @@ -1724,11 +1748,20 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use fd->completion = NULL; fd->comp_flags = 0; fd->no_fd_status = STATUS_BAD_DEVICE_TYPE; + fd->esync_fd = -1; + fd->fsync_idx = 0; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); list_init( &fd->inode_entry ); list_init( &fd->locks ); + + if (do_fsync()) + fd->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + fd->esync_fd = esync_create_fd( 0, 0 ); + return fd; } @@ -1881,6 +1914,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam int root_fd = -1; int rw_mode; char *path; + int do_chmod = 0; + int created = (flags & O_CREAT); if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) || ((options & FILE_DIRECTORY_FILE) && (flags & O_TRUNC))) @@ -1912,13 +1947,19 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam /* create the directory if needed */ if ((options & FILE_DIRECTORY_FILE) && (flags & O_CREAT)) { - if (mkdir( name, *mode ) == -1) + if (mkdir( name, *mode | S_IRUSR ) != -1) + { + /* remove S_IRUSR later, after we have opened the directory */ + do_chmod = !(*mode & S_IRUSR); + } + else { if (errno != EEXIST || (flags & O_EXCL)) { file_set_error(); goto error; } + created = 0; } flags &= ~(O_CREAT | O_EXCL | O_TRUNC); } @@ -1938,6 +1979,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT)) fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode ); } + else if (errno == EACCES) + { + /* try to change permissions temporarily to open a file descriptor */ + if (!(access & ((FILE_UNIX_WRITE_ACCESS | FILE_UNIX_READ_ACCESS | DELETE) & ~FILE_WRITE_ATTRIBUTES)) && + !stat( name, &st ) && st.st_uid == getuid() && + !chmod( name, st.st_mode | S_IRUSR )) + { + fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode ); + *mode = st.st_mode; + do_chmod = 1; + } + else + { + set_error( STATUS_ACCESS_DENIED ); + goto error; + } + } if (fd->unix_fd == -1) { @@ -1946,6 +2004,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam set_error( STATUS_OBJECT_NAME_INVALID ); else file_set_error(); + + if (do_chmod) chmod( name, *mode ); goto error; } } @@ -1961,6 +2021,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam closed_fd->unix_fd = fd->unix_fd; closed_fd->disp_flags = 0; closed_fd->unix_name = fd->unix_name; + if (do_chmod) chmod( name, *mode ); fstat( fd->unix_fd, &st ); *mode = st.st_mode; @@ -2001,7 +2062,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam } /* can't unlink files if we don't have permission to access */ - if ((options & FILE_DELETE_ON_CLOSE) && !(flags & O_CREAT) && + if ((options & FILE_DELETE_ON_CLOSE) && !created && !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) { set_error( STATUS_CANNOT_DELETE ); @@ -2071,6 +2132,45 @@ struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops, int unix_fd, s return NULL; } +void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st ) +{ +#ifdef __linux__ + static const char procfs_fmt[] = "/proc/self/fd/%d"; + + char path[PATH_MAX], procfs_path[sizeof(procfs_fmt) - 2 /* %d */ + 11]; + struct stat path_st; + ssize_t len; + + sprintf( procfs_path, procfs_fmt, fd->unix_fd ); + len = readlink( procfs_path, path, sizeof(path) ); + if (len == -1 || len >= sizeof(path) ) + return; + path[len] = '\0'; + + /* Make sure it's an absolute path, has at least one hardlink, and the same inode */ + if (path[0] != '/' || stat( path, &path_st ) || path_st.st_nlink < 1 || + path_st.st_dev != fd_st->st_dev || path_st.st_ino != fd_st->st_ino) + return; + + if (!(fd->unix_name = mem_alloc( len + 1 ))) + return; + memcpy( fd->unix_name, path, len + 1 ); + +#elif defined(F_GETPATH) + char path[PATH_MAX]; + size_t size; + + if (fcntl( fd->unix_fd, F_GETPATH, path ) == -1 || path[0] != '/') + return; + + size = strlen(path) + 1; + if (!(fd->unix_name = mem_alloc( size ))) + return; + memcpy( fd->unix_name, path, size ); + +#endif +} + /* retrieve the object that is using an fd */ void *get_fd_user( struct fd *fd ) { @@ -2140,6 +2240,12 @@ void set_fd_signaled( struct fd *fd, int signaled ) if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return; fd->signaled = signaled; if (signaled) wake_up( fd->user, 0 ); + + if (do_fsync() && !signaled) + fsync_clear( fd->user ); + + if (do_esync() && !signaled) + esync_clear( fd->esync_fd ); } /* check if events are pending and if yes return which one(s) */ @@ -2165,6 +2271,24 @@ int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry ) return ret; } +int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct fd *fd = get_obj_fd( obj ); + int ret = fd->esync_fd; + *type = ESYNC_MANUAL_SERVER; + release_object( fd ); + return ret; +} + +unsigned int default_fd_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct fd *fd = get_obj_fd( obj ); + unsigned int ret = fd->fsync_idx; + *type = FSYNC_MANUAL_SERVER; + release_object( fd ); + return ret; +} + int default_fd_get_poll_events( struct fd *fd ) { int events = 0; diff --git a/server/file.c b/server/file.c index 76c687833c9..3d9bb46c590 100644 --- a/server/file.c +++ b/server/file.c @@ -31,11 +31,22 @@ #include #include #include +#include #include #ifdef HAVE_UTIME_H #include #endif #include +#ifdef HAVE_ATTR_XATTR_H +#undef XATTR_ADDITIONAL_OPTIONS +#include +#elif defined(HAVE_SYS_XATTR_H) +#include +#endif +#ifdef HAVE_SYS_EXTATTR_H +#undef XATTR_ADDITIONAL_OPTIONS +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -63,6 +74,24 @@ struct type_descr file_type = }, }; +#ifndef XATTR_USER_PREFIX +#define XATTR_USER_PREFIX "user." +#endif +#ifndef XATTR_USER_PREFIX_LEN +#define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1) +#endif +#ifndef XATTR_SIZE_MAX +#define XATTR_SIZE_MAX 65536 +#endif + +/* We intentionally do not match the Samba 4 extended attribute for NT security descriptors (SDs): + * 1) Samba stores this information using an internal data structure (we use a flat NT SD). + * 2) Samba uses the attribute "security.NTACL". This attribute is within a namespace that only + * the administrator has write access to, which prohibits the user from copying the attributes + * when copying a file and would require Wine to run with adminstrative privileges. + */ +#define WINE_XATTR_SD XATTR_USER_PREFIX "wine.sd" + struct file { struct object obj; /* object header */ @@ -94,6 +123,8 @@ static const struct object_ops file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + default_fd_get_esync_fd, /* get_esync_fd */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ file_get_fd, /* get_fd */ @@ -155,6 +186,7 @@ struct file *create_file_for_fd( int fd, unsigned int access, unsigned int shari release_object( file ); return NULL; } + set_unix_name_of_fd( file->fd, &st ); allow_fd_caching( file->fd ); return file; } @@ -186,7 +218,8 @@ struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, unsigne return file; } -static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_t mode ) +static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ) { struct file *file = alloc_object( &file_ops ); @@ -198,6 +231,12 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ list_init( &file->kernel_object ); grab_object( fd ); set_fd_user( fd, &file_fd_ops, &file->obj ); + + if (sd) file_set_sd( &file->obj, sd, OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION ); + return &file->obj; } @@ -207,6 +246,72 @@ int is_file_executable( const char *name ) return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" )); } +#ifdef HAVE_SYS_EXTATTR_H +static inline int xattr_valid_namespace( const char *name ) +{ + if (strncmp( XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN ) != 0) + { + errno = EPERM; + return 0; + } + return 1; +} +#endif + +static int xattr_fget( int filedes, const char *name, void *value, size_t size ) +{ +#if defined(XATTR_ADDITIONAL_OPTIONS) + return fgetxattr( filedes, name, value, size, 0, 0 ); +#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H) + return fgetxattr( filedes, name, value, size ); +#elif defined(HAVE_SYS_EXTATTR_H) + if (!xattr_valid_namespace( name )) return -1; + return extattr_get_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN], + value, size ); +#else + errno = ENOSYS; + return -1; +#endif +} + +static int xattr_fset( int filedes, const char *name, void *value, size_t size ) +{ +#if defined(XATTR_ADDITIONAL_OPTIONS) + return fsetxattr( filedes, name, value, size, 0, 0 ); +#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H) + return fsetxattr( filedes, name, value, size, 0 ); +#elif defined(HAVE_SYS_EXTATTR_H) + if (!xattr_valid_namespace( name )) return -1; + return extattr_set_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN], + value, size ); +#else + errno = ENOSYS; + return -1; +#endif +} + +static void set_xattr_sd( int fd, const struct security_descriptor *sd ) +{ + char buffer[XATTR_SIZE_MAX]; + int present, len; + const struct acl *dacl; + + /* there's no point in storing the security descriptor if there's no DACL */ + if (!sd) return; + dacl = sd_get_dacl( sd, &present ); + if (!present || !dacl) return; + + len = 2 + sizeof(struct security_descriptor) + sd->owner_len + + sd->group_len + sd->sacl_len + sd->dacl_len; + if (len > XATTR_SIZE_MAX) return; + + /* include the descriptor revision and resource manager control bits */ + buffer[0] = SECURITY_DESCRIPTOR_REVISION; + buffer[1] = 0; + memcpy( &buffer[2], sd, len - 2 ); + xattr_fset( fd, WINE_XATTR_SD, buffer, len ); +} + static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len, struct unicode_str nt_name, unsigned int access, unsigned int sharing, int create, @@ -270,11 +375,11 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si if (!fd) goto done; if (S_ISDIR(mode)) - obj = create_dir_obj( fd, access, mode ); + obj = create_dir_obj( fd, access, mode, sd ); else if (S_ISCHR(mode) && is_serial_fd( fd )) obj = create_serial( fd ); else - obj = create_file_obj( fd, access, mode ); + obj = create_file_obj( fd, access, mode, sd ); release_object( fd ); @@ -387,37 +492,91 @@ struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, con return sd; } -static struct security_descriptor *file_get_sd( struct object *obj ) +/* Convert generic rights into standard access rights */ +static void convert_generic_sd( struct security_descriptor *sd ) +{ + const struct acl *dacl; + int present; + + dacl = sd_get_dacl( sd, &present ); + if (present && dacl) + { + const struct ace *ace = (const struct ace *)(dacl + 1); + ULONG i; + + for (i = 0; i < dacl->count; i++, ace = ace_next( ace )) + { + DWORD *mask = (DWORD *)(ace + 1); + *mask = map_access( *mask, &file_type.mapping ); + } + } +} + +static struct security_descriptor *get_xattr_sd( int fd ) { - struct file *file = (struct file *)obj; - struct stat st; - int unix_fd; struct security_descriptor *sd; + char buffer[XATTR_SIZE_MAX]; + int n; - assert( obj->ops == &file_ops ); + n = xattr_fget( fd, WINE_XATTR_SD, buffer, sizeof(buffer) ); + if (n == -1 || n < 2 + sizeof(struct security_descriptor)) return NULL; - unix_fd = get_file_unix_fd( file ); + /* validate that we can handle the descriptor */ + if (buffer[0] != SECURITY_DESCRIPTOR_REVISION || buffer[1] != 0 || + !sd_is_valid( (struct security_descriptor *)&buffer[2], n - 2 )) + return NULL; + + sd = mem_alloc( n - 2 ); + if (sd) + { + memcpy( sd, &buffer[2], n - 2 ); + convert_generic_sd( sd ); /* for backwards compatibility */ + } + return sd; +} + +struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, + uid_t *uid ) +{ + int unix_fd = get_unix_fd( fd ); + struct stat st; + struct security_descriptor *sd; if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return obj->sd; /* mode and uid the same? if so, no need to re-generate security descriptor */ - if (obj->sd && (st.st_mode & (S_IRWXU|S_IRWXO)) == (file->mode & (S_IRWXU|S_IRWXO)) && - (st.st_uid == file->uid)) + if (obj->sd && (st.st_mode & (S_IRWXU|S_IRWXO)) == (*mode & (S_IRWXU|S_IRWXO)) && + (st.st_uid == *uid)) return obj->sd; - sd = mode_to_sd( st.st_mode, - security_unix_uid_to_sid( st.st_uid ), - token_get_primary_group( current->process->token )); + sd = get_xattr_sd( unix_fd ); + if (!sd) sd = mode_to_sd( st.st_mode, + security_unix_uid_to_sid( st.st_uid ), + token_get_primary_group( current->process->token )); if (!sd) return obj->sd; - file->mode = st.st_mode; - file->uid = st.st_uid; + *mode = st.st_mode; + *uid = st.st_uid; free( obj->sd ); obj->sd = sd; return sd; } +static struct security_descriptor *file_get_sd( struct object *obj ) +{ + struct file *file = (struct file *)obj; + struct security_descriptor *sd; + struct fd *fd; + + assert( obj->ops == &file_ops ); + + fd = file_get_fd( obj ); + sd = get_file_sd( obj, fd, &file->mode, &file->uid ); + release_object( fd ); + return sd; +} + static mode_t file_access_to_mode( unsigned int access ) { mode_t mode = 0; @@ -461,7 +620,7 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner { bits_to_set &= ~((mode << 6) | (mode << 3)); /* user + group */ } - else if (equal_sid( sid, owner )) + else if (equal_sid( sid, owner ) || equal_sid( sid, &owner_rights_sid )) { bits_to_set &= ~(mode << 6); /* user only */ } @@ -480,7 +639,7 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner new_mode |= mode & bits_to_set; bits_to_set &= ~mode; } - else if (equal_sid( sid, owner )) + else if (equal_sid( sid, owner ) || equal_sid( sid, &owner_rights_sid )) { mode = (mode << 6); /* user only */ new_mode |= mode & bits_to_set; @@ -497,54 +656,75 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner return new_mode; } -static int file_set_sd( struct object *obj, const struct security_descriptor *sd, - unsigned int set_info ) +int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, + const struct security_descriptor *sd, unsigned int set_info ) { - struct file *file = (struct file *)obj; - const struct sid *owner; + struct security_descriptor *new_sd; + int unix_fd = get_unix_fd( fd ); + const struct sid *owner, *group; struct stat st; - mode_t mode; - int unix_fd; + mode_t new_mode; - assert( obj->ops == &file_ops ); + if (!set_info || unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; + if (!obj->sd) get_file_sd( obj, fd, mode, uid ); - unix_fd = get_file_unix_fd( file ); + /* calculate the new sd, save to a temporary variable before assigning */ + new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, current->process->token ); + if (new_sd) + { + /* convert generic rights into standard access rights */ + convert_generic_sd( new_sd ); - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; + if (set_info & OWNER_SECURITY_INFORMATION) + { + owner = sd_get_owner( new_sd ); + assert( owner ); - if (set_info & OWNER_SECURITY_INFORMATION) - { - owner = sd_get_owner( sd ); - if (!owner) - { - set_error( STATUS_INVALID_SECURITY_DESCR ); - return 0; - } - if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) - { - /* FIXME: get Unix uid and call fchown */ - } - } - else if (obj->sd) - owner = sd_get_owner( obj->sd ); - else - owner = token_get_owner( current->process->token ); + if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) + { + /* FIXME: get Unix uid and call fchown */ + } + } - /* group and sacl not supported */ + if (set_info & GROUP_SECURITY_INFORMATION) + { + group = sd_get_group( new_sd ); + assert( group ); - if (set_info & DACL_SECURITY_INFORMATION) - { - /* keep the bits that we don't map to access rights in the ACL */ - mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); - mode |= sd_to_mode( sd, owner ); + if (!obj->sd || !equal_sid( group, sd_get_group( obj->sd ) )) + { + /* FIXME: get Unix uid and call fchown */ + } + } - if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1) + if (set_info & DACL_SECURITY_INFORMATION) { - file_set_error(); - return 0; - } - } - return 1; + owner = sd_get_owner( new_sd ); + assert( owner ); + + /* keep the bits that we don't map to access rights in the ACL */ + new_mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); + new_mode |= sd_to_mode( new_sd, owner ); + + if (((st.st_mode ^ new_mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, new_mode ) == -1) + { + free( new_sd ); + file_set_error(); + return 0; + } + + *mode = (*mode & S_IFMT) | new_mode; + } + + /* extended attributes are set after the file mode, to ensure it stays in sync */ + set_xattr_sd( unix_fd, new_sd ); + + free( obj->sd ); + obj->sd = new_sd; + return 1; + } + + return 0; } static struct object *file_lookup_name( struct object *obj, struct unicode_str *name, @@ -583,6 +763,21 @@ static struct list *file_get_kernel_obj_list( struct object *obj ) return &file->kernel_object; } +static int file_set_sd( struct object *obj, const struct security_descriptor *sd, + unsigned int set_info ) +{ + struct file *file = (struct file *)obj; + struct fd *fd; + int ret; + + assert( obj->ops == &file_ops ); + + fd = file_get_fd( obj ); + ret = set_file_sd( obj, fd, &file->mode, &file->uid, sd, set_info ); + release_object( fd ); + return ret; +} + static void file_destroy( struct object *obj ) { struct file *file = (struct file *)obj; @@ -669,7 +864,10 @@ DECL_HANDLER(create_file) if ((file = create_file( root_fd, name, name_len, nt_name, req->access, req->sharing, req->create, req->options, req->attrs, sd ))) { - reply->handle = alloc_handle( current->process, file, req->access, objattr->attributes ); + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, file, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, file, req->access, objattr->attributes ); release_object( file ); } if (root_fd) release_object( root_fd ); diff --git a/server/file.h b/server/file.h index 39a833cd105..f5f1ed357ae 100644 --- a/server/file.h +++ b/server/file.h @@ -22,6 +22,7 @@ #define __WINE_SERVER_FILE_H #include +#include #include "object.h" @@ -85,6 +86,7 @@ extern struct fd *open_fd( struct fd *root, const char *name, struct unicode_str unsigned int sharing, unsigned int options ); extern struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops, int unix_fd, struct object *user, unsigned int options ); +extern void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st ); extern struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sharing, unsigned int options ); extern struct fd *get_fd_object_for_mapping( struct fd *fd, unsigned int access, unsigned int sharing ); @@ -108,6 +110,8 @@ extern char *dup_fd_name( struct fd *root, const char *name ) __WINE_DEALLOC(fre extern void get_nt_name( struct fd *fd, struct unicode_str *name ); extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry ); +extern int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ); +extern unsigned int default_fd_get_fsync_idx( struct object *obj, enum fsync_type *type ); extern int default_fd_get_poll_events( struct fd *fd ); extern void default_poll_event( struct fd *fd, int event ); extern void fd_cancel_async( struct fd *fd, struct async *async ); @@ -158,6 +162,11 @@ extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback f extern void remove_timeout_user( struct timeout_user *user ); extern const char *get_timeout_str( timeout_t timeout ); +/* directory functions */ + +extern struct object *create_desktop_map_directory( struct winstation *winstation ); +extern struct object *create_thread_map_directory( void ); + /* file functions */ extern struct file *get_file_obj( struct process *process, obj_handle_t handle, @@ -169,6 +178,10 @@ extern void file_set_error(void); extern struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, const struct sid *group ); extern mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner ); extern int is_file_executable( const char *name ); +extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, + const struct security_descriptor *sd, unsigned int set_info ); +extern struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, + uid_t *uid ); /* file mapping functions */ @@ -186,6 +199,8 @@ extern void free_mapped_views( struct process *process ); extern int get_page_size(void); extern struct mapping *create_fd_mapping( struct object *root, const struct unicode_str *name, struct fd *fd, unsigned int attr, const struct security_descriptor *sd ); +extern struct object *create_shared_mapping( struct object *root, const struct unicode_str *name, mem_size_t size, + unsigned int attr, const struct security_descriptor *sd, void **ptr ); extern struct object *create_user_data_mapping( struct object *root, const struct unicode_str *name, unsigned int attr, const struct security_descriptor *sd ); @@ -206,7 +221,8 @@ extern struct object *create_unix_device( struct object *root, const struct unic extern void do_change_notify( int unix_fd ); extern void sigio_callback(void); -extern struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ); +extern struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ); extern struct dir *get_dir_obj( struct process *process, obj_handle_t handle, unsigned int access ); /* completion */ @@ -237,6 +253,7 @@ extern void set_async_pending( struct async *async ); extern void async_set_initial_status( struct async *async, unsigned int status ); extern void async_wake_obj( struct async *async ); extern int async_waiting( struct async_queue *queue ); +extern int async_queue_has_waiting_asyncs( struct async_queue *queue ); extern void async_terminate( struct async *async, unsigned int status ); extern void async_request_complete( struct async *async, unsigned int status, data_size_t result, data_size_t out_size, void *out_data ); diff --git a/server/fsync.c b/server/fsync.c new file mode 100644 index 00000000000..dc50aa0a1f3 --- /dev/null +++ b/server/fsync.c @@ -0,0 +1,630 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "handle.h" +#include "request.h" +#include "fsync.h" + +#include "pshpack4.h" +#include "poppack.h" + +#ifndef __NR_futex_waitv +#define __NR_futex_waitv 449 +#endif + +int do_fsync(void) +{ +#ifdef __linux__ + static int do_fsync_cached = -1; + + if (do_fsync_cached == -1) + { + syscall( __NR_futex_waitv, 0, 0, 0, 0, 0); + do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; + } + + return do_fsync_cached; +#else + return 0; +#endif +} + +static char shm_name[29]; +static int shm_fd; +static off_t shm_size; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ + +static int is_fsync_initialized; + +static uint64_t *shm_idx_free_map; +static uint32_t shm_idx_free_map_size; /* uint64_t word count */ +static uint32_t shm_idx_free_search_start_hint; + +#define BITS_IN_FREE_MAP_WORD (8 * sizeof(*shm_idx_free_map)) + +static void shm_cleanup(void) +{ + close( shm_fd ); + if (shm_unlink( shm_name ) == -1) + perror( "shm_unlink" ); +} + +void fsync_init(void) +{ + struct stat st; + + if (fstat( config_dir_fd, &st ) == -1) + fatal_error( "cannot stat config dir\n" ); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-fsync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-fsync", (unsigned long)st.st_ino ); + + if (!shm_unlink( shm_name )) + fprintf( stderr, "fsync: warning: a previous shm file %s was not properly removed\n", shm_name ); + + shm_fd = shm_open( shm_name, O_RDWR | O_CREAT | O_EXCL, 0644 ); + if (shm_fd == -1) + perror( "shm_open" ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; + + shm_size = FSYNC_SHM_PAGE_SIZE; + if (ftruncate( shm_fd, shm_size ) == -1) + perror( "ftruncate" ); + + is_fsync_initialized = 1; + + fprintf( stderr, "fsync: up and running.\n" ); + + shm_idx_free_map_size = 256; + shm_idx_free_map = malloc( shm_idx_free_map_size * sizeof(*shm_idx_free_map) ); + memset( shm_idx_free_map, 0xff, shm_idx_free_map_size * sizeof(*shm_idx_free_map) ); + shm_idx_free_map[0] &= ~(uint64_t)1; /* Avoid allocating shm_index 0. */ + + atexit( shm_cleanup ); +} + +static struct list mutex_list = LIST_INIT(mutex_list); + +struct fsync +{ + struct object obj; + unsigned int shm_idx; + enum fsync_type type; + struct list mutex_entry; +}; + +static void fsync_dump( struct object *obj, int verbose ); +static unsigned int fsync_get_fsync_idx( struct object *obj, enum fsync_type *type ); +static unsigned int fsync_map_access( struct object *obj, unsigned int access ); +static void fsync_destroy( struct object *obj ); + +const struct object_ops fsync_ops = +{ + sizeof(struct fsync), /* size */ + &no_type, /* type */ + fsync_dump, /* dump */ + no_add_queue, /* add_queue */ + NULL, /* remove_queue */ + NULL, /* signaled */ + NULL, /* get_esync_fd */ + fsync_get_fsync_idx, /* get_fsync_idx */ + NULL, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + fsync_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + default_get_full_name, /* get_full_name */ + no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_close_handle, /* close_handle */ + fsync_destroy /* destroy */ +}; + +static void fsync_dump( struct object *obj, int verbose ) +{ + struct fsync *fsync = (struct fsync *)obj; + assert( obj->ops == &fsync_ops ); + fprintf( stderr, "fsync idx=%d\n", fsync->shm_idx ); +} + +static unsigned int fsync_get_fsync_idx( struct object *obj, enum fsync_type *type) +{ + struct fsync *fsync = (struct fsync *)obj; + *type = fsync->type; + return fsync->shm_idx; +} + +static unsigned int fsync_map_access( struct object *obj, unsigned int access ) +{ + /* Sync objects have the same flags. */ + if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | EVENT_QUERY_STATE; + if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE; + if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE; + if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + +static void fsync_destroy( struct object *obj ) +{ + struct fsync *fsync = (struct fsync *)obj; + if (fsync->type == FSYNC_MUTEX) + list_remove( &fsync->mutex_entry ); + fsync_free_shm_idx( fsync->shm_idx ); +} + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 16) / FSYNC_SHM_PAGE_SIZE; + int offset = (idx * 16) % FSYNC_SHM_PAGE_SIZE; + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + fprintf( stderr, "fsync: couldn't expand shm_addrs array to size %d\n", entry + 1 ); + + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, FSYNC_SHM_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, + (off_t)entry * FSYNC_SHM_PAGE_SIZE ); + if (addr == (void *)-1) + { + fprintf( stderr, "fsync: failed to map page %d (offset %#zx): ", + entry, (size_t)entry * FSYNC_SHM_PAGE_SIZE ); + perror( "mmap" ); + } + + if (debug_level) + fprintf( stderr, "fsync: Mapping page %d at %p.\n", entry, addr ); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, FSYNC_SHM_PAGE_SIZE ); /* someone beat us to it */ + } + + return (void *)((unsigned long)shm_addrs[entry] + offset); +} + +static int alloc_shm_idx_from_word( unsigned int word_index ) +{ + int ret; + + if (!shm_idx_free_map[word_index]) return 0; + + ret = __builtin_ctzll( shm_idx_free_map[word_index] ); + shm_idx_free_map[word_index] &= ~((uint64_t)1 << ret); + shm_idx_free_search_start_hint = shm_idx_free_map[word_index] ? word_index : word_index + 1; + return word_index * BITS_IN_FREE_MAP_WORD + ret; +} + +unsigned int fsync_alloc_shm( int low, int high ) +{ +#ifdef __linux__ + unsigned int i; + int shm_idx; + int *shm; + + /* this is arguably a bit of a hack, but we need some way to prevent + * allocating shm for the master socket */ + if (!is_fsync_initialized) + return 0; + + /* shm_idx_free_search_start_hint is always at the first word with a free index or before that. */ + for (i = shm_idx_free_search_start_hint; i < shm_idx_free_map_size; ++i) + if ((shm_idx = alloc_shm_idx_from_word( i ))) break; + + if (!shm_idx) + { + uint32_t old_size, new_size; + uint64_t *new_alloc; + + old_size = shm_idx_free_map_size; + new_size = old_size + 256; + new_alloc = realloc( shm_idx_free_map, new_size * sizeof(*new_alloc) ); + if (!new_alloc) + { + fprintf( stderr, "fsync: couldn't expand shm_idx_free_map to size %zd.", + new_size * sizeof(*new_alloc) ); + return 0; + } + memset( new_alloc + old_size, 0xff, (new_size - old_size) * sizeof(*new_alloc) ); + shm_idx_free_map = new_alloc; + shm_idx_free_map_size = new_size; + shm_idx = alloc_shm_idx_from_word( old_size ); + } + + while (shm_idx * 16 >= shm_size) + { + /* Better expand the shm section. */ + shm_size += FSYNC_SHM_PAGE_SIZE; + if (ftruncate( shm_fd, shm_size ) == -1) + { + fprintf( stderr, "fsync: couldn't expand %s to size %jd: ", + shm_name, shm_size ); + perror( "ftruncate" ); + } + } + + shm = get_shm( shm_idx ); + assert(shm); + shm[0] = low; + shm[1] = high; + shm[2] = 1; /* Reference count. */ + shm[3] = 0; /* Last reference process id. */ + + return shm_idx; +#else + return 0; +#endif +} + +void fsync_free_shm_idx( int shm_idx ) +{ + unsigned int idx; + uint64_t mask; + int *shm; + + assert( shm_idx ); + assert( shm_idx < shm_idx_free_map_size * BITS_IN_FREE_MAP_WORD ); + + shm = get_shm( shm_idx ); + if (shm[2] <= 0) + { + fprintf( stderr, "wineserver: fsync err: shm refcount is %d.\n", shm[2] ); + return; + } + + if (__atomic_sub_fetch( &shm[2], 1, __ATOMIC_SEQ_CST )) + { + /* Sync object is still referenced in a process. */ + return; + } + + idx = shm_idx / BITS_IN_FREE_MAP_WORD; + mask = (uint64_t)1 << (shm_idx % BITS_IN_FREE_MAP_WORD); + assert( !(shm_idx_free_map[idx] & mask) ); + shm_idx_free_map[idx] |= mask; + if (idx < shm_idx_free_search_start_hint) + shm_idx_free_search_start_hint = idx; +} + +/* Try to cleanup the shared mem indices locked by the wait on the killed processes. + * This is not fully reliable but should avoid leaking the majority of indices on + * process kill. */ +void fsync_cleanup_process_shm_indices( process_id_t id ) +{ + uint64_t free_word; + unsigned int i, j; + void *shmbase; + int *shm; + + for (i = 0; i < shm_idx_free_map_size; ++i) + { + free_word = shm_idx_free_map[i]; + if (free_word == ~(uint64_t)0) continue; + shmbase = get_shm( i * BITS_IN_FREE_MAP_WORD ); + for (j = !i; j < BITS_IN_FREE_MAP_WORD; ++j) + { + shm = (int *)((char *)shmbase + j * 16); + if (!(free_word & ((uint64_t)1 << j)) && shm[3] == id + && __atomic_load_n( &shm[2], __ATOMIC_SEQ_CST ) == 1) + fsync_free_shm_idx( i * BITS_IN_FREE_MAP_WORD + j ); + } + } +} + +static int type_matches( enum fsync_type type1, enum fsync_type type2 ) +{ + return (type1 == type2) || + ((type1 == FSYNC_AUTO_EVENT || type1 == FSYNC_MANUAL_EVENT) && + (type2 == FSYNC_AUTO_EVENT || type2 == FSYNC_MANUAL_EVENT)); +} + +struct fsync *create_fsync( struct object *root, const struct unicode_str *name, + unsigned int attr, int low, int high, enum fsync_type type, + const struct security_descriptor *sd ) +{ +#ifdef __linux__ + struct fsync *fsync; + + if ((fsync = create_named_object( root, &fsync_ops, name, attr, sd ))) + { + if (get_error() != STATUS_OBJECT_NAME_EXISTS) + { + /* initialize it if it didn't already exist */ + + /* Initialize the shared memory portion. We want to do this on the + * server side to avoid a potential though unlikely race whereby + * the same object is opened and used between the time it's created + * and the time its shared memory portion is initialized. */ + + fsync->shm_idx = fsync_alloc_shm( low, high ); + fsync->type = type; + if (type == FSYNC_MUTEX) + list_add_tail( &mutex_list, &fsync->mutex_entry ); + } + else + { + /* validate the type */ + if (!type_matches( type, fsync->type )) + { + release_object( &fsync->obj ); + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return NULL; + } + } + } + + return fsync; +#else + set_error( STATUS_NOT_IMPLEMENTED ); + return NULL; +#endif +} + +static inline int futex_wake( int *addr, int val ) +{ + return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); +} + +/* shm layout for events or event-like objects. */ +struct fsync_event +{ + int signaled; + int unused; + int ref; + int last_pid; +}; + +void fsync_wake_futex( unsigned int shm_idx ) +{ + struct fsync_event *event; + + if (debug_level) + fprintf( stderr, "fsync_wake_futex: index %u\n", shm_idx ); + + if (!shm_idx) + return; + + event = get_shm( shm_idx ); + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + futex_wake( &event->signaled, INT_MAX ); +} + +void fsync_wake_up( struct object *obj ) +{ + enum fsync_type type; + + if (debug_level) + fprintf( stderr, "fsync_wake_up: object %p\n", obj ); + + if (obj->ops->get_fsync_idx) + fsync_wake_futex( obj->ops->get_fsync_idx( obj, &type ) ); +} + +void fsync_clear_futex( unsigned int shm_idx ) +{ + struct fsync_event *event; + + if (debug_level) + fprintf( stderr, "fsync_clear_futex: index %u\n", shm_idx ); + + if (!shm_idx) + return; + + event = get_shm( shm_idx ); + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); +} + +void fsync_clear( struct object *obj ) +{ + enum fsync_type type; + + if (debug_level) + fprintf( stderr, "fsync_clear: object %p\n", obj ); + + if (obj->ops->get_fsync_idx) + fsync_clear_futex( obj->ops->get_fsync_idx( obj, &type ) ); +} + +void fsync_set_event( struct fsync *fsync ) +{ + struct fsync_event *event = get_shm( fsync->shm_idx ); + assert( fsync->obj.ops == &fsync_ops ); + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + futex_wake( &event->signaled, INT_MAX ); +} + +void fsync_reset_event( struct fsync *fsync ) +{ + struct fsync_event *event = get_shm( fsync->shm_idx ); + assert( fsync->obj.ops == &fsync_ops ); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); +} + +struct mutex +{ + int tid; + int count; /* recursion count */ +}; + +void fsync_abandon_mutexes( struct thread *thread ) +{ + struct fsync *fsync; + + LIST_FOR_EACH_ENTRY( fsync, &mutex_list, struct fsync, mutex_entry ) + { + struct mutex *mutex = get_shm( fsync->shm_idx ); + + if (mutex->tid == thread->id) + { + if (debug_level) + fprintf( stderr, "fsync_abandon_mutexes() idx=%d\n", fsync->shm_idx ); + mutex->tid = ~0; + mutex->count = 0; + futex_wake( &mutex->tid, INT_MAX ); + } + } +} + +DECL_HANDLER(create_fsync) +{ + struct fsync *fsync; + struct unicode_str name; + struct object *root; + const struct security_descriptor *sd; + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); + + if (!do_fsync()) + { + set_error( STATUS_NOT_IMPLEMENTED ); + return; + } + + if (!objattr) return; + + if ((fsync = create_fsync( root, &name, objattr->attributes, req->low, + req->high, req->type, sd ))) + { + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, fsync, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, fsync, + req->access, objattr->attributes ); + + reply->shm_idx = fsync->shm_idx; + reply->type = fsync->type; + release_object( fsync ); + } + + if (root) release_object( root ); +} + +DECL_HANDLER(open_fsync) +{ + struct unicode_str name = get_req_unicode_str(); + + reply->handle = open_object( current->process, req->rootdir, req->access, + &fsync_ops, &name, req->attributes ); + + if (reply->handle) + { + struct fsync *fsync; + + if (!(fsync = (struct fsync *)get_handle_obj( current->process, reply->handle, + 0, &fsync_ops ))) + return; + + if (!type_matches( req->type, fsync->type )) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + release_object( fsync ); + return; + } + + reply->type = fsync->type; + reply->shm_idx = fsync->shm_idx; + release_object( fsync ); + } +} + +/* Retrieve the index of a shm section which will be signaled by the server. */ +DECL_HANDLER(get_fsync_idx) +{ + struct object *obj; + enum fsync_type type; + + if (!(obj = get_handle_obj( current->process, req->handle, SYNCHRONIZE, NULL ))) + return; + + if (obj->ops->get_fsync_idx) + { + int *shm; + + reply->shm_idx = obj->ops->get_fsync_idx( obj, &type ); + reply->type = type; + shm = get_shm( reply->shm_idx ); + __atomic_add_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); + } + else + { + if (debug_level) + { + fprintf( stderr, "%04x: fsync: can't wait on object: ", current->id ); + obj->ops->dump( obj, 0 ); + } + set_error( STATUS_NOT_IMPLEMENTED ); + } + + release_object( obj ); +} + +DECL_HANDLER(get_fsync_apc_idx) +{ + reply->shm_idx = current->fsync_apc_idx; +} + +DECL_HANDLER(fsync_free_shm_idx) +{ + if (!req->shm_idx || req->shm_idx >= shm_idx_free_map_size * BITS_IN_FREE_MAP_WORD) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + fsync_free_shm_idx( req->shm_idx ); +} diff --git a/server/fsync.h b/server/fsync.h new file mode 100644 index 00000000000..d4bd889a7f8 --- /dev/null +++ b/server/fsync.h @@ -0,0 +1,36 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_fsync(void); +extern void fsync_init(void); +extern unsigned int fsync_alloc_shm( int low, int high ); +extern void fsync_free_shm_idx( int shm_idx ); +extern void fsync_wake_futex( unsigned int shm_idx ); +extern void fsync_clear_futex( unsigned int shm_idx ); +extern void fsync_wake_up( struct object *obj ); +extern void fsync_clear( struct object *obj ); + +struct fsync; + +extern const struct object_ops fsync_ops; +extern void fsync_set_event( struct fsync *fsync ); +extern void fsync_reset_event( struct fsync *fsync ); +extern void fsync_abandon_mutexes( struct thread *thread ); +extern void fsync_cleanup_process_shm_indices( process_id_t id ); diff --git a/server/handle.c b/server/handle.c index 0595fdb403b..48b5d8101bb 100644 --- a/server/handle.c +++ b/server/handle.c @@ -126,6 +126,8 @@ static const struct object_ops handle_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/hook.c b/server/hook.c index 5abdf39ad37..24eb27434db 100644 --- a/server/hook.c +++ b/server/hook.c @@ -80,6 +80,8 @@ static const struct object_ops hook_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -355,7 +357,7 @@ static int is_hook_active( struct hook_table *table, int index ) } /* get a bitmap of all active hooks for the current thread */ -unsigned int get_active_hooks(void) +static unsigned int get_active_hooks(void) { struct hook_table *table = get_queue_hooks( current ); struct hook_table *global_hooks = get_global_hooks( current ); @@ -372,16 +374,45 @@ unsigned int get_active_hooks(void) } /* return the thread that owns the first global hook */ -struct thread *get_first_global_hook( int id ) +struct thread *get_first_global_hook( int id, thread_id_t *thread_id, client_ptr_t *proc ) { struct hook *hook; struct hook_table *global_hooks = get_global_hooks( current ); if (!global_hooks) return NULL; if (!(hook = get_first_valid_hook( global_hooks, id - WH_MINHOOK, EVENT_MIN, 0, 0, 0 ))) return NULL; + *thread_id = hook->owner->id; + *proc = hook->proc; return hook->owner; } +void disable_hung_hook( struct desktop *desktop, int id, thread_id_t thread_id, client_ptr_t proc ) +{ + struct hook_table *global_hooks = desktop->global_hooks; + int index = id - WH_MINHOOK; + struct hook *hook; + + if (!global_hooks || !proc) return; + + hook = get_first_hook( global_hooks, index ); + + while (hook) + { + if (hook->proc == proc && hook->owner->id == thread_id) + { + hook->proc = 0; + return; + } + hook = HOOK_ENTRY( list_next( &global_hooks->hooks[index], &hook->chain ) ); + } +} + +/* get thread active hooks */ +DECL_HANDLER(get_active_hooks) +{ + reply->active_hooks = get_active_hooks(); +} + /* set a window hook */ DECL_HANDLER(set_hook) { diff --git a/server/mailslot.c b/server/mailslot.c index 2d8697ec9bd..41fb020aaf0 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -74,6 +74,8 @@ static const struct object_ops mailslot_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_get_fd, /* get_fd */ @@ -133,6 +135,8 @@ static const struct object_ops mail_writer_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ mail_writer_get_fd, /* get_fd */ @@ -196,6 +200,8 @@ static const struct object_ops mailslot_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -226,6 +232,8 @@ static const struct object_ops mailslot_device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_device_file_get_fd, /* get_fd */ diff --git a/server/main.c b/server/main.c index 1248b92f24d..d0a0a4879b5 100644 --- a/server/main.c +++ b/server/main.c @@ -34,11 +34,14 @@ #include "thread.h" #include "request.h" #include "unicode.h" +#include "security.h" +#include "esync.h" +#include "fsync.h" /* command-line options */ int debug_level = 0; int foreground = 0; -timeout_t master_socket_timeout = 3 * -TICKS_PER_SEC; /* master socket timeout, default is 3 seconds */ +timeout_t master_socket_timeout = 0; /* master socket timeout, default is 3 seconds */ const char *server_argv0; /* parse-line args */ @@ -229,11 +232,22 @@ int main( int argc, char *argv[] ) sock_init(); open_master_socket(); + if (do_fsync()) + fsync_init(); + + if (do_esync()) + esync_init(); + + if (!do_fsync() && !do_esync()) + fprintf( stderr, "wineserver: using server-side synchronization.\n" ); + if (debug_level) fprintf( stderr, "wineserver: starting (pid=%ld)\n", (long) getpid() ); set_current_time(); init_signals(); init_memory(); + init_user_sid(); init_directories( load_intl_file() ); + init_threading(); init_registry(); main_loop(); return 0; diff --git a/server/mapping.c b/server/mapping.c index f754078acf7..6d39411f23d 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -43,6 +44,10 @@ #include "request.h" #include "security.h" +#ifndef F_SEAL_FUTURE_WRITE +#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */ +#endif + /* list of memory ranges, used to store committed info */ struct ranges { @@ -67,6 +72,8 @@ static const struct object_ops ranges_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -103,6 +110,8 @@ static const struct object_ops shared_map_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -155,16 +164,19 @@ struct type_descr mapping_type = struct mapping { struct object obj; /* object header */ + struct list kernel_object; /* list of kernel object pointers */ mem_size_t size; /* mapping size */ unsigned int flags; /* SEC_* flags */ struct fd *fd; /* fd for mapped file */ pe_image_info_t image; /* image info (for PE image mapping) */ struct ranges *committed; /* list of committed ranges in this mapping */ struct shared_map *shared; /* temp file for shared PE mapping */ + void *shared_ptr; /* mmaped pointer for shared mappings */ }; static void mapping_dump( struct object *obj, int verbose ); static struct fd *mapping_get_fd( struct object *obj ); +static struct list *mapping_get_kernel_obj_list( struct object *obj ); static void mapping_destroy( struct object *obj ); static enum server_fd_type mapping_get_fd_type( struct fd *fd ); @@ -176,6 +188,8 @@ static const struct object_ops mapping_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ mapping_get_fd, /* get_fd */ @@ -187,7 +201,7 @@ static const struct object_ops mapping_ops = directory_link_name, /* link_name */ default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ - no_kernel_obj_list, /* get_kernel_obj_list */ + mapping_get_kernel_obj_list, /* get_kernel_obj_list */ no_close_handle, /* close_handle */ mapping_destroy /* destroy */ }; @@ -283,6 +297,7 @@ int grow_file( int unix_fd, file_pos_t new_size ) return 0; } +#ifndef HAVE_MEMFD_CREATE /* simplified version of mkstemps() */ static int make_temp_file( char name[16] ) { @@ -316,10 +331,23 @@ static int check_current_dir_for_exec(void) unlink( tmpfn ); return (ret != MAP_FAILED); } +#endif /* create a temp file for anonymous mappings */ static int create_temp_file( file_pos_t size ) { +#ifdef HAVE_MEMFD_CREATE + int fd = memfd_create( "wine-mapping", MFD_ALLOW_SEALING ); + if (fd != -1) + { + if (!grow_file( fd, size )) + { + close( fd ); + fd = -1; + } + } + else file_set_error(); +#else static int temp_dir_fd = -1; char tmpfn[16]; int fd; @@ -352,6 +380,7 @@ static int create_temp_file( file_pos_t size ) else file_set_error(); if (temp_dir_fd != server_dir_fd) fchdir( server_dir_fd ); +#endif return fd; } @@ -697,6 +726,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s { static const char builtin_signature[] = "Wine builtin DLL"; static const char fakedll_signature[] = "Wine placeholder DLL"; + static const char valve_signature[] = {'V','L','V',0,1,0,0,0}; IMAGE_COR20_HEADER clr; IMAGE_SECTION_HEADER sec[96]; @@ -786,7 +816,8 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s if (nt.opt.hdr32.SectionAlignment & page_mask) mapping->image.image_flags |= IMAGE_FLAGS_ImageMappedFlat; else if ((nt.opt.hdr32.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) && - (has_relocs || mapping->image.contains_code) && !(clr_va && clr_size)) + (has_relocs || mapping->image.contains_code) && !(clr_va && clr_size) && + memcmp( mz.buffer, valve_signature, sizeof(valve_signature) )) mapping->image.image_flags |= IMAGE_FLAGS_ImageDynamicallyRelocated; break; @@ -834,7 +865,8 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s if (nt.opt.hdr64.SectionAlignment & page_mask) mapping->image.image_flags |= IMAGE_FLAGS_ImageMappedFlat; else if ((nt.opt.hdr64.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) && - (has_relocs || mapping->image.contains_code) && !(clr_va && clr_size)) + (has_relocs || mapping->image.contains_code) && !(clr_va && clr_size) && + memcmp( mz.buffer, valve_signature, sizeof(valve_signature) )) mapping->image.image_flags |= IMAGE_FLAGS_ImageDynamicallyRelocated; break; @@ -942,10 +974,13 @@ static struct mapping *create_mapping( struct object *root, const struct unicode if (get_error() == STATUS_OBJECT_NAME_EXISTS) return mapping; /* Nothing else to do */ + list_init( &mapping->kernel_object ); + mapping->size = size; mapping->fd = NULL; mapping->shared = NULL; mapping->committed = NULL; + mapping->shared_ptr = MAP_FAILED; if (!(mapping->flags = get_mapping_flags( handle, flags ))) goto error; @@ -1033,6 +1068,8 @@ struct mapping *create_fd_mapping( struct object *root, const struct unicode_str if (!(mapping = create_named_object( root, &mapping_ops, name, attr, sd ))) return NULL; if (get_error() == STATUS_OBJECT_NAME_EXISTS) return mapping; /* Nothing else to do */ + list_init( &mapping->kernel_object ); + mapping->shared = NULL; mapping->committed = NULL; mapping->flags = SEC_FILE; @@ -1139,6 +1176,12 @@ static struct fd *mapping_get_fd( struct object *obj ) return (struct fd *)grab_object( mapping->fd ); } +static struct list *mapping_get_kernel_obj_list( struct object *obj ) +{ + struct mapping *mapping = (struct mapping *)obj; + return &mapping->kernel_object; +} + static void mapping_destroy( struct object *obj ) { struct mapping *mapping = (struct mapping *)obj; @@ -1146,6 +1189,7 @@ static void mapping_destroy( struct object *obj ) if (mapping->fd) release_object( mapping->fd ); if (mapping->committed) release_object( mapping->committed ); if (mapping->shared) release_object( mapping->shared ); + if (mapping->shared_ptr != MAP_FAILED) munmap( mapping->shared_ptr, mapping->size ); } static enum server_fd_type mapping_get_fd_type( struct fd *fd ) @@ -1222,6 +1266,36 @@ int get_page_size(void) return page_mask + 1; } +struct object *create_shared_mapping( struct object *root, const struct unicode_str *name, mem_size_t size, + unsigned int attr, const struct security_descriptor *sd, void **ptr ) +{ + static unsigned int access = FILE_READ_DATA | FILE_WRITE_DATA; + struct mapping *mapping; + + if (!(mapping = create_mapping( root, name, attr, size, SEC_COMMIT, 0, access, sd ))) return NULL; + + if (mapping->shared_ptr == MAP_FAILED) + { + int fd = get_unix_fd( mapping->fd ); + + mapping->shared_ptr = mmap( NULL, mapping->size, PROT_WRITE, MAP_SHARED, fd, 0 ); + if (mapping->shared_ptr == MAP_FAILED) + { + fprintf( stderr, "wine: Failed to map shared memory: %u %m\n", errno ); + release_object( &mapping->obj ); + return NULL; + } + +#if defined(HAVE_MEMFD_CREATE) && defined(F_ADD_SEALS) + /* protect the mapping against any future writable mapping, resize or re-sealing */ + fcntl( fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL ); +#endif + } + + *ptr = mapping->shared_ptr; + return &mapping->obj; +} + struct object *create_user_data_mapping( struct object *root, const struct unicode_str *name, unsigned int attr, const struct security_descriptor *sd ) { diff --git a/server/mutex.c b/server/mutex.c index af0efe72132..2503d12057f 100644 --- a/server/mutex.c +++ b/server/mutex.c @@ -73,6 +73,8 @@ static const struct object_ops mutex_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ mutex_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ mutex_satisfied, /* satisfied */ mutex_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/named_pipe.c b/server/named_pipe.c index f3404a33c3b..4efa51e2fec 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -119,6 +119,8 @@ static const struct object_ops named_pipe_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -167,6 +169,8 @@ static const struct object_ops pipe_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + default_fd_get_esync_fd, /* get_esync_fd */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -211,6 +215,8 @@ static const struct object_ops pipe_client_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + default_fd_get_esync_fd, /* get_esync_fd */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -258,6 +264,8 @@ static const struct object_ops named_pipe_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -289,6 +297,8 @@ static const struct object_ops named_pipe_device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_device_file_get_fd, /* get_fd */ diff --git a/server/object.c b/server/object.c index 89e541ffb6b..29f1ea96129 100644 --- a/server/object.c +++ b/server/object.c @@ -548,8 +548,9 @@ struct security_descriptor *default_get_sd( struct object *obj ) return obj->sd; } -int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, - unsigned int set_info, struct token *token ) +struct security_descriptor *set_sd_from_token_internal( const struct security_descriptor *sd, + const struct security_descriptor *old_sd, + unsigned int set_info, struct token *token ) { struct security_descriptor new_sd, *new_sd_ptr; int present; @@ -558,8 +559,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri struct acl *replaced_sacl = NULL; char *ptr; - if (!set_info) return 1; - new_sd.control = sd->control & ~SE_SELF_RELATIVE; if (set_info & OWNER_SECURITY_INFORMATION && sd->owner_len) @@ -567,10 +566,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri owner = sd_get_owner( sd ); new_sd.owner_len = sd->owner_len; } - else if (obj->sd && obj->sd->owner_len) + else if (old_sd && old_sd->owner_len) { - owner = sd_get_owner( obj->sd ); - new_sd.owner_len = obj->sd->owner_len; + owner = sd_get_owner( old_sd ); + new_sd.owner_len = old_sd->owner_len; } else if (token) { @@ -584,10 +583,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri group = sd_get_group( sd ); new_sd.group_len = sd->group_len; } - else if (obj->sd && obj->sd->group_len) + else if (old_sd && old_sd->group_len) { - group = sd_get_group( obj->sd ); - new_sd.group_len = obj->sd->group_len; + group = sd_get_group( old_sd ); + new_sd.group_len = old_sd->group_len; } else if (token) { @@ -605,20 +604,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri else if (set_info & LABEL_SECURITY_INFORMATION && present) { const struct acl *old_sacl = NULL; - if (obj->sd && obj->sd->control & SE_SACL_PRESENT) old_sacl = sd_get_sacl( obj->sd, &present ); - if (!(replaced_sacl = replace_security_labels( old_sacl, sacl ))) return 0; + if (old_sd && old_sd->control & SE_SACL_PRESENT) old_sacl = sd_get_sacl( old_sd, &present ); + if (!(replaced_sacl = replace_security_labels( old_sacl, sacl ))) return NULL; new_sd.control |= SE_SACL_PRESENT; new_sd.sacl_len = replaced_sacl->size; sacl = replaced_sacl; } else { - if (obj->sd) sacl = sd_get_sacl( obj->sd, &present ); + if (old_sd) sacl = sd_get_sacl( old_sd, &present ); - if (obj->sd && present) + if (old_sd && present) { new_sd.control |= SE_SACL_PRESENT; - new_sd.sacl_len = obj->sd->sacl_len; + new_sd.sacl_len = old_sd->sacl_len; } else new_sd.sacl_len = 0; @@ -632,12 +631,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri } else { - if (obj->sd) dacl = sd_get_dacl( obj->sd, &present ); + if (old_sd) dacl = sd_get_dacl( old_sd, &present ); - if (obj->sd && present) + if (old_sd && present) { new_sd.control |= SE_DACL_PRESENT; - new_sd.dacl_len = obj->sd->dacl_len; + new_sd.dacl_len = old_sd->dacl_len; } else if (token) { @@ -653,7 +652,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri if (!ptr) { free( replaced_sacl ); - return 0; + return NULL; } new_sd_ptr = (struct security_descriptor*)ptr; @@ -668,9 +667,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri memcpy( ptr, dacl, new_sd.dacl_len ); free( replaced_sacl ); - free( obj->sd ); - obj->sd = new_sd_ptr; - return 1; + return new_sd_ptr; +} + +int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, + unsigned int set_info, struct token *token ) +{ + struct security_descriptor *new_sd; + + if (!set_info) return 1; + + new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, token ); + if (new_sd) + { + free( obj->sd ); + obj->sd = new_sd; + return 1; + } + + return 0; } /** Set the security descriptor using the current primary token for defaults. */ diff --git a/server/object.h b/server/object.h index dfdd691601f..3b405e36db0 100644 --- a/server/object.h +++ b/server/object.h @@ -78,6 +78,10 @@ struct object_ops void (*remove_queue)(struct object *,struct wait_queue_entry *); /* is object signaled? */ int (*signaled)(struct object *,struct wait_queue_entry *); + /* return the esync fd for this object */ + int (*get_esync_fd)(struct object *, enum esync_type *type); + /* return the fsync shm idx for this object */ + unsigned int (*get_fsync_idx)(struct object *, enum fsync_type *type); /* wait satisfied */ void (*satisfied)(struct object *,struct wait_queue_entry *); /* signal an object */ @@ -171,6 +175,9 @@ extern struct fd *no_get_fd( struct object *obj ); extern unsigned int default_map_access( struct object *obj, unsigned int access ); extern struct security_descriptor *default_get_sd( struct object *obj ); extern int default_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ); +extern struct security_descriptor *set_sd_from_token_internal( const struct security_descriptor *sd, + const struct security_descriptor *old_sd, + unsigned int set_info, struct token *token ); extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, unsigned int set_info, struct token *token ); extern WCHAR *no_get_full_name( struct object *obj, data_size_t *ret_len ); @@ -277,6 +284,10 @@ extern struct object *get_directory_obj( struct process *process, obj_handle_t h extern int directory_link_name( struct object *obj, struct object_name *name, struct object *parent ); extern void init_directories( struct fd *intl_fd ); +/* thread functions */ + +extern void init_threading(void); + /* symbolic link functions */ extern struct object *create_root_symlink( struct object *root, const struct unicode_str *name, diff --git a/server/process.c b/server/process.c index a0d5ea64d97..050950bc206 100644 --- a/server/process.c +++ b/server/process.c @@ -63,6 +63,8 @@ #include "request.h" #include "user.h" #include "security.h" +#include "esync.h" +#include "fsync.h" /* process object */ @@ -95,7 +97,10 @@ static struct security_descriptor *process_get_sd( struct object *obj ); static void process_poll_event( struct fd *fd, int event ); static struct list *process_get_kernel_obj_list( struct object *obj ); static void process_destroy( struct object *obj ); +static int process_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int process_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void terminate_process( struct process *process, struct thread *skip, int exit_code ); +static void set_process_affinity( struct process *process, affinity_t affinity ); static const struct object_ops process_ops = { @@ -105,6 +110,8 @@ static const struct object_ops process_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ process_signaled, /* signaled */ + process_get_esync_fd, /* get_esync_fd */ + process_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -156,6 +163,8 @@ static const struct object_ops startup_info_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ startup_info_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -217,6 +226,8 @@ static const struct object_ops job_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ job_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -683,6 +694,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla process->rawinput_mouse = NULL; process->rawinput_kbd = NULL; memset( &process->image_info, 0, sizeof(process->image_info) ); + process->esync_fd = -1; + process->fsync_idx = 0; + process->cpu_override.cpu_count = 0; list_init( &process->kernel_object ); list_init( &process->thread_list ); list_init( &process->locks ); @@ -739,6 +753,12 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla if (!token_assign_label( process->token, &high_label_sid )) goto error; + if (do_fsync()) + process->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + process->esync_fd = esync_create_fd( 0, 0 ); + set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */ return process; @@ -786,6 +806,12 @@ static void process_destroy( struct object *obj ) free( process->rawinput_devices ); free( process->dir_cache ); free( process->image ); + if (do_esync()) close( process->esync_fd ); + if (process->fsync_idx) + { + fsync_cleanup_process_shm_indices( process->id ); + fsync_free_shm_idx( process->fsync_idx ); + } } /* dump a process on stdout for debugging purposes */ @@ -803,6 +829,20 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry return !process->running_threads; } +static int process_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct process *process = (struct process *)obj; + *type = ESYNC_MANUAL_SERVER; + return process->esync_fd; +} + +static unsigned int process_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct process *process = (struct process *)obj; + *type = FSYNC_MANUAL_SERVER; + return process->fsync_idx; +} + static unsigned int process_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); @@ -1416,6 +1456,26 @@ DECL_HANDLER(init_process_done) struct memory_view *view; client_ptr_t base; const pe_image_info_t *image_info; + const struct cpu_topology_override *cpu_override = get_req_data(); + unsigned int have_cpu_override = get_req_data_size() / sizeof(*cpu_override); + unsigned int i; + + if (have_cpu_override) + { + if (cpu_override->cpu_count > ARRAY_SIZE(process->wine_cpu_id_from_host)) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + for (i = 0; i < cpu_override->cpu_count; ++i) + { + if (cpu_override->host_cpu_id[i] >= ARRAY_SIZE(process->wine_cpu_id_from_host)) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + } + } if (is_process_init_done(process)) { @@ -1445,6 +1505,14 @@ DECL_HANDLER(init_process_done) if (process->debug_obj) set_process_debug_flag( process, 1 ); reply->entry = current->entry_point; reply->suspend = (current->suspend || process->suspend); + + if (have_cpu_override) + { + process->cpu_override = *cpu_override; + memset( process->wine_cpu_id_from_host, 0, sizeof(process->wine_cpu_id_from_host) ); + for (i = 0; i < process->cpu_override.cpu_count; ++i) + process->wine_cpu_id_from_host[process->cpu_override.host_cpu_id[i]] = i; + } } /* open a handle to a process */ @@ -1518,7 +1586,10 @@ DECL_HANDLER(get_process_debug_info) /* fetch the name of the process image */ DECL_HANDLER(get_process_image_name) { - struct process *process = get_process_from_handle( req->handle, PROCESS_QUERY_LIMITED_INFORMATION ); + struct process *process; + + if (req->pid) process = get_process_from_id( req->pid ); + else process = get_process_from_handle( req->handle, PROCESS_QUERY_LIMITED_INFORMATION ); if (!process) return; if (process->image) @@ -1644,6 +1715,8 @@ DECL_HANDLER(read_process_memory) if (!(process = get_process_from_handle( req->handle, PROCESS_VM_READ ))) return; + reply->unix_pid = process->unix_pid; + if (len) { char *buffer = mem_alloc( len ); diff --git a/server/process.h b/server/process.h index 97e0d455ece..112aa5d5062 100644 --- a/server/process.h +++ b/server/process.h @@ -85,6 +85,10 @@ struct process const struct rawinput_device *rawinput_kbd; /* rawinput keyboard device, if any */ struct list kernel_object; /* list of kernel object pointers */ pe_image_info_t image_info; /* main exe image info */ + int esync_fd; /* esync file descriptor (signaled on exit) */ + unsigned int fsync_idx; + struct cpu_topology_override cpu_override; /* Overridden CPUs to host CPUs mapping. */ + unsigned char wine_cpu_id_from_host[64]; /* Host to overridden CPU mapping. */ }; /* process functions */ diff --git a/server/protocol.def b/server/protocol.def index 5d60e7fcda3..4ec9b5a5f43 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -125,6 +125,14 @@ typedef union } unload_dll; } debug_event_t; + +enum context_exec_space +{ + EXEC_SPACE_USERMODE, + EXEC_SPACE_SYSCALL, + EXEC_SPACE_EXCEPTION, +}; + /* context data */ typedef struct { @@ -171,6 +179,10 @@ typedef struct unsigned char i386_regs[512]; } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */ union + { + struct { enum context_exec_space space; int __pad; } space; + } exec_space; /* selected by SERVER_CTX_EXEC_SPACE */ + union { struct { struct { unsigned __int64 low, high; } ymm_high[16]; } regs; } ymm; /* selected by SERVER_CTX_YMM_REGISTERS */ @@ -183,6 +195,7 @@ typedef struct #define SERVER_CTX_DEBUG_REGISTERS 0x10 #define SERVER_CTX_EXTENDED_REGISTERS 0x20 #define SERVER_CTX_YMM_REGISTERS 0x40 +#define SERVER_CTX_EXEC_SPACE 0x80 /* structure used in sending an fd from client to server */ struct send_fd @@ -893,6 +906,64 @@ typedef struct lparam_t info; } cursor_pos_t; +struct cpu_topology_override +{ + unsigned int cpu_count; + unsigned char host_cpu_id[64]; +}; + +struct shared_cursor +{ + int x; /* cursor position */ + int y; + unsigned int last_change; /* time of last position change */ + rectangle_t clip; /* cursor clip rectangle */ + unsigned int clip_flags; /* cursor clip flags */ +}; + +struct desktop_shared_memory +{ + unsigned int seq; /* sequence number - server updating if (seq & 1) != 0 */ + struct shared_cursor cursor; /* global cursor information */ + unsigned char keystate[256]; /* asynchronous key state */ + thread_id_t foreground_tid; /* tid of the foreground thread */ + __int64 update_serial; + unsigned int flags; +}; +typedef volatile struct desktop_shared_memory desktop_shm_t; + +struct queue_shared_memory +{ + unsigned int seq; /* sequence number - server updating if (seq & 1) != 0 */ + int created; /* queue has been created */ + unsigned int wake_bits; + unsigned int changed_bits; + unsigned int wake_mask; + unsigned int changed_mask; + thread_id_t input_tid; +}; +typedef volatile struct queue_shared_memory queue_shm_t; + +struct input_shared_memory +{ + unsigned int seq; /* sequence number - server updating if (seq & 1) != 0 */ + int created; + thread_id_t tid; + user_handle_t focus; /* handle to the focus window */ + user_handle_t capture; /* handle to the capture window */ + user_handle_t active; /* handle to the active window */ + user_handle_t menu_owner; /* handle to the menu owner */ + user_handle_t move_size; /* handle to the moving/resizing window */ + user_handle_t caret; /* handle to the caret window */ + user_handle_t cursor; /* handle to the cursor */ + rectangle_t caret_rect; /* caret rectangle */ + int cursor_count; /* cursor show count */ + unsigned char keystate[256]; /* key state */ + int keystate_lock; /* keystate is locked */ + __int64 sync_serial; +}; +typedef volatile struct input_shared_memory input_shm_t; + /****************************************************************/ /* Request declarations */ @@ -959,6 +1030,7 @@ typedef struct client_ptr_t ldt_copy; /* address of LDT copy (in process address space) */ @REPLY client_ptr_t entry; /* process entry point */ + VARARG(cpu_override,cpu_topology_override); /* Overridden CPUs to host CPUs mapping. */ int suspend; /* is process suspended? */ @END @@ -1041,6 +1113,7 @@ typedef struct /* Fetch the name of the process image */ @REQ(get_process_image_name) obj_handle_t handle; /* process handle */ + process_id_t pid; /* process id */ int win32; /* return a win32 filename? */ @REPLY data_size_t len; /* len in bytes required to store filename */ @@ -1125,9 +1198,11 @@ typedef struct /* Suspend a thread */ @REQ(suspend_thread) - obj_handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ + obj_handle_t waited_handle; /* handle waited on */ @REPLY - int count; /* new suspend count */ + int count; /* new suspend count */ + obj_handle_t wait_handle; /* handle to wait on */ @END @@ -1808,6 +1883,7 @@ struct process_info obj_handle_t handle; /* process handle */ client_ptr_t addr; /* addr to read from */ @REPLY + int unix_pid; /* Unix pid of new process */ VARARG(data,bytes); /* result data */ @END @@ -1850,6 +1926,18 @@ struct process_info /* Flush a registry key */ @REQ(flush_key) obj_handle_t hkey; /* handle to the key */ +@REPLY + abstime_t timestamp_counter; /* branch last change timestamp counter */ + data_size_t total; /* total length needed for data */ + int branch_count; /* number of registry branches to flush */ + VARARG(data,bytes); /* registry data */ +@END + + +/* Clear KEY_DIRTY after key flush */ +@REQ(flush_key_done) + abstime_t timestamp_counter; /* timestamp counter returned from flush_key */ + int branch; /* saved registry branch id */ @END @@ -1930,11 +2018,19 @@ struct process_info @END -/* Save a registry branch to a file */ +/* Return full registry branch non-volatile data for saving */ @REQ(save_registry) - obj_handle_t hkey; /* key to save */ - obj_handle_t file; /* file to save to */ + obj_handle_t hkey; /* key to save */ +@REPLY + data_size_t total; /* total length needed for data */ + VARARG(data,bytes); /* registry data */ @END +enum prefix_type +{ + PREFIX_UNKNOWN, + PREFIX_32BIT, + PREFIX_64BIT, +}; /* Add a registry key change notification */ @@ -2156,6 +2252,7 @@ enum message_type int new_y; @END #define SEND_HWMSG_INJECTED 0x01 +#define SEND_HWMSG_RAWINPUT 0x02 /* Get a message from the current queue */ @@ -2176,7 +2273,6 @@ enum message_type int x; /* message x position */ int y; /* message y position */ unsigned int time; /* message time */ - unsigned int active_hooks; /* active hooks bitmap */ data_size_t total; /* total size of extra data */ VARARG(data,message_data); /* message data for sent messages */ @END @@ -2819,6 +2915,7 @@ enum coords_relative obj_handle_t handle; /* handle to the object */ unsigned int flags; /* information to set/get */ unsigned int obj_flags; /* new object flags */ + timeout_t close_timeout; /* desktop close timeout */ @REPLY int is_desktop; /* is object a desktop? */ unsigned int old_obj_flags; /* old object flags */ @@ -2826,6 +2923,7 @@ enum coords_relative @END #define SET_USER_OBJECT_SET_FLAGS 1 #define SET_USER_OBJECT_GET_FULL_NAME 2 +#define SET_USER_OBJECT_SET_CLOSE_TIMEOUT 4 /* Register a hotkey */ @@ -2866,12 +2964,9 @@ enum coords_relative user_handle_t focus; /* handle to the focus window */ user_handle_t capture; /* handle to the capture window */ user_handle_t active; /* handle to the active window */ - user_handle_t foreground; /* handle to the global foreground window */ user_handle_t menu_owner; /* handle to the menu owner */ user_handle_t move_size; /* handle to the moving/resizing window */ user_handle_t caret; /* handle to the caret window */ - user_handle_t cursor; /* handle to the cursor */ - int show_count; /* cursor show count */ rectangle_t rect; /* caret rectangle */ @END @@ -2917,6 +3012,7 @@ enum coords_relative /* Set the current thread active window */ @REQ(set_active_window) user_handle_t handle; /* handle to the active window */ + unsigned int internal_msg; /* set active window internal message */ @REPLY user_handle_t previous; /* handle to the previous active window */ @END @@ -2972,6 +3068,13 @@ enum caret_state }; +/* get thread active hooks */ +@REQ(get_active_hooks) +@REPLY + unsigned int active_hooks; /* active hooks bitmap */ +@END + + /* Set a window hook */ @REQ(set_hook) int id; /* id of the hook */ @@ -3588,6 +3691,7 @@ struct handle_info /* Make the current process a system process */ @REQ(make_process_system) obj_handle_t handle; /* handle to the process */ + timeout_t desktop_close_timeout; /* set timeout for desktop close */ @REPLY obj_handle_t event; /* event signaled when all user processes have exited */ @END @@ -3650,6 +3754,7 @@ struct handle_info /* get completion from completion port queue */ @REQ(remove_completion) obj_handle_t handle; /* port handle */ + int waited; /* port was just successfully waited on */ @REPLY apc_param_t ckey; /* completion key */ apc_param_t cvalue; /* completion value */ @@ -3785,6 +3890,8 @@ struct handle_info @REQ(get_rawinput_buffer) data_size_t rawinput_size; /* size of RAWINPUT structure */ data_size_t buffer_size; /* size of output buffer */ + int clear_qs_rawinput; + int __pad; @REPLY data_size_t next_size; /* minimum size to get next message data */ unsigned int count; @@ -3873,7 +3980,6 @@ struct handle_info obj_handle_t handle; /* process handle */ @END - /* Iterate thread list for process */ @REQ(get_next_thread) obj_handle_t process; /* process handle */ @@ -3884,3 +3990,117 @@ struct handle_info @REPLY obj_handle_t handle; /* next thread handle */ @END + +enum esync_type +{ + ESYNC_SEMAPHORE = 1, + ESYNC_AUTO_EVENT, + ESYNC_MANUAL_EVENT, + ESYNC_MUTEX, + ESYNC_AUTO_SERVER, + ESYNC_MANUAL_SERVER, + ESYNC_QUEUE, +}; + +/* Create a new eventfd-based synchronization object */ +@REQ(create_esync) + unsigned int access; /* wanted access rights */ + int initval; /* initial value */ + int type; /* type of esync object */ + int max; /* maximum count on a semaphore */ + VARARG(objattr,object_attributes); /* object attributes */ +@REPLY + obj_handle_t handle; /* handle to the object */ + int type; /* actual type (may be different for events) */ + unsigned int shm_idx; +@END + +@REQ(open_esync) + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ + obj_handle_t rootdir; /* root directory */ + int type; /* type of esync object (above) */ + VARARG(name,unicode_str); /* object name */ +@REPLY + obj_handle_t handle; /* handle to the event */ + int type; /* type of esync object (above) */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END + +/* Retrieve the esync fd for an object. */ +@REQ(get_esync_fd) + obj_handle_t handle; /* handle to the object */ +@REPLY + int type; + unsigned int shm_idx; +@END + +/* Notify the server that we are doing a message wait or done with one. */ +@REQ(esync_msgwait) + int in_msgwait; /* are we in a message wait? */ +@END + +/* Retrieve the fd to wait on for user APCs. */ +@REQ(get_esync_apc_fd) +@END + +#define FSYNC_SHM_PAGE_SIZE 0x10000 + +enum fsync_type +{ + FSYNC_SEMAPHORE = 1, + FSYNC_AUTO_EVENT, + FSYNC_MANUAL_EVENT, + FSYNC_MUTEX, + FSYNC_AUTO_SERVER, + FSYNC_MANUAL_SERVER, + FSYNC_QUEUE, +}; + +/* Create a new futex-based synchronization object */ +@REQ(create_fsync) + unsigned int access; /* wanted access rights */ + int low; /* initial value of low word */ + int high; /* initial value of high word */ + int type; /* type of fsync object */ + VARARG(objattr,object_attributes); /* object attributes */ +@REPLY + obj_handle_t handle; /* handle to the object */ + int type; /* type of fsync object */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END + +/* Open an fsync object */ +@REQ(open_fsync) + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ + obj_handle_t rootdir; /* root directory */ + int type; /* type of fsync object */ + VARARG(name,unicode_str); /* object name */ +@REPLY + obj_handle_t handle; /* handle to the event */ + int type; /* type of fsync object */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END + +/* Retrieve the shm index for an object. */ +@REQ(get_fsync_idx) + obj_handle_t handle; /* handle to the object */ +@REPLY + int type; + unsigned int shm_idx; +@END + +@REQ(fsync_msgwait) + int in_msgwait; /* are we in a message wait? */ +@END + +@REQ(get_fsync_apc_idx) +@REPLY + unsigned int shm_idx; +@END + +@REQ(fsync_free_shm_idx) + unsigned int shm_idx; +@REPLY +@END diff --git a/server/queue.c b/server/queue.c index cd913ae03e5..23423a239f1 100644 --- a/server/queue.c +++ b/server/queue.c @@ -42,6 +42,8 @@ #include "process.h" #include "request.h" #include "user.h" +#include "esync.h" +#include "fsync.h" #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) @@ -66,6 +68,8 @@ struct message_result void *data; /* message reply data */ unsigned int data_size; /* size of message reply data */ struct timeout_user *timeout; /* result timeout */ + thread_id_t hook_thread_id;/* Hook owner thread id. */ + client_ptr_t hook_proc; /* Hook proc address. */ }; struct message @@ -100,21 +104,12 @@ struct thread_input { struct object obj; /* object header */ struct desktop *desktop; /* desktop that this thread input belongs to */ - user_handle_t focus; /* focus window */ - user_handle_t capture; /* capture window */ - user_handle_t active; /* active window */ - user_handle_t menu_owner; /* current menu owner window */ - user_handle_t move_size; /* current moving/resizing window */ - user_handle_t caret; /* caret window */ - rectangle_t caret_rect; /* caret rectangle */ int caret_hide; /* caret hide count */ int caret_state; /* caret on/off state */ - user_handle_t cursor; /* current cursor */ - int cursor_count; /* cursor show count */ struct list msg_list; /* list of hardware messages */ - unsigned char keystate[256]; /* state of each key */ unsigned char desktop_keystate[256]; /* desktop keystate when keystate was synced */ - int keystate_lock; /* keystate is locked */ + struct object *shared_mapping; /* thread input shared memory mapping */ + const input_shm_t *shared; /* thread input shared memory ptr */ }; struct msg_queue @@ -130,6 +125,7 @@ struct msg_queue int quit_message; /* is there a pending quit message? */ int exit_code; /* exit code of pending quit message */ int cursor_count; /* per-queue cursor show count */ + int destroyed; /* queue has been cleaned up */ struct list msg_list[NB_MSG_KINDS]; /* lists of messages */ struct list send_result; /* stack of sent messages waiting for result */ struct list callback_result; /* list of callback messages waiting for result */ @@ -142,6 +138,11 @@ struct msg_queue struct hook_table *hooks; /* hook table */ timeout_t last_get_msg; /* time of last get message call */ int keystate_lock; /* owns an input keystate lock */ + const queue_shm_t *shared; /* thread queue shared memory ptr */ + int esync_fd; /* esync file descriptor (signalled on message) */ + int esync_in_msgwait; /* our thread is currently waiting on us */ + unsigned int fsync_idx; + int fsync_in_msgwait; /* our thread is currently waiting on us */ }; struct hotkey @@ -158,6 +159,8 @@ static void msg_queue_dump( struct object *obj, int verbose ); static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry ); static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int msg_queue_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_destroy( struct object *obj ); static void msg_queue_poll_event( struct fd *fd, int event ); @@ -173,6 +176,8 @@ static const struct object_ops msg_queue_ops = msg_queue_add_queue, /* add_queue */ msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ + msg_queue_get_esync_fd, /* get_esync_fd */ + msg_queue_get_fsync_idx, /* get_fsync_idx */ msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -210,6 +215,8 @@ static const struct object_ops thread_input_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -232,20 +239,40 @@ static unsigned int last_input_time; static cursor_pos_t cursor_history[64]; static unsigned int cursor_history_latest; +#if defined(__i386__) || defined(__x86_64__) +#define __SHARED_INCREMENT_SEQ( x ) ++(x) +#else +#define __SHARED_INCREMENT_SEQ( x ) __atomic_add_fetch( &(x), 1, __ATOMIC_RELEASE ) +#endif + +#define SHARED_WRITE_BEGIN( object, type ) \ + do { \ + const type *__shared = (object)->shared; \ + type *shared = (type *)__shared; \ + unsigned int __seq = __SHARED_INCREMENT_SEQ( shared->seq ); \ + assert( (__seq & 1) != 0 ); \ + do + +#define SHARED_WRITE_END \ + while(0); \ + __seq = __SHARED_INCREMENT_SEQ( shared->seq ) - __seq; \ + assert( __seq == 1 ); \ + } while(0); + static void queue_hardware_message( struct desktop *desktop, struct message *msg, int always_queue ); static void free_message( struct message *msg ); -/* set the caret window in a given thread input */ -static void set_caret_window( struct thread_input *input, user_handle_t win ) +/* set the caret window in a given thread input, requires write lock on the thread input shared member */ +static void set_caret_window( struct thread_input *input, input_shm_t *shared, user_handle_t win ) { - if (!win || win != input->caret) + if (!win || win != shared->caret) { - input->caret_rect.left = 0; - input->caret_rect.top = 0; - input->caret_rect.right = 0; - input->caret_rect.bottom = 0; + shared->caret_rect.left = 0; + shared->caret_rect.top = 0; + shared->caret_rect.right = 0; + shared->caret_rect.bottom = 0; } - input->caret = win; + shared->caret = win; input->caret_hide = 1; input->caret_state = 0; } @@ -257,24 +284,33 @@ static struct thread_input *create_thread_input( struct thread *thread ) if ((input = alloc_object( &thread_input_ops ))) { - input->focus = 0; - input->capture = 0; - input->active = 0; - input->menu_owner = 0; - input->move_size = 0; - input->cursor = 0; - input->cursor_count = 0; + input->shared_mapping = grab_object( thread->input_shared_mapping ); + input->shared = thread->input_shared; list_init( &input->msg_list ); - set_caret_window( input, 0 ); - memset( input->keystate, 0, sizeof(input->keystate) ); - input->keystate_lock = 0; if (!(input->desktop = get_thread_desktop( thread, 0 /* FIXME: access rights */ ))) { release_object( input ); return NULL; } - memcpy( input->desktop_keystate, input->desktop->keystate, sizeof(input->desktop_keystate) ); + memcpy( input->desktop_keystate, (void *)input->desktop->shared->keystate, + sizeof(input->desktop_keystate) ); + + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->focus = 0; + shared->active = 0; + shared->capture = 0; + shared->menu_owner = 0; + shared->move_size = 0; + shared->cursor = 0; + shared->cursor_count = 0; + set_caret_window( input, shared, 0 ); + shared->keystate_lock = 0; + memset( (void *)shared->keystate, 0, sizeof(shared->keystate) ); + shared->created = TRUE; + } + SHARED_WRITE_END } return input; } @@ -303,6 +339,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->hotkey_count = 0; queue->quit_message = 0; queue->cursor_count = 0; + queue->destroyed = 0; queue->recv_result = NULL; queue->next_timer_id = 0x7fff; queue->timeout = NULL; @@ -310,50 +347,82 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->hooks = NULL; queue->last_get_msg = current_time; queue->keystate_lock = 0; + queue->shared = thread->queue_shared; + queue->esync_fd = -1; + queue->esync_in_msgwait = 0; + queue->fsync_idx = 0; + queue->fsync_in_msgwait = 0; list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); list_init( &queue->expired_timers ); for (i = 0; i < NB_MSG_KINDS; i++) list_init( &queue->msg_list[i] ); + if (do_fsync()) + queue->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + queue->esync_fd = esync_create_fd( 0, 0 ); + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->created = TRUE; + } + SHARED_WRITE_END + thread->queue = queue; } - if (new_input) release_object( new_input ); - return queue; -} + if (new_input) + { + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->input_tid = new_input->shared->tid; + } + SHARED_WRITE_END -/* free the message queue of a thread at thread exit */ -void free_msg_queue( struct thread *thread ) -{ - remove_thread_hooks( thread ); - if (!thread->queue) return; - release_object( thread->queue ); - thread->queue = NULL; + release_object( new_input ); + } + return queue; } /* synchronize thread input keystate with the desktop */ static void sync_input_keystate( struct thread_input *input ) { int i; - if (!input->desktop || input->keystate_lock) return; - for (i = 0; i < sizeof(input->keystate); ++i) + if (!input->desktop || input->shared->keystate_lock) return; + + SHARED_WRITE_BEGIN( input, input_shm_t ) { - if (input->desktop_keystate[i] == input->desktop->keystate[i]) continue; - input->keystate[i] = input->desktop_keystate[i] = input->desktop->keystate[i]; + for (i = 0; i < sizeof(shared->keystate); ++i) + { + if (input->desktop_keystate[i] == input->desktop->shared->keystate[i]) continue; + shared->keystate[i] = input->desktop_keystate[i] = input->desktop->shared->keystate[i]; + } + shared->sync_serial = input->desktop->shared->update_serial; } + SHARED_WRITE_END; } /* locks thread input keystate to prevent synchronization */ static void lock_input_keystate( struct thread_input *input ) { - input->keystate_lock++; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->keystate_lock++; + } + SHARED_WRITE_END } /* unlock the thread input keystate and synchronize it again */ static void unlock_input_keystate( struct thread_input *input ) { - input->keystate_lock--; - if (!input->keystate_lock) sync_input_keystate( input ); + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->keystate_lock--; + } + SHARED_WRITE_END + + if (!input->shared->keystate_lock) sync_input_keystate( input ); } /* change the thread input data of a given thread */ @@ -368,13 +437,30 @@ static int assign_thread_input( struct thread *thread, struct thread_input *new_ } if (queue->input) { - queue->input->cursor_count -= queue->cursor_count; + SHARED_WRITE_BEGIN( queue->input, input_shm_t ) + { + shared->cursor_count -= queue->cursor_count; + } + SHARED_WRITE_END + if (queue->keystate_lock) unlock_input_keystate( queue->input ); release_object( queue->input ); } queue->input = (struct thread_input *)grab_object( new_input ); if (queue->keystate_lock) lock_input_keystate( queue->input ); - new_input->cursor_count += queue->cursor_count; + + SHARED_WRITE_BEGIN( new_input, input_shm_t ) + { + shared->cursor_count += queue->cursor_count; + } + SHARED_WRITE_END + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->input_tid = queue->input->shared->tid; + } + SHARED_WRITE_END + return 1; } @@ -406,7 +492,7 @@ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_sour static int is_cursor_clipped( struct desktop *desktop ) { - rectangle_t top_rect, clip_rect = desktop->cursor.clip; + rectangle_t top_rect, clip_rect = desktop->shared->cursor.clip; get_top_window_rectangle( desktop, &top_rect ); return !is_rect_equal( &clip_rect, &top_rect ); } @@ -423,9 +509,9 @@ static void queue_cursor_message( struct desktop *desktop, user_handle_t win, un msg->msg = message; msg->wparam = wparam; msg->lparam = lparam; - msg->x = desktop->cursor.x; - msg->y = desktop->cursor.y; - if (!(msg->win = win) && (input = desktop->foreground_input)) msg->win = input->active; + msg->x = desktop->shared->cursor.x; + msg->y = desktop->shared->cursor.y; + if (!(msg->win = win) && (input = desktop->foreground_input)) msg->win = input->shared->active; queue_hardware_message( desktop, msg, 1 ); } @@ -434,7 +520,7 @@ static struct thread_input *get_desktop_cursor_thread_input( struct desktop *des struct thread_input *input = NULL; struct thread *thread; - if ((thread = get_window_thread( desktop->cursor.win ))) + if ((thread = get_window_thread( desktop->cursor_win ))) { if (thread->queue) input = thread->queue->input; release_object( thread ); @@ -445,31 +531,42 @@ static struct thread_input *get_desktop_cursor_thread_input( struct desktop *des static int update_desktop_cursor_window( struct desktop *desktop, user_handle_t win ) { - int updated = win != desktop->cursor.win; + int updated = win != desktop->cursor_win; struct thread_input *input; - desktop->cursor.win = win; + desktop->cursor_win = win; - if (updated && (input = get_desktop_cursor_thread_input( desktop ))) + if (!updated) return 0; + + if (!(input = get_desktop_cursor_thread_input( desktop ))) + desktop->cursor_handle = -1; + else { - user_handle_t handle = input->cursor_count < 0 ? 0 : input->cursor; + user_handle_t handle = input->shared->cursor_count < 0 ? 0 : input->shared->cursor; /* when clipping send the message to the foreground window as well, as some driver have an artificial overlay window */ if (is_cursor_clipped( desktop )) queue_cursor_message( desktop, 0, WM_WINE_SETCURSOR, win, handle ); queue_cursor_message( desktop, win, WM_WINE_SETCURSOR, win, handle ); + desktop->cursor_handle = handle; } - return updated; + return 1; } static int update_desktop_cursor_pos( struct desktop *desktop, user_handle_t win, int x, int y ) { int updated; + unsigned int time = get_tick_count(); - x = max( min( x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left ); - y = max( min( y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top ); - updated = (desktop->cursor.x != x || desktop->cursor.y != y); - desktop->cursor.x = x; - desktop->cursor.y = y; - desktop->cursor.last_change = get_tick_count(); + x = max( min( x, desktop->shared->cursor.clip.right - 1 ), desktop->shared->cursor.clip.left ); + y = max( min( y, desktop->shared->cursor.clip.bottom - 1 ), desktop->shared->cursor.clip.top ); + updated = (desktop->shared->cursor.x != x || desktop->shared->cursor.y != y); + + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + shared->cursor.x = x; + shared->cursor.y = y; + shared->cursor.last_change = time; + } + SHARED_WRITE_END if (!win || !is_window_visible( win ) || is_window_transparent( win )) win = shallow_window_from_point( desktop, x, y ); @@ -482,10 +579,13 @@ static void update_desktop_cursor_handle( struct desktop *desktop, struct thread { if (input == get_desktop_cursor_thread_input( desktop )) { - user_handle_t handle = input->cursor_count < 0 ? 0 : input->cursor, win = desktop->cursor.win; + user_handle_t handle = input->shared->cursor_count < 0 ? 0 : input->shared->cursor, win = desktop->cursor_win; + if (handle == desktop->cursor_handle) return; + /* when clipping send the message to the foreground window as well, as some driver have an artificial overlay window */ if (is_cursor_clipped( desktop )) queue_cursor_message( desktop, 0, WM_WINE_SETCURSOR, win, handle ); queue_cursor_message( desktop, win, WM_WINE_SETCURSOR, win, handle ); + desktop->cursor_handle = handle; } } @@ -515,40 +615,49 @@ static void get_message_defaults( struct msg_queue *queue, int *x, int *y, unsig { struct desktop *desktop = queue->input->desktop; - *x = desktop->cursor.x; - *y = desktop->cursor.y; + *x = desktop->shared->cursor.x; + *y = desktop->shared->cursor.y; *time = get_tick_count(); } /* set the cursor clip rectangle */ void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, unsigned int flags, int reset ) { - rectangle_t top_rect; + rectangle_t top_rect, new_rect; + unsigned int old_flags; int x, y; get_top_window_rectangle( desktop, &top_rect ); if (rect) { - rectangle_t new_rect = *rect; + new_rect = *rect; if (new_rect.left < top_rect.left) new_rect.left = top_rect.left; if (new_rect.right > top_rect.right) new_rect.right = top_rect.right; if (new_rect.top < top_rect.top) new_rect.top = top_rect.top; if (new_rect.bottom > top_rect.bottom) new_rect.bottom = top_rect.bottom; if (new_rect.left > new_rect.right || new_rect.top > new_rect.bottom) new_rect = top_rect; - desktop->cursor.clip = new_rect; } - else desktop->cursor.clip = top_rect; + else new_rect = top_rect; + + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + old_flags = shared->cursor.clip_flags; + shared->cursor.clip = new_rect; + shared->cursor.clip_flags = flags; + } + SHARED_WRITE_END /* warp the mouse to be inside the clip rect */ - x = max( min( desktop->cursor.x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left ); - y = max( min( desktop->cursor.y, desktop->cursor.clip.bottom - 1 ), desktop->cursor.clip.top ); - if (x != desktop->cursor.x || y != desktop->cursor.y) set_cursor_pos( desktop, x, y ); + x = max( min( desktop->shared->cursor.x, new_rect.right - 1 ), new_rect.left ); + y = max( min( desktop->shared->cursor.y, new_rect.bottom - 1 ), new_rect.top ); + if (x != desktop->shared->cursor.x || y != desktop->shared->cursor.y) set_cursor_pos( desktop, x, y ); /* request clip cursor rectangle reset to the desktop thread */ if (reset) post_desktop_message( desktop, WM_WINE_CLIPCURSOR, flags, FALSE ); /* notify foreground thread, of reset, or to apply new cursor clipping rect */ - queue_cursor_message( desktop, 0, WM_WINE_CLIPCURSOR, flags, reset ); + if (rect || reset || old_flags != SET_CURSOR_NOCLIP) + queue_cursor_message( desktop, 0, WM_WINE_CLIPCURSOR, flags, reset ); } /* change the foreground input and reset the cursor clip rect */ @@ -557,6 +666,11 @@ static void set_foreground_input( struct desktop *desktop, struct thread_input * if (desktop->foreground_input == input) return; set_clip_rectangle( desktop, NULL, SET_CURSOR_NOCLIP, 1 ); desktop->foreground_input = input; + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + shared->foreground_tid = input ? input->shared->tid : 0; + } + SHARED_WRITE_END } /* get the hook table for a given thread */ @@ -591,6 +705,14 @@ static inline void set_queue_bits( struct msg_queue *queue, unsigned int bits ) } queue->wake_bits |= bits; queue->changed_bits |= bits; + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_bits = queue->wake_bits; + shared->changed_bits = queue->changed_bits; + } + SHARED_WRITE_END + if (is_signaled( queue )) wake_up( &queue->obj, 0 ); } @@ -604,6 +726,19 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits if (queue->keystate_lock) unlock_input_keystate( queue->input ); queue->keystate_lock = 0; } + + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_bits = queue->wake_bits; + shared->changed_bits = queue->changed_bits; + } + SHARED_WRITE_END } /* check if message is matched by the filter */ @@ -635,6 +770,7 @@ static inline int get_hardware_msg_bit( unsigned int message ) if (message >= WM_KEYFIRST && message <= WM_KEYLAST) return QS_KEY; if (message == WM_WINE_CLIPCURSOR) return QS_RAWINPUT; if (message == WM_WINE_SETCURSOR) return QS_RAWINPUT; + if (message == WM_POINTERDOWN || message == WM_POINTERUP || message == WM_POINTERUPDATE) return QS_POINTER; return QS_MOUSEBUTTON; } @@ -654,6 +790,36 @@ static inline unsigned int get_unique_id(void) return id; } +static int merge_pointer_update_message( struct thread_input *input, const struct message *msg ) +{ + struct hardware_msg_data *prev_data, *msg_data = msg->data; + struct message *prev; + struct list *ptr; + + for (ptr = list_tail( &input->msg_list ); ptr; ptr = list_prev( &input->msg_list, ptr )) + { + prev = LIST_ENTRY( ptr, struct message, entry ); + if (prev->msg != WM_POINTERUPDATE || !(prev_data = prev->data)) continue; + if (LOWORD(prev_data->rawinput.mouse.data) == LOWORD(msg_data->rawinput.mouse.data)) break; + } + if (!ptr) return 0; + if (prev->result) return 0; + if (prev->win && msg->win && prev->win != msg->win) return 0; + if (prev->type != msg->type) return 0; + /* now we can merge it */ + prev->wparam = msg->wparam; + prev->lparam = msg->lparam; + prev->x = msg->x; + prev->y = msg->y; + prev->time = msg->time; + prev_data->rawinput.mouse.data |= msg_data->rawinput.mouse.data; + prev_data->rawinput.mouse.x = msg_data->rawinput.mouse.x; + prev_data->rawinput.mouse.y = msg_data->rawinput.mouse.y; + list_remove( ptr ); + list_add_tail( &input->msg_list, ptr ); + return 1; +} + /* try to merge a WM_MOUSEMOVE message with the last in the list; return 1 if successful */ static int merge_mousemove( struct thread_input *input, const struct message *msg ) { @@ -663,7 +829,7 @@ static int merge_mousemove( struct thread_input *input, const struct message *ms for (ptr = list_tail( &input->msg_list ); ptr; ptr = list_prev( &input->msg_list, ptr )) { prev = LIST_ENTRY( ptr, struct message, entry ); - if (prev->msg != WM_INPUT) break; + if (prev->msg != WM_INPUT && prev->msg != WM_POINTERUPDATE) break; } if (!ptr) return 0; if (prev->result) return 0; @@ -718,6 +884,7 @@ static int merge_message( struct thread_input *input, const struct message *msg if (msg->msg == WM_MOUSEMOVE) return merge_mousemove( input, msg ); if (msg->msg == WM_WINE_CLIPCURSOR) return merge_unique_message( input, WM_WINE_CLIPCURSOR, msg ); if (msg->msg == WM_WINE_SETCURSOR) return merge_unique_message( input, WM_WINE_SETCURSOR, msg ); + if (msg->msg == WM_POINTERUPDATE) return merge_pointer_update_message( input, msg ); return 0; } @@ -833,6 +1000,13 @@ static void result_timeout( void *private ) { struct message *msg = result->msg; + if (result->sender && result->hook_thread_id && result->hook_proc) + { + if (debug_level > 1) + fprintf( stderr, "disabling hung hook: tid %04x, proc %#lx\n", + result->hook_thread_id, (unsigned long)result->hook_proc ); + disable_hung_hook( result->sender->input->desktop, msg->msg, result->hook_thread_id, result->hook_proc ); + } result->msg = NULL; msg->result = NULL; remove_queue_message( result->receiver, msg, SEND_MESSAGE ); @@ -844,7 +1018,8 @@ static void result_timeout( void *private ) /* allocate and fill a message result structure */ static struct message_result *alloc_message_result( struct msg_queue *send_queue, struct msg_queue *recv_queue, - struct message *msg, timeout_t timeout ) + struct message *msg, timeout_t timeout, + thread_id_t hook_thread_id, client_ptr_t hook_proc) { struct message_result *result = mem_alloc( sizeof(*result) ); if (result) @@ -859,6 +1034,8 @@ static struct message_result *alloc_message_result( struct msg_queue *send_queue result->hardware_msg = NULL; result->desktop = NULL; result->callback_msg = NULL; + result->hook_thread_id = hook_thread_id; + result->hook_proc = hook_proc; if (msg->type == MSG_CALLBACK) { @@ -1082,6 +1259,13 @@ static int is_queue_hung( struct msg_queue *queue ) if (get_wait_queue_thread(entry)->queue == queue) return 0; /* thread is waiting on queue -> not hung */ } + + if (do_fsync() && queue->fsync_in_msgwait) + return 0; /* thread is waiting on queue in absentia -> not hung */ + + if (do_esync() && queue->esync_in_msgwait) + return 0; /* thread is waiting on queue in absentia -> not hung */ + return 1; } @@ -1137,16 +1321,36 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr return ret || is_signaled( queue ); } +static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct msg_queue *queue = (struct msg_queue *)obj; + *type = ESYNC_QUEUE; + return queue->esync_fd; +} + +static unsigned int msg_queue_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct msg_queue *queue = (struct msg_queue *)obj; + *type = FSYNC_QUEUE; + return queue->fsync_idx; +} + static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct msg_queue *queue = (struct msg_queue *)obj; queue->wake_mask = 0; queue->changed_mask = 0; + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_mask = queue->wake_mask; + shared->changed_mask = queue->changed_mask; + } + SHARED_WRITE_END } -static void msg_queue_destroy( struct object *obj ) +static void cleanup_msg_queue( struct msg_queue *queue ) { - struct msg_queue *queue = (struct msg_queue *)obj; struct list *ptr; struct hotkey *hotkey, *hotkey2; int i; @@ -1176,11 +1380,35 @@ static void msg_queue_destroy( struct object *obj ) free( timer ); } if (queue->timeout) remove_timeout_user( queue->timeout ); - queue->input->cursor_count -= queue->cursor_count; + SHARED_WRITE_BEGIN( queue->input, input_shm_t ) + { + shared->cursor_count -= queue->cursor_count; + } + SHARED_WRITE_END + if (queue->keystate_lock) unlock_input_keystate( queue->input ); release_object( queue->input ); if (queue->hooks) release_object( queue->hooks ); if (queue->fd) release_object( queue->fd ); + queue->destroyed = 1; + if (do_esync()) close( queue->esync_fd ); +} + +static void msg_queue_destroy( struct object *obj ) +{ + struct msg_queue *queue = (struct msg_queue *)obj; + if (!queue->destroyed) cleanup_msg_queue( queue ); + if (queue->fsync_idx) fsync_free_shm_idx( queue->fsync_idx ); +} + +/* free the message queue of a thread at thread exit */ +void free_msg_queue( struct thread *thread ) +{ + remove_thread_hooks( thread ); + if (!thread->queue) return; + cleanup_msg_queue( thread->queue ); + release_object( thread->queue ); + thread->queue = NULL; } static void msg_queue_poll_event( struct fd *fd, int event ) @@ -1197,7 +1425,7 @@ static void thread_input_dump( struct object *obj, int verbose ) { struct thread_input *input = (struct thread_input *)obj; fprintf( stderr, "Thread input focus=%08x capture=%08x active=%08x\n", - input->focus, input->capture, input->active ); + input->shared->focus, input->shared->capture, input->shared->active ); } static void thread_input_destroy( struct object *obj ) @@ -1211,6 +1439,7 @@ static void thread_input_destroy( struct object *obj ) if (desktop->foreground_input == input) desktop->foreground_input = NULL; release_object( desktop ); } + release_object( input->shared_mapping ); } /* fix the thread input data when a window is destroyed */ @@ -1218,12 +1447,17 @@ static inline void thread_input_cleanup_window( struct msg_queue *queue, user_ha { struct thread_input *input = queue->input; - if (window == input->focus) input->focus = 0; - if (window == input->capture) input->capture = 0; - if (window == input->active) input->active = 0; - if (window == input->menu_owner) input->menu_owner = 0; - if (window == input->move_size) input->move_size = 0; - if (window == input->caret) set_caret_window( input, 0 ); + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + if (window == shared->focus) shared->focus = 0; + if (window == shared->capture) shared->capture = 0; + if (window == shared->active) shared->active = 0; + if (window == shared->menu_owner) shared->menu_owner = 0; + if (window == shared->move_size) shared->move_size = 0; + if (window == shared->caret) set_caret_window( input, shared, 0 ); + } + SHARED_WRITE_END + } /* check if the specified window can be set in the input data of a given queue */ @@ -1256,7 +1490,7 @@ int init_thread_queue( struct thread *thread ) int attach_thread_input( struct thread *thread_from, struct thread *thread_to ) { struct desktop *desktop; - struct thread_input *input; + struct thread_input *input, *old_input; int ret; if (!thread_to->queue && !(thread_to->queue = create_msg_queue( thread_to, NULL ))) return 0; @@ -1273,12 +1507,25 @@ int attach_thread_input( struct thread *thread_from, struct thread *thread_to ) if (thread_from->queue) { - if (!input->focus) input->focus = thread_from->queue->input->focus; - if (!input->active) input->active = thread_from->queue->input->active; + old_input = thread_from->queue->input; + + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + if (!shared->focus) shared->focus = old_input->shared->focus; + if (!shared->active) shared->active = old_input->shared->active; + } + SHARED_WRITE_END } ret = assign_thread_input( thread_from, input ); - if (ret) memset( input->keystate, 0, sizeof(input->keystate) ); + if (ret) + { + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + memset( (void *)shared->keystate, 0, sizeof(shared->keystate) ); + } + SHARED_WRITE_END + } release_object( input ); return ret; } @@ -1291,21 +1538,39 @@ void detach_thread_input( struct thread *thread_from ) if ((input = create_thread_input( thread_from ))) { - if (old_input->focus && (thread = get_window_thread( old_input->focus ))) + if (old_input->shared->focus && (thread = get_window_thread( old_input->shared->focus ))) { if (thread == thread_from) { - input->focus = old_input->focus; - old_input->focus = 0; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->focus = old_input->shared->focus; + } + SHARED_WRITE_END + + SHARED_WRITE_BEGIN( old_input, input_shm_t ) + { + shared->focus = 0; + } + SHARED_WRITE_END } release_object( thread ); } - if (old_input->active && (thread = get_window_thread( old_input->active ))) + if (old_input->shared->active && (thread = get_window_thread( old_input->shared->active ))) { if (thread == thread_from) { - input->active = old_input->active; - old_input->active = 0; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->active = old_input->shared->active; + } + SHARED_WRITE_END + + SHARED_WRITE_BEGIN( old_input, input_shm_t ) + { + shared->active = 0; + } + SHARED_WRITE_END } release_object( thread ); } @@ -1438,7 +1703,7 @@ static struct timer *set_timer( struct msg_queue *queue, unsigned int rate ) } /* change the input key state for a given key */ -static void set_input_key_state( unsigned char *keystate, unsigned char key, int down ) +static void set_input_key_state( volatile unsigned char *keystate, unsigned char key, unsigned char down ) { if (down) { @@ -1449,34 +1714,33 @@ static void set_input_key_state( unsigned char *keystate, unsigned char key, int } /* update the input key state for a keyboard message */ -static void update_input_key_state( struct desktop *desktop, unsigned char *keystate, - unsigned int msg, lparam_t wparam ) +static void update_key_state( volatile unsigned char *keystate, unsigned int msg, + lparam_t wparam, int desktop ) { - unsigned char key; - int down = 0; + unsigned char key, down = 0, down_val = desktop ? 0xc0 : 0x80; switch (msg) { case WM_LBUTTONDOWN: - down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + down = down_val; /* fall through */ case WM_LBUTTONUP: set_input_key_state( keystate, VK_LBUTTON, down ); break; case WM_MBUTTONDOWN: - down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + down = down_val; /* fall through */ case WM_MBUTTONUP: set_input_key_state( keystate, VK_MBUTTON, down ); break; case WM_RBUTTONDOWN: - down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + down = down_val; /* fall through */ case WM_RBUTTONUP: set_input_key_state( keystate, VK_RBUTTON, down ); break; case WM_XBUTTONDOWN: - down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + down = down_val; /* fall through */ case WM_XBUTTONUP: if (wparam >> 16 == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); @@ -1484,7 +1748,7 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys break; case WM_KEYDOWN: case WM_SYSKEYDOWN: - down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + down = down_val; /* fall through */ case WM_KEYUP: case WM_SYSKEYUP: @@ -1512,25 +1776,44 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys } } +static void update_input_key_state( struct thread_input *input, unsigned int msg, lparam_t wparam ) +{ + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + update_key_state( shared->keystate, msg, wparam, 0 ); + } + SHARED_WRITE_END +} + +static void update_desktop_key_state( struct desktop *desktop, unsigned int msg, lparam_t wparam ) +{ + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + ++shared->update_serial; + update_key_state( shared->keystate, msg, wparam, 1 ); + } + SHARED_WRITE_END +} + /* update the desktop key state according to a mouse message flags */ static void update_desktop_mouse_state( struct desktop *desktop, unsigned int flags, lparam_t wparam ) { if (flags & MOUSEEVENTF_LEFTDOWN) - update_input_key_state( desktop, desktop->keystate, WM_LBUTTONDOWN, wparam ); + update_desktop_key_state( desktop, WM_LBUTTONDOWN, wparam ); if (flags & MOUSEEVENTF_LEFTUP) - update_input_key_state( desktop, desktop->keystate, WM_LBUTTONUP, wparam ); + update_desktop_key_state( desktop, WM_LBUTTONUP, wparam ); if (flags & MOUSEEVENTF_RIGHTDOWN) - update_input_key_state( desktop, desktop->keystate, WM_RBUTTONDOWN, wparam ); + update_desktop_key_state( desktop, WM_RBUTTONDOWN, wparam ); if (flags & MOUSEEVENTF_RIGHTUP) - update_input_key_state( desktop, desktop->keystate, WM_RBUTTONUP, wparam ); + update_desktop_key_state( desktop, WM_RBUTTONUP, wparam ); if (flags & MOUSEEVENTF_MIDDLEDOWN) - update_input_key_state( desktop, desktop->keystate, WM_MBUTTONDOWN, wparam ); + update_desktop_key_state( desktop, WM_MBUTTONDOWN, wparam ); if (flags & MOUSEEVENTF_MIDDLEUP) - update_input_key_state( desktop, desktop->keystate, WM_MBUTTONUP, wparam ); + update_desktop_key_state( desktop, WM_MBUTTONUP, wparam ); if (flags & MOUSEEVENTF_XDOWN) - update_input_key_state( desktop, desktop->keystate, WM_XBUTTONDOWN, wparam ); + update_desktop_key_state( desktop, WM_XBUTTONDOWN, wparam ); if (flags & MOUSEEVENTF_XUP) - update_input_key_state( desktop, desktop->keystate, WM_XBUTTONUP, wparam ); + update_desktop_key_state( desktop, WM_XBUTTONUP, wparam ); } /* release the hardware message currently being processed by the given thread */ @@ -1558,7 +1841,7 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i } if (clr_bit) clear_queue_bits( queue, clr_bit ); - update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + update_input_key_state( input, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); } @@ -1570,10 +1853,10 @@ static int queue_hotkey_message( struct desktop *desktop, struct message *msg ) if (msg->msg != WM_KEYDOWN && msg->msg != WM_SYSKEYDOWN) return 0; - if (desktop->keystate[VK_MENU] & 0x80) modifiers |= MOD_ALT; - if (desktop->keystate[VK_CONTROL] & 0x80) modifiers |= MOD_CONTROL; - if (desktop->keystate[VK_SHIFT] & 0x80) modifiers |= MOD_SHIFT; - if ((desktop->keystate[VK_LWIN] & 0x80) || (desktop->keystate[VK_RWIN] & 0x80)) modifiers |= MOD_WIN; + if (desktop->shared->keystate[VK_MENU] & 0x80) modifiers |= MOD_ALT; + if (desktop->shared->keystate[VK_CONTROL] & 0x80) modifiers |= MOD_CONTROL; + if (desktop->shared->keystate[VK_SHIFT] & 0x80) modifiers |= MOD_SHIFT; + if ((desktop->shared->keystate[VK_LWIN] & 0x80) || (desktop->shared->keystate[VK_RWIN] & 0x80)) modifiers |= MOD_WIN; LIST_FOR_EACH_ENTRY( hotkey, &desktop->hotkeys, struct hotkey, entry ) { @@ -1611,19 +1894,20 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru *msg_code = msg->msg; switch (get_hardware_msg_bit( msg->msg )) { + case QS_POINTER: case QS_RAWINPUT: - if (!(win = msg->win) && input) win = input->focus; + if (!(win = msg->win) && input) win = input->shared->focus; break; case QS_KEY: - if (input && !(win = input->focus)) + if (input && !(win = input->shared->focus)) { - win = input->active; + win = input->shared->active; if (*msg_code < WM_SYSKEYDOWN) *msg_code += WM_SYSKEYDOWN - WM_KEYDOWN; } break; case QS_MOUSEMOVE: case QS_MOUSEBUTTON: - if (!input || !(win = input->capture)) + if (!input || !(win = input->shared->capture)) { if (is_window_visible( msg->win ) && !is_window_transparent( msg->win )) win = msg->win; else win = shallow_window_from_point( desktop, msg->x, msg->y ); @@ -1669,7 +1953,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg struct hardware_msg_data *msg_data = msg->data; unsigned int msg_code; - update_input_key_state( desktop, desktop->keystate, msg->msg, msg->wparam ); + update_desktop_key_state( desktop, msg->msg, msg->wparam ); last_input_time = get_tick_count(); if (msg->msg != WM_MOUSEMOVE) always_queue = 1; @@ -1677,26 +1961,33 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg { case QS_KEY: if (queue_hotkey_message( desktop, msg )) return; - if (desktop->keystate[VK_MENU] & 0x80) msg->lparam |= KF_ALTDOWN << 16; + if (desktop->shared->keystate[VK_MENU] & 0x80) msg->lparam |= KF_ALTDOWN << 16; if (msg->wparam == VK_SHIFT || msg->wparam == VK_LSHIFT || msg->wparam == VK_RSHIFT) msg->lparam &= ~(KF_EXTENDED << 16); break; + case QS_POINTER: + if (IS_POINTER_PRIMARY_WPARAM( msg_data->rawinput.mouse.data )) + { + prepend_cursor_history( msg->x, msg->y, msg->time, msg_data->info ); + if (update_desktop_cursor_pos( desktop, msg->win, msg->x, msg->y )) always_queue = 1; + } + break; case QS_MOUSEMOVE: prepend_cursor_history( msg->x, msg->y, msg->time, msg_data->info ); /* fallthrough */ case QS_MOUSEBUTTON: if (update_desktop_cursor_pos( desktop, msg->win, msg->x, msg->y )) always_queue = 1; - if (desktop->keystate[VK_LBUTTON] & 0x80) msg->wparam |= MK_LBUTTON; - if (desktop->keystate[VK_MBUTTON] & 0x80) msg->wparam |= MK_MBUTTON; - if (desktop->keystate[VK_RBUTTON] & 0x80) msg->wparam |= MK_RBUTTON; - if (desktop->keystate[VK_SHIFT] & 0x80) msg->wparam |= MK_SHIFT; - if (desktop->keystate[VK_CONTROL] & 0x80) msg->wparam |= MK_CONTROL; - if (desktop->keystate[VK_XBUTTON1] & 0x80) msg->wparam |= MK_XBUTTON1; - if (desktop->keystate[VK_XBUTTON2] & 0x80) msg->wparam |= MK_XBUTTON2; + if (desktop->shared->keystate[VK_LBUTTON] & 0x80) msg->wparam |= MK_LBUTTON; + if (desktop->shared->keystate[VK_MBUTTON] & 0x80) msg->wparam |= MK_MBUTTON; + if (desktop->shared->keystate[VK_RBUTTON] & 0x80) msg->wparam |= MK_RBUTTON; + if (desktop->shared->keystate[VK_SHIFT] & 0x80) msg->wparam |= MK_SHIFT; + if (desktop->shared->keystate[VK_CONTROL] & 0x80) msg->wparam |= MK_CONTROL; + if (desktop->shared->keystate[VK_XBUTTON1] & 0x80) msg->wparam |= MK_XBUTTON1; + if (desktop->shared->keystate[VK_XBUTTON2] & 0x80) msg->wparam |= MK_XBUTTON2; break; } - msg->x = desktop->cursor.x; - msg->y = desktop->cursor.y; + msg->x = desktop->shared->cursor.x; + msg->y = desktop->shared->cursor.y; if (msg->win && (thread = get_window_thread( msg->win ))) { @@ -1708,7 +1999,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg win = find_hardware_message_window( desktop, input, msg, &msg_code, &thread ); if (!win || !thread) { - if (input) update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + if (input) update_input_key_state( input, msg->msg, msg->wparam ); free_message( msg ); return; } @@ -1734,8 +2025,10 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa struct message *msg; timeout_t timeout = 2000 * -10000; /* FIXME: load from registry */ int id = (input->type == INPUT_MOUSE) ? WH_MOUSE_LL : WH_KEYBOARD_LL; + thread_id_t hook_thread_id; + client_ptr_t hook_proc; - if (!(hook_thread = get_first_global_hook( id ))) return 0; + if (!(hook_thread = get_first_global_hook( id, &hook_thread_id, &hook_proc ))) return 0; if (!(queue = hook_thread->queue)) return 0; if (is_queue_hung( queue )) return 0; @@ -1760,7 +2053,7 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa else msg->lparam = input->mouse.data << 16; if (!(msg->data = memdup( hardware_msg->data, hardware_msg->data_size )) || - !(msg->result = alloc_message_result( sender, queue, msg, timeout ))) + !(msg->result = alloc_message_result( sender, queue, msg, timeout, hook_thread_id, hook_proc ))) { free_message( msg ); return 0; @@ -1776,7 +2069,7 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa static struct thread *get_foreground_thread( struct desktop *desktop, user_handle_t window ) { /* if desktop has no foreground process, assume the receiving window is */ - if (desktop->foreground_input) return get_window_thread( desktop->foreground_input->focus ); + if (desktop->foreground_input) return get_window_thread( desktop->foreground_input->shared->focus ); if (window) return get_window_thread( window ); return NULL; } @@ -1859,7 +2152,7 @@ static int queue_rawinput_message( struct process* process, void *arg ) /* queue a hardware message for a mouse event */ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input, - unsigned int origin, struct msg_queue *sender ) + unsigned int origin, struct msg_queue *sender, unsigned int req_flags ) { const struct rawinput_device *device; struct hardware_msg_data *msg_data; @@ -1887,10 +2180,14 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */ }; - desktop->cursor.last_change = get_tick_count(); + if ((input->mouse.info & 0xffffff00) == 0xff515700) source.origin = IMDT_TOUCH; + + /* update last desktop cursor change time */ + update_desktop_cursor_pos( desktop, desktop->cursor_win, desktop->shared->cursor.x, desktop->shared->cursor.y ); + flags = input->mouse.flags; time = input->mouse.time; - if (!time) time = desktop->cursor.last_change; + if (!time) time = desktop->shared->cursor.last_change; if (flags & MOUSEEVENTF_MOVE) { @@ -1899,22 +2196,22 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons x = input->mouse.x; y = input->mouse.y; if (flags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE) && - x == desktop->cursor.x && y == desktop->cursor.y) + x == desktop->shared->cursor.x && y == desktop->shared->cursor.y) flags &= ~MOUSEEVENTF_MOVE; } else { - x = desktop->cursor.x + input->mouse.x; - y = desktop->cursor.y + input->mouse.y; + x = desktop->shared->cursor.x + input->mouse.x; + y = desktop->shared->cursor.y + input->mouse.y; } } else { - x = desktop->cursor.x; - y = desktop->cursor.y; + x = desktop->shared->cursor.x; + y = desktop->shared->cursor.y; } - if ((foreground = get_foreground_thread( desktop, win ))) + if ((req_flags & SEND_HWMSG_RAWINPUT) && (foreground = get_foreground_thread( desktop, win ))) { memset( &raw_msg, 0, sizeof(raw_msg) ); raw_msg.foreground = foreground; @@ -1928,8 +2225,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons msg_data->size = sizeof(*msg_data); msg_data->flags = flags; msg_data->rawinput.type = RIM_TYPEMOUSE; - msg_data->rawinput.mouse.x = x - desktop->cursor.x; - msg_data->rawinput.mouse.y = y - desktop->cursor.y; + msg_data->rawinput.mouse.x = (flags & MOUSEEVENTF_MOVE) ? input->mouse.x : 0; + msg_data->rawinput.mouse.y = (flags & MOUSEEVENTF_MOVE) ? input->mouse.y : 0; msg_data->rawinput.mouse.data = input->mouse.data; enum_processes( queue_rawinput_message, &raw_msg ); @@ -1974,7 +2271,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons /* queue a hardware message for a keyboard event */ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input, - unsigned int origin, struct msg_queue *sender ) + unsigned int origin, struct msg_queue *sender, unsigned int req_flags ) { struct hw_msg_source source = { IMDT_KEYBOARD, origin }; const struct rawinput_device *device; @@ -2018,17 +2315,16 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c if (input->kbd.flags & KEYEVENTF_KEYUP) { /* send WM_SYSKEYUP if Alt still pressed and no other key in between */ - /* we use 0x02 as a flag to track if some other SYSKEYUP was sent already */ - if ((desktop->keystate[VK_MENU] & 0x82) != 0x82) break; + if (!(desktop->shared->keystate[VK_MENU] & 0x80) || !desktop->last_press_alt) break; message_code = WM_SYSKEYUP; - desktop->keystate[VK_MENU] &= ~0x02; + desktop->last_press_alt = 0; } else { /* send WM_SYSKEYDOWN for Alt except with Ctrl */ - if (desktop->keystate[VK_CONTROL] & 0x80) break; + if (desktop->shared->keystate[VK_CONTROL] & 0x80) break; message_code = WM_SYSKEYDOWN; - desktop->keystate[VK_MENU] |= 0x02; + desktop->last_press_alt = 1; } break; @@ -2036,23 +2332,23 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c case VK_RCONTROL: /* send WM_SYSKEYUP on release if Alt still pressed */ if (!(input->kbd.flags & KEYEVENTF_KEYUP)) break; - if (!(desktop->keystate[VK_MENU] & 0x80)) break; + if (!(desktop->shared->keystate[VK_MENU] & 0x80)) break; message_code = WM_SYSKEYUP; - desktop->keystate[VK_MENU] &= ~0x02; + desktop->last_press_alt = 0; break; default: /* send WM_SYSKEY for Alt-anykey and for F10 */ - if (desktop->keystate[VK_CONTROL] & 0x80) break; - if (!(desktop->keystate[VK_MENU] & 0x80)) break; + if (desktop->shared->keystate[VK_CONTROL] & 0x80) break; + if (!(desktop->shared->keystate[VK_MENU] & 0x80)) break; /* fall through */ case VK_F10: message_code = (input->kbd.flags & KEYEVENTF_KEYUP) ? WM_SYSKEYUP : WM_SYSKEYDOWN; - desktop->keystate[VK_MENU] &= ~0x02; + desktop->last_press_alt = 0; break; } - if ((foreground = get_foreground_thread( desktop, win ))) + if ((req_flags & SEND_HWMSG_RAWINPUT) && (foreground = get_foreground_thread( desktop, win ))) { memset( &raw_msg, 0, sizeof(raw_msg) ); raw_msg.foreground = foreground; @@ -2076,7 +2372,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c if ((device = current->process->rawinput_kbd) && (device->flags & RIDEV_NOLEGACY)) { - update_input_key_state( desktop, desktop->keystate, message_code, vkey ); + update_desktop_key_state( desktop, message_code, vkey ); return 0; } @@ -2098,7 +2394,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c if (input->kbd.flags & KEYEVENTF_EXTENDEDKEY) flags |= KF_EXTENDED; /* FIXME: set KF_DLGMODE and KF_MENUMODE when needed */ if (input->kbd.flags & KEYEVENTF_KEYUP) flags |= KF_REPEAT | KF_UP; - else if (desktop->keystate[vkey] & 0x80) flags |= KF_REPEAT; + else if (desktop->shared->keystate[vkey] & 0x80) flags |= KF_REPEAT; msg->wparam = vkey; msg->lparam |= flags << 16; @@ -2111,6 +2407,58 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c return wait; } +struct touch +{ + struct list entry; + struct desktop *desktop; + user_handle_t win; + hw_input_t input; + struct timeout_user *timeout; +}; + +static void queue_touch_input_message( void *private ) +{ + struct hw_msg_source source = { IMDT_UNAVAILABLE, IMDT_TOUCH }; + struct touch *touch = private; + struct desktop *desktop = touch->desktop; + const hw_input_t *input = &touch->input; + user_handle_t win = touch->win; + struct hardware_msg_data *msg_data; + struct message *msg; + + if (!(msg = alloc_hardware_message( 0, source, get_tick_count(), 0 ))) return; + + msg_data = msg->data; + msg_data->info = 0; + msg_data->size = sizeof(*msg_data); + msg_data->flags = input->hw.lparam; + msg_data->rawinput = input->hw.rawinput; + + msg->win = get_user_full_handle( win ); + msg->msg = input->hw.msg; + msg->wparam = 0; + msg->lparam = input->hw.lparam; + msg->x = input->hw.rawinput.mouse.x; + msg->y = input->hw.rawinput.mouse.y; + + queue_hardware_message( desktop, msg, 1 ); + touch->timeout = add_timeout_user( -160000, queue_touch_input_message, touch ); +} + +static struct touch *find_touch_input( struct desktop *desktop, unsigned int id ) +{ + struct touch *touch; + + LIST_FOR_EACH_ENTRY( touch, &desktop->touches, struct touch, entry ) + if (LOWORD(touch->input.hw.rawinput.mouse.data) == id) return touch; + + touch = mem_alloc( sizeof(struct touch) ); + list_add_tail( &desktop->touches, &touch->entry ); + touch->desktop = desktop; + touch->timeout = NULL; + return touch; +} + /* queue a hardware message for a custom type of event */ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_t win, unsigned int origin, const hw_input_t *input ) @@ -2118,6 +2466,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ struct hw_msg_source source = { IMDT_UNAVAILABLE, origin }; struct hardware_msg_data *msg_data; struct rawinput_message raw_msg; + struct touch *touch; struct message *msg; data_size_t report_size = 0; @@ -2146,18 +2495,50 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ msg_data->size = sizeof(*msg_data) + report_size; msg_data->rawinput = input->hw.rawinput; + if (input->hw.msg == WM_INPUT && input->hw.rawinput.type == RIM_TYPEMOUSE) + msg_data->flags = input->hw.lparam; + enum_processes( queue_rawinput_message, &raw_msg ); return; } + if (input->hw.msg == WM_POINTERDOWN || input->hw.msg == WM_POINTERUP || + input->hw.msg == WM_POINTERUPDATE) + source.device = IMDT_TOUCH; + if (!(msg = alloc_hardware_message( 0, source, get_tick_count(), 0 ))) return; + if (input->hw.msg == WM_POINTERDOWN || input->hw.msg == WM_POINTERUP || + input->hw.msg == WM_POINTERUPDATE) + { + msg_data = msg->data; + msg_data->info = 0; + msg_data->size = sizeof(*msg_data); + msg_data->flags = input->hw.lparam; + msg_data->rawinput = input->hw.rawinput; + touch = find_touch_input( desktop, LOWORD(input->hw.rawinput.mouse.data) ); + if (touch->timeout) remove_timeout_user( touch->timeout ); + if (input->hw.msg != WM_POINTERUP) + { + touch->win = win; + touch->input = *input; + touch->input.hw.msg = WM_POINTERUPDATE; + touch->input.hw.rawinput.mouse.data &= ~(POINTER_MESSAGE_FLAG_NEW << 16); + touch->timeout = add_timeout_user( -160000, queue_touch_input_message, touch ); + } + else + { + list_remove( &touch->entry ); + free( touch ); + } + } + msg->win = get_user_full_handle( win ); msg->msg = input->hw.msg; msg->wparam = 0; msg->lparam = input->hw.lparam; - msg->x = desktop->cursor.x; - msg->y = desktop->cursor.y; + msg->x = input->hw.rawinput.mouse.x; + msg->y = input->hw.rawinput.mouse.y; queue_hardware_message( desktop, msg, 1 ); } @@ -2245,7 +2626,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user if (!win || !win_thread) { /* no window at all, remove it */ - update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + update_input_key_state( input, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); continue; @@ -2261,7 +2642,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user else { /* for another thread input, drop it */ - update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + update_input_key_state( input, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); } @@ -2298,7 +2679,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user data->hw_id = msg->unique_id; set_reply_data( msg->data, msg->data_size ); - if ((get_hardware_msg_bit( msg->msg ) == QS_RAWINPUT && (flags & PM_REMOVE)) || + if ((get_hardware_msg_bit( msg->msg ) & (QS_RAWINPUT | QS_POINTER) && (flags & PM_REMOVE)) || is_internal_hardware_message( msg->msg )) release_hardware_message( current->queue, data->hw_id ); return 1; @@ -2476,6 +2857,21 @@ void post_win_event( struct thread *thread, unsigned int event, } } +void free_touches( struct desktop *desktop, user_handle_t window ) +{ + struct touch *touch, *next; + + LIST_FOR_EACH_ENTRY_SAFE( touch, next, &desktop->touches, struct touch, entry ) + { + if (!window || touch->win == window) + { + list_remove( &touch->entry ); + if (touch->timeout) remove_timeout_user( touch->timeout ); + free( touch ); + } + } +} + /* free all hotkeys on a desktop, optionally filtering by window */ void free_hotkeys( struct desktop *desktop, user_handle_t window ) { @@ -2553,12 +2949,35 @@ DECL_HANDLER(set_queue_mask) queue->changed_mask = req->changed_mask; reply->wake_bits = queue->wake_bits; reply->changed_bits = queue->changed_bits; + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_mask = queue->wake_mask; + shared->changed_mask = queue->changed_mask; + } + SHARED_WRITE_END + if (is_signaled( queue )) { /* if skip wait is set, do what would have been done in the subsequent wait */ - if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0; + if (req->skip_wait) + { + queue->wake_mask = queue->changed_mask = 0; + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_mask = queue->wake_mask; + shared->changed_mask = queue->changed_mask; + } + SHARED_WRITE_END + } else wake_up( &queue->obj, 0 ); } + + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); } } @@ -2572,6 +2991,18 @@ DECL_HANDLER(get_queue_status) reply->wake_bits = queue->wake_bits; reply->changed_bits = queue->changed_bits; queue->changed_bits &= ~req->clear_bits; + + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->changed_bits = queue->changed_bits; + } + SHARED_WRITE_END } else reply->wake_bits = reply->changed_bits = 0; } @@ -2626,7 +3057,7 @@ DECL_HANDLER(send_message) case MSG_ASCII: case MSG_UNICODE: case MSG_CALLBACK: - if (!(msg->result = alloc_message_result( send_queue, recv_queue, msg, req->timeout ))) + if (!(msg->result = alloc_message_result( send_queue, recv_queue, msg, req->timeout, 0, 0 ))) { free_message( msg ); break; @@ -2678,16 +3109,16 @@ DECL_HANDLER(send_hardware_message) } } - reply->prev_x = desktop->cursor.x; - reply->prev_y = desktop->cursor.y; + reply->prev_x = desktop->shared->cursor.x; + reply->prev_y = desktop->shared->cursor.y; switch (req->input.type) { case INPUT_MOUSE: - reply->wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender ); + reply->wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender, req->flags ); break; case INPUT_KEYBOARD: - reply->wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender ); + reply->wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender, req->flags ); break; case INPUT_HARDWARE: queue_custom_hardware_message( desktop, req->win, origin, &req->input ); @@ -2697,8 +3128,8 @@ DECL_HANDLER(send_hardware_message) } if (thread) release_object( thread ); - reply->new_x = desktop->cursor.x; - reply->new_y = desktop->cursor.y; + reply->new_x = desktop->shared->cursor.x; + reply->new_y = desktop->shared->cursor.y; release_object( desktop ); } @@ -2724,8 +3155,6 @@ DECL_HANDLER(get_message) user_handle_t get_win = get_user_full_handle( req->get_win ); unsigned int filter = req->flags >> 16; - reply->active_hooks = get_active_hooks(); - if (get_win && get_win != 1 && get_win != -1 && !get_user_object( get_win, USER_WINDOW )) { set_win32_error( ERROR_INVALID_WINDOW_HANDLE ); @@ -2753,6 +3182,12 @@ DECL_HANDLER(get_message) if (filter & QS_INPUT) queue->changed_bits &= ~QS_INPUT; if (filter & QS_PAINT) queue->changed_bits &= ~QS_PAINT; + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->changed_bits = queue->changed_bits; + } + SHARED_WRITE_END + /* then check for posted messages */ if ((filter & QS_POSTMESSAGE) && get_posted_message( queue, get_win, req->get_first, req->get_last, req->flags, reply )) @@ -2811,7 +3246,22 @@ DECL_HANDLER(get_message) if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event ); queue->wake_mask = req->wake_mask; queue->changed_mask = req->changed_mask; + + SHARED_WRITE_BEGIN( queue, queue_shm_t ) + { + shared->wake_mask = queue->wake_mask; + shared->changed_mask = queue->changed_mask; + } + SHARED_WRITE_END + set_error( STATUS_PENDING ); /* FIXME */ + + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + } @@ -3155,19 +3605,15 @@ DECL_HANDLER(get_thread_input) if (input) { - reply->focus = input->focus; - reply->capture = input->capture; - reply->active = input->active; - reply->menu_owner = input->menu_owner; - reply->move_size = input->move_size; - reply->caret = input->caret; - reply->cursor = input->cursor; - reply->show_count = input->cursor_count; - reply->rect = input->caret_rect; + reply->focus = input->shared->focus; + reply->capture = input->shared->capture; + reply->active = input->shared->active; + reply->menu_owner = input->shared->menu_owner; + reply->move_size = input->shared->move_size; + reply->caret = input->shared->caret; + reply->rect = input->shared->caret_rect; } - /* foreground window is active window of foreground thread */ - reply->foreground = desktop->foreground_input ? desktop->foreground_input->active : 0; if (thread) release_object( thread ); release_object( desktop ); } @@ -3184,22 +3630,27 @@ DECL_HANDLER(get_key_state) if (!(desktop = get_thread_desktop( current, 0 ))) return; if (req->key >= 0) { - reply->state = desktop->keystate[req->key & 0xff]; - desktop->keystate[req->key & 0xff] &= ~0x40; + reply->state = desktop->shared->keystate[req->key & 0xff]; + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + ++shared->update_serial; + shared->keystate[req->key & 0xff] &= ~0x40; + } + SHARED_WRITE_END } - set_reply_data( desktop->keystate, size ); + else set_reply_data( (void *)desktop->shared->keystate, size ); release_object( desktop ); } else { struct msg_queue *queue = get_current_queue(); - unsigned char *keystate = queue->input->keystate; + unsigned char *keystate = (void *)queue->input->shared->keystate; if (req->key >= 0) { sync_input_keystate( queue->input ); reply->state = keystate[req->key & 0xff]; } - set_reply_data( keystate, size ); + else set_reply_data( keystate, size ); } } @@ -3211,11 +3662,23 @@ DECL_HANDLER(set_key_state) struct msg_queue *queue = get_current_queue(); data_size_t size = min( 256, get_req_data_size() ); - memcpy( queue->input->keystate, get_req_data(), size ); - memcpy( queue->input->desktop_keystate, queue->input->desktop->keystate, 256 ); + SHARED_WRITE_BEGIN( queue->input, input_shm_t ) + { + memcpy( (void *)shared->keystate, get_req_data(), size ); + } + SHARED_WRITE_END + + memcpy( queue->input->desktop_keystate, (void *)queue->input->desktop->shared->keystate, + sizeof(queue->input->desktop_keystate) ); if (req->async && (desktop = get_thread_desktop( current, 0 ))) { - memcpy( desktop->keystate, get_req_data(), size ); + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + ++shared->update_serial; + memcpy( (void *)shared->keystate, get_req_data(), size ); + } + SHARED_WRITE_END + release_object( desktop ); } } @@ -3229,7 +3692,7 @@ DECL_HANDLER(set_foreground_window) struct msg_queue *queue = get_current_queue(); if (!(desktop = get_thread_desktop( current, 0 ))) return; - reply->previous = desktop->foreground_input ? desktop->foreground_input->active : 0; + reply->previous = desktop->foreground_input ? desktop->foreground_input->shared->active : 0; reply->send_msg_old = (reply->previous && desktop->foreground_input != queue->input); reply->send_msg_new = FALSE; @@ -3255,8 +3718,13 @@ DECL_HANDLER(set_focus_window) reply->previous = 0; if (queue && check_queue_input_window( queue, req->handle )) { - reply->previous = queue->input->focus; - queue->input->focus = get_user_full_handle( req->handle ); + user_handle_t focus = get_user_full_handle( req->handle ); + reply->previous = queue->input->shared->focus; + SHARED_WRITE_BEGIN( queue->input, input_shm_t ) + { + shared->focus = focus; + } + SHARED_WRITE_END } } @@ -3264,18 +3732,35 @@ DECL_HANDLER(set_focus_window) /* set the current thread active window */ DECL_HANDLER(set_active_window) { + struct message *msg, *next; struct msg_queue *queue = get_current_queue(); + struct desktop *desktop; + + if (!(desktop = get_thread_desktop( current, 0 ))) return; reply->previous = 0; if (queue && check_queue_input_window( queue, req->handle )) { if (!req->handle || make_window_active( req->handle )) { - reply->previous = queue->input->active; - queue->input->active = get_user_full_handle( req->handle ); + user_handle_t active = get_user_full_handle( req->handle ); + reply->previous = queue->input->shared->active; + SHARED_WRITE_BEGIN( queue->input, input_shm_t ) + { + shared->active = active; + } + SHARED_WRITE_END + + if (desktop->foreground_input == queue->input && req->handle != reply->previous) + { + LIST_FOR_EACH_ENTRY_SAFE( msg, next, &queue->msg_list[POST_MESSAGE], struct message, entry ) + if (msg->msg == req->internal_msg) remove_queue_message( queue, msg, POST_MESSAGE ); + } } else set_error( STATUS_INVALID_HANDLE ); } + + release_object( desktop ); } @@ -3288,18 +3773,24 @@ DECL_HANDLER(set_capture_window) if (queue && check_queue_input_window( queue, req->handle )) { struct thread_input *input = queue->input; + user_handle_t capture = get_user_full_handle( req->handle ); /* if in menu mode, reject all requests to change focus, except if the menu bit is set */ - if (input->menu_owner && !(req->flags & CAPTURE_MENU)) + if (input->shared->menu_owner && !(req->flags & CAPTURE_MENU)) { set_error(STATUS_ACCESS_DENIED); return; } - reply->previous = input->capture; - input->capture = get_user_full_handle( req->handle ); - input->menu_owner = (req->flags & CAPTURE_MENU) ? input->capture : 0; - input->move_size = (req->flags & CAPTURE_MOVESIZE) ? input->capture : 0; - reply->full_handle = input->capture; + reply->previous = input->shared->capture; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->capture = capture; + shared->menu_owner = (req->flags & CAPTURE_MENU) ? shared->capture : 0; + shared->move_size = (req->flags & CAPTURE_MOVESIZE) ? shared->capture : 0; + } + SHARED_WRITE_END + + reply->full_handle = input->shared->capture; } } @@ -3313,15 +3804,20 @@ DECL_HANDLER(set_caret_window) if (queue && check_queue_input_window( queue, req->handle )) { struct thread_input *input = queue->input; + user_handle_t caret = get_user_full_handle(req->handle); - reply->previous = input->caret; - reply->old_rect = input->caret_rect; + reply->previous = input->shared->caret; + reply->old_rect = input->shared->caret_rect; reply->old_hide = input->caret_hide; reply->old_state = input->caret_state; - set_caret_window( input, get_user_full_handle(req->handle) ); - input->caret_rect.right = input->caret_rect.left + req->width; - input->caret_rect.bottom = input->caret_rect.top + req->height; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + set_caret_window( input, shared, caret ); + shared->caret_rect.right = shared->caret_rect.left + req->width; + shared->caret_rect.bottom = shared->caret_rect.top + req->height; + } + SHARED_WRITE_END } } @@ -3334,22 +3830,26 @@ DECL_HANDLER(set_caret_info) if (!queue) return; input = queue->input; - reply->full_handle = input->caret; - reply->old_rect = input->caret_rect; + reply->full_handle = input->shared->caret; + reply->old_rect = input->shared->caret_rect; reply->old_hide = input->caret_hide; reply->old_state = input->caret_state; - if (req->handle && get_user_full_handle(req->handle) != input->caret) + if (req->handle && get_user_full_handle(req->handle) != input->shared->caret) { set_error( STATUS_ACCESS_DENIED ); return; } if (req->flags & SET_CARET_POS) { - input->caret_rect.right += req->x - input->caret_rect.left; - input->caret_rect.bottom += req->y - input->caret_rect.top; - input->caret_rect.left = req->x; - input->caret_rect.top = req->y; + SHARED_WRITE_BEGIN( input, input_shm_t ) + { + shared->caret_rect.right += req->x - shared->caret_rect.left; + shared->caret_rect.bottom += req->y - shared->caret_rect.top; + shared->caret_rect.left = req->x; + shared->caret_rect.top = req->y; + } + SHARED_WRITE_END } if (req->flags & SET_CARET_HIDE) { @@ -3388,25 +3888,32 @@ DECL_HANDLER(set_cursor) input = queue->input; desktop = input->desktop; - reply->prev_handle = input->cursor; - reply->prev_count = input->cursor_count; - reply->prev_x = desktop->cursor.x; - reply->prev_y = desktop->cursor.y; + reply->prev_handle = input->shared->cursor; + reply->prev_count = input->shared->cursor_count; + reply->prev_x = desktop->shared->cursor.x; + reply->prev_y = desktop->shared->cursor.y; - if (req->flags & SET_CURSOR_HANDLE) + if ((req->flags & SET_CURSOR_HANDLE) && req->handle && + !get_user_object( req->handle, USER_CLIENT )) { - if (req->handle && !get_user_object( req->handle, USER_CLIENT )) - { - set_win32_error( ERROR_INVALID_CURSOR_HANDLE ); - return; - } - input->cursor = req->handle; + set_win32_error( ERROR_INVALID_CURSOR_HANDLE ); + return; } - if (req->flags & SET_CURSOR_COUNT) + + SHARED_WRITE_BEGIN( input, input_shm_t ) { - queue->cursor_count += req->show_count; - input->cursor_count += req->show_count; + if (req->flags & SET_CURSOR_HANDLE) + { + shared->cursor = req->handle; + } + if (req->flags & SET_CURSOR_COUNT) + { + queue->cursor_count += req->show_count; + shared->cursor_count += req->show_count; + } } + SHARED_WRITE_END + if (req->flags & SET_CURSOR_POS) set_cursor_pos( desktop, req->x, req->y ); if (req->flags & SET_CURSOR_CLIP) set_clip_rectangle( desktop, &req->clip, req->flags, 0 ); if (req->flags & SET_CURSOR_NOCLIP) set_clip_rectangle( desktop, NULL, SET_CURSOR_NOCLIP, 0 ); @@ -3414,10 +3921,10 @@ DECL_HANDLER(set_cursor) if (req->flags & (SET_CURSOR_HANDLE | SET_CURSOR_COUNT)) update_desktop_cursor_handle( desktop, input ); - reply->new_x = desktop->cursor.x; - reply->new_y = desktop->cursor.y; - reply->new_clip = desktop->cursor.clip; - reply->last_change = desktop->cursor.last_change; + reply->new_x = desktop->shared->cursor.x; + reply->new_y = desktop->shared->cursor.y; + reply->new_clip = desktop->shared->cursor.clip; + reply->last_change = desktop->shared->cursor.last_change; } /* Get the history of the 64 last cursor positions */ @@ -3476,6 +3983,8 @@ DECL_HANDLER(get_rawinput_buffer) count++; } + if (req->clear_qs_rawinput && !ptr) clear_queue_bits( current->queue, QS_RAWINPUT ); + reply->next_size = next_size; reply->count = count; set_reply_data_ptr( buf, pos ); @@ -3508,3 +4017,33 @@ DECL_HANDLER(update_rawinput_devices) process->rawinput_mouse = find_rawinput_device( process, 1, 2 ); process->rawinput_kbd = find_rawinput_device( process, 1, 6 ); } + +DECL_HANDLER(esync_msgwait) +{ + struct msg_queue *queue = get_current_queue(); + + if (!queue) return; + queue->esync_in_msgwait = req->in_msgwait; + + if (current->process->idle_event && !(queue->wake_mask & QS_SMRESULT)) + set_event( current->process->idle_event ); + + /* and start/stop waiting on the driver */ + if (queue->fd) + set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 ); +} + +DECL_HANDLER(fsync_msgwait) +{ + struct msg_queue *queue = get_current_queue(); + + if (!queue) return; + queue->fsync_in_msgwait = req->in_msgwait; + + if (current->process->idle_event && !(queue->wake_mask & QS_SMRESULT)) + set_event( current->process->idle_event ); + + /* and start/stop waiting on the driver */ + if (queue->fd) + set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 ); +} diff --git a/server/registry.c b/server/registry.c index 0128b8be9d8..2baf9e40839 100644 --- a/server/registry.c +++ b/server/registry.c @@ -90,6 +90,7 @@ struct key unsigned int flags; /* flags */ timeout_t modif; /* last modification time */ struct list notify_list; /* list of notifications */ + abstime_t timestamp_counter; /* timestamp counter at last change */ }; /* key flags */ @@ -118,19 +119,18 @@ struct key_value #define MAX_NAME_LEN 256 /* max. length of a key name */ #define MAX_VALUE_LEN 16383 /* max. length of a value name */ +static abstime_t change_timestamp_counter; + /* the root of the registry tree */ static struct key *root_key; static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC; -static const timeout_t save_period = 30 * -TICKS_PER_SEC; /* delay between periodic saves */ -static struct timeout_user *save_timeout_user; /* saving timer */ -static enum prefix_type { PREFIX_UNKNOWN, PREFIX_32BIT, PREFIX_64BIT } prefix_type; +static enum prefix_type prefix_type; static const WCHAR wow6432node[] = {'W','o','w','6','4','3','2','N','o','d','e'}; static const WCHAR symlink_value[] = {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e'}; static const struct unicode_str symlink_str = { symlink_value, sizeof(symlink_value) }; -static void set_periodic_save_timer(void); static struct key_value *find_value( const struct key *key, const struct unicode_str *name, int *index ); /* information about where to save a registry branch */ @@ -180,6 +180,8 @@ static const struct object_ops key_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -708,6 +710,7 @@ static struct key *create_key_object( struct object *parent, const struct unicod key->last_value = -1; key->values = NULL; key->modif = modif; + key->timestamp_counter = 0; list_init( &key->notify_list ); if (options & REG_OPTION_CREATE_LINK) key->flags |= KEY_SYMLINK; @@ -728,23 +731,25 @@ static struct key *create_key_object( struct object *parent, const struct unicod /* mark a key and all its parents as dirty (modified) */ static void make_dirty( struct key *key ) { + ++change_timestamp_counter; while (key) { if (key->flags & (KEY_DIRTY|KEY_VOLATILE)) return; /* nothing to do */ key->flags |= KEY_DIRTY; + key->timestamp_counter = change_timestamp_counter; key = get_parent( key ); } } /* mark a key and all its subkeys as clean (not modified) */ -static void make_clean( struct key *key ) +static void make_clean( struct key *key, abstime_t timestamp_counter ) { int i; if (key->flags & KEY_VOLATILE) return; if (!(key->flags & KEY_DIRTY)) return; - key->flags &= ~KEY_DIRTY; - for (i = 0; i <= key->last_subkey; i++) make_clean( key->subkeys[i] ); + if (key->timestamp_counter <= timestamp_counter) key->flags &= ~KEY_DIRTY; + for (i = 0; i <= key->last_subkey; i++) make_clean( key->subkeys[i], timestamp_counter ); } /* go through all the notifications and send them if necessary */ @@ -1976,9 +1981,6 @@ void init_registry(void) release_object( hklm ); release_object( hkcu ); - /* start the periodic save timer */ - set_periodic_save_timer(); - /* create windows directories */ if (!mkdir( "drive_c/windows", 0777 )) @@ -2001,6 +2003,7 @@ void init_registry(void) /* save a registry branch to a file */ static void save_all_subkeys( struct key *key, FILE *f ) { + /* Registry format in ntdll/registry.c:save_all_subkeys() should match. */ fprintf( f, "WINE REGISTRY Version 2\n" ); fprintf( f, ";; All keys relative to " ); dump_path( key, NULL, f ); @@ -2019,29 +2022,104 @@ static void save_all_subkeys( struct key *key, FILE *f ) save_subkeys( key, key, f ); } -/* save a registry branch to a file handle */ -static void save_registry( struct key *key, obj_handle_t handle ) +static data_size_t serialize_value( const struct key_value *value, char *buf ) { - struct file *file; - int fd; + data_size_t size; - if (!(file = get_file_obj( current->process, handle, FILE_WRITE_DATA ))) return; - fd = dup( get_file_unix_fd( file ) ); - release_object( file ); - if (fd != -1) + size = sizeof(data_size_t) + value->namelen + sizeof(unsigned int) + sizeof(data_size_t) + value->len; + if (!buf) return size; + + *(data_size_t *)buf = value->namelen; + buf += sizeof(data_size_t); + memcpy( buf, value->name, value->namelen ); + buf += value->namelen; + + *(unsigned int *)buf = value->type; + buf += sizeof(unsigned int); + + *(data_size_t *)buf = value->len; + buf += sizeof(data_size_t); + memcpy( buf, value->data, value->len ); + + return size; +} + +/* save a registry key with subkeys to a buffer */ +static data_size_t serialize_key( const struct key *key, char *buf ) +{ + data_size_t size; + int subkey_count, i; + + if (key->flags & KEY_VOLATILE) return 0; + + size = sizeof(data_size_t) + key->obj.name->len + sizeof(data_size_t) + key->classlen + sizeof(int) + sizeof(int) + + sizeof(unsigned int) + sizeof(timeout_t); + for (i = 0; i <= key->last_value; i++) + size += serialize_value( &key->values[i], buf ? buf + size : NULL ); + subkey_count = 0; + for (i = 0; i <= key->last_subkey; i++) { - FILE *f = fdopen( fd, "w" ); - if (f) - { - save_all_subkeys( key, f ); - if (fclose( f )) file_set_error(); - } - else - { - file_set_error(); - close( fd ); - } + if (key->subkeys[i]->flags & KEY_VOLATILE) continue; + size += serialize_key( key->subkeys[i], buf ? buf + size : NULL ); + ++subkey_count; + } + if (!buf) return size; + + *(data_size_t *)buf = key->obj.name->len; + buf += sizeof(data_size_t); + memcpy( buf, key->obj.name->name, key->obj.name->len ); + buf += key->obj.name->len; + + *(data_size_t *)buf = key->classlen; + buf += sizeof(data_size_t); + memcpy( buf, key->class, key->classlen ); + buf += key->classlen; + + *(int *)buf = key->last_value + 1; + buf += sizeof(int); + + *(int *)buf = subkey_count; + buf += sizeof(int); + + *(unsigned int *)buf = key->flags & KEY_SYMLINK; + buf += sizeof(unsigned int); + + *(timeout_t *)buf = key->modif; + + return size; +} + +/* save registry branch to buffer */ +static data_size_t save_registry( const struct key *key, char *buf ) +{ + int *parent_count = NULL; + const struct key *parent; + data_size_t size; + + size = sizeof(int) + sizeof(int); + if (buf) + { + *(int *)buf = prefix_type; + buf += sizeof(int); + parent_count = (int *)buf; + buf += sizeof(int); + *parent_count = 0; } + + parent = key; + do + { + size += sizeof(data_size_t) + parent->obj.name->len; + if (!buf) continue; + ++*parent_count; + *(data_size_t *)buf = parent->obj.name->len; + buf += sizeof(data_size_t); + memcpy( buf, parent->obj.name->name, parent->obj.name->len ); + buf += parent->obj.name->len; + } while ((parent = get_parent( parent ))); + + size += serialize_key( key, buf ); + return size; } /* save a registry branch to a file */ @@ -2114,30 +2192,10 @@ static int save_branch( struct key *key, const char *path ) done: free( tmp ); - if (ret) make_clean( key ); + if (ret) make_clean( key, key->timestamp_counter ); return ret; } -/* periodic saving of the registry */ -static void periodic_save( void *arg ) -{ - int i; - - if (fchdir( config_dir_fd ) == -1) return; - save_timeout_user = NULL; - for (i = 0; i < save_branch_count; i++) - save_branch( save_branch_info[i].key, save_branch_info[i].path ); - if (fchdir( server_dir_fd ) == -1) fatal_error( "chdir to server dir: %s\n", strerror( errno )); - set_periodic_save_timer(); -} - -/* start the periodic save timer */ -static void set_periodic_save_timer(void) -{ - if (save_timeout_user) remove_timeout_user( save_timeout_user ); - save_timeout_user = add_timeout_user( save_period, periodic_save, NULL ); -} - /* save the modified registry branches to disk */ void flush_registry(void) { @@ -2162,6 +2220,36 @@ static int is_wow64_thread( struct thread *thread ) return (is_machine_64bit( native_machine ) && !is_machine_64bit( thread->process->machine )); } +/* find all the branches inside the specified key or the branch containing the key */ +static void find_branches_for_key( struct key *key, int *branches, int *branch_count ) +{ + struct key *k; + int i; + + *branch_count = 0; + for (i = 0; i < save_branch_count; i++) + { + k = save_branch_info[i].key; + while ((k = get_parent(k))) + { + if (k != key) continue; + branches[(*branch_count)++] = i; + break; + } + } + + if (*branch_count) return; + + do + { + for (i = 0; i < save_branch_count; i++) + { + if(key != save_branch_info[i].key) continue; + branches[(*branch_count)++] = i; + return; + } + } while ((key = get_parent( key ))); +} /* create a registry key */ DECL_HANDLER(create_key) @@ -2226,17 +2314,58 @@ DECL_HANDLER(delete_key) } } -/* flush a registry key */ +/* return registry branches snaphot data for flushing key */ DECL_HANDLER(flush_key) { struct key *key = get_hkey_obj( req->hkey, 0 ); - if (key) + int branches[3], branch_count = 0, i, path_len; + char *data; + + if (!key) return; + + reply->total = 0; + reply->branch_count = 0; + if ((key->flags & KEY_DIRTY) && !(key->flags & KEY_VOLATILE)) + find_branches_for_key( key, branches, &branch_count ); + release_object( key ); + + reply->timestamp_counter = change_timestamp_counter; + for (i = 0; i < branch_count; ++i) { - /* we don't need to do anything here with the current implementation */ - release_object( key ); + if (!(save_branch_info[branches[i]].key->flags & KEY_DIRTY)) continue; + ++reply->branch_count; + path_len = strlen( save_branch_info[branches[i]].path ) + 1; + reply->total += sizeof(int) + sizeof(int) + path_len + save_registry( save_branch_info[branches[i]].key, NULL ); + } + if (reply->total > get_reply_max_size()) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return; + } + + if (!(data = set_reply_data_size( reply->total ))) return; + + for (i = 0; i < branch_count; ++i) + { + if (!(save_branch_info[branches[i]].key->flags & KEY_DIRTY)) continue; + *(int *)data = branches[i]; + data += sizeof(int); + path_len = strlen( save_branch_info[branches[i]].path ) + 1; + *(int *)data = path_len; + data += sizeof(int); + memcpy( data, save_branch_info[branches[i]].path, path_len ); + data += path_len; + data += save_registry( save_branch_info[branches[i]].key, data ); } } +/* clear dirty state after successful registry branch flush */ +DECL_HANDLER(flush_key_done) +{ + if (req->branch < save_branch_count) make_clean( save_branch_info[req->branch].key, req->timestamp_counter ); + else set_error( STATUS_INVALID_PARAMETER ); +} + /* enumerate registry subkeys */ DECL_HANDLER(enum_key) { @@ -2368,6 +2497,7 @@ DECL_HANDLER(unload_registry) DECL_HANDLER(save_registry) { struct key *key; + char *data; if (!thread_single_check_privilege( current, SeBackupPrivilege )) { @@ -2377,7 +2507,13 @@ DECL_HANDLER(save_registry) if ((key = get_hkey_obj( req->hkey, 0 ))) { - save_registry( key, req->file ); + reply->total = save_registry( key, NULL ); + if (reply->total <= get_reply_max_size()) + { + if ((data = set_reply_data_size( reply->total ))) + save_registry( key, data ); + } + else set_error( STATUS_BUFFER_TOO_SMALL ); release_object( key ); } } diff --git a/server/request.c b/server/request.c index 7021741c765..343e1a92e0e 100644 --- a/server/request.c +++ b/server/request.c @@ -90,6 +90,8 @@ static const struct object_ops master_socket_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/security.h b/server/security.h index 58ab1594eae..c202ebbe1cc 100644 --- a/server/security.h +++ b/server/security.h @@ -44,8 +44,9 @@ extern const struct luid SeManageVolumePrivilege; extern const struct luid SeImpersonatePrivilege; extern const struct luid SeCreateGlobalPrivilege; +extern const struct sid owner_rights_sid; extern const struct sid world_sid; -extern const struct sid local_user_sid; +extern struct sid local_user_sid; extern const struct sid local_system_sid; extern const struct sid builtin_users_sid; extern const struct sid builtin_admins_sid; @@ -60,6 +61,7 @@ struct ace unsigned int mask; }; + /* token functions */ extern struct token *get_token_obj( struct process *process, obj_handle_t handle, unsigned int access ); @@ -122,6 +124,7 @@ static inline struct ace *set_ace( struct ace *ace, const struct sid *sid, unsig extern void security_set_thread_token( struct thread *thread, obj_handle_t handle ); extern const struct sid *security_unix_uid_to_sid( uid_t uid ); +extern void init_user_sid(void); extern int check_object_access( struct token *token, struct object *obj, unsigned int *access ); static inline int thread_single_check_privilege( struct thread *thread, struct luid priv ) diff --git a/server/semaphore.c b/server/semaphore.c index 53b42a886df..d354892c224 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -70,6 +70,8 @@ static const struct object_ops semaphore_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ semaphore_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ semaphore_satisfied, /* satisfied */ semaphore_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/serial.c b/server/serial.c index d665eb7fa35..1915d00a977 100644 --- a/server/serial.c +++ b/server/serial.c @@ -85,6 +85,8 @@ static const struct object_ops serial_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ serial_get_fd, /* get_fd */ diff --git a/server/signal.c b/server/signal.c index 19b76d44c16..802b7f936b9 100644 --- a/server/signal.c +++ b/server/signal.c @@ -62,6 +62,8 @@ static const struct object_ops handler_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/sock.c b/server/sock.c index 84c0d4a4931..9877888b465 100644 --- a/server/sock.c +++ b/server/sock.c @@ -453,6 +453,8 @@ static const struct object_ops sock_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ sock_get_fd, /* get_fd */ @@ -813,7 +815,7 @@ static void post_sock_messages( struct sock *sock ) } } -static inline int sock_error( struct sock *sock ) +static inline int sock_error( struct sock *sock, int *poll_event ) { int error = 0; socklen_t len = sizeof(error); @@ -839,8 +841,14 @@ static inline int sock_error( struct sock *sock ) error = sock->errors[AFD_POLL_BIT_ACCEPT]; break; - case SOCK_CONNECTED: case SOCK_CONNECTIONLESS: + if (error == ENETUNREACH || error == EHOSTUNREACH || error == ECONNRESET) + { + if (poll_event) *poll_event &= ~POLLERR; + return 0; + } + /* fallthrough */ + case SOCK_CONNECTED: if (error == ECONNRESET || error == EPIPE) { sock->reset = 1; @@ -1231,7 +1239,7 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) event &= ~(POLLIN | POLLPRI); } - if ((event & POLLOUT) && async_queued( &sock->write_q )) + if ((event & POLLOUT) && async_queue_has_waiting_asyncs( &sock->write_q )) { if (async_waiting( &sock->write_q )) { @@ -1346,7 +1354,7 @@ static void sock_poll_event( struct fd *fd, int event ) fprintf(stderr, "socket %p select event: %x\n", sock, event); if (event & (POLLERR | POLLHUP)) - error = sock_error( sock ); + error = sock_error( sock, &event ); switch (sock->state) { @@ -2976,7 +2984,11 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (check_addr_usage( sock, &bind_addr, v6only )) return; - if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0) + /* Quake (and similar family) fails if we can't bind to an IPX address. This often + * doesn't work on Linux, so just fake success. */ + if (unix_addr.addr.sa_family == AF_IPX) + fprintf( stderr, "wine: HACK: Faking AF_IPX bind success.\n" ); + else if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0) { if (errno == EADDRINUSE && sock->reuseaddr) errno = EACCES; @@ -3115,7 +3127,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return; } - error = sock_error( sock ); + error = sock_error( sock, NULL ); if (!error) { for (i = 0; i < ARRAY_SIZE( sock->errors ); ++i) @@ -3554,6 +3566,8 @@ static const struct object_ops ifchange_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ ifchange_get_fd, /* get_fd */ @@ -3775,6 +3789,8 @@ static const struct object_ops socket_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -3945,7 +3961,7 @@ DECL_HANDLER(send_socket) if (bind_errno) status = sock_get_ntstatus( bind_errno ); else if (sock->wr_shutdown) status = STATUS_PIPE_DISCONNECTED; - else if (!async_queued( &sock->write_q )) + else if (!async_queue_has_waiting_asyncs( &sock->write_q )) { /* If write_q is not empty, we cannot really tell if the already queued * asyncs will not consume all available space; if there's no space diff --git a/server/symlink.c b/server/symlink.c index dd28efd3a75..47098fe5823 100644 --- a/server/symlink.c +++ b/server/symlink.c @@ -71,6 +71,8 @@ static const struct object_ops symlink_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/thread.c b/server/thread.c index 50eddabe8eb..0620686399d 100644 --- a/server/thread.c +++ b/server/thread.c @@ -37,6 +37,9 @@ #define _WITH_CPU_SET_T #include #endif +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -50,6 +53,9 @@ #include "request.h" #include "user.h" #include "security.h" +#include "unicode.h" +#include "esync.h" +#include "fsync.h" /* thread queues */ @@ -96,6 +102,8 @@ static const struct object_ops thread_apc_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ thread_apc_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -138,6 +146,8 @@ static const struct object_ops context_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ context_signaled, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -174,6 +184,8 @@ struct type_descr thread_type = static void dump_thread( struct object *obj, int verbose ); static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int thread_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int thread_get_fsync_idx( struct object *obj, enum fsync_type *type ); static unsigned int thread_map_access( struct object *obj, unsigned int access ); static void thread_poll_event( struct fd *fd, int event ); static struct list *thread_get_kernel_obj_list( struct object *obj ); @@ -187,6 +199,8 @@ static const struct object_ops thread_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ thread_signaled, /* signaled */ + thread_get_esync_fd, /* get_esync_fd */ + thread_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -215,6 +229,34 @@ static const struct fd_ops thread_fd_ops = }; static struct list thread_list = LIST_INIT(thread_list); +#ifdef __linux__ +static int nice_limit; +#endif + +void init_threading(void) +{ +#ifdef __linux__ +#ifdef RLIMIT_NICE + struct rlimit rlimit; +#endif +#ifdef HAVE_SETPRIORITY + /* if wineserver has cap_sys_nice we are unlimited, but leave -20 to the user */ + if (!setpriority( PRIO_PROCESS, getpid(), -20 )) nice_limit = -19; + setpriority( PRIO_PROCESS, getpid(), 0 ); +#endif +#ifdef RLIMIT_NICE + if (!nice_limit && !getrlimit( RLIMIT_NICE, &rlimit )) + { + rlimit.rlim_cur = rlimit.rlim_max; + setrlimit( RLIMIT_NICE, &rlimit ); + if (rlimit.rlim_max <= 40) nice_limit = 20 - rlimit.rlim_max; + else if (rlimit.rlim_max == -1) nice_limit = -20; + if (nice_limit >= 0 && debug_level) fprintf(stderr, "wine: RLIMIT_NICE is <= 20, unable to use setpriority safely\n"); + } +#endif + if (nice_limit < 0 && debug_level) fprintf(stderr, "wine: Using setpriority to control niceness in the [%d,%d] range\n", nice_limit, -nice_limit ); +#endif +} /* initialize the structure for a newly allocated thread */ static inline void init_thread_structure( struct thread *thread ) @@ -226,6 +268,9 @@ static inline void init_thread_structure( struct thread *thread ) thread->context = NULL; thread->teb = 0; thread->entry_point = 0; + thread->esync_fd = -1; + thread->esync_apc_fd = -1; + thread->fsync_idx = 0; thread->system_regs = 0; thread->queue = NULL; thread->wait = NULL; @@ -246,9 +291,14 @@ static inline void init_thread_structure( struct thread *thread ) thread->token = NULL; thread->desc = NULL; thread->desc_len = 0; + thread->queue_shared_mapping = NULL; + thread->queue_shared = NULL; + thread->input_shared_mapping = NULL; + thread->input_shared = NULL; thread->creation_time = current_time; thread->exit_time = 0; + thread->locked_completion = NULL; list_init( &thread->mutex_list ); list_init( &thread->system_apc ); @@ -295,6 +345,58 @@ static struct context *create_thread_context( struct thread *thread ) } +static volatile void *init_queue_mapping( struct thread *thread ) +{ + struct unicode_str name; + struct object *dir = create_thread_map_directory(); + char nameA[MAX_PATH]; + WCHAR *nameW; + + if (!dir) return NULL; + + sprintf( nameA, "%08x-queue", thread->id ); + nameW = ascii_to_unicode_str( nameA, &name ); + + thread->queue_shared_mapping = create_shared_mapping( dir, &name, sizeof(struct queue_shared_memory), + OBJ_OPENIF, NULL, (void **)&thread->queue_shared ); + release_object( dir ); + if (thread->queue_shared_mapping) + { + memset( (void *)thread->queue_shared, 0, sizeof(*thread->queue_shared) ); + thread->queue_shared->input_tid = thread->id; + } + + free( nameW ); + return thread->queue_shared; +} + + +static volatile void *init_input_mapping( struct thread *thread ) +{ + struct unicode_str name; + struct object *dir = create_thread_map_directory(); + char nameA[MAX_PATH]; + WCHAR *nameW; + + if (!dir) return NULL; + + sprintf( nameA, "%08x-input", thread->id ); + nameW = ascii_to_unicode_str( nameA, &name ); + + thread->input_shared_mapping = create_shared_mapping( dir, &name, sizeof(struct input_shared_memory), + OBJ_OPENIF, NULL, (void **)&thread->input_shared ); + release_object( dir ); + if (thread->input_shared_mapping) + { + memset( (void *)thread->input_shared, 0, sizeof(*thread->input_shared) ); + thread->input_shared->tid = thread->id; + } + + free( nameW ); + return thread->input_shared; +} + + /* create a new thread */ struct thread *create_thread( int fd, struct process *process, const struct security_descriptor *sd ) { @@ -361,6 +463,16 @@ struct thread *create_thread( int fd, struct process *process, const struct secu release_object( thread ); return NULL; } + if (!init_queue_mapping( thread )) + { + release_object( thread ); + return NULL; + } + if (!init_input_mapping( thread )) + { + release_object( thread ); + return NULL; + } if (process->desktop) { @@ -372,6 +484,20 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } } + thread->fsync_idx = 0; + + if (do_fsync()) + { + thread->fsync_idx = fsync_alloc_shm( 0, 0 ); + thread->fsync_apc_idx = fsync_alloc_shm( 0, 0 ); + } + + if (do_esync()) + { + thread->esync_fd = esync_create_fd( 0, 0 ); + thread->esync_apc_fd = esync_create_fd( 0, 0 ); + } + set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */ add_process_thread( thread->process, thread ); return thread; @@ -429,6 +555,10 @@ static void cleanup_thread( struct thread *thread ) } } free( thread->desc ); + if (thread->queue_shared_mapping) release_object( thread->queue_shared_mapping ); + thread->queue_shared_mapping = NULL; + if (thread->input_shared_mapping) release_object( thread->input_shared_mapping ); + thread->input_shared_mapping = NULL; thread->req_data = NULL; thread->reply_data = NULL; thread->request_fd = NULL; @@ -450,6 +580,15 @@ static void destroy_thread( struct object *obj ) release_object( thread->process ); if (thread->id) free_ptid( thread->id ); if (thread->token) release_object( thread->token ); + if (thread->locked_completion) release_object( thread->locked_completion ); + + if (do_esync()) + close( thread->esync_fd ); + if (thread->fsync_idx) + { + fsync_free_shm_idx( thread->fsync_idx ); + fsync_free_shm_idx( thread->fsync_apc_idx ); + } } /* dump a thread on stdout for debugging purposes */ @@ -468,6 +607,20 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ) return (mythread->state == TERMINATED); } +static int thread_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct thread *thread = (struct thread *)obj; + *type = ESYNC_MANUAL_SERVER; + return thread->esync_fd; +} + +static unsigned int thread_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct thread *thread = (struct thread *)obj; + *type = FSYNC_MANUAL_SERVER; + return thread->fsync_idx; +} + static unsigned int thread_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); @@ -520,6 +673,7 @@ static struct thread_apc *create_apc( struct object *owner, const apc_call_t *ca apc->result.type = APC_NONE; if (owner) grab_object( owner ); } + return apc; } @@ -576,8 +730,19 @@ int set_thread_affinity( struct thread *thread, affinity_t affinity ) CPU_ZERO( &set ); for (i = 0, mask = 1; mask; i++, mask <<= 1) - if (affinity & mask) CPU_SET( i, &set ); - + if (affinity & mask) + { + if (thread->process->cpu_override.cpu_count) + { + if (i >= thread->process->cpu_override.cpu_count) + break; + CPU_SET( thread->process->cpu_override.host_cpu_id[i], &set ); + } + else + { + CPU_SET( i, &set ); + } + } ret = sched_setaffinity( thread->unix_tid, sizeof(set), &set ); } #endif @@ -595,36 +760,103 @@ affinity_t get_thread_affinity( struct thread *thread ) unsigned int i; if (!sched_getaffinity( thread->unix_tid, sizeof(set), &set )) + { for (i = 0; i < 8 * sizeof(mask); i++) - if (CPU_ISSET( i, &set )) mask |= (affinity_t)1 << i; + if (CPU_ISSET( i, &set )) + { + if (thread->process->cpu_override.cpu_count) + { + if (i < ARRAY_SIZE(thread->process->wine_cpu_id_from_host)) + mask |= (affinity_t)1 << thread->process->wine_cpu_id_from_host[i]; + } + else + { + mask |= (affinity_t)1 << i; + } + } + } } #endif if (!mask) mask = ~(affinity_t)0; return mask; } +static int get_base_priority( int priority_class, int priority ) +{ + /* offsets taken from https://learn.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities */ + static const int class_offsets[] = { 4, 8, 13, 24, 6, 10 }; + if (priority == THREAD_PRIORITY_IDLE) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 16 : 1); + if (priority == THREAD_PRIORITY_TIME_CRITICAL) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 31 : 15); + if (priority_class >= ARRAY_SIZE(class_offsets)) return 8; + return class_offsets[priority_class - 1] + priority; +} + +#ifdef __linux__ +/* maps an NT application band [1,15] base priority to [-nice_limit, nice_limit] */ +static int get_unix_niceness( int base_priority ) +{ + int min = -nice_limit, max = nice_limit, range = max - min; + return min + (base_priority - 1) * range / 14; +} +#endif + #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7 +static void apply_thread_priority( struct thread *thread, int priority_class, int priority ) +{ + int base_priority = get_base_priority( priority_class, priority ); +#ifdef __linux__ + int niceness; + + /* FIXME: handle REALTIME class using SCHED_RR if possible, for now map it to highest non-realtime band */ + if (priority_class == PROCESS_PRIOCLASS_REALTIME) base_priority = 15; +#ifdef HAVE_SETPRIORITY + if (nice_limit < 0) + { + niceness = get_unix_niceness( base_priority ); + if (setpriority( PRIO_PROCESS, thread->unix_tid, niceness ) != 0) + fprintf( stderr, "wine: setpriority %d for pid %d failed: %d\n", niceness, thread->unix_tid, errno ); + return; + } +#endif +#endif +} + +int set_thread_priority( struct thread *thread, int priority_class, int priority ) +{ + int max = THREAD_PRIORITY_HIGHEST; + int min = THREAD_PRIORITY_LOWEST; + if (priority_class == PROCESS_PRIOCLASS_REALTIME) + { + max = THREAD_PRIORITY_REALTIME_HIGHEST; + min = THREAD_PRIORITY_REALTIME_LOWEST; + } + if ((priority < min || priority > max) && + priority != THREAD_PRIORITY_IDLE && + priority != THREAD_PRIORITY_TIME_CRITICAL) + { + errno = EINVAL; + return -1; + } + + if (thread->process->priority == priority_class && + thread->priority == priority) + return 0; + thread->priority = priority; + + apply_thread_priority( thread, priority_class, priority ); + return 0; +} + /* set all information about a thread */ static void set_thread_info( struct thread *thread, const struct set_thread_info_request *req ) { if (req->mask & SET_THREAD_INFO_PRIORITY) { - int max = THREAD_PRIORITY_HIGHEST; - int min = THREAD_PRIORITY_LOWEST; - if (thread->process->priority == PROCESS_PRIOCLASS_REALTIME) - { - max = THREAD_PRIORITY_REALTIME_HIGHEST; - min = THREAD_PRIORITY_REALTIME_LOWEST; - } - if ((req->priority >= min && req->priority <= max) || - req->priority == THREAD_PRIORITY_IDLE || - req->priority == THREAD_PRIORITY_TIME_CRITICAL) - thread->priority = req->priority; - else - set_error( STATUS_INVALID_PARAMETER ); + if (set_thread_priority( thread, thread->process->priority, req->priority )) + file_set_error(); } if (req->mask & SET_THREAD_INFO_AFFINITY) { @@ -680,7 +912,11 @@ int suspend_thread( struct thread *thread ) int old_count = thread->suspend; if (thread->suspend < MAXIMUM_SUSPEND_COUNT) { - if (!(thread->process->suspend + thread->suspend++)) stop_thread( thread ); + if (!(thread->process->suspend + thread->suspend++)) + { + stop_thread( thread ); + if (thread == current) return old_count | 0x80000000; + } } else set_error( STATUS_SUSPEND_COUNT_EXCEEDED ); return old_count; @@ -1059,6 +1295,12 @@ void wake_up( struct object *obj, int max ) struct list *ptr; int ret; + if (do_fsync()) + fsync_wake_up( obj ); + + if (do_esync()) + esync_wake_up( obj ); + LIST_FOR_EACH( ptr, &obj->wait_queue ) { struct wait_queue_entry *entry = LIST_ENTRY( ptr, struct wait_queue_entry, entry ); @@ -1143,8 +1385,16 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr grab_object( apc ); list_add_tail( queue, &apc->entry ); if (!list_prev( queue, &apc->entry )) /* first one */ + { wake_thread( thread ); + if (do_fsync() && queue == &thread->user_apc) + fsync_wake_futex( thread->fsync_apc_idx ); + + if (do_esync() && queue == &thread->user_apc) + esync_wake_fd( thread->esync_apc_fd ); + } + return 1; } @@ -1190,6 +1440,13 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system apc = LIST_ENTRY( ptr, struct thread_apc, entry ); list_remove( ptr ); } + + if (do_fsync() && list_empty( &thread->system_apc ) && list_empty( &thread->user_apc )) + fsync_clear_futex( thread->fsync_apc_idx ); + + if (do_esync() && list_empty( &thread->system_apc ) && list_empty( &thread->user_apc )) + esync_clear( thread->esync_apc_fd ); + return apc; } @@ -1285,6 +1542,10 @@ void kill_thread( struct thread *thread, int violent_death ) } kill_console_processes( thread, 0 ); abandon_mutexes( thread ); + if (do_fsync()) + fsync_abandon_mutexes( thread ); + if (do_esync()) + esync_abandon_mutexes( thread ); wake_up( &thread->obj, 0 ); if (violent_death) send_thread_signal( thread, SIGQUIT ); cleanup_thread( thread ); @@ -1303,6 +1564,7 @@ static void copy_context( context_t *to, const context_t *from, unsigned int fla if (flags & SERVER_CTX_DEBUG_REGISTERS) to->debug = from->debug; if (flags & SERVER_CTX_EXTENDED_REGISTERS) to->ext = from->ext; if (flags & SERVER_CTX_YMM_REGISTERS) to->ymm = from->ymm; + if (flags & SERVER_CTX_EXEC_SPACE) to->exec_space = from->exec_space; } /* gets the current impersonation token */ @@ -1413,7 +1675,10 @@ DECL_HANDLER(init_first_thread) if (!process->parent_id) process->affinity = current->affinity = get_thread_affinity( current ); else + { + set_thread_priority( current, current->process->priority, current->priority ); set_thread_affinity( current, current->affinity ); + } debug_level = max( debug_level, req->debug_level ); @@ -1444,6 +1709,7 @@ DECL_HANDLER(init_thread) init_thread_context( current ); generate_debug_event( current, DbgCreateThreadStateChange, &req->entry ); + set_thread_priority( current, current->process->priority, current->priority ); set_thread_affinity( current, current->affinity ); reply->suspend = (current->suspend || current->process->suspend || current->context != NULL); @@ -1550,12 +1816,32 @@ DECL_HANDLER(suspend_thread) { struct thread *thread; - if ((thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) + if (req->waited_handle) { - if (thread->state == TERMINATED) set_error( STATUS_ACCESS_DENIED ); - else reply->count = suspend_thread( thread ); - release_object( thread ); + struct context *context; + + if (!(context = (struct context *)get_handle_obj( current->process, req->waited_handle, + 0, &context_ops ))) + return; + close_handle( current->process, req->waited_handle ); /* avoid extra server call */ + set_error( context->status ); + release_object( context ); + return; } + + if (!(thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) return; + + if (thread->state != RUNNING) set_error( STATUS_ACCESS_DENIED ); + else + { + reply->count = suspend_thread( thread ); + if (!get_error() && thread != current && thread->context && thread->context->status == STATUS_PENDING) + { + set_error( STATUS_PENDING ); + reply->wait_handle = alloc_handle( current->process, thread->context, SYNCHRONIZE, 0 ); + } + } + release_object( thread ); } /* resume a thread */ @@ -1686,9 +1972,7 @@ DECL_HANDLER(select) { apc_call_t *data; data_size_t size = sizeof(*data) + (ctx->regs[CTX_WOW].flags ? 2 : 1) * sizeof(context_t); - unsigned int flags = system_flags & ctx->regs[CTX_NATIVE].flags; - if (flags) set_thread_context( current, &ctx->regs[CTX_NATIVE], flags ); size = min( size, get_reply_max_size() ); if ((data = set_reply_data_size( size ))) { @@ -1934,21 +2218,21 @@ DECL_HANDLER(set_thread_context) unsigned int flags = system_flags & contexts[CTX_NATIVE].flags; if (thread != current) stop_thread( thread ); - else if (flags) set_thread_context( thread, &contexts[CTX_NATIVE], flags ); + if (flags) set_thread_context( thread, &contexts[CTX_NATIVE], flags ); if (thread->context && !get_error()) { /* If context is in a pending state, we don't know if we will use WoW or native * context, so store both and discard irrevelant one in select request. */ const int is_pending = thread->context->status == STATUS_PENDING; - unsigned int native_flags = contexts[CTX_NATIVE].flags; + unsigned int native_flags = contexts[CTX_NATIVE].flags & ~SERVER_CTX_EXEC_SPACE; if (ctx_count == 2 && (is_pending || thread->context->regs[CTX_WOW].machine)) { context_t *ctx = &thread->context->regs[CTX_WOW]; /* some regs are always set from the native context */ - flags = contexts[CTX_WOW].flags & ~req->native_flags; + flags = contexts[CTX_WOW].flags & ~(req->native_flags | SERVER_CTX_EXEC_SPACE); if (is_pending) ctx->machine = contexts[CTX_WOW].machine; else native_flags &= req->native_flags; diff --git a/server/thread.h b/server/thread.h index 8dcf966a90a..dbd2e32c0f6 100644 --- a/server/thread.h +++ b/server/thread.h @@ -54,6 +54,10 @@ struct thread struct process *process; thread_id_t id; /* thread id */ struct list mutex_list; /* list of currently owned mutexes */ + int esync_fd; /* esync file descriptor (signalled on exit) */ + int esync_apc_fd; /* esync apc fd (signalled when APCs are present) */ + unsigned int fsync_idx; + unsigned int fsync_apc_idx; unsigned int system_regs; /* which system regs have been set */ struct msg_queue *queue; /* message queue */ struct thread_wait *wait; /* current wait condition if sleeping */ @@ -90,6 +94,11 @@ struct thread struct list kernel_object; /* list of kernel object pointers */ data_size_t desc_len; /* thread description length in bytes */ WCHAR *desc; /* thread description string */ + struct object *locked_completion; /* completion port wait object successfully waited by the thread */ + struct object *queue_shared_mapping; /* thread queue shared memory mapping */ + queue_shm_t *queue_shared; /* thread queue shared memory ptr */ + struct object *input_shared_mapping; /* thread input shared memory mapping */ + input_shm_t *input_shared; /* thread input shared memory ptr */ }; extern struct thread *current; @@ -119,6 +128,7 @@ extern void thread_cancel_apc( struct thread *thread, struct object *owner, enum extern int thread_add_inflight_fd( struct thread *thread, int client, int server ); extern int thread_get_inflight_fd( struct thread *thread, int client ); extern struct token *thread_get_impersonation_token( struct thread *thread ); +extern int set_thread_priority( struct thread *thread, int priority_class, int priority ); extern int set_thread_affinity( struct thread *thread, affinity_t affinity ); extern int suspend_thread( struct thread *thread ); extern int resume_thread( struct thread *thread ); diff --git a/server/timer.c b/server/timer.c index 96dc9d00ca1..884ace9376f 100644 --- a/server/timer.c +++ b/server/timer.c @@ -35,6 +35,8 @@ #include "file.h" #include "handle.h" #include "request.h" +#include "esync.h" +#include "fsync.h" static const WCHAR timer_name[] = {'T','i','m','e','r'}; @@ -61,10 +63,14 @@ struct timer struct thread *thread; /* thread that set the APC function */ client_ptr_t callback; /* callback APC function */ client_ptr_t arg; /* callback argument */ + int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; /* fsync shm index */ }; static void timer_dump( struct object *obj, int verbose ); static int timer_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int timer_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int timer_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void timer_destroy( struct object *obj ); @@ -76,6 +82,8 @@ static const struct object_ops timer_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ timer_signaled, /* signaled */ + timer_get_esync_fd, /* get_esync_fd */ + timer_get_fsync_idx, /* get_fsync_idx */ timer_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -110,6 +118,14 @@ static struct timer *create_timer( struct object *root, const struct unicode_str timer->period = 0; timer->timeout = NULL; timer->thread = NULL; + timer->esync_fd = -1; + timer->fsync_idx = 0; + + if (do_fsync()) + timer->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + timer->esync_fd = esync_create_fd( 0, 0 ); } } return timer; @@ -181,6 +197,12 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period { period = 0; /* period doesn't make any sense for a manual timer */ timer->signaled = 0; + + if (do_fsync()) + fsync_clear( &timer->obj ); + + if (do_esync()) + esync_clear( timer->esync_fd ); } timer->when = (expire <= 0) ? expire - monotonic_time : max( expire, current_time ); timer->period = period; @@ -208,6 +230,20 @@ static int timer_signaled( struct object *obj, struct wait_queue_entry *entry ) return timer->signaled; } +static int timer_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct timer *timer = (struct timer *)obj; + *type = timer->manual ? ESYNC_MANUAL_SERVER : ESYNC_AUTO_SERVER; + return timer->esync_fd; +} + +static unsigned int timer_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct timer *timer = (struct timer *)obj; + *type = timer->manual ? FSYNC_MANUAL_SERVER : FSYNC_AUTO_SERVER; + return timer->fsync_idx; +} + static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct timer *timer = (struct timer *)obj; @@ -222,6 +258,8 @@ static void timer_destroy( struct object *obj ) if (timer->timeout) remove_timeout_user( timer->timeout ); if (timer->thread) release_object( timer->thread ); + if (do_esync()) close( timer->esync_fd ); + if (timer->fsync_idx) fsync_free_shm_idx( timer->fsync_idx ); } /* create a timer */ diff --git a/server/token.c b/server/token.c index 4df8d2e0c6e..ec2d7539262 100644 --- a/server/token.c +++ b/server/token.c @@ -23,11 +23,15 @@ #include "config.h" #include +#include #include #include #include #include #include +#ifdef HAVE_STDINT_H +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -70,10 +74,11 @@ struct sid_attrs unsigned int attrs; }; +const struct sid owner_rights_sid = { SID_REVISION, 1, SECURITY_CREATOR_SID_AUTHORITY, { SECURITY_CREATOR_OWNER_RIGHTS_RID } }; const struct sid world_sid = { SID_REVISION, 1, SECURITY_WORLD_SID_AUTHORITY, { SECURITY_WORLD_RID } }; const struct sid local_system_sid = { SID_REVISION, 1, SECURITY_NT_AUTHORITY, { SECURITY_LOCAL_SYSTEM_RID } }; const struct sid high_label_sid = { SID_REVISION, 1, SECURITY_MANDATORY_LABEL_AUTHORITY, { SECURITY_MANDATORY_HIGH_RID } }; -const struct sid local_user_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } }; + struct sid local_user_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } }; const struct sid builtin_admins_sid = { SID_REVISION, 2, SECURITY_NT_AUTHORITY, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } }; const struct sid builtin_users_sid = { SID_REVISION, 2, SECURITY_NT_AUTHORITY, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } }; const struct sid domain_users_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, DOMAIN_GROUP_RID_USERS } }; @@ -143,6 +148,8 @@ static const struct object_ops token_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -199,6 +206,35 @@ const struct sid *security_unix_uid_to_sid( uid_t uid ) return &anonymous_logon_sid; } +void init_user_sid(void) +{ + char machine_id[17]; + uint64_t id; + size_t n; + FILE *f; + + f = fopen( "/etc/machine-id", "r" ); + if (!f) + { + fprintf( stderr, "Failed to open /etc/machine-id, error %s.\n", strerror( errno )); + return; + } + + n = fread( machine_id, sizeof(*machine_id), 16, f ); + fclose(f); + + if (n != 16) + { + fprintf( stderr, "Failed to read /etc/machine-id, error %s.\n", strerror( errno )); + return; + } + machine_id[n] = 0; + id = strtoull( machine_id, NULL, 0x10 ); + local_user_sid.sub_auth[1] = id >> 32; + local_user_sid.sub_auth[2] = id & 0xffffffff; + local_user_sid.sub_auth[3] = getuid(); +} + static int acl_is_valid( const struct acl *acl, data_size_t size ) { ULONG i; diff --git a/server/trace.c b/server/trace.c index 1b65d2b977e..a44836e6543 100644 --- a/server/trace.c +++ b/server/trace.c @@ -840,6 +840,19 @@ static void dump_varargs_context( const char *prefix, data_size_t size ) fprintf( stderr, "%s{machine=%04x", prefix, ctx.machine ); break; } + if (ctx.flags & SERVER_CTX_EXEC_SPACE) + { + const char *space; + + switch (ctx.exec_space.space.space) + { + case EXEC_SPACE_USERMODE: space = "user"; break; + case EXEC_SPACE_SYSCALL: space = "syscall"; break; + case EXEC_SPACE_EXCEPTION: space = "exception"; break; + default: space = "invalid"; break; + } + fprintf( stderr, ",exec_space=%s", space ); + } fputc( '}', stderr ); remove_data( size ); } @@ -1383,6 +1396,24 @@ static void dump_varargs_handle_infos( const char *prefix, data_size_t size ) fputc( '}', stderr ); } +static void dump_varargs_cpu_topology_override( const char *prefix, data_size_t size ) +{ + const struct cpu_topology_override *cpu_topology = cur_data; + unsigned int i; + + if (size < sizeof(*cpu_topology)) + return; + + fprintf( stderr,"%s{", prefix ); + for (i = 0; i < cpu_topology->cpu_count; ++i) + { + if (i) fputc( ',', stderr ); + fprintf( stderr, "%u", cpu_topology->host_cpu_id[i] ); + } + fputc( '}', stderr ); + remove_data( size ); +} + typedef void (*dump_func)( const void *req ); /* Everything below this line is generated automatically by tools/make_requests */ @@ -1462,6 +1493,7 @@ static void dump_init_process_done_request( const struct init_process_done_reque static void dump_init_process_done_reply( const struct init_process_done_reply *req ) { dump_uint64( " entry=", &req->entry ); + dump_varargs_cpu_topology_override( ", cpu_override=", cur_size ); fprintf( stderr, ", suspend=%d", req->suspend ); } diff --git a/server/user.h b/server/user.h index 8fa55e09b0f..f06c9ba6b6e 100644 --- a/server/user.h +++ b/server/user.h @@ -52,15 +52,6 @@ struct winstation struct namespace *desktop_names; /* namespace for desktops of this winstation */ }; -struct global_cursor -{ - int x; /* cursor position */ - int y; - rectangle_t clip; /* cursor clip rectangle */ - unsigned int last_change; /* time of last position change */ - user_handle_t win; /* window that contains the cursor */ -}; - struct desktop { struct object obj; /* object header */ @@ -72,10 +63,16 @@ struct desktop struct hook_table *global_hooks; /* table of global hooks on this desktop */ struct list hotkeys; /* list of registered hotkeys */ struct timeout_user *close_timeout; /* timeout before closing the desktop */ + timeout_t close_timeout_val;/* timeout duration before closing desktop */ + struct list touches; /* list of active touches */ struct thread_input *foreground_input; /* thread input of foreground thread */ unsigned int users; /* processes and threads using this desktop */ - struct global_cursor cursor; /* global cursor information */ + user_handle_t cursor_win; /* window that contains the cursor */ + user_handle_t cursor_handle; /* last set cursor handle */ unsigned char keystate[256]; /* asynchronous key state */ + unsigned int last_press_alt:1; /* last key press was Alt (used to determine msg on Alt release) */ + struct object *shared_mapping; /* desktop shared memory mapping */ + const desktop_shm_t *shared; /* desktop shared memory */ }; /* user handles functions */ @@ -96,8 +93,8 @@ extern void cleanup_clipboard_thread( struct thread *thread ); /* hook functions */ extern void remove_thread_hooks( struct thread *thread ); -extern unsigned int get_active_hooks(void); -extern struct thread *get_first_global_hook( int id ); +extern struct thread *get_first_global_hook( int id, thread_id_t *thread_id, client_ptr_t *proc ); +extern void disable_hung_hook( struct desktop *desktop, int id, thread_id_t thread_id, client_ptr_t proc ); /* queue functions */ @@ -121,6 +118,7 @@ extern void post_win_event( struct thread *thread, unsigned int event, const WCHAR *module, data_size_t module_size, user_handle_t handle ); extern void free_hotkeys( struct desktop *desktop, user_handle_t window ); +extern void free_touches( struct desktop *desktop, user_handle_t window ); /* region functions */ diff --git a/server/window.c b/server/window.c index 242e93f303a..184d4e2e212 100644 --- a/server/window.c +++ b/server/window.c @@ -107,6 +107,8 @@ static const struct object_ops window_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -1248,7 +1250,8 @@ static struct region *get_surface_region( struct window *win ) set_region_rect( clip, &win->client_rect ); if (win->win_region && !intersect_window_region( clip, win )) goto error; - if ((win->paint_flags & PAINT_HAS_PIXEL_FORMAT) && !subtract_region( region, region, clip )) + if (!(win->ex_style & WS_EX_LAYERED) && (win->paint_flags & PAINT_HAS_PIXEL_FORMAT) + && !subtract_region( region, region, clip )) goto error; /* clip children */ @@ -2025,6 +2028,7 @@ void free_window_handle( struct window *win ) if (win == progman_window) progman_window = NULL; if (win == taskman_window) taskman_window = NULL; free_hotkeys( win->desktop, win->handle ); + free_touches( win->desktop, win->handle ); cleanup_clipboard_window( win->desktop, win->handle ); destroy_properties( win ); if (is_desktop_window(win)) diff --git a/server/winstation.c b/server/winstation.c index 5903497d61e..534078a5813 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -76,6 +76,8 @@ static const struct object_ops winstation_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -116,6 +118,8 @@ static const struct object_ops desktop_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -132,6 +136,27 @@ static const struct object_ops desktop_ops = desktop_destroy /* destroy */ }; +#if defined(__i386__) || defined(__x86_64__) +#define __SHARED_INCREMENT_SEQ( x ) ++(x) +#else +#define __SHARED_INCREMENT_SEQ( x ) __atomic_add_fetch( &(x), 1, __ATOMIC_RELEASE ) +#endif + +#define SHARED_WRITE_BEGIN( object, type ) \ + do { \ + const type *__shared = (object)->shared; \ + type *shared = (type *)__shared; \ + unsigned int __seq = __SHARED_INCREMENT_SEQ( shared->seq ); \ + assert( (__seq & 1) != 0 ); \ + do + +#define SHARED_WRITE_END \ + while(0); \ + __seq = __SHARED_INCREMENT_SEQ( shared->seq ) - __seq; \ + assert( __seq == 1 ); \ + } while(0); + + /* create a winstation object */ static struct winstation *create_winstation( struct object *root, const struct unicode_str *name, unsigned int attr, unsigned int flags ) @@ -217,6 +242,25 @@ struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle, u return (struct desktop *)get_handle_obj( process, handle, access, &desktop_ops ); } +static int init_desktop_mapping( struct desktop *desktop, const struct unicode_str *name ) +{ + struct object *dir; + + desktop->shared = NULL; + desktop->shared_mapping = NULL; + + if (!(dir = create_desktop_map_directory( desktop->winstation ))) return 0; + if ((desktop->shared_mapping = create_shared_mapping( dir, name, sizeof(struct desktop_shared_memory), + 0, NULL, (void **)&desktop->shared ))) + { + memset( (void *)desktop->shared, 0, sizeof(*desktop->shared) ); + ((desktop_shm_t *)desktop->shared)->update_serial = 1; + } + release_object( dir ); + + return !!desktop->shared; +} + /* create a desktop object */ static struct desktop *create_desktop( const struct unicode_str *name, unsigned int attr, unsigned int flags, struct winstation *winstation ) @@ -234,18 +278,30 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->msg_window = NULL; desktop->global_hooks = NULL; desktop->close_timeout = NULL; + desktop->close_timeout_val = 0; desktop->foreground_input = NULL; desktop->users = 0; - memset( &desktop->cursor, 0, sizeof(desktop->cursor) ); - memset( desktop->keystate, 0, sizeof(desktop->keystate) ); + desktop->cursor_win = 0; + desktop->last_press_alt = 0; list_add_tail( &winstation->desktops, &desktop->entry ); list_init( &desktop->hotkeys ); + list_init( &desktop->touches ); + if (!init_desktop_mapping( desktop, name )) + { + release_object( desktop ); + return NULL; + } } else { desktop->flags |= (flags & DF_WINE_CREATE_DESKTOP); clear_error(); } + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + shared->flags = desktop->flags; + } + SHARED_WRITE_END } return desktop; } @@ -292,11 +348,14 @@ static void desktop_destroy( struct object *obj ) struct desktop *desktop = (struct desktop *)obj; free_hotkeys( desktop, 0 ); + free_touches( desktop, 0 ); if (desktop->top_window) free_window_handle( desktop->top_window ); if (desktop->msg_window) free_window_handle( desktop->msg_window ); if (desktop->global_hooks) release_object( desktop->global_hooks ); if (desktop->close_timeout) remove_timeout_user( desktop->close_timeout ); list_remove( &desktop->entry ); + if (desktop->shared_mapping) release_object( desktop->shared_mapping ); + desktop->shared_mapping = NULL; release_object( desktop->winstation ); } @@ -312,6 +371,7 @@ static void close_desktop_timeout( void *private ) desktop->close_timeout = NULL; unlink_named_object( &desktop->obj ); /* make sure no other process can open it */ + unlink_named_object( desktop->shared_mapping ); post_desktop_message( desktop, WM_CLOSE, 0, 0 ); /* and signal the owner to quit */ } @@ -335,7 +395,7 @@ static void remove_desktop_user( struct desktop *desktop ) /* if we have one remaining user, it has to be the manager of the desktop window */ if ((process = get_top_window_owner( desktop )) && desktop->users == process->running_threads && !desktop->close_timeout) - desktop->close_timeout = add_timeout_user( -TICKS_PER_SEC, close_desktop_timeout, desktop ); + desktop->close_timeout = add_timeout_user( desktop->close_timeout_val, close_desktop_timeout, desktop ); } /* set the thread default desktop handle */ @@ -673,7 +733,16 @@ DECL_HANDLER(set_user_object_info) struct desktop *desktop = (struct desktop *)obj; reply->is_desktop = 1; reply->old_obj_flags = desktop->flags; - if (req->flags & SET_USER_OBJECT_SET_FLAGS) desktop->flags = req->obj_flags; + if (req->flags & SET_USER_OBJECT_SET_FLAGS) + { + desktop->flags = req->obj_flags; + SHARED_WRITE_BEGIN( desktop, desktop_shm_t ) + { + shared->flags = desktop->flags; + } + SHARED_WRITE_END + } + if (req->flags & SET_USER_OBJECT_SET_CLOSE_TIMEOUT) desktop->close_timeout_val = req->close_timeout; } else if (obj->ops == &winstation_ops) { diff --git a/tools/Makefile.in b/tools/Makefile.in index cd643e7e90b..ef27cd88b69 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -2,5 +2,6 @@ PROGRAMS = \ make_xftmpl SOURCES = \ + gdbinit.py.in \ make_xftmpl.c \ wineapploader.in diff --git a/tools/gdbinit.py b/tools/gdbinit.py new file mode 100644 index 00000000000..ba3b7d003ac --- /dev/null +++ b/tools/gdbinit.py @@ -0,0 +1,113 @@ +#!/bin/env python3 + +# Copyright 2021 Rémi Bernon for CodeWeavers +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +from __future__ import print_function + +import gdb +import re +import subprocess +import sys + +class LoadSymbolFiles(gdb.Command): + 'Command to load symbol files directly from /proc//maps.' + + def __init__(self): + sup = super(LoadSymbolFiles, self) + sup.__init__('load-symbol-files', gdb.COMMAND_FILES, gdb.COMPLETE_NONE, + False) + + self.libs = {} + gdb.execute('alias -a lsf = load-symbol-files', True) + + def invoke(self, arg, from_tty): + pid = gdb.selected_inferior().pid + if not pid in self.libs: self.libs[pid] = {} + + def command(cmd, confirm=from_tty, to_string=not from_tty): + gdb.execute(cmd, from_tty=confirm, to_string=to_string) + + def execute(cmd): + return subprocess.check_output(cmd, stderr=subprocess.STDOUT) \ + .decode('utf-8') + + # load mappings addresses + libs = {} + with open('/proc/{}/maps'.format(pid), 'r') as maps: + for line in maps: + addr, _, _, _, node, path = re.split(r'\s+', line, 5) + path = path.strip() + if node == '0': continue + if path in libs: continue + libs[path] = int(addr.split('-')[0], 16) + + # unload symbol file if address changed + for k in set(libs) & set(self.libs[pid]): + if libs[k] != self.libs[pid][k]: + command('remove-symbol-file "{}"'.format(k), confirm=False) + del self.libs[k] + + # load symbol file for new mappings + for k in set(libs) - set(self.libs[pid]): + if arg is not None and re.search(arg, k) is None: continue + addr = self.libs[pid][k] = libs[k] + has_debug = False + offs = None + + try: + out = execute(['file', k]) + except: + continue + + # try loading mapping as ELF + try: + out = execute(['readelf', '-l', k]) + for line in out.split('\n'): + if not 'LOAD' in line: continue + base = int(line.split()[2], 16) + break + except: + # assume mapping is PE + base = -1 + + try: + name = None + cmd = 'add-symbol-file "{}"'.format(k) + out = execute(['objdump', '-h', k]) + for line in out.split('\n'): + if '2**' in line: + _, name, _, vma, _, off, _ = line.split(maxsplit=6) + if base < 0: offs = int(off, 16) + else: offs = int(vma, 16) - base + if 'ALLOC' in line: + cmd += ' -s {} 0x{:x}'.format(name, addr + offs) + elif name in ['.gnu_debuglink', '.debug_info']: + has_debug = True + elif 'DEBUGGING' in line: + has_debug = True + except: + continue + + if not has_debug: + print('no debugging info found in {}'.format(k)) + continue + + print('loading symbols for {}'.format(k)) + command(cmd, confirm=False, to_string=True) + + +LoadSymbolFiles() diff --git a/tools/gdbinit.py.in b/tools/gdbinit.py.in new file mode 120000 index 00000000000..9fb7fdf9b92 --- /dev/null +++ b/tools/gdbinit.py.in @@ -0,0 +1 @@ +gdbinit.py \ No newline at end of file diff --git a/tools/gdbunwind.py b/tools/gdbunwind.py new file mode 100644 index 00000000000..8611d789f1f --- /dev/null +++ b/tools/gdbunwind.py @@ -0,0 +1,177 @@ +#!/bin/env python3 + +# Copyright 2021 Rémi Bernon for CodeWeavers +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +from gdb.unwinder import Unwinder +import gdb +import re + +ARCH_OFFSETS_X86_64 = { + "rax": (0x0000, 'void *'), + "rbx": (0x0008, 'void *'), + "rcx": (0x0010, 'void *'), + "rdx": (0x0018, 'void *'), + "rsi": (0x0020, 'void *'), + "rdi": (0x0028, 'void *'), + "r8": (0x0030, 'void *'), + "r9": (0x0038, 'void *'), + "r10": (0x0040, 'void *'), + "r11": (0x0048, 'void *'), + "r12": (0x0050, 'void *'), + "r13": (0x0058, 'void *'), + "r14": (0x0060, 'void *'), + "r15": (0x0068, 'void *'), + "rip": (0x0070, 'void *'), + "cs": (0x0078, 'void *'), + "eflags": (0x0080, 'void *'), + "rsp": (0x0088, 'void *'), + "ss": (0x0090, 'void *'), + "rbp": (0x0098, 'void *'), + "prev_frame": (0x00a0, 'void *'), + "syscall_cfa": (0x00a8, 'void *'), + # "syscall_flags": (0x00b0, 'unsigned int'), + # "restore_flags": (0x00b4, 'unsigned int'), + "teb_offset": (0x0328, 'void *'), +} + +ARCH_OFFSETS_I386 = { + # "syscall_flags": (0x000, 'unsigned short'), + # "restore_flags": (0x002, 'unsigned short'), + "eflags": (0x004, 'unsigned int'), + "eip": (0x008, 'void *'), + "esp": (0x00c, 'void *'), + "cs": (0x010, 'unsigned short'), + "ss": (0x012, 'unsigned short'), + "ds": (0x014, 'unsigned short'), + "es": (0x016, 'unsigned short'), + "fs": (0x018, 'unsigned short'), + "gs": (0x01a, 'unsigned short'), + "eax": (0x01c, 'void *'), + "ebx": (0x020, 'void *'), + "ecx": (0x024, 'void *'), + "edx": (0x028, 'void *'), + "edi": (0x02c, 'void *'), + "esi": (0x030, 'void *'), + "ebp": (0x034, 'void *'), + "syscall_cfa": (0x038, 'void *'), + "prev_frame": (0x03c, 'void *'), + "teb_offset": (0x1f8, 'void *'), +} + + +def arch_offsets(arch): + if 'x86-64' in arch: + return ARCH_OFFSETS_X86_64 + if 'i386' in arch: + return ARCH_OFFSETS_I386 + + +def find_syscall_frame(sp, arch, teb): + (off, type) = arch_offsets(arch)['teb_offset'] + frame = int(gdb.parse_and_eval(f'*(void **){teb + off}')) + + while frame: + (off, type) = arch_offsets(arch)['prev_frame'] + next_frame = int(gdb.parse_and_eval(f'*(void **){(frame + off)}')) + if not next_frame: return frame + + (off, type) = arch_offsets(arch)['ebp'] + ebp = int(gdb.parse_and_eval(f'*(void **){(next_frame + off)}')) + if ebp >= sp: return frame + + +def callback_registers(pc, sp, pending_frame): + arch = pending_frame.architecture().name() + + if 'x86-64' in arch: + frame = int(pending_frame.read_register("rbp")) + frame = (frame - 0x448) & ~0x3f + + (off, type) = arch_offsets(arch)['syscall_cfa'] + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + yield 'rip', gdb.parse_and_eval(f'*(void **){int(val - 8)}') + yield 'rbp', val - 16 + + elif 'i386' in arch: + teb = int(pending_frame.read_register('edx')) + frame = find_syscall_frame(sp, arch, teb) + + (off, type) = arch_offsets(arch)['syscall_cfa'] + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + yield 'eip', gdb.parse_and_eval(f'*(void **){int(val - 4)}') + yield 'ebp', val - 8 + + +def registers(pc, sp, pending_frame): + arch = pending_frame.architecture().name() + frame = sp + + if 'x86-64' in arch: + if 'syscall' in str(pc): + rbp = pending_frame.read_register("rbp") + frame = rbp - 0x98 + elif 'i386' in arch: + if 'syscall' in str(pc): + ebp = pending_frame.read_register("ebp") + frame = ebp - 0x34 + else: + frame += 16 + + for reg, (off, type) in arch_offsets(arch).items(): + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + + if reg in ('eflags', 'cs', 'ss', 'ds', 'es', 'fs', 'gs'): + int32 = gdb.lookup_type('int') + val = val.cast(int32) + if reg in ('syscall_cfa', 'prev_frame', 'teb_offset'): + continue + + yield reg, val + + +class WineSyscallFrameId(object): + def __init__(self, sp, pc): + self.sp = sp + self.pc = pc + + +class WineSyscallUnwinder(Unwinder): + def __init__(self): + super().__init__("WineSyscallUnwinder", gdb.SIGTRAMP_FRAME) + self.pattern = re.compile('__wine_(syscall|unix_call)' + '|KiUserCallbackDispatcher') + + def __call__(self, pending_frame): + pc = pending_frame.read_register("pc") + if self.pattern.search(str(pc)) is None: + return None + + sp = pending_frame.read_register("sp") + frame = WineSyscallFrameId(sp, pc) + if 'KiUserCallbackDispatcher' in str(pc): + unwind_info = pending_frame.create_unwind_info(frame) + for reg, val in callback_registers(pc, sp, pending_frame): + unwind_info.add_saved_register(reg, val) + return unwind_info + + unwind_info = pending_frame.create_unwind_info(frame) + for reg, val in registers(pc, sp, pending_frame): + unwind_info.add_saved_register(reg, val) + return unwind_info + + +gdb.unwinder.register_unwinder(None, WineSyscallUnwinder(), replace=True) diff --git a/tools/gitlab/test.yml b/tools/gitlab/test.yml index 92c14d83996..aaad7b31c36 100644 --- a/tools/gitlab/test.yml +++ b/tools/gitlab/test.yml @@ -7,7 +7,7 @@ variables: GIT_STRATEGY: none GECKO_VER: 2.47.4 - MONO_VER: 8.1.0 + MONO_VER: 9.0.0 cache: - key: wine-gecko-$GECKO_VER paths: diff --git a/tools/make_requests b/tools/make_requests index 77b5ab331f4..b450e22c2b8 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -54,7 +54,7 @@ my %formats = "hw_input_t" => [ 40, 8, "&dump_hw_input" ], # varargs-only structures "apc_call_t" => [ 64, 8 ], - "context_t" => [ 1720, 8 ], + "context_t" => [ 1728, 8 ], "cursor_pos_t" => [ 24, 8 ], "debug_event_t" => [ 160, 8 ], "message_data_t" => [ 56, 8 ], diff --git a/tools/makedep.c b/tools/makedep.c index 8ce575b15ca..a6984d4303b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -143,6 +143,7 @@ static struct strarray subdirs; static struct strarray delay_import_libs; static struct strarray top_install[NB_INSTALL_RULES]; static const char *root_src_dir; +static const char *root_obj_dir; static const char *tools_dir; static const char *tools_ext; static const char *exe_ext; @@ -181,6 +182,7 @@ struct makefile struct strarray include_args; struct strarray define_args; struct strarray unix_cflags; + struct strarray extra_cflags; struct strarray programs; struct strarray scripts; struct strarray imports; @@ -195,14 +197,19 @@ struct makefile const char *obj_dir; const char *parent_dir; const char *module; + const char *module_x64; const char *testdll; const char *extlib; const char *staticlib; const char *importlib; const char *unixlib; + const char *unixlib_x64; + int use_msvcrt; int data_only; int is_win16; int is_exe; + int has_cxx; + int is_external; int disabled[MAX_ARCHS]; /* values generated at output time */ @@ -602,17 +609,6 @@ static int is_multiarch( unsigned int arch ) } -/******************************************************************* - * is_using_msvcrt - * - * Check if the files of a makefile use msvcrt by default. - */ -static int is_using_msvcrt( struct makefile *make ) -{ - return make->module || make->testdll; -} - - /******************************************************************* * arch_module_name */ @@ -659,6 +655,16 @@ static char *root_src_dir_path( const char *path ) } +/******************************************************************* + * root_obj_dir_path + */ +static char *root_obj_dir_path( const char *path ) +{ + if (!root_obj_dir) return (char *)path; + return concat_paths( root_obj_dir, path ); +} + + /******************************************************************* * tools_dir_path */ @@ -871,7 +877,7 @@ static struct incl_file *add_generated_source( struct makefile *make, const char file->basename = xstrdup( filename ? filename : name ); file->filename = obj_dir_path( make, file->basename ); file->file->flags = FLAG_GENERATED; - file->use_msvcrt = is_using_msvcrt( make ); + file->use_msvcrt = make->use_msvcrt; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) { @@ -1191,6 +1197,7 @@ static const struct } parse_functions[] = { { ".c", parse_c_file }, + { ".cpp", parse_c_file }, { ".h", parse_c_file }, { ".inl", parse_c_file }, { ".l", parse_c_file }, @@ -1450,9 +1457,9 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ if ((file = open_local_file( make, pFile->name, &pFile->filename ))) return file; /* check for global importlib (module dependency) */ - if (pFile->type == INCL_IMPORTLIB && find_importlib_module( pFile->name )) + if (pFile->type == INCL_IMPORTLIB) { - pFile->filename = pFile->name; + if (find_importlib_module( pFile->name )) pFile->filename = pFile->name; return NULL; } @@ -1505,7 +1512,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ return file; } - if (make->extlib) return NULL; /* ignore missing files in external libs */ + if (make->extlib || make->is_external) return NULL; /* ignore missing files in external libs */ fprintf( stderr, "%s:%d: error: ", pFile->included_by->file->name, pFile->included_line ); perror( pFile->name ); @@ -1622,8 +1629,8 @@ static struct incl_file *add_src_file( struct makefile *make, const char *name ) memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); - file->use_msvcrt = is_using_msvcrt( make ); - file->is_external = !!make->extlib; + file->use_msvcrt = make->use_msvcrt; + file->is_external = !!make->extlib || make->is_external; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) { @@ -1820,12 +1827,13 @@ static void add_generated_sources( struct makefile *make ) unsigned int i, arch; struct incl_file *source, *next, *file, *dlldata = NULL; struct strarray objs = get_expanded_make_var_array( make, "EXTRA_OBJS" ); + int multiarch = archs.count > 1 && make->use_msvcrt; LIST_FOR_EACH_ENTRY_SAFE( source, next, &make->sources, struct incl_file, entry ) { for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; if (source->file->flags & FLAG_IDL_CLIENT) { file = add_generated_source( make, replace_extension( source->name, ".idl", "_c.c" ), NULL, arch ); @@ -1944,7 +1952,7 @@ static void add_generated_sources( struct makefile *make ) { for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; file = add_generated_source( make, "testlist.o", "testlist.c", arch ); add_dependency( file->file, "wine/test.h", INCL_NORMAL ); add_all_includes( make, file, file->file ); @@ -2156,7 +2164,7 @@ static struct strarray add_unix_libraries( const struct makefile *make, struct s struct strarray all_libs = empty_strarray; unsigned int i, j; - if (strcmp( make->unixlib, "ntdll.so" )) strarray_add( &all_libs, "-lntdll" ); + if (strcmp( make->unixlib, "ntdll.so" ) && !make->is_external) strarray_add( &all_libs, "-lntdll" ); strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); for (i = 0; i < all_libs.count; i++) @@ -2198,6 +2206,7 @@ static int is_crt_module( const char *file ) */ static const char *get_default_crt( const struct makefile *make ) { + if (!make->use_msvcrt) return NULL; if (make->module && is_crt_module( make->module )) return NULL; /* don't add crt import to crt dlls */ return !make->testdll && (!make->staticlib || make->extlib) ? "ucrtbase" : "msvcrt"; } @@ -2354,7 +2363,6 @@ static struct strarray get_source_defines( struct makefile *make, struct incl_fi strarray_add( &ret, strmake( "-I%s", root_src_dir_path( "include/msvcrt" ))); for (i = 0; i < make->include_paths.count; i++) strarray_add( &ret, strmake( "-I%s", make->include_paths.str[i] )); - strarray_add( &ret, get_crt_define( make )); } strarray_addall( &ret, make->define_args ); strarray_addall( &ret, get_expanded_file_local_var( make, obj, "EXTRADEFS" )); @@ -2404,19 +2412,19 @@ static const char *cmd_prefix( const char *cmd ) /******************************************************************* * output_winegcc_command */ -static void output_winegcc_command( struct makefile *make, unsigned int arch ) +static void output_winegcc_command( struct makefile *make, unsigned int arch, int is_cxx ) { - output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tools_path( make, "winegcc" )); - output_filename( "--wine-objdir ." ); + const char *tool = tools_path( make, "winegcc" ); + if (is_cxx) strcpy( strrchr( tool, 'w' ), "wineg++" ); + output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tool ); + output_filename( strmake( "--wine-objdir %s", root_obj_dir_path( "." ) ) ); if (tools_dir) { output_filename( "--winebuild" ); output_filename( tools_path( make, "winebuild" )); } output_filenames( target_flags[arch] ); - if (arch) return; - output_filename( "-mno-cygwin" ); - output_filenames( lddll_flags ); + if (!arch) output_filenames( lddll_flags ); } @@ -2815,6 +2823,7 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, struct strarray multiarch_targets[MAX_ARCHS] = { empty_strarray }; const char *dest; unsigned int i, arch; + int multiarch; if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER; if (!source->file->flags) return; @@ -2838,9 +2847,10 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, for (i = 0; i < ARRAY_SIZE(idl_outputs); i++) { if (!(source->file->flags & idl_outputs[i].flag)) continue; + multiarch = (make->use_msvcrt && archs.count > 1); for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; if (make->disabled[arch]) continue; dest = strmake( "%s%s%s", arch_dirs[arch], obj, idl_outputs[i].ext ); if (!find_src_file( make, dest )) strarray_add( &make->clean_files, dest ); @@ -3117,7 +3127,7 @@ static void output_source_testdll( struct makefile *make, struct incl_file *sour output_filename( tools_path( make, "winebuild" )); output_filename( tools_path( make, "winegcc" )); output( "\n" ); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, 0 ); output_filename( "-s" ); output_filenames( dll_flags ); if (arch) output_filenames( get_expanded_arch_var_array( make, "EXTRADLLFLAGS", arch )); @@ -3156,20 +3166,22 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou struct strarray defines, struct strarray *targets, unsigned int arch ) { + const int is_cxx = strendswith( source->name, ".cpp" ); const char *obj_name; if (make->disabled[arch] && !(source->file->flags & FLAG_C_IMPLIB)) return; + make->has_cxx |= is_cxx; if (arch) { if (source->file->flags & FLAG_C_UNIX) return; - if (!is_using_msvcrt( make ) && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; + if (!make->use_msvcrt && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; } else if (source->file->flags & FLAG_C_UNIX) { if (!unix_lib_supported) return; } - else if (archs.count > 1 && is_using_msvcrt( make )) + else if (archs.count > 1 && make->use_msvcrt) { if (!so_dll_supported) return; if (!(source->file->flags & FLAG_C_IMPLIB) && (!make->staticlib || make->extlib)) return; @@ -3188,10 +3200,13 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou strarray_add( &make->clean_files, obj_name ); output( "%s: %s\n", obj_dir_path( make, obj_name ), source->filename ); - output( "\t%s%s -c -o $@ %s", cmd_prefix( "CC" ), arch_make_variable( "CC", arch ), source->filename ); + if (is_cxx) output( "\t%s%s -c -o $@ %s", cmd_prefix( "CXX" ), arch_make_variable( "CXX", arch ), source->filename ); + else output( "\t%s%s -c -o $@ %s", cmd_prefix( "CC" ), arch_make_variable( "CC", arch ), source->filename ); output_filenames( defines ); - if (!source->use_msvcrt) output_filenames( make->unix_cflags ); - output_filenames( make->extlib ? extra_cflags_extlib[arch] : extra_cflags[arch] ); + if (source->file->flags & FLAG_C_UNIX) output_filenames( make->unix_cflags ); + else output_filenames( make->extra_cflags ); + if (!make->use_msvcrt && !make->module) output_filenames( make->unix_cflags ); + output_filenames( make->extlib || is_cxx ? extra_cflags_extlib[arch] : extra_cflags[arch] ); if (!arch) { if (source->file->flags & FLAG_C_UNIX) @@ -3212,7 +3227,8 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou } output_filenames( cpp_flags ); - output_filename( arch_make_variable( "CFLAGS", arch )); + if (is_cxx) output_filename( arch_make_variable( "CXXFLAGS", arch )); + else output_filename( arch_make_variable( "CFLAGS", arch )); output( "\n" ); if (make->testdll && strendswith( source->name, ".c" ) && @@ -3305,12 +3321,15 @@ static const struct static void output_fake_module( struct makefile *make, const char *spec_file ) { unsigned int arch = 0; /* fake modules are always native */ - const char *name = strmake( "%s%s", arch_pe_dirs[arch], make->module ); + const char *name, *module = make->module; if (make->disabled[arch]) return; + if (make->module_x64 && !strcmp( archs.str[arch], "x86_64" )) module = make->module_x64; + + name = strmake( "%s%s", arch_pe_dirs[arch], module ); strarray_add( &make->all_targets[arch], name ); - add_install_rule( make, make->module, arch, name, strmake( "d$(dlldir)/%s", name )); + add_install_rule( make, module, arch, name, strmake( "d$(dlldir)/%s", name )); output( "%s:", obj_dir_path( make, name )); if (spec_file) output_filename( spec_file ); @@ -3318,7 +3337,7 @@ static void output_fake_module( struct makefile *make, const char *spec_file ) output_filename( tools_path( make, "winebuild" )); output_filename( tools_path( make, "winegcc" )); output( "\n" ); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, 0 ); output_filename( "-Wb,--fake-module" ); if (!make->is_exe) output_filename( "-shared" ); if (spec_file) output_filename( spec_file ); @@ -3337,27 +3356,28 @@ static void output_module( struct makefile *make, unsigned int arch ) struct strarray all_libs = empty_strarray; struct strarray dep_libs = empty_strarray; struct strarray imports = make->imports; - const char *module_name; + const char *module_name, *module = make->module; const char *debug_file; - char *spec_file = NULL; + char *tool, *spec_file = NULL; unsigned int i; if (make->disabled[arch]) return; + if (make->module_x64 && !strcmp( archs.str[arch], "x86_64" )) module = make->module_x64; if (!make->is_exe) { if (make->data_only || strarray_exists( &make->extradllflags, "-Wl,--subsystem,native" )) { /* spec file is optional */ - struct incl_file *spec = find_src_file( make, replace_extension( make->module, ".dll", ".spec" )); + struct incl_file *spec = find_src_file( make, replace_extension( module, ".dll", ".spec" )); if (spec) spec_file = spec->filename; } - else spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); + else spec_file = src_dir_path( make, replace_extension( module, ".dll", ".spec" )); } if (!make->data_only) { - module_name = arch_module_name( make->module, arch ); + module_name = arch_module_name( module, arch ); if (!strarray_exists( &make->extradllflags, "-nodefaultlibs" )) default_imports = get_default_imports( make, imports ); @@ -3366,6 +3386,12 @@ static void output_module( struct makefile *make, unsigned int arch ) strarray_addall( &all_libs, add_import_libs( make, &dep_libs, default_imports, IMPORT_TYPE_DEFAULT, arch ) ); if (!arch) strarray_addall( &all_libs, libs ); + if (!make->use_msvcrt) + { + strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); + strarray_addall( &all_libs, libs ); + } + if (delay_load_flags[arch]) { for (i = 0; i < make->delayimports.count; i++) @@ -3375,15 +3401,15 @@ static void output_module( struct makefile *make, unsigned int arch ) } } } - else module_name = strmake( "%s%s", arch_pe_dirs[arch], make->module ); + else module_name = strmake( "%s%s", arch_pe_dirs[arch], module ); strarray_add( &make->all_targets[arch], module_name ); if (make->data_only) - add_install_rule( make, make->module, arch, module_name, - strmake( "d$(dlldir)/%s%s", arch_pe_dirs[arch], make->module )); + add_install_rule( make, module, arch, module_name, + strmake( "d$(dlldir)/%s%s", arch_pe_dirs[arch], module )); else - add_install_rule( make, make->module, arch, module_name, - strmake( "%c%s%s%s", '0' + arch, arch_install_dirs[arch], make->module, + add_install_rule( make, module, arch, module_name, + strmake( "%c%s%s%s", '0' + arch, arch_install_dirs[arch], module, dll_ext[arch] )); output( "%s:", obj_dir_path( make, module_name )); @@ -3392,9 +3418,15 @@ static void output_module( struct makefile *make, unsigned int arch ) output_filenames_obj_dir( make, make->res_files[arch] ); output_filenames( dep_libs ); output_filename( tools_path( make, "winebuild" )); - output_filename( tools_path( make, "winegcc" )); + tool = tools_path( make, "winegcc" ); + output_filename( tool ); + if (make->has_cxx) + { + strcpy( strrchr( tool, 'w' ), "wineg++" ); + output_filename( tool ); + } output( "\n" ); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, make->has_cxx ); if (arch) output_filename( "-Wl,--wine-builtin" ); if (!make->is_exe) output_filename( "-shared" ); if (spec_file) output_filename( spec_file ); @@ -3452,17 +3484,20 @@ static void output_unix_lib( struct makefile *make ) struct strarray unix_deps = empty_strarray; struct strarray unix_libs = add_unix_libraries( make, &unix_deps ); unsigned int arch = 0; /* unix libs are always native */ + const char *unixlib = make->unixlib; if (make->disabled[arch]) return; + if (make->unixlib_x64 && !strcmp( archs.str[arch], "x86_64" )) unixlib = make->unixlib_x64; - strarray_add( &make->all_targets[arch], make->unixlib ); - add_install_rule( make, make->module, arch, make->unixlib, - strmake( "p%s%s", arch_install_dirs[arch], make->unixlib )); - output( "%s:", obj_dir_path( make, make->unixlib )); + strarray_add( &make->all_targets[arch], unixlib ); + add_install_rule( make, make->module, arch, unixlib, + strmake( "p%s%s", arch_install_dirs[arch], unixlib )); + output( "%s:", obj_dir_path( make, unixlib )); output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_deps ); output( "\n" ); - output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); + if (make->has_cxx) output( "\t%s$(CXX) -o $@", cmd_prefix( "CCLD" )); + else output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); output_filenames( get_expanded_make_var_array( make, "UNIXLDFLAGS" )); output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_libs ); @@ -3514,7 +3549,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) strarray_add( &make->all_targets[arch], testmodule ); strarray_add( &make->clean_files, stripped ); output( "%s:\n", obj_dir_path( make, testmodule )); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, 0 ); output_filenames( make->extradllflags ); output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files[arch] ); @@ -3524,7 +3559,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output_filename( arch_make_variable( "LDFLAGS", arch )); output( "\n" ); output( "%s:\n", obj_dir_path( make, stripped )); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, 0 ); output_filename( "-s" ); output_filename( strmake( "-Wb,-F,%s_test.exe", basemodule )); output_filenames( make->extradllflags ); @@ -3555,7 +3590,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output( ": %s", obj_dir_path( make, testmodule )); if (parent) { - char *parent_module = arch_module_name( make->testdll, arch ); + char *parent_module = arch_module_name( make->testdll, parent->use_msvcrt ? arch : 0 ); output_filename( obj_dir_path( parent, parent_module )); if (parent->unixlib) output_filename( obj_dir_path( parent, parent->unixlib )); } @@ -3806,7 +3841,8 @@ static void output_sources( struct makefile *make ) } else if (make->module) { - for (arch = 0; arch < archs.count; arch++) + if (!make->use_msvcrt) output_module( make, 0 ); + else for (arch = 0; arch < archs.count; arch++) { if (is_multiarch( arch )) output_module( make, arch ); if (make->importlib && (is_multiarch( arch ) || !is_native_arch_disabled( make ))) @@ -4204,11 +4240,16 @@ static void load_sources( struct makefile *make ) make->parent_dir = get_expanded_make_variable( make, "PARENTSRC" ); make->module = get_expanded_make_variable( make, "MODULE" ); + make->module_x64 = get_expanded_make_variable( make, "MODULE_x64" ); make->testdll = get_expanded_make_variable( make, "TESTDLL" ); make->staticlib = get_expanded_make_variable( make, "STATICLIB" ); make->importlib = get_expanded_make_variable( make, "IMPORTLIB" ); make->extlib = get_expanded_make_variable( make, "EXTLIB" ); - if (unix_lib_supported) make->unixlib = get_expanded_make_variable( make, "UNIXLIB" ); + if (unix_lib_supported) + { + make->unixlib = get_expanded_make_variable( make, "UNIXLIB" ); + make->unixlib_x64 = get_expanded_make_variable( make, "UNIXLIB_x64" ); + } make->programs = get_expanded_make_var_array( make, "PROGRAMS" ); make->scripts = get_expanded_make_var_array( make, "SCRIPTS" ); @@ -4230,9 +4271,13 @@ static void load_sources( struct makefile *make ) } make->is_win16 = strarray_exists( &make->extradllflags, "-m16" ); make->data_only = strarray_exists( &make->extradllflags, "-Wb,--data-only" ); + make->use_msvcrt = (make->module || make->testdll || make->is_win16) && + !strarray_exists( &make->extradllflags, "-mcygwin" ); make->is_exe = strarray_exists( &make->extradllflags, "-mconsole" ) || strarray_exists( &make->extradllflags, "-mwindows" ); + if (make->use_msvcrt) strarray_add_uniq( &make->extradllflags, "-mno-cygwin" ); + if (make->module) { /* add default install rules if nothing was specified */ @@ -4242,6 +4287,7 @@ static void load_sources( struct makefile *make ) if (make->importlib) strarray_add( &make->install[INSTALL_DEV], make->importlib ); if (make->staticlib) strarray_add( &make->install[INSTALL_DEV], make->staticlib ); else strarray_add( &make->install[INSTALL_LIB], make->module ); + if (make->module_x64) strarray_add( &make->install[INSTALL_LIB], make->module_x64 ); } } @@ -4249,6 +4295,7 @@ static void load_sources( struct makefile *make ) make->include_args = empty_strarray; make->define_args = empty_strarray; make->unix_cflags = empty_strarray; + make->extra_cflags = empty_strarray; if (!make->extlib) strarray_add( &make->define_args, "-D__WINESRC__" ); strarray_add( &make->unix_cflags, "-DWINE_UNIX_LIB" ); @@ -4270,13 +4317,14 @@ static void load_sources( struct makefile *make ) } strarray_addall( &make->define_args, get_expanded_make_var_array( make, "EXTRADEFS" )); strarray_addall_uniq( &make->unix_cflags, get_expanded_make_var_array( make, "UNIX_CFLAGS" )); + strarray_addall_uniq( &make->extra_cflags, get_expanded_make_var_array( make, "EXTRA_CFLAGS" )); strarray_add( &make->include_args, strmake( "-I%s", obj_dir_path( make, "" ))); if (make->src_dir) strarray_add( &make->include_args, strmake( "-I%s", make->src_dir )); if (make->parent_dir) strarray_add( &make->include_args, strmake( "-I%s", src_dir_path( make, make->parent_dir ))); - strarray_add( &make->include_args, "-Iinclude" ); + strarray_add( &make->include_args, strmake( "-I%s", root_obj_dir_path( "include" ) ) ); if (root_src_dir) strarray_add( &make->include_args, strmake( "-I%s", root_src_dir_path( "include" ))); list_init( &make->sources ); @@ -4287,6 +4335,8 @@ static void load_sources( struct makefile *make ) add_generated_sources( make ); + if (make->use_msvcrt) strarray_add( &make->define_args, get_crt_define( make )); + LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 ); LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) get_dependencies( file, file ); @@ -4353,7 +4403,7 @@ static int parse_option( const char *opt ) int main( int argc, char *argv[] ) { const char *makeflags = getenv( "MAKEFLAGS" ); - const char *target; + const char *target, *tmp; unsigned int i, j, arch; if (makeflags) parse_makeflags( makeflags ); @@ -4405,6 +4455,7 @@ int main( int argc, char *argv[] ) top_install[i] = get_expanded_make_var_array( top_makefile, strmake( "TOP_%s", install_variables[i] )); root_src_dir = get_expanded_make_variable( top_makefile, "srcdir" ); + root_obj_dir = get_expanded_make_variable( top_makefile, "objdir" ); tools_dir = get_expanded_make_variable( top_makefile, "toolsdir" ); tools_ext = get_expanded_make_variable( top_makefile, "toolsext" ); exe_ext = get_expanded_make_variable( top_makefile, "EXEEXT" ); @@ -4471,7 +4522,18 @@ int main( int argc, char *argv[] ) subdirs = get_expanded_make_var_array( top_makefile, "SUBDIRS" ); submakes = xmalloc( subdirs.count * sizeof(*submakes) ); - for (i = 0; i < subdirs.count; i++) submakes[i] = parse_makefile( subdirs.str[i] ); + for (i = 0; i < subdirs.count; i++) + { + submakes[i] = parse_makefile( subdirs.str[i] ); + if (*(tmp = subdirs.str[i]) == '/') + { + tmp = strmake( "dlls%s", strrchr( tmp, '/' ) ); + submakes[i]->is_external = 1; + } + submakes[i]->obj_dir = subdirs.str[i] = tmp; + } + + if (!include_makefile) include_makefile = parse_makefile( root_src_dir_path( "include" ) ); load_sources( top_makefile ); load_sources( include_makefile ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 6e3a0941310..26cb6878391 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -62,7 +62,7 @@ static unsigned int hash_filename( const char *name ) /* FNV-1 hash */ unsigned int ret = 2166136261u; while (*name) ret = (ret * 16777619) ^ *name++; - return ret; + return ret + target.cpu; } /* check if entry point needs a relay thunk */