return new SSBOLayoutCaseInstance(context, m_bufferMode, m_interface, m_refLayout, m_initialData, m_writeData, m_usePhysStorageBuffer);
}
-void SSBOLayoutCase::init ()
-{
- computeReferenceLayout (m_refLayout, m_interface);
- initRefDataStorage (m_interface, m_refLayout, m_initialData);
- initRefDataStorage (m_interface, m_refLayout, m_writeData);
- generateValues (m_refLayout, m_initialData.pointers, deStringHash(getName()) ^ 0xad2f7214);
- generateValues (m_refLayout, m_writeData.pointers, deStringHash(getName()) ^ 0x25ca4e7);
- copyNonWrittenData (m_interface, m_refLayout, m_initialData.pointers, m_writeData.pointers);
+void SSBOLayoutCase::delayedInit (void)
+{
+ computeReferenceLayout(m_refLayout, m_interface);
+ initRefDataStorage(m_interface, m_refLayout, m_initialData);
+ initRefDataStorage(m_interface, m_refLayout, m_writeData);
+ generateValues(m_refLayout, m_initialData.pointers, deStringHash(getName()) ^ 0xad2f7214);
+ generateValues(m_refLayout, m_writeData.pointers, deStringHash(getName()) ^ 0x25ca4e7);
+ copyNonWrittenData(m_interface, m_refLayout, m_initialData.pointers, m_writeData.pointers);
m_computeShaderSrc = generateComputeShader(m_interface, m_refLayout, m_initialData.pointers, m_writeData.pointers, m_matrixLoadFlag, m_usePhysStorageBuffer);
}
SSBOLayoutCase (tcu::TestContext& testCtx, const char* name, const char* description, BufferMode bufferMode, MatrixLoadFlags matrixLoadFlag, bool usePhysStorageBuffer);
virtual ~SSBOLayoutCase (void);
+ virtual void delayedInit (void);
virtual void initPrograms (vk::SourceCollections& programCollection) const;
virtual TestInstance* createInstance (Context& context) const;
protected:
- void init (void);
-
BufferMode m_bufferMode;
ShaderInterface m_interface;
MatrixLoadFlags m_matrixLoadFlag;
return new UniformBlockCaseInstance(context, m_bufferMode, m_uniformLayout, m_blockPointers);
}
-void UniformBlockCase::init (void)
+void UniformBlockCase::delayedInit (void)
{
const int vec4Alignment = (int)sizeof(deUint32)*4;
bool shuffleUniformMembers = false);
~UniformBlockCase (void);
+ virtual void delayedInit (void);
virtual void initPrograms (vk::SourceCollections& programCollection) const;
virtual TestInstance* createInstance (Context& context) const;
bool usesBlockLayout (UniformFlags layoutFlag) const { return m_interface.usesBlockLayout(layoutFlag); }
protected:
- void init (void);
-
BufferMode m_bufferMode;
ShaderInterface m_interface;
MatrixLoadFlags m_matrixLoadFlag;
block.setArraySize(numInstances);
block.setInstanceName("block");
}
-
- init();
}
};
block.setInstanceName("block");
block.setArraySize(numInstances);
}
-
- init();
}
};
block.setInstanceName("block");
block.setArraySize(numInstances);
}
-
- init();
}
};
block.setInstanceName("block");
block.setArraySize(numInstances);
}
-
- init();
}
};
block.setInstanceName("block");
block.setArraySize(numInstances);
}
-
- init();
}
};
blockA.setArraySize(numInstances);
blockB.setArraySize(numInstances);
}
-
- init();
}
};
blockA.setArraySize(numInstances);
blockB.setArraySize(numInstances);
}
-
- init();
}
};
block.setInstanceName("block");
block.setArraySize(m_numInstances);
}
-
- init();
}
private:
blockB.setInstanceName("testBlock");
blockB.setArraySize(numInstances);
}
-
- init();
}
};
if (iterator.getState() == tcu::TestHierarchyIterator::STATE_ENTER_NODE &&
tcu::isTestNodeTypeExecutable(iterator.getNode()->getNodeType()))
{
- const TestCase* const testCase = dynamic_cast<TestCase*>(iterator.getNode());
+ TestCase* const testCase = dynamic_cast<TestCase*>(iterator.getNode());
const string casePath = iterator.getNodePath();
vk::ShaderBuildOptions defaultGlslBuildOptions (usedVulkanVersion, baselineSpirvVersion, 0u);
vk::ShaderBuildOptions defaultHlslBuildOptions (usedVulkanVersion, baselineSpirvVersion, 0u);
try
{
+ testCase->delayedInit();
testCase->initPrograms(sourcePrograms);
}
catch (const tcu::NotSupportedError& )
{
}
+void TestCase::delayedInit (void)
+{
+}
+
} // vkt
TestCase (tcu::TestContext& testCtx, tcu::TestNodeType type, const std::string& name, const std::string& description);
virtual ~TestCase (void) {}
+ virtual void delayedInit (void); // non-const init called after checkSupport but before initPrograms
virtual void initPrograms (vk::SourceCollections& programCollection) const;
virtual TestInstance* createInstance (Context& context) const = 0;
virtual void checkSupport (Context& context) const;
void TestCaseExecutor::init (tcu::TestCase* testCase, const std::string& casePath)
{
- const TestCase* vktCase = dynamic_cast<TestCase*>(testCase);
+ TestCase* vktCase = dynamic_cast<TestCase*>(testCase);
tcu::TestLog& log = m_context.getTestContext().getLog();
const deUint32 usedVulkanVersion = m_context.getUsedApiVersion();
const vk::SpirvVersion baselineSpirvVersion = vk::getBaselineSpirvVersion(usedVulkanVersion);
vktCase->checkSupport(m_context);
+ vktCase->delayedInit();
+
m_progCollection.clear();
vktCase->initPrograms(sourceProgs);