{
public:
BufferViewTestInstance (Context& ctx,
- BufferViewCaseParameters createInfo)
- : TestInstance (ctx)
- , m_testCase (createInfo)
- {}
+ BufferViewCaseParameters createInfo);
virtual tcu::TestStatus iterate (void);
private:
BufferViewCaseParameters m_testCase;
};
+BufferViewTestInstance::BufferViewTestInstance (Context& ctx,
+ BufferViewCaseParameters createInfo)
+ : TestInstance (ctx)\r
+ , m_testCase (createInfo)
+{
+ if (m_context.getDeviceFeatures().sparseBinding == 0 && m_testCase.beforeAllocateMemory == false)\r
+ throw tcu::NotSupportedError("The test is not supported - it needs missing 'sparseBinding' feature of Vulkan");
+}
+
tcu::TestStatus BufferViewTestInstance::iterate (void)
{
// Create buffer
VkMemoryRequirements memReqs;
const VkBufferCreateInfo bufferParams =
{
- VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_BUFFER_CREATE_SPARSE_BINDING_BIT, // VkBufferCreateFlags flags;
- size, // VkDeviceSize size;
- m_testCase.usage, // VkBufferUsageFlags usage;
- VK_SHARING_MODE_EXCLUSIVE, // VkSharingMode sharingMode;
- 1u, // deUint32 queueFamilyCount;
- &queueFamilyIndex, // const deUint32* pQueueFamilyIndices;
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ m_testCase.beforeAllocateMemory == true ? 0 : VK_BUFFER_CREATE_SPARSE_BINDING_BIT, // VkBufferCreateFlags flags;
+ size, // VkDeviceSize size;
+ m_testCase.usage, // VkBufferUsageFlags usage;
+ VK_SHARING_MODE_EXCLUSIVE, // VkSharingMode sharingMode;
+ 1u, // deUint32 queueFamilyCount;
+ &queueFamilyIndex, // const deUint32* pQueueFamilyIndices;
};
if (vk.createBuffer(vkDevice, &bufferParams, (const VkAllocationCallbacks*)DE_NULL, &testBuffer) != VK_SUCCESS)