termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

shared pixmap not supported #364

Closed xMeM closed 1 year ago

xMeM commented 1 year ago

Use the following code to query the shared pixmap support status. In previous versions, it outputs enable, but in the latest version, it outputs disable.

   auto shm_cookie = xcb_shm_query_version_unchecked(connection);
   auto shm_reply = xcb_shm_query_version_reply(connection, shm_cookie, nullptr);
   if (shm_reply == nullptr ||
       (shm_reply->major_version != 1 || shm_reply->minor_version < 2 || shm_reply->shared_pixmaps == false))
   {
      free(shm_reply);
      has_shm = false;
      std::cout << "disabled." << std::endl;
   }
   else
   {
      has_shm = true;
      std::cout << "enabled." << std::endl;
   }

The last version that outputs enable is this one .

Is this code correct? If it is incorrect, how can I correctly query the support of shared pixmap?

twaik commented 1 year ago

X server reports shm support only for for Unix connections. In the case of TCP connection it always reports no MIT-SHM support.

twaik commented 1 year ago

Anyway, you are likely doing something wrong. I am checking every version with termux's glxgears (llvmpipe and virpipe). It requires MIT-SHM support.

xMeM commented 1 year ago

无论如何,你可能做错了什么。我正在使用termux的glxgears(llvmpipe和virpipe)检查每个版本。它需要MIT-SHM的支持。

I used vulkan-loader-generic to load the native Qualcomm vulkan driver in termux, and then tried to use vulkan-wsi-layer. Finally, I successfully ran vkcube and vkmark on my OnePlus11 device, but after I updated termux:x11 version, shared pixmap creation failed.

This is all the code I use, some of which is copied from mesa and termux-gfx-wrapper. Maybe you can help me check it. sysvk vulkan-wsi-layer

twaik commented 1 year ago

Yeah, you are right. It happens because I initialized root window with offscreen pixmap. Fixing this now.

twaik commented 1 year ago

Build is finished. Can you please check this?

xMeM commented 1 year ago

构建已完成。你能检查一下吗?

Okay, it’s fixed now

![IMG_20230628_21271511](https://github.com/termux/termux-x11/assets/12376597/52ed0000-de1a-4b74-a68f-d2d9733970b5)