TestBase* testPtr);
~RayTracingMiscTestInstance ( void);
- bool init (void);
tcu::TestStatus iterate (void);
protected:
RayTracingMiscTestInstance::RayTracingMiscTestInstance (Context& context,
const CaseDef& data,
TestBase* testPtr)
- : vkt::TestInstance (context)
- , m_data (data)
- , m_testPtr (testPtr)
+ : vkt::TestInstance (context)
+ , m_data (data)
+ , m_rayTracingPropsPtr (makeRayTracingProperties(context.getInstanceInterface(),
+ context.getPhysicalDevice()))
+ , m_testPtr (testPtr)
{
-}
+ m_testPtr->init(m_context, m_rayTracingPropsPtr.get());
+ }
RayTracingMiscTestInstance::~RayTracingMiscTestInstance(void)
{
/* Stub */
}
-bool RayTracingMiscTestInstance::init()
+void RayTracingMiscTestInstance::checkSupport(void) const
{
- const auto& instanceInterface = m_context.getInstanceInterface();
- const auto& physicalDeviceVk = m_context.getPhysicalDevice ();
-
- m_rayTracingPropsPtr = makeRayTracingProperties(instanceInterface,
- physicalDeviceVk);
-
- return true;
+ if (m_testPtr->getResultBufferSize() > m_context.getDeviceVulkan11Properties().maxMemoryAllocationSize)
+ TCU_THROW(NotSupportedError, "VkPhysicalDeviceVulkan11Properties::maxMemoryAllocationSize too small, allocation might fail");
}
de::MovePtr<BufferWithMemory> RayTracingMiscTestInstance::runTest(void)
Allocator& allocator = m_context.getDefaultAllocator ();
de::MovePtr<BufferWithMemory> resultBufferPtr;
- auto rtPropertiesPtr = makeRayTracingProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice() );
-
- m_testPtr->init(m_context,
- rtPropertiesPtr.get() );
// Determine group indices
const auto ahitCollectionShaderNameVec = m_testPtr->getAHitShaderCollectionShaderNames ();
0u /* flags */);
{
m_testPtr->initAS( m_context,
- rtPropertiesPtr.get(),
+ m_rayTracingPropsPtr.get(),
*cmdBufferPtr);
std::vector<TopLevelAccelerationStructure*> tlasPtrVec = m_testPtr->getTLASPtrVecToBind();
tcu::TestStatus RayTracingMiscTestInstance::iterate (void)
{
+ checkSupport();
+
const de::MovePtr<BufferWithMemory> bufferGPUPtr = runTest();
const deUint32* bufferGPUDataPtr = (deUint32*) bufferGPUPtr->getAllocation().getHostPtr();
const bool result = m_testPtr->verifyResultBuffer(bufferGPUDataPtr);
m_data,
m_testPtr.get () );
- newTestInstancePtr->init();
-
return newTestInstancePtr;
}