Build the Vulkan backend on CI
This commit is contained in:
parent
3cf6c9df0c
commit
b36b501f5e
|
@ -13,7 +13,7 @@ install:
|
||||||
build_script:
|
build_script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake -DNXT_USE_WERROR=1 ..
|
- cmake -DNXT_USE_WERROR=1 -DNXT_ENABLE_VULKAN=1 ..
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# TODO(cwallez@chromium.org) test on more than Debug.
|
# TODO(cwallez@chromium.org) test on more than Debug.
|
||||||
|
|
|
@ -53,11 +53,14 @@ script:
|
||||||
# Use the more recent compilers we just installed
|
# Use the more recent compilers we just installed
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi
|
||||||
|
|
||||||
|
# Build the Vulkan backend on Linux
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BUILD_VULKAN=1; else export BUILD_VULKAN=0; fi
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
- mkdir -p build
|
- mkdir -p build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake --version
|
- cmake --version
|
||||||
- cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DNXT_USE_WERROR=1 ..
|
- cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DNXT_USE_WERROR=1 -DNXT_ENABLE_VULKAN=$BUILD_VULKAN ..
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace backend { namespace vulkan {
|
||||||
|
|
||||||
// Write to the staging buffer
|
// Write to the staging buffer
|
||||||
ASSERT(allocation.GetMappedPointer() != nullptr);
|
ASSERT(allocation.GetMappedPointer() != nullptr);
|
||||||
memcpy(allocation.GetMappedPointer(), data, size);
|
memcpy(allocation.GetMappedPointer(), data, static_cast<size_t>(size));
|
||||||
|
|
||||||
// Enqueue host write -> transfer src barrier and copy command
|
// Enqueue host write -> transfer src barrier and copy command
|
||||||
VkCommandBuffer commands = mDevice->GetPendingCommandBuffer();
|
VkCommandBuffer commands = mDevice->GetPendingCommandBuffer();
|
||||||
|
|
|
@ -339,6 +339,10 @@ namespace backend { namespace vulkan {
|
||||||
usedKnobs->debugReport = true;
|
usedKnobs->debugReport = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (mGlobalInfo.surface) {
|
||||||
|
extensionsToRequest.push_back(kExtensionNameKhrSurface);
|
||||||
|
usedKnobs->surface = true;
|
||||||
|
}
|
||||||
|
|
||||||
VkApplicationInfo appInfo;
|
VkApplicationInfo appInfo;
|
||||||
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||||
|
@ -448,14 +452,15 @@ namespace backend { namespace vulkan {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkBool32 Device::OnDebugReportCallback(VkDebugReportFlagsEXT flags,
|
VKAPI_ATTR VkBool32 VKAPI_CALL
|
||||||
VkDebugReportObjectTypeEXT /*objectType*/,
|
Device::OnDebugReportCallback(VkDebugReportFlagsEXT flags,
|
||||||
uint64_t /*object*/,
|
VkDebugReportObjectTypeEXT /*objectType*/,
|
||||||
size_t /*location*/,
|
uint64_t /*object*/,
|
||||||
int32_t /*messageCode*/,
|
size_t /*location*/,
|
||||||
const char* /*pLayerPrefix*/,
|
int32_t /*messageCode*/,
|
||||||
const char* pMessage,
|
const char* /*pLayerPrefix*/,
|
||||||
void* /*pUserdata*/) {
|
const char* pMessage,
|
||||||
|
void* /*pUserdata*/) {
|
||||||
std::cout << pMessage << std::endl;
|
std::cout << pMessage << std::endl;
|
||||||
ASSERT((flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) == 0);
|
ASSERT((flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) == 0);
|
||||||
|
|
||||||
|
|
|
@ -147,14 +147,15 @@ namespace backend { namespace vulkan {
|
||||||
void GatherQueueFromDevice();
|
void GatherQueueFromDevice();
|
||||||
|
|
||||||
bool RegisterDebugReport();
|
bool RegisterDebugReport();
|
||||||
static VkBool32 OnDebugReportCallback(VkDebugReportFlagsEXT flags,
|
static VKAPI_ATTR VkBool32 VKAPI_CALL
|
||||||
VkDebugReportObjectTypeEXT objectType,
|
OnDebugReportCallback(VkDebugReportFlagsEXT flags,
|
||||||
uint64_t object,
|
VkDebugReportObjectTypeEXT objectType,
|
||||||
size_t location,
|
uint64_t object,
|
||||||
int32_t messageCode,
|
size_t location,
|
||||||
const char* pLayerPrefix,
|
int32_t messageCode,
|
||||||
const char* pMessage,
|
const char* pLayerPrefix,
|
||||||
void* pUserdata);
|
const char* pMessage,
|
||||||
|
void* pUserdata);
|
||||||
|
|
||||||
// To make it easier to use fn it is a public const member. However
|
// To make it easier to use fn it is a public const member. However
|
||||||
// the Device is allowed to mutate them through these private methods.
|
// the Device is allowed to mutate them through these private methods.
|
||||||
|
|
|
@ -32,9 +32,7 @@ namespace utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLFWwindow* window = nullptr;
|
SwapChainImplVulkan(GLFWwindow* /*window*/) {
|
||||||
|
|
||||||
SwapChainImplVulkan(GLFWwindow* window) : window(window) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~SwapChainImplVulkan() {
|
~SwapChainImplVulkan() {
|
||||||
|
|
Loading…
Reference in New Issue