-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Vulkan DRM/KMS support #13222
base: master
Are you sure you want to change the base?
Vulkan DRM/KMS support #13222
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ enum class WindowSystemType | |
Wayland, | ||
FBDev, | ||
Haiku, | ||
DRM, | ||
}; | ||
|
||
struct WindowSystemInfo | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2018 Dolphin Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include <unistd.h> | ||
|
||
#include "DolphinNoGUI/Platform.h" | ||
|
||
#include "Common/MsgHandler.h" | ||
#include "Core/ConfigManager.h" | ||
#include "Core/Core.h" | ||
#include "Core/State.h" | ||
#include "Core/System.h" | ||
|
||
#include <climits> | ||
#include <cstdio> | ||
#include <thread> | ||
|
||
#include <fcntl.h> | ||
#include <sys/types.h> | ||
|
||
namespace | ||
{ | ||
class PlatformDRM : public Platform | ||
{ | ||
public: | ||
void SetTitle(const std::string& string) override; | ||
void MainLoop() override; | ||
|
||
WindowSystemInfo GetWindowSystemInfo() const override; | ||
}; | ||
|
||
void PlatformDRM::SetTitle(const std::string& string) | ||
{ | ||
std::fprintf(stdout, "%s\n", string.c_str()); | ||
} | ||
|
||
void PlatformDRM::MainLoop() | ||
{ | ||
while (IsRunning()) | ||
{ | ||
UpdateRunningFlag(); | ||
Core::HostDispatchJobs(Core::System::GetInstance()); | ||
|
||
// TODO: Is this sleep appropriate? | ||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); | ||
Comment on lines
+44
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am interested to hear those more experienced with Dolphin who can weigh on for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just copied and pasted from a different platform |
||
} | ||
} | ||
|
||
WindowSystemInfo PlatformDRM::GetWindowSystemInfo() const | ||
{ | ||
WindowSystemInfo wsi; | ||
wsi.type = WindowSystemType::DRM; | ||
wsi.display_connection = nullptr; // EGL_DEFAULT_DISPLAY | ||
wsi.render_window = nullptr; | ||
wsi.render_surface = nullptr; | ||
return wsi; | ||
} | ||
} // namespace | ||
|
||
std::unique_ptr<Platform> Platform::CreateDRMPlatform() | ||
{ | ||
return std::make_unique<PlatformDRM>(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,10 +57,10 @@ endif() | |
|
||
# Only include the Vulkan headers when building the Vulkan backend | ||
target_include_directories(videovulkan | ||
PRIVATE | ||
${CMAKE_SOURCE_DIR}/Externals/Vulkan-Headers/include | ||
${CMAKE_SOURCE_DIR}/Externals/VulkanMemoryAllocator/include | ||
${CMAKE_SOURCE_DIR}/Externals/libadrenotools/include | ||
PRIVATE | ||
${CMAKE_SOURCE_DIR}/Externals/Vulkan-Headers/include | ||
${CMAKE_SOURCE_DIR}/Externals/VulkanMemoryAllocator/include | ||
${CMAKE_SOURCE_DIR}/Externals/libadrenotools/include | ||
Comment on lines
-60
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't disagree with this formatting change, but since there are no other changes besides formatting I'm not sure it should be in this PR. |
||
) | ||
|
||
if(MSVC) | ||
|
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.
I'm not sure why this is highlighted in blue, its not a C++ keyword. Anyone know?
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.
Probably just a syntax highlighting glitch