2018-04-12 15:36:01 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dxgi_include.h"
|
|
|
|
|
|
|
|
#include "../dxvk/dxvk_include.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
2018-04-12 17:49:14 +02:00
|
|
|
* \brief Format mapping
|
|
|
|
*
|
|
|
|
* Maps a DXGI format to a set of Vulkan formats.
|
2018-04-12 15:36:01 +02:00
|
|
|
*/
|
2018-04-12 17:49:14 +02:00
|
|
|
struct DXGI_VK_FORMAT_MAPPING {
|
|
|
|
VkFormat FormatColor = VK_FORMAT_UNDEFINED; ///< Corresponding color format
|
|
|
|
VkFormat FormatDepth = VK_FORMAT_UNDEFINED; ///< Corresponding depth format
|
|
|
|
VkFormat FormatRaw = VK_FORMAT_UNDEFINED; ///< Bit-compatible integer format
|
|
|
|
VkImageAspectFlags AspectColor = 0; ///< Defined aspects for the color format
|
|
|
|
VkImageAspectFlags AspectDepth = 0; ///< Defined aspects for the depth format
|
|
|
|
VkComponentMapping Swizzle = { ///< Color component swizzle
|
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY,
|
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
|
2018-04-12 15:36:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Format info
|
|
|
|
*
|
|
|
|
* Stores a Vulkan image format for a given
|
|
|
|
* DXGI format and some additional information
|
|
|
|
* on how resources with the particular format
|
|
|
|
* are supposed to be used.
|
|
|
|
*/
|
|
|
|
struct DXGI_VK_FORMAT_INFO {
|
2018-04-12 17:49:14 +02:00
|
|
|
VkFormat Format = VK_FORMAT_UNDEFINED; ///< Corresponding color format
|
|
|
|
VkImageAspectFlags Aspect = 0; ///< Defined image aspect mask
|
|
|
|
VkComponentMapping Swizzle = { ///< Component swizzle
|
2018-04-12 15:36:01 +02:00
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY,
|
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Format lookup mode
|
|
|
|
*
|
|
|
|
* When looking up an image format, additional information
|
|
|
|
* might be needed on how the image is going to be used.
|
|
|
|
* This is used to properly map typeless formats and color
|
|
|
|
* formats to depth formats if they are used on depth images.
|
|
|
|
*/
|
2018-04-12 17:49:14 +02:00
|
|
|
enum DXGI_VK_FORMAT_MODE {
|
|
|
|
DXGI_VK_FORMAT_MODE_ANY = 0, ///< Color first, then depth
|
|
|
|
DXGI_VK_FORMAT_MODE_COLOR = 1, ///< Color only
|
|
|
|
DXGI_VK_FORMAT_MODE_DEPTH = 2, ///< Depth only
|
|
|
|
DXGI_VK_FORMAT_MODE_RAW = 3, ///< Unsigned integer format
|
2018-04-12 15:36:01 +02:00
|
|
|
};
|
|
|
|
|
2018-04-12 17:49:14 +02:00
|
|
|
/**
|
|
|
|
* \brief Retrieves info for a given DXGI format
|
|
|
|
*
|
|
|
|
* \param [in] Format The DXGI format to look up
|
|
|
|
* \param [in] Mode the format lookup mode
|
|
|
|
* \returns Format info
|
|
|
|
*/
|
|
|
|
DXGI_VK_FORMAT_INFO GetDXGIFormatInfo(
|
|
|
|
DXGI_FORMAT Format,
|
|
|
|
DXGI_VK_FORMAT_MODE Mode);
|
|
|
|
|
2018-04-12 15:36:01 +02:00
|
|
|
};
|