Path: blob/master/thirdparty/amd-fsr2/ffx_fsr2_private.h
9903 views
// This file is part of the FidelityFX SDK.1//2// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.3//4// Permission is hereby granted, free of charge, to any person obtaining a copy5// of this software and associated documentation files (the "Software"), to deal6// in the Software without restriction, including without limitation the rights7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell8// copies of the Software, and to permit persons to whom the Software is9// furnished to do so, subject to the following conditions:10// The above copyright notice and this permission notice shall be included in11// all copies or substantial portions of the Software.12//13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN19// THE SOFTWARE.2021#pragma once2223// Constants for FSR2 DX12 dispatches. Must be kept in sync with cbFSR2 in ffx_fsr2_callbacks_hlsl.h24typedef struct Fsr2Constants {2526int32_t renderSize[2];27int32_t maxRenderSize[2];28int32_t displaySize[2];29int32_t inputColorResourceDimensions[2];30int32_t lumaMipDimensions[2];31int32_t lumaMipLevelToUse;32int32_t frameIndex;3334float deviceToViewDepth[4];35float jitterOffset[2];36float motionVectorScale[2];37float downscaleFactor[2];38float motionVectorJitterCancellation[2];39float preExposure;40float previousFramePreExposure;41float tanHalfFOV;42float jitterPhaseCount;43float deltaTime;44float dynamicResChangeFactor;45float viewSpaceToMetersFactor;4647float pad;48float reprojectionMatrix[16];49} Fsr2Constants;5051struct FfxFsr2ContextDescription;52struct FfxDeviceCapabilities;53struct FfxPipelineState;54struct FfxResource;5556// FfxFsr2Context_Private57// The private implementation of the FSR2 context.58typedef struct FfxFsr2Context_Private {5960FfxFsr2ContextDescription contextDescription;61Fsr2Constants constants;62FfxDevice device;63FfxDeviceCapabilities deviceCapabilities;64FfxPipelineState pipelineDepthClip;65FfxPipelineState pipelineReconstructPreviousDepth;66FfxPipelineState pipelineLock;67FfxPipelineState pipelineAccumulate;68FfxPipelineState pipelineAccumulateSharpen;69FfxPipelineState pipelineRCAS;70FfxPipelineState pipelineComputeLuminancePyramid;71FfxPipelineState pipelineGenerateReactive;72FfxPipelineState pipelineTcrAutogenerate;7374// 2 arrays of resources, as e.g. FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS will use different resources when bound as SRV vs when bound as UAV75FfxResourceInternal srvResources[FFX_FSR2_RESOURCE_IDENTIFIER_COUNT];76FfxResourceInternal uavResources[FFX_FSR2_RESOURCE_IDENTIFIER_COUNT];7778bool firstExecution;79bool refreshPipelineStates;80uint32_t resourceFrameIndex;81float previousJitterOffset[2];82int32_t jitterPhaseCountRemaining;83} FfxFsr2Context_Private;848586