Skip to content

Commit

Permalink
Enabled Vulkan on Linux (closed DiligentGraphics/DiligentCore#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 7, 2018
1 parent 1c95a4a commit 9d4f206
Show file tree
Hide file tree
Showing 12 changed files with 366 additions and 33 deletions.
70 changes: 54 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Samples/AntTweakBar/AntTweakBarSample",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Samples/AntTweakBar/assets",
"environment": [],
Expand All @@ -28,7 +28,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Samples/Atmosphere/AtmosphereSample",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Samples/Atmosphere/assets",
"environment": [],
Expand All @@ -47,7 +47,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/unityplugin/GhostCubeScene/GhostCubeScene",
"args": [],
"args": ["mode=gl"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/unityplugin/GhostCubeScene/assets",
"environment": [],
Expand All @@ -66,7 +66,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial00_HelloLinux/Tutorial00_HelloLinux",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial00_HelloLinux",
"environment": [],
Expand All @@ -79,13 +79,13 @@
"ignoreFailures": true
}
]
},
},
{
"name": "Tutorial01_HelloTriangle",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial01_HelloTriangle/Tutorial01_HelloTriangle",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial01_HelloTriangle/assets",
"environment": [],
Expand All @@ -104,7 +104,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial02_Cube/Tutorial02_Cube",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial02_Cube/assets",
"environment": [],
Expand All @@ -123,7 +123,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial03_Texturing/Tutorial03_Texturing",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial03_Texturing/assets",
"environment": [],
Expand All @@ -142,7 +142,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial04_Instancing/Tutorial04_Instancing",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial04_Instancing/assets",
"environment": [],
Expand All @@ -161,7 +161,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial05_TextureArray/Tutorial05_TextureArray",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial05_TextureArray/assets",
"environment": [],
Expand All @@ -180,7 +180,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial06_Multithreading/Tutorial06_Multithreading",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial06_Multithreading/assets",
"environment": [],
Expand All @@ -199,7 +199,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial07_GeometryShader/Tutorial07_GeometryShader",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial07_GeometryShader/assets",
"environment": [],
Expand All @@ -218,7 +218,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial08_Tessellation/Tutorial08_Tessellation",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial08_Tessellation/assets",
"environment": [],
Expand All @@ -237,7 +237,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial09_Quads/Tutorial09_Quads",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial09_Quads/assets",
"environment": [],
Expand All @@ -251,12 +251,50 @@
}
]
},
{
"name": "Tutorial10_DataStreaming",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial10_DataStreaming/Tutorial10_DataStreaming",
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial10_DataStreaming/assets",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Tutorial11_ResourceUpdates",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/DiligentSamples/Tutorials/Tutorial11_ResourceUpdates/Tutorial11_ResourceUpdates",
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/DiligentSamples/Tutorials/Tutorial11_ResourceUpdates/assets",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "TestApp",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmk_build/Tests/TestApp/TestApp",
"args": [],
"args": ["mode=vk"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/Tests/TestApp/assets",
"environment": [],
Expand All @@ -269,6 +307,6 @@
"ignoreFailures": true
}
]
}
}
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"*.fxh": "cpp"
"*.fxh": "cpp",
"xcb.h": "c"
}
}
7 changes: 6 additions & 1 deletion Common/NativeApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,12 @@ elseif(PLATFORM_LINUX)
PUBLIC
include/Linux
)

if(VULKAN_SUPPORTED)
target_link_libraries(NativeAppBase
PRIVATE
xcb
)
endif()
elseif(PLATFORM_MACOS)
target_include_directories(NativeAppBase PUBLIC
src/MacOS
Expand Down
9 changes: 9 additions & 0 deletions Common/NativeApp/include/Linux/LinuxAppBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,20 @@
# undef False
#endif

#if VULKAN_SUPPORTED
#include <xcb/xcb.h>
#endif

#include "AppBase.h"

class LinuxAppBase : public AppBase
{
public:
virtual void OnGLContextCreated(Display* display, Window window) = 0;
virtual int HandleXEvent(XEvent *xev){}

#if VULKAN_SUPPORTED
virtual void InitVulkan(xcb_connection_t* connection, uint32_t window) = 0;
virtual void HandleXCBEvent(xcb_generic_event_t* event){}
#endif
};
Loading

0 comments on commit 9d4f206

Please sign in to comment.