diff --git a/include/ffx_api/ffx_api.h b/include/ffx_api/ffx_api.h index 0b192d5..e136191 100644 --- a/include/ffx_api/ffx_api.h +++ b/include/ffx_api/ffx_api.h @@ -100,6 +100,14 @@ struct ffxOverrideVersion uint64_t versionId; ///< Id of version to use. Must be a value returned from a query in ffxQueryDescGetVersions.versionIds array. }; +#define FFX_API_QUERY_DESC_TYPE_GET_PROVIDER_VERSION 6u +struct ffxQueryGetProviderVersion +{ + ffxQueryDescHeader header; + uint64_t versionId; ///< Id of provider being used for queried context. 0 if invalid. + const char* versionName; ///< Version name for display. If nullptr, the query was invalid. +}; + // Memory allocation function. Must return a valid pointer to at least size bytes of memory aligned to hold any type. // May return null to indicate failure. Standard library malloc fulfills this requirement. typedef void* (*ffxAlloc)(void* pUserData, uint64_t size); diff --git a/include/ffx_api/ffx_api.hpp b/include/ffx_api/ffx_api.hpp index 0ff337d..e1189a3 100644 --- a/include/ffx_api/ffx_api.hpp +++ b/include/ffx_api/ffx_api.hpp @@ -138,6 +138,9 @@ struct struct_type : std::integral_constant struct struct_type : std::integral_constant {}; +template <> +struct struct_type : std::integral_constant {}; + template ::value> struct InitHelper : public Inner { diff --git a/include/ffx_api/ffx_api_types.h b/include/ffx_api/ffx_api_types.h index a31b81f..87a9d0b 100644 --- a/include/ffx_api/ffx_api_types.h +++ b/include/ffx_api/ffx_api_types.h @@ -23,6 +23,7 @@ #pragma once #include +#include /// An enumeration of surface formats. Needs to match enum FfxSurfaceFormat enum FfxApiSurfaceFormat @@ -79,7 +80,7 @@ enum FfxApiResourceUsage FFX_API_RESOURCE_USAGE_ARRAYVIEW = (1<<4), ///< Indicates a resource that will generate array views. Works on 2D and cubemap textures FFX_API_RESOURCE_USAGE_STENCILTARGET = (1<<5), ///< Indicates a resource will be used as stencil target. }; -typedef FfxApiResourceUsage FfxApiResorceUsage; // Corrects a typo that shipped with original API + /// An enumeration of resource states. enum FfxApiResourceState diff --git a/include/ffx_api/ffx_framegeneration.h b/include/ffx_api/ffx_framegeneration.h index c44faed..12f996d 100644 --- a/include/ffx_api/ffx_framegeneration.h +++ b/include/ffx_api/ffx_framegeneration.h @@ -30,7 +30,6 @@ #if defined(__cplusplus) extern "C" { #endif - enum FfxApiCreateContextFramegenerationFlags { FFX_FRAMEGENERATION_ENABLE_ASYNC_WORKLOAD_SUPPORT = (1<<0), @@ -39,6 +38,7 @@ enum FfxApiCreateContextFramegenerationFlags FFX_FRAMEGENERATION_ENABLE_DEPTH_INVERTED = (1<<3), ///< A bit indicating that the input depth buffer data provided is inverted [1..0]. FFX_FRAMEGENERATION_ENABLE_DEPTH_INFINITE = (1<<4), ///< A bit indicating that the input depth buffer data provided is using an infinite far plane. FFX_FRAMEGENERATION_ENABLE_HIGH_DYNAMIC_RANGE = (1<<5), ///< A bit indicating if the input color data provided to all inputs is using a high-dynamic range. + FFX_FRAMEGENERATION_ENABLE_DEBUG_CHECKING = (1<<6), ///< A bit indicating that the runtime should check some API values and report issues. }; enum FfxApiDispatchFramegenerationFlags @@ -48,7 +48,8 @@ enum FfxApiDispatchFramegenerationFlags FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_VIEW = (1 << 2), ///< A bit indicating that the generated output resource will contain debug views with relevant information. FFX_FRAMEGENERATION_FLAG_NO_SWAPCHAIN_CONTEXT_NOTIFY = (1 << 3), ///< A bit indicating that the context should only run frame interpolation and not modify the swapchain. FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_PACING_LINES = (1 << 4), ///< A bit indicating that the debug pacing lines will be drawn to the generated output. - + FFX_FRAMEGENERATION_FLAG_RESERVED_1 = (1 << 5), + FFX_FRAMEGENERATION_FLAG_RESERVED_2 = (1 << 6), }; enum FfxApiUiCompositionFlags @@ -68,7 +69,7 @@ struct ffxCreateContextDescFrameGeneration }; #define FFX_API_CALLBACK_DESC_TYPE_FRAMEGENERATION_PRESENT 0x00020005u -struct ffxCallbackDescFrameGenerationPresent +typedef struct ffxCallbackDescFrameGenerationPresent { ffxDispatchDescHeader header; void* device; ///< The device passed in (from a backend description) during context creation. @@ -78,10 +79,10 @@ struct ffxCallbackDescFrameGenerationPresent struct FfxApiResource outputSwapChainBuffer; ///< Output image that will be presented. bool isGeneratedFrame; ///< true if this frame is generated, false if rendered. uint64_t frameID; ///< Identifier used to select internal resources when async support is enabled. Must increment by exactly one (1) for each frame. Any non-exactly-one difference will reset the frame generation logic. -}; +} ffxCallbackDescFrameGenerationPresent; #define FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION 0x00020003u -struct ffxDispatchDescFrameGeneration +typedef struct ffxDispatchDescFrameGeneration { ffxDispatchDescHeader header; void* commandList; ///< The command list on which to register render commands. @@ -93,7 +94,7 @@ struct ffxDispatchDescFrameGeneration float minMaxLuminance[2]; ///< Min and max luminance values, used when converting HDR colors to linear RGB. struct FfxApiRect2D generationRect; ///< The area of the backbuffer that should be used for generation in case only a part of the screen is used e.g. due to movie bars. uint64_t frameID; ///< Identifier used to select internal resources when async support is enabled. Must increment by exactly one (1) for each frame. Any non-exactly-one difference will reset the frame generation logic. -}; +} ffxDispatchDescFrameGeneration; typedef ffxReturnCode_t(*FfxApiPresentCallbackFunc)(ffxCallbackDescFrameGenerationPresent* params, void* pUserCtx); typedef ffxReturnCode_t(*FfxApiFrameGenerationDispatchFunc)(ffxDispatchDescFrameGeneration* params, void* pUserCtx); @@ -166,12 +167,24 @@ struct ffxConfigureDescFrameGenerationRegisterDistortionFieldResource }; #define FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_HUDLESS 0x00020009u +//Pass this optional linked struct at FG context creation to enable app to use different hudlessBackBufferformat (IE.RGBA8_UNORM) from backBufferFormat (IE. BGRA8_UNORM) struct ffxCreateContextDescFrameGenerationHudless { ffxCreateContextDescHeader header; uint32_t hudlessBackBufferFormat; ///< The surface format for the hudless back buffer. One of the values from FfxApiSurfaceFormat. }; +#define FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_CAMERAINFO 0x0002000au +//Link this struct after ffxDispatchDescFrameGenerationPrepare. This is a required input to FSR3.1.4 and onwards for best quality. +struct ffxDispatchDescFrameGenerationPrepareCameraInfo +{ + ffxConfigureDescHeader header; + float cameraPosition[3]; ///< The camera position in world space + float cameraUp[3]; ///< The camera up normalized vector in world space. + float cameraRight[3]; ///< The camera right normalized vector in world space. + float cameraForward[3]; ///< The camera forward normalized vector in world space. +}; + #if defined(__cplusplus) } // extern "C" #endif diff --git a/include/ffx_api/ffx_framegeneration.hpp b/include/ffx_api/ffx_framegeneration.hpp index 7d5cb44..5cc52a1 100644 --- a/include/ffx_api/ffx_framegeneration.hpp +++ b/include/ffx_api/ffx_framegeneration.hpp @@ -35,11 +35,6 @@ struct struct_type : std::integral_constant struct CreateContextDescFrameGeneration : public InitHelper {}; -template<> -struct struct_type : std::integral_constant {}; - -struct CreateContextDescFrameGenerationHudless : public InitHelper {}; - template<> struct struct_type : std::integral_constant {}; @@ -70,4 +65,13 @@ struct struct_type {}; +template<> +struct struct_type : std::integral_constant {}; + +struct CreateContextDescFrameGenerationHudless : public InitHelper {}; + +template<> +struct struct_type : std::integral_constant {}; + +struct DispatchDescFrameGenerationPrepareCameraInfo : public InitHelper {}; } diff --git a/include/ffx_api/ffx_upscale.h b/include/ffx_api/ffx_upscale.h index ea0192a..e581b47 100644 --- a/include/ffx_api/ffx_upscale.h +++ b/include/ffx_api/ffx_upscale.h @@ -169,7 +169,11 @@ struct ffxConfigureDescUpscaleKeyValue enum FfxApiConfigureUpscaleKey { - FFX_API_CONFIGURE_UPSCALE_KEY_FVELOCITYFACTOR = 0 //Override constant buffer fVelocityFactor (from 1.0f at context creation) to floating point value casted from void * ptr. Value of 0.0f can improve temporal stability of bright pixels. Value is clamped to [0.0f, 1.0f]. + FFX_API_CONFIGURE_UPSCALE_KEY_FVELOCITYFACTOR = 0, //Override constant buffer fVelocityFactor. The float value is casted from void * ptr. Value of 0.0f can improve temporal stability of bright pixels. Default value is 1.0f. Value is clamped to [0.0f, 1.0f]. + FFX_API_CONFIGURE_UPSCALE_KEY_FREACTIVENESSSCALE = 1, //Override constant buffer fReactivenessScale. The float value is casted from void * ptr. Meant for development purpose to test if writing a larger value to reactive mask, reduces ghosting. Default value is 1.0f. Value is clamped to [0.0f, +infinity]. + FFX_API_CONFIGURE_UPSCALE_KEY_FSHADINGCHANGESCALE = 2, //Override fShadingChangeScale. Increasing this scales fsr3.1 computed shading change value at read to have higher reactiveness. Default value is 1.0f. Value is clamped to [0.0f, +infinity]. + FFX_API_CONFIGURE_UPSCALE_KEY_FACCUMULATIONADDEDPERFRAME = 3, // Override constant buffer fAccumulationAddedPerFrame. Corresponds to amount of accumulation added per frame at pixel coordinate where disocclusion occured or when reactive mask value is > 0.0f. Decreasing this and drawing the ghosting object (IE no mv) to reactive mask with value close to 1.0f can decrease temporal ghosting. Decreasing this value could result in more thin feature pixels flickering. Default value is 0.333. Value is clamped to [0.0f, 1.0f]. + FFX_API_CONFIGURE_UPSCALE_KEY_FMINDISOCCLUSIONACCUMULATION = 4, //Override constant buffer fMinDisocclusionAccumulation. Increasing this value may reduce white pixel temporal flickering around swaying thin objects that are disoccluding one another often. Too high value may increase ghosting. A sufficiently negative value means for pixel coordinate at frame N that is disoccluded, add fAccumulationAddedPerFrame starting at frame N+2. Default value is -0.333. Value is clamped to [-1.0f, 1.0f]. }; #define FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE 0x00010008u diff --git a/lib/amd_fidelityfx_dx12.dll b/lib/amd_fidelityfx_dx12.dll index 5e38164..9bd0fbb 100644 Binary files a/lib/amd_fidelityfx_dx12.dll and b/lib/amd_fidelityfx_dx12.dll differ diff --git a/lib/amd_fidelityfx_dx12.lib b/lib/amd_fidelityfx_dx12.lib index 8034b34..aede3d7 100644 Binary files a/lib/amd_fidelityfx_dx12.lib and b/lib/amd_fidelityfx_dx12.lib differ diff --git a/lib/amd_fidelityfx_vk.dll b/lib/amd_fidelityfx_vk.dll index f25dad8..6efacc5 100644 Binary files a/lib/amd_fidelityfx_vk.dll and b/lib/amd_fidelityfx_vk.dll differ diff --git a/lib/amd_fidelityfx_vk.lib b/lib/amd_fidelityfx_vk.lib index 6c45a50..38c3ae9 100644 Binary files a/lib/amd_fidelityfx_vk.lib and b/lib/amd_fidelityfx_vk.lib differ