diff options
| author | 2018-04-15 19:54:38 -0500 | |
|---|---|---|
| committer | 2018-04-18 12:52:52 -0500 | |
| commit | ac09b5a2e945f587a8b3b712f54b76d46edb0c2f (patch) | |
| tree | fe8f41e023436cc64db6c5e34640ea6890ba22f1 /src/video_core | |
| parent | GPU: Allow using a configurable block height when unswizzling textures. (diff) | |
| download | yuzu-ac09b5a2e945f587a8b3b712f54b76d46edb0c2f.tar.gz yuzu-ac09b5a2e945f587a8b3b712f54b76d46edb0c2f.tar.xz yuzu-ac09b5a2e945f587a8b3b712f54b76d46edb0c2f.zip | |
GLCache: Added a function to convert cached PixelFormats back to texture formats.
TODO: The way we handle cached formats must change, framebuffer and texture formats are too different to keep them in the same place.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 3293905d6..0b2e3ffef 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -115,6 +115,18 @@ struct SurfaceParams { | |||
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | static Tegra::Texture::TextureFormat TextureFormatFromPixelFormat(PixelFormat format) { | ||
| 119 | // TODO(Subv): Properly implement this | ||
| 120 | switch (format) { | ||
| 121 | case PixelFormat::RGBA8: | ||
| 122 | return Tegra::Texture::TextureFormat::A8R8G8B8; | ||
| 123 | case PixelFormat::DXT1: | ||
| 124 | return Tegra::Texture::TextureFormat::DXT1; | ||
| 125 | default: | ||
| 126 | UNREACHABLE(); | ||
| 127 | } | ||
| 128 | } | ||
| 129 | |||
| 118 | static bool CheckFormatsBlittable(PixelFormat pixel_format_a, PixelFormat pixel_format_b) { | 130 | static bool CheckFormatsBlittable(PixelFormat pixel_format_a, PixelFormat pixel_format_b) { |
| 119 | SurfaceType a_type = GetFormatType(pixel_format_a); | 131 | SurfaceType a_type = GetFormatType(pixel_format_a); |
| 120 | SurfaceType b_type = GetFormatType(pixel_format_b); | 132 | SurfaceType b_type = GetFormatType(pixel_format_b); |