godot/thirdparty/amd-fsr2/ffx_error.h

// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
//
// 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.

#pragma once

#include "ffx_types.h"

/// Typedef for error codes returned from functions in the FidelityFX SDK.
FfxErrorCode;

static const FfxErrorCode FFX_OK                            =;           ///< The operation completed successfully.
static const FfxErrorCode FFX_ERROR_INVALID_POINTER         =;  ///< The operation failed due to an invalid pointer.
static const FfxErrorCode FFX_ERROR_INVALID_ALIGNMENT       =;  ///< The operation failed due to an invalid alignment.
static const FfxErrorCode FFX_ERROR_INVALID_SIZE            =;  ///< The operation failed due to an invalid size.
static const FfxErrorCode FFX_EOF                           =;  ///< The end of the file was encountered.
static const FfxErrorCode FFX_ERROR_INVALID_PATH            =;  ///< The operation failed because the specified path was invalid.
static const FfxErrorCode FFX_ERROR_EOF                     =;  ///< The operation failed because end of file was reached.
static const FfxErrorCode FFX_ERROR_MALFORMED_DATA          =;  ///< The operation failed because of some malformed data.
static const FfxErrorCode FFX_ERROR_OUT_OF_MEMORY           =;  ///< The operation failed because it ran out memory.
static const FfxErrorCode FFX_ERROR_INCOMPLETE_INTERFACE    =;  ///< The operation failed because the interface was not fully configured.
static const FfxErrorCode FFX_ERROR_INVALID_ENUM            =;  ///< The operation failed because of an invalid enumeration value.
static const FfxErrorCode FFX_ERROR_INVALID_ARGUMENT        =;  ///< The operation failed because an argument was invalid.
static const FfxErrorCode FFX_ERROR_OUT_OF_RANGE            =;  ///< The operation failed because a value was out of range.
static const FfxErrorCode FFX_ERROR_NULL_DEVICE             =;  ///< The operation failed because a device was null.
static const FfxErrorCode FFX_ERROR_BACKEND_API_ERROR       =;  ///< The operation failed because the backend API returned an error code.
static const FfxErrorCode FFX_ERROR_INSUFFICIENT_MEMORY     =;  ///< The operation failed because there was not enough memory.

/// Helper macro to return error code y from a function when a specific condition, x, is not met.
#define FFX_RETURN_ON_ERROR(x, y)

/// Helper macro to return error code x from a function when it is not FFX_OK.
#define FFX_VALIDATE(x)