summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-06-30 09:23:03 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-07-13 06:01:09 +0200
commit50c6030a8dc19454f558ba38562aed44b8c294f2 (patch)
tree9b36c6358ff0fe662f0f5b08125a2c2b28ebcbd4 /src/video_core
parentvideo_core: Implement RG8_SINT render target and fix RG8_UINT (diff)
downloadyuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar.gz
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar.bz2
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar.lz
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar.xz
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.tar.zst
yuzu-50c6030a8dc19454f558ba38562aed44b8c294f2.zip
Diffstat (limited to 'src/video_core')
-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.cpp1
-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, 13 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index a6f846f3c..b0a2ad21b 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -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,
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 9e50aa11d..f932df53f 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -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>,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index ef1729894..1d7824324 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -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
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 43264ce14..4086d1bb6 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -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
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index 06c6169dc..e1128efe6 100644
--- a/src/video_core/renderer_vulkan/vk_device.cpp
+++ b/src/video_core/renderer_vulkan/vk_device.cpp
@@ -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,
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 1f12163fe..13e598972 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -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:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 6999d9dc3..3e9dd797a 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -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