-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
SDL/X11 Vulkan init #10413
SDL/X11 Vulkan init #10413
Conversation
1e0aea9
to
4d6fa41
Compare
why not use the sdl support? |
set(ANDROID ON) | ||
endif() | ||
|
||
# Of the CMake platforms, we only support Vulkan on Android and Windows. |
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.
Comment is now out of date.
I suppose we could support it on BSD too, right? Seems like we could just do if(NOT APPLE)
?
-[Unknown]
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.
Yeah, probably. Would be good to have someone to test it ... not running BSD on any of my boxes.
Common/Vulkan/VulkanContext.h
Outdated
@@ -20,8 +20,10 @@ | |||
#elif defined(__ANDROID__) // _WIN32 | |||
#include <android/native_window_jni.h> | |||
#define VK_USE_PLATFORM_ANDROID_KHR | |||
#elif defined(VK_USE_PLATFORM_XLIB_KHR) | |||
#include <X11/Xlib.h> | |||
#include <X11/Xutil.h> |
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.
Is it at all possible for us to use typedefs to avoid these headers in VulkanContext.h
? Even if xcb_window_t
has to be a pointer that's simply new/deleted?
Just trying to avoid more unexpected issues with those headers...
-[Unknown]
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.
Yeah, that's probably a good idea..
ext/native/base/PCMain.cpp
Outdated
lastT = t; | ||
} | ||
#endif | ||
graphicsContext->SwapBuffers(); |
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.
Does this mean we no longer allow unthrottle properly, or does it work now even without skipping the swapping above?
-[Unknown]
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.
This unthrottle was bad because it ignored control mapping and sat here as a strange hack. If we want that kind of unthrottle we should do it properly, until then we can use frameskip unthrottle on Linux. Though, I should of course make sure that works....
@@ -191,7 +191,7 @@ void GameSettingsScreen::CreateViews() { | |||
} | |||
#endif | |||
bool vulkanAvailable = false; | |||
#if PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(ANDROID) | |||
#ifndef IOS |
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.
CMakeLists.txt
Outdated
if(LINUX) | ||
message("Using direct to display extension...") | ||
if(LINUX AND VULKAN) | ||
message("Using XCB extension...") |
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.
Err?
-[Unknown]
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.
This stuff went through a few iterations very quickly, oops :) (had strange issues so I tried switching to the xcb stuff but then found out what the problem with the x11 stuff was and fixed that and went back...).
I'll clean things up soon.
@davidbepo because I installed the latest ubuntu and the provided version of SDL did not yet support it, so I don't want to require it yet. |
WOW nice advance with mesa3d vulkan intel driver only work the UI this detected 1.0.57 version and these extensions But when load any game said DrawEngineVulkan.cpp:297: INIT : Creating null texture and report segment fault Also add vulkaninfo for more information I debuging too from gdb but not much information crash from libvulkan_intel.so
|
"Creating null texture" is normal, we create a small black texture to use as a replacement if texture creation fails or similar. Our code passes Vulkan validation fine so the crash is likely some kind of driver bug that should be reported to Intel.. Is that everything you could get from the call stack in gdb? (type bt to get the full stack if available) |
@hrydgard Sure with bt returned
|
Thanks. Very likely a driver bug, we don't do anything strange there.. |
Compiled mesa3d from source returned more extra info is stoped by anv :-(
Edit : Fully stack with bt
|
I went ahead and created a bug report upstream: https://bugs.freedesktop.org/show_bug.cgi?id=104346 Please add any missing information that might be relevant, and I suggest you subscribe to that bug in case there are updates. |
…age before binding memory to it. Should help the issue uncovered in #10413
@mrcmunir Alright, turns out this was likely my fault :) I'm gonna push a fix to this branch shortly, stay tuned (through rebasing it on master, where I pushed a fix, so you'll need to reset --hard after fetching this branch again). Thank you so much for the good stack traces. |
4d6fa41
to
8133fa1
Compare
OK, rebase done. Please re-test @mrcmunir :) |
@hrydgard Woah no crash anymore Testing some game with 5x resolution with vulkan and no crash detected In Tales of eternia detected some colours are wrong but fully playable Thanks you. |
@mrcmunir thanks for the testing, can you share performance improvements number please |
@davidbepo I'm only tested with Gen7 (HD4000 mobile) With Big resolution than 4-5x will be unstable fps than OpenGL backend in some games i detected some slowdown like 30fps to 20fps for some seconds or will be little helped with autoframeskip 1 In the next days will try it on a skylake HD 520 GPU.is another notebook that I have and compared too the perfomance. |
That's curious with the wrong colors, probably one of the 16-bit texture formats is backwards, so now I might have two external bug reports to file heh. Thanks for testing! Filed: https://bugs.freedesktop.org/show_bug.cgi?id=104355 |
Turns out that the wrong colors are a shortcoming of that generation of Intel GPUs. The drivers could work around it but they don't, yet. https://bugs.freedesktop.org/show_bug.cgi?id=104355 Might do a workaround in PPSSPP someday but it won't be a high priority. |
@hrydgard oh I see I Suspected it would be something like that, also does not support stencil texture yet and that's why it is also limited to Opengl 4.2 core by default due limitations changes in SIMD work compared with later intel generations and they needed rewrite some parts for some functions in Gen7. Anyway thanks to you at least fixed to the possibilities of the HW driver :) Let's see if I can try it on the other laptop that has GPU skylake |
8133fa1
to
9007abd
Compare
Rebased again. Will merge once it's building everywhere, and leave the final polish (resize, etc) for later. |
Well testing under GPU skylake running fine and the perfomance running about ~3-6fps avg faster than OpenGL in the same conditions limited by gpu i.e in the map final fantasy crisis core with 9x resolution with vulkan running 24-26fps when OpenGL running about 20fps. Also the colours confirmed tale of eternia working in that hw without problem so is confirmed limitation for now in gen7 . no detected any new crash in these games are tested |
That's good news, thanks again for testing. Just for fun I tried to install mesa vulkan drivers on my laptop with nvidia, in order to have a choice to run on the on-board Intel. Unfortunately with both drivers installed it crashes somewhere in X11 when trying to create the surface, so I'm stuck with nVidia for now. |
I just compiled and tested PPSSPP from the last git revision and it fails to start in NVIDIA (issue #10424). Maybe it is related with this pull request? |
just tested on linux, it works fine and there is a performance boost from 1600%/60fps to 2000%/80fps |
@davidbepo @unknownbrackets re: Wayland and BSD: #10449 |
This isn't too pretty, just hacking and slashing until I got it going on my laptop. Window resize not yet working. Feedback appreciated :)
Also it seems that FIFO vsync limiting is not working, it draws like crazy. So does GL on the same laptop though, maybe some issue with the screen being managed by the Intel integrated GPU and rendering happening on the nVidia.
Will fix #9031 .