diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/gpu.h | 1 | ||||
| -rw-r--r-- | src/video_core/morton.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 17 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/surface.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/surface.h | 79 | ||||
| -rw-r--r-- | src/video_core/texture_cache/format_lookup_table.cpp | 3 |
8 files changed, 66 insertions, 40 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index dd51c95b7..a1b4c305c 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -68,6 +68,7 @@ enum class RenderTargetFormat : u32 { | |||
| 68 | BGR5A1_UNORM = 0xE9, | 68 | BGR5A1_UNORM = 0xE9, |
| 69 | RG8_UNORM = 0xEA, | 69 | RG8_UNORM = 0xEA, |
| 70 | RG8_SNORM = 0xEB, | 70 | RG8_SNORM = 0xEB, |
| 71 | RG8_UINT = 0xED, | ||
| 71 | R16_UNORM = 0xEE, | 72 | R16_UNORM = 0xEE, |
| 72 | R16_SNORM = 0xEF, | 73 | R16_SNORM = 0xEF, |
| 73 | R16_SINT = 0xF0, | 74 | R16_SINT = 0xF0, |
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp index 6d522c318..836b25c1d 100644 --- a/src/video_core/morton.cpp +++ b/src/video_core/morton.cpp | |||
| @@ -83,6 +83,7 @@ static constexpr ConversionArray morton_to_linear_fns = { | |||
| 83 | MortonCopy<true, PixelFormat::RGBA8_SRGB>, | 83 | MortonCopy<true, PixelFormat::RGBA8_SRGB>, |
| 84 | MortonCopy<true, PixelFormat::RG8U>, | 84 | MortonCopy<true, PixelFormat::RG8U>, |
| 85 | MortonCopy<true, PixelFormat::RG8S>, | 85 | MortonCopy<true, PixelFormat::RG8S>, |
| 86 | MortonCopy<true, PixelFormat::RG8UI>, | ||
| 86 | MortonCopy<true, PixelFormat::RG32UI>, | 87 | MortonCopy<true, PixelFormat::RG32UI>, |
| 87 | MortonCopy<true, PixelFormat::RGBX16F>, | 88 | MortonCopy<true, PixelFormat::RGBX16F>, |
| 88 | MortonCopy<true, PixelFormat::R32UI>, | 89 | MortonCopy<true, PixelFormat::R32UI>, |
| @@ -166,6 +167,7 @@ static constexpr ConversionArray linear_to_morton_fns = { | |||
| 166 | MortonCopy<false, PixelFormat::RGBA8_SRGB>, | 167 | MortonCopy<false, PixelFormat::RGBA8_SRGB>, |
| 167 | MortonCopy<false, PixelFormat::RG8U>, | 168 | MortonCopy<false, PixelFormat::RG8U>, |
| 168 | MortonCopy<false, PixelFormat::RG8S>, | 169 | MortonCopy<false, PixelFormat::RG8S>, |
| 170 | MortonCopy<false, PixelFormat::RG8UI>, | ||
| 169 | MortonCopy<false, PixelFormat::RG32UI>, | 171 | MortonCopy<false, PixelFormat::RG32UI>, |
| 170 | MortonCopy<false, PixelFormat::RGBX16F>, | 172 | MortonCopy<false, PixelFormat::RGBX16F>, |
| 171 | MortonCopy<false, PixelFormat::R32UI>, | 173 | MortonCopy<false, PixelFormat::R32UI>, |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 2729d1265..94fbd2a22 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -83,6 +83,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format | |||
| 83 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // RGBA8_SRGB | 83 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // RGBA8_SRGB |
| 84 | {GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, // RG8U | 84 | {GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, // RG8U |
| 85 | {GL_RG8_SNORM, GL_RG, GL_BYTE}, // RG8S | 85 | {GL_RG8_SNORM, GL_RG, GL_BYTE}, // RG8S |
| 86 | {GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, // RG8UI | ||
| 86 | {GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, // RG32UI | 87 | {GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, // RG32UI |
| 87 | {GL_RGB16F, GL_RGBA, GL_HALF_FLOAT}, // RGBX16F | 88 | {GL_RGB16F, GL_RGBA, GL_HALF_FLOAT}, // RGBX16F |
| 88 | {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, // R32UI | 89 | {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 850165606..12be691a5 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -160,6 +160,7 @@ struct FormatTuple { | |||
| 160 | {VK_FORMAT_R8G8B8A8_SRGB, Attachable}, // RGBA8_SRGB | 160 | {VK_FORMAT_R8G8B8A8_SRGB, Attachable}, // RGBA8_SRGB |
| 161 | {VK_FORMAT_R8G8_UNORM, Attachable | Storage}, // RG8U | 161 | {VK_FORMAT_R8G8_UNORM, Attachable | Storage}, // RG8U |
| 162 | {VK_FORMAT_R8G8_SNORM, Attachable | Storage}, // RG8S | 162 | {VK_FORMAT_R8G8_SNORM, Attachable | Storage}, // RG8S |
| 163 | {VK_FORMAT_R8G8_UINT, Attachable | Storage}, // RG8UI | ||
| 163 | {VK_FORMAT_R32G32_UINT, Attachable | Storage}, // RG32UI | 164 | {VK_FORMAT_R32G32_UINT, Attachable | Storage}, // RG32UI |
| 164 | {VK_FORMAT_UNDEFINED}, // RGBX16F | 165 | {VK_FORMAT_UNDEFINED}, // RGBX16F |
| 165 | {VK_FORMAT_R32_UINT, Attachable | Storage}, // R32UI | 166 | {VK_FORMAT_R32_UINT, Attachable | Storage}, // R32UI |
| @@ -345,8 +346,6 @@ VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrib | |||
| 345 | break; | 346 | break; |
| 346 | case Maxwell::VertexAttribute::Type::SignedInt: | 347 | case Maxwell::VertexAttribute::Type::SignedInt: |
| 347 | switch (size) { | 348 | switch (size) { |
| 348 | case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | ||
| 349 | return VK_FORMAT_R16G16B16A16_SINT; | ||
| 350 | case Maxwell::VertexAttribute::Size::Size_8: | 349 | case Maxwell::VertexAttribute::Size::Size_8: |
| 351 | return VK_FORMAT_R8_SINT; | 350 | return VK_FORMAT_R8_SINT; |
| 352 | case Maxwell::VertexAttribute::Size::Size_8_8: | 351 | case Maxwell::VertexAttribute::Size::Size_8_8: |
| @@ -355,8 +354,22 @@ VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrib | |||
| 355 | return VK_FORMAT_R8G8B8_SINT; | 354 | return VK_FORMAT_R8G8B8_SINT; |
| 356 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | 355 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: |
| 357 | return VK_FORMAT_R8G8B8A8_SINT; | 356 | return VK_FORMAT_R8G8B8A8_SINT; |
| 357 | case Maxwell::VertexAttribute::Size::Size_16: | ||
| 358 | return VK_FORMAT_R16_SINT; | ||
| 359 | case Maxwell::VertexAttribute::Size::Size_16_16: | ||
| 360 | return VK_FORMAT_R16G16_SINT; | ||
| 361 | case Maxwell::VertexAttribute::Size::Size_16_16_16: | ||
| 362 | return VK_FORMAT_R16G16B16_SINT; | ||
| 363 | case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | ||
| 364 | return VK_FORMAT_R16G16B16A16_SINT; | ||
| 358 | case Maxwell::VertexAttribute::Size::Size_32: | 365 | case Maxwell::VertexAttribute::Size::Size_32: |
| 359 | return VK_FORMAT_R32_SINT; | 366 | return VK_FORMAT_R32_SINT; |
| 367 | case Maxwell::VertexAttribute::Size::Size_32_32: | ||
| 368 | return VK_FORMAT_R32G32_SINT; | ||
| 369 | case Maxwell::VertexAttribute::Size::Size_32_32_32: | ||
| 370 | return VK_FORMAT_R32G32B32_SINT; | ||
| 371 | case Maxwell::VertexAttribute::Size::Size_32_32_32_32: | ||
| 372 | return VK_FORMAT_R32G32B32A32_SINT; | ||
| 360 | default: | 373 | default: |
| 361 | break; | 374 | break; |
| 362 | } | 375 | } |
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 170cdaed0..f0c491d00 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp | |||
| @@ -94,6 +94,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties( | |||
| 94 | VK_FORMAT_R8G8B8A8_SRGB, | 94 | VK_FORMAT_R8G8B8A8_SRGB, |
| 95 | VK_FORMAT_R8G8_UNORM, | 95 | VK_FORMAT_R8G8_UNORM, |
| 96 | VK_FORMAT_R8G8_SNORM, | 96 | VK_FORMAT_R8G8_SNORM, |
| 97 | VK_FORMAT_R8G8_UINT, | ||
| 97 | VK_FORMAT_R8_UNORM, | 98 | VK_FORMAT_R8_UNORM, |
| 98 | VK_FORMAT_R8_UINT, | 99 | VK_FORMAT_R8_UINT, |
| 99 | VK_FORMAT_B10G11R11_UFLOAT_PACK32, | 100 | VK_FORMAT_B10G11R11_UFLOAT_PACK32, |
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index cc7181229..bbe93903c 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp | |||
| @@ -145,6 +145,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) | |||
| 145 | return PixelFormat::RG8U; | 145 | return PixelFormat::RG8U; |
| 146 | case Tegra::RenderTargetFormat::RG8_SNORM: | 146 | case Tegra::RenderTargetFormat::RG8_SNORM: |
| 147 | return PixelFormat::RG8S; | 147 | return PixelFormat::RG8S; |
| 148 | case Tegra::RenderTargetFormat::RG8_UINT: | ||
| 149 | return PixelFormat::RG8UI; | ||
| 148 | case Tegra::RenderTargetFormat::R16_FLOAT: | 150 | case Tegra::RenderTargetFormat::R16_FLOAT: |
| 149 | return PixelFormat::R16F; | 151 | return PixelFormat::R16F; |
| 150 | case Tegra::RenderTargetFormat::R16_UNORM: | 152 | case Tegra::RenderTargetFormat::R16_UNORM: |
diff --git a/src/video_core/surface.h b/src/video_core/surface.h index e0acd44d3..6da6a1b97 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h | |||
| @@ -57,51 +57,52 @@ enum class PixelFormat { | |||
| 57 | RGBA8_SRGB = 39, | 57 | RGBA8_SRGB = 39, |
| 58 | RG8U = 40, | 58 | RG8U = 40, |
| 59 | RG8S = 41, | 59 | RG8S = 41, |
| 60 | RG32UI = 42, | 60 | RG8UI = 42, |
| 61 | RGBX16F = 43, | 61 | RG32UI = 43, |
| 62 | R32UI = 44, | 62 | RGBX16F = 44, |
| 63 | R32I = 45, | 63 | R32UI = 45, |
| 64 | ASTC_2D_8X8 = 46, | 64 | R32I = 46, |
| 65 | ASTC_2D_8X5 = 47, | 65 | ASTC_2D_8X8 = 47, |
| 66 | ASTC_2D_5X4 = 48, | 66 | ASTC_2D_8X5 = 48, |
| 67 | BGRA8_SRGB = 49, | 67 | ASTC_2D_5X4 = 49, |
| 68 | DXT1_SRGB = 50, | 68 | BGRA8_SRGB = 50, |
| 69 | DXT23_SRGB = 51, | 69 | DXT1_SRGB = 51, |
| 70 | DXT45_SRGB = 52, | 70 | DXT23_SRGB = 52, |
| 71 | BC7U_SRGB = 53, | 71 | DXT45_SRGB = 53, |
| 72 | R4G4B4A4U = 54, | 72 | BC7U_SRGB = 54, |
| 73 | ASTC_2D_4X4_SRGB = 55, | 73 | R4G4B4A4U = 55, |
| 74 | ASTC_2D_8X8_SRGB = 56, | 74 | ASTC_2D_4X4_SRGB = 56, |
| 75 | ASTC_2D_8X5_SRGB = 57, | 75 | ASTC_2D_8X8_SRGB = 57, |
| 76 | ASTC_2D_5X4_SRGB = 58, | 76 | ASTC_2D_8X5_SRGB = 58, |
| 77 | ASTC_2D_5X5 = 59, | 77 | ASTC_2D_5X4_SRGB = 59, |
| 78 | ASTC_2D_5X5_SRGB = 60, | 78 | ASTC_2D_5X5 = 60, |
| 79 | ASTC_2D_10X8 = 61, | 79 | ASTC_2D_5X5_SRGB = 61, |
| 80 | ASTC_2D_10X8_SRGB = 62, | 80 | ASTC_2D_10X8 = 62, |
| 81 | ASTC_2D_6X6 = 63, | 81 | ASTC_2D_10X8_SRGB = 63, |
| 82 | ASTC_2D_6X6_SRGB = 64, | 82 | ASTC_2D_6X6 = 64, |
| 83 | ASTC_2D_10X10 = 65, | 83 | ASTC_2D_6X6_SRGB = 65, |
| 84 | ASTC_2D_10X10_SRGB = 66, | 84 | ASTC_2D_10X10 = 66, |
| 85 | ASTC_2D_12X12 = 67, | 85 | ASTC_2D_10X10_SRGB = 67, |
| 86 | ASTC_2D_12X12_SRGB = 68, | 86 | ASTC_2D_12X12 = 68, |
| 87 | ASTC_2D_8X6 = 69, | 87 | ASTC_2D_12X12_SRGB = 69, |
| 88 | ASTC_2D_8X6_SRGB = 70, | 88 | ASTC_2D_8X6 = 70, |
| 89 | ASTC_2D_6X5 = 71, | 89 | ASTC_2D_8X6_SRGB = 71, |
| 90 | ASTC_2D_6X5_SRGB = 72, | 90 | ASTC_2D_6X5 = 72, |
| 91 | E5B9G9R9F = 73, | 91 | ASTC_2D_6X5_SRGB = 73, |
| 92 | E5B9G9R9F = 74, | ||
| 92 | 93 | ||
| 93 | MaxColorFormat, | 94 | MaxColorFormat, |
| 94 | 95 | ||
| 95 | // Depth formats | 96 | // Depth formats |
| 96 | Z32F = 74, | 97 | Z32F = 75, |
| 97 | Z16 = 75, | 98 | Z16 = 76, |
| 98 | 99 | ||
| 99 | MaxDepthFormat, | 100 | MaxDepthFormat, |
| 100 | 101 | ||
| 101 | // DepthStencil formats | 102 | // DepthStencil formats |
| 102 | Z24S8 = 76, | 103 | Z24S8 = 77, |
| 103 | S8Z24 = 77, | 104 | S8Z24 = 78, |
| 104 | Z32FS8 = 78, | 105 | Z32FS8 = 79, |
| 105 | 106 | ||
| 106 | MaxDepthStencilFormat, | 107 | MaxDepthStencilFormat, |
| 107 | 108 | ||
| @@ -171,6 +172,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{ | |||
| 171 | 0, // RGBA8_SRGB | 172 | 0, // RGBA8_SRGB |
| 172 | 0, // RG8U | 173 | 0, // RG8U |
| 173 | 0, // RG8S | 174 | 0, // RG8S |
| 175 | 0, // RG8UI | ||
| 174 | 0, // RG32UI | 176 | 0, // RG32UI |
| 175 | 0, // RGBX16F | 177 | 0, // RGBX16F |
| 176 | 0, // R32UI | 178 | 0, // R32UI |
| @@ -269,6 +271,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{ | |||
| 269 | 1, // RGBA8_SRGB | 271 | 1, // RGBA8_SRGB |
| 270 | 1, // RG8U | 272 | 1, // RG8U |
| 271 | 1, // RG8S | 273 | 1, // RG8S |
| 274 | 1, // RG8UI | ||
| 272 | 1, // RG32UI | 275 | 1, // RG32UI |
| 273 | 1, // RGBX16F | 276 | 1, // RGBX16F |
| 274 | 1, // R32UI | 277 | 1, // R32UI |
| @@ -359,6 +362,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{ | |||
| 359 | 1, // RGBA8_SRGB | 362 | 1, // RGBA8_SRGB |
| 360 | 1, // RG8U | 363 | 1, // RG8U |
| 361 | 1, // RG8S | 364 | 1, // RG8S |
| 365 | 1, // RG8UI | ||
| 362 | 1, // RG32UI | 366 | 1, // RG32UI |
| 363 | 1, // RGBX16F | 367 | 1, // RGBX16F |
| 364 | 1, // R32UI | 368 | 1, // R32UI |
| @@ -449,6 +453,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{ | |||
| 449 | 32, // RGBA8_SRGB | 453 | 32, // RGBA8_SRGB |
| 450 | 16, // RG8U | 454 | 16, // RG8U |
| 451 | 16, // RG8S | 455 | 16, // RG8S |
| 456 | 16, // RG8UI | ||
| 452 | 64, // RG32UI | 457 | 64, // RG32UI |
| 453 | 64, // RGBX16F | 458 | 64, // RGBX16F |
| 454 | 32, // R32UI | 459 | 32, // R32UI |
diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp index 25d2ee2e8..7032e0059 100644 --- a/src/video_core/texture_cache/format_lookup_table.cpp +++ b/src/video_core/texture_cache/format_lookup_table.cpp | |||
| @@ -41,7 +41,7 @@ struct Table { | |||
| 41 | ComponentType alpha_component; | 41 | ComponentType alpha_component; |
| 42 | bool is_srgb; | 42 | bool is_srgb; |
| 43 | }; | 43 | }; |
| 44 | constexpr std::array<Table, 76> DefinitionTable = {{ | 44 | constexpr std::array<Table, 77> DefinitionTable = {{ |
| 45 | {TextureFormat::A8R8G8B8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::ABGR8U}, | 45 | {TextureFormat::A8R8G8B8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::ABGR8U}, |
| 46 | {TextureFormat::A8R8G8B8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::ABGR8S}, | 46 | {TextureFormat::A8R8G8B8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::ABGR8S}, |
| 47 | {TextureFormat::A8R8G8B8, C, UINT, UINT, UINT, UINT, PixelFormat::ABGR8UI}, | 47 | {TextureFormat::A8R8G8B8, C, UINT, UINT, UINT, UINT, PixelFormat::ABGR8UI}, |
| @@ -60,6 +60,7 @@ constexpr std::array<Table, 76> DefinitionTable = {{ | |||
| 60 | 60 | ||
| 61 | {TextureFormat::G8R8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RG8U}, | 61 | {TextureFormat::G8R8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RG8U}, |
| 62 | {TextureFormat::G8R8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RG8S}, | 62 | {TextureFormat::G8R8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RG8S}, |
| 63 | {TextureFormat::G8R8, C, UINT, UINT, UINT, UINT, PixelFormat::RG8UI}, | ||
| 63 | 64 | ||
| 64 | {TextureFormat::R16_G16_B16_A16, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RGBA16S}, | 65 | {TextureFormat::R16_G16_B16_A16, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RGBA16S}, |
| 65 | {TextureFormat::R16_G16_B16_A16, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RGBA16U}, | 66 | {TextureFormat::R16_G16_B16_A16, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RGBA16U}, |