class BufferValidator
{
public:
- BufferValidator (const ValidationData<T> data)
+ BufferValidator (const ValidationData<T> data, vk::VkFormat format)
: m_refData (data)
, m_refDataStorage (*reinterpret_cast<ValidationDataStorage<T>*>( &std::vector<char>(sizeof(ValidationDataStorage<T>), '\0').front()))
, m_bufferType (SAMPLER_BUFFER)
+ , m_format (format)
{
}
- BufferValidator (const ValidationDataStorage<T> data)
+ BufferValidator (const ValidationDataStorage<T> data, vk::VkFormat format)
: m_refData (*reinterpret_cast<ValidationData<T>*>( &std::vector<char>(sizeof(ValidationData<T>), '\0').front()))
, m_refDataStorage (data)
, m_bufferType (STORAGE_BUFFER)
+ , m_format (format)
{
}
const ValidationDataStorage<T> m_refDataStorage;
BufferType m_bufferType;
+ vk::VkFormat m_format;
};
template<>
DE_NULL, // const void* pNext
0u, // VkBufferViewCreateFlags flags
buffer, // VkBuffer buffer
- vk::VK_FORMAT_R32G32B32A32_UINT, // VkFormat format
+ m_format, // VkFormat format
0u, // VkDeviceSize offset
VK_WHOLE_SIZE // VkDeviceSize range
};
const std::string& name,
vk::VkClearColorValue fillValue,
ValidationData<T> data,
- CmdBufferType cmdBufferType)
+ CmdBufferType cmdBufferType,
+ vk::VkFormat format)
: TestCase (testCtx, name, "Copy image to buffer.")
, m_fillValue (fillValue)
- , m_validator (data)
+ , m_validator (data, format)
, m_cmdBufferType (cmdBufferType)
{
}
DE_ASSERT(testData[ndx].data.positions[3].x() < MAX_POSITION);
const std::string name = "copy_" + de::toString(ndx + 1);
- copyStaticTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdBufferType));
+ copyStaticTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
}
/* Add a few randomized tests */
DE_ASSERT(data.positions[2].x() < MAX_POSITION);
DE_ASSERT(data.positions[3].x() < MAX_POSITION);
- copyRandomTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), clearValue.color, data, cmdBufferType));
+ copyRandomTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), clearValue.color, data, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
}
std::string groupName = getCmdBufferTypeStr(cmdBufferType);
deUint32 fillValue,
ValidationData<T> data,
CmdType cmdType,
- CmdBufferType cmdBufferType)
+ CmdBufferType cmdBufferType,
+ vk::VkFormat format)
: TestCase (testCtx, name, getTestTypeName(cmdType))
, m_fillValue (fillValue)
- , m_validator (data)
+ , m_validator (data, format)
, m_cmdType (cmdType)
, m_cmdBufferType (cmdBufferType)
{
const std::string name = "test_" + de::toString(ndx + 1);
staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(
- testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType));
+ testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
}
/* Add a few randomized tests */
DE_ASSERT(data.positions[2].x() < MAX_POSITION);
DE_ASSERT(data.positions[3].x() < MAX_POSITION);
- randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType));
+ randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
}
const std::string groupName = getCmdBufferTypeStr(cmdBufferType);
const std::string name = "test_" + de::toString(ndx + 1);
staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(
- testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType));
+ testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SINT));
}
/* Add a few randomized tests */
DE_ASSERT(data.positions[2].x() < MAX_POSITION);
DE_ASSERT(data.positions[3].x() < MAX_POSITION);
- randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType));
+ randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SINT));
}
const std::string groupName = getCmdBufferTypeStr(cmdBufferType);
const std::string name = "test_" + de::toString(ndx + 1);
staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(
- testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdType, cmdBufferType));
+ testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_UINT));
}
/* Add a few randomized tests */
DE_ASSERT(data.positions[2].x() < MAX_POSITION);
DE_ASSERT(data.positions[3].x() < MAX_POSITION);
- randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(testCtx, name.c_str(), fillValue, data, cmdType, cmdBufferType));
+ randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(testCtx, name.c_str(), fillValue, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_UINT));
}
const std::string groupName = getCmdBufferTypeStr(cmdBufferType);
const char* name,
const tcu::UVec4 testInput,
ValidationDataStorage<T> validationData,
+ vk::VkFormat format,
const std::string& extraShader = "")
: TestCase (testctx, name, getSSBOTestDescription(testType))
, m_testType (testType)
, m_shaderType (shaderType)
, m_testInput (testInput)
- , m_validator (validationData)
+ , m_validator (validationData, format)
, m_extraShader (extraShader)
{
}
for (size_t ndx = 0; ndx < testCount; ++ndx)
{
const std::string name = testTypeStr + "_" + de::toString(ndx + 1);
- testGroup->addChild(new StorageBufferTestCase<tcu::UVec4>(testCtx, testType, shaderType, name.c_str(), testData[ndx].values, testData[ndx]));
+ testGroup->addChild(new StorageBufferTestCase<tcu::UVec4>(testCtx, testType, shaderType, name.c_str(), testData[ndx].values, testData[ndx], vk::VK_FORMAT_R32G32B32A32_UINT));
}
return testGroup.release();
calculateAtomicOpData(atomicType, inputValue, atomicArg, atomicCall, refValue, testData[ndx].swapNdx);
ValidationDataStorage<tcu::UVec4> validationData = { refValue };
- staticTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, atomicCall));
+ staticTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, vk::VK_FORMAT_R32G32B32A32_UINT, atomicCall));
}
de::MovePtr<tcu::TestCaseGroup> randomTests (new tcu::TestCaseGroup(testctx, "random", (atomicDesc + " with random input").c_str()));
calculateAtomicOpData(atomicType, inputValue, atomicArg, atomicCall, refValue, ndx);
ValidationDataStorage<tcu::UVec4> validationData = { refValue };
- randomTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, atomicCall));
+ randomTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, vk::VK_FORMAT_R32G32B32A32_UINT, atomicCall));
}