#ifndef LIBANGLE_RENDERER_VULKAN_VK_FORMAT_UTILS_H_
#define LIBANGLE_RENDERER_VULKAN_VK_FORMAT_UTILS_H_
#include "common/SimpleMutex.h"
#include "common/vulkan/vk_headers.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/Format.h"
#include "libANGLE/renderer/copyvertex.h"
#include "libANGLE/renderer/renderer_utils.h"
#include "platform/autogen/FeaturesVk_autogen.h"
#include <array>
namespace gl
{
struct SwizzleState;
class TextureCapsMap;
}
namespace rx
{
class ContextVk;
namespace vk
{
class Renderer;
constexpr uint32_t kNumVkFormats = …;
enum ImageAccess
{ … };
struct ImageFormatInitInfo final
{ … };
struct BufferFormatInitInfo final
{ … };
VkFormat GetVkFormatFromFormatID(angle::FormatID actualFormatID);
angle::FormatID GetFormatIDFromVkFormat(VkFormat vkFormat);
size_t GetImageCopyBufferAlignment(angle::FormatID actualFormatID);
size_t GetValidImageCopyBufferAlignment(angle::FormatID intendedFormatID,
angle::FormatID actualFormatID);
bool HasEmulatedImageChannels(const angle::Format &intendedFormat,
const angle::Format &actualFormat);
bool HasEmulatedImageFormat(angle::FormatID intendedFormatID, angle::FormatID actualFormatID);
class Format final : private angle::NonCopyable
{ … };
bool operator==(const Format &lhs, const Format &rhs);
bool operator!=(const Format &lhs, const Format &rhs);
class FormatTable final : angle::NonCopyable
{ … };
struct ExternalYuvFormatInfo
{ … };
class ExternalFormatTable final : angle::NonCopyable
{ … };
bool IsYUVExternalFormat(angle::FormatID formatID);
const VkFormatProperties &GetMandatoryFormatSupport(angle::FormatID formatID);
VkImageUsageFlags GetMaximalImageUsageFlags(Renderer *renderer, angle::FormatID formatID);
VkImageCreateFlags GetMinimalImageCreateFlags(Renderer *renderer,
gl::TextureType textureType,
VkImageUsageFlags usage);
}
bool HasFullTextureFormatSupport(vk::Renderer *renderer, angle::FormatID formatID);
bool HasNonRenderableTextureFormatSupport(vk::Renderer *renderer, angle::FormatID formatID);
bool IsETCFormat(angle::FormatID formatID);
bool IsBCFormat(angle::FormatID formatID);
angle::FormatID GetTranscodeBCFormatID(angle::FormatID formatID);
LoadImageFunctionInfo GetEtcToBcTransCodingFunc(angle::FormatID formatID);
gl::SwizzleState GetFormatSwizzle(const angle::Format &angleFormat, const bool sized);
gl::SwizzleState ApplySwizzle(const gl::SwizzleState &formatSwizzle,
const gl::SwizzleState &toApply);
}
#endif