[PATCH xserver 1/5] glamor: Handle GL_OUT_OF_MEMORY when allocating texture images.

Keith Packard keithp at keithp.com
Wed Nov 11 19:11:15 PST 2015


Eric Anholt <eric at anholt.net> writes:

> I think it's a safe enough assumption that we're not generating non-OOM
> errors.  And, now that we're logging errors, we should get reports of
> them sooner than we used to.

Would it be sensible to wrap the glGetError call like this?

GLenum
glamor_check_gl_oom() {
        GLenum last_oom = GL_NO_ERROR;
        GLenum error;

        while ((error = glGetError()) != GL_NO_ERROR) {
                if (error == GL_OUT_OF_MEMORY)
                        last_oom = error;
        }
        return last_oom;
}

I admit I haven't looked at the Mesa glGetError() implementation, so I
don't know if there's a queue of errors, or just a bitfield.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151111/1de7be82/attachment.sig>


More information about the xorg-devel mailing list