summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-20 10:54:51 -0400
committerGravatar GitHub2018-08-20 10:54:51 -0400
commitce4b77bd7d2b4f9403fb14b9bd1d4200fd9fa4c7 (patch)
treed5e7648a42947e2fb50be20e8c80b0975e949380 /src
parentMerge pull request #1119 from lioncash/uninit (diff)
parentImplemented RGBA8_UINT (diff)
downloadyuzu-ce4b77bd7d2b4f9403fb14b9bd1d4200fd9fa4c7.tar.gz
yuzu-ce4b77bd7d2b4f9403fb14b9bd1d4200fd9fa4c7.tar.xz
yuzu-ce4b77bd7d2b4f9403fb14b9bd1d4200fd9fa4c7.zip
Merge pull request #1120 from ogniK5377/rgba8-uint
Implemented RGBA8_UINT
Diffstat (limited to 'src')
-rw-r--r--src/video_core/gpu.cpp1
-rw-r--r--src/video_core/gpu.h1
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp3
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h98
4 files changed, 58 insertions, 45 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 5a593c1f7..9758adcfd 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -55,6 +55,7 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
55 case RenderTargetFormat::RGBA8_UNORM: 55 case RenderTargetFormat::RGBA8_UNORM:
56 case RenderTargetFormat::RGBA8_SNORM: 56 case RenderTargetFormat::RGBA8_SNORM:
57 case RenderTargetFormat::RGBA8_SRGB: 57 case RenderTargetFormat::RGBA8_SRGB:
58 case RenderTargetFormat::RGBA8_UINT:
58 case RenderTargetFormat::RGB10_A2_UNORM: 59 case RenderTargetFormat::RGB10_A2_UNORM:
59 case RenderTargetFormat::BGRA8_UNORM: 60 case RenderTargetFormat::BGRA8_UNORM:
60 case RenderTargetFormat::RG16_UNORM: 61 case RenderTargetFormat::RG16_UNORM:
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 97dcccb92..2697e1c27 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -30,6 +30,7 @@ enum class RenderTargetFormat : u32 {
30 RGBA8_UNORM = 0xD5, 30 RGBA8_UNORM = 0xD5,
31 RGBA8_SRGB = 0xD6, 31 RGBA8_SRGB = 0xD6,
32 RGBA8_SNORM = 0xD7, 32 RGBA8_SNORM = 0xD7,
33 RGBA8_UINT = 0xD9,
33 RG16_UNORM = 0xDA, 34 RG16_UNORM = 0xDA,
34 RG16_SNORM = 0xDB, 35 RG16_SNORM = 0xDB,
35 RG16_SINT = 0xDC, 36 RG16_SINT = 0xDC,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 38aa067b6..fb7476fb8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -94,6 +94,7 @@ struct FormatTuple {
94static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_format_tuples = {{ 94static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_format_tuples = {{
95 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // ABGR8U 95 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // ABGR8U
96 {GL_RGBA8, GL_RGBA, GL_BYTE, ComponentType::SNorm, false}, // ABGR8S 96 {GL_RGBA8, GL_RGBA, GL_BYTE, ComponentType::SNorm, false}, // ABGR8S
97 {GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, ComponentType::UInt, false}, // ABGR8UI
97 {GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, ComponentType::UNorm, false}, // B5G6R5U 98 {GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, ComponentType::UNorm, false}, // B5G6R5U
98 {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, ComponentType::UNorm, 99 {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, ComponentType::UNorm,
99 false}, // A2B10G10R10U 100 false}, // A2B10G10R10U
@@ -245,6 +246,7 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU
245 // clang-format off 246 // clang-format off
246 MortonCopy<true, PixelFormat::ABGR8U>, 247 MortonCopy<true, PixelFormat::ABGR8U>,
247 MortonCopy<true, PixelFormat::ABGR8S>, 248 MortonCopy<true, PixelFormat::ABGR8S>,
249 MortonCopy<true, PixelFormat::ABGR8UI>,
248 MortonCopy<true, PixelFormat::B5G6R5U>, 250 MortonCopy<true, PixelFormat::B5G6R5U>,
249 MortonCopy<true, PixelFormat::A2B10G10R10U>, 251 MortonCopy<true, PixelFormat::A2B10G10R10U>,
250 MortonCopy<true, PixelFormat::A1B5G5R5U>, 252 MortonCopy<true, PixelFormat::A1B5G5R5U>,
@@ -299,6 +301,7 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU
299 // clang-format off 301 // clang-format off
300 MortonCopy<false, PixelFormat::ABGR8U>, 302 MortonCopy<false, PixelFormat::ABGR8U>,
301 MortonCopy<false, PixelFormat::ABGR8S>, 303 MortonCopy<false, PixelFormat::ABGR8S>,
304 MortonCopy<false, PixelFormat::ABGR8UI>,
302 MortonCopy<false, PixelFormat::B5G6R5U>, 305 MortonCopy<false, PixelFormat::B5G6R5U>,
303 MortonCopy<false, PixelFormat::A2B10G10R10U>, 306 MortonCopy<false, PixelFormat::A2B10G10R10U>,
304 MortonCopy<false, PixelFormat::A1B5G5R5U>, 307 MortonCopy<false, PixelFormat::A1B5G5R5U>,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index beec01746..fc8b44219 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -25,59 +25,60 @@ struct SurfaceParams {
25 enum class PixelFormat { 25 enum class PixelFormat {
26 ABGR8U = 0, 26 ABGR8U = 0,
27 ABGR8S = 1, 27 ABGR8S = 1,
28 B5G6R5U = 2, 28 ABGR8UI = 2,
29 A2B10G10R10U = 3, 29 B5G6R5U = 3,
30 A1B5G5R5U = 4, 30 A2B10G10R10U = 4,
31 R8U = 5, 31 A1B5G5R5U = 5,
32 R8UI = 6, 32 R8U = 6,
33 RGBA16F = 7, 33 R8UI = 7,
34 RGBA16U = 8, 34 RGBA16F = 8,
35 RGBA16UI = 9, 35 RGBA16U = 9,
36 R11FG11FB10F = 10, 36 RGBA16UI = 10,
37 RGBA32UI = 11, 37 R11FG11FB10F = 11,
38 DXT1 = 12, 38 RGBA32UI = 12,
39 DXT23 = 13, 39 DXT1 = 13,
40 DXT45 = 14, 40 DXT23 = 14,
41 DXN1 = 15, // This is also known as BC4 41 DXT45 = 15,
42 DXN2UNORM = 16, 42 DXN1 = 16, // This is also known as BC4
43 DXN2SNORM = 17, 43 DXN2UNORM = 17,
44 BC7U = 18, 44 DXN2SNORM = 18,
45 ASTC_2D_4X4 = 19, 45 BC7U = 19,
46 G8R8U = 20, 46 ASTC_2D_4X4 = 20,
47 G8R8S = 21, 47 G8R8U = 21,
48 BGRA8 = 22, 48 G8R8S = 22,
49 RGBA32F = 23, 49 BGRA8 = 23,
50 RG32F = 24, 50 RGBA32F = 24,
51 R32F = 25, 51 RG32F = 25,
52 R16F = 26, 52 R32F = 26,
53 R16U = 27, 53 R16F = 27,
54 R16S = 28, 54 R16U = 28,
55 R16UI = 29, 55 R16S = 29,
56 R16I = 30, 56 R16UI = 30,
57 RG16 = 31, 57 R16I = 31,
58 RG16F = 32, 58 RG16 = 32,
59 RG16UI = 33, 59 RG16F = 33,
60 RG16I = 34, 60 RG16UI = 34,
61 RG16S = 35, 61 RG16I = 35,
62 RGB32F = 36, 62 RG16S = 36,
63 SRGBA8 = 37, 63 RGB32F = 37,
64 RG8U = 38, 64 SRGBA8 = 38,
65 RG8S = 39, 65 RG8U = 39,
66 RG32UI = 40, 66 RG8S = 40,
67 R32UI = 41, 67 RG32UI = 41,
68 R32UI = 42,
68 69
69 MaxColorFormat, 70 MaxColorFormat,
70 71
71 // Depth formats 72 // Depth formats
72 Z32F = 42, 73 Z32F = 43,
73 Z16 = 43, 74 Z16 = 44,
74 75
75 MaxDepthFormat, 76 MaxDepthFormat,
76 77
77 // DepthStencil formats 78 // DepthStencil formats
78 Z24S8 = 44, 79 Z24S8 = 45,
79 S8Z24 = 45, 80 S8Z24 = 46,
80 Z32FS8 = 46, 81 Z32FS8 = 47,
81 82
82 MaxDepthStencilFormat, 83 MaxDepthStencilFormat,
83 84
@@ -117,6 +118,7 @@ struct SurfaceParams {
117 constexpr std::array<u32, MaxPixelFormat> compression_factor_table = {{ 118 constexpr std::array<u32, MaxPixelFormat> compression_factor_table = {{
118 1, // ABGR8U 119 1, // ABGR8U
119 1, // ABGR8S 120 1, // ABGR8S
121 1, // ABGR8UI
120 1, // B5G6R5U 122 1, // B5G6R5U
121 1, // A2B10G10R10U 123 1, // A2B10G10R10U
122 1, // A1B5G5R5U 124 1, // A1B5G5R5U
@@ -175,6 +177,7 @@ struct SurfaceParams {
175 constexpr std::array<u32, MaxPixelFormat> bpp_table = {{ 177 constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
176 32, // ABGR8U 178 32, // ABGR8U
177 32, // ABGR8S 179 32, // ABGR8S
180 32, // ABGR8UI
178 16, // B5G6R5U 181 16, // B5G6R5U
179 32, // A2B10G10R10U 182 32, // A2B10G10R10U
180 16, // A1B5G5R5U 183 16, // A1B5G5R5U
@@ -257,6 +260,8 @@ struct SurfaceParams {
257 return PixelFormat::ABGR8U; 260 return PixelFormat::ABGR8U;
258 case Tegra::RenderTargetFormat::RGBA8_SNORM: 261 case Tegra::RenderTargetFormat::RGBA8_SNORM:
259 return PixelFormat::ABGR8S; 262 return PixelFormat::ABGR8S;
263 case Tegra::RenderTargetFormat::RGBA8_UINT:
264 return PixelFormat::ABGR8UI;
260 case Tegra::RenderTargetFormat::BGRA8_UNORM: 265 case Tegra::RenderTargetFormat::BGRA8_UNORM:
261 return PixelFormat::BGRA8; 266 return PixelFormat::BGRA8;
262 case Tegra::RenderTargetFormat::RGB10_A2_UNORM: 267 case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
@@ -327,6 +332,8 @@ struct SurfaceParams {
327 return PixelFormat::ABGR8U; 332 return PixelFormat::ABGR8U;
328 case Tegra::Texture::ComponentType::SNORM: 333 case Tegra::Texture::ComponentType::SNORM:
329 return PixelFormat::ABGR8S; 334 return PixelFormat::ABGR8S;
335 case Tegra::Texture::ComponentType::UINT:
336 return PixelFormat::ABGR8UI;
330 } 337 }
331 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", 338 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
332 static_cast<u32>(component_type)); 339 static_cast<u32>(component_type));
@@ -551,6 +558,7 @@ struct SurfaceParams {
551 case Tegra::RenderTargetFormat::R16_UINT: 558 case Tegra::RenderTargetFormat::R16_UINT:
552 case Tegra::RenderTargetFormat::RG32_UINT: 559 case Tegra::RenderTargetFormat::RG32_UINT:
553 case Tegra::RenderTargetFormat::R32_UINT: 560 case Tegra::RenderTargetFormat::R32_UINT:
561 case Tegra::RenderTargetFormat::RGBA8_UINT:
554 return ComponentType::UInt; 562 return ComponentType::UInt;
555 case Tegra::RenderTargetFormat::RG16_SINT: 563 case Tegra::RenderTargetFormat::RG16_SINT:
556 case Tegra::RenderTargetFormat::R16_SINT: 564 case Tegra::RenderTargetFormat::R16_SINT: