deUint32 getSparseQueueFamilyIndex (void) const { return m_sparseQueueFamilyIndex; }
VkQueue getSparseQueue (void) const;
+ bool hasDebugReportRecorder (void) const { return m_debugReportRecorder.get() != nullptr; }
+ vk::DebugReportRecorder& getDebugReportRecorder (void) const { return *m_debugReportRecorder.get(); }
+
private:
+ using DebugReportRecorderPtr = de::UniquePtr<vk::DebugReportRecorder>;
const deUint32 m_maximumFrameworkVulkanVersion;
const deUint32 m_availableInstanceVersion;
const vector<string> m_instanceExtensions;
const Unique<VkInstance> m_instance;
const InstanceDriver m_instanceInterface;
+ const DebugReportRecorderPtr m_debugReportRecorder;
const VkPhysicalDevice m_physicalDevice;
const deUint32 m_deviceVersion;
const DeviceDriver m_deviceInterface;
};
-static deUint32 sanitizeApiVersion(deUint32 v)
+namespace
+{
+
+deUint32 sanitizeApiVersion(deUint32 v)
{
return VK_MAKE_VERSION( VK_VERSION_MAJOR(v), VK_VERSION_MINOR(v), 0 );
}
+de::MovePtr<vk::DebugReportRecorder> createDebugReportRecorder (const vk::PlatformInterface& vkp, const vk::InstanceInterface& vki, vk::VkInstance instance, bool printValidationErrors)
+{
+ if (isDebugReportSupported(vkp))
+ return de::MovePtr<vk::DebugReportRecorder>(new vk::DebugReportRecorder(vki, instance, printValidationErrors));
+ else
+ TCU_THROW(NotSupportedError, "VK_EXT_debug_report is not supported");
+}
+
+} // anonymous
+
DefaultDevice::DefaultDevice (const PlatformInterface& vkPlatform, const tcu::CommandLine& cmdLine)
: m_maximumFrameworkVulkanVersion (VK_API_MAX_FRAMEWORK_VERSION)
, m_availableInstanceVersion (getTargetInstanceVersion(vkPlatform))
, m_instance (createInstance(vkPlatform, m_usedApiVersion, m_instanceExtensions, cmdLine))
, m_instanceInterface (vkPlatform, *m_instance)
+ , m_debugReportRecorder (cmdLine.isValidationEnabled()
+ ? createDebugReportRecorder(vkPlatform,
+ m_instanceInterface,
+ *m_instance,
+ cmdLine.printValidationErrors())
+ : de::MovePtr<vk::DebugReportRecorder>(DE_NULL))
, m_physicalDevice (chooseDevice(m_instanceInterface, *m_instance, cmdLine))
, m_deviceVersion (getPhysicalDeviceProperties(m_instanceInterface, m_physicalDevice).apiVersion)
isDeviceFunctionalitySupported("VK_EXT_buffer_device_address");
}
+bool Context::hasDebugReportRecorder () const
+{
+ return m_device->hasDebugReportRecorder();
+}
+
+vk::DebugReportRecorder& Context::getDebugReportRecorder () const
+{
+ return m_device->getDebugReportRecorder();
+}
+
// TestCase
void TestCase::initPrograms (SourceCollections&) const
using de::MovePtr;
using tcu::TestLog;
-namespace
-{
-
-MovePtr<vk::DebugReportRecorder> createDebugReportRecorder (const vk::PlatformInterface& vkp, const vk::InstanceInterface& vki, vk::VkInstance instance, bool printValidationErrors)
-{
- if (isDebugReportSupported(vkp))
- return MovePtr<vk::DebugReportRecorder>(new vk::DebugReportRecorder(vki, instance, printValidationErrors));
- else
- TCU_THROW(NotSupportedError, "VK_EXT_debug_report is not supported");
-}
-
-} // anonymous
-
// TestCaseExecutor
class TestCaseExecutor : public tcu::TestCaseExecutor
const UniquePtr<vk::Library> m_library;
Context m_context;
- const UniquePtr<vk::DebugReportRecorder> m_debugReportRecorder;
const UniquePtr<vk::RenderDocUtil> m_renderDoc;
vk::VkPhysicalDeviceProperties m_deviceProperties;
tcu::WaiverUtil m_waiverMechanism;
: m_prebuiltBinRegistry (testCtx.getArchive(), "vulkan/prebuilt")
, m_library (createLibrary(testCtx))
, m_context (testCtx, m_library->getPlatformInterface(), m_progCollection)
- , m_debugReportRecorder (testCtx.getCommandLine().isValidationEnabled()
- ? createDebugReportRecorder(m_library->getPlatformInterface(),
- m_context.getInstanceInterface(),
- m_context.getInstance(),
- testCtx.getCommandLine().printValidationErrors())
- : MovePtr<vk::DebugReportRecorder>(DE_NULL))
, m_renderDoc (testCtx.getCommandLine().isRenderDocEnabled()
? MovePtr<vk::RenderDocUtil>(new vk::RenderDocUtil())
: MovePtr<vk::RenderDocUtil>(DE_NULL))
if (m_renderDoc) m_renderDoc->endFrame(m_context.getInstance());
// Collect and report any debug messages
- if (m_debugReportRecorder)
- collectAndReportDebugMessages(*m_debugReportRecorder, m_context);
+ if (m_context.hasDebugReportRecorder())
+ collectAndReportDebugMessages(m_context.getDebugReportRecorder(), m_context);
}
tcu::TestNode::IterateResult TestCaseExecutor::iterate (tcu::TestCase*)