Browse Source

Updated to FidelityFX SDK 1.1.4 with FSR 3.1.4

master
Nico de Poel 9 months ago
parent
commit
587cec3a33
  1. 8
      include/ffx_api/ffx_api.h
  2. 3
      include/ffx_api/ffx_api.hpp
  3. 3
      include/ffx_api/ffx_api_types.h
  4. 25
      include/ffx_api/ffx_framegeneration.h
  5. 14
      include/ffx_api/ffx_framegeneration.hpp
  6. 6
      include/ffx_api/ffx_upscale.h
  7. BIN
      lib/amd_fidelityfx_dx12.dll
  8. BIN
      lib/amd_fidelityfx_dx12.lib
  9. BIN
      lib/amd_fidelityfx_vk.dll
  10. BIN
      lib/amd_fidelityfx_vk.lib

8
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);

3
include/ffx_api/ffx_api.hpp

@ -138,6 +138,9 @@ struct struct_type<ffxOverrideVersion> : std::integral_constant<uint64_t, FFX_AP
template<>
struct struct_type<ffxQueryDescGetVersions> : std::integral_constant<uint64_t, FFX_API_QUERY_DESC_TYPE_GET_VERSIONS> {};
template <>
struct struct_type<ffxQueryGetProviderVersion> : std::integral_constant<uint64_t, FFX_API_QUERY_DESC_TYPE_GET_PROVIDER_VERSION> {};
template <class Inner, uint64_t type = struct_type<Inner>::value>
struct InitHelper : public Inner
{

3
include/ffx_api/ffx_api_types.h

@ -23,6 +23,7 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
/// 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

25
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

14
include/ffx_api/ffx_framegeneration.hpp

@ -35,11 +35,6 @@ struct struct_type<ffxCreateContextDescFrameGeneration> : std::integral_constant
struct CreateContextDescFrameGeneration : public InitHelper<ffxCreateContextDescFrameGeneration> {};
template<>
struct struct_type<ffxCreateContextDescFrameGenerationHudless> : std::integral_constant<uint64_t, FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_HUDLESS> {};
struct CreateContextDescFrameGenerationHudless : public InitHelper<ffxCreateContextDescFrameGenerationHudless> {};
template<>
struct struct_type<ffxConfigureDescFrameGeneration> : std::integral_constant<uint64_t, FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION> {};
@ -70,4 +65,13 @@ struct struct_type<ffxConfigureDescFrameGenerationRegisterDistortionFieldResourc
struct ConfigureDescFrameGenerationRegisterDistortionFieldResource : public InitHelper<ffxConfigureDescFrameGenerationRegisterDistortionFieldResource> {};
template<>
struct struct_type<ffxCreateContextDescFrameGenerationHudless> : std::integral_constant<uint64_t, FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_HUDLESS> {};
struct CreateContextDescFrameGenerationHudless : public InitHelper<ffxCreateContextDescFrameGenerationHudless> {};
template<>
struct struct_type<ffxDispatchDescFrameGenerationPrepareCameraInfo> : std::integral_constant<uint64_t, FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_CAMERAINFO> {};
struct DispatchDescFrameGenerationPrepareCameraInfo : public InitHelper<ffxDispatchDescFrameGenerationPrepareCameraInfo> {};
}

6
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

BIN
lib/amd_fidelityfx_dx12.dll

BIN
lib/amd_fidelityfx_dx12.lib

BIN
lib/amd_fidelityfx_vk.dll

BIN
lib/amd_fidelityfx_vk.lib

Loading…
Cancel
Save