Hi Dmitry,

> Subject: Re: [PATCH v3 4/6] ui/console-gl: Add a helper to create a texture
> with linear memory layout
> 
> On 4/29/25 09:08, Vivek Kasireddy wrote:
> > +#ifdef GL_EXT_memory_object_fd
> > +    glCreateMemoryObjectsEXT(1, &mem_obj);
> > +    glImportMemoryFdEXT(mem_obj, size,
> GL_HANDLE_TYPE_OPAQUE_FD_EXT, fd);
> > +    if (glGetError() != GL_NO_ERROR) {
> > +        error_report("spice: cannot import memory object from fd");
> > +        return;
> > +    }
> 
> glGetError() retains error once error occurred. Calling glGetError()
> returns last error code and clears the error state. Hence you should add
> a dummy glGetError() call before glCreateMemoryObjectsEXT() to clear the
> potential stale GL errors, otherwise your code will handle unrelated GL
> errors and report them as memfd import failures.
Thank you for explaining how glGetError() works. I'll fix this in the next 
version.

Thanks,
Vivek

> 
> --
> Best regards,
> Dmitry

Reply via email to