Not sure where this issue should go, but I’m having an issue calling glEGLImageTargetTexture2DOES with an EGLImage imported via a DMA-BUF, which in-turn is exported via eglExportDMABUFImageMESA.
Both exporting and importing the image from/to EGL seems to work fine, here’s the output from my test program from the export:
eglExportDMABUFImageQueryMESA: 1 AB24 (34324241) planes:1 mods:0
eglExportDMABUFImageMESA: 1 44
strides: 512 0 0 0
offsets: 0 0 0 0
This is exactly what I would expect from a 128x128 ABGR image.
The import also works fine, returning a seemingly valid EGLImage:
eglCreateImage from DMA-BUF: 0x1c976a1
But then the glEGLImageTargetTexture2DOES call (with a target of GL_TEXTURE_2D) complains with this:
GL_INVALID_OPERATION error generated. and are incompatible
Is there anyway to figure out exactly why they’re not compatible? Is this meant to work?
So I think I figured out what the issue is. It seems that you can’t import images that were exported in pitch linear format. They first must be converted to a cuArray. Doing this will let you bind the image correctly.
eglExportDMABUFImageMESA continues to work just fine. The original issue is a limitation with the NVIDIA driver, later confirmed by one of the developers, you can’t import pitch-linear textures.
Thank you, this gives me hope. Unfortunately I am still unable to determine why export does not work for me.
If I understand correctly, GL_TEXTURE_2D would include those pitch-linear textures (first time I’ve come across the term)? If not, are there any RGB formats in OpenGL that are not pitch-linear?
If it’s a regular OpenGL texture then it’ll be tiled, not pitch-linear. These should be fine, but there’s only so many formats supported. One of the NVIDIA developers responded here with a list.
Interesting, I am using those formats but apparently they do not work. It could be that GL_TEXTURE_2D is not supported for export. In which case I would have to read the texture back into my own created dma_buf correct?