Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
91a2cebe6c | |||
8bb68d1137 | |||
03655c37fc | |||
ba44bf9b0d | |||
891290abd9 | |||
f5668cdb25 | |||
4f9af86cba | |||
9bd065640d | |||
512b990f3e | |||
8be2d6c09a | |||
d5f9f4b520 | |||
60a7bab96c | |||
1b6be6f72a | |||
41b777a693 | |||
cba8a2a18e | |||
3ef2957b95 | |||
5dd4a81476 |
@ -17,5 +17,12 @@ rm -rf ./AppDir/usr/local
|
||||
#Circumvent missing LibFuse in Docker, by extracting the AppImage
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
|
||||
#Copy External Libraries
|
||||
mkdir -p ./AppDir/usr/plugins/platformthemes
|
||||
mkdir -p ./AppDir/usr/plugins/styles
|
||||
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqt5ct.so ./AppDir/usr/plugins/platformthemes
|
||||
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so ./AppDir/usr/plugins/platformthemes
|
||||
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/styles/libqt5ct-style.so ./AppDir/usr/plugins/styles
|
||||
|
||||
#Build AppImage
|
||||
QMAKE=/usr/lib/qt6/bin/qmake DEPLOY_PLATFORM_THEMES=1 /linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
|
||||
/linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
|
||||
|
@ -17,14 +17,15 @@ echo 'Prepare binaries...'
|
||||
cd ..
|
||||
mkdir package
|
||||
|
||||
QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt6/plugins/platforms/'
|
||||
QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt/plugins/platforms/'
|
||||
find build/ -name "citra*.exe" -exec cp {} 'package' \;
|
||||
|
||||
# copy Qt plugins
|
||||
mkdir package/platforms
|
||||
cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../multimedia/" package/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../styles/" package/
|
||||
rm -f package/mediaservice/*d.dll
|
||||
|
||||
python3 .ci/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
|
||||
|
@ -22,6 +22,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DENABLE_FFMPEG_AUDIO_DECODER=ON \
|
||||
-DENABLE_FFMPEG_VIDEO_DUMPER=ON \
|
||||
-DENABLE_ASM=OFF \
|
||||
-GNinja
|
||||
|
@ -1,3 +1,13 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
brew install ccache ninja || true
|
||||
|
||||
export QT_VER=5.15.8
|
||||
|
||||
mkdir tmp
|
||||
cd tmp/
|
||||
|
||||
# install Qt
|
||||
wget https://github.com/citra-emu/ext-macos-bin/raw/main/qt/qt-${QT_VER}.7z
|
||||
7z x qt-${QT_VER}.7z
|
||||
sudo cp -rv $(pwd)/qt-${QT_VER}/* /usr/local/
|
||||
|
@ -6,7 +6,7 @@ cmake .. \
|
||||
-G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MSVCCache.cmake" \
|
||||
-DCITRA_USE_CCACHE=ON \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DENABLE_QT_TRANSLATION=OFF \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
|
@ -25,7 +25,7 @@ option(USE_SYSTEM_SDL2 "Use the system SDL2 lib (instead of the bundled one)" OF
|
||||
# Set bundled qt as dependent options.
|
||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" ON "ENABLE_QT;MSVC OR APPLE" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" ON "ENABLE_QT;MSVC" OFF)
|
||||
|
||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||
if (MSVC)
|
||||
@ -51,7 +51,6 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
||||
option(CITRA_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(ENABLE_MF "Use Media Foundation decoder (preferred over FFmpeg)" ON "WIN32" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(ENABLE_AUDIOTOOLBOX "Use AudioToolbox decoder (preferred over FFmpeg)" ON "APPLE" OFF)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ON "MINGW" OFF)
|
||||
|
||||
@ -203,23 +202,23 @@ find_package(Threads REQUIRED)
|
||||
|
||||
if (ENABLE_QT)
|
||||
if (CITRA_USE_BUNDLED_QT)
|
||||
download_qt_external(6.5.0 QT_PREFIX)
|
||||
download_qt_external(5.15.2 QT_PREFIX)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${QT_PREFIX})
|
||||
endif()
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia Concurrent)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Widgets Multimedia Concurrent)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(Qt6 REQUIRED COMPONENTS DBus)
|
||||
find_package(Qt5 REQUIRED COMPONENTS DBus)
|
||||
endif()
|
||||
|
||||
if (ENABLE_QT_TRANSLATION)
|
||||
find_package(Qt6 REQUIRED COMPONENTS LinguistTools)
|
||||
find_package(Qt5 REQUIRED COMPONENTS LinguistTools)
|
||||
endif()
|
||||
|
||||
if (NOT CITRA_USE_BUNDLED_QT)
|
||||
# Make sure the Qt bin directory is in the prefix path for later use, such as in post-build scripts.
|
||||
get_target_property(qmake_executable Qt6::qmake IMPORTED_LOCATION)
|
||||
# Make sure the Qt bin directory is in the prefix path for later consumers.
|
||||
get_target_property(qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(qt_bin_dir "${qmake_executable}" DIRECTORY)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${qt_bin_dir})
|
||||
endif()
|
||||
@ -274,10 +273,6 @@ if (ENABLE_FDK)
|
||||
message(FATAL_ERROR "fdk_aac library not found.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use system tsl::robin_map if available (otherwise we fallback to version bundled with dynarmic)
|
||||
find_package(tsl-robin-map QUIET)
|
||||
|
||||
# Platform-specific library requirements
|
||||
# ======================================
|
||||
|
||||
@ -287,6 +282,8 @@ if (APPLE)
|
||||
find_library(AVFOUNDATION_LIBRARY AVFoundation)
|
||||
set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${AVFOUNDATION_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
|
||||
elseif (WIN32)
|
||||
# WSAPoll and SHGetKnownFolderPath (AppData/Roaming) didn't exist before WinNT 6.x (Vista)
|
||||
add_definitions(-D_WIN32_WINNT=0x0601 -DWINVER=0x0601)
|
||||
set(PLATFORM_LIBRARIES winmm ws2_32)
|
||||
if (MINGW)
|
||||
# PSAPI is the Process Status API
|
||||
|
@ -26,10 +26,6 @@ if ("${TYPE}" STREQUAL "qt")
|
||||
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt)
|
||||
execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${bundle_dir} -executable=${EXECUTABLE_PATH} -always-overwrite)
|
||||
|
||||
# Bundling libraries can rewrite path information and break code signatures of system libraries.
|
||||
# Perform an ad-hoc re-signing on the whole app bundle to fix this.
|
||||
execute_process(COMMAND codesign --deep -fs - ${bundle_dir})
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS for Qt-based library bundling.")
|
||||
endif()
|
||||
|
47
CMakeModules/CopyCitraQt5Deps.cmake
Normal file
47
CMakeModules/CopyCitraQt5Deps.cmake
Normal file
@ -0,0 +1,47 @@
|
||||
function(copy_citra_Qt5_deps target_dir)
|
||||
include(WindowsCopyFiles)
|
||||
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
|
||||
set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
|
||||
set(Qt5_PLATFORMS_DIR "${Qt5_DIR}/../../../plugins/platforms/")
|
||||
set(Qt5_MEDIASERVICE_DIR "${Qt5_DIR}/../../../plugins/mediaservice/")
|
||||
set(Qt5_STYLES_DIR "${Qt5_DIR}/../../../plugins/styles/")
|
||||
set(Qt5_IMAGEFORMATS_DIR "${Qt5_DIR}/../../../plugins/imageformats/")
|
||||
set(PLATFORMS ${DLL_DEST}plugins/platforms/)
|
||||
set(MEDIASERVICE ${DLL_DEST}plugins/mediaservice/)
|
||||
set(STYLES ${DLL_DEST}plugins/styles/)
|
||||
set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/)
|
||||
windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
|
||||
icudt*.dll
|
||||
icuin*.dll
|
||||
icuuc*.dll
|
||||
Qt5Core$<$<CONFIG:Debug>:d>.*
|
||||
Qt5Gui$<$<CONFIG:Debug>:d>.*
|
||||
Qt5Widgets$<$<CONFIG:Debug>:d>.*
|
||||
Qt5Concurrent$<$<CONFIG:Debug>:d>.*
|
||||
Qt5Multimedia$<$<CONFIG:Debug>:d>.*
|
||||
Qt5Network$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(citra-qt ${Qt5_MEDIASERVICE_DIR} ${MEDIASERVICE}
|
||||
dsengine$<$<CONFIG:Debug>:d>.*
|
||||
wmfengine$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt5_STYLES_DIR} ${STYLES} qwindowsvistastyle$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(${target_dir} ${Qt5_IMAGEFORMATS_DIR} ${IMAGEFORMATS}
|
||||
qgif$<$<CONFIG:Debug>:d>.dll
|
||||
qicns$<$<CONFIG:Debug>:d>.dll
|
||||
qico$<$<CONFIG:Debug>:d>.dll
|
||||
qjpeg$<$<CONFIG:Debug>:d>.dll
|
||||
qsvg$<$<CONFIG:Debug>:d>.dll
|
||||
qtga$<$<CONFIG:Debug>:d>.dll
|
||||
qtiff$<$<CONFIG:Debug>:d>.dll
|
||||
qwbmp$<$<CONFIG:Debug>:d>.dll
|
||||
qwebp$<$<CONFIG:Debug>:d>.dll
|
||||
)
|
||||
|
||||
# Create an empty qt.conf file. Qt will detect that this file exists, and use the folder that its in as the root folder.
|
||||
# This way it'll look for plugins in the root/plugins/ folder
|
||||
add_custom_command(TARGET citra-qt POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${DLL_DEST}qt.conf
|
||||
)
|
||||
endfunction(copy_citra_Qt5_deps)
|
@ -1,46 +0,0 @@
|
||||
function(copy_citra_Qt6_deps target_dir)
|
||||
include(WindowsCopyFiles)
|
||||
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
|
||||
set(Qt6_DLL_DIR "${Qt6_DIR}/../../../bin")
|
||||
set(Qt6_PLATFORMS_DIR "${Qt6_DIR}/../../../plugins/platforms/")
|
||||
set(Qt6_MULTIMEDIA_DIR "${Qt6_DIR}/../../../plugins/multimedia/")
|
||||
set(Qt6_STYLES_DIR "${Qt6_DIR}/../../../plugins/styles/")
|
||||
set(Qt6_IMAGEFORMATS_DIR "${Qt6_DIR}/../../../plugins/imageformats/")
|
||||
set(PLATFORMS ${DLL_DEST}plugins/platforms/)
|
||||
set(MULTIMEDIA ${DLL_DEST}plugins/multimedia/)
|
||||
set(STYLES ${DLL_DEST}plugins/styles/)
|
||||
set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/)
|
||||
windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST}
|
||||
icudt*.dll
|
||||
icuin*.dll
|
||||
icuuc*.dll
|
||||
Qt6Core$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Gui$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Widgets$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Concurrent$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Multimedia$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Network$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt6_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(citra-qt ${Qt6_MULTIMEDIA_DIR} ${MULTIMEDIA}
|
||||
windowsmediaplugin$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt6_STYLES_DIR} ${STYLES} qwindowsvistastyle$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(${target_dir} ${Qt6_IMAGEFORMATS_DIR} ${IMAGEFORMATS}
|
||||
qgif$<$<CONFIG:Debug>:d>.dll
|
||||
qicns$<$<CONFIG:Debug>:d>.dll
|
||||
qico$<$<CONFIG:Debug>:d>.dll
|
||||
qjpeg$<$<CONFIG:Debug>:d>.dll
|
||||
qsvg$<$<CONFIG:Debug>:d>.dll
|
||||
qtga$<$<CONFIG:Debug>:d>.dll
|
||||
qtiff$<$<CONFIG:Debug>:d>.dll
|
||||
qwbmp$<$<CONFIG:Debug>:d>.dll
|
||||
qwebp$<$<CONFIG:Debug>:d>.dll
|
||||
)
|
||||
|
||||
# Create an empty qt.conf file. Qt will detect that this file exists, and use the folder that its in as the root folder.
|
||||
# This way it'll look for plugins in the root/plugins/ folder
|
||||
add_custom_command(TARGET citra-qt POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${DLL_DEST}qt.conf
|
||||
)
|
||||
endfunction(copy_citra_Qt6_deps)
|
5
CMakeModules/CopyCitraSDLDeps.cmake
Normal file
5
CMakeModules/CopyCitraSDLDeps.cmake
Normal file
@ -0,0 +1,5 @@
|
||||
function(copy_citra_SDL_deps target_dir)
|
||||
include(WindowsCopyFiles)
|
||||
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
|
||||
windows_copy_files(${target_dir} ${SDL2_DLL_DIR} ${DLL_DEST} SDL2.dll)
|
||||
endfunction(copy_citra_SDL_deps)
|
@ -70,7 +70,7 @@ function(download_qt_external target prefix_var)
|
||||
set(install_args install-tool --outputdir ${base_path} ${host} desktop ${target})
|
||||
else()
|
||||
set(prefix "${base_path}/${target}/${arch_path}")
|
||||
set(install_args install-qt --outputdir ${base_path} ${host} desktop ${target} ${arch} -m qtmultimedia)
|
||||
set(install_args install-qt --outputdir ${base_path} ${host} desktop ${target} ${arch})
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS "${prefix}")
|
||||
|
@ -1,6 +1,8 @@
|
||||
SET(MINGW_PREFIX /usr/x86_64-w64-mingw32/)
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
# Actually a hack, w/o this will cause some strange errors
|
||||
SET(CMAKE_HOST_WIN32 TRUE)
|
||||
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
|
||||
|
2
externals/catch2
vendored
2
externals/catch2
vendored
Submodule externals/catch2 updated: 3f0283de7a...dc001fa935
2
externals/dynarmic
vendored
2
externals/dynarmic
vendored
Submodule externals/dynarmic updated: d5c2b473a8...c08c5a9362
29
externals/libusb/CMakeLists.txt
vendored
29
externals/libusb/CMakeLists.txt
vendored
@ -4,6 +4,7 @@ if(MSVC)
|
||||
endif()
|
||||
|
||||
add_library(usb STATIC EXCLUDE_FROM_ALL
|
||||
libusb/libusb/core.c
|
||||
libusb/libusb/core.c
|
||||
libusb/libusb/descriptor.c
|
||||
libusb/libusb/hotplug.c
|
||||
@ -41,9 +42,10 @@ endif()
|
||||
|
||||
if(WIN32 OR CYGWIN)
|
||||
target_sources(usb PRIVATE
|
||||
libusb/libusb/os/threads_windows.c
|
||||
libusb/libusb/os/windows_winusb.c
|
||||
libusb/libusb/os/windows_usbdk.c
|
||||
libusb/libusb/os/windows_common.c
|
||||
libusb/libusb/os/windows_nt_common.c
|
||||
)
|
||||
set(OS_WINDOWS TRUE)
|
||||
elseif(APPLE)
|
||||
@ -52,12 +54,10 @@ elseif(APPLE)
|
||||
)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
find_library(SECURITY_LIBRARY Security)
|
||||
find_library(OBJC_LIBRARY objc)
|
||||
target_link_libraries(usb PRIVATE
|
||||
${COREFOUNDATION_LIBRARY}
|
||||
${IOKIT_LIBRARY}
|
||||
${SECURITY_LIBRARY}
|
||||
${OBJC_LIBRARY}
|
||||
)
|
||||
set(OS_DARWIN TRUE)
|
||||
@ -102,7 +102,7 @@ endif()
|
||||
|
||||
if(UNIX)
|
||||
target_sources(usb PRIVATE
|
||||
libusb/libusb/os/events_posix.c
|
||||
libusb/libusb/os/poll_posix.c
|
||||
libusb/libusb/os/threads_posix.c
|
||||
)
|
||||
find_package(Threads REQUIRED)
|
||||
@ -112,13 +112,12 @@ if(UNIX)
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
target_link_libraries(usb PRIVATE "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
set(PLATFORM_POSIX TRUE)
|
||||
set(THREADS_POSIX TRUE)
|
||||
elseif(WIN32)
|
||||
target_sources(usb PRIVATE
|
||||
libusb/libusb/os/events_windows.c
|
||||
libusb/libusb/os/poll_windows.c
|
||||
libusb/libusb/os/threads_windows.c
|
||||
)
|
||||
set(PLATFORM_WINDOWS TRUE)
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
@ -128,8 +127,7 @@ check_include_files(asm/types.h HAVE_ASM_TYPES_H)
|
||||
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
|
||||
check_include_files(linux/filter.h HAVE_LINUX_FILTER_H)
|
||||
check_include_files(linux/netlink.h HAVE_LINUX_NETLINK_H)
|
||||
check_function_exists(eventfd HAVE_EVENTFD)
|
||||
check_function_exists(timerfd_create HAVE_TIMERFD)
|
||||
check_include_files(poll.h HAVE_POLL_H)
|
||||
check_include_files(signal.h HAVE_SIGNAL_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_type_size("struct timespec" STRUCT_TIMESPEC)
|
||||
@ -138,6 +136,17 @@ check_include_files(syslog.h HAVE_SYSLOG_H)
|
||||
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
||||
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES poll.h)
|
||||
check_type_size("nfds_t" nfds_t)
|
||||
unset(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
if(HAVE_NFDS_T)
|
||||
set(POLL_NFDS_TYPE "nfds_t")
|
||||
else()
|
||||
set(POLL_NFDS_TYPE "unsigned int")
|
||||
endif()
|
||||
|
||||
check_include_files(sys/timerfd.h USBI_TIMERFD_AVAILABLE)
|
||||
|
||||
|
||||
configure_file(config.h.in config.h)
|
||||
|
21
externals/libusb/config.h.in
vendored
21
externals/libusb/config.h.in
vendored
@ -26,11 +26,8 @@
|
||||
/* Define to 1 if you have the <linux/netlink.h> header file. */
|
||||
#cmakedefine HAVE_LINUX_NETLINK_H 1
|
||||
|
||||
/* Define to 1 if you have eventfd support. */
|
||||
#cmakedefine HAVE_EVENTFD 1
|
||||
|
||||
/* Define to 1 if you have timerfd support. */
|
||||
#cmakedefine HAVE_TIMERFD 1
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
#cmakedefine HAVE_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#cmakedefine HAVE_SIGNAL_H 1
|
||||
@ -56,9 +53,6 @@
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the 'clock_gettime' function. */
|
||||
#cmakedefine HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Darwin backend */
|
||||
#cmakedefine OS_DARWIN 1
|
||||
|
||||
@ -74,11 +68,14 @@
|
||||
/* Windows backend */
|
||||
#cmakedefine OS_WINDOWS 1
|
||||
|
||||
/* Use POSIX Platform */
|
||||
#cmakedefine PLATFORM_POSIX
|
||||
/* type of second poll() argument */
|
||||
#define POLL_NFDS_TYPE @POLL_NFDS_TYPE@
|
||||
|
||||
/* Use Windows Platform */
|
||||
#cmakedefine PLATFORM_WINDOWS
|
||||
/* Use POSIX Threads */
|
||||
#cmakedefine THREADS_POSIX
|
||||
|
||||
/* timerfd headers available */
|
||||
#cmakedefine USBI_TIMERFD_AVAILABLE 1
|
||||
|
||||
/* Enable output to system log */
|
||||
#define USE_SYSTEM_LOGGING_FACILITY 1
|
||||
|
2
externals/libusb/libusb
vendored
2
externals/libusb/libusb
vendored
Submodule externals/libusb/libusb updated: 54350bd83f...e782eeb251
970
externals/nvapi/NvApiDriverSettings.c
vendored
Normal file
970
externals/nvapi/NvApiDriverSettings.c
vendored
Normal file
@ -0,0 +1,970 @@
|
||||
/***************************************************************************\
|
||||
|* *|
|
||||
|* Copyright NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This source code is subject to NVIDIA ownership rights under U.S. *|
|
||||
|* and international Copyright laws. Users and possessors of this *|
|
||||
|* source code are hereby granted a nonexclusive, royalty-free *|
|
||||
|* license to use this code in individual and commercial software. *|
|
||||
|* *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *|
|
||||
|* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *|
|
||||
|* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *|
|
||||
|* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *|
|
||||
|* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *|
|
||||
|* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *|
|
||||
|* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *|
|
||||
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *|
|
||||
|* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *|
|
||||
|* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *|
|
||||
|* CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. This source code is a "commercial item" *|
|
||||
|* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *|
|
||||
|* of "commercial computer software" and "commercial computer software *|
|
||||
|* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *|
|
||||
|* and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *|
|
||||
|* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *|
|
||||
|* source code with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this source code in individual and commercial software must *|
|
||||
|* include, in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
|* *|
|
||||
\***************************************************************************/
|
||||
|
||||
#include "NvApiDriverSettings.h"
|
||||
|
||||
EValues_OGL_AA_LINE_GAMMA g_valuesOGL_AA_LINE_GAMMA[OGL_AA_LINE_GAMMA_NUM_VALUES] =
|
||||
{
|
||||
OGL_AA_LINE_GAMMA_DISABLED,
|
||||
OGL_AA_LINE_GAMMA_ENABLED,
|
||||
OGL_AA_LINE_GAMMA_MIN,
|
||||
OGL_AA_LINE_GAMMA_MAX,
|
||||
};
|
||||
|
||||
EValues_OGL_CPL_GDI_COMPATIBILITY g_valuesOGL_CPL_GDI_COMPATIBILITY[OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES] =
|
||||
{
|
||||
OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED,
|
||||
OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED,
|
||||
OGL_CPL_GDI_COMPATIBILITY_AUTO,
|
||||
};
|
||||
|
||||
EValues_OGL_CPL_PREFER_DXPRESENT g_valuesOGL_CPL_PREFER_DXPRESENT[OGL_CPL_PREFER_DXPRESENT_NUM_VALUES] =
|
||||
{
|
||||
OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED,
|
||||
OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED,
|
||||
OGL_CPL_PREFER_DXPRESENT_AUTO,
|
||||
};
|
||||
|
||||
EValues_OGL_DEEP_COLOR_SCANOUT g_valuesOGL_DEEP_COLOR_SCANOUT[OGL_DEEP_COLOR_SCANOUT_NUM_VALUES] =
|
||||
{
|
||||
OGL_DEEP_COLOR_SCANOUT_DISABLE,
|
||||
OGL_DEEP_COLOR_SCANOUT_ENABLE,
|
||||
};
|
||||
|
||||
EValues_OGL_DEFAULT_SWAP_INTERVAL g_valuesOGL_DEFAULT_SWAP_INTERVAL[OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES] =
|
||||
{
|
||||
OGL_DEFAULT_SWAP_INTERVAL_TEAR,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_VSYNC,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_DISABLE,
|
||||
};
|
||||
|
||||
EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL[OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES] =
|
||||
{
|
||||
OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES,
|
||||
};
|
||||
|
||||
EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN[OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES] =
|
||||
{
|
||||
OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE,
|
||||
OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE,
|
||||
};
|
||||
|
||||
EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD[OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES] =
|
||||
{
|
||||
OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE,
|
||||
OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL,
|
||||
OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING,
|
||||
OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION,
|
||||
OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL,
|
||||
};
|
||||
|
||||
EValues_OGL_FORCE_BLIT g_valuesOGL_FORCE_BLIT[OGL_FORCE_BLIT_NUM_VALUES] =
|
||||
{
|
||||
OGL_FORCE_BLIT_ON,
|
||||
OGL_FORCE_BLIT_OFF,
|
||||
};
|
||||
|
||||
EValues_OGL_FORCE_STEREO g_valuesOGL_FORCE_STEREO[OGL_FORCE_STEREO_NUM_VALUES] =
|
||||
{
|
||||
OGL_FORCE_STEREO_OFF,
|
||||
OGL_FORCE_STEREO_ON,
|
||||
};
|
||||
|
||||
const wchar_t * g_valuesOGL_IMPLICIT_GPU_AFFINITY[OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES] =
|
||||
{
|
||||
OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT
|
||||
};
|
||||
|
||||
EValues_OGL_OVERLAY_PIXEL_TYPE g_valuesOGL_OVERLAY_PIXEL_TYPE[OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES] =
|
||||
{
|
||||
OGL_OVERLAY_PIXEL_TYPE_NONE,
|
||||
OGL_OVERLAY_PIXEL_TYPE_CI,
|
||||
OGL_OVERLAY_PIXEL_TYPE_RGBA,
|
||||
OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA,
|
||||
};
|
||||
|
||||
EValues_OGL_OVERLAY_SUPPORT g_valuesOGL_OVERLAY_SUPPORT[OGL_OVERLAY_SUPPORT_NUM_VALUES] =
|
||||
{
|
||||
OGL_OVERLAY_SUPPORT_OFF,
|
||||
OGL_OVERLAY_SUPPORT_ON,
|
||||
OGL_OVERLAY_SUPPORT_FORCE_SW,
|
||||
};
|
||||
|
||||
EValues_OGL_QUALITY_ENHANCEMENTS g_valuesOGL_QUALITY_ENHANCEMENTS[OGL_QUALITY_ENHANCEMENTS_NUM_VALUES] =
|
||||
{
|
||||
OGL_QUALITY_ENHANCEMENTS_HQUAL,
|
||||
OGL_QUALITY_ENHANCEMENTS_QUAL,
|
||||
OGL_QUALITY_ENHANCEMENTS_PERF,
|
||||
OGL_QUALITY_ENHANCEMENTS_HPERF,
|
||||
};
|
||||
|
||||
EValues_OGL_SINGLE_BACKDEPTH_BUFFER g_valuesOGL_SINGLE_BACKDEPTH_BUFFER[OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES] =
|
||||
{
|
||||
OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE,
|
||||
OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE,
|
||||
OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT,
|
||||
};
|
||||
|
||||
EValues_OGL_SLI_CFR_MODE g_valuesOGL_SLI_CFR_MODE[OGL_SLI_CFR_MODE_NUM_VALUES] =
|
||||
{
|
||||
OGL_SLI_CFR_MODE_DISABLE,
|
||||
OGL_SLI_CFR_MODE_ENABLE,
|
||||
OGL_SLI_CFR_MODE_CLASSIC_SFR,
|
||||
};
|
||||
|
||||
EValues_OGL_SLI_MULTICAST g_valuesOGL_SLI_MULTICAST[OGL_SLI_MULTICAST_NUM_VALUES] =
|
||||
{
|
||||
OGL_SLI_MULTICAST_DISABLE,
|
||||
OGL_SLI_MULTICAST_ENABLE,
|
||||
OGL_SLI_MULTICAST_FORCE_DISABLE,
|
||||
OGL_SLI_MULTICAST_ALLOW_MOSAIC,
|
||||
};
|
||||
|
||||
EValues_OGL_THREAD_CONTROL g_valuesOGL_THREAD_CONTROL[OGL_THREAD_CONTROL_NUM_VALUES] =
|
||||
{
|
||||
OGL_THREAD_CONTROL_ENABLE,
|
||||
OGL_THREAD_CONTROL_DISABLE,
|
||||
};
|
||||
|
||||
EValues_OGL_TMON_LEVEL g_valuesOGL_TMON_LEVEL[OGL_TMON_LEVEL_NUM_VALUES] =
|
||||
{
|
||||
OGL_TMON_LEVEL_DISABLE,
|
||||
OGL_TMON_LEVEL_CRITICAL,
|
||||
OGL_TMON_LEVEL_WARNING,
|
||||
OGL_TMON_LEVEL_INFORMATION,
|
||||
OGL_TMON_LEVEL_MOST,
|
||||
OGL_TMON_LEVEL_VERBOSE,
|
||||
};
|
||||
|
||||
EValues_OGL_TRIPLE_BUFFER g_valuesOGL_TRIPLE_BUFFER[OGL_TRIPLE_BUFFER_NUM_VALUES] =
|
||||
{
|
||||
OGL_TRIPLE_BUFFER_DISABLED,
|
||||
OGL_TRIPLE_BUFFER_ENABLED,
|
||||
};
|
||||
|
||||
EValues_AA_BEHAVIOR_FLAGS g_valuesAA_BEHAVIOR_FLAGS[AA_BEHAVIOR_FLAGS_NUM_VALUES] =
|
||||
{
|
||||
AA_BEHAVIOR_FLAGS_NONE,
|
||||
AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED,
|
||||
AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE,
|
||||
AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE,
|
||||
AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED,
|
||||
AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE,
|
||||
AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE,
|
||||
AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING,
|
||||
AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING,
|
||||
AA_BEHAVIOR_FLAGS_DISABLE_CPLAA,
|
||||
AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE,
|
||||
AA_BEHAVIOR_FLAGS_DISABLE_SLIAA,
|
||||
AA_BEHAVIOR_FLAGS_DEFAULT,
|
||||
AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4,
|
||||
AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT,
|
||||
AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4,
|
||||
AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT,
|
||||
AA_BEHAVIOR_FLAGS_MASK,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_ALPHATOCOVERAGE g_valuesAA_MODE_ALPHATOCOVERAGE[AA_MODE_ALPHATOCOVERAGE_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_ALPHATOCOVERAGE_MODE_MASK,
|
||||
AA_MODE_ALPHATOCOVERAGE_MODE_OFF,
|
||||
AA_MODE_ALPHATOCOVERAGE_MODE_ON,
|
||||
AA_MODE_ALPHATOCOVERAGE_MODE_MAX,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_GAMMACORRECTION g_valuesAA_MODE_GAMMACORRECTION[AA_MODE_GAMMACORRECTION_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_GAMMACORRECTION_MASK,
|
||||
AA_MODE_GAMMACORRECTION_OFF,
|
||||
AA_MODE_GAMMACORRECTION_ON_IF_FOS,
|
||||
AA_MODE_GAMMACORRECTION_ON_ALWAYS,
|
||||
AA_MODE_GAMMACORRECTION_MAX,
|
||||
AA_MODE_GAMMACORRECTION_DEFAULT,
|
||||
AA_MODE_GAMMACORRECTION_DEFAULT_TESLA,
|
||||
AA_MODE_GAMMACORRECTION_DEFAULT_FERMI,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_METHOD g_valuesAA_MODE_METHOD[AA_MODE_METHOD_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_METHOD_NONE,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_2X_H,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_2X_V,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5,
|
||||
AA_MODE_METHOD_FREE_0x03,
|
||||
AA_MODE_METHOD_FREE_0x04,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_4X,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN,
|
||||
AA_MODE_METHOD_FREE_0x08,
|
||||
AA_MODE_METHOD_FREE_0x09,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_9X,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_16X,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS,
|
||||
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL,
|
||||
AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX,
|
||||
AA_MODE_METHOD_MULTISAMPLE_4X,
|
||||
AA_MODE_METHOD_FREE_0x11,
|
||||
AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP,
|
||||
AA_MODE_METHOD_FREE_0x14,
|
||||
AA_MODE_METHOD_FREE_0x15,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_6X,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_8X,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_16X,
|
||||
AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA,
|
||||
AA_MODE_METHOD_MULTISAMPLE_16X,
|
||||
AA_MODE_METHOD_VCAA_32X_8v24,
|
||||
AA_MODE_METHOD_CORRUPTION_CHECK,
|
||||
AA_MODE_METHOD_6X_CT,
|
||||
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA,
|
||||
AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA,
|
||||
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA,
|
||||
AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA,
|
||||
AA_MODE_METHOD_MULTISAMPLE_8X,
|
||||
AA_MODE_METHOD_VCAA_8X_4v4,
|
||||
AA_MODE_METHOD_VCAA_16X_4v12,
|
||||
AA_MODE_METHOD_VCAA_16X_8v8,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_32X,
|
||||
AA_MODE_METHOD_SUPERVCAA_64X_4v12,
|
||||
AA_MODE_METHOD_SUPERVCAA_64X_8v8,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_64X,
|
||||
AA_MODE_METHOD_MIXEDSAMPLE_128X,
|
||||
AA_MODE_METHOD_COUNT,
|
||||
AA_MODE_METHOD_METHOD_MASK,
|
||||
AA_MODE_METHOD_METHOD_MAX,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_REPLAY g_valuesAA_MODE_REPLAY[AA_MODE_REPLAY_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_REPLAY_SAMPLES_MASK,
|
||||
AA_MODE_REPLAY_SAMPLES_ONE,
|
||||
AA_MODE_REPLAY_SAMPLES_TWO,
|
||||
AA_MODE_REPLAY_SAMPLES_FOUR,
|
||||
AA_MODE_REPLAY_SAMPLES_EIGHT,
|
||||
AA_MODE_REPLAY_SAMPLES_MAX,
|
||||
AA_MODE_REPLAY_MODE_MASK,
|
||||
AA_MODE_REPLAY_MODE_OFF,
|
||||
AA_MODE_REPLAY_MODE_ALPHA_TEST,
|
||||
AA_MODE_REPLAY_MODE_PIXEL_KILL,
|
||||
AA_MODE_REPLAY_MODE_DYN_BRANCH,
|
||||
AA_MODE_REPLAY_MODE_OPTIMAL,
|
||||
AA_MODE_REPLAY_MODE_ALL,
|
||||
AA_MODE_REPLAY_MODE_MAX,
|
||||
AA_MODE_REPLAY_TRANSPARENCY,
|
||||
AA_MODE_REPLAY_DISALLOW_TRAA,
|
||||
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT,
|
||||
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA,
|
||||
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI,
|
||||
AA_MODE_REPLAY_MASK,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_SELECTOR g_valuesAA_MODE_SELECTOR[AA_MODE_SELECTOR_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_SELECTOR_MASK,
|
||||
AA_MODE_SELECTOR_APP_CONTROL,
|
||||
AA_MODE_SELECTOR_OVERRIDE,
|
||||
AA_MODE_SELECTOR_ENHANCE,
|
||||
AA_MODE_SELECTOR_MAX,
|
||||
};
|
||||
|
||||
EValues_AA_MODE_SELECTOR_SLIAA g_valuesAA_MODE_SELECTOR_SLIAA[AA_MODE_SELECTOR_SLIAA_NUM_VALUES] =
|
||||
{
|
||||
AA_MODE_SELECTOR_SLIAA_DISABLED,
|
||||
AA_MODE_SELECTOR_SLIAA_ENABLED,
|
||||
};
|
||||
|
||||
EValues_ANISO_MODE_LEVEL g_valuesANISO_MODE_LEVEL[ANISO_MODE_LEVEL_NUM_VALUES] =
|
||||
{
|
||||
ANISO_MODE_LEVEL_MASK,
|
||||
ANISO_MODE_LEVEL_NONE_POINT,
|
||||
ANISO_MODE_LEVEL_NONE_LINEAR,
|
||||
ANISO_MODE_LEVEL_MAX,
|
||||
ANISO_MODE_LEVEL_DEFAULT,
|
||||
};
|
||||
|
||||
EValues_ANISO_MODE_SELECTOR g_valuesANISO_MODE_SELECTOR[ANISO_MODE_SELECTOR_NUM_VALUES] =
|
||||
{
|
||||
ANISO_MODE_SELECTOR_MASK,
|
||||
ANISO_MODE_SELECTOR_APP,
|
||||
ANISO_MODE_SELECTOR_USER,
|
||||
ANISO_MODE_SELECTOR_COND,
|
||||
ANISO_MODE_SELECTOR_MAX,
|
||||
ANISO_MODE_SELECTOR_DEFAULT,
|
||||
};
|
||||
|
||||
EValues_ANSEL_ALLOW g_valuesANSEL_ALLOW[ANSEL_ALLOW_NUM_VALUES] =
|
||||
{
|
||||
ANSEL_ALLOW_DISALLOWED,
|
||||
ANSEL_ALLOW_ALLOWED,
|
||||
};
|
||||
|
||||
EValues_ANSEL_ALLOWLISTED g_valuesANSEL_ALLOWLISTED[ANSEL_ALLOWLISTED_NUM_VALUES] =
|
||||
{
|
||||
ANSEL_ALLOWLISTED_DISALLOWED,
|
||||
ANSEL_ALLOWLISTED_ALLOWED,
|
||||
};
|
||||
|
||||
EValues_ANSEL_ENABLE g_valuesANSEL_ENABLE[ANSEL_ENABLE_NUM_VALUES] =
|
||||
{
|
||||
ANSEL_ENABLE_OFF,
|
||||
ANSEL_ENABLE_ON,
|
||||
};
|
||||
|
||||
EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT[APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES] =
|
||||
{
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED,
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS,
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS,
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS,
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE,
|
||||
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES,
|
||||
};
|
||||
|
||||
EValues_BATTERY_BOOST_APP_FPS g_valuesBATTERY_BOOST_APP_FPS[BATTERY_BOOST_APP_FPS_NUM_VALUES] =
|
||||
{
|
||||
BATTERY_BOOST_APP_FPS_MIN,
|
||||
BATTERY_BOOST_APP_FPS_MAX,
|
||||
BATTERY_BOOST_APP_FPS_NO_OVERRIDE,
|
||||
};
|
||||
|
||||
EValues_CPL_HIDDEN_PROFILE g_valuesCPL_HIDDEN_PROFILE[CPL_HIDDEN_PROFILE_NUM_VALUES] =
|
||||
{
|
||||
CPL_HIDDEN_PROFILE_DISABLED,
|
||||
CPL_HIDDEN_PROFILE_ENABLED,
|
||||
};
|
||||
|
||||
const wchar_t * g_valuesCUDA_EXCLUDED_GPUS[CUDA_EXCLUDED_GPUS_NUM_VALUES] =
|
||||
{
|
||||
CUDA_EXCLUDED_GPUS_NONE
|
||||
};
|
||||
|
||||
const wchar_t * g_valuesD3DOGL_GPU_MAX_POWER[D3DOGL_GPU_MAX_POWER_NUM_VALUES] =
|
||||
{
|
||||
D3DOGL_GPU_MAX_POWER_DEFAULTPOWER
|
||||
};
|
||||
|
||||
EValues_EXPORT_PERF_COUNTERS g_valuesEXPORT_PERF_COUNTERS[EXPORT_PERF_COUNTERS_NUM_VALUES] =
|
||||
{
|
||||
EXPORT_PERF_COUNTERS_OFF,
|
||||
EXPORT_PERF_COUNTERS_ON,
|
||||
};
|
||||
|
||||
EValues_EXTERNAL_QUIET_MODE g_valuesEXTERNAL_QUIET_MODE[EXTERNAL_QUIET_MODE_NUM_VALUES] =
|
||||
{
|
||||
EXTERNAL_QUIET_MODE_ON,
|
||||
EXTERNAL_QUIET_MODE_OFF,
|
||||
};
|
||||
|
||||
EValues_FRL_FPS g_valuesFRL_FPS[FRL_FPS_NUM_VALUES] =
|
||||
{
|
||||
FRL_FPS_DISABLED,
|
||||
FRL_FPS_MIN,
|
||||
FRL_FPS_MAX,
|
||||
};
|
||||
|
||||
EValues_FXAA_ALLOW g_valuesFXAA_ALLOW[FXAA_ALLOW_NUM_VALUES] =
|
||||
{
|
||||
FXAA_ALLOW_DISALLOWED,
|
||||
FXAA_ALLOW_ALLOWED,
|
||||
};
|
||||
|
||||
EValues_FXAA_ENABLE g_valuesFXAA_ENABLE[FXAA_ENABLE_NUM_VALUES] =
|
||||
{
|
||||
FXAA_ENABLE_OFF,
|
||||
FXAA_ENABLE_ON,
|
||||
};
|
||||
|
||||
EValues_FXAA_INDICATOR_ENABLE g_valuesFXAA_INDICATOR_ENABLE[FXAA_INDICATOR_ENABLE_NUM_VALUES] =
|
||||
{
|
||||
FXAA_INDICATOR_ENABLE_OFF,
|
||||
FXAA_INDICATOR_ENABLE_ON,
|
||||
};
|
||||
|
||||
EValues_LATENCY_INDICATOR_AUTOALIGN g_valuesLATENCY_INDICATOR_AUTOALIGN[LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES] =
|
||||
{
|
||||
LATENCY_INDICATOR_AUTOALIGN_DISABLED,
|
||||
LATENCY_INDICATOR_AUTOALIGN_ENABLED,
|
||||
};
|
||||
|
||||
EValues_MCSFRSHOWSPLIT g_valuesMCSFRSHOWSPLIT[MCSFRSHOWSPLIT_NUM_VALUES] =
|
||||
{
|
||||
MCSFRSHOWSPLIT_DISABLED,
|
||||
MCSFRSHOWSPLIT_ENABLED,
|
||||
};
|
||||
|
||||
EValues_NV_QUALITY_UPSCALING g_valuesNV_QUALITY_UPSCALING[NV_QUALITY_UPSCALING_NUM_VALUES] =
|
||||
{
|
||||
NV_QUALITY_UPSCALING_OFF,
|
||||
NV_QUALITY_UPSCALING_ON,
|
||||
};
|
||||
|
||||
EValues_OPTIMUS_MAXAA g_valuesOPTIMUS_MAXAA[OPTIMUS_MAXAA_NUM_VALUES] =
|
||||
{
|
||||
OPTIMUS_MAXAA_MIN,
|
||||
OPTIMUS_MAXAA_MAX,
|
||||
};
|
||||
|
||||
EValues_PHYSXINDICATOR g_valuesPHYSXINDICATOR[PHYSXINDICATOR_NUM_VALUES] =
|
||||
{
|
||||
PHYSXINDICATOR_DISABLED,
|
||||
PHYSXINDICATOR_ENABLED,
|
||||
};
|
||||
|
||||
EValues_PREFERRED_PSTATE g_valuesPREFERRED_PSTATE[PREFERRED_PSTATE_NUM_VALUES] =
|
||||
{
|
||||
PREFERRED_PSTATE_ADAPTIVE,
|
||||
PREFERRED_PSTATE_PREFER_MAX,
|
||||
PREFERRED_PSTATE_DRIVER_CONTROLLED,
|
||||
PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE,
|
||||
PREFERRED_PSTATE_PREFER_MIN,
|
||||
PREFERRED_PSTATE_OPTIMAL_POWER,
|
||||
PREFERRED_PSTATE_MIN,
|
||||
PREFERRED_PSTATE_MAX,
|
||||
};
|
||||
|
||||
EValues_PREVENT_UI_AF_OVERRIDE g_valuesPREVENT_UI_AF_OVERRIDE[PREVENT_UI_AF_OVERRIDE_NUM_VALUES] =
|
||||
{
|
||||
PREVENT_UI_AF_OVERRIDE_OFF,
|
||||
PREVENT_UI_AF_OVERRIDE_ON,
|
||||
};
|
||||
|
||||
EValues_SHIM_MCCOMPAT g_valuesSHIM_MCCOMPAT[SHIM_MCCOMPAT_NUM_VALUES] =
|
||||
{
|
||||
SHIM_MCCOMPAT_INTEGRATED,
|
||||
SHIM_MCCOMPAT_ENABLE,
|
||||
SHIM_MCCOMPAT_USER_EDITABLE,
|
||||
SHIM_MCCOMPAT_MASK,
|
||||
SHIM_MCCOMPAT_VIDEO_MASK,
|
||||
SHIM_MCCOMPAT_VARYING_BIT,
|
||||
SHIM_MCCOMPAT_AUTO_SELECT,
|
||||
SHIM_MCCOMPAT_OVERRIDE_BIT,
|
||||
};
|
||||
|
||||
EValues_SHIM_RENDERING_MODE g_valuesSHIM_RENDERING_MODE[SHIM_RENDERING_MODE_NUM_VALUES] =
|
||||
{
|
||||
SHIM_RENDERING_MODE_INTEGRATED,
|
||||
SHIM_RENDERING_MODE_ENABLE,
|
||||
SHIM_RENDERING_MODE_USER_EDITABLE,
|
||||
SHIM_RENDERING_MODE_MASK,
|
||||
SHIM_RENDERING_MODE_VIDEO_MASK,
|
||||
SHIM_RENDERING_MODE_VARYING_BIT,
|
||||
SHIM_RENDERING_MODE_AUTO_SELECT,
|
||||
SHIM_RENDERING_MODE_OVERRIDE_BIT,
|
||||
};
|
||||
|
||||
EValues_SHIM_RENDERING_OPTIONS g_valuesSHIM_RENDERING_OPTIONS[SHIM_RENDERING_OPTIONS_NUM_VALUES] =
|
||||
{
|
||||
SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT,
|
||||
SHIM_RENDERING_OPTIONS_EHSHELL_DETECT,
|
||||
SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT,
|
||||
SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT,
|
||||
SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES,
|
||||
SHIM_RENDERING_OPTIONS_RESERVED1,
|
||||
SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT,
|
||||
SHIM_RENDERING_OPTIONS_RESERVED2,
|
||||
SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS,
|
||||
SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS,
|
||||
SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT,
|
||||
SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_CUDA,
|
||||
SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO,
|
||||
SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT,
|
||||
SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO,
|
||||
SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID,
|
||||
SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD,
|
||||
SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT,
|
||||
SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG,
|
||||
SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP,
|
||||
SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH,
|
||||
SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH,
|
||||
SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY,
|
||||
};
|
||||
|
||||
EValues_SLI_GPU_COUNT g_valuesSLI_GPU_COUNT[SLI_GPU_COUNT_NUM_VALUES] =
|
||||
{
|
||||
SLI_GPU_COUNT_AUTOSELECT,
|
||||
SLI_GPU_COUNT_ONE,
|
||||
SLI_GPU_COUNT_TWO,
|
||||
SLI_GPU_COUNT_THREE,
|
||||
SLI_GPU_COUNT_FOUR,
|
||||
};
|
||||
|
||||
EValues_SLI_PREDEFINED_GPU_COUNT g_valuesSLI_PREDEFINED_GPU_COUNT[SLI_PREDEFINED_GPU_COUNT_NUM_VALUES] =
|
||||
{
|
||||
SLI_PREDEFINED_GPU_COUNT_AUTOSELECT,
|
||||
SLI_PREDEFINED_GPU_COUNT_ONE,
|
||||
SLI_PREDEFINED_GPU_COUNT_TWO,
|
||||
SLI_PREDEFINED_GPU_COUNT_THREE,
|
||||
SLI_PREDEFINED_GPU_COUNT_FOUR,
|
||||
};
|
||||
|
||||
EValues_SLI_PREDEFINED_GPU_COUNT_DX10 g_valuesSLI_PREDEFINED_GPU_COUNT_DX10[SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES] =
|
||||
{
|
||||
SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT,
|
||||
SLI_PREDEFINED_GPU_COUNT_DX10_ONE,
|
||||
SLI_PREDEFINED_GPU_COUNT_DX10_TWO,
|
||||
SLI_PREDEFINED_GPU_COUNT_DX10_THREE,
|
||||
SLI_PREDEFINED_GPU_COUNT_DX10_FOUR,
|
||||
};
|
||||
|
||||
EValues_SLI_PREDEFINED_MODE g_valuesSLI_PREDEFINED_MODE[SLI_PREDEFINED_MODE_NUM_VALUES] =
|
||||
{
|
||||
SLI_PREDEFINED_MODE_AUTOSELECT,
|
||||
SLI_PREDEFINED_MODE_FORCE_SINGLE,
|
||||
SLI_PREDEFINED_MODE_FORCE_AFR,
|
||||
SLI_PREDEFINED_MODE_FORCE_AFR2,
|
||||
SLI_PREDEFINED_MODE_FORCE_SFR,
|
||||
SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
|
||||
};
|
||||
|
||||
EValues_SLI_PREDEFINED_MODE_DX10 g_valuesSLI_PREDEFINED_MODE_DX10[SLI_PREDEFINED_MODE_DX10_NUM_VALUES] =
|
||||
{
|
||||
SLI_PREDEFINED_MODE_DX10_AUTOSELECT,
|
||||
SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE,
|
||||
SLI_PREDEFINED_MODE_DX10_FORCE_AFR,
|
||||
SLI_PREDEFINED_MODE_DX10_FORCE_AFR2,
|
||||
SLI_PREDEFINED_MODE_DX10_FORCE_SFR,
|
||||
SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
|
||||
};
|
||||
|
||||
EValues_SLI_RENDERING_MODE g_valuesSLI_RENDERING_MODE[SLI_RENDERING_MODE_NUM_VALUES] =
|
||||
{
|
||||
SLI_RENDERING_MODE_AUTOSELECT,
|
||||
SLI_RENDERING_MODE_FORCE_SINGLE,
|
||||
SLI_RENDERING_MODE_FORCE_AFR,
|
||||
SLI_RENDERING_MODE_FORCE_AFR2,
|
||||
SLI_RENDERING_MODE_FORCE_SFR,
|
||||
SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
|
||||
};
|
||||
|
||||
EValues_VRPRERENDERLIMIT g_valuesVRPRERENDERLIMIT[VRPRERENDERLIMIT_NUM_VALUES] =
|
||||
{
|
||||
VRPRERENDERLIMIT_MIN,
|
||||
VRPRERENDERLIMIT_MAX,
|
||||
VRPRERENDERLIMIT_APP_CONTROLLED,
|
||||
VRPRERENDERLIMIT_DEFAULT,
|
||||
};
|
||||
|
||||
EValues_VRRFEATUREINDICATOR g_valuesVRRFEATUREINDICATOR[VRRFEATUREINDICATOR_NUM_VALUES] =
|
||||
{
|
||||
VRRFEATUREINDICATOR_DISABLED,
|
||||
VRRFEATUREINDICATOR_ENABLED,
|
||||
};
|
||||
|
||||
EValues_VRROVERLAYINDICATOR g_valuesVRROVERLAYINDICATOR[VRROVERLAYINDICATOR_NUM_VALUES] =
|
||||
{
|
||||
VRROVERLAYINDICATOR_DISABLED,
|
||||
VRROVERLAYINDICATOR_ENABLED,
|
||||
};
|
||||
|
||||
EValues_VRRREQUESTSTATE g_valuesVRRREQUESTSTATE[VRRREQUESTSTATE_NUM_VALUES] =
|
||||
{
|
||||
VRRREQUESTSTATE_DISABLED,
|
||||
VRRREQUESTSTATE_FULLSCREEN_ONLY,
|
||||
VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED,
|
||||
};
|
||||
|
||||
EValues_VRR_APP_OVERRIDE g_valuesVRR_APP_OVERRIDE[VRR_APP_OVERRIDE_NUM_VALUES] =
|
||||
{
|
||||
VRR_APP_OVERRIDE_ALLOW,
|
||||
VRR_APP_OVERRIDE_FORCE_OFF,
|
||||
VRR_APP_OVERRIDE_DISALLOW,
|
||||
VRR_APP_OVERRIDE_ULMB,
|
||||
VRR_APP_OVERRIDE_FIXED_REFRESH,
|
||||
};
|
||||
|
||||
EValues_VRR_APP_OVERRIDE_REQUEST_STATE g_valuesVRR_APP_OVERRIDE_REQUEST_STATE[VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES] =
|
||||
{
|
||||
VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW,
|
||||
VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF,
|
||||
VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW,
|
||||
VRR_APP_OVERRIDE_REQUEST_STATE_ULMB,
|
||||
VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH,
|
||||
};
|
||||
|
||||
EValues_VRR_MODE g_valuesVRR_MODE[VRR_MODE_NUM_VALUES] =
|
||||
{
|
||||
VRR_MODE_DISABLED,
|
||||
VRR_MODE_FULLSCREEN_ONLY,
|
||||
VRR_MODE_FULLSCREEN_AND_WINDOWED,
|
||||
};
|
||||
|
||||
EValues_VSYNCSMOOTHAFR g_valuesVSYNCSMOOTHAFR[VSYNCSMOOTHAFR_NUM_VALUES] =
|
||||
{
|
||||
VSYNCSMOOTHAFR_OFF,
|
||||
VSYNCSMOOTHAFR_ON,
|
||||
};
|
||||
|
||||
EValues_VSYNCVRRCONTROL g_valuesVSYNCVRRCONTROL[VSYNCVRRCONTROL_NUM_VALUES] =
|
||||
{
|
||||
VSYNCVRRCONTROL_DISABLE,
|
||||
VSYNCVRRCONTROL_ENABLE,
|
||||
VSYNCVRRCONTROL_NOTSUPPORTED,
|
||||
};
|
||||
|
||||
EValues_VSYNC_BEHAVIOR_FLAGS g_valuesVSYNC_BEHAVIOR_FLAGS[VSYNC_BEHAVIOR_FLAGS_NUM_VALUES] =
|
||||
{
|
||||
VSYNC_BEHAVIOR_FLAGS_NONE,
|
||||
VSYNC_BEHAVIOR_FLAGS_DEFAULT,
|
||||
VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE,
|
||||
};
|
||||
|
||||
EValues_WKS_API_STEREO_EYES_EXCHANGE g_valuesWKS_API_STEREO_EYES_EXCHANGE[WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES] =
|
||||
{
|
||||
WKS_API_STEREO_EYES_EXCHANGE_OFF,
|
||||
WKS_API_STEREO_EYES_EXCHANGE_ON,
|
||||
};
|
||||
|
||||
EValues_WKS_API_STEREO_MODE g_valuesWKS_API_STEREO_MODE[WKS_API_STEREO_MODE_NUM_VALUES] =
|
||||
{
|
||||
WKS_API_STEREO_MODE_SHUTTER_GLASSES,
|
||||
WKS_API_STEREO_MODE_VERTICAL_INTERLACED,
|
||||
WKS_API_STEREO_MODE_TWINVIEW,
|
||||
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO,
|
||||
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0,
|
||||
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1,
|
||||
WKS_API_STEREO_MODE_COLOR_LINE,
|
||||
WKS_API_STEREO_MODE_COLOR_INTERLEAVED,
|
||||
WKS_API_STEREO_MODE_ANAGLYPH,
|
||||
WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED,
|
||||
WKS_API_STEREO_MODE_SIDE_FIELD,
|
||||
WKS_API_STEREO_MODE_SUB_FIELD,
|
||||
WKS_API_STEREO_MODE_CHECKERBOARD,
|
||||
WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD,
|
||||
WKS_API_STEREO_MODE_TRIDELITY_SL,
|
||||
WKS_API_STEREO_MODE_TRIDELITY_MV,
|
||||
WKS_API_STEREO_MODE_SEEFRONT,
|
||||
WKS_API_STEREO_MODE_STEREO_MIRROR,
|
||||
WKS_API_STEREO_MODE_FRAME_SEQUENTIAL,
|
||||
WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE,
|
||||
WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL,
|
||||
WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL,
|
||||
WKS_API_STEREO_MODE_DP_INBAND,
|
||||
WKS_API_STEREO_MODE_USE_HW_DEFAULT,
|
||||
WKS_API_STEREO_MODE_DEFAULT_GL,
|
||||
};
|
||||
|
||||
EValues_WKS_MEMORY_ALLOCATION_POLICY g_valuesWKS_MEMORY_ALLOCATION_POLICY[WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES] =
|
||||
{
|
||||
WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED,
|
||||
WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION,
|
||||
WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION,
|
||||
};
|
||||
|
||||
EValues_WKS_STEREO_DONGLE_SUPPORT g_valuesWKS_STEREO_DONGLE_SUPPORT[WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES] =
|
||||
{
|
||||
WKS_STEREO_DONGLE_SUPPORT_OFF,
|
||||
WKS_STEREO_DONGLE_SUPPORT_DAC,
|
||||
WKS_STEREO_DONGLE_SUPPORT_DLP,
|
||||
};
|
||||
|
||||
EValues_WKS_STEREO_SUPPORT g_valuesWKS_STEREO_SUPPORT[WKS_STEREO_SUPPORT_NUM_VALUES] =
|
||||
{
|
||||
WKS_STEREO_SUPPORT_OFF,
|
||||
WKS_STEREO_SUPPORT_ON,
|
||||
};
|
||||
|
||||
EValues_WKS_STEREO_SWAP_MODE g_valuesWKS_STEREO_SWAP_MODE[WKS_STEREO_SWAP_MODE_NUM_VALUES] =
|
||||
{
|
||||
WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL,
|
||||
WKS_STEREO_SWAP_MODE_PER_EYE,
|
||||
WKS_STEREO_SWAP_MODE_PER_EYE_PAIR,
|
||||
WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR,
|
||||
WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP,
|
||||
};
|
||||
|
||||
EValues_AO_MODE g_valuesAO_MODE[AO_MODE_NUM_VALUES] =
|
||||
{
|
||||
AO_MODE_OFF,
|
||||
AO_MODE_LOW,
|
||||
AO_MODE_MEDIUM,
|
||||
AO_MODE_HIGH,
|
||||
};
|
||||
|
||||
EValues_AO_MODE_ACTIVE g_valuesAO_MODE_ACTIVE[AO_MODE_ACTIVE_NUM_VALUES] =
|
||||
{
|
||||
AO_MODE_ACTIVE_DISABLED,
|
||||
AO_MODE_ACTIVE_ENABLED,
|
||||
};
|
||||
|
||||
EValues_AUTO_LODBIASADJUST g_valuesAUTO_LODBIASADJUST[AUTO_LODBIASADJUST_NUM_VALUES] =
|
||||
{
|
||||
AUTO_LODBIASADJUST_OFF,
|
||||
AUTO_LODBIASADJUST_ON,
|
||||
};
|
||||
|
||||
EValues_EXPORT_PERF_COUNTERS_DX9_ONLY g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY[EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES] =
|
||||
{
|
||||
EXPORT_PERF_COUNTERS_DX9_ONLY_OFF,
|
||||
EXPORT_PERF_COUNTERS_DX9_ONLY_ON,
|
||||
};
|
||||
|
||||
EValues_LODBIASADJUST g_valuesLODBIASADJUST[LODBIASADJUST_NUM_VALUES] =
|
||||
{
|
||||
LODBIASADJUST_MIN,
|
||||
LODBIASADJUST_MAX,
|
||||
};
|
||||
|
||||
EValues_MAXWELL_B_SAMPLE_INTERLEAVE g_valuesMAXWELL_B_SAMPLE_INTERLEAVE[MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES] =
|
||||
{
|
||||
MAXWELL_B_SAMPLE_INTERLEAVE_OFF,
|
||||
MAXWELL_B_SAMPLE_INTERLEAVE_ON,
|
||||
};
|
||||
|
||||
EValues_PRERENDERLIMIT g_valuesPRERENDERLIMIT[PRERENDERLIMIT_NUM_VALUES] =
|
||||
{
|
||||
PRERENDERLIMIT_MIN,
|
||||
PRERENDERLIMIT_MAX,
|
||||
PRERENDERLIMIT_APP_CONTROLLED,
|
||||
};
|
||||
|
||||
EValues_PS_SHADERDISKCACHE g_valuesPS_SHADERDISKCACHE[PS_SHADERDISKCACHE_NUM_VALUES] =
|
||||
{
|
||||
PS_SHADERDISKCACHE_OFF,
|
||||
PS_SHADERDISKCACHE_ON,
|
||||
};
|
||||
|
||||
EValues_PS_SHADERDISKCACHE_MAX_SIZE g_valuesPS_SHADERDISKCACHE_MAX_SIZE[PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES] =
|
||||
{
|
||||
PS_SHADERDISKCACHE_MAX_SIZE_MIN,
|
||||
PS_SHADERDISKCACHE_MAX_SIZE_MAX,
|
||||
};
|
||||
|
||||
EValues_PS_TEXFILTER_ANISO_OPTS2 g_valuesPS_TEXFILTER_ANISO_OPTS2[PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES] =
|
||||
{
|
||||
PS_TEXFILTER_ANISO_OPTS2_OFF,
|
||||
PS_TEXFILTER_ANISO_OPTS2_ON,
|
||||
};
|
||||
|
||||
EValues_PS_TEXFILTER_BILINEAR_IN_ANISO g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO[PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES] =
|
||||
{
|
||||
PS_TEXFILTER_BILINEAR_IN_ANISO_OFF,
|
||||
PS_TEXFILTER_BILINEAR_IN_ANISO_ON,
|
||||
};
|
||||
|
||||
EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE[PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES] =
|
||||
{
|
||||
PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF,
|
||||
PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON,
|
||||
};
|
||||
|
||||
EValues_PS_TEXFILTER_NO_NEG_LODBIAS g_valuesPS_TEXFILTER_NO_NEG_LODBIAS[PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES] =
|
||||
{
|
||||
PS_TEXFILTER_NO_NEG_LODBIAS_OFF,
|
||||
PS_TEXFILTER_NO_NEG_LODBIAS_ON,
|
||||
};
|
||||
|
||||
EValues_QUALITY_ENHANCEMENTS g_valuesQUALITY_ENHANCEMENTS[QUALITY_ENHANCEMENTS_NUM_VALUES] =
|
||||
{
|
||||
QUALITY_ENHANCEMENTS_HIGHQUALITY,
|
||||
QUALITY_ENHANCEMENTS_QUALITY,
|
||||
QUALITY_ENHANCEMENTS_PERFORMANCE,
|
||||
QUALITY_ENHANCEMENTS_HIGHPERFORMANCE,
|
||||
};
|
||||
|
||||
EValues_QUALITY_ENHANCEMENT_SUBSTITUTION g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION[QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES] =
|
||||
{
|
||||
QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION,
|
||||
QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY,
|
||||
};
|
||||
|
||||
EValues_REFRESH_RATE_OVERRIDE g_valuesREFRESH_RATE_OVERRIDE[REFRESH_RATE_OVERRIDE_NUM_VALUES] =
|
||||
{
|
||||
REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED,
|
||||
REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE,
|
||||
REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK,
|
||||
};
|
||||
|
||||
EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE[SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES] =
|
||||
{
|
||||
SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF,
|
||||
SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON,
|
||||
};
|
||||
|
||||
EValues_SET_VAB_DATA g_valuesSET_VAB_DATA[SET_VAB_DATA_NUM_VALUES] =
|
||||
{
|
||||
SET_VAB_DATA_ZERO,
|
||||
SET_VAB_DATA_UINT_ONE,
|
||||
SET_VAB_DATA_FLOAT_ONE,
|
||||
SET_VAB_DATA_FLOAT_POS_INF,
|
||||
SET_VAB_DATA_FLOAT_NAN,
|
||||
SET_VAB_DATA_USE_API_DEFAULTS,
|
||||
};
|
||||
|
||||
EValues_VSYNCMODE g_valuesVSYNCMODE[VSYNCMODE_NUM_VALUES] =
|
||||
{
|
||||
VSYNCMODE_PASSIVE,
|
||||
VSYNCMODE_FORCEOFF,
|
||||
VSYNCMODE_FORCEON,
|
||||
VSYNCMODE_FLIPINTERVAL2,
|
||||
VSYNCMODE_FLIPINTERVAL3,
|
||||
VSYNCMODE_FLIPINTERVAL4,
|
||||
VSYNCMODE_VIRTUAL,
|
||||
};
|
||||
|
||||
EValues_VSYNCTEARCONTROL g_valuesVSYNCTEARCONTROL[VSYNCTEARCONTROL_NUM_VALUES] =
|
||||
{
|
||||
VSYNCTEARCONTROL_DISABLE,
|
||||
VSYNCTEARCONTROL_ENABLE,
|
||||
};
|
||||
|
||||
|
||||
SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] =
|
||||
{
|
||||
{OGL_AA_LINE_GAMMA_ID, OGL_AA_LINE_GAMMA_STRING, 4, (NvU32 *)g_valuesOGL_AA_LINE_GAMMA, OGL_AA_LINE_GAMMA_DISABLED},
|
||||
{OGL_CPL_GDI_COMPATIBILITY_ID, OGL_CPL_GDI_COMPATIBILITY_STRING, 3, (NvU32 *)g_valuesOGL_CPL_GDI_COMPATIBILITY, OGL_CPL_GDI_COMPATIBILITY_AUTO},
|
||||
{OGL_CPL_PREFER_DXPRESENT_ID, OGL_CPL_PREFER_DXPRESENT_STRING, 3, (NvU32 *)g_valuesOGL_CPL_PREFER_DXPRESENT, OGL_CPL_PREFER_DXPRESENT_AUTO},
|
||||
{OGL_DEEP_COLOR_SCANOUT_ID, OGL_DEEP_COLOR_SCANOUT_STRING, 2, (NvU32 *)g_valuesOGL_DEEP_COLOR_SCANOUT, OGL_DEEP_COLOR_SCANOUT_ENABLE},
|
||||
{OGL_DEFAULT_SWAP_INTERVAL_ID, OGL_DEFAULT_SWAP_INTERVAL_STRING, 9, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL, OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE},
|
||||
{OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID, OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL, 0x00000000},
|
||||
{OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID, OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN, OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE},
|
||||
{OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID, OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING, 5, (NvU32 *)g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD, OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL},
|
||||
{OGL_EXTENSION_STRING_VERSION_ID, OGL_EXTENSION_STRING_VERSION_STRING, 0, NULL, 0x00000000},
|
||||
{OGL_FORCE_BLIT_ID, OGL_FORCE_BLIT_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_BLIT, OGL_FORCE_BLIT_OFF},
|
||||
{OGL_FORCE_STEREO_ID, OGL_FORCE_STEREO_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_STEREO, OGL_FORCE_STEREO_OFF},
|
||||
{OGL_MAX_FRAMES_ALLOWED_ID, OGL_MAX_FRAMES_ALLOWED_STRING, 0, NULL, 0x00000002},
|
||||
{OGL_OVERLAY_PIXEL_TYPE_ID, OGL_OVERLAY_PIXEL_TYPE_STRING, 4, (NvU32 *)g_valuesOGL_OVERLAY_PIXEL_TYPE, OGL_OVERLAY_PIXEL_TYPE_CI},
|
||||
{OGL_OVERLAY_SUPPORT_ID, OGL_OVERLAY_SUPPORT_STRING, 3, (NvU32 *)g_valuesOGL_OVERLAY_SUPPORT, OGL_OVERLAY_SUPPORT_OFF},
|
||||
{OGL_QUALITY_ENHANCEMENTS_ID, OGL_QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesOGL_QUALITY_ENHANCEMENTS, OGL_QUALITY_ENHANCEMENTS_QUAL},
|
||||
{OGL_SINGLE_BACKDEPTH_BUFFER_ID, OGL_SINGLE_BACKDEPTH_BUFFER_STRING, 3, (NvU32 *)g_valuesOGL_SINGLE_BACKDEPTH_BUFFER, OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE},
|
||||
{OGL_SLI_CFR_MODE_ID, OGL_SLI_CFR_MODE_STRING, 3, (NvU32 *)g_valuesOGL_SLI_CFR_MODE, OGL_SLI_CFR_MODE_DISABLE},
|
||||
{OGL_SLI_MULTICAST_ID, OGL_SLI_MULTICAST_STRING, 4, (NvU32 *)g_valuesOGL_SLI_MULTICAST, OGL_SLI_MULTICAST_DISABLE},
|
||||
{OGL_THREAD_CONTROL_ID, OGL_THREAD_CONTROL_STRING, 2, (NvU32 *)g_valuesOGL_THREAD_CONTROL, 0x00000000},
|
||||
{OGL_TMON_LEVEL_ID, OGL_TMON_LEVEL_STRING, 6, (NvU32 *)g_valuesOGL_TMON_LEVEL, OGL_TMON_LEVEL_MOST},
|
||||
{OGL_TRIPLE_BUFFER_ID, OGL_TRIPLE_BUFFER_STRING, 2, (NvU32 *)g_valuesOGL_TRIPLE_BUFFER, OGL_TRIPLE_BUFFER_DISABLED},
|
||||
{AA_BEHAVIOR_FLAGS_ID, AA_BEHAVIOR_FLAGS_STRING, 18, (NvU32 *)g_valuesAA_BEHAVIOR_FLAGS, AA_BEHAVIOR_FLAGS_DEFAULT},
|
||||
{AA_MODE_ALPHATOCOVERAGE_ID, AA_MODE_ALPHATOCOVERAGE_STRING, 4, (NvU32 *)g_valuesAA_MODE_ALPHATOCOVERAGE, 0x00000000},
|
||||
{AA_MODE_GAMMACORRECTION_ID, AA_MODE_GAMMACORRECTION_STRING, 8, (NvU32 *)g_valuesAA_MODE_GAMMACORRECTION, 0x00000000},
|
||||
{AA_MODE_METHOD_ID, AA_MODE_METHOD_STRING, 50, (NvU32 *)g_valuesAA_MODE_METHOD, AA_MODE_METHOD_NONE},
|
||||
{AA_MODE_REPLAY_ID, AA_MODE_REPLAY_STRING, 20, (NvU32 *)g_valuesAA_MODE_REPLAY, 0x00000000},
|
||||
{AA_MODE_SELECTOR_ID, AA_MODE_SELECTOR_STRING, 5, (NvU32 *)g_valuesAA_MODE_SELECTOR, AA_MODE_SELECTOR_APP_CONTROL},
|
||||
{AA_MODE_SELECTOR_SLIAA_ID, AA_MODE_SELECTOR_SLIAA_STRING, 2, (NvU32 *)g_valuesAA_MODE_SELECTOR_SLIAA, AA_MODE_SELECTOR_SLIAA_DISABLED},
|
||||
{ANISO_MODE_LEVEL_ID, ANISO_MODE_LEVEL_STRING, 5, (NvU32 *)g_valuesANISO_MODE_LEVEL, ANISO_MODE_LEVEL_DEFAULT},
|
||||
{ANISO_MODE_SELECTOR_ID, ANISO_MODE_SELECTOR_STRING, 6, (NvU32 *)g_valuesANISO_MODE_SELECTOR, ANISO_MODE_SELECTOR_DEFAULT},
|
||||
{ANSEL_ALLOW_ID, ANSEL_ALLOW_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOW, ANSEL_ALLOW_ALLOWED},
|
||||
{ANSEL_ALLOWLISTED_ID, ANSEL_ALLOWLISTED_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOWLISTED, ANSEL_ALLOWLISTED_DISALLOWED},
|
||||
{ANSEL_ENABLE_ID, ANSEL_ENABLE_STRING, 2, (NvU32 *)g_valuesANSEL_ENABLE, ANSEL_ENABLE_ON},
|
||||
{APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING, 6, (NvU32 *)g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED},
|
||||
{APPLICATION_STEAM_ID_ID, APPLICATION_STEAM_ID_STRING, 0, NULL, 0x00000000},
|
||||
{BATTERY_BOOST_APP_FPS_ID, BATTERY_BOOST_APP_FPS_STRING, 3, (NvU32 *)g_valuesBATTERY_BOOST_APP_FPS, BATTERY_BOOST_APP_FPS_NO_OVERRIDE},
|
||||
{CPL_HIDDEN_PROFILE_ID, CPL_HIDDEN_PROFILE_STRING, 2, (NvU32 *)g_valuesCPL_HIDDEN_PROFILE, CPL_HIDDEN_PROFILE_DISABLED},
|
||||
{EXPORT_PERF_COUNTERS_ID, EXPORT_PERF_COUNTERS_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS, EXPORT_PERF_COUNTERS_OFF},
|
||||
{EXTERNAL_QUIET_MODE_ID, EXTERNAL_QUIET_MODE_STRING, 2, (NvU32 *)g_valuesEXTERNAL_QUIET_MODE, EXTERNAL_QUIET_MODE_OFF},
|
||||
{FRL_FPS_ID, FRL_FPS_STRING, 3, (NvU32 *)g_valuesFRL_FPS, FRL_FPS_DISABLED},
|
||||
{FXAA_ALLOW_ID, FXAA_ALLOW_STRING, 2, (NvU32 *)g_valuesFXAA_ALLOW, FXAA_ALLOW_ALLOWED},
|
||||
{FXAA_ENABLE_ID, FXAA_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_ENABLE, FXAA_ENABLE_OFF},
|
||||
{FXAA_INDICATOR_ENABLE_ID, FXAA_INDICATOR_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_INDICATOR_ENABLE, FXAA_INDICATOR_ENABLE_OFF},
|
||||
{LATENCY_INDICATOR_AUTOALIGN_ID, LATENCY_INDICATOR_AUTOALIGN_STRING, 2, (NvU32 *)g_valuesLATENCY_INDICATOR_AUTOALIGN, LATENCY_INDICATOR_AUTOALIGN_ENABLED},
|
||||
{MCSFRSHOWSPLIT_ID, MCSFRSHOWSPLIT_STRING, 2, (NvU32 *)g_valuesMCSFRSHOWSPLIT, MCSFRSHOWSPLIT_DISABLED},
|
||||
{NV_QUALITY_UPSCALING_ID, NV_QUALITY_UPSCALING_STRING, 2, (NvU32 *)g_valuesNV_QUALITY_UPSCALING, NV_QUALITY_UPSCALING_OFF},
|
||||
{OPTIMUS_MAXAA_ID, OPTIMUS_MAXAA_STRING, 2, (NvU32 *)g_valuesOPTIMUS_MAXAA, 0x00000000},
|
||||
{PHYSXINDICATOR_ID, PHYSXINDICATOR_STRING, 2, (NvU32 *)g_valuesPHYSXINDICATOR, PHYSXINDICATOR_DISABLED},
|
||||
{PREFERRED_PSTATE_ID, PREFERRED_PSTATE_STRING, 8, (NvU32 *)g_valuesPREFERRED_PSTATE, PREFERRED_PSTATE_OPTIMAL_POWER},
|
||||
{PREVENT_UI_AF_OVERRIDE_ID, PREVENT_UI_AF_OVERRIDE_STRING, 2, (NvU32 *)g_valuesPREVENT_UI_AF_OVERRIDE, PREVENT_UI_AF_OVERRIDE_OFF},
|
||||
{SHIM_MAXRES_ID, SHIM_MAXRES_STRING, 0, NULL, 0x00000000},
|
||||
{SHIM_MCCOMPAT_ID, SHIM_MCCOMPAT_STRING, 8, (NvU32 *)g_valuesSHIM_MCCOMPAT, SHIM_MCCOMPAT_AUTO_SELECT},
|
||||
{SHIM_RENDERING_MODE_ID, SHIM_RENDERING_MODE_STRING, 8, (NvU32 *)g_valuesSHIM_RENDERING_MODE, SHIM_RENDERING_MODE_AUTO_SELECT},
|
||||
{SHIM_RENDERING_OPTIONS_ID, SHIM_RENDERING_OPTIONS_STRING, 28, (NvU32 *)g_valuesSHIM_RENDERING_OPTIONS, 0x00000000},
|
||||
{SLI_GPU_COUNT_ID, SLI_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_GPU_COUNT, SLI_GPU_COUNT_AUTOSELECT},
|
||||
{SLI_PREDEFINED_GPU_COUNT_ID, SLI_PREDEFINED_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT, SLI_PREDEFINED_GPU_COUNT_AUTOSELECT},
|
||||
{SLI_PREDEFINED_GPU_COUNT_DX10_ID, SLI_PREDEFINED_GPU_COUNT_DX10_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT_DX10, SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT},
|
||||
{SLI_PREDEFINED_MODE_ID, SLI_PREDEFINED_MODE_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE, SLI_PREDEFINED_MODE_AUTOSELECT},
|
||||
{SLI_PREDEFINED_MODE_DX10_ID, SLI_PREDEFINED_MODE_DX10_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE_DX10, SLI_PREDEFINED_MODE_DX10_AUTOSELECT},
|
||||
{SLI_RENDERING_MODE_ID, SLI_RENDERING_MODE_STRING, 6, (NvU32 *)g_valuesSLI_RENDERING_MODE, SLI_RENDERING_MODE_AUTOSELECT},
|
||||
{VRPRERENDERLIMIT_ID, VRPRERENDERLIMIT_STRING, 4, (NvU32 *)g_valuesVRPRERENDERLIMIT, VRPRERENDERLIMIT_DEFAULT},
|
||||
{VRRFEATUREINDICATOR_ID, VRRFEATUREINDICATOR_STRING, 2, (NvU32 *)g_valuesVRRFEATUREINDICATOR, VRRFEATUREINDICATOR_ENABLED},
|
||||
{VRROVERLAYINDICATOR_ID, VRROVERLAYINDICATOR_STRING, 2, (NvU32 *)g_valuesVRROVERLAYINDICATOR, VRROVERLAYINDICATOR_ENABLED},
|
||||
{VRRREQUESTSTATE_ID, VRRREQUESTSTATE_STRING, 3, (NvU32 *)g_valuesVRRREQUESTSTATE, VRRREQUESTSTATE_FULLSCREEN_ONLY},
|
||||
{VRR_APP_OVERRIDE_ID, VRR_APP_OVERRIDE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE, VRR_APP_OVERRIDE_ALLOW},
|
||||
{VRR_APP_OVERRIDE_REQUEST_STATE_ID, VRR_APP_OVERRIDE_REQUEST_STATE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE_REQUEST_STATE, VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW},
|
||||
{VRR_MODE_ID, VRR_MODE_STRING, 3, (NvU32 *)g_valuesVRR_MODE, VRR_MODE_FULLSCREEN_ONLY},
|
||||
{VSYNCSMOOTHAFR_ID, VSYNCSMOOTHAFR_STRING, 2, (NvU32 *)g_valuesVSYNCSMOOTHAFR, VSYNCSMOOTHAFR_OFF},
|
||||
{VSYNCVRRCONTROL_ID, VSYNCVRRCONTROL_STRING, 3, (NvU32 *)g_valuesVSYNCVRRCONTROL, VSYNCVRRCONTROL_ENABLE},
|
||||
{VSYNC_BEHAVIOR_FLAGS_ID, VSYNC_BEHAVIOR_FLAGS_STRING, 3, (NvU32 *)g_valuesVSYNC_BEHAVIOR_FLAGS, VSYNC_BEHAVIOR_FLAGS_DEFAULT},
|
||||
{WKS_API_STEREO_EYES_EXCHANGE_ID, WKS_API_STEREO_EYES_EXCHANGE_STRING, 2, (NvU32 *)g_valuesWKS_API_STEREO_EYES_EXCHANGE, WKS_API_STEREO_EYES_EXCHANGE_OFF},
|
||||
{WKS_API_STEREO_MODE_ID, WKS_API_STEREO_MODE_STRING, 25, (NvU32 *)g_valuesWKS_API_STEREO_MODE, WKS_API_STEREO_MODE_SHUTTER_GLASSES},
|
||||
{WKS_MEMORY_ALLOCATION_POLICY_ID, WKS_MEMORY_ALLOCATION_POLICY_STRING, 3, (NvU32 *)g_valuesWKS_MEMORY_ALLOCATION_POLICY, WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED},
|
||||
{WKS_STEREO_DONGLE_SUPPORT_ID, WKS_STEREO_DONGLE_SUPPORT_STRING, 3, (NvU32 *)g_valuesWKS_STEREO_DONGLE_SUPPORT, WKS_STEREO_DONGLE_SUPPORT_DAC},
|
||||
{WKS_STEREO_SUPPORT_ID, WKS_STEREO_SUPPORT_STRING, 2, (NvU32 *)g_valuesWKS_STEREO_SUPPORT, WKS_STEREO_SUPPORT_OFF},
|
||||
{WKS_STEREO_SWAP_MODE_ID, WKS_STEREO_SWAP_MODE_STRING, 5, (NvU32 *)g_valuesWKS_STEREO_SWAP_MODE, WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL},
|
||||
{AO_MODE_ID, AO_MODE_STRING, 4, (NvU32 *)g_valuesAO_MODE, AO_MODE_OFF},
|
||||
{AO_MODE_ACTIVE_ID, AO_MODE_ACTIVE_STRING, 2, (NvU32 *)g_valuesAO_MODE_ACTIVE, AO_MODE_ACTIVE_DISABLED},
|
||||
{AUTO_LODBIASADJUST_ID, AUTO_LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesAUTO_LODBIASADJUST, AUTO_LODBIASADJUST_ON},
|
||||
{EXPORT_PERF_COUNTERS_DX9_ONLY_ID, EXPORT_PERF_COUNTERS_DX9_ONLY_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY, EXPORT_PERF_COUNTERS_DX9_ONLY_OFF},
|
||||
{LODBIASADJUST_ID, LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesLODBIASADJUST, 0x00000000},
|
||||
{MAXWELL_B_SAMPLE_INTERLEAVE_ID, MAXWELL_B_SAMPLE_INTERLEAVE_STRING, 2, (NvU32 *)g_valuesMAXWELL_B_SAMPLE_INTERLEAVE, MAXWELL_B_SAMPLE_INTERLEAVE_OFF},
|
||||
{PRERENDERLIMIT_ID, PRERENDERLIMIT_STRING, 3, (NvU32 *)g_valuesPRERENDERLIMIT, PRERENDERLIMIT_APP_CONTROLLED},
|
||||
{PS_SHADERDISKCACHE_ID, PS_SHADERDISKCACHE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE, PS_SHADERDISKCACHE_ON},
|
||||
{PS_SHADERDISKCACHE_MAX_SIZE_ID, PS_SHADERDISKCACHE_MAX_SIZE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE_MAX_SIZE, 0x00000000},
|
||||
{PS_TEXFILTER_ANISO_OPTS2_ID, PS_TEXFILTER_ANISO_OPTS2_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_ANISO_OPTS2, PS_TEXFILTER_ANISO_OPTS2_OFF},
|
||||
{PS_TEXFILTER_BILINEAR_IN_ANISO_ID, PS_TEXFILTER_BILINEAR_IN_ANISO_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO, PS_TEXFILTER_BILINEAR_IN_ANISO_OFF},
|
||||
{PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF},
|
||||
{PS_TEXFILTER_NO_NEG_LODBIAS_ID, PS_TEXFILTER_NO_NEG_LODBIAS_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_NO_NEG_LODBIAS, PS_TEXFILTER_NO_NEG_LODBIAS_OFF},
|
||||
{QUALITY_ENHANCEMENTS_ID, QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesQUALITY_ENHANCEMENTS, QUALITY_ENHANCEMENTS_QUALITY},
|
||||
{QUALITY_ENHANCEMENT_SUBSTITUTION_ID, QUALITY_ENHANCEMENT_SUBSTITUTION_STRING, 2, (NvU32 *)g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION, QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION},
|
||||
{REFRESH_RATE_OVERRIDE_ID, REFRESH_RATE_OVERRIDE_STRING, 3, (NvU32 *)g_valuesREFRESH_RATE_OVERRIDE, REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED},
|
||||
{SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING, 2, (NvU32 *)g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF},
|
||||
{SET_VAB_DATA_ID, SET_VAB_DATA_STRING, 6, (NvU32 *)g_valuesSET_VAB_DATA, SET_VAB_DATA_USE_API_DEFAULTS},
|
||||
{VSYNCMODE_ID, VSYNCMODE_STRING, 7, (NvU32 *)g_valuesVSYNCMODE, VSYNCMODE_PASSIVE},
|
||||
{VSYNCTEARCONTROL_ID, VSYNCTEARCONTROL_STRING, 2, (NvU32 *)g_valuesVSYNCTEARCONTROL, VSYNCTEARCONTROL_DISABLE},
|
||||
};
|
||||
|
||||
SettingWSTRINGNameString mapSettingWSTRING[TOTAL_WSTRING_SETTING_NUM] =
|
||||
{
|
||||
{OGL_IMPLICIT_GPU_AFFINITY_ID, OGL_IMPLICIT_GPU_AFFINITY_STRING, 1, (const wchar_t **)g_valuesOGL_IMPLICIT_GPU_AFFINITY, L"autoselect"},
|
||||
{CUDA_EXCLUDED_GPUS_ID, CUDA_EXCLUDED_GPUS_STRING, 1, (const wchar_t **)g_valuesCUDA_EXCLUDED_GPUS, L"none"},
|
||||
{D3DOGL_GPU_MAX_POWER_ID, D3DOGL_GPU_MAX_POWER_STRING, 1, (const wchar_t **)g_valuesD3DOGL_GPU_MAX_POWER, L"0"},
|
||||
{ICAFE_LOGO_CONFIG_ID, ICAFE_LOGO_CONFIG_STRING, 0, NULL, L""},
|
||||
};
|
||||
|
1175
externals/nvapi/NvApiDriverSettings.h
vendored
Normal file
1175
externals/nvapi/NvApiDriverSettings.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
externals/nvapi/amd64/nvapi64.lib
vendored
Normal file
BIN
externals/nvapi/amd64/nvapi64.lib
vendored
Normal file
Binary file not shown.
2206
externals/nvapi/nvHLSLExtns.h
vendored
Normal file
2206
externals/nvapi/nvHLSLExtns.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
767
externals/nvapi/nvHLSLExtnsInternal.h
vendored
Normal file
767
externals/nvapi/nvHLSLExtnsInternal.h
vendored
Normal file
@ -0,0 +1,767 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright <20> 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
////////////////////////// NVIDIA SHADER EXTENSIONS /////////////////
|
||||
// internal functions
|
||||
// Functions in this file are not expected to be called by apps directly
|
||||
|
||||
#include "nvShaderExtnEnums.h"
|
||||
|
||||
struct NvShaderExtnStruct
|
||||
{
|
||||
uint opcode; // opcode
|
||||
uint rid; // resource ID
|
||||
uint sid; // sampler ID
|
||||
|
||||
uint4 dst1u; // destination operand 1 (for instructions that need extra destination operands)
|
||||
uint4 src3u; // source operand 3
|
||||
uint4 src4u; // source operand 4
|
||||
uint4 src5u; // source operand 5
|
||||
|
||||
uint4 src0u; // uint source operand 0
|
||||
uint4 src1u; // uint source operand 0
|
||||
uint4 src2u; // uint source operand 0
|
||||
uint4 dst0u; // uint destination operand
|
||||
|
||||
uint markUavRef; // the next store to UAV is fake and is used only to identify the uav slot
|
||||
uint numOutputsForIncCounter; // Used for output to IncrementCounter
|
||||
float padding1[27]; // struct size: 256 bytes
|
||||
};
|
||||
|
||||
// RW structured buffer for Nvidia shader extensions
|
||||
|
||||
// Application needs to define NV_SHADER_EXTN_SLOT as a unused slot, which should be
|
||||
// set using NvAPI_D3D11_SetNvShaderExtnSlot() call before creating the first shader that
|
||||
// uses nvidia shader extensions. E.g before including this file in shader define it as:
|
||||
// #define NV_SHADER_EXTN_SLOT u7
|
||||
|
||||
// For SM5.1, application needs to define NV_SHADER_EXTN_REGISTER_SPACE as register space
|
||||
// E.g. before including this file in shader define it as:
|
||||
// #define NV_SHADER_EXTN_REGISTER_SPACE space2
|
||||
|
||||
// Note that other operations to this UAV will be ignored so application
|
||||
// should bind a null resource
|
||||
|
||||
#ifdef NV_SHADER_EXTN_REGISTER_SPACE
|
||||
RWStructuredBuffer<NvShaderExtnStruct> g_NvidiaExt : register( NV_SHADER_EXTN_SLOT, NV_SHADER_EXTN_REGISTER_SPACE );
|
||||
#else
|
||||
RWStructuredBuffer<NvShaderExtnStruct> g_NvidiaExt : register( NV_SHADER_EXTN_SLOT );
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// the exposed SHFL instructions accept a mask parameter in src2
|
||||
// To compute lane mask from width of segment:
|
||||
// minLaneID : currentLaneId & src2[12:8]
|
||||
// maxLaneID : minLaneId | (src2[4:0] & ~src2[12:8])
|
||||
// where [minLaneId, maxLaneId] defines the segment where currentLaneId belongs
|
||||
// we always set src2[4:0] to 11111 (0x1F), and set src2[12:8] as (32 - width)
|
||||
int __NvGetShflMaskFromWidth(uint width)
|
||||
{
|
||||
return ((NV_WARP_SIZE - width) << 8) | 0x1F;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
void __NvReferenceUAVForOp(RWByteAddressBuffer uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav.Store(index, 0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<float2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = float2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<float2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = float2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<float2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = float2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<float4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = float4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<float4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = float4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<float4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = float4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<float> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = 0.0f;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<float> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = 0.0f;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<float> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<uint2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = uint2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<uint2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = uint2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<uint2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = uint2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<uint4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = uint4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<uint4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = uint4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<uint4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = uint4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<uint> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = 0;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<uint> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = 0;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<uint> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = 0;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<int2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = int2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<int2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = int2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<int2> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = int2(0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<int4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = int4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<int4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = int4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<int4> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = int4(0,0,0,0);
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture1D<int> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[index] = 0;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture2D<int> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint2(index,index)] = 0;
|
||||
}
|
||||
|
||||
void __NvReferenceUAVForOp(RWTexture3D<int> uav)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].markUavRef = 1;
|
||||
uav[uint3(index,index,index)] = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// ATOMIC op sub-opcodes
|
||||
#define NV_EXTN_ATOM_AND 0
|
||||
#define NV_EXTN_ATOM_OR 1
|
||||
#define NV_EXTN_ATOM_XOR 2
|
||||
|
||||
#define NV_EXTN_ATOM_ADD 3
|
||||
#define NV_EXTN_ATOM_MAX 6
|
||||
#define NV_EXTN_ATOM_MIN 7
|
||||
|
||||
#define NV_EXTN_ATOM_SWAP 8
|
||||
#define NV_EXTN_ATOM_CAS 9
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// performs Atomic operation on two consecutive fp16 values in the given UAV
|
||||
// the uint paramater 'fp16x2Val' is treated as two fp16 values
|
||||
// the passed sub-opcode 'op' should be an immediate constant
|
||||
// byteAddress must be multiple of 4
|
||||
// the returned value are the two fp16 values packed into a single uint
|
||||
uint __NvAtomicOpFP16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = byteAddress;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.x;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// performs Atomic operation on a R16G16_FLOAT UAV at the given address
|
||||
// the uint paramater 'fp16x2Val' is treated as two fp16 values
|
||||
// the passed sub-opcode 'op' should be an immediate constant
|
||||
// the returned value are the two fp16 values (.x and .y components) packed into a single uint
|
||||
// Warning: Behaviour of these set of functions is undefined if the UAV is not
|
||||
// of R16G16_FLOAT format (might result in app crash or TDR)
|
||||
|
||||
uint __NvAtomicOpFP16x2(RWTexture1D<float2> uav, uint address, uint fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.x;
|
||||
}
|
||||
|
||||
uint __NvAtomicOpFP16x2(RWTexture2D<float2> uav, uint2 address, uint fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = address;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.x;
|
||||
}
|
||||
|
||||
uint __NvAtomicOpFP16x2(RWTexture3D<float2> uav, uint3 address, uint fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = address;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.x;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// performs Atomic operation on a R16G16B16A16_FLOAT UAV at the given address
|
||||
// the uint2 paramater 'fp16x2Val' is treated as four fp16 values
|
||||
// i.e, fp16x2Val.x = uav.xy and fp16x2Val.y = uav.yz
|
||||
// the passed sub-opcode 'op' should be an immediate constant
|
||||
// the returned value are the four fp16 values (.xyzw components) packed into uint2
|
||||
// Warning: Behaviour of these set of functions is undefined if the UAV is not
|
||||
// of R16G16B16A16_FLOAT format (might result in app crash or TDR)
|
||||
|
||||
uint2 __NvAtomicOpFP16x2(RWTexture1D<float4> uav, uint address, uint2 fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
// break it down into two fp16x2 atomic ops
|
||||
uint2 retVal;
|
||||
|
||||
// first op has x-coordinate = x * 2
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address * 2;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.x = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
// second op has x-coordinate = x * 2 + 1
|
||||
index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address * 2 + 1;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.y = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpFP16x2(RWTexture2D<float4> uav, uint2 address, uint2 fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
// break it down into two fp16x2 atomic ops
|
||||
uint2 retVal;
|
||||
|
||||
// first op has x-coordinate = x * 2
|
||||
uint2 addressTemp = uint2(address.x * 2, address.y);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = addressTemp;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.x = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
// second op has x-coordinate = x * 2 + 1
|
||||
addressTemp.x++;
|
||||
index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = addressTemp;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.y = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpFP16x2(RWTexture3D<float4> uav, uint3 address, uint2 fp16x2Val, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
// break it down into two fp16x2 atomic ops
|
||||
uint2 retVal;
|
||||
|
||||
// first op has x-coordinate = x * 2
|
||||
uint3 addressTemp = uint3(address.x * 2, address.y, address.z);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = addressTemp;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.x = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
// second op has x-coordinate = x * 2 + 1
|
||||
addressTemp.x++;
|
||||
index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = addressTemp;
|
||||
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
|
||||
retVal.y = g_NvidiaExt[index].dst0u.x;
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
uint __fp32x2Tofp16x2(float2 val)
|
||||
{
|
||||
return (f32tof16(val.y)<<16) | f32tof16(val.x) ;
|
||||
}
|
||||
|
||||
uint2 __fp32x4Tofp16x4(float4 val)
|
||||
{
|
||||
return uint2( (f32tof16(val.y)<<16) | f32tof16(val.x), (f32tof16(val.w)<<16) | f32tof16(val.z) ) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// FP32 Atomic functions
|
||||
// performs Atomic operation treating the uav as float (fp32) values
|
||||
// the passed sub-opcode 'op' should be an immediate constant
|
||||
// byteAddress must be multiple of 4
|
||||
float __NvAtomicAddFP32(RWByteAddressBuffer uav, uint byteAddress, float val)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = byteAddress;
|
||||
g_NvidiaExt[index].src1u.x = asuint(val); // passing as uint to make it more convinient for the driver to translate
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
|
||||
|
||||
return asfloat(g_NvidiaExt[index].dst0u.x);
|
||||
}
|
||||
|
||||
float __NvAtomicAddFP32(RWTexture1D<float> uav, uint address, float val)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address;
|
||||
g_NvidiaExt[index].src1u.x = asuint(val);
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
|
||||
|
||||
return asfloat(g_NvidiaExt[index].dst0u.x);
|
||||
}
|
||||
|
||||
float __NvAtomicAddFP32(RWTexture2D<float> uav, uint2 address, float val)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = address;
|
||||
g_NvidiaExt[index].src1u.x = asuint(val);
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
|
||||
|
||||
return asfloat(g_NvidiaExt[index].dst0u.x);
|
||||
}
|
||||
|
||||
float __NvAtomicAddFP32(RWTexture3D<float> uav, uint3 address, float val)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = address;
|
||||
g_NvidiaExt[index].src1u.x = asuint(val);
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
|
||||
|
||||
return asfloat(g_NvidiaExt[index].dst0u.x);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// UINT64 Atmoic Functions
|
||||
// The functions below performs atomic operation on the given UAV treating the value as uint64
|
||||
// byteAddress must be multiple of 8
|
||||
// The returned value is the value present in memory location before the atomic operation
|
||||
// uint2 vector type is used to represent a single uint64 value with the x component containing the low 32 bits and y component the high 32 bits.
|
||||
|
||||
uint2 __NvAtomicCompareExchangeUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 compareValue, uint2 value)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = byteAddress;
|
||||
g_NvidiaExt[index].src1u.xy = compareValue;
|
||||
g_NvidiaExt[index].src1u.zw = value;
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 value, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = byteAddress;
|
||||
g_NvidiaExt[index].src1u.xy = value;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicCompareExchangeUINT64(RWTexture1D<uint2> uav, uint address, uint2 compareValue, uint2 value)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address;
|
||||
g_NvidiaExt[index].src1u.xy = compareValue;
|
||||
g_NvidiaExt[index].src1u.zw = value;
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpUINT64(RWTexture1D<uint2> uav, uint address, uint2 value, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = address;
|
||||
g_NvidiaExt[index].src1u.xy = value;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicCompareExchangeUINT64(RWTexture2D<uint2> uav, uint2 address, uint2 compareValue, uint2 value)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = address;
|
||||
g_NvidiaExt[index].src1u.xy = compareValue;
|
||||
g_NvidiaExt[index].src1u.zw = value;
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpUINT64(RWTexture2D<uint2> uav, uint2 address, uint2 value, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xy = address;
|
||||
g_NvidiaExt[index].src1u.xy = value;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicCompareExchangeUINT64(RWTexture3D<uint2> uav, uint3 address, uint2 compareValue, uint2 value)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = address;
|
||||
g_NvidiaExt[index].src1u.xy = compareValue;
|
||||
g_NvidiaExt[index].src1u.zw = value;
|
||||
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
uint2 __NvAtomicOpUINT64(RWTexture3D<uint2> uav, uint3 address, uint2 value, uint atomicOpType)
|
||||
{
|
||||
__NvReferenceUAVForOp(uav);
|
||||
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.xyz = address;
|
||||
g_NvidiaExt[index].src1u.xy = value;
|
||||
g_NvidiaExt[index].src2u.x = atomicOpType;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
|
||||
|
||||
return g_NvidiaExt[index].dst0u.xy;
|
||||
}
|
||||
|
||||
|
||||
uint4 __NvFootprint(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, int3 offset = int3(0, 0, 0))
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = texIndex;
|
||||
g_NvidiaExt[index].src0u.y = smpIndex;
|
||||
g_NvidiaExt[index].src1u.xyz = asuint(location);
|
||||
g_NvidiaExt[index].src1u.w = gran;
|
||||
g_NvidiaExt[index].src3u.x = texSpace;
|
||||
g_NvidiaExt[index].src3u.y = smpSpace;
|
||||
g_NvidiaExt[index].src3u.z = texType;
|
||||
g_NvidiaExt[index].src3u.w = footprintmode;
|
||||
g_NvidiaExt[index].src4u.xyz = asuint(offset);
|
||||
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT;
|
||||
g_NvidiaExt[index].numOutputsForIncCounter = 4;
|
||||
|
||||
// result is returned as the return value of IncrementCounter on fake UAV slot
|
||||
uint4 op;
|
||||
op.x = g_NvidiaExt.IncrementCounter();
|
||||
op.y = g_NvidiaExt.IncrementCounter();
|
||||
op.z = g_NvidiaExt.IncrementCounter();
|
||||
op.w = g_NvidiaExt.IncrementCounter();
|
||||
return op;
|
||||
}
|
||||
|
||||
uint4 __NvFootprintBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float bias, int3 offset = int3(0, 0, 0))
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = texIndex;
|
||||
g_NvidiaExt[index].src0u.y = smpIndex;
|
||||
g_NvidiaExt[index].src1u.xyz = asuint(location);
|
||||
g_NvidiaExt[index].src1u.w = gran;
|
||||
g_NvidiaExt[index].src2u.x = asuint(bias);
|
||||
g_NvidiaExt[index].src3u.x = texSpace;
|
||||
g_NvidiaExt[index].src3u.y = smpSpace;
|
||||
g_NvidiaExt[index].src3u.z = texType;
|
||||
g_NvidiaExt[index].src3u.w = footprintmode;
|
||||
g_NvidiaExt[index].src4u.xyz = asuint(offset);
|
||||
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_BIAS;
|
||||
g_NvidiaExt[index].numOutputsForIncCounter = 4;
|
||||
|
||||
// result is returned as the return value of IncrementCounter on fake UAV slot
|
||||
uint4 op;
|
||||
op.x = g_NvidiaExt.IncrementCounter();
|
||||
op.y = g_NvidiaExt.IncrementCounter();
|
||||
op.z = g_NvidiaExt.IncrementCounter();
|
||||
op.w = g_NvidiaExt.IncrementCounter();
|
||||
return op;
|
||||
}
|
||||
|
||||
uint4 __NvFootprintLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float lodLevel, int3 offset = int3(0, 0, 0))
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = texIndex;
|
||||
g_NvidiaExt[index].src0u.y = smpIndex;
|
||||
g_NvidiaExt[index].src1u.xyz = asuint(location);
|
||||
g_NvidiaExt[index].src1u.w = gran;
|
||||
g_NvidiaExt[index].src2u.x = asuint(lodLevel);
|
||||
g_NvidiaExt[index].src3u.x = texSpace;
|
||||
g_NvidiaExt[index].src3u.y = smpSpace;
|
||||
g_NvidiaExt[index].src3u.z = texType;
|
||||
g_NvidiaExt[index].src3u.w = footprintmode;
|
||||
g_NvidiaExt[index].src4u.xyz = asuint(offset);
|
||||
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_LEVEL;
|
||||
g_NvidiaExt[index].numOutputsForIncCounter = 4;
|
||||
|
||||
// result is returned as the return value of IncrementCounter on fake UAV slot
|
||||
uint4 op;
|
||||
op.x = g_NvidiaExt.IncrementCounter();
|
||||
op.y = g_NvidiaExt.IncrementCounter();
|
||||
op.z = g_NvidiaExt.IncrementCounter();
|
||||
op.w = g_NvidiaExt.IncrementCounter();
|
||||
return op;
|
||||
}
|
||||
|
||||
uint4 __NvFootprintGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float3 ddx, float3 ddy, int3 offset = int3(0, 0, 0))
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = texIndex;
|
||||
g_NvidiaExt[index].src0u.y = smpIndex;
|
||||
g_NvidiaExt[index].src1u.xyz = asuint(location);
|
||||
g_NvidiaExt[index].src1u.w = gran;
|
||||
g_NvidiaExt[index].src2u.xyz = asuint(ddx);
|
||||
g_NvidiaExt[index].src5u.xyz = asuint(ddy);
|
||||
g_NvidiaExt[index].src3u.x = texSpace;
|
||||
g_NvidiaExt[index].src3u.y = smpSpace;
|
||||
g_NvidiaExt[index].src3u.z = texType;
|
||||
g_NvidiaExt[index].src3u.w = footprintmode;
|
||||
g_NvidiaExt[index].src4u.xyz = asuint(offset);
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_GRAD;
|
||||
g_NvidiaExt[index].numOutputsForIncCounter = 4;
|
||||
|
||||
// result is returned as the return value of IncrementCounter on fake UAV slot
|
||||
uint4 op;
|
||||
op.x = g_NvidiaExt.IncrementCounter();
|
||||
op.y = g_NvidiaExt.IncrementCounter();
|
||||
op.z = g_NvidiaExt.IncrementCounter();
|
||||
op.w = g_NvidiaExt.IncrementCounter();
|
||||
return op;
|
||||
}
|
||||
|
||||
// returns value of special register - specify subopcode from any of NV_SPECIALOP_* specified in nvShaderExtnEnums.h - other opcodes undefined behavior
|
||||
uint __NvGetSpecial(uint subOpCode)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_GET_SPECIAL;
|
||||
g_NvidiaExt[index].src0u.x = subOpCode;
|
||||
return g_NvidiaExt.IncrementCounter();
|
||||
}
|
||||
|
||||
// predicate is returned in laneValid indicating if srcLane is in range and val from specified lane is returned.
|
||||
int __NvShflGeneric(int val, uint srcLane, uint maskClampVal, out uint laneValid)
|
||||
{
|
||||
uint index = g_NvidiaExt.IncrementCounter();
|
||||
g_NvidiaExt[index].src0u.x = val; // variable to be shuffled
|
||||
g_NvidiaExt[index].src0u.y = srcLane; // source lane
|
||||
g_NvidiaExt[index].src0u.z = maskClampVal;
|
||||
g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_GENERIC;
|
||||
g_NvidiaExt[index].numOutputsForIncCounter = 2;
|
||||
|
||||
laneValid = asuint(g_NvidiaExt.IncrementCounter());
|
||||
return g_NvidiaExt.IncrementCounter();
|
||||
}
|
141
externals/nvapi/nvShaderExtnEnums.h
vendored
Normal file
141
externals/nvapi/nvShaderExtnEnums.h
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright <20> 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////// NVIDIA SHADER EXTENSIONS ////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file can be included both from HLSL shader code as well as C++ code.
|
||||
// The app should call NvAPI_D3D11_IsNvShaderExtnOpCodeSupported() / NvAPI_D3D12_IsNvShaderExtnOpCodeSupported()
|
||||
// to check for support for every nv shader extension opcode it plans to use
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//---------------------------- NV Shader Extn Version -----------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
#define NV_SHADER_EXTN_VERSION 1
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//---------------------------- Misc constants --------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
#define NV_WARP_SIZE 32
|
||||
#define NV_WARP_SIZE_LOG2 5
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//---------------------------- opCode constants ------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
|
||||
#define NV_EXTN_OP_SHFL 1
|
||||
#define NV_EXTN_OP_SHFL_UP 2
|
||||
#define NV_EXTN_OP_SHFL_DOWN 3
|
||||
#define NV_EXTN_OP_SHFL_XOR 4
|
||||
|
||||
#define NV_EXTN_OP_VOTE_ALL 5
|
||||
#define NV_EXTN_OP_VOTE_ANY 6
|
||||
#define NV_EXTN_OP_VOTE_BALLOT 7
|
||||
|
||||
#define NV_EXTN_OP_GET_LANE_ID 8
|
||||
#define NV_EXTN_OP_FP16_ATOMIC 12
|
||||
#define NV_EXTN_OP_FP32_ATOMIC 13
|
||||
|
||||
#define NV_EXTN_OP_GET_SPECIAL 19
|
||||
|
||||
#define NV_EXTN_OP_UINT64_ATOMIC 20
|
||||
|
||||
#define NV_EXTN_OP_MATCH_ANY 21
|
||||
|
||||
// FOOTPRINT - For Sample and SampleBias
|
||||
#define NV_EXTN_OP_FOOTPRINT 28
|
||||
#define NV_EXTN_OP_FOOTPRINT_BIAS 29
|
||||
|
||||
#define NV_EXTN_OP_GET_SHADING_RATE 30
|
||||
|
||||
// FOOTPRINT - For SampleLevel and SampleGrad
|
||||
#define NV_EXTN_OP_FOOTPRINT_LEVEL 31
|
||||
#define NV_EXTN_OP_FOOTPRINT_GRAD 32
|
||||
|
||||
// SHFL Generic
|
||||
#define NV_EXTN_OP_SHFL_GENERIC 33
|
||||
|
||||
#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE 51
|
||||
#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED 52
|
||||
|
||||
// HitObject API
|
||||
#define NV_EXTN_OP_HIT_OBJECT_TRACE_RAY 67
|
||||
#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT 68
|
||||
#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT_WITH_RECORD_INDEX 69
|
||||
#define NV_EXTN_OP_HIT_OBJECT_MAKE_MISS 70
|
||||
#define NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD 71
|
||||
#define NV_EXTN_OP_HIT_OBJECT_INVOKE 72
|
||||
#define NV_EXTN_OP_HIT_OBJECT_IS_MISS 73
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_ID 74
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_INDEX 75
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_PRIMITIVE_INDEX 76
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_GEOMETRY_INDEX 77
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_HIT_KIND 78
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_RAY_DESC 79
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_ATTRIBUTES 80
|
||||
#define NV_EXTN_OP_HIT_OBJECT_GET_SHADER_TABLE_INDEX 81
|
||||
#define NV_EXTN_OP_HIT_OBJECT_LOAD_LOCAL_ROOT_TABLE_CONSTANT 82
|
||||
#define NV_EXTN_OP_HIT_OBJECT_IS_HIT 83
|
||||
#define NV_EXTN_OP_HIT_OBJECT_IS_NOP 84
|
||||
#define NV_EXTN_OP_HIT_OBJECT_MAKE_NOP 85
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//-------------------- GET_SPECIAL subOpCode constants -----------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
#define NV_SPECIALOP_THREADLTMASK 4
|
||||
#define NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED 5
|
||||
#define NV_SPECIALOP_GLOBAL_TIMER_LO 9
|
||||
#define NV_SPECIALOP_GLOBAL_TIMER_HI 10
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//----------------------------- Texture Types -------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
#define NV_EXTN_TEXTURE_1D 2
|
||||
#define NV_EXTN_TEXTURE_1D_ARRAY 3
|
||||
#define NV_EXTN_TEXTURE_2D 4
|
||||
#define NV_EXTN_TEXTURE_2D_ARRAY 5
|
||||
#define NV_EXTN_TEXTURE_3D 6
|
||||
#define NV_EXTN_TEXTURE_CUBE 7
|
||||
#define NV_EXTN_TEXTURE_CUBE_ARRAY 8
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------//
|
||||
//----------------FOOTPRINT Enums for NvFootprint* extns---------------------//
|
||||
//---------------------------------------------------------------------------//
|
||||
#define NV_EXTN_FOOTPRINT_MODE_FINE 0
|
||||
#define NV_EXTN_FOOTPRINT_MODE_COARSE 1
|
22178
externals/nvapi/nvapi.h
vendored
Normal file
22178
externals/nvapi/nvapi.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
652
externals/nvapi/nvapi_lite_common.h
vendored
Normal file
652
externals/nvapi/nvapi_lite_common.h
vendored
Normal file
@ -0,0 +1,652 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
#pragma once
|
||||
#include"nvapi_lite_salstart.h"
|
||||
#pragma pack(push,8)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) && (_MSC_VER > 1399) && !defined(NVAPI_INTERNAL) && !defined(NVAPI_DEPRECATED_OLD)
|
||||
#ifndef __nvapi_deprecated_function
|
||||
#define __nvapi_deprecated_function(message) __declspec(deprecated(message))
|
||||
#endif
|
||||
#ifndef __nvapi_deprecated_datatype
|
||||
#define __nvapi_deprecated_datatype(FirstRelease) __declspec(deprecated("Do not use this data type - it is deprecated in release " #FirstRelease "."))
|
||||
#endif
|
||||
#else
|
||||
#ifndef __nvapi_deprecated_function
|
||||
#define __nvapi_deprecated_function(message)
|
||||
#endif
|
||||
#ifndef __nvapi_deprecated_datatype
|
||||
#define __nvapi_deprecated_datatype(FirstRelease)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* 64-bit types for compilers that support them, plus some obsolete variants */
|
||||
#if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64)
|
||||
typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */
|
||||
typedef long long NvS64; /* -9223372036854775808 to 9223372036854775807 */
|
||||
#else
|
||||
typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */
|
||||
typedef __int64 NvS64; /* -9223372036854775808 to 9223372036854775807 */
|
||||
#endif
|
||||
|
||||
// mac os 32-bit still needs this
|
||||
#if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__)
|
||||
typedef signed long NvS32; /* -2147483648 to 2147483647 */
|
||||
#else
|
||||
typedef signed int NvS32; /* -2147483648 to 2147483647 */
|
||||
#endif
|
||||
|
||||
#ifndef __unix
|
||||
// mac os 32-bit still needs this
|
||||
#if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \
|
||||
(!defined(macintosh) && defined(__NVAPI_RESERVED0__)) )
|
||||
typedef unsigned int NvU32; /* 0 to 4294967295 */
|
||||
#else
|
||||
typedef unsigned long NvU32; /* 0 to 4294967295 */
|
||||
#endif
|
||||
#else
|
||||
typedef unsigned int NvU32; /* 0 to 4294967295 */
|
||||
#endif
|
||||
|
||||
typedef unsigned long temp_NvU32; /* 0 to 4294967295 */
|
||||
typedef signed short NvS16;
|
||||
typedef unsigned short NvU16;
|
||||
typedef unsigned char NvU8;
|
||||
typedef signed char NvS8;
|
||||
typedef float NvF32;
|
||||
typedef double NvF64;
|
||||
|
||||
/*!
|
||||
* Macro to convert NvU32 to NvF32.
|
||||
*/
|
||||
#define NvU32TONvF32(_pData) *(NvF32 *)(_pData)
|
||||
/*!
|
||||
* Macro to convert NvF32 to NvU32.
|
||||
*/
|
||||
#define NvF32TONvU32(_pData) *(NvU32 *)(_pData)
|
||||
|
||||
/* Boolean type */
|
||||
typedef NvU8 NvBool;
|
||||
#define NV_TRUE ((NvBool)(0 == 0))
|
||||
#define NV_FALSE ((NvBool)(0 != 0))
|
||||
|
||||
typedef struct _NV_RECT
|
||||
{
|
||||
NvU32 left;
|
||||
NvU32 top;
|
||||
NvU32 right;
|
||||
NvU32 bottom;
|
||||
} NV_RECT;
|
||||
|
||||
|
||||
#define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
|
||||
|
||||
//! \addtogroup nvapihandles
|
||||
//! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
|
||||
//! These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
|
||||
//! display indexes or anything else.
|
||||
//!
|
||||
//! Most handles remain valid until a display re-configuration (display mode set) or GPU
|
||||
//! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
|
||||
//! is received by an app, it should discard all handles, and re-enumerate them.
|
||||
//! @{
|
||||
NV_DECLARE_HANDLE(NvLogicalGpuHandle); //!< One or more physical GPUs acting in concert (SLI)
|
||||
NV_DECLARE_HANDLE(NvPhysicalGpuHandle); //!< A single physical GPU
|
||||
NV_DECLARE_HANDLE(NvDisplayHandle); //!< Display Device driven by NVIDIA GPU(s) (an attached display)
|
||||
NV_DECLARE_HANDLE(NvMonitorHandle); //!< Monitor handle
|
||||
NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); //!< Unattached Display Device driven by NVIDIA GPU(s)
|
||||
NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); //!< A handle to a Visual Computing Device
|
||||
NV_DECLARE_HANDLE(NvEventHandle); //!< A handle to an event registration instance
|
||||
|
||||
|
||||
NV_DECLARE_HANDLE(NvHICHandle); //!< A handle to a Host Interface Card
|
||||
NV_DECLARE_HANDLE(NvGSyncDeviceHandle); //!< A handle to a Sync device
|
||||
NV_DECLARE_HANDLE(NvVioHandle); //!< A handle to an SDI device
|
||||
NV_DECLARE_HANDLE(NvTransitionHandle); //!< A handle to address a single transition request
|
||||
NV_DECLARE_HANDLE(NvAudioHandle); //!< NVIDIA HD Audio Device
|
||||
NV_DECLARE_HANDLE(Nv3DVPContextHandle); //!< A handle for a 3D Vision Pro (3DVP) context
|
||||
NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); //!< A handle for a 3DVP RF transceiver
|
||||
NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); //!< A handle for a pair of 3DVP RF shutter glasses
|
||||
NV_DECLARE_HANDLE(NvPcfClientHandle); //!< A handle for NVPCF clients
|
||||
|
||||
typedef void* StereoHandle; //!< A stereo handle, that corresponds to the device interface
|
||||
|
||||
NV_DECLARE_HANDLE(NvSourceHandle); //!< Unique source handle on the system
|
||||
NV_DECLARE_HANDLE(NvTargetHandle); //!< Unique target handle on the system
|
||||
NV_DECLARE_HANDLE(NVDX_SwapChainHandle); //!< DirectX SwapChain objects
|
||||
static const NVDX_SwapChainHandle NVDX_SWAPCHAIN_NONE = 0;
|
||||
NV_DECLARE_HANDLE(NvPresentBarrierClientHandle); //!< PresentBarrier client object
|
||||
//! @}
|
||||
|
||||
//! \ingroup nvapihandles
|
||||
//! @{
|
||||
#define NVAPI_DEFAULT_HANDLE 0
|
||||
#define NV_BIT(x) (1 << (x))
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
//! \addtogroup nvapitypes
|
||||
//! @{
|
||||
#define NVAPI_GENERIC_STRING_MAX 4096
|
||||
#define NVAPI_LONG_STRING_MAX 256
|
||||
#define NVAPI_SHORT_STRING_MAX 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvS32 sX;
|
||||
NvS32 sY;
|
||||
NvS32 sWidth;
|
||||
NvS32 sHeight;
|
||||
} NvSBox;
|
||||
|
||||
#ifndef NvGUID_Defined
|
||||
#define NvGUID_Defined
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 data1;
|
||||
NvU16 data2;
|
||||
NvU16 data3;
|
||||
NvU8 data4[8];
|
||||
} NvGUID, NvLUID;
|
||||
|
||||
|
||||
#endif //#ifndef NvGUID_Defined
|
||||
#define NVAPI_MAX_PHYSICAL_GPUS 64
|
||||
|
||||
|
||||
#define NVAPI_MAX_PHYSICAL_BRIDGES 100
|
||||
#define NVAPI_PHYSICAL_GPUS 32
|
||||
#define NVAPI_MAX_LOGICAL_GPUS 64
|
||||
#define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256
|
||||
#define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256
|
||||
#define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS
|
||||
#define NVAPI_MAX_GPU_PER_TOPOLOGY 8
|
||||
#define NVAPI_MAX_DISPLAY_HEADS 2
|
||||
#define NVAPI_ADVANCED_DISPLAY_HEADS 4
|
||||
#define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS
|
||||
#define NVAPI_MAX_ACPI_IDS 16
|
||||
#define NVAPI_MAX_VIEW_MODES 8
|
||||
|
||||
|
||||
#define NVAPI_SYSTEM_MAX_HWBCS 128
|
||||
#define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff
|
||||
|
||||
#define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS
|
||||
#define NV_MAX_HEADS 4 //!< Maximum heads, each with NVAPI_DESKTOP_RES resolution
|
||||
#define NVAPI_MAX_HEADS_PER_GPU 32
|
||||
#define NV_MAX_VID_STREAMS 4 //!< Maximum number of input video streams, each with a #NVAPI_VIDEO_SRC_INFO
|
||||
#define NV_MAX_VID_STREAMS_EX 20 //!< Increasing MAX no. of input video streams, each with a #NVAPI_VIDEO_SRC_INFO
|
||||
#define NV_MAX_VID_PROFILES 4 //!< Maximum number of output video profiles supported
|
||||
|
||||
#define NVAPI_MAX_AUDIO_DEVICES 16
|
||||
|
||||
|
||||
typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX];
|
||||
typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX];
|
||||
typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX];
|
||||
typedef NvU16 NvAPI_UnicodeShortString[NVAPI_SHORT_STRING_MAX];
|
||||
//! @}
|
||||
|
||||
|
||||
// =========================================================================================
|
||||
//! NvAPI Version Definition \n
|
||||
//! Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro. \n
|
||||
//! Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
|
||||
//! \ingroup nvapitypes
|
||||
// =========================================================================================
|
||||
#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
|
||||
|
||||
//! \ingroup nvapitypes
|
||||
#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
|
||||
|
||||
//! \ingroup nvapitypes
|
||||
#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
|
||||
|
||||
|
||||
// ====================================================
|
||||
//! NvAPI Status Values
|
||||
//! All NvAPI functions return one of these codes.
|
||||
//! \ingroup nvapistatus
|
||||
// ====================================================
|
||||
|
||||
|
||||
typedef enum _NvAPI_Status
|
||||
{
|
||||
NVAPI_OK = 0, //!< Success. Request is completed.
|
||||
NVAPI_ERROR = -1, //!< Generic error
|
||||
NVAPI_LIBRARY_NOT_FOUND = -2, //!< NVAPI support library cannot be loaded.
|
||||
NVAPI_NO_IMPLEMENTATION = -3, //!< not implemented in current driver installation
|
||||
NVAPI_API_NOT_INITIALIZED = -4, //!< NvAPI_Initialize has not been called (successfully)
|
||||
NVAPI_INVALID_ARGUMENT = -5, //!< The argument/parameter value is not valid or NULL.
|
||||
NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, //!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found.
|
||||
NVAPI_END_ENUMERATION = -7, //!< No more items to enumerate
|
||||
NVAPI_INVALID_HANDLE = -8, //!< Invalid handle
|
||||
NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, //!< An argument's structure version is not supported
|
||||
NVAPI_HANDLE_INVALIDATED = -10, //!< The handle is no longer valid (likely due to GPU or display re-configuration)
|
||||
NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, //!< No NVIDIA OpenGL context is current (but needs to be)
|
||||
NVAPI_INVALID_POINTER = -14, //!< An invalid pointer, usually NULL, was passed as a parameter
|
||||
NVAPI_NO_GL_EXPERT = -12, //!< OpenGL Expert is not supported by the current drivers
|
||||
NVAPI_INSTRUMENTATION_DISABLED = -13, //!< OpenGL Expert is supported, but driver instrumentation is currently disabled
|
||||
NVAPI_NO_GL_NSIGHT = -15, //!< OpenGL does not support Nsight
|
||||
|
||||
NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, //!< Expected a logical GPU handle for one or more parameters
|
||||
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, //!< Expected a physical GPU handle for one or more parameters
|
||||
NVAPI_EXPECTED_DISPLAY_HANDLE = -102, //!< Expected an NV display handle for one or more parameters
|
||||
NVAPI_INVALID_COMBINATION = -103, //!< The combination of parameters is not valid.
|
||||
NVAPI_NOT_SUPPORTED = -104, //!< Requested feature is not supported in the selected GPU
|
||||
NVAPI_PORTID_NOT_FOUND = -105, //!< No port ID was found for the I2C transaction
|
||||
NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, //!< Expected an unattached display handle as one of the input parameters.
|
||||
NVAPI_INVALID_PERF_LEVEL = -107, //!< Invalid perf level
|
||||
NVAPI_DEVICE_BUSY = -108, //!< Device is busy; request not fulfilled
|
||||
NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, //!< NV persist file is not found
|
||||
NVAPI_PERSIST_DATA_NOT_FOUND = -110, //!< NV persist data is not found
|
||||
NVAPI_EXPECTED_TV_DISPLAY = -111, //!< Expected a TV output display
|
||||
NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, //!< Expected a TV output on the D Connector - HDTV_EIAJ4120.
|
||||
NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, //!< SLI is not active on this device.
|
||||
NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, //!< Setup of SLI rendering mode is not possible right now.
|
||||
NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, //!< Expected a digital flat panel.
|
||||
NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, //!< Argument exceeds the expected size.
|
||||
NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, //!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active.
|
||||
NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, //!< Testing of clocks is not supported.
|
||||
NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, //!< The specified underscan config is from an unknown source (e.g. INF)
|
||||
NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, //!< Timeout while reconfiguring GPUs
|
||||
NVAPI_DATA_NOT_FOUND = -121, //!< Requested data was not found
|
||||
NVAPI_EXPECTED_ANALOG_DISPLAY = -122, //!< Expected an analog display
|
||||
NVAPI_NO_VIDLINK = -123, //!< No SLI video bridge is present
|
||||
NVAPI_REQUIRES_REBOOT = -124, //!< NVAPI requires a reboot for the settings to take effect
|
||||
NVAPI_INVALID_HYBRID_MODE = -125, //!< The function is not supported with the current Hybrid mode.
|
||||
NVAPI_MIXED_TARGET_TYPES = -126, //!< The target types are not all the same
|
||||
NVAPI_SYSWOW64_NOT_SUPPORTED = -127, //!< The function is not supported from 32-bit on a 64-bit system.
|
||||
NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology.
|
||||
NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //!< Prompt the user to close all non-migratable applications.
|
||||
NVAPI_OUT_OF_MEMORY = -130, //!< Could not allocate sufficient memory to complete the call.
|
||||
NVAPI_WAS_STILL_DRAWING = -131, //!< The previous operation that is transferring information to or from this surface is incomplete.
|
||||
NVAPI_FILE_NOT_FOUND = -132, //!< The file was not found.
|
||||
NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, //!< There are too many unique instances of a particular type of state object.
|
||||
NVAPI_INVALID_CALL = -134, //!< The method call is invalid. For example, a method's parameter may not be a valid pointer.
|
||||
NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, //!< d3d10_1.dll cannot be loaded.
|
||||
NVAPI_FUNCTION_NOT_FOUND = -136, //!< Couldn't find the function in the loaded DLL.
|
||||
NVAPI_INVALID_USER_PRIVILEGE = -137, //!< The application will require Administrator privileges to access this API.
|
||||
//!< The application can be elevated to a higher permission level by selecting "Run as Administrator".
|
||||
NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, //!< The handle corresponds to GDIPrimary.
|
||||
NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, //!< Setting Physx GPU requires that the GPU is compute-capable.
|
||||
NVAPI_STEREO_NOT_INITIALIZED = -140, //!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed.
|
||||
NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, //!< Access to stereo-related registry keys or values has failed.
|
||||
NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, //!< The given registry profile type is not supported.
|
||||
NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, //!< The given registry value is not supported.
|
||||
NVAPI_STEREO_NOT_ENABLED = -144, //!< Stereo is not enabled and the function needed it to execute completely.
|
||||
NVAPI_STEREO_NOT_TURNED_ON = -145, //!< Stereo is not turned on and the function needed it to execute completely.
|
||||
NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, //!< Invalid device interface.
|
||||
NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, //!< Separation percentage or JPEG image capture quality is out of [0-100] range.
|
||||
NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, //!< The given frustum adjust mode is not supported.
|
||||
NVAPI_TOPO_NOT_POSSIBLE = -149, //!< The mosaic topology is not possible given the current state of the hardware.
|
||||
NVAPI_MODE_CHANGE_FAILED = -150, //!< An attempt to do a display resolution mode change has failed.
|
||||
NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, //!< d3d11.dll/d3d11_beta.dll cannot be loaded.
|
||||
NVAPI_INVALID_ADDRESS = -152, //!< Address is outside of valid range.
|
||||
NVAPI_STRING_TOO_SMALL = -153, //!< The pre-allocated string is too small to hold the result.
|
||||
NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, //!< The input does not match any of the available devices.
|
||||
NVAPI_DRIVER_RUNNING = -155, //!< Driver is running.
|
||||
NVAPI_DRIVER_NOTRUNNING = -156, //!< Driver is not running.
|
||||
NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, //!< A driver reload is required to apply these settings.
|
||||
NVAPI_SET_NOT_ALLOWED = -158, //!< Intended setting is not allowed.
|
||||
NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, //!< Information can't be returned due to "advanced display topology".
|
||||
NVAPI_SETTING_NOT_FOUND = -160, //!< Setting is not found.
|
||||
NVAPI_SETTING_SIZE_TOO_LARGE = -161, //!< Setting size is too large.
|
||||
NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, //!< There are too many settings for a profile.
|
||||
NVAPI_PROFILE_NOT_FOUND = -163, //!< Profile is not found.
|
||||
NVAPI_PROFILE_NAME_IN_USE = -164, //!< Profile name is duplicated.
|
||||
NVAPI_PROFILE_NAME_EMPTY = -165, //!< Profile name is empty.
|
||||
NVAPI_EXECUTABLE_NOT_FOUND = -166, //!< Application not found in the Profile.
|
||||
NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, //!< Application already exists in the other profile.
|
||||
NVAPI_DATATYPE_MISMATCH = -168, //!< Data Type mismatch
|
||||
NVAPI_PROFILE_REMOVED = -169, //!< The profile passed as parameter has been removed and is no longer valid.
|
||||
NVAPI_UNREGISTERED_RESOURCE = -170, //!< An unregistered resource was passed as a parameter.
|
||||
NVAPI_ID_OUT_OF_RANGE = -171, //!< The DisplayId corresponds to a display which is not within the normal outputId range.
|
||||
NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, //!< Display topology is not valid so the driver cannot do a mode set on this configuration.
|
||||
NVAPI_DPMST_CHANGED = -173, //!< Display Port Multi-Stream topology has been changed.
|
||||
NVAPI_INSUFFICIENT_BUFFER = -174, //!< Input buffer is insufficient to hold the contents.
|
||||
NVAPI_ACCESS_DENIED = -175, //!< No access to the caller.
|
||||
NVAPI_MOSAIC_NOT_ACTIVE = -176, //!< The requested action cannot be performed without Mosaic being enabled.
|
||||
NVAPI_SHARE_RESOURCE_RELOCATED = -177, //!< The surface is relocated away from video memory.
|
||||
NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, //!< The user should disable DWM before calling NvAPI.
|
||||
NVAPI_D3D_DEVICE_LOST = -179, //!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device.
|
||||
NVAPI_INVALID_CONFIGURATION = -180, //!< The requested action cannot be performed in the current state.
|
||||
NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, //!< Call failed as stereo handshake not completed.
|
||||
NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, //!< The path provided was too short to determine the correct NVDRS_APPLICATION
|
||||
NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, //!< Default stereo profile is not currently defined
|
||||
NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, //!< Default stereo profile does not exist
|
||||
NVAPI_CLUSTER_ALREADY_EXISTS = -185, //!< A cluster is already defined with the given configuration.
|
||||
NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, //!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology
|
||||
NVAPI_INVALID_DISPLAY_ID = -187, //!< The input display id is not valid or the monitor associated to it does not support the current operation
|
||||
NVAPI_STREAM_IS_OUT_OF_SYNC = -188, //!< While playing secure audio stream, stream goes out of sync
|
||||
NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, //!< Older audio driver version than required
|
||||
NVAPI_VALUE_ALREADY_SET = -190, //!< Value already set, setting again not allowed.
|
||||
NVAPI_TIMEOUT = -191, //!< Requested operation timed out
|
||||
NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, //!< The requested workstation feature set has incomplete driver internal allocation resources
|
||||
NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, //!< Call failed because InitActivation was not called.
|
||||
NVAPI_SYNC_NOT_ACTIVE = -194, //!< The requested action cannot be performed without Sync being enabled.
|
||||
NVAPI_SYNC_MASTER_NOT_FOUND = -195, //!< The requested action cannot be performed without Sync Master being enabled.
|
||||
NVAPI_INVALID_SYNC_TOPOLOGY = -196, //!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer.
|
||||
NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, //!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value.
|
||||
NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, //!< The encrypted public key verification has failed.
|
||||
NVAPI_FIRMWARE_OUT_OF_DATE = -199, //!< The device's firmware is out of date.
|
||||
NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED = -200, //!< The device's firmware is not supported.
|
||||
NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED = -201, //!< The caller is not authorized to modify the License.
|
||||
NVAPI_D3D_DEVICE_NOT_REGISTERED = -202, //!< The user tried to use a deferred context without registering the device first
|
||||
NVAPI_RESOURCE_NOT_ACQUIRED = -203, //!< Head or SourceId was not reserved for the VR Display before doing the Modeset or the dedicated display.
|
||||
NVAPI_TIMING_NOT_SUPPORTED = -204, //!< Provided timing is not supported.
|
||||
NVAPI_HDCP_ENCRYPTION_FAILED = -205, //!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable.
|
||||
NVAPI_PCLK_LIMITATION_FAILED = -206, //!< Provided mode is over sink device pclk limitation.
|
||||
NVAPI_NO_CONNECTOR_FOUND = -207, //!< No connector on GPU found.
|
||||
NVAPI_HDCP_DISABLED = -208, //!< When a non-HDCP capable HMD is connected, we would inform user by this code.
|
||||
NVAPI_API_IN_USE = -209, //!< Atleast an API is still being called
|
||||
NVAPI_NVIDIA_DISPLAY_NOT_FOUND = -210, //!< No display found on Nvidia GPU(s).
|
||||
NVAPI_PRIV_SEC_VIOLATION = -211, //!< Priv security violation, improper access to a secured register.
|
||||
NVAPI_INCORRECT_VENDOR = -212, //!< NVAPI cannot be called by this vendor
|
||||
NVAPI_DISPLAY_IN_USE = -213, //!< DirectMode Display is already in use
|
||||
NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD = -214, //!< The Config is having Non-NVidia GPU with Non-HDCP HMD connected
|
||||
NVAPI_MAX_DISPLAY_LIMIT_REACHED = -215, //!< GPU's Max Display Limit has Reached
|
||||
NVAPI_INVALID_DIRECT_MODE_DISPLAY = -216, //!< DirectMode not Enabled on the Display
|
||||
NVAPI_GPU_IN_DEBUG_MODE = -217, //!< GPU is in debug mode, OC is NOT allowed.
|
||||
NVAPI_D3D_CONTEXT_NOT_FOUND = -218, //!< No NvAPI context was found for this D3D object
|
||||
NVAPI_STEREO_VERSION_MISMATCH = -219, //!< there is version mismatch between stereo driver and dx driver
|
||||
NVAPI_GPU_NOT_POWERED = -220, //!< GPU is not powered and so the request cannot be completed.
|
||||
NVAPI_ERROR_DRIVER_RELOAD_IN_PROGRESS = -221, //!< The display driver update in progress.
|
||||
NVAPI_WAIT_FOR_HW_RESOURCE = -222, //!< Wait for HW resources allocation
|
||||
NVAPI_REQUIRE_FURTHER_HDCP_ACTION = -223, //!< operation requires further HDCP action
|
||||
NVAPI_DISPLAY_MUX_TRANSITION_FAILED = -224, //!< Dynamic Mux transition failure
|
||||
NVAPI_INVALID_DSC_VERSION = -225, //!< Invalid DSC version
|
||||
NVAPI_INVALID_DSC_SLICECOUNT = -226, //!< Invalid DSC slice count
|
||||
NVAPI_INVALID_DSC_OUTPUT_BPP = -227, //!< Invalid DSC output BPP
|
||||
NVAPI_FAILED_TO_LOAD_FROM_DRIVER_STORE = -228, //!< There was an error while loading nvapi.dll from the driver store.
|
||||
NVAPI_NO_VULKAN = -229, //!< OpenGL does not export Vulkan fake extensions
|
||||
NVAPI_REQUEST_PENDING = -230, //!< A request for NvTOPPs telemetry CData has already been made and is pending a response.
|
||||
NVAPI_RESOURCE_IN_USE = -231, //!< Operation cannot be performed because the resource is in use.
|
||||
NVAPI_INVALID_IMAGE = -232, //!< Device kernel image is invalid
|
||||
NVAPI_INVALID_PTX = -233, //!< PTX JIT compilation failed
|
||||
NVAPI_NVLINK_UNCORRECTABLE = -234, //!< Uncorrectable NVLink error was detected during the execution
|
||||
NVAPI_JIT_COMPILER_NOT_FOUND = -235, //!< PTX JIT compiler library was not found.
|
||||
NVAPI_INVALID_SOURCE = -236, //!< Device kernel source is invalid.
|
||||
NVAPI_ILLEGAL_INSTRUCTION = -237, //!< While executing a kernel, the device encountered an illegal instruction.
|
||||
NVAPI_INVALID_PC = -238, //!< While executing a kernel, the device program counter wrapped its address space
|
||||
NVAPI_LAUNCH_FAILED = -239, //!< An exception occurred on the device while executing a kernel
|
||||
NVAPI_NOT_PERMITTED = -240, //!< Attempted operation is not permitted.
|
||||
NVAPI_CALLBACK_ALREADY_REGISTERED = -241, //!< The callback function has already been registered.
|
||||
NVAPI_CALLBACK_NOT_FOUND = -242, //!< The callback function is not found or not registered.
|
||||
} NvAPI_Status;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion
|
||||
//
|
||||
//! DESCRIPTION: This API returns display driver version and driver-branch string.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [out] pDriverVersion Contains the driver version after successful return.
|
||||
//! \param [out] szBuildBranchString Contains the driver-branch string after successful return.
|
||||
//!
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big
|
||||
//! \retval ::NVAPI_OK - completed request
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
|
||||
//! \retval ::NVAPI_ERROR - miscellaneous error occurred
|
||||
//!
|
||||
//! \ingroup driverapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString);
|
||||
//! \ingroup driverapi
|
||||
//! Used in NvAPI_GPU_GetMemoryInfo().
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Version info
|
||||
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
|
||||
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
|
||||
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
|
||||
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
|
||||
|
||||
} NV_DISPLAY_DRIVER_MEMORY_INFO_V1;
|
||||
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Used in NvAPI_GPU_GetMemoryInfo().
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Version info
|
||||
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
|
||||
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
|
||||
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
|
||||
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
|
||||
NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
|
||||
|
||||
} NV_DISPLAY_DRIVER_MEMORY_INFO_V2;
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Used in NvAPI_GPU_GetMemoryInfo().
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Version info
|
||||
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
|
||||
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
|
||||
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
|
||||
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
|
||||
NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
|
||||
NvU32 dedicatedVideoMemoryEvictionsSize; //!< Size(in kb) of the total size of memory released as a result of the evictions.
|
||||
NvU32 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU
|
||||
//!< video memory to make room for other allocations.
|
||||
} NV_DISPLAY_DRIVER_MEMORY_INFO_V3;
|
||||
|
||||
//! \ingroup driverapi
|
||||
typedef NV_DISPLAY_DRIVER_MEMORY_INFO_V3 NV_DISPLAY_DRIVER_MEMORY_INFO;
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V1
|
||||
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V1,1)
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V2
|
||||
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V2,2)
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V3
|
||||
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3,3)
|
||||
|
||||
//! \ingroup driverapi
|
||||
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_GPU_GetMemoryInfo
|
||||
//
|
||||
//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU.
|
||||
//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_DISPLAY_DRIVER_MEMORY_INFO).
|
||||
//!
|
||||
//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! TCC_SUPPORTED
|
||||
//!
|
||||
//! \since Release: 177
|
||||
//!
|
||||
//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted.
|
||||
//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_DISPLAY_DRIVER_MEMORY_INFO.
|
||||
//!
|
||||
//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL.
|
||||
//! \retval NVAPI_OK Call successful.
|
||||
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
|
||||
//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_DISPLAY_DRIVER_MEMORY_INFO structure version mismatch.
|
||||
//!
|
||||
//! \ingroup driverapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.")
|
||||
NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_DISPLAY_DRIVER_MEMORY_INFO *pMemoryInfo);
|
||||
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Used in NvAPI_GPU_GetMemoryInfoEx().
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Structure version
|
||||
NvU64 dedicatedVideoMemory; //!< Size(in bytes) of the physical framebuffer.
|
||||
NvU64 availableDedicatedVideoMemory; //!< Size(in bytes) of the available physical framebuffer for allocating video memory surfaces.
|
||||
NvU64 systemVideoMemory; //!< Size(in bytes) of system memory the driver allocates at load time.
|
||||
NvU64 sharedSystemMemory; //!< Size(in bytes) of shared system memory that driver is allowed to commit for surfaces across all allocations.
|
||||
NvU64 curAvailableDedicatedVideoMemory; //!< Size(in bytes) of the current available physical framebuffer for allocating video memory surfaces.
|
||||
NvU64 dedicatedVideoMemoryEvictionsSize; //!< Size(in bytes) of the total size of memory released as a result of the evictions.
|
||||
NvU64 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU
|
||||
//!< video memory to make room for other allocations.
|
||||
NvU64 dedicatedVideoMemoryPromotionsSize; //!< Size(in bytes) of the total size of memory allocated as a result of the promotions.
|
||||
NvU64 dedicatedVideoMemoryPromotionCount; //!< Indicates the number of promotion events that caused an allocation to be promoted to dedicated video memory
|
||||
} NV_GPU_MEMORY_INFO_EX_V1;
|
||||
|
||||
//! \ingroup driverapi
|
||||
typedef NV_GPU_MEMORY_INFO_EX_V1 NV_GPU_MEMORY_INFO_EX;
|
||||
|
||||
//! \ingroup driverapi
|
||||
//! Macro for constructing the version field of NV_GPU_MEMORY_INFO_EX_V1
|
||||
#define NV_GPU_MEMORY_INFO_EX_VER_1 MAKE_NVAPI_VERSION(NV_GPU_MEMORY_INFO_EX_V1,1)
|
||||
|
||||
//! \ingroup driverapi
|
||||
#define NV_GPU_MEMORY_INFO_EX_VER NV_GPU_MEMORY_INFO_EX_VER_1
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_GPU_GetMemoryInfoEx
|
||||
//
|
||||
//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU.
|
||||
//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_GPU_MEMORY_INFO_EX).
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 10 and higher
|
||||
//!
|
||||
//!
|
||||
//! TCC_SUPPORTED
|
||||
//!
|
||||
//! \since Release: 520
|
||||
//!
|
||||
//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted.
|
||||
//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_GPU_MEMORY_INFO_EX.
|
||||
//!
|
||||
//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL.
|
||||
//! \retval NVAPI_OK Call successful.
|
||||
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
|
||||
//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_GPU_MEMORY_INFO_EX structure version mismatch.
|
||||
//!
|
||||
//! \ingroup driverapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_MEMORY_INFO_EX *pMemoryInfo);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_EnumPhysicalGPUs
|
||||
//
|
||||
//! This function returns an array of physical GPU handles.
|
||||
//! Each handle represents a physical GPU present in the system.
|
||||
//! That GPU may be part of an SLI configuration, or may not be visible to the OS directly.
|
||||
//!
|
||||
//! At least one GPU must be present in the system and running an NVIDIA display driver.
|
||||
//!
|
||||
//! The array nvGPUHandle will be filled with physical GPU handle values. The returned
|
||||
//! gpuCount determines how many entries in the array are valid.
|
||||
//!
|
||||
//! \note In drivers older than 105.00, all physical GPU handles get invalidated on a
|
||||
//! modeset. So the calling applications need to renum the handles after every modeset.\n
|
||||
//! With drivers 105.00 and up, all physical GPU handles are constant.
|
||||
//! Physical GPU handles are constant as long as the GPUs are not physically moved and
|
||||
//! the SBIOS VGA order is unchanged.
|
||||
//!
|
||||
//! For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs()
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \par Introduced in
|
||||
//! \since Release: 80
|
||||
//!
|
||||
//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL
|
||||
//! \retval NVAPI_OK One or more handles were returned
|
||||
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
|
||||
//! \ingroup gpu
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
|
||||
|
||||
NV_DECLARE_HANDLE(NVDX_ObjectHandle); // DX Objects
|
||||
static const NVDX_ObjectHandle NVDX_OBJECT_NONE = 0;
|
||||
|
||||
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D_GetObjectHandleForResource
|
||||
//
|
||||
//! DESCRIPTION: This API gets a handle to a resource.
|
||||
//!
|
||||
//! \param [in] pDev The ID3D11Device, ID3D10Device or IDirect3DDevice9 or ID3D11DeviceContext to use
|
||||
//! \param [in] pResource The ID3D11Resource, ID3D10Resource or IDirect3DResource9 from which
|
||||
//! we want the NvAPI handle
|
||||
//! \param [out] pHandle A handle to the resource
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \return ::NVAPI_OK if the handle was populated.
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D_GetObjectHandleForResource(
|
||||
IUnknown *pDevice,
|
||||
IUnknown *pResource,
|
||||
NVDX_ObjectHandle *pHandle);
|
||||
|
||||
|
||||
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
|
||||
|
||||
#include"nvapi_lite_salend.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#pragma pack(pop)
|
191
externals/nvapi/nvapi_lite_d3dext.h
vendored
Normal file
191
externals/nvapi/nvapi_lite_d3dext.h
vendored
Normal file
@ -0,0 +1,191 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
#pragma once
|
||||
#include"nvapi_lite_salstart.h"
|
||||
#include"nvapi_lite_common.h"
|
||||
#pragma pack(push,8)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
|
||||
//! \ingroup dx
|
||||
//! D3D_FEATURE_LEVEL supported - used in NvAPI_D3D11_CreateDevice() and NvAPI_D3D11_CreateDeviceAndSwapChain()
|
||||
typedef enum
|
||||
{
|
||||
NVAPI_DEVICE_FEATURE_LEVEL_NULL = -1,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL_10_0 = 0,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL_10_0_PLUS = 1,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL_10_1 = 2,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL_11_0 = 3,
|
||||
} NVAPI_DEVICE_FEATURE_LEVEL;
|
||||
|
||||
#endif //defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
|
||||
#if defined(__cplusplus) && defined(__d3d11_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D11_CreateDevice
|
||||
//
|
||||
//! DESCRIPTION: This function tries to create a DirectX 11 device. If the call fails (if we are running
|
||||
//! on pre-DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR DirectX 10.0+
|
||||
//! OR DirectX 10.0 device. The function call is the same as D3D11CreateDevice(), but with an extra
|
||||
//! argument (D3D_FEATURE_LEVEL supported by the device) that the function fills in. This argument
|
||||
//! can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel is less than DirecX 10.0.
|
||||
//!
|
||||
//! NOTE: When NvAPI_D3D11_CreateDevice is called with 10+ feature level we have an issue on few set of
|
||||
//! tesla hardware (G80/G84/G86/G92/G94/G96) which does not support all feature level 10+ functionality
|
||||
//! e.g. calling driver with mismatch between RenderTarget and Depth Buffer. App developers should
|
||||
//! take into consideration such limitation when using NVAPI on such tesla hardwares.
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \param [in] pAdapter
|
||||
//! \param [in] DriverType
|
||||
//! \param [in] Software
|
||||
//! \param [in] Flags
|
||||
//! \param [in] *pFeatureLevels
|
||||
//! \param [in] FeatureLevels
|
||||
//! \param [in] SDKVersion
|
||||
//! \param [in] **ppDevice
|
||||
//! \param [in] *pFeatureLevel
|
||||
//! \param [in] **ppImmediateContext
|
||||
//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
|
||||
//!
|
||||
//! \return NVAPI_OK if the createDevice call succeeded.
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D11_CreateDevice(IDXGIAdapter* pAdapter,
|
||||
D3D_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
CONST D3D_FEATURE_LEVEL *pFeatureLevels,
|
||||
UINT FeatureLevels,
|
||||
UINT SDKVersion,
|
||||
ID3D11Device **ppDevice,
|
||||
D3D_FEATURE_LEVEL *pFeatureLevel,
|
||||
ID3D11DeviceContext **ppImmediateContext,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
|
||||
|
||||
|
||||
#endif //defined(__cplusplus) && defined(__d3d11_h__)
|
||||
#if defined(__cplusplus) && defined(__d3d11_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D11_CreateDeviceAndSwapChain
|
||||
//
|
||||
//! DESCRIPTION: This function tries to create a DirectX 11 device and swap chain. If the call fails (if we are
|
||||
//! running on pre=DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR
|
||||
//! DirectX 10.0+ OR DirectX 10.0 device. The function call is the same as D3D11CreateDeviceAndSwapChain,
|
||||
//! but with an extra argument (D3D_FEATURE_LEVEL supported by the device) that the function fills
|
||||
//! in. This argument can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel
|
||||
//! is less than DirectX 10.0.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \param [in] pAdapter
|
||||
//! \param [in] DriverType
|
||||
//! \param [in] Software
|
||||
//! \param [in] Flags
|
||||
//! \param [in] *pFeatureLevels
|
||||
//! \param [in] FeatureLevels
|
||||
//! \param [in] SDKVersion
|
||||
//! \param [in] *pSwapChainDesc
|
||||
//! \param [in] **ppSwapChain
|
||||
//! \param [in] **ppDevice
|
||||
//! \param [in] *pFeatureLevel
|
||||
//! \param [in] **ppImmediateContext
|
||||
//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
|
||||
//!
|
||||
//!return NVAPI_OK if the createDevice with swap chain call succeeded.
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D11_CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter,
|
||||
D3D_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
CONST D3D_FEATURE_LEVEL *pFeatureLevels,
|
||||
UINT FeatureLevels,
|
||||
UINT SDKVersion,
|
||||
CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
|
||||
IDXGISwapChain **ppSwapChain,
|
||||
ID3D11Device **ppDevice,
|
||||
D3D_FEATURE_LEVEL *pFeatureLevel,
|
||||
ID3D11DeviceContext **ppImmediateContext,
|
||||
NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
|
||||
|
||||
|
||||
|
||||
#endif //defined(__cplusplus) && defined(__d3d11_h__)
|
||||
#if defined(__cplusplus) && defined(__d3d11_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D11_SetDepthBoundsTest
|
||||
//
|
||||
//! DESCRIPTION: This function enables/disables the depth bounds test
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [in] pDeviceOrContext The device or device context to set depth bounds test
|
||||
//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test
|
||||
//! \param [in] fMinDepth The minimum depth for depth bounds test
|
||||
//! \param [in] fMaxDepth The maximum depth for depth bounds test
|
||||
//! The valid values for fMinDepth and fMaxDepth
|
||||
//! are such that 0 <= fMinDepth <= fMaxDepth <= 1
|
||||
//!
|
||||
//! \return ::NVAPI_OK if the depth bounds test was correcly enabled or disabled
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D11_SetDepthBoundsTest(IUnknown* pDeviceOrContext,
|
||||
NvU32 bEnable,
|
||||
float fMinDepth,
|
||||
float fMaxDepth);
|
||||
|
||||
#endif //defined(__cplusplus) && defined(__d3d11_h__)
|
||||
|
||||
#include"nvapi_lite_salend.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#pragma pack(pop)
|
816
externals/nvapi/nvapi_lite_salend.h
vendored
Normal file
816
externals/nvapi/nvapi_lite_salend.h
vendored
Normal file
@ -0,0 +1,816 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
#ifndef __NVAPI_EMPTY_SAL
|
||||
#ifdef __nvapi_undef__ecount
|
||||
#undef __ecount
|
||||
#undef __nvapi_undef__ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__bcount
|
||||
#undef __bcount
|
||||
#undef __nvapi_undef__bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in
|
||||
#undef __in
|
||||
#undef __nvapi_undef__in
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount
|
||||
#undef __in_ecount
|
||||
#undef __nvapi_undef__in_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount
|
||||
#undef __in_bcount
|
||||
#undef __nvapi_undef__in_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_z
|
||||
#undef __in_z
|
||||
#undef __nvapi_undef__in_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount_z
|
||||
#undef __in_ecount_z
|
||||
#undef __nvapi_undef__in_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount_z
|
||||
#undef __in_bcount_z
|
||||
#undef __nvapi_undef__in_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_nz
|
||||
#undef __in_nz
|
||||
#undef __nvapi_undef__in_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount_nz
|
||||
#undef __in_ecount_nz
|
||||
#undef __nvapi_undef__in_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount_nz
|
||||
#undef __in_bcount_nz
|
||||
#undef __nvapi_undef__in_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out
|
||||
#undef __out
|
||||
#undef __nvapi_undef__out
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount
|
||||
#undef __out_ecount
|
||||
#undef __nvapi_undef__out_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount
|
||||
#undef __out_bcount
|
||||
#undef __nvapi_undef__out_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_part
|
||||
#undef __out_ecount_part
|
||||
#undef __nvapi_undef__out_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_part
|
||||
#undef __out_bcount_part
|
||||
#undef __nvapi_undef__out_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_full
|
||||
#undef __out_ecount_full
|
||||
#undef __nvapi_undef__out_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_full
|
||||
#undef __out_bcount_full
|
||||
#undef __nvapi_undef__out_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_z
|
||||
#undef __out_z
|
||||
#undef __nvapi_undef__out_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_z_opt
|
||||
#undef __out_z_opt
|
||||
#undef __nvapi_undef__out_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_z
|
||||
#undef __out_ecount_z
|
||||
#undef __nvapi_undef__out_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_z
|
||||
#undef __out_bcount_z
|
||||
#undef __nvapi_undef__out_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_part_z
|
||||
#undef __out_ecount_part_z
|
||||
#undef __nvapi_undef__out_ecount_part_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_part_z
|
||||
#undef __out_bcount_part_z
|
||||
#undef __nvapi_undef__out_bcount_part_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_full_z
|
||||
#undef __out_ecount_full_z
|
||||
#undef __nvapi_undef__out_ecount_full_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_full_z
|
||||
#undef __out_bcount_full_z
|
||||
#undef __nvapi_undef__out_bcount_full_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_nz
|
||||
#undef __out_nz
|
||||
#undef __nvapi_undef__out_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_nz_opt
|
||||
#undef __out_nz_opt
|
||||
#undef __nvapi_undef__out_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_nz
|
||||
#undef __out_ecount_nz
|
||||
#undef __nvapi_undef__out_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_nz
|
||||
#undef __out_bcount_nz
|
||||
#undef __nvapi_undef__out_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout
|
||||
#undef __inout
|
||||
#undef __nvapi_undef__inout
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount
|
||||
#undef __inout_ecount
|
||||
#undef __nvapi_undef__inout_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount
|
||||
#undef __inout_bcount
|
||||
#undef __nvapi_undef__inout_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_part
|
||||
#undef __inout_ecount_part
|
||||
#undef __nvapi_undef__inout_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_part
|
||||
#undef __inout_bcount_part
|
||||
#undef __nvapi_undef__inout_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_full
|
||||
#undef __inout_ecount_full
|
||||
#undef __nvapi_undef__inout_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_full
|
||||
#undef __inout_bcount_full
|
||||
#undef __nvapi_undef__inout_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_z
|
||||
#undef __inout_z
|
||||
#undef __nvapi_undef__inout_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_z
|
||||
#undef __inout_ecount_z
|
||||
#undef __nvapi_undef__inout_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_z
|
||||
#undef __inout_bcount_z
|
||||
#undef __nvapi_undef__inout_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_nz
|
||||
#undef __inout_nz
|
||||
#undef __nvapi_undef__inout_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_nz
|
||||
#undef __inout_ecount_nz
|
||||
#undef __nvapi_undef__inout_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_nz
|
||||
#undef __inout_bcount_nz
|
||||
#undef __nvapi_undef__inout_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__ecount_opt
|
||||
#undef __ecount_opt
|
||||
#undef __nvapi_undef__ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__bcount_opt
|
||||
#undef __bcount_opt
|
||||
#undef __nvapi_undef__bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_opt
|
||||
#undef __in_opt
|
||||
#undef __nvapi_undef__in_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount_opt
|
||||
#undef __in_ecount_opt
|
||||
#undef __nvapi_undef__in_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount_opt
|
||||
#undef __in_bcount_opt
|
||||
#undef __nvapi_undef__in_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_z_opt
|
||||
#undef __in_z_opt
|
||||
#undef __nvapi_undef__in_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount_z_opt
|
||||
#undef __in_ecount_z_opt
|
||||
#undef __nvapi_undef__in_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount_z_opt
|
||||
#undef __in_bcount_z_opt
|
||||
#undef __nvapi_undef__in_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_nz_opt
|
||||
#undef __in_nz_opt
|
||||
#undef __nvapi_undef__in_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_ecount_nz_opt
|
||||
#undef __in_ecount_nz_opt
|
||||
#undef __nvapi_undef__in_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__in_bcount_nz_opt
|
||||
#undef __in_bcount_nz_opt
|
||||
#undef __nvapi_undef__in_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_opt
|
||||
#undef __out_opt
|
||||
#undef __nvapi_undef__out_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_opt
|
||||
#undef __out_ecount_opt
|
||||
#undef __nvapi_undef__out_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_opt
|
||||
#undef __out_bcount_opt
|
||||
#undef __nvapi_undef__out_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_part_opt
|
||||
#undef __out_ecount_part_opt
|
||||
#undef __nvapi_undef__out_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_part_opt
|
||||
#undef __out_bcount_part_opt
|
||||
#undef __nvapi_undef__out_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_full_opt
|
||||
#undef __out_ecount_full_opt
|
||||
#undef __nvapi_undef__out_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_full_opt
|
||||
#undef __out_bcount_full_opt
|
||||
#undef __nvapi_undef__out_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_z_opt
|
||||
#undef __out_ecount_z_opt
|
||||
#undef __nvapi_undef__out_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_z_opt
|
||||
#undef __out_bcount_z_opt
|
||||
#undef __nvapi_undef__out_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_part_z_opt
|
||||
#undef __out_ecount_part_z_opt
|
||||
#undef __nvapi_undef__out_ecount_part_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_part_z_opt
|
||||
#undef __out_bcount_part_z_opt
|
||||
#undef __nvapi_undef__out_bcount_part_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_full_z_opt
|
||||
#undef __out_ecount_full_z_opt
|
||||
#undef __nvapi_undef__out_ecount_full_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_full_z_opt
|
||||
#undef __out_bcount_full_z_opt
|
||||
#undef __nvapi_undef__out_bcount_full_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_ecount_nz_opt
|
||||
#undef __out_ecount_nz_opt
|
||||
#undef __nvapi_undef__out_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__out_bcount_nz_opt
|
||||
#undef __out_bcount_nz_opt
|
||||
#undef __nvapi_undef__out_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_opt
|
||||
#undef __inout_opt
|
||||
#undef __nvapi_undef__inout_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_opt
|
||||
#undef __inout_ecount_opt
|
||||
#undef __nvapi_undef__inout_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_opt
|
||||
#undef __inout_bcount_opt
|
||||
#undef __nvapi_undef__inout_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_part_opt
|
||||
#undef __inout_ecount_part_opt
|
||||
#undef __nvapi_undef__inout_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_part_opt
|
||||
#undef __inout_bcount_part_opt
|
||||
#undef __nvapi_undef__inout_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_full_opt
|
||||
#undef __inout_ecount_full_opt
|
||||
#undef __nvapi_undef__inout_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_full_opt
|
||||
#undef __inout_bcount_full_opt
|
||||
#undef __nvapi_undef__inout_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_z_opt
|
||||
#undef __inout_z_opt
|
||||
#undef __nvapi_undef__inout_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_z_opt
|
||||
#undef __inout_ecount_z_opt
|
||||
#undef __nvapi_undef__inout_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_z_opt
|
||||
#undef __inout_ecount_z_opt
|
||||
#undef __nvapi_undef__inout_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_z_opt
|
||||
#undef __inout_bcount_z_opt
|
||||
#undef __nvapi_undef__inout_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_nz_opt
|
||||
#undef __inout_nz_opt
|
||||
#undef __nvapi_undef__inout_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_ecount_nz_opt
|
||||
#undef __inout_ecount_nz_opt
|
||||
#undef __nvapi_undef__inout_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__inout_bcount_nz_opt
|
||||
#undef __inout_bcount_nz_opt
|
||||
#undef __nvapi_undef__inout_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_ecount
|
||||
#undef __deref_ecount
|
||||
#undef __nvapi_undef__deref_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_bcount
|
||||
#undef __deref_bcount
|
||||
#undef __nvapi_undef__deref_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out
|
||||
#undef __deref_out
|
||||
#undef __nvapi_undef__deref_out
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount
|
||||
#undef __deref_out_ecount
|
||||
#undef __nvapi_undef__deref_out_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount
|
||||
#undef __deref_out_bcount
|
||||
#undef __nvapi_undef__deref_out_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_part
|
||||
#undef __deref_out_ecount_part
|
||||
#undef __nvapi_undef__deref_out_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_part
|
||||
#undef __deref_out_bcount_part
|
||||
#undef __nvapi_undef__deref_out_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_full
|
||||
#undef __deref_out_ecount_full
|
||||
#undef __nvapi_undef__deref_out_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_full
|
||||
#undef __deref_out_bcount_full
|
||||
#undef __nvapi_undef__deref_out_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_z
|
||||
#undef __deref_out_z
|
||||
#undef __nvapi_undef__deref_out_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_z
|
||||
#undef __deref_out_ecount_z
|
||||
#undef __nvapi_undef__deref_out_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_z
|
||||
#undef __deref_out_bcount_z
|
||||
#undef __nvapi_undef__deref_out_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_nz
|
||||
#undef __deref_out_nz
|
||||
#undef __nvapi_undef__deref_out_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_nz
|
||||
#undef __deref_out_ecount_nz
|
||||
#undef __nvapi_undef__deref_out_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_nz
|
||||
#undef __deref_out_bcount_nz
|
||||
#undef __nvapi_undef__deref_out_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout
|
||||
#undef __deref_inout
|
||||
#undef __nvapi_undef__deref_inout
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_z
|
||||
#undef __deref_inout_z
|
||||
#undef __nvapi_undef__deref_inout_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount
|
||||
#undef __deref_inout_ecount
|
||||
#undef __nvapi_undef__deref_inout_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount
|
||||
#undef __deref_inout_bcount
|
||||
#undef __nvapi_undef__deref_inout_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_part
|
||||
#undef __deref_inout_ecount_part
|
||||
#undef __nvapi_undef__deref_inout_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_part
|
||||
#undef __deref_inout_bcount_part
|
||||
#undef __nvapi_undef__deref_inout_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_full
|
||||
#undef __deref_inout_ecount_full
|
||||
#undef __nvapi_undef__deref_inout_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_full
|
||||
#undef __deref_inout_bcount_full
|
||||
#undef __nvapi_undef__deref_inout_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_z
|
||||
#undef __deref_inout_z
|
||||
#undef __nvapi_undef__deref_inout_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_z
|
||||
#undef __deref_inout_ecount_z
|
||||
#undef __nvapi_undef__deref_inout_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_z
|
||||
#undef __deref_inout_bcount_z
|
||||
#undef __nvapi_undef__deref_inout_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_nz
|
||||
#undef __deref_inout_nz
|
||||
#undef __nvapi_undef__deref_inout_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_nz
|
||||
#undef __deref_inout_ecount_nz
|
||||
#undef __nvapi_undef__deref_inout_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_nz
|
||||
#undef __deref_inout_bcount_nz
|
||||
#undef __nvapi_undef__deref_inout_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_ecount_opt
|
||||
#undef __deref_ecount_opt
|
||||
#undef __nvapi_undef__deref_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_bcount_opt
|
||||
#undef __deref_bcount_opt
|
||||
#undef __nvapi_undef__deref_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_opt
|
||||
#undef __deref_out_opt
|
||||
#undef __nvapi_undef__deref_out_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_opt
|
||||
#undef __deref_out_ecount_opt
|
||||
#undef __nvapi_undef__deref_out_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_opt
|
||||
#undef __deref_out_bcount_opt
|
||||
#undef __nvapi_undef__deref_out_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_part_opt
|
||||
#undef __deref_out_ecount_part_opt
|
||||
#undef __nvapi_undef__deref_out_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_part_opt
|
||||
#undef __deref_out_bcount_part_opt
|
||||
#undef __nvapi_undef__deref_out_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_full_opt
|
||||
#undef __deref_out_ecount_full_opt
|
||||
#undef __nvapi_undef__deref_out_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_full_opt
|
||||
#undef __deref_out_bcount_full_opt
|
||||
#undef __nvapi_undef__deref_out_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_z_opt
|
||||
#undef __deref_out_z_opt
|
||||
#undef __nvapi_undef__deref_out_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_z_opt
|
||||
#undef __deref_out_ecount_z_opt
|
||||
#undef __nvapi_undef__deref_out_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_z_opt
|
||||
#undef __deref_out_bcount_z_opt
|
||||
#undef __nvapi_undef__deref_out_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_nz_opt
|
||||
#undef __deref_out_nz_opt
|
||||
#undef __nvapi_undef__deref_out_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_ecount_nz_opt
|
||||
#undef __deref_out_ecount_nz_opt
|
||||
#undef __nvapi_undef__deref_out_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_out_bcount_nz_opt
|
||||
#undef __deref_out_bcount_nz_opt
|
||||
#undef __nvapi_undef__deref_out_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_opt
|
||||
#undef __deref_inout_opt
|
||||
#undef __nvapi_undef__deref_inout_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_opt
|
||||
#undef __deref_inout_ecount_opt
|
||||
#undef __nvapi_undef__deref_inout_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_opt
|
||||
#undef __deref_inout_bcount_opt
|
||||
#undef __nvapi_undef__deref_inout_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_part_opt
|
||||
#undef __deref_inout_ecount_part_opt
|
||||
#undef __nvapi_undef__deref_inout_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_part_opt
|
||||
#undef __deref_inout_bcount_part_opt
|
||||
#undef __nvapi_undef__deref_inout_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_full_opt
|
||||
#undef __deref_inout_ecount_full_opt
|
||||
#undef __nvapi_undef__deref_inout_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_full_opt
|
||||
#undef __deref_inout_bcount_full_opt
|
||||
#undef __nvapi_undef__deref_inout_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_z_opt
|
||||
#undef __deref_inout_z_opt
|
||||
#undef __nvapi_undef__deref_inout_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_z_opt
|
||||
#undef __deref_inout_ecount_z_opt
|
||||
#undef __nvapi_undef__deref_inout_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_z_opt
|
||||
#undef __deref_inout_bcount_z_opt
|
||||
#undef __nvapi_undef__deref_inout_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_nz_opt
|
||||
#undef __deref_inout_nz_opt
|
||||
#undef __nvapi_undef__deref_inout_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_ecount_nz_opt
|
||||
#undef __deref_inout_ecount_nz_opt
|
||||
#undef __nvapi_undef__deref_inout_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_inout_bcount_nz_opt
|
||||
#undef __deref_inout_bcount_nz_opt
|
||||
#undef __nvapi_undef__deref_inout_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_ecount
|
||||
#undef __deref_opt_ecount
|
||||
#undef __nvapi_undef__deref_opt_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_bcount
|
||||
#undef __deref_opt_bcount
|
||||
#undef __nvapi_undef__deref_opt_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out
|
||||
#undef __deref_opt_out
|
||||
#undef __nvapi_undef__deref_opt_out
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_z
|
||||
#undef __deref_opt_out_z
|
||||
#undef __nvapi_undef__deref_opt_out_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount
|
||||
#undef __deref_opt_out_ecount
|
||||
#undef __nvapi_undef__deref_opt_out_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount
|
||||
#undef __deref_opt_out_bcount
|
||||
#undef __nvapi_undef__deref_opt_out_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_part
|
||||
#undef __deref_opt_out_ecount_part
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_part
|
||||
#undef __deref_opt_out_bcount_part
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_full
|
||||
#undef __deref_opt_out_ecount_full
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_full
|
||||
#undef __deref_opt_out_bcount_full
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout
|
||||
#undef __deref_opt_inout
|
||||
#undef __nvapi_undef__deref_opt_inout
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount
|
||||
#undef __deref_opt_inout_ecount
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount
|
||||
#undef __deref_opt_inout_bcount
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_part
|
||||
#undef __deref_opt_inout_ecount_part
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_part
|
||||
#undef __deref_opt_inout_bcount_part
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_part
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_full
|
||||
#undef __deref_opt_inout_ecount_full
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_full
|
||||
#undef __deref_opt_inout_bcount_full
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_full
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_z
|
||||
#undef __deref_opt_inout_z
|
||||
#undef __nvapi_undef__deref_opt_inout_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_z
|
||||
#undef __deref_opt_inout_ecount_z
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_z
|
||||
#undef __deref_opt_inout_bcount_z
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_z
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_nz
|
||||
#undef __deref_opt_inout_nz
|
||||
#undef __nvapi_undef__deref_opt_inout_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_nz
|
||||
#undef __deref_opt_inout_ecount_nz
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_nz
|
||||
#undef __deref_opt_inout_bcount_nz
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_nz
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_ecount_opt
|
||||
#undef __deref_opt_ecount_opt
|
||||
#undef __nvapi_undef__deref_opt_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_bcount_opt
|
||||
#undef __deref_opt_bcount_opt
|
||||
#undef __nvapi_undef__deref_opt_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_opt
|
||||
#undef __deref_opt_out_opt
|
||||
#undef __nvapi_undef__deref_opt_out_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_opt
|
||||
#undef __deref_opt_out_ecount_opt
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_opt
|
||||
#undef __deref_opt_out_bcount_opt
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_part_opt
|
||||
#undef __deref_opt_out_ecount_part_opt
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_part_opt
|
||||
#undef __deref_opt_out_bcount_part_opt
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_full_opt
|
||||
#undef __deref_opt_out_ecount_full_opt
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_full_opt
|
||||
#undef __deref_opt_out_bcount_full_opt
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_z_opt
|
||||
#undef __deref_opt_out_z_opt
|
||||
#undef __nvapi_undef__deref_opt_out_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_z_opt
|
||||
#undef __deref_opt_out_ecount_z_opt
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_z_opt
|
||||
#undef __deref_opt_out_bcount_z_opt
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_nz_opt
|
||||
#undef __deref_opt_out_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_out_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_ecount_nz_opt
|
||||
#undef __deref_opt_out_ecount_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_out_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_out_bcount_nz_opt
|
||||
#undef __deref_opt_out_bcount_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_out_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_opt
|
||||
#undef __deref_opt_inout_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_opt
|
||||
#undef __deref_opt_inout_ecount_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_opt
|
||||
#undef __deref_opt_inout_bcount_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_part_opt
|
||||
#undef __deref_opt_inout_ecount_part_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_part_opt
|
||||
#undef __deref_opt_inout_bcount_part_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_part_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_full_opt
|
||||
#undef __deref_opt_inout_ecount_full_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_full_opt
|
||||
#undef __deref_opt_inout_bcount_full_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_full_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_z_opt
|
||||
#undef __deref_opt_inout_z_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_z_opt
|
||||
#undef __deref_opt_inout_ecount_z_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_z_opt
|
||||
#undef __deref_opt_inout_bcount_z_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_z_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_nz_opt
|
||||
#undef __deref_opt_inout_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_ecount_nz_opt
|
||||
#undef __deref_opt_inout_ecount_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_ecount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_undef__deref_opt_inout_bcount_nz_opt
|
||||
#undef __deref_opt_inout_bcount_nz_opt
|
||||
#undef __nvapi_undef__deref_opt_inout_bcount_nz_opt
|
||||
#endif
|
||||
#ifdef __nvapi_success
|
||||
#undef __success
|
||||
#undef __nvapi_success
|
||||
#endif
|
||||
#ifdef __nvapi__Ret_notnull_
|
||||
#undef __nvapi__Ret_notnull_
|
||||
#undef _Ret_notnull_
|
||||
#endif
|
||||
#ifdef __nvapi__Post_writable_byte_size_
|
||||
#undef __nvapi__Post_writable_byte_size_
|
||||
#undef _Post_writable_byte_size_
|
||||
#endif
|
||||
#ifdef __nvapi_Outptr_
|
||||
#undef __nvapi_Outptr_
|
||||
#undef _Outptr_
|
||||
#endif
|
||||
|
||||
#endif // __NVAPI_EMPTY_SAL
|
821
externals/nvapi/nvapi_lite_salstart.h
vendored
Normal file
821
externals/nvapi/nvapi_lite_salstart.h
vendored
Normal file
@ -0,0 +1,821 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
// ====================================================
|
||||
// SAL related support
|
||||
// ====================================================
|
||||
|
||||
#ifndef __ecount
|
||||
#define __nvapi_undef__ecount
|
||||
#define __ecount(size)
|
||||
#endif
|
||||
#ifndef __bcount
|
||||
#define __nvapi_undef__bcount
|
||||
#define __bcount(size)
|
||||
#endif
|
||||
#ifndef __in
|
||||
#define __nvapi_undef__in
|
||||
#define __in
|
||||
#endif
|
||||
#ifndef __in_ecount
|
||||
#define __nvapi_undef__in_ecount
|
||||
#define __in_ecount(size)
|
||||
#endif
|
||||
#ifndef __in_bcount
|
||||
#define __nvapi_undef__in_bcount
|
||||
#define __in_bcount(size)
|
||||
#endif
|
||||
#ifndef __in_z
|
||||
#define __nvapi_undef__in_z
|
||||
#define __in_z
|
||||
#endif
|
||||
#ifndef __in_ecount_z
|
||||
#define __nvapi_undef__in_ecount_z
|
||||
#define __in_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __in_bcount_z
|
||||
#define __nvapi_undef__in_bcount_z
|
||||
#define __in_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __in_nz
|
||||
#define __nvapi_undef__in_nz
|
||||
#define __in_nz
|
||||
#endif
|
||||
#ifndef __in_ecount_nz
|
||||
#define __nvapi_undef__in_ecount_nz
|
||||
#define __in_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __in_bcount_nz
|
||||
#define __nvapi_undef__in_bcount_nz
|
||||
#define __in_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __out
|
||||
#define __nvapi_undef__out
|
||||
#define __out
|
||||
#endif
|
||||
#ifndef __out_ecount
|
||||
#define __nvapi_undef__out_ecount
|
||||
#define __out_ecount(size)
|
||||
#endif
|
||||
#ifndef __out_bcount
|
||||
#define __nvapi_undef__out_bcount
|
||||
#define __out_bcount(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_part
|
||||
#define __nvapi_undef__out_ecount_part
|
||||
#define __out_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __out_bcount_part
|
||||
#define __nvapi_undef__out_bcount_part
|
||||
#define __out_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __out_ecount_full
|
||||
#define __nvapi_undef__out_ecount_full
|
||||
#define __out_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_full
|
||||
#define __nvapi_undef__out_bcount_full
|
||||
#define __out_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __out_z
|
||||
#define __nvapi_undef__out_z
|
||||
#define __out_z
|
||||
#endif
|
||||
#ifndef __out_z_opt
|
||||
#define __nvapi_undef__out_z_opt
|
||||
#define __out_z_opt
|
||||
#endif
|
||||
#ifndef __out_ecount_z
|
||||
#define __nvapi_undef__out_ecount_z
|
||||
#define __out_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_z
|
||||
#define __nvapi_undef__out_bcount_z
|
||||
#define __out_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_part_z
|
||||
#define __nvapi_undef__out_ecount_part_z
|
||||
#define __out_ecount_part_z(size,length)
|
||||
#endif
|
||||
#ifndef __out_bcount_part_z
|
||||
#define __nvapi_undef__out_bcount_part_z
|
||||
#define __out_bcount_part_z(size,length)
|
||||
#endif
|
||||
#ifndef __out_ecount_full_z
|
||||
#define __nvapi_undef__out_ecount_full_z
|
||||
#define __out_ecount_full_z(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_full_z
|
||||
#define __nvapi_undef__out_bcount_full_z
|
||||
#define __out_bcount_full_z(size)
|
||||
#endif
|
||||
#ifndef __out_nz
|
||||
#define __nvapi_undef__out_nz
|
||||
#define __out_nz
|
||||
#endif
|
||||
#ifndef __out_nz_opt
|
||||
#define __nvapi_undef__out_nz_opt
|
||||
#define __out_nz_opt
|
||||
#endif
|
||||
#ifndef __out_ecount_nz
|
||||
#define __nvapi_undef__out_ecount_nz
|
||||
#define __out_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_nz
|
||||
#define __nvapi_undef__out_bcount_nz
|
||||
#define __out_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __inout
|
||||
#define __nvapi_undef__inout
|
||||
#define __inout
|
||||
#endif
|
||||
#ifndef __inout_ecount
|
||||
#define __nvapi_undef__inout_ecount
|
||||
#define __inout_ecount(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount
|
||||
#define __nvapi_undef__inout_bcount
|
||||
#define __inout_bcount(size)
|
||||
#endif
|
||||
#ifndef __inout_ecount_part
|
||||
#define __nvapi_undef__inout_ecount_part
|
||||
#define __inout_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __inout_bcount_part
|
||||
#define __nvapi_undef__inout_bcount_part
|
||||
#define __inout_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __inout_ecount_full
|
||||
#define __nvapi_undef__inout_ecount_full
|
||||
#define __inout_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_full
|
||||
#define __nvapi_undef__inout_bcount_full
|
||||
#define __inout_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __inout_z
|
||||
#define __nvapi_undef__inout_z
|
||||
#define __inout_z
|
||||
#endif
|
||||
#ifndef __inout_ecount_z
|
||||
#define __nvapi_undef__inout_ecount_z
|
||||
#define __inout_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_z
|
||||
#define __nvapi_undef__inout_bcount_z
|
||||
#define __inout_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __inout_nz
|
||||
#define __nvapi_undef__inout_nz
|
||||
#define __inout_nz
|
||||
#endif
|
||||
#ifndef __inout_ecount_nz
|
||||
#define __nvapi_undef__inout_ecount_nz
|
||||
#define __inout_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_nz
|
||||
#define __nvapi_undef__inout_bcount_nz
|
||||
#define __inout_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __ecount_opt
|
||||
#define __nvapi_undef__ecount_opt
|
||||
#define __ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __bcount_opt
|
||||
#define __nvapi_undef__bcount_opt
|
||||
#define __bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __in_opt
|
||||
#define __nvapi_undef__in_opt
|
||||
#define __in_opt
|
||||
#endif
|
||||
#ifndef __in_ecount_opt
|
||||
#define __nvapi_undef__in_ecount_opt
|
||||
#define __in_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __in_bcount_opt
|
||||
#define __nvapi_undef__in_bcount_opt
|
||||
#define __in_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __in_z_opt
|
||||
#define __nvapi_undef__in_z_opt
|
||||
#define __in_z_opt
|
||||
#endif
|
||||
#ifndef __in_ecount_z_opt
|
||||
#define __nvapi_undef__in_ecount_z_opt
|
||||
#define __in_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __in_bcount_z_opt
|
||||
#define __nvapi_undef__in_bcount_z_opt
|
||||
#define __in_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __in_nz_opt
|
||||
#define __nvapi_undef__in_nz_opt
|
||||
#define __in_nz_opt
|
||||
#endif
|
||||
#ifndef __in_ecount_nz_opt
|
||||
#define __nvapi_undef__in_ecount_nz_opt
|
||||
#define __in_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __in_bcount_nz_opt
|
||||
#define __nvapi_undef__in_bcount_nz_opt
|
||||
#define __in_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __out_opt
|
||||
#define __nvapi_undef__out_opt
|
||||
#define __out_opt
|
||||
#endif
|
||||
#ifndef __out_ecount_opt
|
||||
#define __nvapi_undef__out_ecount_opt
|
||||
#define __out_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_opt
|
||||
#define __nvapi_undef__out_bcount_opt
|
||||
#define __out_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_part_opt
|
||||
#define __nvapi_undef__out_ecount_part_opt
|
||||
#define __out_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __out_bcount_part_opt
|
||||
#define __nvapi_undef__out_bcount_part_opt
|
||||
#define __out_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __out_ecount_full_opt
|
||||
#define __nvapi_undef__out_ecount_full_opt
|
||||
#define __out_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_full_opt
|
||||
#define __nvapi_undef__out_bcount_full_opt
|
||||
#define __out_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_z_opt
|
||||
#define __nvapi_undef__out_ecount_z_opt
|
||||
#define __out_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_z_opt
|
||||
#define __nvapi_undef__out_bcount_z_opt
|
||||
#define __out_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_part_z_opt
|
||||
#define __nvapi_undef__out_ecount_part_z_opt
|
||||
#define __out_ecount_part_z_opt(size,length)
|
||||
#endif
|
||||
#ifndef __out_bcount_part_z_opt
|
||||
#define __nvapi_undef__out_bcount_part_z_opt
|
||||
#define __out_bcount_part_z_opt(size,length)
|
||||
#endif
|
||||
#ifndef __out_ecount_full_z_opt
|
||||
#define __nvapi_undef__out_ecount_full_z_opt
|
||||
#define __out_ecount_full_z_opt(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_full_z_opt
|
||||
#define __nvapi_undef__out_bcount_full_z_opt
|
||||
#define __out_bcount_full_z_opt(size)
|
||||
#endif
|
||||
#ifndef __out_ecount_nz_opt
|
||||
#define __nvapi_undef__out_ecount_nz_opt
|
||||
#define __out_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __out_bcount_nz_opt
|
||||
#define __nvapi_undef__out_bcount_nz_opt
|
||||
#define __out_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_opt
|
||||
#define __nvapi_undef__inout_opt
|
||||
#define __inout_opt
|
||||
#endif
|
||||
#ifndef __inout_ecount_opt
|
||||
#define __nvapi_undef__inout_ecount_opt
|
||||
#define __inout_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_opt
|
||||
#define __nvapi_undef__inout_bcount_opt
|
||||
#define __inout_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_ecount_part_opt
|
||||
#define __nvapi_undef__inout_ecount_part_opt
|
||||
#define __inout_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __inout_bcount_part_opt
|
||||
#define __nvapi_undef__inout_bcount_part_opt
|
||||
#define __inout_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __inout_ecount_full_opt
|
||||
#define __nvapi_undef__inout_ecount_full_opt
|
||||
#define __inout_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_full_opt
|
||||
#define __nvapi_undef__inout_bcount_full_opt
|
||||
#define __inout_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_z_opt
|
||||
#define __nvapi_undef__inout_z_opt
|
||||
#define __inout_z_opt
|
||||
#endif
|
||||
#ifndef __inout_ecount_z_opt
|
||||
#define __nvapi_undef__inout_ecount_z_opt
|
||||
#define __inout_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_ecount_z_opt
|
||||
#define __nvapi_undef__inout_ecount_z_opt
|
||||
#define __inout_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_z_opt
|
||||
#define __nvapi_undef__inout_bcount_z_opt
|
||||
#define __inout_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_nz_opt
|
||||
#define __nvapi_undef__inout_nz_opt
|
||||
#define __inout_nz_opt
|
||||
#endif
|
||||
#ifndef __inout_ecount_nz_opt
|
||||
#define __nvapi_undef__inout_ecount_nz_opt
|
||||
#define __inout_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __inout_bcount_nz_opt
|
||||
#define __nvapi_undef__inout_bcount_nz_opt
|
||||
#define __inout_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_ecount
|
||||
#define __nvapi_undef__deref_ecount
|
||||
#define __deref_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_bcount
|
||||
#define __nvapi_undef__deref_bcount
|
||||
#define __deref_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_out
|
||||
#define __nvapi_undef__deref_out
|
||||
#define __deref_out
|
||||
#endif
|
||||
#ifndef __deref_out_ecount
|
||||
#define __nvapi_undef__deref_out_ecount
|
||||
#define __deref_out_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount
|
||||
#define __nvapi_undef__deref_out_bcount
|
||||
#define __deref_out_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_part
|
||||
#define __nvapi_undef__deref_out_ecount_part
|
||||
#define __deref_out_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_part
|
||||
#define __nvapi_undef__deref_out_bcount_part
|
||||
#define __deref_out_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_full
|
||||
#define __nvapi_undef__deref_out_ecount_full
|
||||
#define __deref_out_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_full
|
||||
#define __nvapi_undef__deref_out_bcount_full
|
||||
#define __deref_out_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_out_z
|
||||
#define __nvapi_undef__deref_out_z
|
||||
#define __deref_out_z
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_z
|
||||
#define __nvapi_undef__deref_out_ecount_z
|
||||
#define __deref_out_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_z
|
||||
#define __nvapi_undef__deref_out_bcount_z
|
||||
#define __deref_out_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_out_nz
|
||||
#define __nvapi_undef__deref_out_nz
|
||||
#define __deref_out_nz
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_nz
|
||||
#define __nvapi_undef__deref_out_ecount_nz
|
||||
#define __deref_out_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_nz
|
||||
#define __nvapi_undef__deref_out_bcount_nz
|
||||
#define __deref_out_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_inout
|
||||
#define __nvapi_undef__deref_inout
|
||||
#define __deref_inout
|
||||
#endif
|
||||
#ifndef __deref_inout_z
|
||||
#define __nvapi_undef__deref_inout_z
|
||||
#define __deref_inout_z
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount
|
||||
#define __nvapi_undef__deref_inout_ecount
|
||||
#define __deref_inout_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount
|
||||
#define __nvapi_undef__deref_inout_bcount
|
||||
#define __deref_inout_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_part
|
||||
#define __nvapi_undef__deref_inout_ecount_part
|
||||
#define __deref_inout_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_part
|
||||
#define __nvapi_undef__deref_inout_bcount_part
|
||||
#define __deref_inout_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_full
|
||||
#define __nvapi_undef__deref_inout_ecount_full
|
||||
#define __deref_inout_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_full
|
||||
#define __nvapi_undef__deref_inout_bcount_full
|
||||
#define __deref_inout_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_z
|
||||
#define __nvapi_undef__deref_inout_z
|
||||
#define __deref_inout_z
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_z
|
||||
#define __nvapi_undef__deref_inout_ecount_z
|
||||
#define __deref_inout_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_z
|
||||
#define __nvapi_undef__deref_inout_bcount_z
|
||||
#define __deref_inout_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_nz
|
||||
#define __nvapi_undef__deref_inout_nz
|
||||
#define __deref_inout_nz
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_nz
|
||||
#define __nvapi_undef__deref_inout_ecount_nz
|
||||
#define __deref_inout_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_nz
|
||||
#define __nvapi_undef__deref_inout_bcount_nz
|
||||
#define __deref_inout_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_ecount_opt
|
||||
#define __nvapi_undef__deref_ecount_opt
|
||||
#define __deref_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_bcount_opt
|
||||
#define __nvapi_undef__deref_bcount_opt
|
||||
#define __deref_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_opt
|
||||
#define __nvapi_undef__deref_out_opt
|
||||
#define __deref_out_opt
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_opt
|
||||
#define __nvapi_undef__deref_out_ecount_opt
|
||||
#define __deref_out_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_opt
|
||||
#define __nvapi_undef__deref_out_bcount_opt
|
||||
#define __deref_out_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_part_opt
|
||||
#define __nvapi_undef__deref_out_ecount_part_opt
|
||||
#define __deref_out_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_part_opt
|
||||
#define __nvapi_undef__deref_out_bcount_part_opt
|
||||
#define __deref_out_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_full_opt
|
||||
#define __nvapi_undef__deref_out_ecount_full_opt
|
||||
#define __deref_out_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_full_opt
|
||||
#define __nvapi_undef__deref_out_bcount_full_opt
|
||||
#define __deref_out_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_z_opt
|
||||
#define __nvapi_undef__deref_out_z_opt
|
||||
#define __deref_out_z_opt
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_z_opt
|
||||
#define __nvapi_undef__deref_out_ecount_z_opt
|
||||
#define __deref_out_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_z_opt
|
||||
#define __nvapi_undef__deref_out_bcount_z_opt
|
||||
#define __deref_out_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_nz_opt
|
||||
#define __nvapi_undef__deref_out_nz_opt
|
||||
#define __deref_out_nz_opt
|
||||
#endif
|
||||
#ifndef __deref_out_ecount_nz_opt
|
||||
#define __nvapi_undef__deref_out_ecount_nz_opt
|
||||
#define __deref_out_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_out_bcount_nz_opt
|
||||
#define __nvapi_undef__deref_out_bcount_nz_opt
|
||||
#define __deref_out_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_opt
|
||||
#define __nvapi_undef__deref_inout_opt
|
||||
#define __deref_inout_opt
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_opt
|
||||
#define __nvapi_undef__deref_inout_ecount_opt
|
||||
#define __deref_inout_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_opt
|
||||
#define __nvapi_undef__deref_inout_bcount_opt
|
||||
#define __deref_inout_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_part_opt
|
||||
#define __nvapi_undef__deref_inout_ecount_part_opt
|
||||
#define __deref_inout_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_part_opt
|
||||
#define __nvapi_undef__deref_inout_bcount_part_opt
|
||||
#define __deref_inout_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_full_opt
|
||||
#define __nvapi_undef__deref_inout_ecount_full_opt
|
||||
#define __deref_inout_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_full_opt
|
||||
#define __nvapi_undef__deref_inout_bcount_full_opt
|
||||
#define __deref_inout_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_z_opt
|
||||
#define __nvapi_undef__deref_inout_z_opt
|
||||
#define __deref_inout_z_opt
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_z_opt
|
||||
#define __nvapi_undef__deref_inout_ecount_z_opt
|
||||
#define __deref_inout_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_z_opt
|
||||
#define __nvapi_undef__deref_inout_bcount_z_opt
|
||||
#define __deref_inout_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_nz_opt
|
||||
#define __nvapi_undef__deref_inout_nz_opt
|
||||
#define __deref_inout_nz_opt
|
||||
#endif
|
||||
#ifndef __deref_inout_ecount_nz_opt
|
||||
#define __nvapi_undef__deref_inout_ecount_nz_opt
|
||||
#define __deref_inout_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_inout_bcount_nz_opt
|
||||
#define __nvapi_undef__deref_inout_bcount_nz_opt
|
||||
#define __deref_inout_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_ecount
|
||||
#define __nvapi_undef__deref_opt_ecount
|
||||
#define __deref_opt_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_bcount
|
||||
#define __nvapi_undef__deref_opt_bcount
|
||||
#define __deref_opt_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out
|
||||
#define __nvapi_undef__deref_opt_out
|
||||
#define __deref_opt_out
|
||||
#endif
|
||||
#ifndef __deref_opt_out_z
|
||||
#define __nvapi_undef__deref_opt_out_z
|
||||
#define __deref_opt_out_z
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount
|
||||
#define __nvapi_undef__deref_opt_out_ecount
|
||||
#define __deref_opt_out_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount
|
||||
#define __nvapi_undef__deref_opt_out_bcount
|
||||
#define __deref_opt_out_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_part
|
||||
#define __nvapi_undef__deref_opt_out_ecount_part
|
||||
#define __deref_opt_out_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_part
|
||||
#define __nvapi_undef__deref_opt_out_bcount_part
|
||||
#define __deref_opt_out_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_full
|
||||
#define __nvapi_undef__deref_opt_out_ecount_full
|
||||
#define __deref_opt_out_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_full
|
||||
#define __nvapi_undef__deref_opt_out_bcount_full
|
||||
#define __deref_opt_out_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout
|
||||
#define __nvapi_undef__deref_opt_inout
|
||||
#define __deref_opt_inout
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount
|
||||
#define __nvapi_undef__deref_opt_inout_ecount
|
||||
#define __deref_opt_inout_ecount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount
|
||||
#define __nvapi_undef__deref_opt_inout_bcount
|
||||
#define __deref_opt_inout_bcount(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_part
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_part
|
||||
#define __deref_opt_inout_ecount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_part
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_part
|
||||
#define __deref_opt_inout_bcount_part(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_full
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_full
|
||||
#define __deref_opt_inout_ecount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_full
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_full
|
||||
#define __deref_opt_inout_bcount_full(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_z
|
||||
#define __nvapi_undef__deref_opt_inout_z
|
||||
#define __deref_opt_inout_z
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_z
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_z
|
||||
#define __deref_opt_inout_ecount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_z
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_z
|
||||
#define __deref_opt_inout_bcount_z(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_nz
|
||||
#define __nvapi_undef__deref_opt_inout_nz
|
||||
#define __deref_opt_inout_nz
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_nz
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_nz
|
||||
#define __deref_opt_inout_ecount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_nz
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_nz
|
||||
#define __deref_opt_inout_bcount_nz(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_ecount_opt
|
||||
#define __nvapi_undef__deref_opt_ecount_opt
|
||||
#define __deref_opt_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_bcount_opt
|
||||
#define __nvapi_undef__deref_opt_bcount_opt
|
||||
#define __deref_opt_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_opt
|
||||
#define __nvapi_undef__deref_opt_out_opt
|
||||
#define __deref_opt_out_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_opt
|
||||
#define __nvapi_undef__deref_opt_out_ecount_opt
|
||||
#define __deref_opt_out_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_opt
|
||||
#define __nvapi_undef__deref_opt_out_bcount_opt
|
||||
#define __deref_opt_out_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_part_opt
|
||||
#define __nvapi_undef__deref_opt_out_ecount_part_opt
|
||||
#define __deref_opt_out_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_part_opt
|
||||
#define __nvapi_undef__deref_opt_out_bcount_part_opt
|
||||
#define __deref_opt_out_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_full_opt
|
||||
#define __nvapi_undef__deref_opt_out_ecount_full_opt
|
||||
#define __deref_opt_out_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_full_opt
|
||||
#define __nvapi_undef__deref_opt_out_bcount_full_opt
|
||||
#define __deref_opt_out_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_z_opt
|
||||
#define __nvapi_undef__deref_opt_out_z_opt
|
||||
#define __deref_opt_out_z_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_z_opt
|
||||
#define __nvapi_undef__deref_opt_out_ecount_z_opt
|
||||
#define __deref_opt_out_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_z_opt
|
||||
#define __nvapi_undef__deref_opt_out_bcount_z_opt
|
||||
#define __deref_opt_out_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_nz_opt
|
||||
#define __nvapi_undef__deref_opt_out_nz_opt
|
||||
#define __deref_opt_out_nz_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_out_ecount_nz_opt
|
||||
#define __nvapi_undef__deref_opt_out_ecount_nz_opt
|
||||
#define __deref_opt_out_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_out_bcount_nz_opt
|
||||
#define __nvapi_undef__deref_opt_out_bcount_nz_opt
|
||||
#define __deref_opt_out_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_opt
|
||||
#define __nvapi_undef__deref_opt_inout_opt
|
||||
#define __deref_opt_inout_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_opt
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_opt
|
||||
#define __deref_opt_inout_ecount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_opt
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_opt
|
||||
#define __deref_opt_inout_bcount_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_part_opt
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_part_opt
|
||||
#define __deref_opt_inout_ecount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_part_opt
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_part_opt
|
||||
#define __deref_opt_inout_bcount_part_opt(size,length)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_full_opt
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_full_opt
|
||||
#define __deref_opt_inout_ecount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_full_opt
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_full_opt
|
||||
#define __deref_opt_inout_bcount_full_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_z_opt
|
||||
#define __nvapi_undef__deref_opt_inout_z_opt
|
||||
#define __deref_opt_inout_z_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_z_opt
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_z_opt
|
||||
#define __deref_opt_inout_ecount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_z_opt
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_z_opt
|
||||
#define __deref_opt_inout_bcount_z_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_nz_opt
|
||||
#define __nvapi_undef__deref_opt_inout_nz_opt
|
||||
#define __deref_opt_inout_nz_opt
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_ecount_nz_opt
|
||||
#define __nvapi_undef__deref_opt_inout_ecount_nz_opt
|
||||
#define __deref_opt_inout_ecount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __deref_opt_inout_bcount_nz_opt
|
||||
#define __nvapi_undef__deref_opt_inout_bcount_nz_opt
|
||||
#define __deref_opt_inout_bcount_nz_opt(size)
|
||||
#endif
|
||||
#ifndef __success
|
||||
#define __nvapi_success
|
||||
#define __success(epxr)
|
||||
#endif
|
||||
#ifndef _Ret_notnull_
|
||||
#define __nvapi__Ret_notnull_
|
||||
#define _Ret_notnull_
|
||||
#endif
|
||||
#ifndef _Post_writable_byte_size_
|
||||
#define __nvapi__Post_writable_byte_size_
|
||||
#define _Post_writable_byte_size_(n)
|
||||
#endif
|
||||
#ifndef _Outptr_
|
||||
#define __nvapi_Outptr_
|
||||
#define _Outptr_
|
||||
#endif
|
||||
|
||||
|
||||
#define NVAPI_INTERFACE extern __success(return == NVAPI_OK) NvAPI_Status __cdecl
|
255
externals/nvapi/nvapi_lite_sli.h
vendored
Normal file
255
externals/nvapi/nvapi_lite_sli.h
vendored
Normal file
@ -0,0 +1,255 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include"nvapi_lite_salstart.h"
|
||||
#include"nvapi_lite_common.h"
|
||||
#pragma pack(push,8)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// DirectX APIs
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//! \ingroup dx
|
||||
//! Used in NvAPI_D3D10_GetCurrentSLIState(), and NvAPI_D3D_GetCurrentSLIState().
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Structure version
|
||||
NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups
|
||||
NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system
|
||||
NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered
|
||||
NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)
|
||||
NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)
|
||||
NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group
|
||||
|
||||
} NV_GET_CURRENT_SLI_STATE_V1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; //!< Structure version
|
||||
NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups
|
||||
NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system
|
||||
NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered
|
||||
NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)
|
||||
NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)
|
||||
NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group
|
||||
NvU32 numVRSLIGpus; //!< [OUT] The number of GPUs used in VR-SLI. If it is 0 VR-SLI is not active
|
||||
|
||||
} NV_GET_CURRENT_SLI_STATE_V2;
|
||||
|
||||
//! \ingroup dx
|
||||
#define NV_GET_CURRENT_SLI_STATE_VER1 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V1,1)
|
||||
#define NV_GET_CURRENT_SLI_STATE_VER2 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V2,1)
|
||||
#define NV_GET_CURRENT_SLI_STATE_VER NV_GET_CURRENT_SLI_STATE_VER2
|
||||
#define NV_GET_CURRENT_SLI_STATE NV_GET_CURRENT_SLI_STATE_V2
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D_GetCurrentSLIState
|
||||
//
|
||||
//! DESCRIPTION: This function returns the current SLI state for the specified device. The structure
|
||||
//! contains the number of AFR groups, the current AFR group index,
|
||||
//! and what the AFR group index will be for the next frame. \p
|
||||
//! pDevice can be either a IDirect3DDevice9 or ID3D10Device pointer.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 173
|
||||
//!
|
||||
//! \retval NVAPI_OK Completed request
|
||||
//! \retval NVAPI_ERROR Error occurred
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET_CURRENT_SLI_STATE *pSliState);
|
||||
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D_SetResourceHint
|
||||
//
|
||||
//! \fn NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj,
|
||||
//! NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory,
|
||||
//! NvU32 dwHintName,
|
||||
//! NvU32 *pdwHintValue)
|
||||
//!
|
||||
//! DESCRIPTION: This is a general purpose function for passing down various resource
|
||||
//! related hints to the driver. Hints are divided into categories
|
||||
//! and types within each category. For DX11 devices this function is free-threaded.
|
||||
//! An application is responsible to complete this call before making use of the resource
|
||||
//! in a rendering context (therefore applying inter-thread synchronization as appropriate).
|
||||
//! As a debug help to an application the driver enforces that a resource in this call was never bound.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \param [in] pDev The ID3D10Device or IDirect3DDevice9 that is a using the resource
|
||||
//! \param [in] obj Previously obtained HV resource handle
|
||||
//! \param [in] dwHintCategory Category of the hints
|
||||
//! \param [in] dwHintName A hint within this category
|
||||
//! \param [in/out] *pdwHintValue Pointer to location containing hint value, function returns previous hint value in this slot
|
||||
//!
|
||||
//! \return an int which could be an NvAPI status or DX HRESULT code
|
||||
//!
|
||||
//! \retval ::NVAPI_OK
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT
|
||||
//! \retval ::NVAPI_INVALID_CALL It is illegal to change a hint dynamically when the resource is already bound.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//! \ingroup dx
|
||||
//! Valid categories for NvAPI_D3D_SetResourceHint()
|
||||
typedef enum _NVAPI_D3D_SETRESOURCEHINT_CATEGORY
|
||||
{
|
||||
NVAPI_D3D_SRH_CATEGORY_SLI = 1
|
||||
} NVAPI_D3D_SETRESOURCEHINT_CATEGORY;
|
||||
|
||||
|
||||
//
|
||||
// NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC:
|
||||
// NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USING:
|
||||
// NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC:
|
||||
|
||||
|
||||
//! \ingroup dx
|
||||
//! Types of SLI hints; \n
|
||||
//! NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n
|
||||
//! Default value: 0 \n
|
||||
//! Explanation: If the value is 1, the driver will not track any rendering operations that would mark this resource as dirty,
|
||||
//! avoiding any form of synchronization across frames rendered in parallel in multiple GPUs in AFR mode.
|
||||
//!
|
||||
//! NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE: Valid values : 0 or 1 \n
|
||||
//! Default value: 0 \n
|
||||
//! Explanation: If the value is 1, the driver will try to perform operations which involved target resource in broadcast,
|
||||
//! where it's possible. Hint is static and must be set before resource starts using.
|
||||
//!
|
||||
//! NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n
|
||||
//! Default value: 0 \n
|
||||
//! Explanation: If the value is 1, the driver will do dirty resource resolve regardless of discard flags in the application profile or
|
||||
//! AFR-FriendlyD3DHints.exe name using.
|
||||
//!
|
||||
typedef enum _NVAPI_D3D_SETRESOURCEHINT_SLI
|
||||
{
|
||||
NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC = 1,
|
||||
NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE = 2,
|
||||
NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC = 3
|
||||
} NVAPI_D3D_SETRESOURCEHINT_SLI;
|
||||
|
||||
//! \ingroup dx
|
||||
NVAPI_INTERFACE NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj,
|
||||
NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory,
|
||||
NvU32 dwHintName,
|
||||
NvU32 *pdwHintValue);
|
||||
#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D_BeginResourceRendering
|
||||
//
|
||||
//! \fn NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags)
|
||||
//! DESCRIPTION: This function tells the driver that the resource will begin to receive updates. It must be used in combination with NvAPI_D3D_EndResourceRendering().
|
||||
//! The primary use of this function is allow the driver to initiate early inter-frame synchronization of resources while running in AFR SLI mode.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource
|
||||
//! \param [in] obj Previously obtained HV resource handle
|
||||
//! \param [in] Flags The flags for functionality applied to resource while being used.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values
|
||||
//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \ingroup dx
|
||||
//! Used in NvAPI_D3D_BeginResourceRendering().
|
||||
typedef enum _NVAPI_D3D_RESOURCERENDERING_FLAG
|
||||
{
|
||||
NVAPI_D3D_RR_FLAG_DEFAULTS = 0x00000000, //!< All bits set to 0 are defaults.
|
||||
NVAPI_D3D_RR_FLAG_FORCE_DISCARD_CONTENT = 0x00000001, //!< (bit 0) The flag forces to discard previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint
|
||||
NVAPI_D3D_RR_FLAG_FORCE_KEEP_CONTENT = 0x00000002, //!< (bit 1) The flag forces to respect previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint
|
||||
NVAPI_D3D_RR_FLAG_MULTI_FRAME = 0x00000004 //!< (bit 2) The flag hints the driver that content will be used for many frames. If not specified then the driver assumes that content is used only on the next frame
|
||||
} NVAPI_D3D_RESOURCERENDERING_FLAG;
|
||||
|
||||
//! \ingroup dx
|
||||
NVAPI_INTERFACE NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags);
|
||||
|
||||
#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_D3D_EndResourceRendering
|
||||
//
|
||||
//! DESCRIPTION: This function tells the driver that the resource is done receiving updates. It must be used in combination with
|
||||
//! NvAPI_D3D_BeginResourceRendering().
|
||||
//! The primary use of this function is allow the driver to initiate early inter-frame syncs of resources while running in AFR SLI mode.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 185
|
||||
//!
|
||||
//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource
|
||||
//! \param [in] obj Previously obtained HV resource handle
|
||||
//! \param [in] Flags Reserved, must be zero
|
||||
//
|
||||
//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values
|
||||
//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls
|
||||
//!
|
||||
//! \ingroup dx
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_D3D_EndResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags);
|
||||
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
|
||||
|
||||
#include"nvapi_lite_salend.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#pragma pack(pop)
|
600
externals/nvapi/nvapi_lite_stereo.h
vendored
Normal file
600
externals/nvapi/nvapi_lite_stereo.h
vendored
Normal file
@ -0,0 +1,600 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include"nvapi_lite_salstart.h"
|
||||
#include"nvapi_lite_common.h"
|
||||
#pragma pack(push,8)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_Enable
|
||||
//
|
||||
//! DESCRIPTION: This APU enables stereo mode in the registry.
|
||||
//! Calls to this function affect the entire system.
|
||||
//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect,
|
||||
//! and will return the appropriate error code.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo is now enabled.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_Enable(void);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_Disable
|
||||
//
|
||||
//! DESCRIPTION: This API disables stereo mode in the registry.
|
||||
//! Calls to this function affect the entire system.
|
||||
//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect,
|
||||
//! and will return the appropriate error code.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo is now disabled.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_Disable(void);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_IsEnabled
|
||||
//
|
||||
//! DESCRIPTION: This API checks if stereo mode is enabled in the registry.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [out] pIsStereoEnabled Address where the result of the inquiry will be placed.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Check was sucessfully completed and result reflects current state of stereo availability.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_IsEnabled(NvU8 *pIsStereoEnabled);
|
||||
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)|| defined(__d3d12_h__)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown
|
||||
//
|
||||
//! DESCRIPTION: This API creates a stereo handle that is used in subsequent calls related to a given device interface.
|
||||
//! This must be called before any other NvAPI_Stereo_ function for that handle.
|
||||
//! Multiple devices can be used at one time using multiple calls to this function (one per each device).
|
||||
//!
|
||||
//! HOW TO USE: After the Direct3D device is created, create the stereo handle.
|
||||
//! On call success:
|
||||
//! -# Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter.
|
||||
//! -# After the device interface that corresponds to the the stereo handle is destroyed,
|
||||
//! the application should call NvAPI_DestroyStereoHandle() for that stereo handle.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] pDevice Pointer to IUnknown interface that is IDirect3DDevice9* in DX9, ID3D10Device*.
|
||||
//! \param [out] pStereoHandle Pointer to the newly created stereo handle.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo handle is created for given device interface.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT Provided device interface is invalid.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_CreateHandleFromIUnknown(IUnknown *pDevice, StereoHandle *pStereoHandle);
|
||||
|
||||
#endif // defined(_D3D9_H_) || defined(__d3d10_h__)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_DestroyHandle
|
||||
//
|
||||
//! DESCRIPTION: This API destroys the stereo handle created with one of the NvAPI_Stereo_CreateHandleFrom() functions.
|
||||
//! This should be called after the device corresponding to the handle has been destroyed.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that is to be destroyed.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo handle is destroyed.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_DestroyHandle(StereoHandle stereoHandle);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_Activate
|
||||
//
|
||||
//! DESCRIPTION: This API activates stereo for the device interface corresponding to the given stereo handle.
|
||||
//! Activating stereo is possible only if stereo was enabled previously in the registry.
|
||||
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
|
||||
//! and will return the appropriate error code.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle corresponding to the device interface.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo is turned on.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_Activate(StereoHandle stereoHandle);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_Deactivate
|
||||
//
|
||||
//! DESCRIPTION: This API deactivates stereo for the given device interface.
|
||||
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
|
||||
//! and will return the appropriate error code.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Stereo is turned off.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_Deactivate(StereoHandle stereoHandle);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_IsActivated
|
||||
//
|
||||
//! DESCRIPTION: This API checks if stereo is activated for the given device interface.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [in] pIsStereoOn Address where result of the inquiry will be placed.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off).
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR - Something is wrong (generic error).
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_IsActivated(StereoHandle stereoHandle, NvU8 *pIsStereoOn);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_GetSeparation
|
||||
//
|
||||
//! DESCRIPTION: This API gets current separation value (in percents).
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [out] pSeparationPercentage Address of @c float type variable to store current separation percentage in.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Retrieval of separation percentage was successfull.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_GetSeparation(StereoHandle stereoHandle, float *pSeparationPercentage);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetSeparation
|
||||
//
|
||||
//! DESCRIPTION: This API sets separation to given percentage.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [in] newSeparationPercentage New value for separation percentage.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Setting of separation percentage was successfull.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE Given separation percentage is out of [0..100] range.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetSeparation(StereoHandle stereoHandle, float newSeparationPercentage);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_GetConvergence
|
||||
//
|
||||
//! DESCRIPTION: This API gets the current convergence value.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [out] pConvergence Address of @c float type variable to store current convergence value in.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Retrieval of convergence value was successfull.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_GetConvergence(StereoHandle stereoHandle, float *pConvergence);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetConvergence
|
||||
//
|
||||
//! DESCRIPTION: This API sets convergence to the given value.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \since Release: 180
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [in] newConvergence New value for convergence.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Setting of convergence value was successfull.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetConvergence(StereoHandle stereoHandle, float newConvergence);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetActiveEye
|
||||
//
|
||||
//! \fn NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye);
|
||||
//! DESCRIPTION: This API sets the back buffer to left or right in Direct stereo mode.
|
||||
//!
|
||||
//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate
|
||||
//! NvAPI_Stereo_CreateHandleFrom function.
|
||||
//!
|
||||
//! \since Release: 285
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [in] StereoEye Defines active eye in Direct stereo mode
|
||||
//!
|
||||
//! \retval ::NVAPI_OK - Active eye is set.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT - StereoEye parameter has not allowed value.
|
||||
//! \retval ::NVAPI_SET_NOT_ALLOWED - Current stereo mode is not Direct
|
||||
//! \retval ::NVAPI_ERROR - Something is wrong (generic error).
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \ingroup stereoapi
|
||||
typedef enum _NV_StereoActiveEye
|
||||
{
|
||||
NVAPI_STEREO_EYE_RIGHT = 1,
|
||||
NVAPI_STEREO_EYE_LEFT = 2,
|
||||
NVAPI_STEREO_EYE_MONO = 3,
|
||||
} NV_STEREO_ACTIVE_EYE;
|
||||
|
||||
//! \ingroup stereoapi
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetDriverMode
|
||||
//
|
||||
//! \fn NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode );
|
||||
//! DESCRIPTION: This API sets the 3D stereo driver mode: Direct or Automatic
|
||||
//!
|
||||
//! HOW TO USE: This API must be called before the device is created.
|
||||
//! Applies to DirectX 9 and higher.
|
||||
//!
|
||||
//! \since Release: 285
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [in] mode Defines the 3D stereo driver mode: Direct or Automatic
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Active eye is set.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT mode parameter has not allowed value.
|
||||
//! \retval ::NVAPI_ERROR Something is wrong (generic error).
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \ingroup stereoapi
|
||||
typedef enum _NV_StereoDriverMode
|
||||
{
|
||||
NVAPI_STEREO_DRIVER_MODE_AUTOMATIC = 0,
|
||||
NVAPI_STEREO_DRIVER_MODE_DIRECT = 2,
|
||||
} NV_STEREO_DRIVER_MODE;
|
||||
|
||||
//! \ingroup stereoapi
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_GetEyeSeparation
|
||||
//
|
||||
//! DESCRIPTION: This API returns eye separation as a ratio of <between eye distance>/<physical screen width>.
|
||||
//!
|
||||
//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate API. Applies only to DirectX 9 and up.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [out] pSeparation Eye separation.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Active eye is set.
|
||||
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR (generic error).
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_GetEyeSeparation(StereoHandle hStereoHandle, float *pSeparation );
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_IsWindowedModeSupported
|
||||
//
|
||||
//! DESCRIPTION: This API returns availability of windowed mode stereo
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! \param [out] bSupported(OUT) != 0 - supported, \n
|
||||
//! == 0 - is not supported
|
||||
//!
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
|
||||
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
|
||||
//! \retval ::NVAPI_ERROR Something is wrong (generic error).
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_IsWindowedModeSupported(NvU8* bSupported);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetSurfaceCreationMode
|
||||
//
|
||||
//! \function NvAPI_Stereo_SetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE creationMode)
|
||||
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [in] creationMode New surface creation mode for this device interface.
|
||||
//!
|
||||
//! \since Release: 285
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! DESCRIPTION: This API sets surface creation mode for this device interface.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
|
||||
//!
|
||||
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
|
||||
//! There are no return error codes with specific meaning for this API.
|
||||
//!
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \ingroup stereoapi
|
||||
typedef enum _NVAPI_STEREO_SURFACECREATEMODE
|
||||
{
|
||||
NVAPI_STEREO_SURFACECREATEMODE_AUTO, //!< Use driver registry profile settings for surface creation mode.
|
||||
NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO, //!< Always create stereo surfaces.
|
||||
NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO //!< Always create mono surfaces.
|
||||
} NVAPI_STEREO_SURFACECREATEMODE;
|
||||
|
||||
//! \ingroup stereoapi
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE creationMode);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_GetSurfaceCreationMode
|
||||
//
|
||||
//! \function NvAPI_Stereo_GetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE* pCreationMode)
|
||||
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [out] pCreationMode The current creation mode for this device interface.
|
||||
//!
|
||||
//! \since Release: 295
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! DESCRIPTION: This API gets surface creation mode for this device interface.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
|
||||
//!
|
||||
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
|
||||
//! There are no return error codes with specific meaning for this API.
|
||||
//!
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \ingroup stereoapi
|
||||
NVAPI_INTERFACE NvAPI_Stereo_GetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE* pCreationMode);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_Debug_WasLastDrawStereoized
|
||||
//
|
||||
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
|
||||
//! \param [out] pWasStereoized Address where result of the inquiry will be placed.
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! DESCRIPTION: This API checks if the last draw call was stereoized. It is a very expensive to call and should be used for debugging purpose *only*.
|
||||
//!
|
||||
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
|
||||
//!
|
||||
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
|
||||
//! There are no return error codes with specific meaning for this API.
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_Debug_WasLastDrawStereoized(__in StereoHandle hStereoHandle, __out NvU8 *pWasStereoized);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_SetDefaultProfile
|
||||
//
|
||||
//!
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! DESCRIPTION: This API defines the stereo profile used by the driver in case the application has no associated profile.
|
||||
//!
|
||||
//! WHEN TO USE: To take effect, this API must be called before D3D device is created. Calling once a device has been created will not affect the current device.
|
||||
//!
|
||||
//! \param [in] szProfileName Default profile name.
|
||||
//!
|
||||
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
|
||||
//! Error codes specific to this API are described below.
|
||||
//!
|
||||
//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName.
|
||||
//! \retval NVAPI_INVALID_ARGUMENT - szProfileName == NULL.
|
||||
//! \retval NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST - Default stereo profile does not exist
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_SetDefaultProfile(__in const char* szProfileName);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Stereo_GetDefaultProfile
|
||||
//
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
//!
|
||||
//! DESCRIPTION: This API retrieves the current default stereo profile.
|
||||
//!
|
||||
//! After call cbSizeOut contain 0 if default profile is not set required buffer size cbSizeOut.
|
||||
//! To get needed buffer size this function can be called with szProfileName==0 and cbSizeIn == 0.
|
||||
//!
|
||||
//! WHEN TO USE: This API can be called at any time.
|
||||
//!
|
||||
//!
|
||||
//! \param [in] cbSizeIn Size of buffer allocated for default stereo profile name.
|
||||
//! \param [out] szProfileName Default stereo profile name.
|
||||
//! \param [out] pcbSizeOut Required buffer size.
|
||||
//! # ==0 - there is no default stereo profile name currently set
|
||||
//! # !=0 - size of buffer required for currently set default stereo profile name including trailing '0'.
|
||||
//!
|
||||
//!
|
||||
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
|
||||
//! Error codes specific to this API are described below.
|
||||
//!
|
||||
//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName.
|
||||
//! \retval NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED - There is no default stereo profile set at this time.
|
||||
//! \retval NVAPI_INVALID_ARGUMENT - pcbSizeOut == 0 or cbSizeIn >= *pcbSizeOut && szProfileName == 0
|
||||
//! \retval NVAPI_INSUFFICIENT_BUFFER - cbSizeIn < *pcbSizeOut
|
||||
//!
|
||||
//! \ingroup stereoapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Stereo_GetDefaultProfile( __in NvU32 cbSizeIn, __out_bcount_part_opt(cbSizeIn, *pcbSizeOut) char* szProfileName, __out NvU32 *pcbSizeOut);
|
||||
|
||||
#include"nvapi_lite_salend.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#pragma pack(pop)
|
105
externals/nvapi/nvapi_lite_surround.h
vendored
Normal file
105
externals/nvapi/nvapi_lite_surround.h
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/************************************************************************************************************************************\
|
||||
|* *|
|
||||
|* Copyright ? 2012 NVIDIA Corporation. All rights reserved. *|
|
||||
|* *|
|
||||
|* NOTICE TO USER: *|
|
||||
|* *|
|
||||
|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
|
||||
|* *|
|
||||
|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
|
||||
|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
|
||||
|* Otherwise, you have no rights to use or access this software in any manner. *|
|
||||
|* *|
|
||||
|* If not covered by the applicable NVIDIA software license agreement: *|
|
||||
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
|
||||
|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
|
||||
|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
|
||||
|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
|
||||
|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
|
||||
|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
|
||||
|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
|
||||
|* *|
|
||||
|* U.S. Government End Users. *|
|
||||
|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
|
||||
|* consisting of "commercial computer software" and "commercial computer software documentation" *|
|
||||
|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
|
||||
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
|
||||
|* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
|
||||
|* *|
|
||||
|* Any use of this software in individual and commercial software must include, *|
|
||||
|* in the user documentation and internal comments to the code, *|
|
||||
|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
|
||||
|* *|
|
||||
\************************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include"nvapi_lite_salstart.h"
|
||||
#include"nvapi_lite_common.h"
|
||||
#pragma pack(push,8)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_DISP_GetGDIPrimaryDisplayId
|
||||
//
|
||||
//! DESCRIPTION: This API returns the Display ID of the GDI Primary.
|
||||
//!
|
||||
//! \param [out] displayId Display ID of the GDI Primary display.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK: Capabilties have been returned.
|
||||
//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND: GDI Primary not on an NVIDIA GPU.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
|
||||
//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available
|
||||
//! \retval ::NVAPI_ERROR: Miscellaneous error occurred
|
||||
//!
|
||||
//! \ingroup dispcontrol
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_DISP_GetGDIPrimaryDisplayId(NvU32* displayId);
|
||||
#define NV_MOSAIC_MAX_DISPLAYS (64)
|
||||
//! SUPPORTED OS: Windows 7 and higher
|
||||
//!
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION NAME: NvAPI_Mosaic_GetDisplayViewportsByResolution
|
||||
//
|
||||
//! DESCRIPTION: This API returns the viewports that would be applied on
|
||||
//! the requested display.
|
||||
//!
|
||||
//! \param [in] displayId Display ID of a single display in the active
|
||||
//! mosaic topology to query.
|
||||
//! \param [in] srcWidth Width of full display topology. If both
|
||||
//! width and height are 0, the current
|
||||
//! resolution is used.
|
||||
//! \param [in] srcHeight Height of full display topology. If both
|
||||
//! width and height are 0, the current
|
||||
//! resolution is used.
|
||||
//! \param [out] viewports Array of NV_RECT viewports which represent
|
||||
//! the displays as identified in
|
||||
//! NvAPI_Mosaic_EnumGridTopologies. If the
|
||||
//! requested resolution is a single-wide
|
||||
//! resolution, only viewports[0] will
|
||||
//! contain the viewport details, regardless
|
||||
//! of which display is driving the display.
|
||||
//! \param [out] bezelCorrected Returns 1 if the requested resolution is
|
||||
//! bezel corrected. May be NULL.
|
||||
//!
|
||||
//! \retval ::NVAPI_OK Capabilties have been returned.
|
||||
//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
|
||||
//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first
|
||||
//! \retval ::NVAPI_MOSAIC_NOT_ACTIVE The display does not belong to an active Mosaic Topology
|
||||
//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available
|
||||
//! \retval ::NVAPI_ERROR Miscellaneous error occurred
|
||||
//!
|
||||
//! \ingroup mosaicapi
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NVAPI_INTERFACE NvAPI_Mosaic_GetDisplayViewportsByResolution(NvU32 displayId, NvU32 srcWidth, NvU32 srcHeight, NV_RECT viewports[NV_MOSAIC_MAX_DISPLAYS], NvU8* bezelCorrected);
|
||||
|
||||
#include"nvapi_lite_salend.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#pragma pack(pop)
|
BIN
externals/nvapi/x86/nvapi.lib
vendored
Normal file
BIN
externals/nvapi/x86/nvapi.lib
vendored
Normal file
Binary file not shown.
33
externals/sdl2/CMakeLists.txt
vendored
33
externals/sdl2/CMakeLists.txt
vendored
@ -1,6 +1,33 @@
|
||||
# Configure static library build
|
||||
set(SDL_SHARED OFF CACHE BOOL "")
|
||||
set(SDL_STATIC ON CACHE BOOL "")
|
||||
# Disable building the stuff we don't need.
|
||||
set(SDL_DISKAUDIO OFF CACHE BOOL "")
|
||||
set(SDL_OPENGL ON CACHE BOOL "")
|
||||
set(SDL_OPENGLES ON CACHE BOOL "")
|
||||
set(SDL_OSS OFF CACHE BOOL "")
|
||||
set(SDL_ALSA OFF CACHE BOOL "")
|
||||
set(SDL_JACK OFF CACHE BOOL "")
|
||||
set(SDL_ESD OFF CACHE BOOL "")
|
||||
set(SDL_PIPEWIRE OFF CACHE BOOL "")
|
||||
set(SDL_PULSEAUDIO OFF CACHE BOOL "")
|
||||
set(SDL_ARTS OFF CACHE BOOL "")
|
||||
set(SDL_NAS OFF CACHE BOOL "")
|
||||
set(SDL_SNDIO OFF CACHE BOOL "")
|
||||
set(SDL_FUSIONSOUND OFF CACHE BOOL "")
|
||||
set(SDL_LIBSAMPLERATE OFF CACHE BOOL "")
|
||||
set(SDL_X11 OFF CACHE BOOL "")
|
||||
set(SDL_WAYLAND OFF CACHE BOOL "")
|
||||
set(SDL_RPI OFF CACHE BOOL "")
|
||||
set(SDL_COCOA ON CACHE BOOL "")
|
||||
set(SDL_DIRECTX OFF CACHE BOOL "")
|
||||
set(SDL_WASAPI OFF CACHE BOOL "")
|
||||
set(SDL_RENDER_D3D OFF CACHE BOOL "")
|
||||
set(SDL_RENDER_METAL OFF CACHE BOOL "")
|
||||
set(SDL_VIVANTE OFF CACHE BOOL "")
|
||||
set(SDL_VULKAN OFF CACHE BOOL "")
|
||||
set(SDL_METAL OFF CACHE BOOL "")
|
||||
set(SDL_KMSDRM OFF CACHE BOOL "")
|
||||
set(SDL_OFFSCREEN OFF CACHE BOOL "")
|
||||
set(SDL_SHARED ON CACHE BOOL "")
|
||||
set(SDL_STATIC OFF CACHE BOOL "")
|
||||
|
||||
# Subsystems
|
||||
set(SDL_ATOMIC ON CACHE BOOL "")
|
||||
|
2
externals/sdl2/SDL
vendored
2
externals/sdl2/SDL
vendored
Submodule externals/sdl2/SDL updated: ac13ca9ab6...a1d1946dcb
2
externals/zstd
vendored
2
externals/zstd
vendored
Submodule externals/zstd updated: 63779c7982...e47e674cd0
358
license.txt
358
license.txt
@ -1,358 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
|
||||
The icons used in this project have the following licenses:
|
||||
|
||||
Icon Name | License | Origin/Author
|
||||
--- | --- | ---
|
||||
checked.png | CC BY-ND 3.0 | https://icons8.com
|
||||
connected.png | CC BY-ND 3.0 | https://icons8.com
|
||||
connected_notification.png | CC BY-ND 3.0 | https://icons8.com
|
||||
disconnected.png | CC BY-ND 3.0 | https://icons8.com
|
||||
failed.png | CC BY-ND 3.0 | https://icons8.com
|
||||
lock.png | CC BY-ND 3.0 | https://icons8.com
|
||||
plus_folder.png | CC BY-ND 3.0 | https://icons8.com
|
||||
bad_folder.png | CC BY-ND 3.0 | https://icons8.com
|
||||
chip.png | CC BY-ND 3.0 | https://icons8.com
|
||||
folder.png | CC BY-ND 3.0 | https://icons8.com
|
||||
plus.png (Default, Dark) | CC0 1.0 | Designed by BreadFish64 from the Citra team
|
||||
plus.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com
|
||||
sd_card.png | CC BY-ND 3.0 | https://icons8.com
|
@ -128,7 +128,29 @@ public final class NativeLibrary {
|
||||
|
||||
public static native void InitGameIni(String gameID);
|
||||
|
||||
public static native long GetTitleId(String filename);
|
||||
/**
|
||||
* Gets the embedded icon within the given ROM.
|
||||
*
|
||||
* @param filename the file path to the ROM.
|
||||
* @return an integer array containing the color data for the icon.
|
||||
*/
|
||||
public static native int[] GetIcon(String filename);
|
||||
|
||||
/**
|
||||
* Gets the embedded title of the given ISO/ROM.
|
||||
*
|
||||
* @param filename The file path to the ISO/ROM.
|
||||
* @return the embedded title of the ISO/ROM.
|
||||
*/
|
||||
public static native String GetTitle(String filename);
|
||||
|
||||
public static native String GetDescription(String filename);
|
||||
|
||||
public static native String GetGameId(String filename);
|
||||
|
||||
public static native String GetRegions(String filename);
|
||||
|
||||
public static native String GetCompany(String filename);
|
||||
|
||||
public static native String GetGitRevision();
|
||||
|
||||
@ -188,11 +210,6 @@ public final class NativeLibrary {
|
||||
*/
|
||||
public static native boolean IsRunning();
|
||||
|
||||
/**
|
||||
* Returns the title ID of the currently running title, or 0 on failure.
|
||||
*/
|
||||
public static native long GetRunningTitleId();
|
||||
|
||||
/**
|
||||
* Returns the performance stats for the current game
|
||||
**/
|
||||
|
@ -491,7 +491,7 @@ public final class EmulationActivity extends AppCompatActivity {
|
||||
break;
|
||||
|
||||
case MENU_ACTION_OPEN_CHEATS:
|
||||
CheatsActivity.launch(this, NativeLibrary.GetRunningTitleId());
|
||||
CheatsActivity.launch(this);
|
||||
break;
|
||||
|
||||
case MENU_ACTION_CLOSE_GAME:
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.citra.citra_emu.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.DataSetObserver;
|
||||
import android.os.Build;
|
||||
@ -15,13 +14,10 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.citra.citra_emu.CitraApplication;
|
||||
import org.citra.citra_emu.NativeLibrary;
|
||||
import org.citra.citra_emu.R;
|
||||
import org.citra.citra_emu.activities.EmulationActivity;
|
||||
import org.citra.citra_emu.features.cheats.ui.CheatsActivity;
|
||||
import org.citra.citra_emu.model.GameDatabase;
|
||||
import org.citra.citra_emu.utils.FileUtil;
|
||||
import org.citra.citra_emu.utils.Log;
|
||||
@ -35,7 +31,8 @@ import java.util.stream.Stream;
|
||||
* ContentProviders and Loaders, allows for efficient display of a limited view into a (possibly)
|
||||
* large dataset.
|
||||
*/
|
||||
public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> {
|
||||
public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> implements
|
||||
View.OnClickListener {
|
||||
private Cursor mCursor;
|
||||
private GameDataSetObserver mObserver;
|
||||
|
||||
@ -64,8 +61,7 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> {
|
||||
View gameCard = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.card_game, parent, false);
|
||||
|
||||
gameCard.setOnClickListener(this::onClick);
|
||||
gameCard.setOnLongClickListener(this::onLongClick);
|
||||
gameCard.setOnClickListener(this);
|
||||
|
||||
// Use that view to create a ViewHolder.
|
||||
return new GameViewHolder(gameCard);
|
||||
@ -197,9 +193,10 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> {
|
||||
/**
|
||||
* Launches the game that was clicked on.
|
||||
*
|
||||
* @param view The view representing the game the user wants to play.
|
||||
* @param view The card representing the game the user wants to play.
|
||||
*/
|
||||
private void onClick(View view) {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// Double-click prevention, using threshold of 1000 ms
|
||||
if (SystemClock.elapsedRealtime() - mLastClickTime < 1000) {
|
||||
return;
|
||||
@ -211,31 +208,6 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> {
|
||||
EmulationActivity.launch((FragmentActivity) view.getContext(), holder.path, holder.title);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the cheats settings for the game that was clicked on.
|
||||
*
|
||||
* @param view The view representing the game the user wants to play.
|
||||
*/
|
||||
private boolean onLongClick(View view) {
|
||||
Context context = view.getContext();
|
||||
GameViewHolder holder = (GameViewHolder) view.getTag();
|
||||
|
||||
final long titleId = NativeLibrary.GetTitleId(holder.path);
|
||||
|
||||
if (titleId == 0) {
|
||||
new MaterialAlertDialogBuilder(context)
|
||||
.setIcon(R.mipmap.ic_launcher)
|
||||
.setTitle(R.string.properties)
|
||||
.setMessage(R.string.properties_not_loaded)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
} else {
|
||||
CheatsActivity.launch(context, titleId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isValidGame(String path) {
|
||||
return Stream.of(
|
||||
".rar", ".zip", ".7z", ".torrent", ".tar", ".gz").noneMatch(suffix -> path.toLowerCase().endsWith(suffix));
|
||||
|
@ -1,28 +1,13 @@
|
||||
package org.citra.citra_emu.features.cheats.model;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
public class CheatEngine {
|
||||
@Keep
|
||||
private final long mPointer;
|
||||
public static native Cheat[] getCheats();
|
||||
|
||||
@Keep
|
||||
public CheatEngine(long titleId) {
|
||||
mPointer = initialize(titleId);
|
||||
}
|
||||
public static native void addCheat(Cheat cheat);
|
||||
|
||||
private static native long initialize(long titleId);
|
||||
public static native void removeCheat(int index);
|
||||
|
||||
@Override
|
||||
protected native void finalize();
|
||||
public static native void updateCheat(int index, Cheat newCheat);
|
||||
|
||||
public native Cheat[] getCheats();
|
||||
|
||||
public native void addCheat(Cheat cheat);
|
||||
|
||||
public native void removeCheat(int index);
|
||||
|
||||
public native void updateCheat(int index, Cheat newCheat);
|
||||
|
||||
public native void saveCheatFile();
|
||||
public static native void saveCheatFile();
|
||||
}
|
||||
|
@ -19,17 +19,11 @@ public class CheatsViewModel extends ViewModel {
|
||||
private final MutableLiveData<Integer> mCheatDeletedEvent = new MutableLiveData<>(null);
|
||||
private final MutableLiveData<Boolean> mOpenDetailsViewEvent = new MutableLiveData<>(false);
|
||||
|
||||
private CheatEngine mCheatEngine;
|
||||
private Cheat[] mCheats;
|
||||
private boolean mCheatsNeedSaving = false;
|
||||
|
||||
public void initialize(long titleId) {
|
||||
mCheatEngine = new CheatEngine(titleId);
|
||||
load();
|
||||
}
|
||||
|
||||
private void load() {
|
||||
mCheats = mCheatEngine.getCheats();
|
||||
public void load() {
|
||||
mCheats = CheatEngine.getCheats();
|
||||
|
||||
for (int i = 0; i < mCheats.length; i++) {
|
||||
int position = i;
|
||||
@ -42,7 +36,7 @@ public class CheatsViewModel extends ViewModel {
|
||||
|
||||
public void saveIfNeeded() {
|
||||
if (mCheatsNeedSaving) {
|
||||
mCheatEngine.saveCheatFile();
|
||||
CheatEngine.saveCheatFile();
|
||||
mCheatsNeedSaving = false;
|
||||
}
|
||||
}
|
||||
@ -112,7 +106,7 @@ public class CheatsViewModel extends ViewModel {
|
||||
|
||||
int position = mCheats.length;
|
||||
|
||||
mCheatEngine.addCheat(cheat);
|
||||
CheatEngine.addCheat(cheat);
|
||||
|
||||
mCheatsNeedSaving = true;
|
||||
load();
|
||||
@ -138,7 +132,7 @@ public class CheatsViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
public void updateSelectedCheat(Cheat newCheat) {
|
||||
mCheatEngine.updateCheat(mSelectedCheatPosition, newCheat);
|
||||
CheatEngine.updateCheat(mSelectedCheatPosition, newCheat);
|
||||
|
||||
mCheatsNeedSaving = true;
|
||||
load();
|
||||
@ -168,7 +162,7 @@ public class CheatsViewModel extends ViewModel {
|
||||
|
||||
setSelectedCheat(null, -1);
|
||||
|
||||
mCheatEngine.removeCheat(position);
|
||||
CheatEngine.removeCheat(position);
|
||||
|
||||
mCheatsNeedSaving = true;
|
||||
load();
|
||||
|
@ -32,8 +32,6 @@ import java.util.List;
|
||||
|
||||
public class CheatsActivity extends AppCompatActivity
|
||||
implements SlidingPaneLayout.PanelSlideListener {
|
||||
private static String ARG_TITLE_ID = "title_id";
|
||||
|
||||
private CheatsViewModel mViewModel;
|
||||
|
||||
private SlidingPaneLayout mSlidingPaneLayout;
|
||||
@ -43,9 +41,8 @@ public class CheatsActivity extends AppCompatActivity
|
||||
private View mCheatListLastFocus;
|
||||
private View mCheatDetailsLastFocus;
|
||||
|
||||
public static void launch(Context context, long titleId) {
|
||||
public static void launch(Context context) {
|
||||
Intent intent = new Intent(context, CheatsActivity.class);
|
||||
intent.putExtra(ARG_TITLE_ID, titleId);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@ -57,10 +54,8 @@ public class CheatsActivity extends AppCompatActivity
|
||||
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
|
||||
|
||||
long titleId = getIntent().getLongExtra(ARG_TITLE_ID, -1);
|
||||
|
||||
mViewModel = new ViewModelProvider(this).get(CheatsViewModel.class);
|
||||
mViewModel.initialize(titleId);
|
||||
mViewModel.load();
|
||||
|
||||
setContentView(R.layout.activity_cheats);
|
||||
|
||||
|
@ -12,7 +12,6 @@ import org.citra.citra_emu.utils.FileUtil;
|
||||
import org.citra.citra_emu.utils.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@ -207,26 +206,27 @@ public final class GameDatabase extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
private static void attemptToAddGame(SQLiteDatabase database, String filePath) {
|
||||
GameInfo gameInfo;
|
||||
try {
|
||||
gameInfo = new GameInfo(filePath);
|
||||
} catch (IOException e) {
|
||||
gameInfo = null;
|
||||
}
|
||||
|
||||
String name = gameInfo != null ? gameInfo.getTitle() : "";
|
||||
String name = NativeLibrary.GetTitle(filePath);
|
||||
|
||||
// If the game's title field is empty, use the filename.
|
||||
if (name.isEmpty()) {
|
||||
name = filePath.substring(filePath.lastIndexOf("/") + 1);
|
||||
}
|
||||
|
||||
String gameId = NativeLibrary.GetGameId(filePath);
|
||||
|
||||
// If the game's ID field is empty, use the filename without extension.
|
||||
if (gameId.isEmpty()) {
|
||||
gameId = filePath.substring(filePath.lastIndexOf("/") + 1,
|
||||
filePath.lastIndexOf("."));
|
||||
}
|
||||
|
||||
ContentValues game = Game.asContentValues(name,
|
||||
filePath.replace("\n", " "),
|
||||
gameInfo != null ? gameInfo.getRegions() : "Invalid region",
|
||||
NativeLibrary.GetDescription(filePath).replace("\n", " "),
|
||||
NativeLibrary.GetRegions(filePath),
|
||||
filePath,
|
||||
filePath,
|
||||
gameInfo != null ? gameInfo.getCompany() : "");
|
||||
gameId,
|
||||
NativeLibrary.GetCompany(filePath));
|
||||
|
||||
// Try to update an existing game first.
|
||||
int rowsMatched = database.update(TABLE_NAME_GAMES, // Which table to update.
|
||||
|
@ -1,37 +0,0 @@
|
||||
package org.citra.citra_emu.model;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GameInfo {
|
||||
@Keep
|
||||
private final long mPointer;
|
||||
|
||||
@Keep
|
||||
public GameInfo(String path) throws IOException {
|
||||
mPointer = initialize(path);
|
||||
if (mPointer == 0L) {
|
||||
throw new IOException();
|
||||
}
|
||||
}
|
||||
|
||||
private static native long initialize(String path);
|
||||
|
||||
@Override
|
||||
protected native void finalize();
|
||||
|
||||
@NonNull
|
||||
public native String getTitle();
|
||||
|
||||
@NonNull
|
||||
public native String getRegions();
|
||||
|
||||
@NonNull
|
||||
public native String getCompany();
|
||||
|
||||
@Nullable
|
||||
public native int[] getIcon();
|
||||
}
|
@ -7,9 +7,7 @@ import com.squareup.picasso.Request;
|
||||
import com.squareup.picasso.RequestHandler;
|
||||
|
||||
import org.citra.citra_emu.NativeLibrary;
|
||||
import org.citra.citra_emu.model.GameInfo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
public class GameIconRequestHandler extends RequestHandler {
|
||||
@ -20,14 +18,8 @@ public class GameIconRequestHandler extends RequestHandler {
|
||||
|
||||
@Override
|
||||
public Result load(Request request, int networkPolicy) {
|
||||
int[] vector;
|
||||
try {
|
||||
String url = request.uri.toString();
|
||||
vector = new GameInfo(url).getIcon();
|
||||
} catch (IOException e) {
|
||||
vector = null;
|
||||
}
|
||||
|
||||
int[] vector = NativeLibrary.GetIcon(url);
|
||||
Bitmap bitmap = Bitmap.createBitmap(48, 48, Bitmap.Config.RGB_565);
|
||||
bitmap.copyPixelsFromBuffer(IntBuffer.wrap(vector));
|
||||
return new Result(bitmap, Picasso.LoadedFrom.DISK);
|
||||
|
@ -20,6 +20,7 @@ add_library(citra-android SHARED
|
||||
emu_window/emu_window.cpp
|
||||
emu_window/emu_window.h
|
||||
game_info.cpp
|
||||
game_info.h
|
||||
game_settings.cpp
|
||||
game_settings.h
|
||||
id_cache.cpp
|
||||
|
@ -15,24 +15,9 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static Cheats::CheatEngine* GetPointer(JNIEnv* env, jobject obj) {
|
||||
return reinterpret_cast<Cheats::CheatEngine*>(
|
||||
env->GetLongField(obj, IDCache::GetCheatEnginePointer()));
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_initialize(
|
||||
JNIEnv* env, jclass, jlong title_id) {
|
||||
return reinterpret_cast<jlong>(new Cheats::CheatEngine(title_id, Core::System::GetInstance()));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_finalize(JNIEnv* env, jobject obj) {
|
||||
delete GetPointer(env, obj);
|
||||
}
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_getCheats(JNIEnv* env, jobject obj) {
|
||||
auto cheats = GetPointer(env, obj)->GetCheats();
|
||||
Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_getCheats(JNIEnv* env, jclass) {
|
||||
auto cheats = Core::System::GetInstance().CheatEngine().GetCheats();
|
||||
|
||||
const jobjectArray array =
|
||||
env->NewObjectArray(static_cast<jsize>(cheats.size()), IDCache::GetCheatClass(), nullptr);
|
||||
@ -45,22 +30,22 @@ Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_getCheats(JNIEnv* en
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_addCheat(
|
||||
JNIEnv* env, jobject obj, jobject j_cheat) {
|
||||
GetPointer(env, obj)->AddCheat(*CheatFromJava(env, j_cheat));
|
||||
JNIEnv* env, jclass, jobject j_cheat) {
|
||||
Core::System::GetInstance().CheatEngine().AddCheat(*CheatFromJava(env, j_cheat));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_removeCheat(
|
||||
JNIEnv* env, jobject obj, jint index) {
|
||||
GetPointer(env, obj)->RemoveCheat(index);
|
||||
JNIEnv* env, jclass, jint index) {
|
||||
Core::System::GetInstance().CheatEngine().RemoveCheat(index);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_updateCheat(
|
||||
JNIEnv* env, jobject obj, jint index, jobject j_new_cheat) {
|
||||
GetPointer(env, obj)->UpdateCheat(index, *CheatFromJava(env, j_new_cheat));
|
||||
JNIEnv* env, jclass, jint index, jobject j_new_cheat) {
|
||||
Core::System::GetInstance().CheatEngine().UpdateCheat(index, *CheatFromJava(env, j_new_cheat));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_saveCheatFile(
|
||||
JNIEnv* env, jobject obj) {
|
||||
GetPointer(env, obj)->SaveCheatFile();
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_citra_citra_1emu_features_cheats_model_CheatEngine_saveCheatFile(JNIEnv* env, jclass) {
|
||||
Core::System::GetInstance().CheatEngine().SaveCheatFile();
|
||||
}
|
||||
}
|
||||
|
@ -12,13 +12,12 @@
|
||||
#include "core/hle/service/fs/archive.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "core/loader/smdh.h"
|
||||
#include "jni/android_common/android_common.h"
|
||||
#include "jni/id_cache.h"
|
||||
#include "jni/game_info.h"
|
||||
|
||||
namespace {
|
||||
namespace GameInfo {
|
||||
|
||||
std::vector<u8> GetSMDHData(const std::string& path) {
|
||||
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(path);
|
||||
std::vector<u8> GetSMDHData(std::string physical_name) {
|
||||
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name);
|
||||
if (!loader) {
|
||||
return {};
|
||||
}
|
||||
@ -52,55 +51,55 @@ std::vector<u8> GetSMDHData(const std::string& path) {
|
||||
return smdh;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
|
||||
static Loader::SMDH* GetPointer(JNIEnv* env, jobject obj) {
|
||||
return reinterpret_cast<Loader::SMDH*>(env->GetLongField(obj, IDCache::GetGameInfoPointer()));
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_org_citra_citra_1emu_model_GameInfo_initialize(JNIEnv* env, jclass,
|
||||
jstring j_path) {
|
||||
std::vector<u8> smdh_data = GetSMDHData(GetJString(env, j_path));
|
||||
|
||||
Loader::SMDH* smdh = nullptr;
|
||||
if (Loader::IsValidSMDH(smdh_data)) {
|
||||
smdh = new Loader::SMDH;
|
||||
memcpy(smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||
}
|
||||
return reinterpret_cast<jlong>(smdh);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_model_GameInfo_finalize(JNIEnv* env, jobject obj) {
|
||||
delete GetPointer(env, obj);
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_model_GameInfo_getTitle(JNIEnv* env, jobject obj) {
|
||||
Loader::SMDH* smdh = GetPointer(env, obj);
|
||||
std::u16string GetTitle(std::string physical_name) {
|
||||
Loader::SMDH::TitleLanguage language = Loader::SMDH::TitleLanguage::English;
|
||||
std::vector<u8> smdh_data = GetSMDHData(physical_name);
|
||||
|
||||
if (!Loader::IsValidSMDH(smdh_data)) {
|
||||
// SMDH is not valid, return null
|
||||
return {};
|
||||
}
|
||||
|
||||
Loader::SMDH smdh;
|
||||
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||
|
||||
// Get the title from SMDH in UTF-16 format
|
||||
std::u16string title{
|
||||
reinterpret_cast<char16_t*>(smdh->titles[static_cast<size_t>(language)].long_title.data())};
|
||||
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].long_title.data())};
|
||||
|
||||
return ToJString(env, Common::UTF16ToUTF8(title).data());
|
||||
return title;
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_model_GameInfo_getCompany(JNIEnv* env, jobject obj) {
|
||||
Loader::SMDH* smdh = GetPointer(env, obj);
|
||||
std::u16string GetPublisher(std::string physical_name) {
|
||||
Loader::SMDH::TitleLanguage language = Loader::SMDH::TitleLanguage::English;
|
||||
std::vector<u8> smdh_data = GetSMDHData(physical_name);
|
||||
|
||||
if (!Loader::IsValidSMDH(smdh_data)) {
|
||||
// SMDH is not valid, return null
|
||||
return {};
|
||||
}
|
||||
|
||||
Loader::SMDH smdh;
|
||||
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||
|
||||
// Get the Publisher's name from SMDH in UTF-16 format
|
||||
char16_t* publisher;
|
||||
publisher =
|
||||
reinterpret_cast<char16_t*>(smdh->titles[static_cast<size_t>(language)].publisher.data());
|
||||
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].publisher.data());
|
||||
|
||||
return ToJString(env, Common::UTF16ToUTF8(publisher).data());
|
||||
return publisher;
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_model_GameInfo_getRegions(JNIEnv* env, jobject obj) {
|
||||
Loader::SMDH* smdh = GetPointer(env, obj);
|
||||
std::string GetRegions(std::string physical_name) {
|
||||
std::vector<u8> smdh_data = GetSMDHData(physical_name);
|
||||
|
||||
if (!Loader::IsValidSMDH(smdh_data)) {
|
||||
// SMDH is not valid, return "Invalid region"
|
||||
return "Invalid region";
|
||||
}
|
||||
|
||||
Loader::SMDH smdh;
|
||||
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||
|
||||
using GameRegion = Loader::SMDH::GameRegion;
|
||||
static const std::map<GameRegion, const char*> regions_map = {
|
||||
@ -108,10 +107,10 @@ jstring Java_org_citra_citra_1emu_model_GameInfo_getRegions(JNIEnv* env, jobject
|
||||
{GameRegion::Europe, "Europe"}, {GameRegion::Australia, "Australia"},
|
||||
{GameRegion::China, "China"}, {GameRegion::Korea, "Korea"},
|
||||
{GameRegion::Taiwan, "Taiwan"}};
|
||||
std::vector<GameRegion> regions = smdh->GetRegions();
|
||||
std::vector<GameRegion> regions = smdh.GetRegions();
|
||||
|
||||
if (regions.empty()) {
|
||||
return ToJString(env, "Invalid region");
|
||||
return "Invalid region";
|
||||
}
|
||||
|
||||
const bool region_free =
|
||||
@ -120,7 +119,7 @@ jstring Java_org_citra_citra_1emu_model_GameInfo_getRegions(JNIEnv* env, jobject
|
||||
});
|
||||
|
||||
if (region_free) {
|
||||
return ToJString(env, "Region free");
|
||||
return "Region free";
|
||||
}
|
||||
|
||||
const std::string separator = ", ";
|
||||
@ -129,22 +128,23 @@ jstring Java_org_citra_citra_1emu_model_GameInfo_getRegions(JNIEnv* env, jobject
|
||||
result += separator + regions_map.at(*region);
|
||||
}
|
||||
|
||||
return ToJString(env, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
jintArray Java_org_citra_citra_1emu_model_GameInfo_getIcon(JNIEnv* env, jobject obj) {
|
||||
Loader::SMDH* smdh = GetPointer(env, obj);
|
||||
std::vector<u16> GetIcon(std::string physical_name) {
|
||||
std::vector<u8> smdh_data = GetSMDHData(physical_name);
|
||||
|
||||
// Always get a 48x48(large) icon
|
||||
std::vector<u16> icon_data = smdh->GetIcon(true);
|
||||
if (icon_data.empty()) {
|
||||
return nullptr;
|
||||
if (!Loader::IsValidSMDH(smdh_data)) {
|
||||
// SMDH is not valid, return null
|
||||
return std::vector<u16>(0, 0);
|
||||
}
|
||||
|
||||
jintArray icon = env->NewIntArray(static_cast<jsize>(icon_data.size() / 2));
|
||||
env->SetIntArrayRegion(icon, 0, env->GetArrayLength(icon),
|
||||
reinterpret_cast<jint*>(icon_data.data()));
|
||||
Loader::SMDH smdh;
|
||||
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||
|
||||
return icon;
|
||||
}
|
||||
// Always get a 48x48(large) icon
|
||||
std::vector<u16> icon_data = smdh.GetIcon(true);
|
||||
return icon_data;
|
||||
}
|
||||
|
||||
} // namespace GameInfo
|
||||
|
19
src/android/app/src/main/jni/game_info.h
Normal file
19
src/android/app/src/main/jni/game_info.h
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace GameInfo {
|
||||
std::vector<u8> GetSMDHData(std::string physical_name);
|
||||
|
||||
std::u16string GetTitle(std::string physical_name);
|
||||
|
||||
std::u16string GetPublisher(std::string physical_name);
|
||||
|
||||
std::string GetRegions(std::string physical_name);
|
||||
|
||||
std::vector<u16> GetIcon(std::string physical_name);
|
||||
} // namespace GameInfo
|
@ -40,10 +40,6 @@ static jclass s_cheat_class;
|
||||
static jfieldID s_cheat_pointer;
|
||||
static jmethodID s_cheat_constructor;
|
||||
|
||||
static jfieldID s_cheat_engine_pointer;
|
||||
|
||||
static jfieldID s_game_info_pointer;
|
||||
|
||||
static std::unordered_map<VideoCore::LoadCallbackStage, jobject> s_java_load_callback_stages;
|
||||
|
||||
namespace IDCache {
|
||||
@ -139,14 +135,6 @@ jmethodID GetCheatConstructor() {
|
||||
return s_cheat_constructor;
|
||||
}
|
||||
|
||||
jfieldID GetCheatEnginePointer() {
|
||||
return s_cheat_engine_pointer;
|
||||
}
|
||||
|
||||
jfieldID GetGameInfoPointer() {
|
||||
return s_game_info_pointer;
|
||||
}
|
||||
|
||||
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage) {
|
||||
const auto it = s_java_load_callback_stages.find(stage);
|
||||
ASSERT_MSG(it != s_java_load_callback_stages.end(), "Invalid LoadCallbackStage: {}", stage);
|
||||
@ -217,17 +205,6 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
s_cheat_constructor = env->GetMethodID(cheat_class, "<init>", "(J)V");
|
||||
env->DeleteLocalRef(cheat_class);
|
||||
|
||||
// Initialize CheatEngine
|
||||
const jclass cheat_engine_class =
|
||||
env->FindClass("org/citra/citra_emu/features/cheats/model/CheatEngine");
|
||||
s_cheat_engine_pointer = env->GetFieldID(cheat_engine_class, "mPointer", "J");
|
||||
env->DeleteLocalRef(cheat_engine_class);
|
||||
|
||||
// Initialize GameInfo
|
||||
const jclass game_info_class = env->FindClass("org/citra/citra_emu/model/GameInfo");
|
||||
s_game_info_pointer = env->GetFieldID(game_info_class, "mPointer", "J");
|
||||
env->DeleteLocalRef(game_info_class);
|
||||
|
||||
// Initialize LoadCallbackStage map
|
||||
const auto to_java_load_callback_stage = [env](const std::string& stage) {
|
||||
jclass load_callback_stage_class = IDCache::GetDiskCacheLoadCallbackStageClass();
|
||||
|
@ -34,10 +34,6 @@ jclass GetCheatClass();
|
||||
jfieldID GetCheatPointer();
|
||||
jmethodID GetCheatConstructor();
|
||||
|
||||
jfieldID GetCheatEnginePointer();
|
||||
|
||||
jfieldID GetGameInfoPointer();
|
||||
|
||||
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage);
|
||||
|
||||
} // namespace IDCache
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "core/frontend/camera/factory.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/nfc/nfc.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "core/savestate.h"
|
||||
#include "jni/android_common/android_common.h"
|
||||
#include "jni/applets/mii_selector.h"
|
||||
@ -33,6 +32,7 @@
|
||||
#include "jni/camera/still_image_camera.h"
|
||||
#include "jni/config.h"
|
||||
#include "jni/emu_window/emu_window.h"
|
||||
#include "jni/game_info.h"
|
||||
#include "jni/game_settings.h"
|
||||
#include "jni/id_cache.h"
|
||||
#include "jni/input_manager.h"
|
||||
@ -380,13 +380,6 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_IsRunning(JNIEnv* env,
|
||||
return static_cast<jboolean>(!stop_run);
|
||||
}
|
||||
|
||||
jlong Java_org_citra_citra_1emu_NativeLibrary_GetRunningTitleId(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz) {
|
||||
u64 title_id{};
|
||||
Core::System::GetInstance().GetAppLoader().ReadProgramId(title_id);
|
||||
return static_cast<jlong>(title_id);
|
||||
}
|
||||
|
||||
jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadEvent(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_device, jint j_button,
|
||||
@ -443,16 +436,58 @@ void Java_org_citra_citra_1emu_NativeLibrary_onTouchMoved(JNIEnv* env,
|
||||
window->OnTouchMoved((int)x, (int)y);
|
||||
}
|
||||
|
||||
jlong Java_org_citra_citra_1emu_NativeLibrary_GetTitleId(JNIEnv* env, [[maybe_unused]] jclass clazz,
|
||||
jintArray Java_org_citra_citra_1emu_NativeLibrary_GetIcon(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_file) {
|
||||
std::string filepath = GetJString(env, j_file);
|
||||
|
||||
std::vector<u16> icon_data = GameInfo::GetIcon(filepath);
|
||||
if (icon_data.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
jintArray icon = env->NewIntArray(static_cast<jsize>(icon_data.size() / 2));
|
||||
env->SetIntArrayRegion(icon, 0, env->GetArrayLength(icon),
|
||||
reinterpret_cast<jint*>(icon_data.data()));
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetTitle(JNIEnv* env, [[maybe_unused]] jclass clazz,
|
||||
jstring j_filename) {
|
||||
std::string filepath = GetJString(env, j_filename);
|
||||
const auto loader = Loader::GetLoader(filepath);
|
||||
auto Title = GameInfo::GetTitle(filepath);
|
||||
return env->NewStringUTF(Common::UTF16ToUTF8(Title).data());
|
||||
}
|
||||
|
||||
u64 title_id{};
|
||||
if (loader) {
|
||||
loader->ReadProgramId(title_id);
|
||||
}
|
||||
return static_cast<jlong>(title_id);
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetDescription(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_filename) {
|
||||
return j_filename;
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetGameId(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_filename) {
|
||||
return j_filename;
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetRegions(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_filename) {
|
||||
std::string filepath = GetJString(env, j_filename);
|
||||
|
||||
std::string regions = GameInfo::GetRegions(filepath);
|
||||
|
||||
return env->NewStringUTF(regions.c_str());
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetCompany(JNIEnv* env,
|
||||
[[maybe_unused]] jclass clazz,
|
||||
jstring j_filename) {
|
||||
std::string filepath = GetJString(env, j_filename);
|
||||
auto publisher = GameInfo::GetPublisher(filepath);
|
||||
return env->NewStringUTF(Common::UTF16ToUTF8(publisher).data());
|
||||
}
|
||||
|
||||
jstring Java_org_citra_citra_1emu_NativeLibrary_GetGitRevision(JNIEnv* env,
|
||||
|
@ -146,10 +146,6 @@
|
||||
<string name="select_game_folder">Select Game Folder</string>
|
||||
<string name="install_cia_title">Install CIA</string>
|
||||
|
||||
<!-- Game Properties -->
|
||||
<string name="properties">Properties</string>
|
||||
<string name="properties_not_loaded">The game properties could not be loaded.</string>
|
||||
|
||||
<!-- Preferences Screen -->
|
||||
<string name="preferences_settings">Settings</string>
|
||||
<string name="preferences_premium">Premium</string>
|
||||
|
@ -59,14 +59,6 @@ if(ENABLE_MF)
|
||||
# just a static library of GUIDS so include that one directly.
|
||||
target_link_libraries(audio_core PRIVATE mfuuid.lib)
|
||||
target_compile_definitions(audio_core PUBLIC HAVE_MF)
|
||||
elseif(ENABLE_AUDIOTOOLBOX)
|
||||
target_sources(audio_core PRIVATE
|
||||
hle/audiotoolbox_decoder.cpp
|
||||
hle/audiotoolbox_decoder.h
|
||||
)
|
||||
find_library(AUDIOTOOLBOX AudioToolbox)
|
||||
target_link_libraries(audio_core PRIVATE ${AUDIOTOOLBOX})
|
||||
target_compile_definitions(audio_core PUBLIC HAVE_AUDIOTOOLBOX)
|
||||
elseif(ENABLE_FFMPEG_AUDIO_DECODER)
|
||||
target_sources(audio_core PRIVATE
|
||||
hle/ffmpeg_decoder.cpp
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "common/common_types.h"
|
||||
|
||||
struct ADTSData {
|
||||
u8 header_length;
|
||||
bool MPEG2;
|
||||
u8 profile;
|
||||
u8 channels;
|
||||
|
@ -18,8 +18,6 @@ ADTSData ParseADTS(const char* buffer) {
|
||||
out.length = 0;
|
||||
return out;
|
||||
}
|
||||
// bit 16 = no CRC
|
||||
out.header_length = (buffer[1] & 0x1) ? 7 : 9;
|
||||
out.MPEG2 = (buffer[1] >> 3) & 0x1;
|
||||
// bit 17 to 18
|
||||
out.profile = (buffer[2] >> 6) + 1;
|
||||
|
@ -1,255 +0,0 @@
|
||||
// Copyright 2023 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#include "audio_core/audio_types.h"
|
||||
#include "audio_core/hle/adts.h"
|
||||
#include "audio_core/hle/audiotoolbox_decoder.h"
|
||||
|
||||
namespace AudioCore::HLE {
|
||||
|
||||
static constexpr auto bytes_per_sample = sizeof(s16);
|
||||
static constexpr auto aac_frames_per_packet = 1024;
|
||||
static constexpr auto error_out_of_data = -1932;
|
||||
|
||||
class AudioToolboxDecoder::Impl {
|
||||
public:
|
||||
explicit Impl(Memory::MemorySystem& memory);
|
||||
~Impl();
|
||||
std::optional<BinaryResponse> ProcessRequest(const BinaryRequest& request);
|
||||
|
||||
private:
|
||||
std::optional<BinaryResponse> Initalize(const BinaryRequest& request);
|
||||
std::optional<BinaryResponse> Decode(const BinaryRequest& request);
|
||||
|
||||
void Clear();
|
||||
bool InitializeDecoder(ADTSData& adts_header);
|
||||
|
||||
static OSStatus DataFunc(AudioConverterRef in_audio_converter, u32* io_number_data_packets,
|
||||
AudioBufferList* io_data,
|
||||
AudioStreamPacketDescription** out_data_packet_description,
|
||||
void* in_user_data);
|
||||
|
||||
Memory::MemorySystem& memory;
|
||||
|
||||
ADTSData adts_config;
|
||||
AudioStreamBasicDescription output_format = {};
|
||||
AudioConverterRef converter = nullptr;
|
||||
|
||||
u8* curr_data = nullptr;
|
||||
u32 curr_data_len = 0;
|
||||
|
||||
AudioStreamPacketDescription packet_description;
|
||||
};
|
||||
|
||||
AudioToolboxDecoder::Impl::Impl(Memory::MemorySystem& memory) : memory(memory) {}
|
||||
|
||||
std::optional<BinaryResponse> AudioToolboxDecoder::Impl::Initalize(const BinaryRequest& request) {
|
||||
BinaryResponse response;
|
||||
std::memcpy(&response, &request, sizeof(response));
|
||||
response.unknown1 = 0x0;
|
||||
|
||||
Clear();
|
||||
return response;
|
||||
}
|
||||
|
||||
AudioToolboxDecoder::Impl::~Impl() {
|
||||
Clear();
|
||||
}
|
||||
|
||||
void AudioToolboxDecoder::Impl::Clear() {
|
||||
curr_data = nullptr;
|
||||
curr_data_len = 0;
|
||||
|
||||
adts_config = {};
|
||||
output_format = {};
|
||||
|
||||
if (converter) {
|
||||
AudioConverterDispose(converter);
|
||||
converter = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<BinaryResponse> AudioToolboxDecoder::Impl::ProcessRequest(
|
||||
const BinaryRequest& request) {
|
||||
if (request.codec != DecoderCodec::AAC) {
|
||||
LOG_ERROR(Audio_DSP, "AudioToolbox AAC Decoder cannot handle such codec: {}",
|
||||
static_cast<u16>(request.codec));
|
||||
return {};
|
||||
}
|
||||
|
||||
switch (request.cmd) {
|
||||
case DecoderCommand::Init: {
|
||||
return Initalize(request);
|
||||
}
|
||||
case DecoderCommand::Decode: {
|
||||
return Decode(request);
|
||||
}
|
||||
case DecoderCommand::Unknown: {
|
||||
BinaryResponse response;
|
||||
std::memcpy(&response, &request, sizeof(response));
|
||||
response.unknown1 = 0x0;
|
||||
return response;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR(Audio_DSP, "Got unknown binary request: {}", static_cast<u16>(request.cmd));
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
bool AudioToolboxDecoder::Impl::InitializeDecoder(ADTSData& adts_header) {
|
||||
if (converter) {
|
||||
if (adts_config.channels == adts_header.channels &&
|
||||
adts_config.samplerate == adts_header.samplerate) {
|
||||
return true;
|
||||
} else {
|
||||
Clear();
|
||||
}
|
||||
}
|
||||
|
||||
AudioStreamBasicDescription input_format = {
|
||||
.mSampleRate = static_cast<Float64>(adts_header.samplerate),
|
||||
.mFormatID = kAudioFormatMPEG4AAC,
|
||||
.mFramesPerPacket = aac_frames_per_packet,
|
||||
.mChannelsPerFrame = adts_header.channels,
|
||||
};
|
||||
|
||||
u32 bytes_per_frame = input_format.mChannelsPerFrame * bytes_per_sample;
|
||||
output_format = {
|
||||
.mSampleRate = input_format.mSampleRate,
|
||||
.mFormatID = kAudioFormatLinearPCM,
|
||||
.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked,
|
||||
.mBytesPerPacket = bytes_per_frame,
|
||||
.mFramesPerPacket = 1,
|
||||
.mBytesPerFrame = bytes_per_frame,
|
||||
.mChannelsPerFrame = input_format.mChannelsPerFrame,
|
||||
.mBitsPerChannel = bytes_per_sample * 8,
|
||||
};
|
||||
|
||||
auto status = AudioConverterNew(&input_format, &output_format, &converter);
|
||||
if (status != noErr) {
|
||||
LOG_ERROR(Audio_DSP, "Could not create AAC audio converter: {}", status);
|
||||
Clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
adts_config = adts_header;
|
||||
return true;
|
||||
}
|
||||
|
||||
OSStatus AudioToolboxDecoder::Impl::DataFunc(
|
||||
AudioConverterRef in_audio_converter, u32* io_number_data_packets, AudioBufferList* io_data,
|
||||
AudioStreamPacketDescription** out_data_packet_description, void* in_user_data) {
|
||||
auto impl = reinterpret_cast<Impl*>(in_user_data);
|
||||
if (!impl || !impl->curr_data || impl->curr_data_len == 0) {
|
||||
*io_number_data_packets = 0;
|
||||
return error_out_of_data;
|
||||
}
|
||||
|
||||
io_data->mNumberBuffers = 1;
|
||||
io_data->mBuffers[0].mNumberChannels = 0;
|
||||
io_data->mBuffers[0].mDataByteSize = impl->curr_data_len;
|
||||
io_data->mBuffers[0].mData = impl->curr_data;
|
||||
*io_number_data_packets = 1;
|
||||
|
||||
if (out_data_packet_description != nullptr) {
|
||||
impl->packet_description.mStartOffset = 0;
|
||||
impl->packet_description.mVariableFramesInPacket = 0;
|
||||
impl->packet_description.mDataByteSize = impl->curr_data_len;
|
||||
*out_data_packet_description = &impl->packet_description;
|
||||
}
|
||||
|
||||
impl->curr_data = nullptr;
|
||||
impl->curr_data_len = 0;
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
||||
std::optional<BinaryResponse> AudioToolboxDecoder::Impl::Decode(const BinaryRequest& request) {
|
||||
BinaryResponse response;
|
||||
response.codec = request.codec;
|
||||
response.cmd = request.cmd;
|
||||
response.size = request.size;
|
||||
|
||||
if (request.src_addr < Memory::FCRAM_PADDR ||
|
||||
request.src_addr + request.size > Memory::FCRAM_PADDR + Memory::FCRAM_SIZE) {
|
||||
LOG_ERROR(Audio_DSP, "Got out of bounds src_addr {:08x}", request.src_addr);
|
||||
return {};
|
||||
}
|
||||
|
||||
auto data = memory.GetFCRAMPointer(request.src_addr - Memory::FCRAM_PADDR);
|
||||
auto adts_header = ParseADTS(reinterpret_cast<const char*>(data));
|
||||
curr_data = data + adts_header.header_length;
|
||||
curr_data_len = request.size - adts_header.header_length;
|
||||
|
||||
if (!InitializeDecoder(adts_header)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// 1024 samples, up to 2 channels each
|
||||
s16 decoder_output[2048];
|
||||
AudioBufferList out_buffer{1,
|
||||
{{
|
||||
output_format.mChannelsPerFrame,
|
||||
sizeof(decoder_output),
|
||||
decoder_output,
|
||||
}}};
|
||||
|
||||
u32 num_packets = sizeof(decoder_output) / output_format.mBytesPerPacket;
|
||||
auto status = AudioConverterFillComplexBuffer(converter, DataFunc, this, &num_packets,
|
||||
&out_buffer, nullptr);
|
||||
if (status != noErr && status != error_out_of_data) {
|
||||
LOG_ERROR(Audio_DSP, "Could not decode AAC data: {}", status);
|
||||
Clear();
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// De-interleave samples.
|
||||
std::array<std::vector<s16>, 2> out_streams;
|
||||
auto num_frames = num_packets * output_format.mFramesPerPacket;
|
||||
for (auto frame = 0; frame < num_frames; frame++) {
|
||||
for (auto ch = 0; ch < output_format.mChannelsPerFrame; ch++) {
|
||||
out_streams[ch].push_back(
|
||||
decoder_output[(frame * output_format.mChannelsPerFrame) + ch]);
|
||||
}
|
||||
}
|
||||
|
||||
curr_data = nullptr;
|
||||
curr_data_len = 0;
|
||||
|
||||
response.sample_rate = GetSampleRateEnum(static_cast<u32>(output_format.mSampleRate));
|
||||
response.num_channels = output_format.mChannelsPerFrame;
|
||||
response.num_samples = num_frames;
|
||||
|
||||
// transfer the decoded buffer from vector to the FCRAM
|
||||
for (auto ch = 0; ch < out_streams.size(); ch++) {
|
||||
if (!out_streams[ch].empty()) {
|
||||
auto dst = ch == 0 ? request.dst_addr_ch0 : request.dst_addr_ch1;
|
||||
if (dst < Memory::FCRAM_PADDR ||
|
||||
dst + out_streams[ch].size() > Memory::FCRAM_PADDR + Memory::FCRAM_SIZE) {
|
||||
LOG_ERROR(Audio_DSP, "Got out of bounds dst_addr_ch{} {:08x}", ch, dst);
|
||||
return {};
|
||||
}
|
||||
std::memcpy(memory.GetFCRAMPointer(dst - Memory::FCRAM_PADDR), out_streams[ch].data(),
|
||||
out_streams[ch].size() * bytes_per_sample);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
AudioToolboxDecoder::AudioToolboxDecoder(Memory::MemorySystem& memory)
|
||||
: impl(std::make_unique<Impl>(memory)) {}
|
||||
|
||||
AudioToolboxDecoder::~AudioToolboxDecoder() = default;
|
||||
|
||||
std::optional<BinaryResponse> AudioToolboxDecoder::ProcessRequest(const BinaryRequest& request) {
|
||||
return impl->ProcessRequest(request);
|
||||
}
|
||||
|
||||
bool AudioToolboxDecoder::IsValid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace AudioCore::HLE
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2023 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "audio_core/hle/decoder.h"
|
||||
|
||||
namespace AudioCore::HLE {
|
||||
|
||||
class AudioToolboxDecoder final : public DecoderBase {
|
||||
public:
|
||||
explicit AudioToolboxDecoder(Memory::MemorySystem& memory);
|
||||
~AudioToolboxDecoder() override;
|
||||
std::optional<BinaryResponse> ProcessRequest(const BinaryRequest& request) override;
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> impl;
|
||||
};
|
||||
|
||||
} // namespace AudioCore::HLE
|
@ -10,8 +10,6 @@
|
||||
#include "audio_core/audio_types.h"
|
||||
#ifdef HAVE_MF
|
||||
#include "audio_core/hle/wmf_decoder.h"
|
||||
#elif HAVE_AUDIOTOOLBOX
|
||||
#include "audio_core/hle/audiotoolbox_decoder.h"
|
||||
#elif HAVE_FFMPEG
|
||||
#include "audio_core/hle/ffmpeg_decoder.h"
|
||||
#elif ANDROID
|
||||
@ -133,8 +131,6 @@ DspHle::Impl::Impl(DspHle& parent_, Memory::MemorySystem& memory) : parent(paren
|
||||
}
|
||||
#elif defined(HAVE_MF)
|
||||
decoder = std::make_unique<HLE::WMFDecoder>(memory);
|
||||
#elif defined(HAVE_AUDIOTOOLBOX)
|
||||
decoder = std::make_unique<HLE::AudioToolboxDecoder>(memory);
|
||||
#elif defined(HAVE_FFMPEG)
|
||||
decoder = std::make_unique<HLE::FFMPEGDecoder>(memory);
|
||||
#elif ANDROID
|
||||
|
@ -36,10 +36,9 @@ private:
|
||||
Memory::MemorySystem& mMemory;
|
||||
std::unique_ptr<AMediaCodec, AMediaCodecRelease> mDecoder;
|
||||
// default: 2 channles, 48000 samplerate
|
||||
ADTSData mADTSData{
|
||||
/*header_length*/ 7, /*MPEG2*/ false, /*profile*/ 2,
|
||||
/*channels*/ 2, /*channel_idx*/ 2, /*framecount*/ 0,
|
||||
/*samplerate_idx*/ 3, /*length*/ 0, /*samplerate*/ 48000};
|
||||
ADTSData mADTSData{/* MPEG2 */ false, /*profile*/ 2, /*channels*/ 2,
|
||||
/*channel_idx*/ 2, /*framecount*/ 0, /*samplerate_idx*/ 3,
|
||||
/*length*/ 0, /*samplerate*/ 48000};
|
||||
};
|
||||
|
||||
MediaNDKDecoder::Impl::Impl(Memory::MemorySystem& memory) : mMemory(memory) {
|
||||
|
@ -12,6 +12,8 @@ add_executable(citra
|
||||
emu_window/emu_window_sdl2_gl.h
|
||||
emu_window/emu_window_sdl2_sw.cpp
|
||||
emu_window/emu_window_sdl2_sw.h
|
||||
emu_window/emu_window_sdl2_vk.cpp
|
||||
emu_window/emu_window_sdl2_vk.h
|
||||
precompiled_headers.h
|
||||
resource.h
|
||||
)
|
||||
@ -29,9 +31,13 @@ if(UNIX AND NOT APPLE)
|
||||
install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
endif()
|
||||
|
||||
if (MSVC AND ENABLE_WEB_SERVICE AND OPENSSL_DLL_DIR)
|
||||
if (MSVC)
|
||||
include(CopyCitraSDLDeps)
|
||||
copy_citra_SDL_deps(citra)
|
||||
if (ENABLE_WEB_SERVICE AND OPENSSL_DLL_DIR)
|
||||
include(CopyCitraOpensslDeps)
|
||||
copy_citra_openssl_deps(citra)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CITRA_USE_PRECOMPILED_HEADERS)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "citra/emu_window/emu_window_sdl2.h"
|
||||
#include "citra/emu_window/emu_window_sdl2_gl.h"
|
||||
#include "citra/emu_window/emu_window_sdl2_sw.h"
|
||||
#include "citra/emu_window/emu_window_sdl2_vk.h"
|
||||
#include "common/common_paths.h"
|
||||
#include "common/detached_tasks.h"
|
||||
#include "common/file_util.h"
|
||||
@ -358,18 +359,20 @@ int main(int argc, char** argv) {
|
||||
// Register frontend applets
|
||||
Frontend::RegisterDefaultApplets();
|
||||
|
||||
InputCommon::InputSubsystem input_subsystem{};
|
||||
EmuWindow_SDL2::InitializeSDL2();
|
||||
|
||||
const auto create_emu_window = [&](bool fullscreen,
|
||||
const auto create_emu_window = [](bool fullscreen,
|
||||
bool is_secondary) -> std::unique_ptr<EmuWindow_SDL2> {
|
||||
switch (Settings::values.graphics_api.GetValue()) {
|
||||
case Settings::GraphicsAPI::OpenGL:
|
||||
return std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen, is_secondary);
|
||||
return std::make_unique<EmuWindow_SDL2_GL>(fullscreen, is_secondary);
|
||||
case Settings::GraphicsAPI::Vulkan:
|
||||
return std::make_unique<EmuWindow_SDL2_VK>(fullscreen, is_secondary);
|
||||
case Settings::GraphicsAPI::Software:
|
||||
return std::make_unique<EmuWindow_SDL2_SW>(&input_subsystem, fullscreen, is_secondary);
|
||||
return std::make_unique<EmuWindow_SDL2_SW>(fullscreen, is_secondary);
|
||||
}
|
||||
LOG_ERROR(Frontend, "Invalid Graphics API, using OpenGL");
|
||||
return std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen, is_secondary);
|
||||
return std::make_unique<EmuWindow_SDL2_GL>(fullscreen, is_secondary);
|
||||
};
|
||||
|
||||
const auto emu_window{create_emu_window(fullscreen, false)};
|
||||
@ -496,6 +499,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
Network::Shutdown();
|
||||
InputCommon::Shutdown();
|
||||
|
||||
system.Shutdown();
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
#include "common/param_package.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "input_common/drivers/udp_client.h"
|
||||
#include "input_common/main.h"
|
||||
#include "input_common/udp/client.h"
|
||||
#include "network/network_settings.h"
|
||||
|
||||
Config::Config() {
|
||||
@ -97,7 +97,8 @@ void Config::ReadSetting(const std::string& group, Settings::Setting<Type, range
|
||||
|
||||
void Config::ReadValues() {
|
||||
// Controls
|
||||
/*for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
||||
// TODO: add multiple input profile support
|
||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
||||
std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]);
|
||||
Settings::values.current_input_profile.buttons[i] =
|
||||
sdl2_config->GetString("Controls", Settings::NativeButton::mapping[i], default_param);
|
||||
@ -124,7 +125,7 @@ void Config::ReadValues() {
|
||||
"Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_ADDR);
|
||||
Settings::values.current_input_profile.udp_input_port =
|
||||
static_cast<u16>(sdl2_config->GetInteger("Controls", "udp_input_port",
|
||||
InputCommon::CemuhookUDP::DEFAULT_PORT));*/
|
||||
InputCommon::CemuhookUDP::DEFAULT_PORT));
|
||||
|
||||
// Core
|
||||
ReadSetting("Core", Settings::values.use_cpu_jit);
|
||||
|
@ -99,7 +99,7 @@ cpu_clock_percentage =
|
||||
|
||||
[Renderer]
|
||||
# Whether to render using OpenGL or Software
|
||||
# 0: Software, 1: OpenGL (default)
|
||||
# 0: Software, 1: OpenGL (default), 2: Vulkan (default)
|
||||
graphics_api =
|
||||
|
||||
# Whether to render using GLES or OpenGL
|
||||
|
@ -2,38 +2,131 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#define SDL_MAIN_HANDLED
|
||||
#include <SDL.h>
|
||||
#include "citra/emu_window/emu_window_sdl2.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scm_rev.h"
|
||||
#include "core/core.h"
|
||||
#include "input_common/drivers/keyboard.h"
|
||||
#include "input_common/drivers/mouse.h"
|
||||
#include "input_common/drivers/touch_screen.h"
|
||||
#include "input_common/keyboard.h"
|
||||
#include "input_common/main.h"
|
||||
#include "input_common/motion_emu.h"
|
||||
#include "network/network.h"
|
||||
|
||||
EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, bool is_secondary)
|
||||
: EmuWindow(is_secondary), input_subsystem{input_subsystem_} {
|
||||
void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {
|
||||
TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0));
|
||||
InputCommon::GetMotionEmu()->Tilt(x, y);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
|
||||
if (button == SDL_BUTTON_LEFT) {
|
||||
if (state == SDL_PRESSED) {
|
||||
TouchPressed((unsigned)std::max(x, 0), (unsigned)std::max(y, 0));
|
||||
} else {
|
||||
TouchReleased();
|
||||
}
|
||||
} else if (button == SDL_BUTTON_RIGHT) {
|
||||
if (state == SDL_PRESSED) {
|
||||
InputCommon::GetMotionEmu()->BeginTilt(x, y);
|
||||
} else {
|
||||
InputCommon::GetMotionEmu()->EndTilt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<unsigned, unsigned> EmuWindow_SDL2::TouchToPixelPos(float touch_x, float touch_y) const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(render_window, &w, &h);
|
||||
|
||||
touch_x *= w;
|
||||
touch_y *= h;
|
||||
|
||||
return {static_cast<unsigned>(std::max(std::round(touch_x), 0.0f)),
|
||||
static_cast<unsigned>(std::max(std::round(touch_y), 0.0f))};
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerDown(float x, float y) {
|
||||
// TODO(NeatNit): keep track of multitouch using the fingerID and a dictionary of some kind
|
||||
// This isn't critical because the best we can do when we have that is to average them, like the
|
||||
// 3DS does
|
||||
|
||||
const auto [px, py] = TouchToPixelPos(x, y);
|
||||
TouchPressed(px, py);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerMotion(float x, float y) {
|
||||
const auto [px, py] = TouchToPixelPos(x, y);
|
||||
TouchMoved(px, py);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerUp() {
|
||||
TouchReleased();
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) {
|
||||
if (state == SDL_PRESSED) {
|
||||
InputCommon::GetKeyboard()->PressKey(key);
|
||||
} else if (state == SDL_RELEASED) {
|
||||
InputCommon::GetKeyboard()->ReleaseKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
bool EmuWindow_SDL2::IsOpen() const {
|
||||
return is_open;
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::RequestClose() {
|
||||
is_open = false;
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnResize() {
|
||||
int width, height;
|
||||
SDL_GL_GetDrawableSize(render_window, &width, &height);
|
||||
UpdateCurrentFramebufferLayout(width, height);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::Fullscreen() {
|
||||
if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError());
|
||||
|
||||
// Try a different fullscreening method
|
||||
LOG_INFO(Frontend, "Attempting to use borderless fullscreen...");
|
||||
if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError());
|
||||
|
||||
// Fallback algorithm: Maximise window.
|
||||
// Works on all systems (unless something is seriously wrong), so no fallback for this one.
|
||||
LOG_INFO(Frontend, "Falling back on a maximised window...");
|
||||
SDL_MaximizeWindow(render_window);
|
||||
}
|
||||
|
||||
EmuWindow_SDL2::EmuWindow_SDL2(bool is_secondary) : EmuWindow(is_secondary) {}
|
||||
|
||||
EmuWindow_SDL2::~EmuWindow_SDL2() {
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::InitializeSDL2() {
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) < 0) {
|
||||
LOG_CRITICAL(Frontend, "Failed to initialize SDL2: {}! Exiting...", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
input_subsystem->Initialize();
|
||||
InputCommon::Init();
|
||||
Network::Init();
|
||||
|
||||
SDL_SetMainReady();
|
||||
}
|
||||
|
||||
EmuWindow_SDL2::~EmuWindow_SDL2() {
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::PollEvents() {
|
||||
SDL_Event event;
|
||||
std::vector<SDL_Event> other_window_events;
|
||||
@ -77,12 +170,10 @@ void EmuWindow_SDL2::PollEvents() {
|
||||
}
|
||||
break;
|
||||
case SDL_FINGERDOWN:
|
||||
OnFingerDown(event.tfinger.x, event.tfinger.y,
|
||||
static_cast<std::size_t>(event.tfinger.touchId));
|
||||
OnFingerDown(event.tfinger.x, event.tfinger.y);
|
||||
break;
|
||||
case SDL_FINGERMOTION:
|
||||
OnFingerMotion(event.tfinger.x, event.tfinger.y,
|
||||
static_cast<std::size_t>(event.tfinger.touchId));
|
||||
OnFingerMotion(event.tfinger.x, event.tfinger.y);
|
||||
break;
|
||||
case SDL_FINGERUP:
|
||||
OnFingerUp();
|
||||
@ -104,106 +195,6 @@ void EmuWindow_SDL2::PollEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {
|
||||
const auto [touch_x, touch_y] = MouseToTouchPos(x, y);
|
||||
input_subsystem->GetMouse()->Move(x, y, 0, 0);
|
||||
input_subsystem->GetMouse()->MouseMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->TouchMove(touch_x, touch_y);
|
||||
}
|
||||
|
||||
InputCommon::MouseButton EmuWindow_SDL2::SDLButtonToMouseButton(u32 button) const {
|
||||
switch (button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
return InputCommon::MouseButton::Left;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
return InputCommon::MouseButton::Right;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
return InputCommon::MouseButton::Wheel;
|
||||
case SDL_BUTTON_X1:
|
||||
return InputCommon::MouseButton::Backward;
|
||||
case SDL_BUTTON_X2:
|
||||
return InputCommon::MouseButton::Forward;
|
||||
default:
|
||||
return InputCommon::MouseButton::Undefined;
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<float, float> EmuWindow_SDL2::MouseToTouchPos(s32 touch_x, s32 touch_y) const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(render_window, &w, &h);
|
||||
const float fx = static_cast<float>(touch_x) / w;
|
||||
const float fy = static_cast<float>(touch_y) / h;
|
||||
|
||||
return {std::clamp<float>(fx, 0.0f, 1.0f), std::clamp<float>(fy, 0.0f, 1.0f)};
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
|
||||
const auto mouse_button = SDLButtonToMouseButton(button);
|
||||
if (state == SDL_PRESSED) {
|
||||
const auto [touch_x, touch_y] = MouseToTouchPos(x, y);
|
||||
input_subsystem->GetMouse()->PressButton(x, y, mouse_button);
|
||||
input_subsystem->GetMouse()->PressMouseButton(mouse_button);
|
||||
input_subsystem->GetMouse()->PressTouchButton(touch_x, touch_y, mouse_button);
|
||||
} else {
|
||||
input_subsystem->GetMouse()->ReleaseButton(mouse_button);
|
||||
}
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerDown(float x, float y, std::size_t id) {
|
||||
input_subsystem->GetTouchScreen()->TouchPressed(x, y, id);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerMotion(float x, float y, std::size_t id) {
|
||||
input_subsystem->GetTouchScreen()->TouchMoved(x, y, id);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnFingerUp() {
|
||||
input_subsystem->GetTouchScreen()->ReleaseAllTouch();
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) {
|
||||
if (state == SDL_PRESSED) {
|
||||
input_subsystem->GetKeyboard()->PressKey(static_cast<std::size_t>(key));
|
||||
} else if (state == SDL_RELEASED) {
|
||||
input_subsystem->GetKeyboard()->ReleaseKey(static_cast<std::size_t>(key));
|
||||
}
|
||||
}
|
||||
|
||||
bool EmuWindow_SDL2::IsOpen() const {
|
||||
return is_open;
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::RequestClose() {
|
||||
is_open = false;
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnResize() {
|
||||
int width, height;
|
||||
SDL_GL_GetDrawableSize(render_window, &width, &height);
|
||||
UpdateCurrentFramebufferLayout(width, height);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::Fullscreen() {
|
||||
if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError());
|
||||
|
||||
// Try a different fullscreening method
|
||||
LOG_INFO(Frontend, "Attempting to use borderless fullscreen...");
|
||||
if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError());
|
||||
|
||||
// Fallback algorithm: Maximise window.
|
||||
// Works on all systems (unless something is seriously wrong), so no fallback for this one.
|
||||
LOG_INFO(Frontend, "Falling back on a maximised window...");
|
||||
SDL_MaximizeWindow(render_window);
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) {
|
||||
SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second);
|
||||
}
|
||||
|
@ -10,16 +10,14 @@
|
||||
|
||||
struct SDL_Window;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
enum class MouseButton;
|
||||
} // namespace InputCommon
|
||||
|
||||
class EmuWindow_SDL2 : public Frontend::EmuWindow {
|
||||
public:
|
||||
explicit EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem, bool is_secondary);
|
||||
explicit EmuWindow_SDL2(bool is_secondary);
|
||||
~EmuWindow_SDL2();
|
||||
|
||||
/// Initializes SDL2
|
||||
static void InitializeSDL2();
|
||||
|
||||
/// Presents the most recent frame from the video backend
|
||||
virtual void Present() {}
|
||||
|
||||
@ -39,20 +37,17 @@ protected:
|
||||
/// Called by PollEvents when the mouse moves.
|
||||
void OnMouseMotion(s32 x, s32 y);
|
||||
|
||||
/// Converts a SDL mouse button into MouseInput mouse button
|
||||
InputCommon::MouseButton SDLButtonToMouseButton(u32 button) const;
|
||||
|
||||
/// Translates pixel position to float position
|
||||
std::pair<float, float> MouseToTouchPos(s32 touch_x, s32 touch_y) const;
|
||||
|
||||
/// Called by PollEvents when a mouse button is pressed or released
|
||||
void OnMouseButton(u32 button, u8 state, s32 x, s32 y);
|
||||
|
||||
/// Translates pixel position (0..1) to pixel positions
|
||||
std::pair<unsigned, unsigned> TouchToPixelPos(float touch_x, float touch_y) const;
|
||||
|
||||
/// Called by PollEvents when a finger starts touching the touchscreen
|
||||
void OnFingerDown(float x, float y, std::size_t id);
|
||||
void OnFingerDown(float x, float y);
|
||||
|
||||
/// Called by PollEvents when a finger moves while touching the touchscreen
|
||||
void OnFingerMotion(float x, float y, std::size_t id);
|
||||
void OnFingerMotion(float x, float y);
|
||||
|
||||
/// Called by PollEvents when a finger stops touching the touchscreen
|
||||
void OnFingerUp();
|
||||
@ -83,7 +78,4 @@ protected:
|
||||
|
||||
/// Keeps track of how often to update the title bar during gameplay
|
||||
u32 last_time = 0;
|
||||
|
||||
/// Input subsystem to use with this window.
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
};
|
||||
|
@ -42,8 +42,8 @@ private:
|
||||
SDL_GLContext context;
|
||||
};
|
||||
|
||||
EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem, bool fullscreen, bool is_secondary)
|
||||
: EmuWindow_SDL2{input_subsystem, is_secondary} {
|
||||
EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(bool fullscreen, bool is_secondary)
|
||||
: EmuWindow_SDL2{is_secondary} {
|
||||
// Initialize the window
|
||||
if (Settings::values.use_gles) {
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
|
@ -11,7 +11,7 @@ struct SDL_Window;
|
||||
|
||||
class EmuWindow_SDL2_GL : public EmuWindow_SDL2 {
|
||||
public:
|
||||
explicit EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem, bool fullscreen, bool is_secondary);
|
||||
explicit EmuWindow_SDL2_GL(bool fullscreen, bool is_secondary);
|
||||
~EmuWindow_SDL2_GL();
|
||||
|
||||
void Present() override;
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
class DummyContext : public Frontend::GraphicsContext {};
|
||||
|
||||
EmuWindow_SDL2_SW::EmuWindow_SDL2_SW(InputCommon::InputSubsystem* input_subsystem, bool fullscreen, bool is_secondary)
|
||||
: EmuWindow_SDL2{input_subsystem, is_secondary} {
|
||||
EmuWindow_SDL2_SW::EmuWindow_SDL2_SW(bool fullscreen, bool is_secondary)
|
||||
: EmuWindow_SDL2{is_secondary} {
|
||||
std::string window_title = fmt::format("Citra {} | {}-{}", Common::g_build_fullname,
|
||||
Common::g_scm_branch, Common::g_scm_desc);
|
||||
render_window =
|
||||
|
@ -12,7 +12,7 @@ struct SDL_Surface;
|
||||
|
||||
class EmuWindow_SDL2_SW : public EmuWindow_SDL2 {
|
||||
public:
|
||||
explicit EmuWindow_SDL2_SW(InputCommon::InputSubsystem* input_subsystem, bool fullscreen, bool is_secondary);
|
||||
explicit EmuWindow_SDL2_SW(bool fullscreen, bool is_secondary);
|
||||
~EmuWindow_SDL2_SW();
|
||||
|
||||
void Present() override;
|
||||
|
87
src/citra/emu_window/emu_window_sdl2_vk.cpp
Normal file
87
src/citra/emu_window/emu_window_sdl2_vk.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
// Copyright 2023 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <SDL.h>
|
||||
#include <SDL_syswm.h>
|
||||
#include <fmt/format.h>
|
||||
#include "citra/emu_window/emu_window_sdl2_vk.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scm_rev.h"
|
||||
|
||||
class DummyContext : public Frontend::GraphicsContext {};
|
||||
|
||||
EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(bool fullscreen, bool is_secondary)
|
||||
: EmuWindow_SDL2{is_secondary} {
|
||||
const std::string window_title = fmt::format("Citra {} | {}-{}", Common::g_build_fullname,
|
||||
Common::g_scm_branch, Common::g_scm_desc);
|
||||
render_window =
|
||||
SDL_CreateWindow(window_title.c_str(),
|
||||
SDL_WINDOWPOS_UNDEFINED, // x position
|
||||
SDL_WINDOWPOS_UNDEFINED, // y position
|
||||
Core::kScreenTopWidth, Core::kScreenTopHeight + Core::kScreenBottomHeight,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
SDL_SysWMinfo wm;
|
||||
SDL_VERSION(&wm.version);
|
||||
if (SDL_GetWindowWMInfo(render_window, &wm) == SDL_FALSE) {
|
||||
LOG_CRITICAL(Frontend, "Failed to get information from the window manager");
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (fullscreen) {
|
||||
Fullscreen();
|
||||
ShowCursor(false);
|
||||
}
|
||||
|
||||
switch (wm.subsystem) {
|
||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
||||
case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS:
|
||||
window_info.type = Frontend::WindowSystemType::Windows;
|
||||
window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_X11
|
||||
case SDL_SYSWM_TYPE::SDL_SYSWM_X11:
|
||||
window_info.type = Frontend::WindowSystemType::X11;
|
||||
window_info.display_connection = wm.info.x11.display;
|
||||
window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_WAYLAND
|
||||
case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND:
|
||||
window_info.type = Frontend::WindowSystemType::Wayland;
|
||||
window_info.display_connection = wm.info.wl.display;
|
||||
window_info.render_surface = wm.info.wl.surface;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
case SDL_SYSWM_TYPE::SDL_SYSWM_COCOA:
|
||||
window_info.type = Frontend::WindowSystemType::Cocoa;
|
||||
window_info.render_surface = SDL_Metal_CreateView(render_window);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_ANDROID
|
||||
case SDL_SYSWM_TYPE::SDL_SYSWM_ANDROID:
|
||||
window_info.type = Frontend::WindowSystemType::Android;
|
||||
window_info.render_surface = reinterpret_cast<void*>(wm.info.android.window);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
LOG_CRITICAL(Frontend, "Window manager subsystem {} not implemented", wm.subsystem);
|
||||
std::exit(EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
|
||||
OnResize();
|
||||
OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);
|
||||
SDL_PumpEvents();
|
||||
}
|
||||
|
||||
EmuWindow_SDL2_VK::~EmuWindow_SDL2_VK() = default;
|
||||
|
||||
std::unique_ptr<Frontend::GraphicsContext> EmuWindow_SDL2_VK::CreateSharedContext() const {
|
||||
return std::make_unique<DummyContext>();
|
||||
}
|
17
src/citra/emu_window/emu_window_sdl2_vk.h
Normal file
17
src/citra/emu_window/emu_window_sdl2_vk.h
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2023 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "citra/emu_window/emu_window_sdl2.h"
|
||||
#include "core/frontend/emu_window.h"
|
||||
|
||||
class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 {
|
||||
public:
|
||||
explicit EmuWindow_SDL2_VK(bool fullscreen, bool is_secondary);
|
||||
~EmuWindow_SDL2_VK() override;
|
||||
|
||||
std::unique_ptr<Frontend::GraphicsContext> CreateSharedContext() const override;
|
||||
};
|
@ -88,8 +88,6 @@ add_executable(citra-qt
|
||||
configuration/configure_cheats.cpp
|
||||
configuration/configure_cheats.h
|
||||
configuration/configure_cheats.ui
|
||||
configuration/input_profiles.cpp
|
||||
configuration/input_profiles.h
|
||||
debugger/console.h
|
||||
debugger/console.cpp
|
||||
debugger/graphics/graphics.cpp
|
||||
@ -210,13 +208,9 @@ if (ENABLE_QT_TRANSLATION)
|
||||
|
||||
# Update source TS file if enabled
|
||||
if (GENERATE_QT_TRANSLATION)
|
||||
get_target_property(QT_SRCS citra-qt SOURCES)
|
||||
get_target_property(QT_INCLUDES citra-qt INCLUDE_DIRECTORIES)
|
||||
qt_add_lupdate(citra-qt TS_FILES ${CITRA_QT_LANGUAGES}/en.ts
|
||||
SOURCES ${QT_SRCS} ${UIS}
|
||||
INCLUDE_DIRECTORIES ${QT_INCLUDES}
|
||||
NO_GLOBAL_TARGET)
|
||||
add_custom_target(translation ALL DEPENDS citra-qt_lupdate)
|
||||
get_target_property(SRCS citra-qt SOURCES)
|
||||
qt5_create_translation(QM_FILES ${SRCS} ${UIS} ${CITRA_QT_LANGUAGES}/en.ts)
|
||||
add_custom_target(translation ALL DEPENDS ${CITRA_QT_LANGUAGES}/en.ts)
|
||||
endif()
|
||||
|
||||
# Find all TS files except en.ts
|
||||
@ -224,7 +218,7 @@ if (ENABLE_QT_TRANSLATION)
|
||||
list(REMOVE_ITEM LANGUAGES_TS ${CITRA_QT_LANGUAGES}/en.ts)
|
||||
|
||||
# Compile TS files to QM files
|
||||
qt_add_lrelease(citra-qt TS_FILES ${LANGUAGES_TS} NO_GLOBAL_TARGET QM_FILES_OUTPUT_VARIABLE LANGUAGES_QM)
|
||||
qt5_add_translation(LANGUAGES_QM ${LANGUAGES_TS})
|
||||
|
||||
# Build a QRC file from the QM file list
|
||||
set(LANGUAGES_QRC ${CMAKE_CURRENT_BINARY_DIR}/languages.qrc)
|
||||
@ -236,7 +230,7 @@ if (ENABLE_QT_TRANSLATION)
|
||||
file(APPEND ${LANGUAGES_QRC} "</qresource></RCC>")
|
||||
|
||||
# Add the QRC file to package in all QM files
|
||||
qt_add_resources(LANGUAGES ${LANGUAGES_QRC})
|
||||
qt5_add_resources(LANGUAGES ${LANGUAGES_QRC})
|
||||
else()
|
||||
set(LANGUAGES)
|
||||
endif()
|
||||
@ -263,7 +257,7 @@ if (APPLE)
|
||||
)
|
||||
elseif(WIN32)
|
||||
# compile as a win32 gui application instead of a console application
|
||||
target_link_libraries(citra-qt PRIVATE Qt6::EntryPointImplementation)
|
||||
target_link_libraries(citra-qt PRIVATE Qt5::WinMain)
|
||||
if(MSVC)
|
||||
set_target_properties(citra-qt PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
|
||||
elseif(MINGW)
|
||||
@ -290,15 +284,15 @@ endif()
|
||||
create_target_directory_groups(citra-qt)
|
||||
|
||||
target_link_libraries(citra-qt PRIVATE audio_core citra_common citra_core input_common network video_core)
|
||||
target_link_libraries(citra-qt PRIVATE Boost::boost glad nihstro-headers Qt6::Widgets Qt6::Multimedia Qt6::Concurrent)
|
||||
target_link_libraries(citra-qt PRIVATE Boost::boost glad nihstro-headers Qt5::Widgets Qt5::Multimedia Qt5::Concurrent)
|
||||
target_link_libraries(citra-qt PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||
|
||||
if (NOT WIN32)
|
||||
target_include_directories(citra-qt PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
||||
target_include_directories(citra-qt PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(citra-qt PRIVATE Qt6::DBus)
|
||||
target_link_libraries(citra-qt PRIVATE Qt5::DBus)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(citra-qt PRIVATE
|
||||
@ -342,8 +336,10 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
include(CopyCitraQt6Deps)
|
||||
copy_citra_Qt6_deps(citra-qt)
|
||||
include(CopyCitraQt5Deps)
|
||||
include(CopyCitraSDLDeps)
|
||||
copy_citra_Qt5_deps(citra-qt)
|
||||
copy_citra_SDL_deps(citra-qt)
|
||||
if (ENABLE_WEB_SERVICE AND OPENSSL_DLL_DIR)
|
||||
include(CopyCitraOpensslDeps)
|
||||
copy_citra_openssl_deps(citra-qt)
|
||||
|
@ -20,12 +20,9 @@
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/framebuffer_layout.h"
|
||||
#include "core/perf_stats.h"
|
||||
#include "input_common/drivers/keyboard.h"
|
||||
#include "input_common/drivers/mouse.h"
|
||||
#include "input_common/drivers/touch_screen.h"
|
||||
#include "input_common/keyboard.h"
|
||||
#include "input_common/main.h"
|
||||
#include "network/network.h"
|
||||
#include "video_core/custom_textures/custom_tex_manager.h"
|
||||
#include "input_common/motion_emu.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
#include "video_core/video_core.h"
|
||||
|
||||
@ -63,17 +60,10 @@ static GMainWindow* GetMainWindow() {
|
||||
void EmuThread::run() {
|
||||
MicroProfileOnThreadCreate("EmuThread");
|
||||
const auto scope = core_context.Acquire();
|
||||
Core::System& system = Core::System::GetInstance();
|
||||
|
||||
if (Settings::values.preload_textures) {
|
||||
emit LoadProgress(VideoCore::LoadCallbackStage::Preload, 0, 0);
|
||||
system.CustomTexManager().PreloadTextures(
|
||||
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value,
|
||||
std::size_t total) { emit LoadProgress(stage, value, total); });
|
||||
}
|
||||
|
||||
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
|
||||
|
||||
Core::System& system = Core::System::GetInstance();
|
||||
system.Renderer().Rasterizer()->LoadDiskResources(
|
||||
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
|
||||
emit LoadProgress(stage, value, total);
|
||||
@ -227,9 +217,17 @@ private:
|
||||
|
||||
class DummyContext : public Frontend::GraphicsContext {};
|
||||
|
||||
template <bool is_native = true>
|
||||
class RenderWidget : public QWidget {
|
||||
public:
|
||||
RenderWidget(GRenderWindow* parent) : QWidget(parent) {
|
||||
if constexpr (is_native) {
|
||||
setAttribute(Qt::WA_NativeWindow);
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
if (GetWindowSystemType() == Frontend::WindowSystemType::Wayland) {
|
||||
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||
}
|
||||
}
|
||||
setMouseTracking(true);
|
||||
}
|
||||
|
||||
@ -248,15 +246,10 @@ public:
|
||||
};
|
||||
|
||||
#ifdef HAS_OPENGL
|
||||
class OpenGLRenderWidget : public RenderWidget {
|
||||
class OpenGLRenderWidget : public RenderWidget<true> {
|
||||
public:
|
||||
explicit OpenGLRenderWidget(GRenderWindow* parent, bool is_secondary)
|
||||
: RenderWidget(parent), is_secondary(is_secondary) {
|
||||
setAttribute(Qt::WA_NativeWindow);
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
if (GetWindowSystemType() == Frontend::WindowSystemType::Wayland) {
|
||||
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||
}
|
||||
windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
|
||||
}
|
||||
|
||||
@ -290,7 +283,14 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
struct SoftwareRenderWidget : public RenderWidget {
|
||||
class VulkanRenderWidget : public RenderWidget<true> {
|
||||
public:
|
||||
explicit VulkanRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {
|
||||
windowHandle()->setSurfaceType(QWindow::VulkanSurface);
|
||||
}
|
||||
};
|
||||
|
||||
struct SoftwareRenderWidget : public RenderWidget<false> {
|
||||
explicit SoftwareRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {}
|
||||
|
||||
void Present() override {
|
||||
@ -404,11 +404,8 @@ static Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window
|
||||
|
||||
std::unique_ptr<Frontend::GraphicsContext> GRenderWindow::main_context;
|
||||
|
||||
GRenderWindow::GRenderWindow(QWidget* parent_, EmuThread* emu_thread,
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
||||
bool is_secondary_)
|
||||
: QWidget(parent_), EmuWindow(is_secondary_),
|
||||
emu_thread(emu_thread), input_subsystem{std::move(input_subsystem_)} {
|
||||
GRenderWindow::GRenderWindow(QWidget* parent_, EmuThread* emu_thread, bool is_secondary_)
|
||||
: QWidget(parent_), EmuWindow(is_secondary_), emu_thread(emu_thread) {
|
||||
|
||||
setWindowTitle(QStringLiteral("Citra %1 | %2-%3")
|
||||
.arg(QString::fromUtf8(Common::g_build_name),
|
||||
@ -486,117 +483,90 @@ qreal GRenderWindow::windowPixelRatio() const {
|
||||
return devicePixelRatioF();
|
||||
}
|
||||
|
||||
std::pair<u32, u32> GRenderWindow::ScaleTouch(const QPointF pos) const {
|
||||
const qreal pixel_ratio = windowPixelRatio();
|
||||
return {static_cast<u32>(std::max(std::round(pos.x() * pixel_ratio), qreal{0.0})),
|
||||
static_cast<u32>(std::max(std::round(pos.y() * pixel_ratio), qreal{0.0}))};
|
||||
}
|
||||
|
||||
void GRenderWindow::closeEvent(QCloseEvent* event) {
|
||||
emit Closed();
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void GRenderWindow::keyPressEvent(QKeyEvent* event) {
|
||||
if (!event->isAutoRepeat()) {
|
||||
input_subsystem->GetKeyboard()->PressKey(event->key());
|
||||
}
|
||||
InputCommon::GetKeyboard()->PressKey(event->key());
|
||||
}
|
||||
|
||||
void GRenderWindow::keyReleaseEvent(QKeyEvent* event) {
|
||||
if (!event->isAutoRepeat()) {
|
||||
input_subsystem->GetKeyboard()->ReleaseKey(event->key());
|
||||
}
|
||||
}
|
||||
|
||||
InputCommon::MouseButton GRenderWindow::QtButtonToMouseButton(Qt::MouseButton button) {
|
||||
switch (button) {
|
||||
case Qt::LeftButton:
|
||||
return InputCommon::MouseButton::Left;
|
||||
case Qt::RightButton:
|
||||
return InputCommon::MouseButton::Right;
|
||||
case Qt::MiddleButton:
|
||||
return InputCommon::MouseButton::Wheel;
|
||||
case Qt::BackButton:
|
||||
return InputCommon::MouseButton::Backward;
|
||||
case Qt::ForwardButton:
|
||||
return InputCommon::MouseButton::Forward;
|
||||
case Qt::TaskButton:
|
||||
return InputCommon::MouseButton::Task;
|
||||
default:
|
||||
return InputCommon::MouseButton::Extra;
|
||||
}
|
||||
InputCommon::GetKeyboard()->ReleaseKey(event->key());
|
||||
}
|
||||
|
||||
void GRenderWindow::mousePressEvent(QMouseEvent* event) {
|
||||
// Touch input is handled in TouchBeginEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
return; // touch input is handled in TouchBeginEvent
|
||||
}
|
||||
// Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
|
||||
// coordinates and map them to the current render area
|
||||
const auto pos = mapFromGlobal(QCursor::pos());
|
||||
const auto [touch_x, touch_y] = MapToTouchScreen(pos.x(), pos.y());
|
||||
const auto button = QtButtonToMouseButton(event->button());
|
||||
|
||||
input_subsystem->GetMouse()->PressMouseButton(button);
|
||||
input_subsystem->GetMouse()->PressButton(pos.x(), pos.y(), button);
|
||||
input_subsystem->GetMouse()->PressTouchButton(touch_x, touch_y, button);
|
||||
|
||||
auto pos = event->pos();
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
const auto [x, y] = ScaleTouch(pos);
|
||||
this->TouchPressed(x, y);
|
||||
} else if (event->button() == Qt::RightButton) {
|
||||
InputCommon::GetMotionEmu()->BeginTilt(pos.x(), pos.y());
|
||||
}
|
||||
emit MouseActivity();
|
||||
}
|
||||
|
||||
void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
|
||||
// Touch input is handled in TouchUpdateEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
return; // touch input is handled in TouchUpdateEvent
|
||||
}
|
||||
// Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
|
||||
// coordinates and map them to the current render area
|
||||
const auto pos = mapFromGlobal(QCursor::pos());
|
||||
const auto [touch_x, touch_y] = MapToTouchScreen(pos.x(), pos.y());
|
||||
const int center_x = width() / 2;
|
||||
const int center_y = height() / 2;
|
||||
|
||||
input_subsystem->GetMouse()->MouseMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->TouchMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->Move(pos.x(), pos.y(), center_x, center_y);
|
||||
|
||||
auto pos = event->pos();
|
||||
const auto [x, y] = ScaleTouch(pos);
|
||||
this->TouchMoved(x, y);
|
||||
InputCommon::GetMotionEmu()->Tilt(pos.x(), pos.y());
|
||||
emit MouseActivity();
|
||||
}
|
||||
|
||||
void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
|
||||
// Touch input is handled in TouchEndEvent
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
return; // touch input is handled in TouchEndEvent
|
||||
}
|
||||
|
||||
const auto button = QtButtonToMouseButton(event->button());
|
||||
input_subsystem->GetMouse()->ReleaseButton(button);
|
||||
}
|
||||
|
||||
void GRenderWindow::wheelEvent(QWheelEvent* event) {
|
||||
const int x = event->angleDelta().x();
|
||||
const int y = event->angleDelta().y();
|
||||
input_subsystem->GetMouse()->MouseWheelChange(x, y);
|
||||
if (event->button() == Qt::LeftButton)
|
||||
this->TouchReleased();
|
||||
else if (event->button() == Qt::RightButton)
|
||||
InputCommon::GetMotionEmu()->EndTilt();
|
||||
emit MouseActivity();
|
||||
}
|
||||
|
||||
void GRenderWindow::TouchBeginEvent(const QTouchEvent* event) {
|
||||
QList<QTouchEvent::TouchPoint> touch_points = event->touchPoints();
|
||||
for (const auto& touch_point : touch_points) {
|
||||
const auto pos = touch_point.pos();
|
||||
const auto [touch_x, touch_y] = MapToTouchScreen(pos.x(), pos.y());
|
||||
input_subsystem->GetTouchScreen()->TouchPressed(touch_x, touch_y, touch_point.id());
|
||||
}
|
||||
// TouchBegin always has exactly one touch point, so take the .first()
|
||||
const auto [x, y] = ScaleTouch(event->touchPoints().first().pos());
|
||||
this->TouchPressed(x, y);
|
||||
}
|
||||
|
||||
void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) {
|
||||
QList<QTouchEvent::TouchPoint> touch_points = event->touchPoints();
|
||||
input_subsystem->GetTouchScreen()->ClearActiveFlag();
|
||||
for (const auto& touch_point : touch_points) {
|
||||
const auto pos = touch_point.pos();
|
||||
const auto [touch_x, touch_y] = MapToTouchScreen(pos.x(), pos.y());
|
||||
input_subsystem->GetTouchScreen()->TouchMoved(touch_x, touch_y, touch_point.id());
|
||||
QPointF pos;
|
||||
int active_points = 0;
|
||||
|
||||
// average all active touch points
|
||||
for (const auto& tp : event->touchPoints()) {
|
||||
if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) {
|
||||
active_points++;
|
||||
pos += tp.pos();
|
||||
}
|
||||
input_subsystem->GetTouchScreen()->ReleaseInactiveTouch();
|
||||
}
|
||||
|
||||
pos /= active_points;
|
||||
|
||||
const auto [x, y] = ScaleTouch(pos);
|
||||
this->TouchMoved(x, y);
|
||||
}
|
||||
|
||||
void GRenderWindow::TouchEndEvent() {
|
||||
input_subsystem->GetTouchScreen()->ReleaseAllTouch();
|
||||
this->TouchReleased();
|
||||
}
|
||||
|
||||
bool GRenderWindow::event(QEvent* event) {
|
||||
@ -620,9 +590,7 @@ bool GRenderWindow::event(QEvent* event) {
|
||||
|
||||
void GRenderWindow::focusOutEvent(QFocusEvent* event) {
|
||||
QWidget::focusOutEvent(event);
|
||||
input_subsystem->GetKeyboard()->ReleaseAllKeys();
|
||||
input_subsystem->GetMouse()->ReleaseAllButtons();
|
||||
input_subsystem->GetTouchScreen()->ReleaseAllTouch();
|
||||
InputCommon::GetKeyboard()->ReleaseAllKeys();
|
||||
has_focus = false;
|
||||
}
|
||||
|
||||
@ -655,6 +623,11 @@ bool GRenderWindow::InitRenderTarget() {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Settings::GraphicsAPI::Vulkan:
|
||||
if (!InitializeVulkan()) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Update the Window System information with the new render target
|
||||
@ -740,6 +713,15 @@ bool GRenderWindow::InitializeOpenGL() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GRenderWindow::InitializeVulkan() {
|
||||
auto child = new VulkanRenderWidget(this);
|
||||
child_widget = child;
|
||||
child_widget->windowHandle()->create();
|
||||
main_context = std::make_unique<DummyContext>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GRenderWindow::InitializeSoftware() {
|
||||
child_widget = new SoftwareRenderWidget(this);
|
||||
main_context = std::make_unique<DummyContext>();
|
||||
|
@ -18,11 +18,6 @@ class QTouchEvent;
|
||||
|
||||
class GRenderWindow;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
enum class MouseButton;
|
||||
} // namespace InputCommon
|
||||
|
||||
namespace VideoCore {
|
||||
enum class LoadCallbackStage;
|
||||
}
|
||||
@ -117,8 +112,7 @@ class GRenderWindow : public QWidget, public Frontend::EmuWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GRenderWindow(QWidget* parent, EmuThread* emu_thread,
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_, bool is_secondary);
|
||||
GRenderWindow(QWidget* parent, EmuThread* emu_thread, bool is_secondary);
|
||||
~GRenderWindow() override;
|
||||
|
||||
// EmuWindow implementation.
|
||||
@ -141,13 +135,9 @@ public:
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
|
||||
/// Converts a Qt mouse button into MouseInput mouse button
|
||||
static InputCommon::MouseButton QtButtonToMouseButton(Qt::MouseButton button);
|
||||
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
|
||||
bool event(QEvent* event) override;
|
||||
|
||||
@ -192,13 +182,13 @@ private:
|
||||
void OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) override;
|
||||
|
||||
bool InitializeOpenGL();
|
||||
bool InitializeVulkan();
|
||||
void InitializeSoftware();
|
||||
bool LoadOpenGL();
|
||||
|
||||
QWidget* child_widget = nullptr;
|
||||
|
||||
EmuThread* emu_thread;
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem;
|
||||
|
||||
/// Main context that will be shared with all other contexts that are requested.
|
||||
/// If this is used in a shared context setting, then this should not be used directly, but
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QCamera>
|
||||
#include <QCameraInfo>
|
||||
#include <QImageReader>
|
||||
#include <QMediaDevices>
|
||||
#include <QMessageBox>
|
||||
#include <QThread>
|
||||
#include "citra_qt/camera/qt_multimedia_camera.h"
|
||||
#include "citra_qt/main.h"
|
||||
@ -15,85 +16,229 @@
|
||||
|
||||
namespace Camera {
|
||||
|
||||
std::shared_ptr<QtMultimediaCameraHandler> QtMultimediaCameraHandlerFactory::Create(
|
||||
QList<QVideoFrame::PixelFormat> QtCameraSurface::supportedPixelFormats(
|
||||
[[maybe_unused]] QAbstractVideoBuffer::HandleType handleType) const {
|
||||
return QList<QVideoFrame::PixelFormat>()
|
||||
<< QVideoFrame::Format_RGB32 << QVideoFrame::Format_RGB24
|
||||
<< QVideoFrame::Format_ARGB32_Premultiplied << QVideoFrame::Format_ARGB32
|
||||
<< QVideoFrame::Format_RGB565 << QVideoFrame::Format_RGB555
|
||||
<< QVideoFrame::Format_Jpeg
|
||||
// the following formats are supported via Qt internal conversions
|
||||
<< QVideoFrame::Format_ARGB8565_Premultiplied << QVideoFrame::Format_BGRA32
|
||||
<< QVideoFrame::Format_BGRA32_Premultiplied << QVideoFrame::Format_BGR32
|
||||
<< QVideoFrame::Format_BGR24 << QVideoFrame::Format_BGR565 << QVideoFrame::Format_BGR555
|
||||
<< QVideoFrame::Format_AYUV444 << QVideoFrame::Format_YUV444
|
||||
<< QVideoFrame::Format_YUV420P << QVideoFrame::Format_YV12 << QVideoFrame::Format_UYVY
|
||||
<< QVideoFrame::Format_YUYV << QVideoFrame::Format_NV12
|
||||
<< QVideoFrame::Format_NV21; // Supporting all the QImage convertible formats, ordered by
|
||||
// QImage decoding performance
|
||||
}
|
||||
|
||||
bool QtCameraSurface::present(const QVideoFrame& frame) {
|
||||
if (!frame.isValid()) {
|
||||
return false;
|
||||
}
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
QMutexLocker locker(&mutex);
|
||||
// In Qt 5.15, the image is already flipped
|
||||
current_frame = frame.image();
|
||||
locker.unlock();
|
||||
#else
|
||||
QVideoFrame cloneFrame(frame);
|
||||
cloneFrame.map(QAbstractVideoBuffer::ReadOnly);
|
||||
const QImage image(cloneFrame.bits(), cloneFrame.width(), cloneFrame.height(),
|
||||
QVideoFrame::imageFormatFromPixelFormat(cloneFrame.pixelFormat()));
|
||||
QMutexLocker locker(&mutex);
|
||||
current_frame = image.mirrored(true, true);
|
||||
locker.unlock();
|
||||
cloneFrame.unmap();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
QtMultimediaCamera::QtMultimediaCamera(const std::string& camera_name,
|
||||
const Service::CAM::Flip& flip)
|
||||
: QtCameraInterface(flip), handler(QtMultimediaCameraHandler::GetHandler(camera_name)) {
|
||||
if (handler->thread() == QThread::currentThread()) {
|
||||
handler->CreateCamera(camera_name);
|
||||
} else {
|
||||
QMetaObject::invokeMethod(handler.get(), "CreateCamera", Qt::BlockingQueuedConnection,
|
||||
Q_ARG(const std::string&, camera_name));
|
||||
}
|
||||
}
|
||||
|
||||
QtMultimediaCamera::~QtMultimediaCamera() {
|
||||
handler->StopCamera();
|
||||
QtMultimediaCameraHandler::ReleaseHandler(handler);
|
||||
}
|
||||
|
||||
void QtMultimediaCamera::StartCapture() {
|
||||
if (handler->thread() == QThread::currentThread()) {
|
||||
handler->StartCamera();
|
||||
} else {
|
||||
QMetaObject::invokeMethod(handler.get(), "StartCamera", Qt::BlockingQueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
void QtMultimediaCamera::StopCapture() {
|
||||
handler->StopCamera();
|
||||
}
|
||||
|
||||
void QtMultimediaCamera::SetFrameRate(Service::CAM::FrameRate frame_rate) {
|
||||
const std::array<QCamera::FrameRateRange, 13> FrameRateList = {
|
||||
/* Rate_15 */ QCamera::FrameRateRange(15, 15),
|
||||
/* Rate_15_To_5 */ QCamera::FrameRateRange(5, 15),
|
||||
/* Rate_15_To_2 */ QCamera::FrameRateRange(2, 15),
|
||||
/* Rate_10 */ QCamera::FrameRateRange(10, 10),
|
||||
/* Rate_8_5 */ QCamera::FrameRateRange(8.5, 8.5),
|
||||
/* Rate_5 */ QCamera::FrameRateRange(5, 5),
|
||||
/* Rate_20 */ QCamera::FrameRateRange(20, 20),
|
||||
/* Rate_20_To_5 */ QCamera::FrameRateRange(5, 20),
|
||||
/* Rate_30 */ QCamera::FrameRateRange(30, 30),
|
||||
/* Rate_30_To_5 */ QCamera::FrameRateRange(5, 30),
|
||||
/* Rate_15_To_10 */ QCamera::FrameRateRange(10, 15),
|
||||
/* Rate_20_To_10 */ QCamera::FrameRateRange(10, 20),
|
||||
/* Rate_30_To_10 */ QCamera::FrameRateRange(10, 30),
|
||||
};
|
||||
|
||||
auto framerate = FrameRateList[static_cast<int>(frame_rate)];
|
||||
|
||||
if (handler->camera->supportedViewfinderFrameRateRanges().contains(framerate)) {
|
||||
handler->settings.setMinimumFrameRate(framerate.minimumFrameRate);
|
||||
handler->settings.setMaximumFrameRate(framerate.maximumFrameRate);
|
||||
}
|
||||
}
|
||||
|
||||
QImage QtMultimediaCamera::QtReceiveFrame() {
|
||||
QMutexLocker locker(&handler->camera_surface.mutex);
|
||||
return handler->camera_surface.current_frame;
|
||||
}
|
||||
|
||||
bool QtMultimediaCamera::IsPreviewAvailable() {
|
||||
return handler->CameraAvailable();
|
||||
}
|
||||
|
||||
std::unique_ptr<CameraInterface> QtMultimediaCameraFactory::Create(const std::string& config,
|
||||
const Service::CAM::Flip& flip) {
|
||||
return std::make_unique<QtMultimediaCamera>(config, flip);
|
||||
}
|
||||
|
||||
std::array<std::shared_ptr<QtMultimediaCameraHandler>, 3> QtMultimediaCameraHandler::handlers;
|
||||
|
||||
std::array<bool, 3> QtMultimediaCameraHandler::status;
|
||||
|
||||
std::unordered_map<std::string, std::shared_ptr<QtMultimediaCameraHandler>>
|
||||
QtMultimediaCameraHandler::loaded;
|
||||
|
||||
void QtMultimediaCameraHandler::Init() {
|
||||
std::generate(std::begin(handlers), std::end(handlers),
|
||||
std::make_shared<QtMultimediaCameraHandler>);
|
||||
}
|
||||
|
||||
std::shared_ptr<QtMultimediaCameraHandler> QtMultimediaCameraHandler::GetHandler(
|
||||
const std::string& camera_name) {
|
||||
if (thread() == QThread::currentThread()) {
|
||||
std::shared_ptr<QtMultimediaCameraHandler> handler;
|
||||
if (!handlers.contains(camera_name) || !(handler = handlers[camera_name].lock())) {
|
||||
LOG_INFO(Service_CAM, "Creating new handler for camera '{}'", camera_name);
|
||||
handler = std::make_shared<QtMultimediaCameraHandler>(camera_name);
|
||||
handlers[camera_name] = handler;
|
||||
} else {
|
||||
LOG_INFO(Service_CAM, "Reusing existing handler for camera '{}'", camera_name);
|
||||
if (loaded.count(camera_name)) {
|
||||
return loaded.at(camera_name);
|
||||
}
|
||||
return handler;
|
||||
} else {
|
||||
std::shared_ptr<QtMultimediaCameraHandler> handler;
|
||||
QMetaObject::invokeMethod(this, "Create", Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(std::shared_ptr<QtMultimediaCameraHandler>, handler),
|
||||
Q_ARG(std::string, camera_name));
|
||||
return handler;
|
||||
for (std::size_t i = 0; i < handlers.size(); i++) {
|
||||
if (!status[i]) {
|
||||
LOG_INFO(Service_CAM, "Successfully got handler {}", i);
|
||||
status[i] = true;
|
||||
loaded.emplace(camera_name, handlers[i]);
|
||||
return handlers[i];
|
||||
}
|
||||
}
|
||||
LOG_CRITICAL(Service_CAM, "All handlers taken up");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandlerFactory::PauseCameras() {
|
||||
LOG_INFO(Service_CAM, "Pausing all cameras");
|
||||
for (auto& handler_pair : handlers) {
|
||||
auto handler = handler_pair.second.lock();
|
||||
if (handler && handler->IsActive()) {
|
||||
handler->PauseCapture();
|
||||
void QtMultimediaCameraHandler::ReleaseHandler(
|
||||
const std::shared_ptr<Camera::QtMultimediaCameraHandler>& handler) {
|
||||
for (std::size_t i = 0; i < handlers.size(); i++) {
|
||||
if (handlers[i] == handler) {
|
||||
LOG_INFO(Service_CAM, "Successfully released handler {}", i);
|
||||
status[i] = false;
|
||||
handlers[i]->started = false;
|
||||
for (auto it = loaded.begin(); it != loaded.end(); it++) {
|
||||
if (it->second == handlers[i]) {
|
||||
loaded.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandlerFactory::ResumeCameras() {
|
||||
LOG_INFO(Service_CAM, "Resuming all cameras");
|
||||
for (auto& handler_pair : handlers) {
|
||||
auto handler = handler_pair.second.lock();
|
||||
if (handler && handler->IsPaused()) {
|
||||
handler->StartCapture();
|
||||
void QtMultimediaCameraHandler::CreateCamera(const std::string& camera_name) {
|
||||
QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
|
||||
for (const QCameraInfo& cameraInfo : cameras) {
|
||||
if (cameraInfo.deviceName().toStdString() == camera_name)
|
||||
camera = std::make_unique<QCamera>(cameraInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QtMultimediaCameraHandler::QtMultimediaCameraHandler(const std::string& camera_name) {
|
||||
auto cameras = QMediaDevices::videoInputs();
|
||||
auto requested_camera =
|
||||
std::find_if(cameras.begin(), cameras.end(), [camera_name](QCameraDevice& camera_info) {
|
||||
return camera_info.description().toStdString() == camera_name;
|
||||
});
|
||||
if (requested_camera != cameras.end()) {
|
||||
camera = std::make_unique<QCamera>(*requested_camera);
|
||||
} else {
|
||||
if (!camera) { // no cameras found, using default camera
|
||||
camera = std::make_unique<QCamera>();
|
||||
}
|
||||
camera_surface = std::make_unique<QVideoSink>();
|
||||
capture_session.setVideoSink(camera_surface.get());
|
||||
capture_session.setCamera(camera.get());
|
||||
settings.setMinimumFrameRate(30);
|
||||
settings.setMaximumFrameRate(30);
|
||||
camera->setViewfinder(&camera_surface);
|
||||
camera->load();
|
||||
if (camera->supportedViewfinderPixelFormats().isEmpty()) {
|
||||
// The gstreamer plugin (used on linux systems) returns an empty list on querying supported
|
||||
// viewfinder pixel formats, and will not work without expliciting setting it to some value,
|
||||
// so we are defaulting to RGB565 here which should be fairly widely supported.
|
||||
settings.setPixelFormat(QVideoFrame::PixelFormat::Format_RGB565);
|
||||
}
|
||||
}
|
||||
|
||||
QtMultimediaCameraHandler::~QtMultimediaCameraHandler() {
|
||||
StopCapture();
|
||||
void QtMultimediaCameraHandler::StopCamera() {
|
||||
camera->stop();
|
||||
started = false;
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandler::StartCapture() {
|
||||
if (!camera->isActive()) {
|
||||
void QtMultimediaCameraHandler::StartCamera() {
|
||||
#if defined(__APPLE__)
|
||||
if (!AppleAuthorization::CheckAuthorizationForCamera()) {
|
||||
LOG_ERROR(Service_CAM, "Unable to start camera due to lack of authorization");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
camera->setViewfinderSettings(settings);
|
||||
camera->start();
|
||||
}
|
||||
started = true;
|
||||
paused = false;
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandler::StopCapture() {
|
||||
if (camera->isActive()) {
|
||||
camera->stop();
|
||||
bool QtMultimediaCameraHandler::CameraAvailable() const {
|
||||
return camera && camera->isAvailable();
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandler::StopCameras() {
|
||||
LOG_INFO(Service_CAM, "Stopping all cameras");
|
||||
for (auto& handler : handlers) {
|
||||
if (handler && handler->started) {
|
||||
handler->StopCamera();
|
||||
handler->paused = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandler::ResumeCameras() {
|
||||
for (auto& handler : handlers) {
|
||||
if (handler && handler->paused) {
|
||||
handler->StartCamera();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtMultimediaCameraHandler::ReleaseHandlers() {
|
||||
StopCameras();
|
||||
LOG_INFO(Service_CAM, "Releasing all handlers");
|
||||
for (std::size_t i = 0; i < handlers.size(); i++) {
|
||||
status[i] = false;
|
||||
handlers[i]->started = false;
|
||||
handlers[i]->paused = false;
|
||||
}
|
||||
paused = false;
|
||||
}
|
||||
|
||||
} // namespace Camera
|
||||
|
@ -4,113 +4,99 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <QAbstractVideoSurface>
|
||||
#include <QCamera>
|
||||
#include <QCameraViewfinderSettings>
|
||||
#include <QImage>
|
||||
#include <QMediaCaptureSession>
|
||||
#include <QVideoSink>
|
||||
#include <QMutex>
|
||||
#include "citra_qt/camera/camera_util.h"
|
||||
#include "citra_qt/camera/qt_camera_base.h"
|
||||
#include "core/frontend/camera/interface.h"
|
||||
|
||||
class GMainWindow;
|
||||
|
||||
namespace Camera {
|
||||
|
||||
// NOTE: Must be created on the Qt thread. QtMultimediaCameraHandlerFactory ensures this.
|
||||
class QtMultimediaCameraHandler final : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
class QtCameraSurface final : public QAbstractVideoSurface {
|
||||
public:
|
||||
explicit QtMultimediaCameraHandler(const std::string& camera_name);
|
||||
~QtMultimediaCameraHandler();
|
||||
|
||||
void StartCapture();
|
||||
void StopCapture();
|
||||
|
||||
QImage QtReceiveFrame() {
|
||||
return camera_surface->videoFrame().toImage();
|
||||
}
|
||||
|
||||
bool IsPreviewAvailable() {
|
||||
return camera->isAvailable();
|
||||
}
|
||||
|
||||
bool IsActive() {
|
||||
return camera->isActive();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsPaused() {
|
||||
return paused;
|
||||
}
|
||||
|
||||
void PauseCapture() {
|
||||
StopCapture();
|
||||
paused = true;
|
||||
}
|
||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||
QAbstractVideoBuffer::HandleType) const override;
|
||||
bool present(const QVideoFrame&) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<QCamera> camera;
|
||||
std::unique_ptr<QVideoSink> camera_surface;
|
||||
QMediaCaptureSession capture_session{};
|
||||
bool paused = false; // was previously started but was paused, to be resumed
|
||||
QMutex mutex;
|
||||
QImage current_frame;
|
||||
|
||||
friend class QtMultimediaCamera; // For access to current_frame
|
||||
};
|
||||
|
||||
// NOTE: Must be created on the Qt thread.
|
||||
class QtMultimediaCameraHandlerFactory final : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_INVOKABLE std::shared_ptr<QtMultimediaCameraHandler> Create(const std::string& camera_name);
|
||||
void PauseCameras();
|
||||
void ResumeCameras();
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::weak_ptr<QtMultimediaCameraHandler>> handlers;
|
||||
};
|
||||
class QtMultimediaCameraHandler;
|
||||
|
||||
/// This class is only an interface. It just calls QtMultimediaCameraHandler.
|
||||
class QtMultimediaCamera final : public QtCameraInterface {
|
||||
public:
|
||||
QtMultimediaCamera(const std::shared_ptr<QtMultimediaCameraHandler>& handler,
|
||||
const Service::CAM::Flip& flip)
|
||||
: QtCameraInterface(flip), handler(handler) {}
|
||||
|
||||
void StartCapture() override {
|
||||
handler->StartCapture();
|
||||
}
|
||||
|
||||
void StopCapture() override {
|
||||
handler->StopCapture();
|
||||
}
|
||||
|
||||
void SetFrameRate(Service::CAM::FrameRate frame_rate) override {}
|
||||
|
||||
QImage QtReceiveFrame() override {
|
||||
return handler->QtReceiveFrame();
|
||||
}
|
||||
|
||||
bool IsPreviewAvailable() override {
|
||||
return handler->IsPreviewAvailable();
|
||||
}
|
||||
QtMultimediaCamera(const std::string& camera_name, const Service::CAM::Flip& flip);
|
||||
~QtMultimediaCamera();
|
||||
void StartCapture() override;
|
||||
void StopCapture() override;
|
||||
void SetFrameRate(Service::CAM::FrameRate frame_rate) override;
|
||||
QImage QtReceiveFrame() override;
|
||||
bool IsPreviewAvailable() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<QtMultimediaCameraHandler> handler;
|
||||
};
|
||||
|
||||
/// This class is only an interface. It just calls QtMultimediaCameraHandlerFactory.
|
||||
class QtMultimediaCameraFactory final : public QtCameraFactory {
|
||||
public:
|
||||
QtMultimediaCameraFactory(
|
||||
const std::shared_ptr<QtMultimediaCameraHandlerFactory>& handler_factory)
|
||||
: handler_factory(handler_factory) {}
|
||||
|
||||
std::unique_ptr<CameraInterface> Create(const std::string& config,
|
||||
const Service::CAM::Flip& flip) override {
|
||||
return std::make_unique<QtMultimediaCamera>(handler_factory->Create(config), flip);
|
||||
}
|
||||
const Service::CAM::Flip& flip) override;
|
||||
};
|
||||
|
||||
class QtMultimediaCameraHandler final : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/// Creates the global handler. Must be called in UI thread.
|
||||
static void Init();
|
||||
static std::shared_ptr<QtMultimediaCameraHandler> GetHandler(const std::string& camera_name);
|
||||
static void ReleaseHandler(const std::shared_ptr<QtMultimediaCameraHandler>& handler);
|
||||
|
||||
/**
|
||||
* Creates the camera.
|
||||
* Note: This function must be called via QMetaObject::invokeMethod in UI thread.
|
||||
*/
|
||||
Q_INVOKABLE void CreateCamera(const std::string& camera_name);
|
||||
|
||||
/**
|
||||
* Starts the camera.
|
||||
* Note: This function must be called via QMetaObject::invokeMethod in UI thread when
|
||||
* starting the camera for the first time. 'Resume' calls can be in other threads.
|
||||
*/
|
||||
Q_INVOKABLE void StartCamera();
|
||||
|
||||
void StopCamera();
|
||||
bool CameraAvailable() const;
|
||||
static void StopCameras();
|
||||
static void ResumeCameras();
|
||||
static void ReleaseHandlers();
|
||||
|
||||
private:
|
||||
std::shared_ptr<QtMultimediaCameraHandlerFactory> handler_factory;
|
||||
std::unique_ptr<QCamera> camera;
|
||||
QtCameraSurface camera_surface{};
|
||||
QCameraViewfinderSettings settings;
|
||||
bool started = false;
|
||||
bool paused = false; // was previously started but was paused, to be resumed
|
||||
|
||||
static std::array<std::shared_ptr<QtMultimediaCameraHandler>, 3> handlers;
|
||||
static std::array<bool, 3> status;
|
||||
static std::unordered_map<std::string, std::shared_ptr<QtMultimediaCameraHandler>> loaded;
|
||||
|
||||
friend class QtMultimediaCamera; // For access to camera_surface (and camera)
|
||||
};
|
||||
|
||||
} // namespace Camera
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include "common/file_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "input_common/drivers/udp_client.h"
|
||||
#include "input_common/main.h"
|
||||
#include "input_common/udp/client.h"
|
||||
#include "network/network.h"
|
||||
#include "network/network_settings.h"
|
||||
|
||||
@ -27,21 +27,17 @@ Config::~Config() {
|
||||
}
|
||||
|
||||
const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = {
|
||||
Qt::Key_C, Qt::Key_X, Qt::Key_V, Qt::Key_Z, Qt::Key_Up, Qt::Key_Down,
|
||||
Qt::Key_Left, Qt::Key_Right, Qt::Key_Q, Qt::Key_E, Qt::Key_M, Qt::Key_N,
|
||||
Qt::Key_O, Qt::Key_P, Qt::Key_R, Qt::Key_T, Qt::Key_B,
|
||||
};
|
||||
|
||||
const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motions = {
|
||||
Qt::Key_7,
|
||||
Qt::Key_8,
|
||||
Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_T, Qt::Key_G,
|
||||
Qt::Key_F, Qt::Key_H, Qt::Key_Q, Qt::Key_W, Qt::Key_M, Qt::Key_N,
|
||||
Qt::Key_O, Qt::Key_P, Qt::Key_1, Qt::Key_2, Qt::Key_B,
|
||||
};
|
||||
|
||||
const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{
|
||||
{
|
||||
Qt::Key_W,
|
||||
Qt::Key_S,
|
||||
Qt::Key_A,
|
||||
Qt::Key_Up,
|
||||
Qt::Key_Down,
|
||||
Qt::Key_Left,
|
||||
Qt::Key_Right,
|
||||
Qt::Key_D,
|
||||
},
|
||||
{
|
||||
@ -49,14 +45,10 @@ const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config:
|
||||
Qt::Key_K,
|
||||
Qt::Key_J,
|
||||
Qt::Key_L,
|
||||
Qt::Key_D,
|
||||
},
|
||||
}};
|
||||
|
||||
const std::array<int, 2> Config::default_stick_mod = {
|
||||
Qt::Key_Shift,
|
||||
0,
|
||||
};
|
||||
|
||||
// This shouldn't have anything except static initializers (no functions). So
|
||||
// QKeySequence(...).toString() is NOT ALLOWED HERE.
|
||||
// This must be in alphabetical order according to action name as it must have the same order as
|
||||
@ -105,21 +97,12 @@ void Config::Initialize(const std::string& config_name) {
|
||||
case ConfigType::PerGameConfig:
|
||||
qt_config_loc = fmt::format("{}/custom/{}", fs_config_loc, config_file);
|
||||
break;
|
||||
case ConfigType::InputProfile:
|
||||
qt_config_loc = fmt::format("{}/input/{}", fs_config_loc, config_file);
|
||||
break;
|
||||
}
|
||||
|
||||
FileUtil::CreateFullPath(qt_config_loc);
|
||||
qt_config =
|
||||
std::make_unique<QSettings>(QString::fromStdString(qt_config_loc), QSettings::IniFormat);
|
||||
if (type != ConfigType::InputProfile) {
|
||||
Reload();
|
||||
}
|
||||
}
|
||||
|
||||
bool Config::IsCustomConfig() {
|
||||
return type == ConfigType::PerGameConfig;
|
||||
}
|
||||
|
||||
/* {Read,Write}BasicSetting and WriteGlobalSetting templates must be defined here before their
|
||||
@ -334,78 +317,9 @@ void Config::ReadCameraValues() {
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
void Config::ReadPlayerValues() {
|
||||
const QString player_prefix = [this] {
|
||||
if (type == ConfigType::InputProfile) {
|
||||
return QString{};
|
||||
} else {
|
||||
return QStringLiteral("player_");
|
||||
}
|
||||
}();
|
||||
void Config::ReadControlValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
|
||||
auto& player = Settings::values.players.GetValue();
|
||||
if (IsCustomConfig()) {
|
||||
const auto profile_name =
|
||||
qt_config->value(QStringLiteral("%1profile_name").arg(player_prefix), QString{})
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (profile_name.empty()) {
|
||||
// Use the global input config
|
||||
player = Settings::values.players.GetValue(true);
|
||||
return;
|
||||
}
|
||||
player.profile_name = profile_name;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]);
|
||||
auto& player_buttons = player.buttons[i];
|
||||
|
||||
player_buttons = qt_config
|
||||
->value(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromUtf8(Settings::NativeButton::mapping[i]),
|
||||
QString::fromStdString(default_param))
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (player_buttons.empty()) {
|
||||
player_buttons = default_param;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
|
||||
default_analogs[i][0], default_analogs[i][1], default_analogs[i][2],
|
||||
default_analogs[i][3], default_stick_mod[i], 0.5f);
|
||||
auto& player_analogs = player.analogs[i];
|
||||
|
||||
player_analogs = qt_config
|
||||
->value(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromUtf8(Settings::NativeAnalog::mapping[i]),
|
||||
QString::fromStdString(default_param))
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (player_analogs.empty()) {
|
||||
player_analogs = default_param;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Settings::NativeMotion::NumMotions; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateKeyboardParam(default_motions[i]);
|
||||
auto& player_motions = player.motions[i];
|
||||
|
||||
player_motions = qt_config
|
||||
->value(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromUtf8(Settings::NativeMotion::mapping[i]),
|
||||
QString::fromStdString(default_param))
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (player_motions.empty()) {
|
||||
player_motions = default_param;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Config::ReadMotionTouchValues() {
|
||||
int num_touch_from_button_maps =
|
||||
qt_config->beginReadArray(QStringLiteral("touch_from_button_maps"));
|
||||
|
||||
@ -438,26 +352,82 @@ void Config::ReadMotionTouchValues() {
|
||||
}
|
||||
qt_config->endArray();
|
||||
|
||||
ReadBasicSetting(Settings::values.touch_device);
|
||||
ReadBasicSetting(Settings::values.touch_from_button_map_index);
|
||||
Settings::values.touch_from_button_map_index = std::clamp(
|
||||
Settings::values.touch_from_button_map_index.GetValue(), 0, num_touch_from_button_maps - 1);
|
||||
Settings::values.current_input_profile_index =
|
||||
ReadSetting(QStringLiteral("profile"), 0).toInt();
|
||||
|
||||
ReadBasicSetting(Settings::values.udp_input_address);
|
||||
ReadBasicSetting(Settings::values.udp_input_port);
|
||||
ReadBasicSetting(Settings::values.udp_pad_index);
|
||||
}
|
||||
|
||||
void Config::ReadControlValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
|
||||
Settings::values.players.SetGlobal(!IsCustomConfig());
|
||||
ReadPlayerValues();
|
||||
if (IsCustomConfig()) {
|
||||
qt_config->endGroup();
|
||||
return;
|
||||
const auto append_profile = [this, num_touch_from_button_maps] {
|
||||
Settings::InputProfile profile;
|
||||
profile.name =
|
||||
ReadSetting(QStringLiteral("name"), QStringLiteral("default")).toString().toStdString();
|
||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
||||
std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]);
|
||||
profile.buttons[i] = ReadSetting(QString::fromUtf8(Settings::NativeButton::mapping[i]),
|
||||
QString::fromStdString(default_param))
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (profile.buttons[i].empty())
|
||||
profile.buttons[i] = default_param;
|
||||
}
|
||||
ReadMotionTouchValues();
|
||||
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
|
||||
std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
|
||||
default_analogs[i][0], default_analogs[i][1], default_analogs[i][2],
|
||||
default_analogs[i][3], default_analogs[i][4], 0.5f);
|
||||
profile.analogs[i] = ReadSetting(QString::fromUtf8(Settings::NativeAnalog::mapping[i]),
|
||||
QString::fromStdString(default_param))
|
||||
.toString()
|
||||
.toStdString();
|
||||
if (profile.analogs[i].empty())
|
||||
profile.analogs[i] = default_param;
|
||||
}
|
||||
profile.motion_device =
|
||||
ReadSetting(QStringLiteral("motion_device"),
|
||||
QStringLiteral(
|
||||
"engine:motion_emu,update_period:100,sensitivity:0.01,tilt_clamp:90.0"))
|
||||
.toString()
|
||||
.toStdString();
|
||||
profile.touch_device =
|
||||
ReadSetting(QStringLiteral("touch_device"), QStringLiteral("engine:emu_window"))
|
||||
.toString()
|
||||
.toStdString();
|
||||
profile.use_touch_from_button =
|
||||
ReadSetting(QStringLiteral("use_touch_from_button"), false).toBool();
|
||||
profile.touch_from_button_map_index =
|
||||
ReadSetting(QStringLiteral("touch_from_button_map"), 0).toInt();
|
||||
profile.touch_from_button_map_index =
|
||||
std::clamp(profile.touch_from_button_map_index, 0, num_touch_from_button_maps - 1);
|
||||
profile.udp_input_address =
|
||||
ReadSetting(QStringLiteral("udp_input_address"),
|
||||
QString::fromUtf8(InputCommon::CemuhookUDP::DEFAULT_ADDR))
|
||||
.toString()
|
||||
.toStdString();
|
||||
profile.udp_input_port = static_cast<u16>(
|
||||
ReadSetting(QStringLiteral("udp_input_port"), InputCommon::CemuhookUDP::DEFAULT_PORT)
|
||||
.toInt());
|
||||
profile.udp_pad_index =
|
||||
static_cast<u8>(ReadSetting(QStringLiteral("udp_pad_index"), 0).toUInt());
|
||||
Settings::values.input_profiles.emplace_back(std::move(profile));
|
||||
};
|
||||
|
||||
int num_input_profiles = qt_config->beginReadArray(QStringLiteral("profiles"));
|
||||
|
||||
for (int i = 0; i < num_input_profiles; ++i) {
|
||||
qt_config->setArrayIndex(i);
|
||||
append_profile();
|
||||
}
|
||||
|
||||
qt_config->endArray();
|
||||
|
||||
// create a input profile if no input profiles exist, with the default or old settings
|
||||
if (num_input_profiles == 0) {
|
||||
append_profile();
|
||||
num_input_profiles = 1;
|
||||
}
|
||||
|
||||
// ensure that the current input profile index is valid.
|
||||
Settings::values.current_input_profile_index =
|
||||
std::clamp(Settings::values.current_input_profile_index, 0, num_input_profiles - 1);
|
||||
|
||||
Settings::LoadProfile(Settings::values.current_input_profile_index);
|
||||
|
||||
qt_config->endGroup();
|
||||
}
|
||||
@ -914,87 +884,61 @@ void Config::SaveCameraValues() {
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
void Config::SavePlayerValues() {
|
||||
const QString player_prefix = [this] {
|
||||
if (type == ConfigType::InputProfile) {
|
||||
return QString{};
|
||||
} else {
|
||||
return QStringLiteral("player_");
|
||||
}
|
||||
}();
|
||||
|
||||
const auto& player = Settings::values.players.GetValue();
|
||||
if (IsCustomConfig()) {
|
||||
if (player.profile_name.empty()) {
|
||||
// No custom profile selected
|
||||
return;
|
||||
}
|
||||
WriteSetting(QStringLiteral("%1profile_name").arg(player_prefix),
|
||||
QString::fromStdString(player.profile_name), QString{});
|
||||
}
|
||||
void Config::SaveControlValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
|
||||
WriteSetting(QStringLiteral("profile"), Settings::values.current_input_profile_index, 0);
|
||||
qt_config->beginWriteArray(QStringLiteral("profiles"));
|
||||
for (std::size_t p = 0; p < Settings::values.input_profiles.size(); ++p) {
|
||||
qt_config->setArrayIndex(static_cast<int>(p));
|
||||
const auto& profile = Settings::values.input_profiles[p];
|
||||
WriteSetting(QStringLiteral("name"), QString::fromStdString(profile.name),
|
||||
QStringLiteral("default"));
|
||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]);
|
||||
WriteSetting(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromStdString(Settings::NativeButton::mapping[i]),
|
||||
QString::fromStdString(player.buttons[i]),
|
||||
std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]);
|
||||
WriteSetting(QString::fromStdString(Settings::NativeButton::mapping[i]),
|
||||
QString::fromStdString(profile.buttons[i]),
|
||||
QString::fromStdString(default_param));
|
||||
}
|
||||
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
|
||||
std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
|
||||
default_analogs[i][0], default_analogs[i][1], default_analogs[i][2],
|
||||
default_analogs[i][3], default_stick_mod[i], 0.5f);
|
||||
WriteSetting(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromStdString(Settings::NativeAnalog::mapping[i]),
|
||||
QString::fromStdString(player.analogs[i]),
|
||||
default_analogs[i][3], default_analogs[i][4], 0.5f);
|
||||
WriteSetting(QString::fromStdString(Settings::NativeAnalog::mapping[i]),
|
||||
QString::fromStdString(profile.analogs[i]),
|
||||
QString::fromStdString(default_param));
|
||||
}
|
||||
for (int i = 0; i < Settings::NativeMotion::NumMotions; ++i) {
|
||||
const std::string default_param = InputCommon::GenerateKeyboardParam(default_motions[i]);
|
||||
WriteSetting(QStringLiteral("%1").arg(player_prefix) +
|
||||
QString::fromStdString(Settings::NativeMotion::mapping[i]),
|
||||
QString::fromStdString(player.motions[i]),
|
||||
QString::fromStdString(default_param));
|
||||
WriteSetting(
|
||||
QStringLiteral("motion_device"), QString::fromStdString(profile.motion_device),
|
||||
QStringLiteral("engine:motion_emu,update_period:100,sensitivity:0.01,tilt_clamp:90.0"));
|
||||
WriteSetting(QStringLiteral("touch_device"), QString::fromStdString(profile.touch_device),
|
||||
QStringLiteral("engine:emu_window"));
|
||||
WriteSetting(QStringLiteral("use_touch_from_button"), profile.use_touch_from_button, false);
|
||||
WriteSetting(QStringLiteral("touch_from_button_map"), profile.touch_from_button_map_index,
|
||||
0);
|
||||
WriteSetting(QStringLiteral("udp_input_address"),
|
||||
QString::fromStdString(profile.udp_input_address),
|
||||
QString::fromUtf8(InputCommon::CemuhookUDP::DEFAULT_ADDR));
|
||||
WriteSetting(QStringLiteral("udp_input_port"), profile.udp_input_port,
|
||||
InputCommon::CemuhookUDP::DEFAULT_PORT);
|
||||
WriteSetting(QStringLiteral("udp_pad_index"), profile.udp_pad_index, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Config::SaveMotionTouchValues() {
|
||||
WriteBasicSetting(Settings::values.touch_device);
|
||||
WriteBasicSetting(Settings::values.touch_from_button_map_index);
|
||||
|
||||
WriteBasicSetting(Settings::values.udp_input_address);
|
||||
WriteBasicSetting(Settings::values.udp_input_port);
|
||||
WriteBasicSetting(Settings::values.udp_pad_index);
|
||||
qt_config->endArray();
|
||||
|
||||
qt_config->beginWriteArray(QStringLiteral("touch_from_button_maps"));
|
||||
for (std::size_t p = 0; p < Settings::values.touch_from_button_maps.size(); ++p) {
|
||||
qt_config->setArrayIndex(static_cast<int>(p));
|
||||
WriteSetting(QStringLiteral("name"),
|
||||
QString::fromStdString(Settings::values.touch_from_button_maps[p].name),
|
||||
const auto& map = Settings::values.touch_from_button_maps[p];
|
||||
WriteSetting(QStringLiteral("name"), QString::fromStdString(map.name),
|
||||
QStringLiteral("default"));
|
||||
qt_config->beginWriteArray(QStringLiteral("entries"));
|
||||
for (std::size_t q = 0; q < Settings::values.touch_from_button_maps[p].buttons.size();
|
||||
++q) {
|
||||
for (std::size_t q = 0; q < map.buttons.size(); ++q) {
|
||||
qt_config->setArrayIndex(static_cast<int>(q));
|
||||
WriteSetting(
|
||||
QStringLiteral("bind"),
|
||||
QString::fromStdString(Settings::values.touch_from_button_maps[p].buttons[q]));
|
||||
WriteSetting(QStringLiteral("bind"), QString::fromStdString(map.buttons[q]));
|
||||
}
|
||||
qt_config->endArray();
|
||||
}
|
||||
qt_config->endArray();
|
||||
}
|
||||
|
||||
void Config::SaveControlValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
|
||||
Settings::values.players.SetGlobal(!IsCustomConfig());
|
||||
SavePlayerValues();
|
||||
if (IsCustomConfig()) {
|
||||
qt_config->endGroup();
|
||||
return;
|
||||
}
|
||||
SaveMotionTouchValues();
|
||||
|
||||
qt_config->endGroup();
|
||||
}
|
||||
@ -1358,26 +1302,3 @@ void Config::Reload() {
|
||||
void Config::Save() {
|
||||
SaveValues();
|
||||
}
|
||||
|
||||
void Config::ReadControlPlayerValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
ReadPlayerValues();
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
void Config::SaveControlPlayerValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
SavePlayerValues();
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
void Config::ClearControlPlayerValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||
// If key is an empty string, all keys in the current group() are removed.
|
||||
qt_config->remove(QString{});
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
const std::string& Config::GetConfigFilePath() const {
|
||||
return qt_config_loc;
|
||||
}
|
@ -15,11 +15,7 @@ class QSettings;
|
||||
|
||||
class Config {
|
||||
public:
|
||||
enum class ConfigType : u32 {
|
||||
GlobalConfig,
|
||||
PerGameConfig,
|
||||
InputProfile,
|
||||
};
|
||||
enum class ConfigType : u32 { GlobalConfig, PerGameConfig };
|
||||
|
||||
explicit Config(const std::string& config_name = "qt-config",
|
||||
ConfigType config_type = ConfigType::GlobalConfig);
|
||||
@ -28,28 +24,17 @@ public:
|
||||
void Reload();
|
||||
void Save();
|
||||
|
||||
// Used for input profiles
|
||||
void ReadControlPlayerValues();
|
||||
void SaveControlPlayerValues();
|
||||
void ClearControlPlayerValues();
|
||||
const std::string& GetConfigFilePath() const;
|
||||
|
||||
static const std::array<int, Settings::NativeButton::NumButtons> default_buttons;
|
||||
static const std::array<int, Settings::NativeMotion::NumMotions> default_motions;
|
||||
static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> default_analogs;
|
||||
static const std::array<UISettings::Shortcut, 28> default_hotkeys;
|
||||
static const std::array<int, 2> default_stick_mod;
|
||||
|
||||
private:
|
||||
void Initialize(const std::string& config_name);
|
||||
bool IsCustomConfig();
|
||||
|
||||
void ReadValues();
|
||||
void ReadPlayerValues();
|
||||
void ReadMotionTouchValues();
|
||||
void ReadControlValues();
|
||||
void ReadAudioValues();
|
||||
void ReadCameraValues();
|
||||
void ReadControlValues();
|
||||
void ReadCoreValues();
|
||||
void ReadDataStorageValues();
|
||||
void ReadDebuggingValues();
|
||||
@ -69,11 +54,9 @@ private:
|
||||
void ReadVideoDumpingValues();
|
||||
|
||||
void SaveValues();
|
||||
void SavePlayerValues();
|
||||
void SaveMotionTouchValues();
|
||||
void SaveControlValues();
|
||||
void SaveAudioValues();
|
||||
void SaveCameraValues();
|
||||
void SaveControlValues();
|
||||
void SaveCoreValues();
|
||||
void SaveDataStorageValues();
|
||||
void SaveDebuggingValues();
|
||||
|
@ -2,16 +2,16 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QCameraDevice>
|
||||
#include <QCameraInfo>
|
||||
#include <QDirIterator>
|
||||
#include <QFileDialog>
|
||||
#include <QImageReader>
|
||||
#include <QMediaDevices>
|
||||
#include <QMessageBox>
|
||||
#include <QWidget>
|
||||
#include "citra_qt/configuration/configure_camera.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/frontend/camera/factory.h"
|
||||
#include "core/frontend/camera/interface.h"
|
||||
#include "core/hle/service/cam/cam.h"
|
||||
#include "ui_configure_camera.h"
|
||||
|
||||
@ -32,9 +32,9 @@ ConfigureCamera::ConfigureCamera(QWidget* parent)
|
||||
camera_name = Settings::values.camera_name;
|
||||
camera_config = Settings::values.camera_config;
|
||||
camera_flip = Settings::values.camera_flip;
|
||||
const QList<QCameraDevice> cameras = QMediaDevices::videoInputs();
|
||||
for (const QCameraDevice& camera : cameras) {
|
||||
ui->system_camera->addItem(camera.description());
|
||||
QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
|
||||
for (const QCameraInfo& cameraInfo : cameras) {
|
||||
ui->system_camera->addItem(cameraInfo.deviceName());
|
||||
}
|
||||
UpdateCameraMode();
|
||||
SetConfiguration();
|
||||
|
@ -10,14 +10,11 @@
|
||||
#include "common/settings.h"
|
||||
#include "ui_configure.h"
|
||||
|
||||
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
|
||||
InputCommon::InputSubsystem* input_subsystem,
|
||||
bool enable_web_config)
|
||||
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, bool enable_web_config)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDialog>()), registry(registry) {
|
||||
Settings::SetConfiguringGlobal(true);
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->inputTab->Initialize(input_subsystem);
|
||||
ui->hotkeysTab->Populate(registry);
|
||||
ui->webTab->SetWebServiceConfigEnabled(enable_web_config);
|
||||
|
||||
@ -61,6 +58,7 @@ void ConfigureDialog::ApplyConfiguration() {
|
||||
ui->generalTab->ApplyConfiguration();
|
||||
ui->systemTab->ApplyConfiguration();
|
||||
ui->inputTab->ApplyConfiguration();
|
||||
ui->inputTab->ApplyProfile();
|
||||
ui->hotkeysTab->ApplyConfiguration(registry);
|
||||
ui->graphicsTab->ApplyConfiguration();
|
||||
ui->enhancementsTab->ApplyConfiguration();
|
||||
|
@ -13,16 +13,11 @@ namespace Ui {
|
||||
class ConfigureDialog;
|
||||
}
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
class ConfigureDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
|
||||
InputCommon::InputSubsystem* input_subsystem,
|
||||
bool enable_web_config = true);
|
||||
~ConfigureDialog() override;
|
||||
|
||||
|
@ -398,7 +398,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_31">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Large Screen Proportion:</string>
|
||||
</property>
|
||||
|
@ -60,6 +60,11 @@
|
||||
<string>OpenGL</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Vulkan</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,42 +9,22 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <QKeySequence>
|
||||
#include <QWidget>
|
||||
|
||||
#include "common/param_package.h"
|
||||
#include "common/settings.h"
|
||||
#include "ui_configure_input.h"
|
||||
#include "input_common/main.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QKeyEvent;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QSlider;
|
||||
class QSpinBox;
|
||||
class QString;
|
||||
class QTimer;
|
||||
class QWidget;
|
||||
|
||||
class InputProfiles;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace InputCommon::Polling {
|
||||
enum class InputType;
|
||||
} // namespace InputCommon::Polling
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureInput;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Core::HID {
|
||||
class HIDCore;
|
||||
class EmulatedController;
|
||||
} // namespace Core::HID
|
||||
}
|
||||
|
||||
class ConfigureInput : public QWidget {
|
||||
Q_OBJECT
|
||||
@ -53,32 +33,16 @@ public:
|
||||
explicit ConfigureInput(QWidget* parent = nullptr);
|
||||
~ConfigureInput() override;
|
||||
|
||||
/// Initializes the ConfigureInput dialog
|
||||
void Initialize(InputCommon::InputSubsystem* input_subsystem_);
|
||||
/// Save all button configurations to settings file
|
||||
void ApplyConfiguration();
|
||||
void RetranslateUI();
|
||||
|
||||
/// Load configuration settings.
|
||||
void LoadConfiguration();
|
||||
|
||||
/// Save all button configurations to settings file.
|
||||
void ApplyConfiguration();
|
||||
|
||||
/// Update the input devices combobox.
|
||||
void UpdateInputDeviceCombobox();
|
||||
|
||||
/// Updates the list of controller profiles.
|
||||
void UpdateInputProfiles();
|
||||
|
||||
/// Restore all buttons to their default values.
|
||||
void RestoreDefaults();
|
||||
|
||||
/// Clear all input configuration.
|
||||
void ClearAll();
|
||||
|
||||
/// Updates UI with selected language translations
|
||||
void RetranslateUI();
|
||||
|
||||
void EmitInputKeysChanged();
|
||||
|
||||
/// Save the current input profile index
|
||||
void ApplyProfile();
|
||||
public slots:
|
||||
void OnHotkeysChanged(QList<QKeySequence> new_key_list);
|
||||
|
||||
@ -86,97 +50,39 @@ signals:
|
||||
void InputKeysChanged(QList<QKeySequence> new_key_list);
|
||||
|
||||
private:
|
||||
/// Generates list of all used keys
|
||||
QList<QKeySequence> GetUsedKeyboardKeys();
|
||||
|
||||
QString ButtonToText(const Common::ParamPackage& param);
|
||||
|
||||
QString AnalogToText(const Common::ParamPackage& param, const std::string& dir);
|
||||
|
||||
void changeEvent(QEvent* event) override;
|
||||
|
||||
/// Called when the button was pressed.
|
||||
void HandleClick(QPushButton* button, std::size_t button_id,
|
||||
std::function<void(const Common::ParamPackage&)> new_input_setter,
|
||||
InputCommon::Polling::InputType type);
|
||||
|
||||
/// Finish polling and configure input using the input_setter.
|
||||
void SetPollingResult(const Common::ParamPackage& params, bool abort);
|
||||
|
||||
/// Checks whether a given input can be accepted.
|
||||
bool IsInputAcceptable(const Common::ParamPackage& params) const;
|
||||
|
||||
/// Handle mouse button press events.
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
|
||||
/// Handle mouse wheel move events.
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
|
||||
/// Handle key press events.
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
/// Handle combobox list refresh
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
|
||||
/// Update UI to reflect current configuration.
|
||||
void UpdateUI();
|
||||
|
||||
/// Update the available input devices.
|
||||
void UpdateInputDevices();
|
||||
|
||||
/// Gets the default controller mapping for this device and auto configures the input to match.
|
||||
void UpdateMappingWithDefaults();
|
||||
|
||||
/// Creates a controller profile.
|
||||
void CreateProfile();
|
||||
|
||||
/// Deletes the selected controller profile.
|
||||
void DeleteProfile();
|
||||
|
||||
/// Loads the selected controller profile.
|
||||
void LoadProfile();
|
||||
|
||||
/// Saves the current controller configuration into a selected controller profile.
|
||||
void SaveProfile();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureInput> ui;
|
||||
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
|
||||
std::unique_ptr<InputProfiles> profiles;
|
||||
|
||||
std::unique_ptr<QTimer> timeout_timer;
|
||||
std::unique_ptr<QTimer> poll_timer;
|
||||
|
||||
/// This will be the the setting function when an input is awaiting configuration.
|
||||
std::optional<std::function<void(const Common::ParamPackage&)>> input_setter;
|
||||
|
||||
Core::HID::EmulatedController* emulated_controller;
|
||||
std::array<Common::ParamPackage, Settings::NativeButton::NumButtons> buttons_param;
|
||||
std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs> analogs_param;
|
||||
|
||||
static constexpr int ANALOG_SUB_BUTTONS_NUM = 4;
|
||||
static constexpr int ANALOG_SUB_BUTTONS_NUM = 5;
|
||||
|
||||
/// Each button input is represented by a QPushButton.
|
||||
std::array<QPushButton*, Settings::NativeButton::NumButtons> button_map;
|
||||
|
||||
/// A group of four QPushButtons represent one analog input. The buttons each represent up,
|
||||
/// down, left, right, respectively.
|
||||
/// A group of five QPushButtons represent one analog input. The buttons each represent up,
|
||||
/// down, left, right, and modifier, respectively.
|
||||
std::array<std::array<QPushButton*, ANALOG_SUB_BUTTONS_NUM>, Settings::NativeAnalog::NumAnalogs>
|
||||
analog_map_buttons;
|
||||
|
||||
/// Each motion input is represented by a QPushButton.
|
||||
std::array<QPushButton*, Settings::NativeMotion::NumMotions> motion_map;
|
||||
|
||||
std::array<QLabel*, Settings::NativeAnalog::NumAnalogs> analog_map_deadzone_label;
|
||||
std::array<QSlider*, Settings::NativeAnalog::NumAnalogs> analog_map_deadzone_slider;
|
||||
std::array<QGroupBox*, Settings::NativeAnalog::NumAnalogs> analog_map_modifier_groupbox;
|
||||
std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_modifier_button;
|
||||
std::array<QLabel*, Settings::NativeAnalog::NumAnalogs> analog_map_modifier_label;
|
||||
std::array<QSlider*, Settings::NativeAnalog::NumAnalogs> analog_map_modifier_slider;
|
||||
std::array<QGroupBox*, Settings::NativeAnalog::NumAnalogs> analog_map_range_groupbox;
|
||||
std::array<QSpinBox*, Settings::NativeAnalog::NumAnalogs> analog_map_range_spinbox;
|
||||
/// Analog inputs are also represented each with a single button, used to configure with an
|
||||
/// actual analog stick
|
||||
std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_stick;
|
||||
std::array<QSlider*, Settings::NativeAnalog::NumAnalogs>
|
||||
analog_map_deadzone_and_modifier_slider;
|
||||
std::array<QLabel*, Settings::NativeAnalog::NumAnalogs>
|
||||
analog_map_deadzone_and_modifier_slider_label;
|
||||
|
||||
static const std::array<std::string, ANALOG_SUB_BUTTONS_NUM> analog_sub_buttons;
|
||||
|
||||
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers;
|
||||
|
||||
/**
|
||||
* List of keys currently registered to hotkeys.
|
||||
* These can't be bound to any input key.
|
||||
@ -184,10 +90,43 @@ private:
|
||||
*/
|
||||
QList<QKeySequence> hotkey_list;
|
||||
|
||||
/// A flag to indicate that the "Map Analog Stick" pop-up has been shown and accepted once.
|
||||
bool map_analog_stick_accepted{};
|
||||
/// A flag to indicate if keyboard keys are okay when configuring an input. If this is false,
|
||||
/// keyboard events are ignored.
|
||||
bool want_keyboard_keys = false;
|
||||
|
||||
/// List of physical devices users can map with. If a SDL backed device is selected, then you
|
||||
/// can use this device to get a default mapping.
|
||||
std::vector<Common::ParamPackage> input_devices;
|
||||
/// Generates list of all used keys
|
||||
QList<QKeySequence> GetUsedKeyboardKeys();
|
||||
|
||||
void MapFromButton(const Common::ParamPackage& params);
|
||||
void AutoMap();
|
||||
|
||||
/// Restore all buttons to their default values.
|
||||
void RestoreDefaults();
|
||||
/// Clear all input configuration
|
||||
void ClearAll();
|
||||
|
||||
/// Update UI to reflect current configuration.
|
||||
void UpdateButtonLabels();
|
||||
|
||||
/// Called when the button was pressed.
|
||||
void HandleClick(QPushButton* button,
|
||||
std::function<void(const Common::ParamPackage&)> new_input_setter,
|
||||
InputCommon::Polling::DeviceType type);
|
||||
|
||||
/// The key code of the previous state of the key being currently bound.
|
||||
int previous_key_code;
|
||||
|
||||
/// Finish polling and configure input using the input_setter
|
||||
void SetPollingResult(const Common::ParamPackage& params, bool abort);
|
||||
|
||||
/// Handle key press events.
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
/// input profiles
|
||||
void NewProfile();
|
||||
void DeleteProfile();
|
||||
void RenameProfile();
|
||||
|
||||
bool IsProfileNameDuplicate(const QString& name) const;
|
||||
void WarnProposedProfileNameIsDuplicate();
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,14 +7,11 @@
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QStringListModel>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include "citra_qt/configuration/configure_motion_touch.h"
|
||||
#include "citra_qt/configuration/configure_touch_from_button.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "input_common/drivers/udp_client.h"
|
||||
#include "input_common/helpers/udp_protocol.h"
|
||||
#include "input_common/main.h"
|
||||
#include "ui_configure_motion_touch.h"
|
||||
|
||||
@ -37,9 +34,8 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
|
||||
|
||||
using namespace InputCommon::CemuhookUDP;
|
||||
job = std::make_unique<CalibrationConfigurationJob>(
|
||||
host, port, pad_index,
|
||||
host, port, pad_index, client_id,
|
||||
[this](CalibrationConfigurationJob::Status status) {
|
||||
QMetaObject::invokeMethod(this, [status, this] {
|
||||
QString text;
|
||||
switch (status) {
|
||||
case CalibrationConfigurationJob::Status::Ready:
|
||||
@ -52,12 +48,12 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
|
||||
text = tr("Configuration completed!");
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR(Frontend, "Unknown calibration status {}", status);
|
||||
break;
|
||||
}
|
||||
UpdateLabelText(text);
|
||||
});
|
||||
QMetaObject::invokeMethod(this, "UpdateLabelText", Q_ARG(QString, text));
|
||||
if (status == CalibrationConfigurationJob::Status::Completed) {
|
||||
QMetaObject::invokeMethod(this, [this] { UpdateButtonText(tr("OK")); });
|
||||
QMetaObject::invokeMethod(this, "UpdateButtonText", Q_ARG(QString, tr("OK")));
|
||||
}
|
||||
},
|
||||
[this](u16 min_x_, u16 min_y_, u16 max_x_, u16 max_y_) {
|
||||
@ -90,13 +86,10 @@ constexpr std::array<std::pair<const char*, const char*>, 2> TouchProviders = {{
|
||||
{"cemuhookudp", QT_TRANSLATE_NOOP("ConfigureMotionTouch", "CemuhookUDP")},
|
||||
}};
|
||||
|
||||
ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
||||
InputCommon::InputSubsystem* input_subsystem_)
|
||||
: QDialog(parent), input_subsystem{input_subsystem_},
|
||||
ui(std::make_unique<Ui::ConfigureMotionTouch>()), timeout_timer(std::make_unique<QTimer>()),
|
||||
poll_timer(std::make_unique<QTimer>()) {
|
||||
ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureMotionTouch>()),
|
||||
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
for (const auto& [provider, name] : MotionProviders) {
|
||||
ui->motion_provider->addItem(tr(name), QString::fromUtf8(provider));
|
||||
}
|
||||
@ -111,7 +104,22 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
||||
"using-a-controller-or-android-phone-for-motion-or-touch-input'><span "
|
||||
"style=\"text-decoration: underline; color:#039be5;\">Learn More</span></a>"));
|
||||
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
timeout_timer->setSingleShot(true);
|
||||
connect(timeout_timer.get(), &QTimer::timeout, this, [this]() { SetPollingResult({}, true); });
|
||||
|
||||
connect(poll_timer.get(), &QTimer::timeout, this, [this]() {
|
||||
Common::ParamPackage params;
|
||||
for (auto& poller : device_pollers) {
|
||||
params = poller->GetNextInput();
|
||||
// We want all the input systems to be in a "polling" state, but we only care about the
|
||||
// input from SDL.
|
||||
if (params.Has("engine") && params.Get("engine", "") == "sdl") {
|
||||
SetPollingResult(params, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
SetConfiguration();
|
||||
UpdateUiDisplay();
|
||||
ConnectEvents();
|
||||
@ -120,23 +128,37 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
||||
ConfigureMotionTouch::~ConfigureMotionTouch() = default;
|
||||
|
||||
void ConfigureMotionTouch::SetConfiguration() {
|
||||
const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue());
|
||||
const Common::ParamPackage motion_param(Settings::values.current_input_profile.motion_device);
|
||||
const Common::ParamPackage touch_param(Settings::values.current_input_profile.touch_device);
|
||||
const std::string motion_engine = motion_param.Get("engine", "motion_emu");
|
||||
const std::string touch_engine = touch_param.Get("engine", "emu_window");
|
||||
|
||||
ui->motion_provider->setCurrentIndex(
|
||||
ui->motion_provider->findData(QString::fromStdString(motion_engine)));
|
||||
ui->touch_provider->setCurrentIndex(
|
||||
ui->touch_provider->findData(QString::fromStdString(touch_engine)));
|
||||
ui->touch_from_button_checkbox->setChecked(
|
||||
Settings::values.current_input_profile.use_touch_from_button);
|
||||
touch_from_button_maps = Settings::values.touch_from_button_maps;
|
||||
for (const auto& touch_map : touch_from_button_maps) {
|
||||
ui->touch_from_button_map->addItem(QString::fromStdString(touch_map.name));
|
||||
}
|
||||
ui->touch_from_button_map->setCurrentIndex(
|
||||
Settings::values.touch_from_button_map_index.GetValue());
|
||||
Settings::values.current_input_profile.touch_from_button_map_index);
|
||||
ui->motion_sensitivity->setValue(motion_param.Get("sensitivity", 0.01f));
|
||||
|
||||
guid = motion_param.Get("guid", "0");
|
||||
port = motion_param.Get("port", 0);
|
||||
|
||||
min_x = touch_param.Get("min_x", 100);
|
||||
min_y = touch_param.Get("min_y", 50);
|
||||
max_x = touch_param.Get("max_x", 1800);
|
||||
max_y = touch_param.Get("max_y", 850);
|
||||
|
||||
ui->udp_server->setText(QString::fromStdString(Settings::values.udp_input_address.GetValue()));
|
||||
ui->udp_port->setText(QString::number(Settings::values.udp_input_port.GetValue()));
|
||||
ui->udp_pad_index->setCurrentIndex(Settings::values.udp_pad_index.GetValue());
|
||||
ui->udp_server->setText(
|
||||
QString::fromStdString(Settings::values.current_input_profile.udp_input_address));
|
||||
ui->udp_port->setText(QString::number(Settings::values.current_input_profile.udp_input_port));
|
||||
ui->udp_pad_index->setCurrentIndex(Settings::values.current_input_profile.udp_pad_index);
|
||||
}
|
||||
|
||||
void ConfigureMotionTouch::UpdateUiDisplay() {
|
||||
@ -183,13 +205,35 @@ void ConfigureMotionTouch::ConnectEvents() {
|
||||
[this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
|
||||
connect(ui->touch_provider, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
[this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
|
||||
connect(ui->motion_controller_button, &QPushButton::clicked, this, [this]() {
|
||||
if (QMessageBox::information(this, tr("Information"),
|
||||
tr("After pressing OK, press a button on the controller whose "
|
||||
"motion you want to track."),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
||||
ui->motion_controller_button->setText(tr("[press button]"));
|
||||
ui->motion_controller_button->setFocus();
|
||||
|
||||
input_setter = [this](const Common::ParamPackage& params) {
|
||||
guid = params.Get("guid", "0");
|
||||
port = params.Get("port", 0);
|
||||
};
|
||||
|
||||
device_pollers =
|
||||
InputCommon::Polling::GetPollers(InputCommon::Polling::DeviceType::Button);
|
||||
|
||||
for (auto& poller : device_pollers) {
|
||||
poller->Start();
|
||||
}
|
||||
|
||||
timeout_timer->start(5000); // Cancel after 5 seconds
|
||||
poll_timer->start(200); // Check for new inputs every 200ms
|
||||
}
|
||||
});
|
||||
connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest);
|
||||
connect(ui->touch_calibration_config, &QPushButton::clicked, this,
|
||||
&ConfigureMotionTouch::OnConfigureTouchCalibration);
|
||||
connect(ui->touch_from_button_config_btn, &QPushButton::clicked, this,
|
||||
&ConfigureMotionTouch::OnConfigureTouchFromButton);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this,
|
||||
&ConfigureMotionTouch::ApplyConfiguration);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [this] {
|
||||
if (CanCloseDialog()) {
|
||||
reject();
|
||||
@ -197,13 +241,28 @@ void ConfigureMotionTouch::ConnectEvents() {
|
||||
});
|
||||
}
|
||||
|
||||
void ConfigureMotionTouch::SetPollingResult(const Common::ParamPackage& params, bool abort) {
|
||||
timeout_timer->stop();
|
||||
poll_timer->stop();
|
||||
for (auto& poller : device_pollers) {
|
||||
poller->Stop();
|
||||
}
|
||||
|
||||
if (!abort && input_setter) {
|
||||
(*input_setter)(params);
|
||||
}
|
||||
|
||||
ui->motion_controller_button->setText(tr("Configure"));
|
||||
input_setter.reset();
|
||||
}
|
||||
|
||||
void ConfigureMotionTouch::OnCemuhookUDPTest() {
|
||||
ui->udp_test->setEnabled(false);
|
||||
ui->udp_test->setText(tr("Testing"));
|
||||
udp_test_in_progress = true;
|
||||
InputCommon::CemuhookUDP::TestCommunication(
|
||||
ui->udp_server->text().toStdString(), static_cast<u16>(ui->udp_port->text().toInt()),
|
||||
static_cast<u8>(ui->udp_pad_index->currentIndex()),
|
||||
static_cast<u8>(ui->udp_pad_index->currentIndex()), 24872,
|
||||
[this] {
|
||||
LOG_INFO(Frontend, "UDP input test success");
|
||||
QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, true));
|
||||
@ -261,7 +320,7 @@ void ConfigureMotionTouch::ShowUDPTestResult(bool result) {
|
||||
}
|
||||
|
||||
void ConfigureMotionTouch::OnConfigureTouchFromButton() {
|
||||
ConfigureTouchFromButton dialog{this, touch_from_button_maps, input_subsystem,
|
||||
ConfigureTouchFromButton dialog{this, touch_from_button_maps,
|
||||
ui->touch_from_button_map->currentIndex()};
|
||||
if (dialog.exec() != QDialog::Accepted) {
|
||||
return;
|
||||
@ -313,13 +372,20 @@ void ConfigureMotionTouch::ApplyConfiguration() {
|
||||
touch_param.Set("max_y", max_y);
|
||||
}
|
||||
|
||||
Settings::values.touch_device = touch_param.Serialize();
|
||||
Settings::values.touch_from_button_map_index = ui->touch_from_button_map->currentIndex();
|
||||
Settings::values.current_input_profile.motion_device = motion_param.Serialize();
|
||||
Settings::values.current_input_profile.touch_device = touch_param.Serialize();
|
||||
Settings::values.current_input_profile.use_touch_from_button =
|
||||
ui->touch_from_button_checkbox->isChecked();
|
||||
Settings::values.current_input_profile.touch_from_button_map_index =
|
||||
ui->touch_from_button_map->currentIndex();
|
||||
Settings::values.touch_from_button_maps = touch_from_button_maps;
|
||||
Settings::values.udp_input_address = ui->udp_server->text().toStdString();
|
||||
Settings::values.udp_input_port = static_cast<u16>(ui->udp_port->text().toInt());
|
||||
Settings::values.udp_pad_index = static_cast<u8>(ui->udp_pad_index->currentIndex());
|
||||
input_subsystem->ReloadInputDevices();
|
||||
Settings::values.current_input_profile.udp_input_address = ui->udp_server->text().toStdString();
|
||||
Settings::values.current_input_profile.udp_input_port =
|
||||
static_cast<u16>(ui->udp_port->text().toInt());
|
||||
Settings::values.current_input_profile.udp_pad_index =
|
||||
static_cast<u8>(ui->udp_pad_index->currentIndex());
|
||||
Settings::SaveProfile(Settings::values.current_input_profile_index);
|
||||
InputCommon::ReloadInputDevices();
|
||||
|
||||
accept();
|
||||
}
|
||||
|
@ -6,21 +6,15 @@
|
||||
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
#include "common/param_package.h"
|
||||
#include "common/settings.h"
|
||||
#include "input_common/main.h"
|
||||
#include "input_common/udp/udp.h"
|
||||
|
||||
class QVBoxLayout;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QTimer;
|
||||
class QStringListModel;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace InputCommon::CemuhookUDP {
|
||||
class CalibrationConfigurationJob;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureMotionTouch;
|
||||
@ -57,7 +51,7 @@ class ConfigureMotionTouch : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureMotionTouch(QWidget* parent, InputCommon::InputSubsystem* input_subsystem_);
|
||||
explicit ConfigureMotionTouch(QWidget* parent = nullptr);
|
||||
~ConfigureMotionTouch() override;
|
||||
|
||||
public slots:
|
||||
@ -74,10 +68,9 @@ private:
|
||||
void SetConfiguration();
|
||||
void UpdateUiDisplay();
|
||||
void ConnectEvents();
|
||||
void SetPollingResult(const Common::ParamPackage& params, bool abort);
|
||||
bool CanCloseDialog();
|
||||
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
|
||||
std::unique_ptr<Ui::ConfigureMotionTouch> ui;
|
||||
|
||||
// Used for SDL input polling
|
||||
@ -85,6 +78,10 @@ private:
|
||||
int port;
|
||||
std::unique_ptr<QTimer> timeout_timer;
|
||||
std::unique_ptr<QTimer> poll_timer;
|
||||
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers;
|
||||
|
||||
/// This will be the the setting function when an input is awaiting configuration.
|
||||
std::optional<std::function<void(const Common::ParamPackage&)>> input_setter;
|
||||
|
||||
// Coordinate system of the CemuhookUDP touch provider
|
||||
int min_x{};
|
||||
|
@ -2,17 +2,17 @@
|
||||
<ui version="4.0">
|
||||
<class>ConfigureMotionTouch</class>
|
||||
<widget class="QDialog" name="ConfigureMotionTouch">
|
||||
<property name="windowTitle">
|
||||
<string>Configure Motion / Touch</string>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>580</height>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure Motion / Touch</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="motion_group_box">
|
||||
@ -342,7 +342,4 @@
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>ApplyConfiguration()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
@ -283,7 +283,7 @@ void ConfigureSystem::SetConfiguration() {
|
||||
|
||||
ui->combo_init_clock->setCurrentIndex(static_cast<u8>(Settings::values.init_clock.GetValue()));
|
||||
QDateTime date_time;
|
||||
date_time.setSecsSinceEpoch(Settings::values.init_time.GetValue());
|
||||
date_time.setTime_t(Settings::values.init_time.GetValue());
|
||||
ui->edit_init_time->setDateTime(date_time);
|
||||
|
||||
long long init_time_offset = Settings::values.init_time_offset.GetValue();
|
||||
@ -406,7 +406,7 @@ void ConfigureSystem::ApplyConfiguration() {
|
||||
|
||||
Settings::values.init_clock =
|
||||
static_cast<Settings::InitClock>(ui->combo_init_clock->currentIndex());
|
||||
Settings::values.init_time = ui->edit_init_time->dateTime().toSecsSinceEpoch();
|
||||
Settings::values.init_time = ui->edit_init_time->dateTime().toTime_t();
|
||||
|
||||
s64 time_offset_time = ui->edit_init_time_offset_time->time().msecsSinceStartOfDay() / 1000;
|
||||
s64 time_offset_days = ui->edit_init_time_offset_days->value() * 86400;
|
||||
|
@ -12,9 +12,7 @@
|
||||
#include "citra_qt/configuration/configure_touch_from_button.h"
|
||||
#include "citra_qt/configuration/configure_touch_widget.h"
|
||||
#include "common/param_package.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/3ds.h"
|
||||
#include "core/frontend/framebuffer_layout.h"
|
||||
#include "input_common/main.h"
|
||||
#include "ui_configure_touch_from_button.h"
|
||||
|
||||
@ -70,11 +68,11 @@ static QString ButtonToText(const Common::ParamPackage& param) {
|
||||
}
|
||||
|
||||
ConfigureTouchFromButton::ConfigureTouchFromButton(
|
||||
QWidget* parent, const std::vector<Settings::TouchFromButtonMap>& touch_maps_,
|
||||
InputCommon::InputSubsystem* input_subsystem_, const int default_index)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()),
|
||||
touch_maps{touch_maps_}, input_subsystem{input_subsystem_}, selected_index{default_index},
|
||||
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) {
|
||||
QWidget* parent, const std::vector<Settings::TouchFromButtonMap>& touch_maps,
|
||||
const int default_index)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()), touch_maps(touch_maps),
|
||||
selected_index(default_index), timeout_timer(std::make_unique<QTimer>()),
|
||||
poll_timer(std::make_unique<QTimer>()) {
|
||||
ui->setupUi(this);
|
||||
binding_list_model = new QStandardItemModel(0, 3, this);
|
||||
binding_list_model->setHorizontalHeaderLabels(
|
||||
@ -164,11 +162,14 @@ void ConfigureTouchFromButton::ConnectEvents() {
|
||||
connect(timeout_timer.get(), &QTimer::timeout, [this]() { SetPollingResult({}, true); });
|
||||
|
||||
connect(poll_timer.get(), &QTimer::timeout, [this]() {
|
||||
const auto& params = input_subsystem->GetNextInput();
|
||||
Common::ParamPackage params;
|
||||
for (auto& poller : device_pollers) {
|
||||
params = poller->GetNextInput();
|
||||
if (params.Has("engine")) {
|
||||
SetPollingResult(params, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -228,9 +229,6 @@ void ConfigureTouchFromButton::RenameMapping() {
|
||||
}
|
||||
|
||||
void ConfigureTouchFromButton::GetButtonInput(const int row_index, const bool is_new) {
|
||||
if (timeout_timer->isActive()) {
|
||||
return;
|
||||
}
|
||||
binding_list_model->item(row_index, 0)->setText(tr("[press key]"));
|
||||
|
||||
input_setter = [this, row_index, is_new](const Common::ParamPackage& params,
|
||||
@ -249,7 +247,11 @@ void ConfigureTouchFromButton::GetButtonInput(const int row_index, const bool is
|
||||
}
|
||||
};
|
||||
|
||||
input_subsystem->BeginMapping(InputCommon::Polling::InputType::Button);
|
||||
device_pollers = InputCommon::Polling::GetPollers(InputCommon::Polling::DeviceType::Button);
|
||||
|
||||
for (auto& poller : device_pollers) {
|
||||
poller->Start();
|
||||
}
|
||||
|
||||
grabKeyboard();
|
||||
grabMouse();
|
||||
@ -361,14 +363,14 @@ void ConfigureTouchFromButton::SetCoordinates(const int dot_id, const QPoint& po
|
||||
|
||||
void ConfigureTouchFromButton::SetPollingResult(const Common::ParamPackage& params,
|
||||
const bool cancel) {
|
||||
timeout_timer->stop();
|
||||
poll_timer->stop();
|
||||
input_subsystem->StopMapping();
|
||||
|
||||
releaseKeyboard();
|
||||
releaseMouse();
|
||||
qApp->restoreOverrideCursor();
|
||||
|
||||
timeout_timer->stop();
|
||||
poll_timer->stop();
|
||||
for (auto& poller : device_pollers) {
|
||||
poller->Stop();
|
||||
}
|
||||
if (input_setter) {
|
||||
(*input_setter)(params, cancel);
|
||||
input_setter.reset();
|
||||
@ -507,8 +509,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) {
|
||||
if (!coord_label) {
|
||||
return;
|
||||
}
|
||||
const auto point = event->position().toPoint();
|
||||
const auto pos = MapToDeviceCoords(point.x(), point.y());
|
||||
const auto pos = MapToDeviceCoords(event->x(), event->y());
|
||||
if (pos) {
|
||||
coord_label->setText(QStringLiteral("X: %1, Y: %2").arg(pos->x()).arg(pos->y()));
|
||||
} else {
|
||||
@ -526,8 +527,7 @@ void TouchScreenPreview::mousePressEvent(QMouseEvent* event) {
|
||||
if (event->button() != Qt::MouseButton::LeftButton) {
|
||||
return;
|
||||
}
|
||||
const auto point = event->position().toPoint();
|
||||
const auto pos = MapToDeviceCoords(point.x(), point.y());
|
||||
const auto pos = MapToDeviceCoords(event->x(), event->y());
|
||||
if (pos) {
|
||||
emit DotAdded(*pos);
|
||||
}
|
||||
@ -543,7 +543,7 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) {
|
||||
emit DotSelected(obj->property(PropId).toInt());
|
||||
|
||||
drag_state.dot = qobject_cast<QLabel*>(obj);
|
||||
drag_state.start_pos = mouse_event->globalPosition().toPoint();
|
||||
drag_state.start_pos = mouse_event->globalPos();
|
||||
return true;
|
||||
}
|
||||
case QEvent::Type::MouseMove: {
|
||||
@ -552,13 +552,14 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) {
|
||||
}
|
||||
const auto mouse_event = static_cast<QMouseEvent*>(event);
|
||||
if (!drag_state.active) {
|
||||
drag_state.active = (mouse_event->globalPosition().toPoint() - drag_state.start_pos)
|
||||
.manhattanLength() >= QApplication::startDragDistance();
|
||||
drag_state.active =
|
||||
(mouse_event->globalPos() - drag_state.start_pos).manhattanLength() >=
|
||||
QApplication::startDragDistance();
|
||||
if (!drag_state.active) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
auto current_pos = mapFromGlobal(mouse_event->globalPosition().toPoint());
|
||||
auto current_pos = mapFromGlobal(mouse_event->globalPos());
|
||||
current_pos.setX(std::clamp(current_pos.x(), contentsMargins().left(),
|
||||
contentsMargins().left() + contentsRect().width() - 1));
|
||||
current_pos.setY(std::clamp(current_pos.y(), contentsMargins().top(),
|
||||
@ -595,6 +596,7 @@ std::optional<QPoint> TouchScreenPreview::MapToDeviceCoords(const int screen_x,
|
||||
(Core::kScreenBottomHeight - 1) / (contentsRect().height() - 1);
|
||||
if (t_x >= 0.5f && t_x < Core::kScreenBottomWidth && t_y >= 0.5f &&
|
||||
t_y < Core::kScreenBottomHeight) {
|
||||
|
||||
return QPoint{static_cast<int>(t_x), static_cast<int>(t_y)};
|
||||
}
|
||||
return std::nullopt;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// SPDX-FileCopyrightText: 2020 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -8,6 +9,7 @@
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
#include <QDialog>
|
||||
#include "common/settings.h"
|
||||
|
||||
class QItemSelection;
|
||||
class QModelIndex;
|
||||
@ -20,12 +22,10 @@ class ParamPackage;
|
||||
}
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
struct TouchFromButtonMap;
|
||||
namespace Polling {
|
||||
class DevicePoller;
|
||||
}
|
||||
} // namespace InputCommon
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureTouchFromButton;
|
||||
@ -36,8 +36,7 @@ class ConfigureTouchFromButton : public QDialog {
|
||||
|
||||
public:
|
||||
explicit ConfigureTouchFromButton(QWidget* parent,
|
||||
const std::vector<Settings::TouchFromButtonMap>& touch_maps_,
|
||||
InputCommon::InputSubsystem* input_subsystem_,
|
||||
const std::vector<Settings::TouchFromButtonMap>& touch_maps,
|
||||
int default_index = 0);
|
||||
~ConfigureTouchFromButton() override;
|
||||
|
||||
@ -73,13 +72,13 @@ private:
|
||||
void SaveCurrentMapping();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureTouchFromButton> ui;
|
||||
std::vector<Settings::TouchFromButtonMap> touch_maps;
|
||||
QStandardItemModel* binding_list_model;
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
std::vector<Settings::TouchFromButtonMap> touch_maps;
|
||||
int selected_index;
|
||||
|
||||
std::unique_ptr<QTimer> timeout_timer;
|
||||
std::unique_ptr<QTimer> poll_timer;
|
||||
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers;
|
||||
std::optional<std::function<void(const Common::ParamPackage&, bool)>> input_setter;
|
||||
|
||||
static constexpr int DataRoleDot = Qt::ItemDataRole::UserRole + 2;
|
||||
|
@ -1,130 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "citra_qt/configuration/config.h"
|
||||
#include "citra_qt/configuration/input_profiles.h"
|
||||
#include "common/common_paths.h"
|
||||
#include "common/file_util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
bool ProfileExistsInFilesystem(std::string_view profile_name) {
|
||||
return FileUtil::Exists(FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "input" +
|
||||
DIR_SEP + fmt::format("{}.ini", profile_name));
|
||||
}
|
||||
|
||||
bool IsINI(const std::string& filename) {
|
||||
return filename.ends_with(".ini");
|
||||
}
|
||||
|
||||
std::string GetNameWithoutExtension(const std::string& filename) {
|
||||
const auto last_dot = filename.find_last_of(".");
|
||||
if (last_dot == std::string::npos) {
|
||||
return filename;
|
||||
}
|
||||
return filename.substr(0, last_dot);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
InputProfiles::InputProfiles() {
|
||||
const auto input_profile_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "input";
|
||||
|
||||
if (!FileUtil::IsDirectory(input_profile_loc)) {
|
||||
return;
|
||||
}
|
||||
|
||||
FileUtil::ForeachDirectoryEntry(
|
||||
nullptr, input_profile_loc,
|
||||
[this](u64* num_entries_out, const std::string& directory, const std::string& filename) {
|
||||
const auto name_without_ext = GetNameWithoutExtension(filename);
|
||||
|
||||
if (IsINI(filename) && IsProfileNameValid(name_without_ext)) {
|
||||
map_profiles.insert_or_assign(
|
||||
name_without_ext,
|
||||
std::make_unique<Config>(name_without_ext, Config::ConfigType::InputProfile));
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
InputProfiles::~InputProfiles() = default;
|
||||
|
||||
std::vector<std::string> InputProfiles::GetInputProfileNames() {
|
||||
std::vector<std::string> profile_names;
|
||||
profile_names.reserve(map_profiles.size());
|
||||
|
||||
auto it = map_profiles.cbegin();
|
||||
while (it != map_profiles.cend()) {
|
||||
const auto& [profile_name, config] = *it;
|
||||
if (!ProfileExistsInFilesystem(profile_name)) {
|
||||
it = map_profiles.erase(it);
|
||||
continue;
|
||||
}
|
||||
|
||||
profile_names.push_back(profile_name);
|
||||
++it;
|
||||
}
|
||||
|
||||
std::stable_sort(profile_names.begin(), profile_names.end());
|
||||
|
||||
return profile_names;
|
||||
}
|
||||
|
||||
bool InputProfiles::IsProfileNameValid(std::string_view profile_name) {
|
||||
return profile_name.find_first_of("<>:;\"/\\|,.!?*") == std::string::npos;
|
||||
}
|
||||
|
||||
bool InputProfiles::CreateProfile(const std::string& profile_name) {
|
||||
if (ProfileExistsInMap(profile_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
map_profiles.insert_or_assign(
|
||||
profile_name, std::make_unique<Config>(profile_name, Config::ConfigType::InputProfile));
|
||||
|
||||
return SaveProfile(profile_name);
|
||||
}
|
||||
|
||||
bool InputProfiles::DeleteProfile(const std::string& profile_name) {
|
||||
if (!ProfileExistsInMap(profile_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ProfileExistsInFilesystem(profile_name) ||
|
||||
FileUtil::Delete(map_profiles[profile_name]->GetConfigFilePath())) {
|
||||
map_profiles.erase(profile_name);
|
||||
}
|
||||
|
||||
return !ProfileExistsInMap(profile_name) && !ProfileExistsInFilesystem(profile_name);
|
||||
}
|
||||
|
||||
bool InputProfiles::LoadProfile(const std::string& profile_name) {
|
||||
if (!ProfileExistsInMap(profile_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ProfileExistsInFilesystem(profile_name)) {
|
||||
map_profiles.erase(profile_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
map_profiles[profile_name]->ReadControlPlayerValues();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InputProfiles::SaveProfile(const std::string& profile_name) {
|
||||
if (!ProfileExistsInMap(profile_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
map_profiles[profile_name]->SaveControlPlayerValues();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InputProfiles::ProfileExistsInMap(const std::string& profile_name) const {
|
||||
return map_profiles.find(profile_name) != map_profiles.end();
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
class Config;
|
||||
|
||||
class InputProfiles {
|
||||
|
||||
public:
|
||||
explicit InputProfiles();
|
||||
virtual ~InputProfiles();
|
||||
|
||||
std::vector<std::string> GetInputProfileNames();
|
||||
|
||||
static bool IsProfileNameValid(std::string_view profile_name);
|
||||
|
||||
bool CreateProfile(const std::string& profile_name);
|
||||
bool DeleteProfile(const std::string& profile_name);
|
||||
bool LoadProfile(const std::string& profile_name);
|
||||
bool SaveProfile(const std::string& profile_name);
|
||||
|
||||
private:
|
||||
bool ProfileExistsInMap(const std::string& profile_name) const;
|
||||
|
||||
std::unordered_map<std::string, std::unique_ptr<Config>> map_profiles;
|
||||
};
|
@ -40,9 +40,8 @@ void SurfacePicture::mousePressEvent(QMouseEvent* event) {
|
||||
}
|
||||
|
||||
if (surface_widget) {
|
||||
const auto pos = event->position().toPoint();
|
||||
surface_widget->Pick(pos.x() * pixmap.width() / width(),
|
||||
pos.y() * pixmap.height() / height());
|
||||
surface_widget->Pick(event->x() * pixmap.width() / width(),
|
||||
event->y() * pixmap.height() / height());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,13 +17,13 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="client_group">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Client</string>
|
||||
</property>
|
||||
<layout class="QFormLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Process:</string>
|
||||
</property>
|
||||
@ -37,7 +37,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Thread:</string>
|
||||
</property>
|
||||
@ -51,7 +51,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Session:</string>
|
||||
</property>
|
||||
@ -68,13 +68,13 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="server_group">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Server</string>
|
||||
</property>
|
||||
<layout class="QFormLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Process:</string>
|
||||
</property>
|
||||
@ -88,7 +88,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Thread:</string>
|
||||
</property>
|
||||
@ -102,7 +102,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Session:</string>
|
||||
</property>
|
||||
@ -121,13 +121,13 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="general_group">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QFormLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Client Port:</string>
|
||||
</property>
|
||||
@ -141,7 +141,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Service:</string>
|
||||
</property>
|
||||
@ -155,7 +155,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Function:</string>
|
||||
</property>
|
||||
@ -172,7 +172,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="cmdbuffer_group">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Command Buffer</string>
|
||||
</property>
|
||||
@ -180,7 +180,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Select:</string>
|
||||
</property>
|
||||
|
@ -142,28 +142,24 @@ void MicroProfileWidget::hideEvent(QHideEvent* event) {
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* event) {
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mousePressEvent(QMouseEvent* event) {
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* event) {
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::wheelEvent(QWheelEvent* event) {
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale,
|
||||
MicroProfileMousePosition(event->position().x() / x_scale, event->position().y() / y_scale,
|
||||
event->angleDelta().y() / 120);
|
||||
event->accept();
|
||||
}
|
||||
|
@ -239,8 +239,7 @@ void GameList::OnTextChanged(const QString& new_text) {
|
||||
file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} +
|
||||
file_title;
|
||||
if (ContainsAllWords(file_name, edit_filter_text) ||
|
||||
(file_program_id.length() == 16 &&
|
||||
edit_filter_text.contains(file_program_id))) {
|
||||
(file_program_id.count() == 16 && edit_filter_text.contains(file_program_id))) {
|
||||
tree_view->setRowHidden(j, folder_index, false);
|
||||
++result_count;
|
||||
} else {
|
||||
@ -420,10 +419,10 @@ void GameList::DonePopulating(const QStringList& watch_list) {
|
||||
// Workaround: Add the watch paths in chunks to allow the gui to refresh
|
||||
// This prevents the UI from stalling when a large number of watch paths are added
|
||||
// Also artificially caps the watcher to a certain number of directories
|
||||
constexpr qsizetype LIMIT_WATCH_DIRECTORIES = 5000;
|
||||
constexpr int LIMIT_WATCH_DIRECTORIES = 5000;
|
||||
constexpr int SLICE_SIZE = 25;
|
||||
const qsizetype len = std::min(watch_list.length(), LIMIT_WATCH_DIRECTORIES);
|
||||
for (qsizetype i = 0; i < len; i += SLICE_SIZE) {
|
||||
int len = std::min(watch_list.length(), LIMIT_WATCH_DIRECTORIES);
|
||||
for (int i = 0; i < len; i += SLICE_SIZE) {
|
||||
watcher->addPaths(watch_list.mid(i, i + SLICE_SIZE));
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ void HotkeyRegistry::SaveHotkeys() {
|
||||
void HotkeyRegistry::LoadHotkeys() {
|
||||
// Make sure NOT to use a reference here because it would become invalid once we call
|
||||
// beginGroup()
|
||||
for (const auto shortcut : UISettings::values.shortcuts) {
|
||||
for (auto shortcut : UISettings::values.shortcuts) {
|
||||
Hotkey& hk = hotkey_groups[shortcut.group][shortcut.name];
|
||||
if (!shortcut.shortcut.keyseq.isEmpty()) {
|
||||
hk.keyseq =
|
||||
@ -40,7 +40,7 @@ void HotkeyRegistry::LoadHotkeys() {
|
||||
}
|
||||
}
|
||||
|
||||
QShortcut* HotkeyRegistry::GetHotkey(const QString& group, const QString& action, QObject* widget) {
|
||||
QShortcut* HotkeyRegistry::GetHotkey(const QString& group, const QString& action, QWidget* widget) {
|
||||
Hotkey& hk = hotkey_groups[group][action];
|
||||
|
||||
if (!hk.shortcut) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user