Testing / example code
Hey. Thanks for your work. Any chance that you have some example code that really works (able to render anything) with headless surface?
First I tried to modify famous vkcube app to use vkCreateHeadlessSurfaceEXT(). Surface creation seems to pass (function returns without any error and the pointer is filled with some address), but than the app crashes in
demo->fpGetPhysicalDeviceSurfaceSupportKHR(demo->gpu, i, demo->surface, &supportsPresent[i]);
If I replace this line with
supportsPresent[i] = 1;
it than crashes in
demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, &formatCount, surfFormats);
etc.
I am very new to Vulkan (just about 4 hours) and I suspect that I am doing something wrong. But I've also tried to compile that SaschaWillems' (not that I like his style) repository with -DUSE_HEADLESS and everything there crashes too.
In case you care, my goal is to make vulkan apps run on X11/wayland servers that don't support DRI and can only use shared memory. We currently have more or less working vulkan driver (called turnip) for adreno GPUs that can work even with proprietary kernels on Android devices, but existing Android X11/wayland solutions don't support DRI. So I hoped that I can hook some functions, force all vulkan apps to render to some offscreen buffer, than download image and send it to X11 window through shared memory. I already did so a long time ago using libhybris.