summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-06-30 09:46:07 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-07-13 06:01:09 +0200
commit9338599d7246a954a1ce25a7e97d80bc1062e1d9 (patch)
treea73b07e4d3fac447c3bafe41e493366fde6f023b /src/video_core
parentvideo_core: Implement RGBA16_SINT render target (diff)
downloadyuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar.gz
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar.bz2
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar.lz
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar.xz
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.tar.zst
yuzu-9338599d7246a954a1ce25a7e97d80bc1062e1d9.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 4a47862ce..102f528c5 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -40,6 +40,7 @@ namespace Tegra {
enum class RenderTargetFormat : u32 {
NONE = 0x0,
RGBA32_FLOAT = 0xC0,
+ RGBA32_SINT = 0xC1,
RGBA32_UINT = 0xC2,
RGBA16_UNORM = 0xC6,
RGBA16_SNORM = 0xC7,
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index c7c8f2238..18bcb60b0 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -71,6 +71,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
MortonCopy<true, PixelFormat::ASTC_2D_4X4>,
MortonCopy<true, PixelFormat::BGRA8>,
MortonCopy<true, PixelFormat::RGBA32F>,
+ MortonCopy<true, PixelFormat::RGBA32I>,
MortonCopy<true, PixelFormat::RG32F>,
MortonCopy<true, PixelFormat::RG32I>,
MortonCopy<true, PixelFormat::R32F>,
@@ -161,6 +162,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
nullptr,
MortonCopy<false, PixelFormat::BGRA8>,
MortonCopy<false, PixelFormat::RGBA32F>,
+ MortonCopy<false, PixelFormat::RGBA32I>,
MortonCopy<false, PixelFormat::RG32F>,
MortonCopy<false, PixelFormat::RG32I>,
MortonCopy<false, PixelFormat::R32F>,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index ff67ac813..de1e05cd2 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -71,6 +71,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
{GL_COMPRESSED_RGBA_ASTC_4x4_KHR}, // ASTC_2D_4X4
{GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE}, // BGRA8
{GL_RGBA32F, GL_RGBA, GL_FLOAT}, // RGBA32F
+ {GL_RGBA32I, GL_RGBA_INTEGER, GL_INT}, // RGBA32I
{GL_RG32F, GL_RG, GL_FLOAT}, // RG32F
{GL_RG32I, GL_RG_INTEGER, GL_INT}, // RG32I
{GL_R32F, GL_RED, GL_FLOAT}, // R32F
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index e79e0645d..bab9f485f 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -147,6 +147,7 @@ struct FormatTuple {
{VK_FORMAT_ASTC_4x4_UNORM_BLOCK}, // ASTC_2D_4X4
{VK_FORMAT_B8G8R8A8_UNORM, Attachable}, // BGRA8
{VK_FORMAT_R32G32B32A32_SFLOAT, Attachable | Storage}, // RGBA32F
+ {VK_FORMAT_R32G32B32A32_SINT, Attachable | Storage}, // RGBA32I
{VK_FORMAT_R32G32_SFLOAT, Attachable | Storage}, // RG32F
{VK_FORMAT_R32G32_SINT, Attachable | Storage}, // RG32I
{VK_FORMAT_R32_SFLOAT, Attachable | Storage}, // R32F
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index a61a94c6c..173957533 100644
--- a/src/video_core/renderer_vulkan/vk_device.cpp
+++ b/src/video_core/renderer_vulkan/vk_device.cpp
@@ -83,6 +83,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
VK_FORMAT_A2B10G10R10_UNORM_PACK32,
VK_FORMAT_A1R5G5B5_UNORM_PACK16,
VK_FORMAT_R32G32B32A32_SFLOAT,
+ VK_FORMAT_R32G32B32A32_SINT,
VK_FORMAT_R32G32B32A32_UINT,
VK_FORMAT_R32G32_SFLOAT,
VK_FORMAT_R32G32_SINT,
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 9c19e2838..b287fe83f 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -94,6 +94,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
switch (format) {
case Tegra::RenderTargetFormat::RGBA32_FLOAT:
return PixelFormat::RGBA32F;
+ case Tegra::RenderTargetFormat::RGBA32_SINT:
+ return PixelFormat::RGBA32I;
case Tegra::RenderTargetFormat::RGBA32_UINT:
return PixelFormat::RGBA32UI;
case Tegra::RenderTargetFormat::RGBA16_UNORM:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 27d447cb9..a564a00e9 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -45,6 +45,7 @@ enum class PixelFormat {
ASTC_2D_4X4,
BGRA8,
RGBA32F,
+ RGBA32I,
RG32F,
RG32I,
R32F,
@@ -166,6 +167,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
2, // ASTC_2D_4X4
0, // BGRA8
0, // RGBA32F
+ 0, // RGBA32I
0, // RG32F
0, // RG32I
0, // R32F
@@ -271,6 +273,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
4, // ASTC_2D_4X4
1, // BGRA8
1, // RGBA32F
+ 1, // RGBA32I
1, // RG32F
1, // RG32I
1, // R32F
@@ -368,6 +371,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
4, // ASTC_2D_4X4
1, // BGRA8
1, // RGBA32F
+ 1, // RGBA32I
1, // RG32F
1, // RG32I
1, // R32F
@@ -465,6 +469,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
128, // ASTC_2D_4X4
32, // BGRA8
128, // RGBA32F
+ 128, // RGBA32I
64, // RG32F
64, // RG32I
32, // R32F