Triforce v0.8.0

Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-25 10:21:32 -06:00
parent 861702476a
commit 4fa4f9188b
881 changed files with 179428 additions and 15581 deletions

21
third_party/xess/PROVENANCE.md vendored Normal file
View File

@@ -0,0 +1,21 @@
# Intel XeSS Super Resolution API headers
Intel's MIT-licensed XeSS-SR API headers, the Vulkan path only: `inc/xess/xess.h`, `inc/xess/xess_vk.h` and their licence
`inc/MIT.txt`, at the same paths as in <https://github.com/intel/xess>, commit `de0fb9c1c510661c571164e1418ceca8101dab69`
(main, after the 3.0.2 release). Licence: MIT (`inc/MIT.txt`, Copyright (c) 2026 Intel Corporation; each header says
`SPDX-License-Identifier: MIT`).
Not the `v3.0.2` tag: its headers carry Intel's proprietary notice, not the MIT one; the commit above is the first whose
`inc/` is MIT. Only these headers are taken. Nothing else of the SDK is here: not the D3D12 or D3D11 headers, not XeSS Frame
Generation or XeLL (D3D12 only), not the import library, and never `libxess.dll`, which is Intel's under the Intel Simplified
Software License: the player puts it beside the game (readme, Intel XeSS); nothing downloads it. `gpu/vk/vk_xess.cpp` compiles
against these headers for their types and loads the player's `libxess.dll` at run time through `GetProcAddress`.
The files are Intel's, unmodified but for their line endings: Intel's repository stores them with CRLF, and this repository keeps
text files with LF (`.gitattributes`). With CRLF put back they are Intel's blobs byte for byte (git blob ids:
`inc/xess/xess.h` 5d16b101994190f22cdf43e695ca1fccc9a79a1d, `inc/xess/xess_vk.h` 1349d81d4474975e8dccd5783ceae5d8dc2d9de8,
`inc/MIT.txt` 478eb06298afb556e6248b434b7aec2c93ea4bdb).
Nothing in this folder is edited. A change belongs in a new folder with its own note.
tree-sha256: 2ad625a8596454f22f0474f3af8d3b121b0ed746428f2bac0cadd4bfd580a91d

17
third_party/xess/inc/MIT.txt vendored Normal file
View File

@@ -0,0 +1,17 @@
Copyright (c) 2026 Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

426
third_party/xess/inc/xess/xess.h vendored Normal file
View File

@@ -0,0 +1,426 @@
/*******************************************************************************
* Copyright (c) 2026 Intel Corporation
*
* SPDX-License-Identifier: MIT
******************************************************************************/
#ifndef XESS_H
#define XESS_H
#ifdef XESS_SHARED_LIB
#ifdef _WIN32
#ifdef XESS_EXPORT_API
#define XESS_API __declspec(dllexport)
#else
#define XESS_API __declspec(dllimport)
#endif
#else
#define XESS_API __attribute__((visibility("default")))
#endif
#else
#define XESS_API
#endif
#if !defined _MSC_VER || (_MSC_VER >= 1929)
#define XESS_PRAGMA(x) _Pragma(#x)
#else
#define XESS_PRAGMA(x) __pragma(x)
#endif
#define XESS_PACK_B_X(x) XESS_PRAGMA(pack(push, x))
#define XESS_PACK_E() XESS_PRAGMA(pack(pop))
#define XESS_PACK_B() XESS_PACK_B_X(8)
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _xess_context_handle_t* xess_context_handle_t;
XESS_PACK_B()
/**
* @brief XeSS version.
*
* XeSS uses major.minor.patch version format and Numeric 90+ scheme for development stage builds.
*/
typedef struct _xess_version_t
{
/** A major version increment indicates a new API and potentially a
* break in functionality. */
uint16_t major;
/** A minor version increment indicates incremental changes such as
* optional inputs or flags. This does not break existing functionality. */
uint16_t minor;
/** A patch version increment may include performance or quality tweaks or fixes for known issues.
* There's no change in the interfaces.
* Versions beyond 90 used for development builds to change the interface for the next release.
*/
uint16_t patch;
/** Reserved for future use. */
uint16_t reserved;
} xess_version_t;
XESS_PACK_E()
XESS_PACK_B()
/**
* @brief 2D variable.
*/
typedef struct _xess_2d_t
{
uint32_t x;
uint32_t y;
} xess_2d_t;
XESS_PACK_E()
/**
* @brief 2D coordinates.
*/
typedef xess_2d_t xess_coord_t;
/**
* @brief XeSS quality settings.
*/
typedef enum _xess_quality_settings_t
{
XESS_QUALITY_SETTING_ULTRA_PERFORMANCE = 100,
XESS_QUALITY_SETTING_PERFORMANCE = 101,
XESS_QUALITY_SETTING_BALANCED = 102,
XESS_QUALITY_SETTING_QUALITY = 103,
XESS_QUALITY_SETTING_ULTRA_QUALITY = 104,
XESS_QUALITY_SETTING_ULTRA_QUALITY_PLUS = 105,
XESS_QUALITY_SETTING_AA = 106,
} xess_quality_settings_t;
/**
* @brief XeSS initialization flags.
*/
typedef enum _xess_init_flags_t
{
XESS_INIT_FLAG_NONE = 0,
/** Use motion vectors at target resolution. */
XESS_INIT_FLAG_HIGH_RES_MV = 1 << 0,
/** Use inverted (increased precision) depth encoding */
XESS_INIT_FLAG_INVERTED_DEPTH = 1 << 1,
/** Use exposure texture to scale input color. */
XESS_INIT_FLAG_EXPOSURE_SCALE_TEXTURE = 1 << 2,
/** Use responsive pixel mask texture. */
XESS_INIT_FLAG_RESPONSIVE_PIXEL_MASK = 1 << 3,
/** Use velocity in NDC */
XESS_INIT_FLAG_USE_NDC_VELOCITY = 1 << 4,
/** Use external descriptor heap */
XESS_INIT_FLAG_EXTERNAL_DESCRIPTOR_HEAP = 1 << 5,
/** Disable tonemapping for input and output */
XESS_INIT_FLAG_LDR_INPUT_COLOR = 1 << 6,
/** Remove jitter from input velocity*/
XESS_INIT_FLAG_JITTERED_MV = 1 << 7,
/** Enable automatic exposure calculation. */
XESS_INIT_FLAG_ENABLE_AUTOEXPOSURE = 1 << 8
} xess_init_flags_t;
XESS_PACK_B()
/**
* @brief Properties for internal XeSS resources.
*/
typedef struct _xess_properties_t
{
/** Required amount of descriptors for XeSS */
uint32_t requiredDescriptorCount;
/** The heap size required by XeSS for temporary buffer storage. */
uint64_t tempBufferHeapSize;
/** The heap size required by XeSS for temporary texture storage. */
uint64_t tempTextureHeapSize;
} xess_properties_t;
XESS_PACK_E()
/**
* @brief XeSS return codes.
*/
typedef enum _xess_result_t
{
/** Warning. Folder to store dump data doesn't exist. Write operation skipped.*/
XESS_RESULT_WARNING_NONEXISTING_FOLDER = 1,
/** An old or outdated driver. */
XESS_RESULT_WARNING_OLD_DRIVER = 2,
/** XeSS operation was successful. */
XESS_RESULT_SUCCESS = 0,
/** XeSS not supported on the GPU. An SM 6.4 capable GPU is required. */
XESS_RESULT_ERROR_UNSUPPORTED_DEVICE = -1,
/** An unsupported driver. */
XESS_RESULT_ERROR_UNSUPPORTED_DRIVER = -2,
/** Execute called without initialization. */
XESS_RESULT_ERROR_UNINITIALIZED = -3,
/** Invalid argument such as descriptor handles. */
XESS_RESULT_ERROR_INVALID_ARGUMENT = -4,
/** Not enough available GPU memory. */
XESS_RESULT_ERROR_DEVICE_OUT_OF_MEMORY = -5,
/** Device function failed, such as resource or descriptor creation. */
XESS_RESULT_ERROR_DEVICE = -6,
/** The function is not implemented */
XESS_RESULT_ERROR_NOT_IMPLEMENTED = -7,
/** Invalid context. */
XESS_RESULT_ERROR_INVALID_CONTEXT = -8,
/** Operation not finished yet. */
XESS_RESULT_ERROR_OPERATION_IN_PROGRESS = -9,
/** Operation not supported in current configuration. */
XESS_RESULT_ERROR_UNSUPPORTED = -10,
/** The library cannot be loaded. */
XESS_RESULT_ERROR_CANT_LOAD_LIBRARY = -11,
/** Call to function done in invalid order. */
XESS_RESULT_ERROR_WRONG_CALL_ORDER = -12,
/** Unknown internal failure */
XESS_RESULT_ERROR_UNKNOWN = -1000,
} xess_result_t;
/**
* @brief XeSS logging level
*/
typedef enum _xess_logging_level_t
{
XESS_LOGGING_LEVEL_DEBUG = 0,
XESS_LOGGING_LEVEL_INFO = 1,
XESS_LOGGING_LEVEL_WARNING = 2,
XESS_LOGGING_LEVEL_ERROR = 3
} xess_logging_level_t;
/**
* A logging callback provided by the application. This callback can be called from other threads.
* Message pointer is only valid inside function and may be invalid right after return call.
* Message is a null-terminated utf-8 string
*/
typedef void (*xess_app_log_callback_t)(const char *message, xess_logging_level_t loggingLevel);
#ifndef XESS_TYPES_ONLY
/** @addtogroup xess XeSS API exports
* @{
*/
/**
* @brief Gets the XeSS version. This is baked into the XeSS SDK release.
* @param[out] pVersion Returned XeSS version.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetVersion(xess_version_t* pVersion);
/**
* @brief Gets the version of the loaded Intel XeFX library. When running on Intel platforms
* this function will return the version of the loaded Intel XeFX library, for other
* platforms 0.0.0 will be returned.
* @param hContext The XeSS context handle.
* @param[out] pVersion Returned Intel XeFX library version.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetIntelXeFXVersion(xess_context_handle_t hContext,
xess_version_t* pVersion);
/**
* @brief Gets XeSS internal resources properties.
* @param hContext The XeSS context handle.
* @param pOutputResolution Output resolution to calculate properties for.
* @param[out] pBindingProperties Returned properties.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetProperties(xess_context_handle_t hContext,
const xess_2d_t* pOutputResolution, xess_properties_t* pBindingProperties);
/**
* @brief Get the input resolution for a specified output resolution for a given quality setting.
* XeSS expects all the input buffers except motion vectors to be in the returned resolution.
* Motion vectors can be either in output resolution (XESS_INIT_FLAG_HIGH_RES_MV) or
* returned resolution (default).
*
* @param hContext The XeSS context handle.
* @param pOutputResolution Output resolution to calculate input resolution for.
* @param qualitySettings Desired quality setting.
* @param[out] pInputResolution Required input resolution.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetInputResolution(xess_context_handle_t hContext,
const xess_2d_t* pOutputResolution, xess_quality_settings_t qualitySettings,
xess_2d_t* pInputResolution);
/**
* @brief Get the optimal input resolution and possible range for a specified output resolution for a given quality setting.
* XeSS expects all the input buffers except motion vectors to be in the returned resolution range
* and all input buffers to be in the same resolution.
* Motion vectors can be either in output resolution (XESS_INIT_FLAG_HIGH_RES_MV) or
* in the same resolution as other input buffers (by default).
*
* @note Aspect ratio of the input resolution must be the same as for the output resolution.
*
* @param hContext The XeSS context handle.
* @param pOutputResolution Output resolution to calculate input resolution for.
* @param qualitySettings Desired quality setting.
* @param[out] pInputResolutionOptimal Optimal input resolution.
* @param[out] pInputResolutionMin Required minimal input resolution.
* @param[out] pInputResolutionMax Required maximal input resolution.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetOptimalInputResolution(xess_context_handle_t hContext,
const xess_2d_t* pOutputResolution, xess_quality_settings_t qualitySettings,
xess_2d_t* pInputResolutionOptimal, xess_2d_t* pInputResolutionMin, xess_2d_t* pInputResolutionMax);
/**
* @brief Gets jitter scale value.
* @param hContext The XeSS context handle.
* @param[out] pX Jitter scale pointer for the X axis.
* @param[out] pY Jitter scale pointer for the Y axis.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetJitterScale(xess_context_handle_t hContext, float* pX, float* pY);
/**
* @brief Gets velocity scale value.
* @param hContext The XeSS context handle.
* @param[out] pX Velocity scale pointer for the X axis.
* @param[out] pY Velocity scale pointer for the Y axis.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetVelocityScale(xess_context_handle_t hContext, float* pX, float* pY);
/**
* @brief Destroys the XeSS context.
* The user must ensure that any pending command lists are completed before destroying the context.
* @param hContext: The XeSS context handle.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessDestroyContext(xess_context_handle_t hContext);
/**
* @brief Sets jitter scale value
*
* @param hContext The XeSS context handle.
* @param x scale for the X axis
* @param y scale for the Y axis
* @return XeSS return status code.
*/
XESS_API xess_result_t xessSetJitterScale(xess_context_handle_t hContext, float x, float y);
/**
* @brief Sets velocity scale value
*
* @param hContext The XeSS context handle.
* @param x scale for the X axis
* @param y scale for the Y axis
* @return XeSS return status code.
*/
XESS_API xess_result_t xessSetVelocityScale(xess_context_handle_t hContext, float x, float y);
/**
* @brief Sets exposure scale value
*
* This value will be applied on top of any passed exposure value or automatically calculated exposure.
*
* @param hContext The XeSS context handle.
* @param scale scale value.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessSetExposureMultiplier(xess_context_handle_t hContext, float scale);
/**
* @brief Gets exposure scale value
*
* @param hContext The XeSS context handle.
* @param[out] pScale Exposure scale pointer.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetExposureMultiplier(xess_context_handle_t hContext, float *pScale);
/**
* @brief Sets maximum value for responsive mask
*
* This value used to clip responsive mask values. Final responsive mask value calculated as
* clip(responsive_mask, 0.0, max_value). Value must be within range [0.0; 1.0]
*
* @param hContext The XeSS context handle.
* @param value maximum clip value.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessSetMaxResponsiveMaskValue(xess_context_handle_t hContext, float value);
/**
* @brief Gets maximum value for responsive mask
*
* @param hContext The XeSS context handle.
* @param[out] pValue maximum clip value pointer.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessGetMaxResponsiveMaskValue(xess_context_handle_t hContext, float *pValue);
/**
* @brief Sets logging callback
*
* @param hContext The XeSS context handle.
* @param loggingLevel Minimum logging level for logging callback.
* @param loggingCallback Logging callback
* @return XeSS return status code.
*/
XESS_API xess_result_t xessSetLoggingCallback(xess_context_handle_t hContext,
xess_logging_level_t loggingLevel, xess_app_log_callback_t loggingCallback);
/**
* @brief Indicates if the installed driver supports best XeSS experience.
*
* @param hContext The XeSS context handle.
* @return xessIsOptimalDriver returns XESS_RESULT_SUCCESS, or XESS_RESULT_WARNING_OLD_DRIVER
* if installed driver may result in degraded performance or visual quality.
* xessD3D12CreateContext(..) will return XESS_RESULT_ERROR_UNSUPPORTED_DRIVER if driver does
* not support XeSS at all.
*/
XESS_API xess_result_t xessIsOptimalDriver(xess_context_handle_t hContext);
/**
* @brief Forces usage of legacy (pre 1.3.0) scale factors
*
* Following scale factors will be applied:
* @li XESS_QUALITY_SETTING_ULTRA_PERFORMANCE: 3.0
* @li XESS_QUALITY_SETTING_PERFORMANCE: 2.0
* @li XESS_QUALITY_SETTING_BALANCED: 1.7
* @li XESS_QUALITY_SETTING_QUALITY: 1.5
* @li XESS_QUALITY_SETTING_ULTRA_QUALITY: 1.3
* @li XESS_QUALITY_SETTING_AA: 1.0
* In order to apply new scale factors application should call xessGetOptimalInputResolution and
* initialization function (xess*Init)
*
* @param hContext The XeSS context handle.
* @param force if set to true legacy scale factors will be forced, if set to false - scale factors
* will be selected by XeSS
*
* @return XeSS return status code.
*/
XESS_API xess_result_t xessForceLegacyScaleFactors(xess_context_handle_t hContext, bool force);
/**
* @brief Returns current state of pipeline build
* This function can only be called after xess*BuildPipelines and
* before corresponding xess*Init.
* This call returns XESS_RESULT_SUCCESS if pipelines already built, and
* XESS_RESULT_ERROR_OPERATION_IN_PROGRESS if pipeline build is in progress.
* If function called before @ref xess*BuildPipelines or after @ref xess*Init -
* XESS_RESULT_ERROR_WRONG_CALL_ORDER will be returned.
*
* @param hContext The XeSS context handle.
* @return XESS_RESULT_SUCCESS if pipelines already built.
* XESS_RESULT_ERROR_OPERATION_IN_PROGRESS if pipeline build is in progress.
* XESS_RESULT_ERROR_WRONG_CALL_ORDER if the function is called out of order.
*/
XESS_API xess_result_t xessGetPipelineBuildStatus(xess_context_handle_t hContext);
/** @}*/
#endif
// Enum size checks. All enums must be 4 bytes
typedef char sizecheck__LINE__[ (sizeof(xess_quality_settings_t) == 4) ? 1 : -1];
typedef char sizecheck__LINE__[ (sizeof(xess_init_flags_t) == 4) ? 1 : -1];
typedef char sizecheck__LINE__[ (sizeof(xess_result_t) == 4) ? 1 : -1];
typedef char sizecheck__LINE__[ (sizeof(xess_logging_level_t) == 4) ? 1 : -1];
#ifdef __cplusplus
}
#endif
#endif

253
third_party/xess/inc/xess/xess_vk.h vendored Normal file
View File

@@ -0,0 +1,253 @@
/*******************************************************************************
* Copyright (c) 2026 Intel Corporation
*
* SPDX-License-Identifier: MIT
******************************************************************************/
#ifndef XESS_VK_H
#define XESS_VK_H
#include <vulkan/vulkan.h>
#include "xess.h"
#ifdef __cplusplus
extern "C" {
#endif
XESS_PACK_B()
typedef struct _xess_vk_image_view_info
{
VkImageView imageView;
VkImage image;
VkImageSubresourceRange subresourceRange;
VkFormat format;
unsigned int width;
unsigned int height;
} xess_vk_image_view_info;
XESS_PACK_E()
XESS_PACK_B()
/**
* @brief Execution parameters for XeSS Vulkan.
*/
typedef struct _xess_vk_execute_params_t
{
/** Input color texture. Must be in VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL state.*/
xess_vk_image_view_info colorTexture;
/** Input motion vector texture. Must be in VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL state.*/
xess_vk_image_view_info velocityTexture;
/** Optional depth texture. Required if XESS_INIT_FLAG_HIGH_RES_MV has not been specified.
* Must be in VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL state.*/
xess_vk_image_view_info depthTexture;
/** Optional 1x1 exposure scale texture. Required if XESS_INIT_FLAG_EXPOSURE_TEXTURE has been
* specified. Must be in VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL state */
xess_vk_image_view_info exposureScaleTexture;
/** Optional responsive pixel mask texture. Required if XESS_INIT_FLAG_RESPONSIVE_PIXEL_MASK
* has been specified. Must be in VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL state */
xess_vk_image_view_info responsivePixelMaskTexture;
/** Output texture in target resolution. Must be in VK_IMAGE_LAYOUT_GENERAL state.*/
xess_vk_image_view_info outputTexture;
/** Jitter X coordinate in the range [-0.5, 0.5]. */
float jitterOffsetX;
/** Jitter Y coordinate in the range [-0.5, 0.5]. */
float jitterOffsetY;
/** Optional input color scaling. Default is 1. */
float exposureScale;
/** Resets the history accumulation in this frame. */
uint32_t resetHistory;
/** Input color width. */
uint32_t inputWidth;
/** Input color height. */
uint32_t inputHeight;
/** Base coordinate for the input color in the texture. Default is (0,0). */
xess_coord_t inputColorBase;
/** Base coordinate for the input motion vector in the texture. Default is (0,0). */
xess_coord_t inputMotionVectorBase;
/** Base coordinate for the input depth in the texture. Default is (0,0). */
xess_coord_t inputDepthBase;
/** Base coordinate for the input responsive pixel mask in the texture. Default is (0,0). */
xess_coord_t inputResponsiveMaskBase;
/** Reserved parameter. */
xess_coord_t reserved0;
/** Base coordinate for the output color. Default is (0,0). */
xess_coord_t outputColorBase;
} xess_vk_execute_params_t;
XESS_PACK_E()
XESS_PACK_B()
/**
* @brief Initialization parameters for XeSS VK.
*/
typedef struct _xess_vk_init_params_t
{
/** Output width and height. */
xess_2d_t outputResolution;
/** Quality setting */
xess_quality_settings_t qualitySetting;
/** Initialization flags. */
uint32_t initFlags;
/** Specifies the node mask for internally created resources on
* multi-adapter systems. */
uint32_t creationNodeMask;
/** Specifies the node visibility mask for internally created resources
* on multi-adapter systems. */
uint32_t visibleNodeMask;
/** Optional externally allocated buffer memory for XeSS. If VK_NULL_HANDLE the
* memory is allocated internally. If provided, the memory must be allocated from
* memory type that supports allocating buffers. The memory type should be DEVICE_LOCAL.
* This memory is not accessed by the CPU. */
VkDeviceMemory tempBufferHeap;
/** Offset in the externally allocated memory for temporary buffer storage. */
uint64_t bufferHeapOffset;
/** Optional externally allocated texture memory for XeSS. If VK_NULL_HANDLE the
* memory is allocated internally. If provided, the memory must be allocated from
* memory type that supports allocating textures. The memory type should be DEVICE_LOCAL.
* This memory is not accessed by the CPU. */
VkDeviceMemory tempTextureHeap;
/** Offset in the externally allocated memory for temporary texture storage. */
uint64_t textureHeapOffset;
/** Optional pipeline cache. If not VK_NULL_HANDLE will be used for pipeline creation. */
VkPipelineCache pipelineCache;
} xess_vk_init_params_t;
XESS_PACK_E()
/** @addtogroup xess-vulkan XeSS VK API exports
* @{
*/
/**
* @brief Get required extensions for Vulkan instance that would run XeSS.
* This function must be called to get instance extensions need by XeSS. These
* extensions must be enabled in subsequent vkCreateInstance call, that would create a VkInstance
* object to be passed to @ref xessVKCreateContext
* @param[out] instanceExtensionsCount returns a count of instance extensions to be enabled in Vulkan instance
* @param[out] instanceExtensions returns a pointer to an array of \p instanceExtensionsCount required extension names.
* The memory used by the array is owned by the XeSS library and should not be freed by the application.
* @param[out] minVkApiVersion The Vulkan API version that XeSS would use. When calling vkCreateInstance, the application
* should set VkApplicationInfo.apiVersion to value greater or equal to \p minVkApiVersion
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKGetRequiredInstanceExtensions(uint32_t* instanceExtensionsCount, const char* const** instanceExtensions, uint32_t* minVkApiVersion);
/**
* @brief Get required extensions for Vulkan device that would run XeSS.
* This function must be called to get device extensions need by XeSS. These
* extensions must be enabled in subsequent vkCreateDevice call, that would create a VkDevice
* object to be passed to @ref xessVKCreateContext
* @param instance A VkInstance object created by the user
* @param physicalDevice A VkPhysicalDevice selected by the user from instance
* @param[out] deviceExtensionsCount returns a count of device extensions to be enabled in Vulkan device
* @param[out] deviceExtensions returns a pointer to an array of \p deviceExtensionsCount required extension names
* The memory used by the array is owned by the XeSS library and should not be freed by the application.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKGetRequiredDeviceExtensions(VkInstance instance, VkPhysicalDevice physicalDevice,
uint32_t* deviceExtensionsCount, const char* const** deviceExtensions);
/**
* @brief Get required features for Vulkan device that would run XeSS.
* This function must be called to get device features need by XeSS. These
* features must be enabled in subsequent vkCreateDevice call, that would create a VkDevice
* object to be passed to @ref xessVKCreateContext.
* @param instance A VkInstance object created by the user
* @param physicalDevice A VkPhysicalDevice selected by the user from instance
* @param[out] features a pointer to writable chain of feature structures, that this function would patch
* with required features, by filling required fields and attaching new structures to the chain if needed.
* The returned pointer should be passed to vkCreateDevice as pNext chain of VkDeviceCreateInfo structure.
* If null is passed, than the function constructs a new structure chain that should be merged
* into the chain that application would use with VkDeviceCreateInfo, with application responsibility to
* avoid any duplicates with its own structures.
*
* It is an error to chain VkDeviceCreateInfo structure with not null pEnabledFeatures field, as this field is const
* and cannot be patched by this function. VkPhysicalDeviceFeatures2 structure should be used instead.
*
* The memory used by the structures added by this funtion to the chain is owned by the XeSS library and
* should not be freed by the application.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKGetRequiredDeviceFeatures(VkInstance instance, VkPhysicalDevice physicalDevice, void** features);
/**
* @brief Create an XeSS VK context.
* @param instance A VkInstance object created by the user
* @param physicalDevice A VkPhysicalDevice selected by the user from instance
* @param device A VK device created by the user from physicalDevice
* @param[out] phContext Returned xess context handle.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKCreateContext(VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device,
xess_context_handle_t* phContext);
/**
* @brief Initiates pipeline build process
* This function can only be called between @ref xessVKCreateContext and
* @ref xessVKInit
* This call initiates build of Vulkan pipelines and kernel compilation
* This call can be blocking (if @p blocking set to true) or non-blocking.
* In case of non-blocking call library will wait for pipeline build on call to
* @ref xessVKInit
* If @p pipelineCache passed to this call - same pipeline library must be passed
* to @ref xessVKInit
*
* @param hContext The XeSS context handle.
* @param pipelineCache Optional pointer to pipeline library for pipeline caching.
* @param blocking Wait for kernel compilation and pipeline creation to finish or not
* @param initFlags Initialization flags. *Must* be identical to flags passed to @ref xessVKInit
*/
XESS_API xess_result_t xessVKBuildPipelines(xess_context_handle_t hContext,
VkPipelineCache pipelineCache, bool blocking, uint32_t initFlags);
/**
* @brief Initialize XeSS VK.
* This is a blocking call that initializes XeSS and triggers internal
* resources allocation and JIT for the XeSS kernels. The user must ensure that
* any pending command lists are completed before re-initialization. When
* During initialization, XeSS can create staging buffers and copy queues to
* upload internal data. These will be destroyed at the end of initialization.
*
* @note XeSS supports devices starting from VK_RESOURCE_HEAP_TIER_1, which means
* that buffers and textures can not live in the same resource heap.
*
* @param hContext: The XeSS context handle.
* @param pInitParams: Initialization parameters.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKInit(
xess_context_handle_t hContext, const xess_vk_init_params_t* pInitParams);
/**
* @brief Get XeSS VK initialization parameters.
*
* @note This function will return @ref XESS_RESULT_ERROR_UNINITIALIZED if @ref xessVKInit has not been called.
*
* @param hContext: The XeSS context handle.
* @param[out] pInitParams: Returned initialization parameters.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKGetInitParams(
xess_context_handle_t hContext, xess_vk_init_params_t* pInitParams);
/**
* @brief Record XeSS upscaling commands into the command list.
* @param hContext: The XeSS context handle.
* @param commandBuffer: The command buffer for XeSS commands.
* @param pExecParams: Execution parameters.
* @return XeSS return status code.
*/
XESS_API xess_result_t xessVKExecute(xess_context_handle_t hContext,
VkCommandBuffer commandBuffer, const xess_vk_execute_params_t* pExecParams);
/** @}*/
#ifdef __cplusplus
}
#endif
#endif // XESS_VK_H