video_core: Implement RG8_SINT render target and fix RG8_UINT

This commit is contained in:
ReinUsesLisp 2020-06-30 04:13:46 -03:00
parent f29fede49c
commit e849d68048
7 changed files with 14 additions and 1 deletions

View file

@ -68,6 +68,7 @@ enum class RenderTargetFormat : u32 {
BGR5A1_UNORM = 0xE9,
RG8_UNORM = 0xEA,
RG8_SNORM = 0xEB,
RG8_SINT = 0xEC,
RG8_UINT = 0xED,
R16_UNORM = 0xEE,
R16_SNORM = 0xEF,

View file

@ -85,6 +85,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
MortonCopy<true, PixelFormat::RGBA8_SRGB>,
MortonCopy<true, PixelFormat::RG8U>,
MortonCopy<true, PixelFormat::RG8S>,
MortonCopy<true, PixelFormat::RG8I>,
MortonCopy<true, PixelFormat::RG8UI>,
MortonCopy<true, PixelFormat::RG32UI>,
MortonCopy<true, PixelFormat::RGBX16F>,
@ -171,6 +172,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
MortonCopy<false, PixelFormat::RGBA8_SRGB>,
MortonCopy<false, PixelFormat::RG8U>,
MortonCopy<false, PixelFormat::RG8S>,
MortonCopy<false, PixelFormat::RG8I>,
MortonCopy<false, PixelFormat::RG8UI>,
MortonCopy<false, PixelFormat::RG32UI>,
MortonCopy<false, PixelFormat::RGBX16F>,

View file

@ -85,7 +85,8 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
{GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // RGBA8_SRGB
{GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, // RG8U
{GL_RG8_SNORM, GL_RG, GL_BYTE}, // RG8S
{GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, // RG8UI
{GL_RG8I, GL_RG_INTEGER, GL_BYTE}, // RG8I
{GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE}, // RG8UI
{GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, // RG32UI
{GL_RGB16F, GL_RGBA, GL_HALF_FLOAT}, // RGBX16F
{GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, // R32UI

View file

@ -161,6 +161,7 @@ struct FormatTuple {
{VK_FORMAT_R8G8B8A8_SRGB, Attachable}, // RGBA8_SRGB
{VK_FORMAT_R8G8_UNORM, Attachable | Storage}, // RG8U
{VK_FORMAT_R8G8_SNORM, Attachable | Storage}, // RG8S
{VK_FORMAT_R8G8_SINT, Attachable | Storage}, // RG8I
{VK_FORMAT_R8G8_UINT, Attachable | Storage}, // RG8UI
{VK_FORMAT_R32G32_UINT, Attachable | Storage}, // RG32UI
{VK_FORMAT_UNDEFINED}, // RGBX16F

View file

@ -96,6 +96,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
VK_FORMAT_R8G8B8A8_SRGB,
VK_FORMAT_R8G8_UNORM,
VK_FORMAT_R8G8_SNORM,
VK_FORMAT_R8G8_SINT,
VK_FORMAT_R8G8_UINT,
VK_FORMAT_R8_UNORM,
VK_FORMAT_R8_SNORM,

View file

@ -150,6 +150,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
return PixelFormat::RG8U;
case Tegra::RenderTargetFormat::RG8_SNORM:
return PixelFormat::RG8S;
case Tegra::RenderTargetFormat::RG8_SINT:
return PixelFormat::RG8I;
case Tegra::RenderTargetFormat::RG8_UINT:
return PixelFormat::RG8UI;
case Tegra::RenderTargetFormat::R16_UNORM:

View file

@ -59,6 +59,7 @@ enum class PixelFormat {
RGBA8_SRGB,
RG8U,
RG8S,
RG8I,
RG8UI,
RG32UI,
RGBX16F,
@ -176,6 +177,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
0, // RGBA8_SRGB
0, // RG8U
0, // RG8S
0, // RG8I
0, // RG8UI
0, // RG32UI
0, // RGBX16F
@ -277,6 +279,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
1, // RGBA8_SRGB
1, // RG8U
1, // RG8S
1, // RG8I
1, // RG8UI
1, // RG32UI
1, // RGBX16F
@ -370,6 +373,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
1, // RGBA8_SRGB
1, // RG8U
1, // RG8S
1, // RG8I
1, // RG8UI
1, // RG32UI
1, // RGBX16F
@ -463,6 +467,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
32, // RGBA8_SRGB
16, // RG8U
16, // RG8S
16, // RG8I
16, // RG8UI
64, // RG32UI
64, // RGBX16F