diff options
Diffstat (limited to 'src/video_core')
-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 { BGR5A1_UNORM = 0xE9, RG8_UNORM = 0xEA, RG8_SNORM = 0xEB, + RG8_UINT = 0xED, R16_UNORM = 0xEE, R16_SNORM = 0xEF, 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 = { MortonCopy<true, PixelFormat::RGBA8_SRGB>, MortonCopy<true, PixelFormat::RG8U>, MortonCopy<true, PixelFormat::RG8S>, + MortonCopy<true, PixelFormat::RG8UI>, MortonCopy<true, PixelFormat::RG32UI>, MortonCopy<true, PixelFormat::RGBX16F>, MortonCopy<true, PixelFormat::R32UI>, @@ -166,6 +167,7 @@ static constexpr ConversionArray linear_to_morton_fns = { MortonCopy<false, PixelFormat::RGBA8_SRGB>, MortonCopy<false, PixelFormat::RG8U>, MortonCopy<false, PixelFormat::RG8S>, + MortonCopy<false, PixelFormat::RG8UI>, MortonCopy<false, PixelFormat::RG32UI>, MortonCopy<false, PixelFormat::RGBX16F>, 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 {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_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 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 { {VK_FORMAT_R8G8B8A8_SRGB, Attachable}, // RGBA8_SRGB {VK_FORMAT_R8G8_UNORM, Attachable | Storage}, // RG8U {VK_FORMAT_R8G8_SNORM, Attachable | Storage}, // RG8S + {VK_FORMAT_R8G8_UINT, Attachable | Storage}, // RG8UI {VK_FORMAT_R32G32_UINT, Attachable | Storage}, // RG32UI {VK_FORMAT_UNDEFINED}, // RGBX16F {VK_FORMAT_R32_UINT, Attachable | Storage}, // R32UI @@ -345,8 +346,6 @@ VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrib break; case Maxwell::VertexAttribute::Type::SignedInt: switch (size) { - case Maxwell::VertexAttribute::Size::Size_16_16_16_16: - return VK_FORMAT_R16G16B16A16_SINT; case Maxwell::VertexAttribute::Size::Size_8: return VK_FORMAT_R8_SINT; case Maxwell::VertexAttribute::Size::Size_8_8: @@ -355,8 +354,22 @@ VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrib return VK_FORMAT_R8G8B8_SINT; case Maxwell::VertexAttribute::Size::Size_8_8_8_8: return VK_FORMAT_R8G8B8A8_SINT; + case Maxwell::VertexAttribute::Size::Size_16: + return VK_FORMAT_R16_SINT; + case Maxwell::VertexAttribute::Size::Size_16_16: + return VK_FORMAT_R16G16_SINT; + case Maxwell::VertexAttribute::Size::Size_16_16_16: + return VK_FORMAT_R16G16B16_SINT; + case Maxwell::VertexAttribute::Size::Size_16_16_16_16: + return VK_FORMAT_R16G16B16A16_SINT; case Maxwell::VertexAttribute::Size::Size_32: return VK_FORMAT_R32_SINT; + case Maxwell::VertexAttribute::Size::Size_32_32: + return VK_FORMAT_R32G32_SINT; + case Maxwell::VertexAttribute::Size::Size_32_32_32: + return VK_FORMAT_R32G32B32_SINT; + case Maxwell::VertexAttribute::Size::Size_32_32_32_32: + return VK_FORMAT_R32G32B32A32_SINT; default: break; } 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( VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8G8_SNORM, + VK_FORMAT_R8G8_UINT, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UINT, 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) return PixelFormat::RG8U; case Tegra::RenderTargetFormat::RG8_SNORM: return PixelFormat::RG8S; + case Tegra::RenderTargetFormat::RG8_UINT: + return PixelFormat::RG8UI; case Tegra::RenderTargetFormat::R16_FLOAT: return PixelFormat::R16F; 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 { RGBA8_SRGB = 39, RG8U = 40, RG8S = 41, - RG32UI = 42, - RGBX16F = 43, - R32UI = 44, - R32I = 45, - ASTC_2D_8X8 = 46, - ASTC_2D_8X5 = 47, - ASTC_2D_5X4 = 48, - BGRA8_SRGB = 49, - DXT1_SRGB = 50, - DXT23_SRGB = 51, - DXT45_SRGB = 52, - BC7U_SRGB = 53, - R4G4B4A4U = 54, - ASTC_2D_4X4_SRGB = 55, - ASTC_2D_8X8_SRGB = 56, - ASTC_2D_8X5_SRGB = 57, - ASTC_2D_5X4_SRGB = 58, - ASTC_2D_5X5 = 59, - ASTC_2D_5X5_SRGB = 60, - ASTC_2D_10X8 = 61, - ASTC_2D_10X8_SRGB = 62, - ASTC_2D_6X6 = 63, - ASTC_2D_6X6_SRGB = 64, - ASTC_2D_10X10 = 65, - ASTC_2D_10X10_SRGB = 66, - ASTC_2D_12X12 = 67, - ASTC_2D_12X12_SRGB = 68, - ASTC_2D_8X6 = 69, - ASTC_2D_8X6_SRGB = 70, - ASTC_2D_6X5 = 71, - ASTC_2D_6X5_SRGB = 72, - E5B9G9R9F = 73, + RG8UI = 42, + RG32UI = 43, + RGBX16F = 44, + R32UI = 45, + R32I = 46, + ASTC_2D_8X8 = 47, + ASTC_2D_8X5 = 48, + ASTC_2D_5X4 = 49, + BGRA8_SRGB = 50, + DXT1_SRGB = 51, + DXT23_SRGB = 52, + DXT45_SRGB = 53, + BC7U_SRGB = 54, + R4G4B4A4U = 55, + ASTC_2D_4X4_SRGB = 56, + ASTC_2D_8X8_SRGB = 57, + ASTC_2D_8X5_SRGB = 58, + ASTC_2D_5X4_SRGB = 59, + ASTC_2D_5X5 = 60, + ASTC_2D_5X5_SRGB = 61, + ASTC_2D_10X8 = 62, + ASTC_2D_10X8_SRGB = 63, + ASTC_2D_6X6 = 64, + ASTC_2D_6X6_SRGB = 65, + ASTC_2D_10X10 = 66, + ASTC_2D_10X10_SRGB = 67, + ASTC_2D_12X12 = 68, + ASTC_2D_12X12_SRGB = 69, + ASTC_2D_8X6 = 70, + ASTC_2D_8X6_SRGB = 71, + ASTC_2D_6X5 = 72, + ASTC_2D_6X5_SRGB = 73, + E5B9G9R9F = 74, MaxColorFormat, // Depth formats - Z32F = 74, - Z16 = 75, + Z32F = 75, + Z16 = 76, MaxDepthFormat, // DepthStencil formats - Z24S8 = 76, - S8Z24 = 77, - Z32FS8 = 78, + Z24S8 = 77, + S8Z24 = 78, + Z32FS8 = 79, MaxDepthStencilFormat, @@ -171,6 +172,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{ 0, // RGBA8_SRGB 0, // RG8U 0, // RG8S + 0, // RG8UI 0, // RG32UI 0, // RGBX16F 0, // R32UI @@ -269,6 +271,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{ 1, // RGBA8_SRGB 1, // RG8U 1, // RG8S + 1, // RG8UI 1, // RG32UI 1, // RGBX16F 1, // R32UI @@ -359,6 +362,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{ 1, // RGBA8_SRGB 1, // RG8U 1, // RG8S + 1, // RG8UI 1, // RG32UI 1, // RGBX16F 1, // R32UI @@ -449,6 +453,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{ 32, // RGBA8_SRGB 16, // RG8U 16, // RG8S + 16, // RG8UI 64, // RG32UI 64, // RGBX16F 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 { ComponentType alpha_component; bool is_srgb; }; -constexpr std::array<Table, 76> DefinitionTable = {{ +constexpr std::array<Table, 77> DefinitionTable = {{ {TextureFormat::A8R8G8B8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::ABGR8U}, {TextureFormat::A8R8G8B8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::ABGR8S}, {TextureFormat::A8R8G8B8, C, UINT, UINT, UINT, UINT, PixelFormat::ABGR8UI}, @@ -60,6 +60,7 @@ constexpr std::array<Table, 76> DefinitionTable = {{ {TextureFormat::G8R8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RG8U}, {TextureFormat::G8R8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RG8S}, + {TextureFormat::G8R8, C, UINT, UINT, UINT, UINT, PixelFormat::RG8UI}, {TextureFormat::R16_G16_B16_A16, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::RGBA16S}, {TextureFormat::R16_G16_B16_A16, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::RGBA16U}, |