diff options
| author | 2019-11-09 03:26:30 -0300 | |
|---|---|---|
| committer | 2019-11-14 20:57:10 -0300 | |
| commit | 80eacdf89b55528a66b2e94391e640e641e8cb57 (patch) | |
| tree | 38f52e7744ba4db1aba6252837459b1ca72fa465 /src/video_core/surface.h | |
| parent | texture_cache: Drop abstracted ComponentType (diff) | |
| download | yuzu-80eacdf89b55528a66b2e94391e640e641e8cb57.tar.gz yuzu-80eacdf89b55528a66b2e94391e640e641e8cb57.tar.xz yuzu-80eacdf89b55528a66b2e94391e640e641e8cb57.zip | |
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.
Diffstat (limited to 'src/video_core/surface.h')
| -rw-r--r-- | src/video_core/surface.h | 5 |
1 files changed, 0 insertions, 5 deletions
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 { | |||
| 106 | Max = MaxDepthStencilFormat, | 106 | Max = MaxDepthStencilFormat, |
| 107 | Invalid = 255, | 107 | Invalid = 255, |
| 108 | }; | 108 | }; |
| 109 | |||
| 110 | static constexpr std::size_t MaxPixelFormat = static_cast<std::size_t>(PixelFormat::Max); | 109 | static constexpr std::size_t MaxPixelFormat = static_cast<std::size_t>(PixelFormat::Max); |
| 111 | 110 | ||
| 112 | enum class SurfaceType { | 111 | enum class SurfaceType { |
| @@ -600,10 +599,6 @@ PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format); | |||
| 600 | 599 | ||
| 601 | PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format); | 600 | PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format); |
| 602 | 601 | ||
| 603 | PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, | ||
| 604 | Tegra::Texture::ComponentType component_type, | ||
| 605 | bool is_srgb); | ||
| 606 | |||
| 607 | PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format); | 602 | PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format); |
| 608 | 603 | ||
| 609 | SurfaceType GetFormatType(PixelFormat pixel_format); | 604 | SurfaceType GetFormatType(PixelFormat pixel_format); |