mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Create highest vulkan instance possible in tests, and save version
This commit is contained in:
@@ -63,6 +63,7 @@ namespace
|
||||
{
|
||||
bool volk = false;
|
||||
bool spv = false;
|
||||
uint32_t vulkanVersion = 0;
|
||||
VkInstance inst = VK_NULL_HANDLE;
|
||||
VkPhysicalDevice selectedPhys = VK_NULL_HANDLE;
|
||||
std::vector<const char *> enabledInstExts;
|
||||
@@ -162,8 +163,13 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
|
||||
enabledInstExts.push_back(search);
|
||||
}
|
||||
|
||||
vulkanVersion = volkGetInstanceVersion();
|
||||
|
||||
vkh::ApplicationInfo app("RenderDoc autotesting", VK_MAKE_VERSION(1, 0, 0),
|
||||
"RenderDoc autotesting", VK_MAKE_VERSION(1, 0, 0), VK_API_VERSION_1_0);
|
||||
"RenderDoc autotesting", VK_MAKE_VERSION(1, 0, 0), vulkanVersion);
|
||||
|
||||
TEST_LOG("Initialising Vulkan at VK%u.%u", VK_VERSION_MAJOR(vulkanVersion),
|
||||
VK_VERSION_MINOR(vulkanVersion));
|
||||
|
||||
VkResult vkr = vkCreateInstance(vkh::InstanceCreateInfo(app, enabledLayers, enabledInstExts),
|
||||
NULL, &inst);
|
||||
@@ -319,6 +325,17 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
|
||||
|
||||
vkGetPhysicalDeviceProperties(phys, &physProperties);
|
||||
|
||||
instVersion = vulkanVersion;
|
||||
devVersion = physProperties.apiVersion;
|
||||
|
||||
if(std::find(enabledInstExts.begin(), enabledInstExts.end(),
|
||||
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) != enabledInstExts.end())
|
||||
{
|
||||
vkh::PhysicalDeviceProperties2KHR props2;
|
||||
vkGetPhysicalDeviceProperties2KHR(phys, props2);
|
||||
devVersion = props2.properties.apiVersion;
|
||||
}
|
||||
|
||||
for(const char *search : devExts)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
@@ -249,6 +249,11 @@ struct VulkanGraphicsTest : public GraphicsTest
|
||||
|
||||
std::mutex mutex;
|
||||
|
||||
// instance version
|
||||
uint32_t instVersion;
|
||||
// device version
|
||||
uint32_t devVersion;
|
||||
|
||||
// requested features
|
||||
VkPhysicalDeviceFeatures features = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user