diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 24 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 3 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 466a911db..ff35d362d 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -133,6 +133,7 @@ std::array<Device::BaseBindings, Tegra::Engines::MaxShaderTypes> BuildBaseBindin | |||
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | bool IsASTCSupported() { | 135 | bool IsASTCSupported() { |
| 136 | static constexpr std::array targets = {GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY}; | ||
| 136 | static constexpr std::array formats = { | 137 | static constexpr std::array formats = { |
| 137 | GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, | 138 | GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, |
| 138 | GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, | 139 | GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, |
| @@ -149,12 +150,23 @@ bool IsASTCSupported() { | |||
| 149 | GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, | 150 | GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, |
| 150 | GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, | 151 | GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, |
| 151 | }; | 152 | }; |
| 152 | return std::find_if_not(formats.begin(), formats.end(), [](GLenum format) { | 153 | static constexpr std::array required_support = { |
| 153 | GLint supported; | 154 | GL_VERTEX_TEXTURE, GL_TESS_CONTROL_TEXTURE, GL_TESS_EVALUATION_TEXTURE, |
| 154 | glGetInternalformativ(GL_TEXTURE_2D, format, GL_INTERNALFORMAT_SUPPORTED, 1, | 155 | GL_GEOMETRY_TEXTURE, GL_FRAGMENT_TEXTURE, GL_COMPUTE_TEXTURE, |
| 155 | &supported); | 156 | }; |
| 156 | return supported == GL_TRUE; | 157 | |
| 157 | }) == formats.end(); | 158 | for (const GLenum target : targets) { |
| 159 | for (const GLenum format : formats) { | ||
| 160 | for (const GLenum support : required_support) { | ||
| 161 | GLint value; | ||
| 162 | glGetInternalformativ(GL_TEXTURE_2D, format, support, 1, &value); | ||
| 163 | if (value != GL_FULL_SUPPORT) { | ||
| 164 | return false; | ||
| 165 | } | ||
| 166 | } | ||
| 167 | } | ||
| 168 | } | ||
| 169 | return true; | ||
| 158 | } | 170 | } |
| 159 | 171 | ||
| 160 | } // Anonymous namespace | 172 | } // Anonymous namespace |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 4faa8b90c..57db5a08b 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -404,8 +404,7 @@ View CachedSurface::CreateViewInner(const ViewParams& view_key, const bool is_pr | |||
| 404 | 404 | ||
| 405 | CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& params, | 405 | CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& params, |
| 406 | bool is_proxy) | 406 | bool is_proxy) |
| 407 | : VideoCommon::ViewBase(params), surface{surface}, | 407 | : VideoCommon::ViewBase(params), surface{surface}, format{surface.internal_format}, |
| 408 | format{GetFormatTuple(surface.GetSurfaceParams().pixel_format).internal_format}, | ||
| 409 | target{GetTextureTarget(params.target)}, is_proxy{is_proxy} { | 408 | target{GetTextureTarget(params.target)}, is_proxy{is_proxy} { |
| 410 | if (!is_proxy) { | 409 | if (!is_proxy) { |
| 411 | main_view = CreateTextureView(); | 410 | main_view = CreateTextureView(); |