jwinarske / meta-vulkan

Yocto Vulkan Layer
MIT License
10 stars 4 forks source link

Build sasha samples with directfb support #10

Closed dbeulen closed 7 months ago

dbeulen commented 2 years ago

Hy I'm trying to build the sasha-samples with DirectFB support and swiftshader, to test vulkan on an imx7 without GPU. During the compile phase i ran into a error i could not solve on my own.

Sasha-Samples

I made the following changes to the recipe of the sasha-samples_git.bb:

Added directfb and the vulkan-headers to DEPENDS

DEPENDS += "  \   
    compiler-rt \  
    libcxx \  
    openmp \  
    vulkan-loader \  
    vulkan-headers \  
    directfb \  
   "

Added -D USE_DIRECTFB_WSI=ON to EXTRA_OECMAKE

EXTRA_OECMAKE += "  \ 
-DRESOURCE_INSTALL_DIR=${datadir}/vulkan-samples/assets \ 
-DCMAKE_INSTALL_BINDIR=${bindir}/vulkan-samples \  
-DUSE_DIRECTFB_WSI=ON \ 
 "

But this results in a linker error during compiling: /usr/src/debug/sascha-samples/git-r0/git/base/VulkanSwapChain.cpp:65: undefined reference to 'vkCreateDirectFBSurfaceEXT'

I believe it should be linked against vulkan lib file? But im not sure how to do so with yocto. Could you give any hints?

Full log attached: log.do_compile.2309418.txt

Swiftshader (Compiles succesfully)

By the way, i also changed the swiftshader_git.bb file, so it supports directfb, this compiles sucessfully. Changes i made:

Added directfb to DEPENDS

DEPENDS += "\
    compiler-rt \
    libcxx \
    libdrm \
    vulkan-headers \
    directfb \
   "

Add directfb to RDEPENDS RDEPENDS:${PN} += " directfb"

Add -D SWIFTSHADER_BUILD_WSI_DIRECTFB=ON to EXTRA_OEMAKE:

    -D SWIFTSHADER_BUILD_EGL=OFF \
    -D SWIFTSHADER_BUILD_GLESv2=OFF \
    -D SWIFTSHADER_BUILD_VULKAN=TRUE \
    -D SWIFTSHADER_BUILD_WSI_D2D=ON \
    -D SWIFTSHADER_BUILD_PVR=FALSE \
    -D SWIFTSHADER_GET_PVR=FALSE \
    -D SWIFTSHADER_BUILD_ANGLE=FALSE \
    -D SWIFTSHADER_BUILD_TESTS=OFF \
    -D SWIFTSHADER_BUILD_BENCHMARKS=OFF \
    -D SWIFTSHADER_USE_GROUP_SOURCES=OFF \
    -D SWIFTSHADER_WARNINGS_AS_ERRORS=OFF \
    -D SWIFTSHADER_BUILD_WSI_DIRECTFB=ON \
    "
jwinarske commented 2 years ago

@dbeulen I would use Direct 2 Display (WSI_D2D) for SwiftShader, and disable WSI_DIRECTFB in all cases: https://github.com/SaschaWillems/Vulkan/blob/master/CMakeLists.txt#L18

jwinarske commented 2 years ago

@dbeulen If you come up with working scenario feel free to create a PR.