yuzu-emu
/
yuzu
Archived
1
0
Fork 0

video_core: Implement R8_SINT render target

This commit is contained in:
ReinUsesLisp 2020-06-30 04:00:23 -03:00
parent fd33e996e0
commit f29fede49c
7 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,7 @@ enum class RenderTargetFormat : u32 {
R16_FLOAT = 0xF2, R16_FLOAT = 0xF2,
R8_UNORM = 0xF3, R8_UNORM = 0xF3,
R8_SNORM = 0xF4, R8_SNORM = 0xF4,
R8_SINT = 0xF5,
R8_UINT = 0xF6, R8_UINT = 0xF6,
}; };

View File

@ -49,6 +49,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
MortonCopy<true, PixelFormat::A1B5G5R5U>, MortonCopy<true, PixelFormat::A1B5G5R5U>,
MortonCopy<true, PixelFormat::R8U>, MortonCopy<true, PixelFormat::R8U>,
MortonCopy<true, PixelFormat::R8S>, MortonCopy<true, PixelFormat::R8S>,
MortonCopy<true, PixelFormat::R8I>,
MortonCopy<true, PixelFormat::R8UI>, MortonCopy<true, PixelFormat::R8UI>,
MortonCopy<true, PixelFormat::RGBA16F>, MortonCopy<true, PixelFormat::RGBA16F>,
MortonCopy<true, PixelFormat::RGBA16U>, MortonCopy<true, PixelFormat::RGBA16U>,
@ -133,6 +134,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
MortonCopy<false, PixelFormat::A1B5G5R5U>, MortonCopy<false, PixelFormat::A1B5G5R5U>,
MortonCopy<false, PixelFormat::R8U>, MortonCopy<false, PixelFormat::R8U>,
MortonCopy<false, PixelFormat::R8S>, MortonCopy<false, PixelFormat::R8S>,
MortonCopy<false, PixelFormat::R8I>,
MortonCopy<false, PixelFormat::R8UI>, MortonCopy<false, PixelFormat::R8UI>,
MortonCopy<false, PixelFormat::RGBA16F>, MortonCopy<false, PixelFormat::RGBA16F>,
MortonCopy<false, PixelFormat::RGBA16S>, MortonCopy<false, PixelFormat::RGBA16S>,

View File

@ -49,6 +49,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
{GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // A1B5G5R5U {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // A1B5G5R5U
{GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // R8U {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // R8U
{GL_R8_SNORM, GL_RED, GL_BYTE}, // R8S {GL_R8_SNORM, GL_RED, GL_BYTE}, // R8S
{GL_R8I, GL_RED_INTEGER, GL_BYTE}, // R8I
{GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, // R8UI {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, // R8UI
{GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F
{GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U

View File

@ -125,6 +125,7 @@ struct FormatTuple {
{VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // A1B5G5R5U (flipped with swizzle) {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // A1B5G5R5U (flipped with swizzle)
{VK_FORMAT_R8_UNORM, Attachable | Storage}, // R8U {VK_FORMAT_R8_UNORM, Attachable | Storage}, // R8U
{VK_FORMAT_R8_SNORM, Attachable | Storage}, // R8S {VK_FORMAT_R8_SNORM, Attachable | Storage}, // R8S
{VK_FORMAT_R8_SINT, Attachable | Storage}, // R8I
{VK_FORMAT_R8_UINT, Attachable | Storage}, // R8UI {VK_FORMAT_R8_UINT, Attachable | Storage}, // R8UI
{VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F {VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F
{VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U {VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U

View File

@ -99,6 +99,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UINT,
VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM,
VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SNORM,
VK_FORMAT_R8_SINT,
VK_FORMAT_R8_UINT, VK_FORMAT_R8_UINT,
VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10G11R11_UFLOAT_PACK32,
VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SFLOAT,

View File

@ -166,6 +166,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
return PixelFormat::R8U; return PixelFormat::R8U;
case Tegra::RenderTargetFormat::R8_SNORM: case Tegra::RenderTargetFormat::R8_SNORM:
return PixelFormat::R8S; return PixelFormat::R8S;
case Tegra::RenderTargetFormat::R8_SINT:
return PixelFormat::R8I;
case Tegra::RenderTargetFormat::R8_UINT: case Tegra::RenderTargetFormat::R8_UINT:
return PixelFormat::R8UI; return PixelFormat::R8UI;
default: default:

View File

@ -23,6 +23,7 @@ enum class PixelFormat {
A1B5G5R5U, A1B5G5R5U,
R8U, R8U,
R8S, R8S,
R8I,
R8UI, R8UI,
RGBA16F, RGBA16F,
RGBA16U, RGBA16U,
@ -139,6 +140,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
0, // A1B5G5R5U 0, // A1B5G5R5U
0, // R8U 0, // R8U
0, // R8S 0, // R8S
0, // R8I
0, // R8UI 0, // R8UI
0, // RGBA16F 0, // RGBA16F
0, // RGBA16U 0, // RGBA16U
@ -239,6 +241,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
1, // A1B5G5R5U 1, // A1B5G5R5U
1, // R8U 1, // R8U
1, // R8S 1, // R8S
1, // R8I
1, // R8UI 1, // R8UI
1, // RGBA16F 1, // RGBA16F
1, // RGBA16U 1, // RGBA16U
@ -331,6 +334,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
1, // A1B5G5R5U 1, // A1B5G5R5U
1, // R8U 1, // R8U
1, // R8S 1, // R8S
1, // R8I
1, // R8UI 1, // R8UI
1, // RGBA16F 1, // RGBA16F
1, // RGBA16U 1, // RGBA16U
@ -423,6 +427,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
16, // A1B5G5R5U 16, // A1B5G5R5U
8, // R8U 8, // R8U
8, // R8S 8, // R8S
8, // R8I
8, // R8UI 8, // R8UI
64, // RGBA16F 64, // RGBA16F
64, // RGBA16U 64, // RGBA16U