video_core: Implement RG32_SINT render target

master
ReinUsesLisp 2020-06-30 04:23:03 +07:00
parent e849d68048
commit 50c6030a8d
7 changed files with 13 additions and 0 deletions

@ -46,6 +46,7 @@ enum class RenderTargetFormat : u32 {
RGBA16_UINT = 0xC9,
RGBA16_FLOAT = 0xCA,
RG32_FLOAT = 0xCB,
RG32_SINT = 0xCC,
RG32_UINT = 0xCD,
RGBX16_FLOAT = 0xCE,
BGRA8_UNORM = 0xCF,

@ -70,6 +70,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
MortonCopy<true, PixelFormat::BGRA8>,
MortonCopy<true, PixelFormat::RGBA32F>,
MortonCopy<true, PixelFormat::RG32F>,
MortonCopy<true, PixelFormat::RG32I>,
MortonCopy<true, PixelFormat::R32F>,
MortonCopy<true, PixelFormat::R16F>,
MortonCopy<true, PixelFormat::R16U>,
@ -157,6 +158,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
MortonCopy<false, PixelFormat::BGRA8>,
MortonCopy<false, PixelFormat::RGBA32F>,
MortonCopy<false, PixelFormat::RG32F>,
MortonCopy<false, PixelFormat::RG32I>,
MortonCopy<false, PixelFormat::R32F>,
MortonCopy<false, PixelFormat::R16F>,
MortonCopy<false, PixelFormat::R16U>,

@ -70,6 +70,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
{GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE}, // BGRA8
{GL_RGBA32F, GL_RGBA, GL_FLOAT}, // RGBA32F
{GL_RG32F, GL_RG, GL_FLOAT}, // RG32F
{GL_RG32I, GL_RG_INTEGER, GL_INT}, // RG32I
{GL_R32F, GL_RED, GL_FLOAT}, // R32F
{GL_R16F, GL_RED, GL_HALF_FLOAT}, // R16F
{GL_R16, GL_RED, GL_UNSIGNED_SHORT}, // R16U

@ -146,6 +146,7 @@ struct FormatTuple {
{VK_FORMAT_B8G8R8A8_UNORM, Attachable}, // BGRA8
{VK_FORMAT_R32G32B32A32_SFLOAT, Attachable | Storage}, // RGBA32F
{VK_FORMAT_R32G32_SFLOAT, Attachable | Storage}, // RG32F
{VK_FORMAT_R32G32_SINT, Attachable | Storage}, // RG32I
{VK_FORMAT_R32_SFLOAT, Attachable | Storage}, // R32F
{VK_FORMAT_R16_SFLOAT, Attachable | Storage}, // R16F
{VK_FORMAT_R16_UNORM, Attachable | Storage}, // R16U

@ -84,6 +84,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
VK_FORMAT_R32G32B32A32_SFLOAT,
VK_FORMAT_R32G32B32A32_UINT,
VK_FORMAT_R32G32_SFLOAT,
VK_FORMAT_R32G32_SINT,
VK_FORMAT_R32G32_UINT,
VK_FORMAT_R16G16B16A16_UINT,
VK_FORMAT_R16G16B16A16_SNORM,

@ -106,6 +106,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
return PixelFormat::RGBA16F;
case Tegra::RenderTargetFormat::RG32_FLOAT:
return PixelFormat::RG32F;
case Tegra::RenderTargetFormat::RG32_SINT:
return PixelFormat::RG32I;
case Tegra::RenderTargetFormat::RG32_UINT:
return PixelFormat::RG32UI;
case Tegra::RenderTargetFormat::RGBX16_FLOAT:

@ -44,6 +44,7 @@ enum class PixelFormat {
BGRA8,
RGBA32F,
RG32F,
RG32I,
R32F,
R16F,
R16U,
@ -162,6 +163,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
0, // BGRA8
0, // RGBA32F
0, // RG32F
0, // RG32I
0, // R32F
0, // R16F
0, // R16U
@ -264,6 +266,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
1, // BGRA8
1, // RGBA32F
1, // RG32F
1, // RG32I
1, // R32F
1, // R16F
1, // R16U
@ -358,6 +361,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
1, // BGRA8
1, // RGBA32F
1, // RG32F
1, // RG32I
1, // R32F
1, // R16F
1, // R16U
@ -452,6 +456,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
32, // BGRA8
128, // RGBA32F
64, // RG32F
64, // RG32I
32, // R32F
16, // R16F
16, // R16U