summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-06-30 09:13:46 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-07-13 06:01:09 +0200
commite849d680480e07e430793fd9657a08b676655803 (patch)
tree640b2cfed02f0e67750ff4ec4c8fc15e909a099f
parentvideo_core: Implement R8_SINT render target (diff)
downloadyuzu-e849d680480e07e430793fd9657a08b676655803.tar
yuzu-e849d680480e07e430793fd9657a08b676655803.tar.gz
yuzu-e849d680480e07e430793fd9657a08b676655803.tar.bz2
yuzu-e849d680480e07e430793fd9657a08b676655803.tar.lz
yuzu-e849d680480e07e430793fd9657a08b676655803.tar.xz
yuzu-e849d680480e07e430793fd9657a08b676655803.tar.zst
yuzu-e849d680480e07e430793fd9657a08b676655803.zip
-rw-r--r--src/video_core/gpu.h1
-rw-r--r--src/video_core/morton.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp3
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp1
-rw-r--r--src/video_core/renderer_vulkan/vk_device.cpp1
-rw-r--r--src/video_core/surface.cpp2
-rw-r--r--src/video_core/surface.h5
7 files changed, 14 insertions, 1 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 1e5d2ffcc..a6f846f3c 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -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,
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 790360d4d..9e50aa11d 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -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>,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 553db1cb1..ef1729894 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -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
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 645cb92ca..43264ce14 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -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
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index 59c5f9ea5..06c6169dc 100644
--- a/src/video_core/renderer_vulkan/vk_device.cpp
+++ b/src/video_core/renderer_vulkan/vk_device.cpp
@@ -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,
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index f132f1b43..1f12163fe 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -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:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index a6cac3bf9..6999d9dc3 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -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