summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp24
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp3
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 d20547c04..b772c37d9 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -144,6 +144,7 @@ std::array<Device::BaseBindings, Tegra::Engines::MaxShaderTypes> BuildBaseBindin
144} 144}
145 145
146bool IsASTCSupported() { 146bool IsASTCSupported() {
147 static constexpr std::array targets = {GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY};
147 static constexpr std::array formats = { 148 static constexpr std::array formats = {
148 GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, 149 GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
149 GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, 150 GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
@@ -160,12 +161,23 @@ bool IsASTCSupported() {
160 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 161 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
161 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 162 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
162 }; 163 };
163 return std::find_if_not(formats.begin(), formats.end(), [](GLenum format) { 164 static constexpr std::array required_support = {
164 GLint supported; 165 GL_VERTEX_TEXTURE, GL_TESS_CONTROL_TEXTURE, GL_TESS_EVALUATION_TEXTURE,
165 glGetInternalformativ(GL_TEXTURE_2D, format, GL_INTERNALFORMAT_SUPPORTED, 1, 166 GL_GEOMETRY_TEXTURE, GL_FRAGMENT_TEXTURE, GL_COMPUTE_TEXTURE,
166 &supported); 167 };
167 return supported == GL_TRUE; 168
168 }) == formats.end(); 169 for (const GLenum target : targets) {
170 for (const GLenum format : formats) {
171 for (const GLenum support : required_support) {
172 GLint value;
173 glGetInternalformativ(GL_TEXTURE_2D, format, support, 1, &value);
174 if (value != GL_FULL_SUPPORT) {
175 return false;
176 }
177 }
178 }
179 }
180 return true;
169} 181}
170 182
171} // Anonymous namespace 183} // 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
405CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& params, 405CachedSurfaceView::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();