mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Support specifying next chain to instance creation, and inst extensions
This commit is contained in:
@@ -202,6 +202,12 @@ struct InstanceCreateInfo : public VkInstanceCreateInfo
|
||||
ppEnabledExtensionNames = exts.data();
|
||||
}
|
||||
|
||||
InstanceCreateInfo &next(const void *next)
|
||||
{
|
||||
this->pNext = next;
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator const VkInstanceCreateInfo *() const { return this; }
|
||||
};
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
|
||||
|
||||
if(volk && spv)
|
||||
{
|
||||
enabledInstExts = instExts;
|
||||
|
||||
enabledInstExts.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
|
||||
|
||||
#if defined(WIN32)
|
||||
@@ -137,6 +139,15 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
|
||||
std::vector<VkExtensionProperties> supportedExts;
|
||||
CHECK_VKR(vkh::enumerateInstanceExtensionProperties(supportedExts, NULL));
|
||||
|
||||
for(const char *l : enabledLayers)
|
||||
{
|
||||
std::vector<VkExtensionProperties> tmp;
|
||||
CHECK_VKR(vkh::enumerateInstanceExtensionProperties(tmp, l));
|
||||
|
||||
for(const VkExtensionProperties &t : tmp)
|
||||
supportedExts.push_back(t);
|
||||
}
|
||||
|
||||
// strip any extensions that are not supported
|
||||
for(auto it = enabledInstExts.begin(); it != enabledInstExts.end();)
|
||||
{
|
||||
@@ -186,8 +197,9 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
|
||||
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);
|
||||
VkResult vkr = vkCreateInstance(
|
||||
vkh::InstanceCreateInfo(app, enabledLayers, enabledInstExts).next(instInfoNext), NULL,
|
||||
&inst);
|
||||
|
||||
if(vkr == VK_SUCCESS)
|
||||
{
|
||||
|
||||
@@ -234,6 +234,9 @@ struct VulkanGraphicsTest : public GraphicsTest
|
||||
// device version
|
||||
uint32_t devVersion;
|
||||
|
||||
// a custom struct to pass to vkInstanceCreateInfo::pNext
|
||||
const void *instInfoNext = NULL;
|
||||
|
||||
// requested features
|
||||
VkPhysicalDeviceFeatures features = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user