rasterizer_cache: Always create TextureDownloaderES

* It's used when dumping textures on desktop, so create it upfront to avoid null checks
This commit is contained in:
emufan4568 2022-08-21 13:33:52 +03:00
parent 1579f96397
commit 9b5230c60e
2 changed files with 1 additions and 9 deletions

View file

@ -260,11 +260,6 @@ void CachedSurface::DumpTexture(GLuint target_tex, u64 tex_hash) {
GetTexImageOES conveniently only dumps the specified region, and works on both GetTexImageOES conveniently only dumps the specified region, and works on both
desktop and ES. desktop and ES.
*/ */
// if the backend isn't OpenGL ES, this won't be initialized yet
if (!owner.texture_downloader_es) {
owner.texture_downloader_es = std::make_unique<TextureDownloaderES>(false);
}
owner.texture_downloader_es->GetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, owner.texture_downloader_es->GetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE,
height, width, &decoded_texture[0]); height, width, &decoded_texture[0]);
state.texture_units[0].texture_2d = old_texture; state.texture_units[0].texture_2d = old_texture;

View file

@ -12,7 +12,6 @@
#include "video_core/renderer_opengl/texture_filters/texture_filterer.h" #include "video_core/renderer_opengl/texture_filters/texture_filterer.h"
#include "video_core/renderer_opengl/texture_downloader_es.h" #include "video_core/renderer_opengl/texture_downloader_es.h"
#include "video_core/renderer_opengl/gl_format_reinterpreter.h" #include "video_core/renderer_opengl/gl_format_reinterpreter.h"
#include "video_core/renderer_opengl/gl_vars.h"
namespace OpenGL { namespace OpenGL {
@ -244,10 +243,8 @@ RasterizerCacheOpenGL::RasterizerCacheOpenGL() {
texture_filterer = std::make_unique<TextureFilterer>(Settings::values.texture_filter_name, texture_filterer = std::make_unique<TextureFilterer>(Settings::values.texture_filter_name,
resolution_scale_factor); resolution_scale_factor);
format_reinterpreter = std::make_unique<FormatReinterpreterOpenGL>(); format_reinterpreter = std::make_unique<FormatReinterpreterOpenGL>();
if (GLES) {
texture_downloader_es = std::make_unique<TextureDownloaderES>(false); texture_downloader_es = std::make_unique<TextureDownloaderES>(false);
} }
}
RasterizerCacheOpenGL::~RasterizerCacheOpenGL() { RasterizerCacheOpenGL::~RasterizerCacheOpenGL() {
#ifndef ANDROID #ifndef ANDROID