Ported: Initialize GLWrapper earlier in Storage::initialize()

Make sure `GLWrapper` is initialized before `glActiveTexture` is called by other parts of the storage initialize(), to prevent benign warnings.
- lawnjelly
857d884026
This commit is contained in:
Relintai 2023-08-27 22:20:14 +02:00
parent fb142ed6f8
commit 05c264c83c

View File

@ -5955,6 +5955,10 @@ void RasterizerStorageGLES2::initialize() {
config.depth_internalformat = GL_DEPTH_COMPONENT;
config.depth_type = GL_UNSIGNED_INT;
// Initialize GLWrapper early on, as required for any calls to glActiveTexture.
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units);
gl_wrapper.initialize(config.max_texture_image_units);
#ifdef GLES_OVER_GL
config.float_texture_supported = true;
config.s3tc_supported = true;
@ -6147,8 +6151,6 @@ void RasterizerStorageGLES2::initialize() {
frame.clear_request = false;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &config.max_vertex_texture_image_units);
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units);
gl_wrapper.initialize(config.max_texture_image_units);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &config.max_texture_size);
glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &config.max_cubemap_texture_size);
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, config.max_viewport_dimensions);