diff options
| author | 2018-04-18 13:51:09 -0500 | |
|---|---|---|
| committer | 2018-04-18 14:17:27 -0500 | |
| commit | b2c1672e108333bb38ae15f6c6677a0f3719896a (patch) | |
| tree | bba88a87fb5ea959909581bc610c3d1ee443cecf /src | |
| parent | Merge pull request #349 from Subv/texturing (diff) | |
| download | yuzu-b2c1672e108333bb38ae15f6c6677a0f3719896a.tar.gz yuzu-b2c1672e108333bb38ae15f6c6677a0f3719896a.tar.xz yuzu-b2c1672e108333bb38ae15f6c6677a0f3719896a.zip | |
GPU: Texture format 8 and framebuffer format 0xD5 are actually ABGR8.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index a92773f11..d54ddf643 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -52,7 +52,7 @@ static constexpr std::array<FormatTuple, 1> fb_format_tuples = {{ | |||
| 52 | }}; | 52 | }}; |
| 53 | 53 | ||
| 54 | static constexpr std::array<FormatTuple, 2> tex_format_tuples = {{ | 54 | static constexpr std::array<FormatTuple, 2> tex_format_tuples = {{ |
| 55 | {GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, false, 1}, // RGBA8 | 55 | {GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, false, 1}, // ABGR8 |
| 56 | {GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, true, 16}, // DXT1 | 56 | {GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, true, 16}, // DXT1 |
| 57 | }}; | 57 | }}; |
| 58 | 58 | ||
| @@ -123,13 +123,13 @@ void MortonCopy(u32 stride, u32 block_height, u32 height, u8* gl_buffer, VAddr b | |||
| 123 | 123 | ||
| 124 | static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> morton_to_gl_fns = | 124 | static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> morton_to_gl_fns = |
| 125 | { | 125 | { |
| 126 | MortonCopy<true, PixelFormat::RGBA8>, | 126 | MortonCopy<true, PixelFormat::ABGR8>, |
| 127 | MortonCopy<true, PixelFormat::DXT1>, | 127 | MortonCopy<true, PixelFormat::DXT1>, |
| 128 | }; | 128 | }; |
| 129 | 129 | ||
| 130 | static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> gl_to_morton_fns = | 130 | static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> gl_to_morton_fns = |
| 131 | { | 131 | { |
| 132 | MortonCopy<false, PixelFormat::RGBA8>, | 132 | MortonCopy<false, PixelFormat::ABGR8>, |
| 133 | // TODO(Subv): Swizzling the DXT1 format is not yet supported | 133 | // TODO(Subv): Swizzling the DXT1 format is not yet supported |
| 134 | nullptr, | 134 | nullptr, |
| 135 | }; | 135 | }; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 26d6c3061..0f8f14404 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -52,7 +52,7 @@ enum class ScaleMatch { | |||
| 52 | 52 | ||
| 53 | struct SurfaceParams { | 53 | struct SurfaceParams { |
| 54 | enum class PixelFormat { | 54 | enum class PixelFormat { |
| 55 | RGBA8 = 0, | 55 | ABGR8 = 0, |
| 56 | DXT1 = 1, | 56 | DXT1 = 1, |
| 57 | Invalid = 255, | 57 | Invalid = 255, |
| 58 | }; | 58 | }; |
| @@ -71,7 +71,7 @@ struct SurfaceParams { | |||
| 71 | return 0; | 71 | return 0; |
| 72 | 72 | ||
| 73 | constexpr std::array<unsigned int, 2> bpp_table = { | 73 | constexpr std::array<unsigned int, 2> bpp_table = { |
| 74 | 32, // RGBA8 | 74 | 32, // ABGR8 |
| 75 | 64, // DXT1 | 75 | 64, // DXT1 |
| 76 | }; | 76 | }; |
| 77 | 77 | ||
| @@ -85,7 +85,7 @@ struct SurfaceParams { | |||
| 85 | static PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) { | 85 | static PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) { |
| 86 | switch (format) { | 86 | switch (format) { |
| 87 | case Tegra::RenderTargetFormat::RGBA8_UNORM: | 87 | case Tegra::RenderTargetFormat::RGBA8_UNORM: |
| 88 | return PixelFormat::RGBA8; | 88 | return PixelFormat::ABGR8; |
| 89 | default: | 89 | default: |
| 90 | NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 90 | NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 91 | UNREACHABLE(); | 91 | UNREACHABLE(); |
| @@ -95,7 +95,7 @@ struct SurfaceParams { | |||
| 95 | static PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) { | 95 | static PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) { |
| 96 | switch (format) { | 96 | switch (format) { |
| 97 | case Tegra::FramebufferConfig::PixelFormat::ABGR8: | 97 | case Tegra::FramebufferConfig::PixelFormat::ABGR8: |
| 98 | return PixelFormat::RGBA8; | 98 | return PixelFormat::ABGR8; |
| 99 | default: | 99 | default: |
| 100 | NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 100 | NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 101 | UNREACHABLE(); | 101 | UNREACHABLE(); |
| @@ -106,7 +106,7 @@ struct SurfaceParams { | |||
| 106 | // TODO(Subv): Properly implement this | 106 | // TODO(Subv): Properly implement this |
| 107 | switch (format) { | 107 | switch (format) { |
| 108 | case Tegra::Texture::TextureFormat::A8R8G8B8: | 108 | case Tegra::Texture::TextureFormat::A8R8G8B8: |
| 109 | return PixelFormat::RGBA8; | 109 | return PixelFormat::ABGR8; |
| 110 | case Tegra::Texture::TextureFormat::DXT1: | 110 | case Tegra::Texture::TextureFormat::DXT1: |
| 111 | return PixelFormat::DXT1; | 111 | return PixelFormat::DXT1; |
| 112 | default: | 112 | default: |
| @@ -118,7 +118,7 @@ struct SurfaceParams { | |||
| 118 | static Tegra::Texture::TextureFormat TextureFormatFromPixelFormat(PixelFormat format) { | 118 | static Tegra::Texture::TextureFormat TextureFormatFromPixelFormat(PixelFormat format) { |
| 119 | // TODO(Subv): Properly implement this | 119 | // TODO(Subv): Properly implement this |
| 120 | switch (format) { | 120 | switch (format) { |
| 121 | case PixelFormat::RGBA8: | 121 | case PixelFormat::ABGR8: |
| 122 | return Tegra::Texture::TextureFormat::A8R8G8B8; | 122 | return Tegra::Texture::TextureFormat::A8R8G8B8; |
| 123 | case PixelFormat::DXT1: | 123 | case PixelFormat::DXT1: |
| 124 | return Tegra::Texture::TextureFormat::DXT1; | 124 | return Tegra::Texture::TextureFormat::DXT1; |
| @@ -148,7 +148,7 @@ struct SurfaceParams { | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | static SurfaceType GetFormatType(PixelFormat pixel_format) { | 150 | static SurfaceType GetFormatType(PixelFormat pixel_format) { |
| 151 | if ((unsigned int)pixel_format <= static_cast<unsigned int>(PixelFormat::RGBA8)) { | 151 | if ((unsigned int)pixel_format <= static_cast<unsigned int>(PixelFormat::ABGR8)) { |
| 152 | return SurfaceType::Color; | 152 | return SurfaceType::Color; |
| 153 | } | 153 | } |
| 154 | 154 | ||