Commit 3b8657af authored by Florian Oetke's avatar Florian Oetke
Browse files

fixed vulkan warnings and special case to disable labels (-DMIRRAGE_VULKAN_USE_LABELS=OFF)

parent 40377081
......@@ -32,6 +32,11 @@ add_library(mirrage_graphic STATIC
add_library(mirrage::graphic ALIAS mirrage_graphic)
target_compile_features(mirrage_graphic PUBLIC cxx_std_17)
option(MIRRAGE_VULKAN_USE_LABELS "Use labels if VK_EXT_DEBUG_UTILS_EXTENSION_NAME is available" ON)
if(NOT MIRRAGE_VULKAN_USE_LABELS)
target_compile_definitions(mirrage_graphic PRIVATE MIRRAGE_IGNORE_VULKAN_LABELS)
endif()
set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_compile_options(mirrage_graphic PRIVATE ${MIRRAGE_DEFAULT_COMPILER_ARGS})
......
......@@ -82,8 +82,8 @@ namespace mirrage {
std::unordered_map<std::string, Window_ptr> _windows;
PFN_vkCmdBeginDebugUtilsLabelEXT _vkCmdBeginDebugUtilsLabelEXT;
PFN_vkCmdEndDebugUtilsLabelEXT _vkCmdEndDebugUtilsLabelEXT;
PFN_vkCmdBeginDebugUtilsLabelEXT _vkCmdBeginDebugUtilsLabelEXT = nullptr;
PFN_vkCmdEndDebugUtilsLabelEXT _vkCmdEndDebugUtilsLabelEXT = nullptr;
auto _find_window_settings(const std::string& name, int width, int height) -> Window_settings;
};
......
......@@ -321,6 +321,7 @@ namespace mirrage::graphic {
_debug_callback = _instance->createDebugUtilsMessengerEXTUnique(create_info);
}
#ifndef MIRRAGE_VULKAN_USE_LABELS
_vkCmdBeginDebugUtilsLabelEXT = reinterpret_cast<PFN_vkCmdBeginDebugUtilsLabelEXT>(
vkGetInstanceProcAddr(*_instance, "vkCmdBeginDebugUtilsLabelEXT"));
_vkCmdEndDebugUtilsLabelEXT = reinterpret_cast<PFN_vkCmdEndDebugUtilsLabelEXT>(
......@@ -332,6 +333,7 @@ namespace mirrage::graphic {
LOG(plog::warning) << "vkCmdBeginDebugUtilsLabelEXT/vkCmdEndDebugUtilsLabelEXT extension "
"function not found.";
}
#endif
for(auto&& [_, window] : _windows) {
(void) _;
......
......@@ -763,9 +763,21 @@ namespace mirrage::renderer {
return current_score;
}
void Particle_pass_factory::configure_device(vk::PhysicalDevice,
void Particle_pass_factory::configure_device(vk::PhysicalDevice pd,
util::maybe<std::uint32_t>,
graphic::Device_create_info&)
graphic::Device_create_info& ci)
{
auto features = pd.getFeatures();
if(features.fragmentStoresAndAtomics) {
ci.features.fragmentStoresAndAtomics = true;
} else {
LOG(plog::warning) << "Feature fragmentStoresAndAtomics is not supported.";
}
if(features.vertexPipelineStoresAndAtomics) {
ci.features.vertexPipelineStoresAndAtomics = true;
} else {
LOG(plog::warning) << "Feature vertexPipelineStoresAndAtomics is not supported.";
}
}
} // namespace mirrage::renderer
......@@ -572,5 +572,17 @@ namespace mirrage::renderer {
LOG(plog::warning) << "Feature independentBlend is not supported. Transparent objects will not "
"be rendered!";
}
if(features.fragmentStoresAndAtomics) {
ci.features.fragmentStoresAndAtomics = true;
} else {
LOG(plog::warning) << "Feature fragmentStoresAndAtomics is not supported.";
}
if(features.vertexPipelineStoresAndAtomics) {
ci.features.vertexPipelineStoresAndAtomics = true;
} else {
LOG(plog::warning) << "Feature vertexPipelineStoresAndAtomics is not supported.";
}
}
} // namespace mirrage::renderer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment