-
Notifications
You must be signed in to change notification settings - Fork 45
【Experimental】Enable Vulkan Renderer #1032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
LFRon
wants to merge
5
commits into
linuxdeepin:master
Choose a base branch
from
LFRon:feat-and-refactor/enable-vulkan-renderer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
67b8ccf
feat(waylib): support Qt Quick Vulkan on wlroots render buffers (Need…
LFRon 5f3ad17
feat(waylib): simplify Vulkan texture sampling plumbing
LFRon 151e233
feat(vulkan): add presentation feedback
LFRon 1de9b42
feat(cursor): detach cursor layer from QML scene
LFRon fb2b9bf
fix(vulkan): close render resource lifetime gaps
LFRon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #include "wlinuxdmabufv1.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #include "wpresentation.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // Copyright (C) 2026 UnionTech Software Technology Co., Ltd. | ||
| // SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
|
||
| #include "wlinuxdmabufv1.h" | ||
|
|
||
| #include "wayliblogging.h" | ||
|
|
||
| #include <qwdisplay.h> | ||
| #include <qwlinuxdmabufv1.h> | ||
| #include <qwrenderer.h> | ||
|
|
||
| QW_USE_NAMESPACE | ||
| WAYLIB_SERVER_BEGIN_NAMESPACE | ||
|
|
||
| constexpr uint32_t LinuxDmabufV1Version = 4; | ||
|
|
||
| WLinuxDmabufV1::WLinuxDmabufV1(qw_renderer *renderer, QObject *parent) | ||
| : QObject(parent) | ||
| , m_renderer(renderer) | ||
| { | ||
| } | ||
|
|
||
| qw_linux_dmabuf_v1 *WLinuxDmabufV1::handle() const | ||
| { | ||
| return nativeInterface<qw_linux_dmabuf_v1>(); | ||
| } | ||
|
|
||
| QByteArrayView WLinuxDmabufV1::interfaceName() const | ||
| { | ||
| return "zwp_linux_dmabuf_v1"; | ||
| } | ||
|
|
||
| void WLinuxDmabufV1::create(WServer *server) | ||
| { | ||
| if (m_handle) | ||
| return; | ||
|
|
||
| if (!m_renderer || !m_renderer->handle()) { | ||
| qCWarning(lcWlLinuxDmabuf) << "Cannot create linux-dmabuf global without renderer"; | ||
| return; | ||
| } | ||
|
|
||
| const auto *formats = m_renderer->get_texture_formats(WLR_BUFFER_CAP_DMABUF); | ||
| if (!formats) { | ||
| qCInfo(lcWlLinuxDmabuf) << "Skipping linux-dmabuf global: renderer does not expose DMA-BUF texture formats"; | ||
| return; | ||
| } | ||
|
|
||
| const int drmFd = m_renderer->get_drm_fd(); | ||
| if (drmFd < 0) { | ||
| qCInfo(lcWlLinuxDmabuf) << "Skipping linux-dmabuf global: renderer has no DRM fd"; | ||
| return; | ||
| } | ||
|
|
||
| m_handle = qw_linux_dmabuf_v1::create_with_renderer(*server->handle(), | ||
| LinuxDmabufV1Version, | ||
| *m_renderer); | ||
| if (!m_handle) { | ||
| qCWarning(lcWlLinuxDmabuf) << "Failed to create renderer-backed linux-dmabuf global"; | ||
| return; | ||
| } | ||
|
|
||
| qCInfo(lcWlLinuxDmabuf) << "Created renderer-backed linux-dmabuf global" | ||
| << "version" << LinuxDmabufV1Version | ||
| << "drm fd" << drmFd; | ||
| } | ||
|
|
||
| void WLinuxDmabufV1::destroy([[maybe_unused]] WServer *server) | ||
| { | ||
| // wlroots owns this global and destroys it from the display destroy listener. | ||
| } | ||
|
|
||
| wl_global *WLinuxDmabufV1::global() const | ||
| { | ||
| if (auto *native = handle()) | ||
| return native->handle()->global; | ||
|
|
||
| return nullptr; | ||
| } | ||
|
|
||
| WAYLIB_SERVER_END_NAMESPACE |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这行应该可以直接删掉,WRenderHelper::setupRendererBackend(); 会找到合适的backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的设置不要紧,只是告诉Qt如果用opengl,应该用gles版本,不会影响treeland和QtQuick的渲染引擎。