]> git.tdb.fi Git - libs/gl.git/commitdiff
Use glCreateTextures also for async loading
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 23:19:33 +0000 (01:19 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 23:33:08 +0000 (01:33 +0200)
Otherwise the texture won't be fully created when glTextureStorage2D
is called.

source/texture2d.cpp

index dac671fdfa52fcae265d088b2cb9d14f918a9a56..08383526728bb7a239b8551c910c75c6a2ff2f03 100644 (file)
@@ -270,7 +270,12 @@ bool Texture2D::AsyncLoader::process()
                }
 
                if(!texture.id)
-                       glGenTextures(1, &texture.id);
+               {
+                       if(ARB_direct_state_access)
+                               glCreateTextures(texture.target, 1, &texture.id);
+                       else
+                               glGenTextures(1, &texture.id);
+               }
                texture.image(image, srgb_conversion, true);
        }