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.
This commit is contained in:
parent
48a1687f51
commit
80eacdf89b
9 changed files with 290 additions and 261 deletions
|
@ -106,7 +106,6 @@ enum class PixelFormat {
|
|||
Max = MaxDepthStencilFormat,
|
||||
Invalid = 255,
|
||||
};
|
||||
|
||||
static constexpr std::size_t MaxPixelFormat = static_cast<std::size_t>(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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue