Working on a project to exchange OpenGL textures between two independent applications.
As a first basis I use this example program https://gitlab.com/blaztinn/dma-buf-texture-sharing/-/tree/master
Here is a fork from me for test purposes https://github.com/AlwinEsch/dma-buf-texture-sharing/tree/own-tries
This uses a complete image for testing (not with 4 pixels as in the original).
This also works completely correctly for me when exchanging 24bit texture image (GL_RGB).
However, if I switch to 32bit (GL_RGBA) which is necessary for my project, the child only arrives garbage.
Image where shows on left client and on right server
Questions:
- Is this maybe related to OS/Hardware bugs?
- Can this vary between different GPUs and if so how can the support be determined in the code?
- Something special in code wrong to have RGBA supported?
- Other wide supported ways possible to share a texture between two independent apps?
Here a bit in hex Format:
Correct on server:
00000000 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF
00000028 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF │ 38 38 38 FF
...
If with Alpha given to child (glTexImage2D format with GL_BGRA):
00000000 83 83 8F F3 │ 00 00 0F 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00
00000028 00 00 00 00 │ 00 00 00 00 │ 83 83 8F F3 │ 00 00 0F 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00 │ 00 00 00 00
...
If passed as RGB (glTexImage2D format with GL_BGR, a bit swapped as original source still in RGBA):
00000000 38 38 38 38 │ 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38 │ 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38 │ 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38
00000028 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38 │ 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38 │ 38 FF 38 FF │ 38 FF 38 38 │ 38 38 38 38 │ 38 FF 38 FF
...
My Hardware:
- OS: Ubuntu 20.04
- CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
- GPU: Intel Corporation UHD Graphics 630 (Desktop 9 Series)
Background to me, I am part of the Kodi team and am looking to develop a working web browser add-on for Kodi which CEF / Chromium uses (https://github.com/AlwinEsch/web.browser.chromium). However, since Chromium is a bit thicker, it becomes necessary to have this regardless of the executing app.