video_core: Implement RGBA8_SINT render target

This commit is contained in:
ReinUsesLisp 2020-06-30 04:31:48 -03:00
parent 50c6030a8d
commit 977d6c46f3
7 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,7 @@ enum class RenderTargetFormat : u32 {
RGBA8_UNORM = 0xD5,
RGBA8_SRGB = 0xD6,
RGBA8_SNORM = 0xD7,
RGBA8_SINT = 0xD8,
RGBA8_UINT = 0xD9,
RG16_UNORM = 0xDA,
RG16_SNORM = 0xDB,

View File

@ -43,6 +43,7 @@ static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth
static constexpr ConversionArray morton_to_linear_fns = {
MortonCopy<true, PixelFormat::ABGR8U>,
MortonCopy<true, PixelFormat::ABGR8S>,
MortonCopy<true, PixelFormat::ABGR8I>,
MortonCopy<true, PixelFormat::ABGR8UI>,
MortonCopy<true, PixelFormat::B5G6R5U>,
MortonCopy<true, PixelFormat::A2B10G10R10U>,
@ -130,6 +131,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
static constexpr ConversionArray linear_to_morton_fns = {
MortonCopy<false, PixelFormat::ABGR8U>,
MortonCopy<false, PixelFormat::ABGR8S>,
MortonCopy<false, PixelFormat::ABGR8I>,
MortonCopy<false, PixelFormat::ABGR8UI>,
MortonCopy<false, PixelFormat::B5G6R5U>,
MortonCopy<false, PixelFormat::A2B10G10R10U>,

View File

@ -43,6 +43,7 @@ struct FormatTuple {
constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format_tuples = {{
{GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // ABGR8U
{GL_RGBA8_SNORM, GL_RGBA, GL_BYTE}, // ABGR8S
{GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE}, // ABGR8I
{GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE}, // ABGR8UI
{GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV}, // B5G6R5U
{GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10U

View File

@ -119,6 +119,7 @@ struct FormatTuple {
} constexpr tex_format_tuples[] = {
{VK_FORMAT_A8B8G8R8_UNORM_PACK32, Attachable | Storage}, // ABGR8U
{VK_FORMAT_A8B8G8R8_SNORM_PACK32, Attachable | Storage}, // ABGR8S
{VK_FORMAT_A8B8G8R8_SINT_PACK32, Attachable | Storage}, // ABGR8I
{VK_FORMAT_A8B8G8R8_UINT_PACK32, Attachable | Storage}, // ABGR8UI
{VK_FORMAT_B5G6R5_UNORM_PACK16}, // B5G6R5U
{VK_FORMAT_A2B10G10R10_UNORM_PACK32, Attachable | Storage}, // A2B10G10R10U

View File

@ -77,6 +77,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
VK_FORMAT_A8B8G8R8_UNORM_PACK32,
VK_FORMAT_A8B8G8R8_UINT_PACK32,
VK_FORMAT_A8B8G8R8_SNORM_PACK32,
VK_FORMAT_A8B8G8R8_SINT_PACK32,
VK_FORMAT_A8B8G8R8_SRGB_PACK32,
VK_FORMAT_B5G6R5_UNORM_PACK16,
VK_FORMAT_A2B10G10R10_UNORM_PACK32,

View File

@ -124,6 +124,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
return PixelFormat::RGBA8_SRGB;
case Tegra::RenderTargetFormat::RGBA8_SNORM:
return PixelFormat::ABGR8S;
case Tegra::RenderTargetFormat::RGBA8_SINT:
return PixelFormat::ABGR8I;
case Tegra::RenderTargetFormat::RGBA8_UINT:
return PixelFormat::ABGR8UI;
case Tegra::RenderTargetFormat::RG16_UNORM:

View File

@ -17,6 +17,7 @@ namespace VideoCore::Surface {
enum class PixelFormat {
ABGR8U,
ABGR8S,
ABGR8I,
ABGR8UI,
B5G6R5U,
A2B10G10R10U,
@ -136,6 +137,7 @@ enum class SurfaceTarget {
constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
0, // ABGR8U
0, // ABGR8S
0, // ABGR8I
0, // ABGR8UI
0, // B5G6R5U
0, // A2B10G10R10U
@ -239,6 +241,7 @@ inline constexpr u32 GetCompressionFactor(PixelFormat format) {
constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
1, // ABGR8U
1, // ABGR8S
1, // ABGR8I
1, // ABGR8UI
1, // B5G6R5U
1, // A2B10G10R10U
@ -334,6 +337,7 @@ static constexpr u32 GetDefaultBlockWidth(PixelFormat format) {
constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
1, // ABGR8U
1, // ABGR8S
1, // ABGR8I
1, // ABGR8UI
1, // B5G6R5U
1, // A2B10G10R10U
@ -429,6 +433,7 @@ static constexpr u32 GetDefaultBlockHeight(PixelFormat format) {
constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
32, // ABGR8U
32, // ABGR8S
32, // ABGR8I
32, // ABGR8UI
16, // B5G6R5U
32, // A2B10G10R10U