Hi Dmitry,

> Subject: Re: [PATCH v2 4/6] ui/console-gl: Add a helper to create a texture
> with linear memory layout
> 
> On 3/26/25 02:39, Vivek Kasireddy wrote:
> > +void surface_gl_create_texture_from_fd(DisplaySurface *surface,
> > +                                       int fd, GLuint *texture)
> > +{
> > +    unsigned long size = surface_stride(surface) * surface_height(surface);
> > +    GLuint mem_obj;
> > +
> > +    if (!epoxy_has_gl_extension("GL_EXT_memory_object") ||
> > +        !epoxy_has_gl_extension("GL_EXT_memory_object_fd")) {
> > +        return;
> > +    }
> > +
> > +#ifdef GL_EXT_memory_object_fd
> > +    glCreateMemoryObjectsEXT(1, &mem_obj);
> > +    glImportMemoryFdEXT(mem_obj, size,
> GL_HANDLE_TYPE_OPAQUE_FD_EXT, fd);
> > +    if (!glIsMemoryObjectEXT(mem_obj)) {
> 
> This check should always succeed. glGetError() should be used for
> glImportMemoryFdEXT() failure checking.
> 
> Won't hurt to print error messages instead of failing silently.
Makes sense; will add glGetError() and error messages in the next version.

Thanks,
Vivek

> 
> --
> Best regards,
> Dmitry

Reply via email to