2019-03-02 22:34:11 +01:00
|
|
|
// Copyright 2019 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "video_core/engines/maxwell_3d.h"
|
|
|
|
#include "video_core/renderer_vulkan/vk_device.h"
|
|
|
|
#include "video_core/surface.h"
|
|
|
|
#include "video_core/textures/texture.h"
|
2020-12-25 01:30:11 +01:00
|
|
|
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
2019-03-02 22:34:11 +01:00
|
|
|
|
|
|
|
namespace Vulkan::MaxwellToVK {
|
|
|
|
|
|
|
|
using Maxwell = Tegra::Engines::Maxwell3D::Regs;
|
|
|
|
using PixelFormat = VideoCore::Surface::PixelFormat;
|
|
|
|
|
|
|
|
namespace Sampler {
|
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkFilter Filter(Tegra::Texture::TextureFilter filter);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode wrap_mode,
|
|
|
|
Tegra::Texture::TextureFilter filter);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
|
|
|
} // namespace Sampler
|
|
|
|
|
2019-12-13 06:44:45 +01:00
|
|
|
struct FormatInfo {
|
2020-03-27 05:33:21 +01:00
|
|
|
VkFormat format;
|
2019-12-13 06:44:45 +01:00
|
|
|
bool attachable;
|
|
|
|
bool storage;
|
|
|
|
};
|
|
|
|
|
|
|
|
FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFormat pixel_format);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkPrimitiveTopology PrimitiveTopology(const VKDevice& device, Maxwell::PrimitiveTopology topology);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkStencilOp StencilOp(Maxwell::StencilOp stencil_op);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkBlendOp BlendEquation(Maxwell::Blend::Equation equation);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkBlendFactor BlendFactor(Maxwell::Blend::Factor factor);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkFrontFace FrontFace(Maxwell::FrontFace front_face);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkCullModeFlags CullFace(Maxwell::CullFace cull_face);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-03-27 05:33:21 +01:00
|
|
|
VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle);
|
2019-03-02 22:34:11 +01:00
|
|
|
|
2020-05-04 23:31:17 +02:00
|
|
|
VkViewportCoordinateSwizzleNV ViewportSwizzle(Maxwell::ViewportSwizzle swizzle);
|
|
|
|
|
2020-12-30 06:25:23 +01:00
|
|
|
VkSamplerReductionMode SamplerReduction(Tegra::Texture::SamplerReduction reduction);
|
|
|
|
|
2019-03-02 22:34:11 +01:00
|
|
|
} // namespace Vulkan::MaxwellToVK
|