From 48a1687f515110b602c64ffbc27eacef3e57a575 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 8 Nov 2019 22:38:26 -0300 Subject: texture_cache: Drop abstracted ComponentType Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour. --- src/video_core/surface.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/video_core/surface.h') diff --git a/src/video_core/surface.h b/src/video_core/surface.h index d3bcd38c5..a3bf2a5b2 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h @@ -109,15 +109,6 @@ enum class PixelFormat { static constexpr std::size_t MaxPixelFormat = static_cast(PixelFormat::Max); -enum class ComponentType { - Invalid = 0, - SNorm = 1, - UNorm = 2, - SInt = 3, - UInt = 4, - Float = 5, -}; - enum class SurfaceType { ColorTexture = 0, Depth = 1, @@ -613,14 +604,8 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, Tegra::Texture::ComponentType component_type, bool is_srgb); -ComponentType ComponentTypeFromTexture(Tegra::Texture::ComponentType type); - -ComponentType ComponentTypeFromRenderTarget(Tegra::RenderTargetFormat format); - PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format); -ComponentType ComponentTypeFromDepthFormat(Tegra::DepthFormat format); - SurfaceType GetFormatType(PixelFormat pixel_format); bool IsPixelFormatASTC(PixelFormat format); -- cgit v1.2.3 From 80eacdf89b55528a66b2e94391e640e641e8cb57 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sat, 9 Nov 2019 03:26:30 -0300 Subject: texture_cache: Use a table instead of switch for texture formats Use a large flat array to look up texture formats. This allows us to properly implement formats with different component types. It should also be faster. --- src/video_core/surface.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/video_core/surface.h') diff --git a/src/video_core/surface.h b/src/video_core/surface.h index a3bf2a5b2..0d17a93ed 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h @@ -106,7 +106,6 @@ enum class PixelFormat { Max = MaxDepthStencilFormat, Invalid = 255, }; - static constexpr std::size_t MaxPixelFormat = static_cast(PixelFormat::Max); enum class SurfaceType { @@ -600,10 +599,6 @@ PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format); PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format); -PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, - Tegra::Texture::ComponentType component_type, - bool is_srgb); - PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format); SurfaceType GetFormatType(PixelFormat pixel_format); -- cgit v1.2.3