mirror of
https://github.com/love2d/love.git
synced 2026-08-22 05:25:11 +02:00
Fix GL version check for arbitrary texture-to-buffer copy support.
love never creates a GL4.5 context, so we also need to check for the extension that provides the same functionality.
This commit is contained in:
@@ -1541,7 +1541,7 @@ bool OpenGL::isCopyBufferToTextureSupported() const
|
|||||||
bool OpenGL::isCopyTextureToBufferSupported() const
|
bool OpenGL::isCopyTextureToBufferSupported() const
|
||||||
{
|
{
|
||||||
// Requires glGetTextureSubImage support.
|
// Requires glGetTextureSubImage support.
|
||||||
return GLAD_VERSION_4_5;
|
return GLAD_VERSION_4_5 || GLAD_ARB_get_texture_sub_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenGL::isCopyRenderTargetToBufferSupported() const
|
bool OpenGL::isCopyRenderTargetToBufferSupported() const
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ void Texture::copyToBuffer(love::graphics::Buffer *dest, int slice, int mipmap,
|
|||||||
// treating the pointer as a byte offset.
|
// treating the pointer as a byte offset.
|
||||||
uint8 *byteoffset = (uint8 *)(ptrdiff_t)destoffset;
|
uint8 *byteoffset = (uint8 *)(ptrdiff_t)destoffset;
|
||||||
|
|
||||||
if (GLAD_VERSION_4_5)
|
if (gl.isCopyTextureToBufferSupported())
|
||||||
{
|
{
|
||||||
if (isCompressed())
|
if (isCompressed())
|
||||||
glGetCompressedTextureSubImage(texture, mipmap, rect.x, rect.y, slice, rect.w, rect.h, 1, size, byteoffset);
|
glGetCompressedTextureSubImage(texture, mipmap, rect.x, rect.y, slice, rect.w, rect.h, 1, size, byteoffset);
|
||||||
|
|||||||
Reference in New Issue
Block a user