return isLayerSupported(layers.begin(), layers.end(), required);
}
+VkQueue getDeviceQueue (const DeviceInterface& vkd, VkDevice device, deUint32 queueFamilyIndex, deUint32 queueIndex)
+{
+ VkQueue queue;
+
+ vkd.getDeviceQueue(device, queueFamilyIndex, queueIndex, &queue);
+
+ return queue;
+}
+
} // vk
std::vector<VkLayerProperties> enumerateDeviceLayerProperties (const InstanceInterface& vki, VkPhysicalDevice physicalDevice);
std::vector<VkExtensionProperties> enumerateDeviceExtensionProperties (const InstanceInterface& vki, VkPhysicalDevice physicalDevice, const char* layerName);
+VkQueue getDeviceQueue (const DeviceInterface& vkd, VkDevice device, deUint32 queueFamilyIndex, deUint32 queueIndex);
+
// Feature / extension support
bool isShaderStageSupported (const VkPhysicalDeviceFeatures& deviceFeatures, VkShaderStageFlagBits stage);
return Move<VkDescriptorSet>(check<VkDescriptorSet>(object), Deleter<VkDescriptorSet>(vk, device, pAllocateInfo->descriptorPool));
}
+Move<VkSemaphore> createSemaphore (const DeviceInterface& vk,
+ VkDevice device,
+ VkSemaphoreCreateFlags flags,
+ const VkAllocationCallbacks* pAllocator)
+{
+ const VkSemaphoreCreateInfo createInfo =
+ {
+ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
+ DE_NULL,
+
+ flags
+ };
+
+ return createSemaphore(vk, device, &createInfo, pAllocator);
+}
+
+Move<VkFence> createFence (const DeviceInterface& vk,
+ VkDevice device,
+ VkFenceCreateFlags flags,
+ const VkAllocationCallbacks* pAllocator)
+{
+ const VkFenceCreateInfo createInfo =
+ {
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ DE_NULL,
+
+ flags
+ };
+
+ return createFence(vk, device, &createInfo, pAllocator);
+}
+
+Move<VkCommandPool> createCommandPool (const DeviceInterface& vk,
+ VkDevice device,
+ VkCommandPoolCreateFlags flags,
+ deUint32 queueFamilyIndex,
+ const VkAllocationCallbacks* pAllocator)
+{
+ const VkCommandPoolCreateInfo createInfo =
+ {
+ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ DE_NULL,
+
+ flags,
+ queueFamilyIndex
+ };
+
+ return createCommandPool(vk, device, &createInfo, pAllocator);
+}
+
+Move<VkCommandBuffer> allocateCommandBuffer (const DeviceInterface& vk,
+ VkDevice device,
+ VkCommandPool commandPool,
+ VkCommandBufferLevel level)
+{
+ const VkCommandBufferAllocateInfo allocInfo =
+ {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ DE_NULL,
+
+ commandPool,
+ level,
+ 1
+ };
+
+ return allocateCommandBuffer(vk, device, &allocInfo);
+}
+
+Move<VkEvent> createEvent (const DeviceInterface& vk,
+ VkDevice device,
+ VkEventCreateFlags flags,
+ const VkAllocationCallbacks* pAllocateInfo)
+{
+ const VkEventCreateInfo createInfo =
+ {
+ VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
+ DE_NULL,
+
+ flags
+ };
+
+ return createEvent(vk, device, &createInfo, pAllocateInfo);
+}
+
} // vk
Move<VkCommandBuffer> allocateCommandBuffer (const DeviceInterface& vk, VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo);
Move<VkDescriptorSet> allocateDescriptorSet (const DeviceInterface& vk, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo);
+Move<VkSemaphore> createSemaphore (const DeviceInterface& vk,
+ VkDevice device,
+ VkSemaphoreCreateFlags flags = (VkSemaphoreCreateFlags)0,
+ const VkAllocationCallbacks* pAllocator = DE_NULL);
+
+Move<VkFence> createFence (const DeviceInterface& vk,
+ VkDevice device,
+ VkFenceCreateFlags flags = (VkFenceCreateFlags)0,
+ const VkAllocationCallbacks* pAllocator = DE_NULL);
+
+Move<VkCommandPool> createCommandPool (const DeviceInterface& vk,
+ VkDevice device,
+ VkCommandPoolCreateFlags flags,
+ deUint32 queueFamilyIndex,
+ const VkAllocationCallbacks* pAllocator = DE_NULL);
+
+Move<VkCommandBuffer> allocateCommandBuffer (const DeviceInterface& vk,
+ VkDevice device,
+ VkCommandPool commandPool,
+ VkCommandBufferLevel level);
+
+Move<VkEvent> createEvent (const DeviceInterface& vk,
+ VkDevice device,
+ VkEventCreateFlags flags = (VkEventCreateFlags)0u,
+ const VkAllocationCallbacks* pAllocateInfo = DE_NULL);
+
} // vk
#endif // _VKREFUTIL_HPP
// Bind the memory
if ((m_testCase.flags & (VK_BUFFER_CREATE_SPARSE_BINDING_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT)) != 0)
{
- VkQueue queue = DE_NULL;
-
- vk.getDeviceQueue(vkDevice, queueFamilyIndex, 0, &queue);
+ const VkQueue queue = getDeviceQueue(vk, vkDevice, queueFamilyIndex, 0);
const VkSparseMemoryBind sparseMemoryBind =
{
DE_NULL, // const VkSemaphore* pSignalSemaphores;
};
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- const vk::Unique<vk::VkFence> fence(vk::createFence(vk, vkDevice, &fenceParams));
+ const vk::Unique<vk::VkFence> fence(vk::createFence(vk, vkDevice));
if (vk.queueBindSparse(queue, 1, &bindSparseInfo, *fence) != VK_SUCCESS)
return tcu::TestStatus::fail("Bind sparse buffer memory failed! (requested memory size: " + de::toString(size) + ")");
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 count;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
attachmentClearValues // const VkClearValue* pClearValues;
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
tcu::TestStatus BufferViewTestInstance::checkResult (deInt8 factor)
, m_queueFamilyIndex (context.getUniversalQueueFamilyIndex())
, m_allocator (context.getDefaultAllocator())
{
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPoolCreateFlags, // VkCommandPoolCreateFlags flags;
- m_queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_commandPool = createCommandPool(m_vkd, m_device, &cmdPoolCreateInfo, DE_NULL);
+ m_commandPool = createCommandPool(m_vkd, m_device, commandPoolCreateFlags, m_queueFamilyIndex);
const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
{
void CommandBufferRenderPassTestEnvironment::submitPrimaryCommandBuffer(void)
{
-
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- const Unique<VkFence> fence (createFence(m_vkd, m_device, &fenceCreateInfo));
-
-
+ const Unique<VkFence> fence (createFence(m_vkd, m_device));
const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO, // VkStructureType sType;
const DeviceInterface& vk = context.getDeviceInterface();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- queueFamilyIndex, // queueFamilyIndex;
- };
-
- createCommandPool(vk, vkDevice, &cmdPoolParams, DE_NULL);
+ createCommandPool(vk, vkDevice, 0u, queueFamilyIndex);
return tcu::TestStatus::pass("Command Pool allocated correctly.");
}
const VkCommandBuffer commandBuffer,
const bool exitBeforeEndCommandBuffer = false)
{
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkEventCreateFlags flags;
- };
- const Unique<VkEvent> event (createEvent(vk, device, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, device));
const VkCommandBufferBeginInfo commandBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, //VkStructureType sType;
VK_CHECK(vk.endCommandBuffer(commandBuffer));
{
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, device));
const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
std::vector<VkEventSp> events;
for (deUint32 ndx = 0; ndx < LARGE_BUFFER_SIZE; ++ndx)
- events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice, &eventCreateInfo, DE_NULL))));
+ events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice))));
// record primary command buffer
VK_CHECK(vk.beginCommandBuffer(*primCmdBuf, &primCmdBufBeginInfo));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- };
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// Put the command buffer in recording state.
VK_CHECK(vk.beginCommandBuffer(*cmdBuf, &cmdBufBeginInfo));
VK_CHECK(vk.endCommandBuffer(*cmdBuf));
// We'll use a fence to wait for the execution of the queue
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags
- };
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
bool submitAndCheck (Context& context, std::vector<VkCommandBuffer>& cmdBuffers, std::vector <VkEventShared>& events)
{
- const VkDevice vkDevice = context.getDevice();
- const DeviceInterface& vk = context.getDeviceInterface();
- const VkQueue queue = context.getUniversalQueue();
+ const VkDevice vkDevice = context.getDevice();
+ const DeviceInterface& vk = context.getDeviceInterface();
+ const VkQueue queue = context.getUniversalQueue();
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags
- };
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
-
- const VkSubmitInfo submitInfo =
+ const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
DE_NULL, // pNext
};
const Unique<VkCommandPool> cmdPool (createCommandPool(vk, vkDevice, &cmdPoolParams));
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- };
-
std::vector <VkEventShared> events;
for (deUint32 ndx = 0u; ndx < cmdBufferCount; ++ndx)
- events.push_back(makeSharedPtr(createEvent(vk, vkDevice, &eventCreateInfo)));
+ events.push_back(makeSharedPtr(createEvent(vk, vkDevice)));
{
std::vector<VkCommandBuffer> cmdBuffers(cmdBufferCount);
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// record primary command buffer
VK_CHECK(vk.beginCommandBuffer(*primCmdBuf, &primCmdBufBeginInfo));
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// record primary command buffer
VK_CHECK(vk.beginCommandBuffer(*secCmdBuf, &secCmdBufBeginInfo));
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf1));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo1 =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf1));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo1 =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> eventOne (createEvent(vk, vkDevice, &eventCreateInfo));
- const Unique<VkEvent> eventTwo (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> eventOne (createEvent(vk, vkDevice));
+ const Unique<VkEvent> eventTwo (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *eventOne));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence1 (createFence(vk, vkDevice, &fenceCreateInfo));
- const Unique<VkFence> fence2 (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence1 (createFence(vk, vkDevice));
+ const Unique<VkFence> fence2 (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> eventOne (createEvent(vk, vkDevice, &eventCreateInfo));
- const Unique<VkEvent> eventTwo (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> eventOne (createEvent(vk, vkDevice));
+ const Unique<VkEvent> eventTwo (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *eventOne));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence(createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence(createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
}
VK_CHECK(vk.endCommandBuffer(*primCmdBufTwo));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence(createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence(createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- };
-
std::vector<VkEventSp> events;
for (deUint32 ndx = 0; ndx < BUFFER_COUNT; ++ndx)
{
- events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice, &eventCreateInfo, DE_NULL))));
+ events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice))));
}
// Record the command buffers
}
// We'll use a fence to wait for the execution of the queue
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags
- };
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- };
-
std::vector<VkEventSp> events;
for (deUint32 ndx = 0; ndx < BUFFER_COUNT; ++ndx)
- events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice, &eventCreateInfo, DE_NULL))));
+ events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice))));
// Record the command buffers
for (deUint32 ndx = 0; ndx < BUFFER_COUNT; ++ndx)
}
// We'll use a fence to wait for the execution of the queue
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags
- };
- const Unique<VkFence> fenceZero (createFence(vk, vkDevice, &fenceCreateInfo));
- const Unique<VkFence> fenceOne (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fenceZero (createFence(vk, vkDevice));
+ const Unique<VkFence> fenceOne (createFence(vk, vkDevice));
const VkSubmitInfo submitInfoCountZero =
{
DE_NULL // const VkCommandBufferInheritanceInfo* pInheritanceInfo;
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create two events that will be used to check if command buffers has been executed
- const Unique<VkEvent> event1 (createEvent(vk, vkDevice, &eventCreateInfo));
- const Unique<VkEvent> event2 (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event1 (createEvent(vk, vkDevice));
+ const Unique<VkEvent> event2 (createEvent(vk, vkDevice));
// reset events
VK_CHECK(vk.resetEvent(vkDevice, *event1));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf2));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
// create semaphore for use in this test
- const VkSemaphoreCreateInfo semaphoreCreateInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0, // flags;
- };
-
- const Unique <VkSemaphore> semaphore (createSemaphore(vk, vkDevice, &semaphoreCreateInfo));
+ const Unique <VkSemaphore> semaphore (createSemaphore(vk, vkDevice));
// create submit info for first buffer - signalling semaphore
const VkSubmitInfo submitInfo1 =
DE_NULL // const VkCommandBufferInheritanceInfo* pInheritanceInfo;
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if command buffers has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event - at creation state is undefined
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
// numSemaphores is declared const, so this array can be static
// the semaphores will be destroyed automatically at end of scope
Move <VkSemaphore> semaphoreArray[numSemaphores];
VkSemaphore semaphores[numSemaphores];
- // prepare create info for semaphores - same for all
- const VkSemaphoreCreateInfo semaphoreCreateInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0, // flags;
- };
-
for (deUint32 idx = 0; idx < numSemaphores; ++idx) {
// create semaphores for use in this test
- semaphoreArray[idx] = createSemaphore(vk, vkDevice, &semaphoreCreateInfo);
+ semaphoreArray[idx] = createSemaphore(vk, vkDevice);
semaphores[idx] = semaphoreArray[idx].get();
};
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags;
- };
-
std::vector<VkEventSp> events;
for (deUint32 ndx = 0; ndx < BUFFER_COUNT; ++ndx)
- events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice, &eventCreateInfo, DE_NULL))));
+ events.push_back(VkEventSp(new vk::Unique<VkEvent>(createEvent(vk, vkDevice))));
// Record the command buffers
for (deUint32 ndx = 0; ndx < BUFFER_COUNT; ++ndx)
}
// We'll use a fence to wait for the execution of the queue
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType;
- DE_NULL, // pNext;
- 0u, // flags
- };
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfoNullFence =
{
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> event (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> event (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *event));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBuf));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
&secCmdBufInheritInfo,
};
- // Fill create info struct for event
- const VkEventCreateInfo eventCreateInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0u,
- };
-
// create event that will be used to check if secondary command buffer has been executed
- const Unique<VkEvent> eventOne (createEvent(vk, vkDevice, &eventCreateInfo));
+ const Unique<VkEvent> eventOne (createEvent(vk, vkDevice));
// reset event
VK_CHECK(vk.resetEvent(vkDevice, *eventOne));
}
VK_CHECK(vk.endCommandBuffer(*primCmdBufTwo));
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
// create fence to wait for execution of queue
- const Unique<VkFence> fenceOne (createFence(vk, vkDevice, &fenceCreateInfo));
- const Unique<VkFence> fenceTwo (createFence(vk, vkDevice, &fenceCreateInfo));
+ const Unique<VkFence> fenceOne (createFence(vk, vkDevice));
+ const Unique<VkFence> fenceTwo (createFence(vk, vkDevice));
const VkSubmitInfo submitInfoOne =
{
queueFamilyIndex, // queueFamilyIndex
};
const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolCreateInfo));
-
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
const VkCommandBufferAllocateInfo cmdBufCreateInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const Unique<VkFence> cmdCompleteFence (createFence(vk, device, &fenceCreateInfo));
+ const Unique<VkFence> cmdCompleteFence (createFence(vk, device));
const Unique<VkCommandBuffer> cmd (allocateCommandBuffer(vk, device, &cmdBufCreateInfo));
VK_CHECK(vk.beginCommandBuffer(*cmd, &cmdBufBeginInfo));
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,// VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
// Create command buffer
- {
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
void CopiesAndBlittingTestInstance::generateBuffer (tcu::PixelBufferAccess buffer, int width, int height, int depth, FillMode mode)
const Unique<VkDevice> device (createDevice(instanceDriver, physicalDevice, &deviceCreateInfo));
const DeviceDriver deviceDriver (instanceDriver, device.get());
- VkQueue queue;
+ const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex);
- deviceDriver.getDeviceQueue(device.get(), queueFamilyIndex, queueIndex, &queue);
VK_CHECK(deviceDriver.queueWaitIdle(queue));
return tcu::TestStatus::pass("Pass");
}
{
- const DeviceDriver deviceDriver(instanceDriver, devices[deviceNdx]);
- VkQueue queue;
+ const DeviceDriver deviceDriver (instanceDriver, devices[deviceNdx]);
+ const VkQueue queue = getDeviceQueue(deviceDriver, devices[deviceNdx], queueFamilyIndex, queueIndex);
- DE_ASSERT(queueIndex < queueCount);
- deviceDriver.getDeviceQueue(devices[deviceNdx], queueFamilyIndex, queueIndex, &queue);
VK_CHECK(deviceDriver.queueWaitIdle(queue));
}
}
VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
DE_NULL,
(VkDeviceQueueCreateFlags)0u,
- 0, //queueFamiliIndex;
+ 0, //queueFamilyIndex;
1, //queueCount;
&queuePriority, //pQueuePriorities;
};
for (deUint32 queueIndex = 0; queueIndex < queueCount; queueIndex++)
{
- VkQueue queue;
- VkResult result;
+ const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex);
+ VkResult result;
- deviceDriver.getDeviceQueue(device.get(), queueFamilyIndex, queueIndex, &queue);
TCU_CHECK(!!queue);
result = deviceDriver.queueWaitIdle(queue);
{
const Unique<VkDevice> device (createDevice(vki, physicalDevice, &deviceCreateInfo));
const DeviceDriver vkd (vki, device.get());
- VkQueue queue;
+ const VkQueue queue = getDeviceQueue(vkd, *device, queueFamilyIndex, queueIndex);
- vkd.getDeviceQueue(device.get(), queueFamilyIndex, queueIndex, &queue);
VK_CHECK(vkd.queueWaitIdle(queue));
}
Allocator& memAlloc = context.getDefaultAllocator();
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
- {
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
// Create desctination buffer
{
void MemoryCommitmentTestInstance::submitCommandsAndWait (const DeviceInterface& vkd, const VkDevice device, const VkQueue queue, const VkCommandBuffer& cmdBuffer)
{
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- Move<VkFence> fence = createFence(vkd, device, &fenceParams);
+ Move<VkFence> fence = createFence(vkd, device);
const VkSubmitInfo submitInfo =
{
Move<VkCommandPool> MemoryCommitmentTestInstance::createCommandPool() const
{
- const VkDevice device = m_context.getDevice();
- const DeviceInterface& vkd = m_context.getDeviceInterface();
- const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
+ const VkDevice device = m_context.getDevice();
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- return vk::createCommandPool(vkd, device, &cmdPoolCreateInfo, DE_NULL);
+ return vk::createCommandPool(vkd, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
}
Move<VkCommandBuffer> MemoryCommitmentTestInstance::allocatePrimaryCommandBuffer (VkCommandPool commandPool) const
{
const VkDevice device = m_context.getDevice();
const DeviceInterface& vkd = m_context.getDeviceInterface();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1 // deUint32 commandBufferCount;
- };
- return vk::allocateCommandBuffer(vkd, device, &cmdBufferAllocateInfo);
+ return vk::allocateCommandBuffer(vkd, device, commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
bool MemoryCommitmentTestInstance::isDeviceMemoryCommitmentOk(const VkMemoryRequirements memoryRequirements)
m_frameBuffer = createFramebuffer(vk, device, &framebufferParams);
}
- { // Create CommandPool
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
+ m_cmdPool = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
- m_cmdPool = createCommandPool(vk, device, &cmdPoolParams);
- }
-
- { // Create CommandBuffer
- const VkCommandBufferAllocateInfo bufferAllocInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 count;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, device, &bufferAllocInfo);
- }
+ // Create CommandBuffer
+ m_cmdBuffer = allocateCommandBuffer(vk, device, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
{ // Begin CommandBuffer
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
Move<VkCommandPool> ImageClearingTestInstance::createCommandPool (VkCommandPoolCreateFlags commandPoolCreateFlags) const
{
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPoolCreateFlags, // VkCommandPoolCreateFlags flags;
- m_queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- return vk::createCommandPool(m_vkd, m_device, &cmdPoolCreateInfo, DE_NULL);
+ return vk::createCommandPool(m_vkd, m_device, commandPoolCreateFlags, m_queueFamilyIndex);
}
Move<VkCommandBuffer> ImageClearingTestInstance::allocatePrimaryCommandBuffer (VkCommandPool commandPool) const
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1 // deUint32 commandBufferCount;
- };
-
- return vk::allocateCommandBuffer(m_vkd, m_device, &cmdBufferAllocateInfo);
+ return vk::allocateCommandBuffer(m_vkd, m_device, commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
Move<VkImage> ImageClearingTestInstance::createImage (VkImageType imageType, VkFormat format, VkExtent3D extent, VkImageUsageFlags usage) const
void ImageClearingTestInstance::submitCommandBuffer (void) const
{
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- const Unique<VkFence> fence (createFence(m_vkd, m_device, &fenceCreateInfo));
+ const Unique<VkFence> fence (createFence(m_vkd, m_device));
const VkSubmitInfo submitInfo =
{
vk::VkDevice device,
deUint32 queueFamilyIndex)
{
- const vk::VkCommandPoolCreateInfo createInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
- DE_NULL,
- vk::VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // flags
- queueFamilyIndex, // queueFamilyIndex
- };
- return vk::createCommandPool(vki, device, &createInfo);
+ return vk::createCommandPool(vki, device, vk::VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
}
void SingleTargetRenderInstance::readRenderTarget (tcu::TextureLevel& dst)
0u, // offset
(vk::VkDeviceSize)pixelDataSize // size
};
- const vk::VkCommandBufferAllocateInfo cmdBufAllocInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *m_cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // bufferCount
- };
- const vk::VkFenceCreateInfo fenceCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
const vk::VkCommandBufferBeginInfo cmdBufBeginInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
const de::MovePtr<vk::Allocation> bufferMemory = allocateAndBindObjectMemory(m_vki, m_device, m_allocator, *buffer, vk::MemoryRequirement::HostVisible);
- const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, &cmdBufAllocInfo));
- const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(m_vki, m_device, &fenceCreateInfo));
+ const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(m_vki, m_device));
const deUint64 infiniteTimeout = ~(deUint64)0u;
// copy content to buffer
*m_colorAttachmentImage, // image
fullSubrange, // subresourceRange
};
- const vk::VkCommandBufferAllocateInfo cmdBufAllocInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *m_cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // count
- };
const vk::VkCommandBufferBeginInfo cmdBufBeginInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
vk::VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, // flags
(const vk::VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const vk::VkFenceCreateInfo fenceCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- (vk::VkFenceCreateFlags)0,
- };
- const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, &cmdBufAllocInfo));
- const vk::Unique<vk::VkFence> fence (vk::createFence(m_vki, m_device, &fenceCreateInfo));
+ const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const vk::Unique<vk::VkFence> fence (vk::createFence(m_vki, m_device));
const deUint64 infiniteTimeout = ~(deUint64)0u;
VK_CHECK(m_vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo));
{ 0, 0 }, // offset
{ m_targetSize.x(), m_targetSize.y() }, // extent
};
- const vk::VkCommandBufferAllocateInfo mainCmdBufCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *m_cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // count
- };
const vk::VkCommandBufferBeginInfo mainCmdBufBeginInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
vk::VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, // flags
(const vk::VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const vk::VkCommandBufferAllocateInfo passCmdBufCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *m_cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_SECONDARY, // level
- 1u, // count
- };
const vk::VkCommandBufferInheritanceInfo passCmdBufInheritInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO,
vk::VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, // flags
&passCmdBufInheritInfo,
};
- const vk::VkFenceCreateInfo fenceCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
const vk::VkClearValue clearValue = vk::makeClearValueColorF32(0.0f, 0.0f, 0.0f, 0.0f);
const vk::VkRenderPassBeginInfo renderPassBeginInfo =
{
const vk::VkPipelineLayout pipelineLayout (getPipelineLayout());
const vk::Unique<vk::VkPipeline> pipeline (createPipeline(pipelineLayout));
- const vk::Unique<vk::VkCommandBuffer> mainCmd (vk::allocateCommandBuffer(m_vki, m_device, &mainCmdBufCreateInfo));
- const vk::Unique<vk::VkCommandBuffer> passCmd ((m_isPrimaryCmdBuf) ? (vk::Move<vk::VkCommandBuffer>()) : (vk::allocateCommandBuffer(m_vki, m_device, &passCmdBufCreateInfo)));
- const vk::Unique<vk::VkFence> fence (vk::createFence(m_vki, m_device, &fenceCreateInfo));
+ const vk::Unique<vk::VkCommandBuffer> mainCmd (vk::allocateCommandBuffer(m_vki, m_device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const vk::Unique<vk::VkCommandBuffer> passCmd ((m_isPrimaryCmdBuf) ? (vk::Move<vk::VkCommandBuffer>()) : (vk::allocateCommandBuffer(m_vki, m_device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_SECONDARY)));
+ const vk::Unique<vk::VkFence> fence (vk::createFence(m_vki, m_device));
const deUint64 infiniteTimeout = ~(deUint64)0u;
const vk::VkSubpassContents passContents = (m_isPrimaryCmdBuf) ? (vk::VK_SUBPASS_CONTENTS_INLINE) : (vk::VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS);
queueFamilyIndex, // queueFamilyIndex
};
const vk::Unique<vk::VkCommandPool> cmdPool (vk::createCommandPool(m_vki, m_device, &cmdPoolCreateInfo));
-
- const vk::VkFenceCreateInfo fenceCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
-
- const vk::VkCommandBufferAllocateInfo cmdBufCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // count
- };
const vk::VkCommandBufferBeginInfo cmdBufBeginInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
(const vk::VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(m_vki, m_device, &fenceCreateInfo));
- const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, &cmdBufCreateInfo));
+ const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(m_vki, m_device));
+ const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(m_vki, m_device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const deUint64 infiniteTimeout = ~(deUint64)0u;
VK_CHECK(m_vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo));
};
const vk::Unique<vk::VkBuffer> dataBuffer (vk::createBuffer(vki, device, &bufferCreateInfo));
const de::MovePtr<vk::Allocation> dataBufferMemory = allocateAndBindObjectMemory(vki, device, allocator, *dataBuffer, vk::MemoryRequirement::HostVisible);
- const vk::VkFenceCreateInfo fenceCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- 0u, // flags
- };
const vk::VkBufferMemoryBarrier preMemoryBarrier =
{
vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
queueFamilyIndex, // queueFamilyIndex
};
const vk::Unique<vk::VkCommandPool> cmdPool (vk::createCommandPool(vki, device, &cmdPoolCreateInfo));
- const vk::VkCommandBufferAllocateInfo cmdBufCreateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- *cmdPool, // cmdPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // count
- };
const vk::VkCommandBufferBeginInfo cmdBufBeginInfo =
{
vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
(const vk::VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(vki, device, &cmdBufCreateInfo));
- const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(vki, device, &fenceCreateInfo));
+ const vk::Unique<vk::VkCommandBuffer> cmd (vk::allocateCommandBuffer(vki, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const vk::Unique<vk::VkFence> cmdCompleteFence (vk::createFence(vki, device));
const deUint64 infiniteTimeout = ~(deUint64)0u;
std::vector<vk::VkBufferImageCopy> copySlices;
const VkBufferMemoryBarrier computeFinishBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *buffer, 0ull, bufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier computeFinishBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *buffer, 0ull, bufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier computeFinishBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *buffer, 0ull, bufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
// Prepare the command buffer
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
// Prepare the command buffer
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier shaderWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *outputBuffer, 0ull, bufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier shaderWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *buffer, 0ull, bufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
};
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier afterComputeBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *outputBuffer, 0ull, outputBufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
// Prepare the command buffer
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const VkBufferMemoryBarrier afterComputeBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *outputBuffer, 0ull, outputBufferSizeBytes);
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
const Unique<VkPipeline> pipeline(makeComputePipeline(vk, device, *pipelineLayout, *shaderModule));
const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
// Create command buffer
const vk::Unique<vk::VkCommandPool> cmdPool(makeCommandPool(m_device_interface, m_device, m_queueFamilyIndex));
- const vk::Unique<vk::VkCommandBuffer> cmdBuffer(makeCommandBuffer(m_device_interface, m_device, *cmdPool));
+ const vk::Unique<vk::VkCommandBuffer> cmdBuffer(allocateCommandBuffer(m_device_interface, m_device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Begin recording commands
beginCommandBuffer(m_device_interface, *cmdBuffer);
VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *resultBuffer, 0ull, resultBufferSize);
const Unique<VkCommandPool> cmdPool(makeCommandPool(m_vki, m_device, m_queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(m_vki, m_device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(m_vki, m_device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
beginCommandBuffer(m_vki, *cmdBuffer);
return createCommandPool(vk, device, &commandPoolParams);
}
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo bufferAllocateParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- return allocateCommandBuffer(vk, device, &bufferAllocateParams);
-}
-
Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface& vk,
const VkDevice device)
{
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceParams));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
const vk::VkDevice device,
const deUint32 queueFamilyIndex);
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk,
- const vk::VkDevice device,
- const vk::VkCommandPool commandPool);
-
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk,
const vk::VkDevice device);
VK_WHOLE_SIZE);
const CmdPoolCreateInfo cmdPoolCreateInfo(queueFamilyIndex);
- m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, &cmdBufferAllocateInfo);
+ m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
+ m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
initPipeline(device);
}
dataSize);
const CmdPoolCreateInfo cmdPoolCreateInfo(queueFamilyIndex);
- m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, &cmdBufferAllocateInfo);
+ m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
+ m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
initPipeline(device);
}
//todo [scygan] get proper queueFamilyIndex
CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, ©CmdPoolCreateInfo));
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *copyCmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, &cmdBufferAllocateInfo));
+ vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, *copyCmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo;
VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
//todo [scygan] get proper queueFamilyIndex
CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, ©CmdPoolCreateInfo));
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *copyCmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, &cmdBufferAllocateInfo));
+ vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, *copyCmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo;
VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
//todo [scygan] get proper queueFamilyIndex
CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, ©CmdPoolCreateInfo));
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *copyCmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, &cmdBufferAllocateInfo));
+ vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, *copyCmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo;
VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
//todo [scygan] get proper queueFamilyIndex
CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, ©CmdPoolCreateInfo));
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *copyCmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, &cmdBufferAllocateInfo));
+ vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, *copyCmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo;
VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
const CmdPoolCreateInfo cmdPoolCreateInfo(queueFamilyIndex);
m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, &cmdBufferAllocateInfo);
+ m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
const vk::Unique<vk::VkShaderModule> vs(createShaderModule(m_vk, device, m_context.getBinaryCollection().get("InstancedDrawVert"), 0));
const vk::Unique<vk::VkShaderModule> fs(createShaderModule(m_vk, device, m_context.getBinaryCollection().get("InstancedDrawFrag"), 0));
// Command buffer
- const CmdPoolCreateInfo cmdPoolCreateInfo (queueFamilyIndex);
- const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolCreateInfo));
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ const CmdPoolCreateInfo cmdPoolCreateInfo (queueFamilyIndex);
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolCreateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Draw
// Submit
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence (createFence(vk, device));
const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO, // VkStructureType sType;
const CmdPoolCreateInfo cmdPoolCreateInfo(m_context.getUniversalQueueFamilyIndex());
m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, &cmdBufferAllocateInfo);
+ m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
virtual tcu::TestStatus iterate (void)
const CmdPoolCreateInfo cmdPoolCreateInfo(m_context.getUniversalQueueFamilyIndex());
m_cmdPool = vk::createCommandPool(m_vk, device, &cmdPoolCreateInfo);
-
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, &cmdBufferAllocateInfo);
+ m_cmdBuffer = vk::allocateCommandBuffer(m_vk, device, *m_cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
virtual tcu::TestStatus iterate (void)
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout));
const Unique<VkPipeline> pipeline (makeGraphicsPipeline(vk, device, *pipelineLayout, *renderPass, *vertexModule, *fragmentModule, renderSize,
(m_testMode == MODE_DEPTH), (m_testMode == MODE_STENCIL)));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Draw commands
return barrier;
}
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- return createCommandPool(vk, device, &info);
-}
-
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 commandBufferCount;
- };
- return allocateCommandBuffer(vk, device, &info);
-}
-
Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface& vk,
const VkDevice device,
const VkDescriptorPool descriptorPool,
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
{
vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, const vk::VkBufferUsageFlags usage);
-vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
vk::Move<vk::VkDescriptorSet> makeDescriptorSet (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorPool descriptorPool, const vk::VkDescriptorSetLayout setLayout);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
m_pipelineLayout = makePipelineLayout (vk, device);
m_pipeline = makeGraphicsPipeline (vk, device, *m_pipelineLayout, *m_renderPass, *m_vertexModule, *m_geometryModule, *m_fragmentModule,
m_renderSize, m_numViewports, scissors);
- m_cmdPool = makeCommandPool (vk, device, queueFamilyIndex);
- m_cmdBuffer = makeCommandBuffer (vk, device, *m_cmdPool);
+ m_cmdPool = createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
+ m_cmdBuffer = allocateCommandBuffer (vk, device, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
void draw (Context& context, const VkBuffer colorBuffer) const
m_framebuffer = makeFramebuffer (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
static_cast<deUint32>(m_renderSize.x()), static_cast<deUint32>(m_renderSize.y()));
m_pipelineLayout = makePipelineLayout (vk, device);
- m_cmdPool = makeCommandPool (vk, device, queueFamilyIndex);
- m_cmdBuffer = makeCommandBuffer (vk, device, *m_cmdPool);
+ m_cmdPool = createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
+ m_cmdBuffer = allocateCommandBuffer (vk, device, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
const VkImageSubresourceRange colorSubRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
const Unique<VkImageView> colorAttachmentView (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubRange));
const Unique<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, resolution.x(), resolution.y(), 1u));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const VkDeviceSize vertexDataSizeBytes = sizeInBytes(m_vertexPosData) + sizeInBytes(m_vertexAttrData);
const deUint32 vertexPositionsOffset = 0u;
// Create command pool and buffer
{
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- cmdPool = createCommandPool(vk, device, &cmdPoolParams);
+ cmdPool = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
{
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, device, &fenceParams);
- }
+ fence = createFence(vk, device);
// Barriers for copying buffer to image
const VkBufferMemoryBarrier preBufferBarrier =
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule, renderExtent));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Initialize vertex data
{
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule,
makeExtent2D(params.image.size.width, params.image.size.height)));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
zeroBuffer(vk, device, *colorBufferAlloc, colorBufferSize);
return createFramebuffer(vk, device, &framebufferInfo);
}
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- return createCommandPool(vk, device, &info);
-}
-
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 commandBufferCount;
- };
- return allocateCommandBuffer(vk, device, &info);
-}
-
VkImageMemoryBarrier makeImageMemoryBarrier (const VkAccessFlags srcAccessMask,
const VkAccessFlags dstAccessMask,
const VkImageLayout oldLayout,
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
vk::VkBufferImageCopy makeBufferImageCopy (const vk::VkExtent3D extent, const vk::VkImageSubresourceLayers subresourceLayers);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout = DE_NULL);
vk::Move<vk::VkFramebuffer> makeFramebuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const vk::VkImageView colorAttachment, const deUint32 width, const deUint32 height, const deUint32 layers);
-vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
vk::VkImageMemoryBarrier makeImageMemoryBarrier (const vk::VkAccessFlags srcAccessMask, const vk::VkAccessFlags dstAccessMask, const vk::VkImageLayout oldLayout, const vk::VkImageLayout newLayout, const vk::VkImage image, const vk::VkImageSubresourceRange subresourceRange);
vk::VkBufferMemoryBarrier makeBufferMemoryBarrier (const vk::VkAccessFlags srcAccessMask, const vk::VkAccessFlags dstAccessMask, const vk::VkBuffer buffer, const vk::VkDeviceSize offset, const vk::VkDeviceSize bufferSizeBytes);
de::MovePtr<vk::Allocation> bindImage (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkImage image, const vk::MemoryRequirement requirement);
const Unique<VkPipeline> pipeline(makeComputePipeline(deviceInterface, device, *pipelineLayout, *shaderModule));
// Create command buffer
- const Unique<VkCommandPool> cmdPool(makeCommandPool(deviceInterface, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(deviceInterface, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool(createCommandPool(deviceInterface, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(deviceInterface, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(deviceInterface, *cmdBuffer);
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout(vk, device, descriptorSetLayout));
const Unique<VkPipeline> pipeline(makeComputePipeline(vk, device, *pipelineLayout, *shaderModule));
- const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool(createCommandPool(vk, device, VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(vk, *cmdBuffer);
// Prepare commands
- const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const tcu::IVec3 workSize = (caseDef.singleLayerBind ? caseDef.texture.layerSize() : caseDef.texture.size());
const int loopNumLayers = (caseDef.singleLayerBind ? numLayers : 1);
const vk::Unique<VkPipeline> pipeline(makeComputePipeline(deviceInterface, device, *pipelineLayout, *shaderModule));
// Create command buffer
- const Unique<VkCommandPool> cmdPool(makeCommandPool(deviceInterface, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(deviceInterface, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool(createCommandPool(deviceInterface, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(deviceInterface, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
beginCommandBuffer(deviceInterface, *cmdBuffer);
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout(vk, device, descriptorSetLayout));
const Unique<VkPipeline> pipeline(makeComputePipeline(vk, device, *pipelineLayout, *shaderModule));
- const Unique<VkCommandPool> cmdPool(makeCommandPool(vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool(createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(vk, *cmdBuffer);
return copyParams;
}
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo commandPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- return createCommandPool(vk, device, &commandPoolParams);
-}
-
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo bufferAllocateParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- return allocateCommandBuffer(vk, device, &bufferAllocateParams);
-}
-
Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface& vk,
const VkDevice device,
const VkDescriptorSetLayout descriptorSetLayout)
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceParams));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
deUint32 getDimensions (const ImageType imageType); //!< Coordinate dimension used for addressing (e.g. 3 (x,y,z) for 2d array)
deUint32 getLayerDimensions (const ImageType imageType); //!< Coordinate dimension used for addressing a single layer (e.g. 2 (x,y) for 2d array)
-vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk,
- const vk::VkDevice device,
- const deUint32 queueFamilyIndex);
-
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk,
- const vk::VkDevice device,
- const vk::VkCommandPool commandPool);
-
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk,
const vk::VkDevice device,
const vk::VkDescriptorSetLayout descriptorSetLayout);
vk::VkSharingMode sharing;
};
-vk::Move<vk::VkCommandBuffer> createCommandBuffer (const vk::DeviceInterface& vkd,
- vk::VkDevice device,
- vk::VkCommandPool pool,
- vk::VkCommandBufferLevel level)
-{
- const vk::VkCommandBufferAllocateInfo bufferInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
-
- pool,
- level,
- 1u
- };
-
- return vk::allocateCommandBuffer(vkd, device, &bufferInfo);
-}
-
vk::Move<vk::VkCommandBuffer> createBeginCommandBuffer (const vk::DeviceInterface& vkd,
vk::VkDevice device,
vk::VkCommandPool pool,
(level == vk::VK_COMMAND_BUFFER_LEVEL_SECONDARY ? &inheritInfo : (const vk::VkCommandBufferInheritanceInfo*)DE_NULL),
};
- vk::Move<vk::VkCommandBuffer> commandBuffer (createCommandBuffer(vkd, device, pool, level));
+ vk::Move<vk::VkCommandBuffer> commandBuffer (allocateCommandBuffer(vkd, device, pool, level));
vkd.beginCommandBuffer(*commandBuffer, &beginInfo);
return commandBuffer;
}
-vk::Move<vk::VkCommandPool> createCommandPool (const vk::DeviceInterface& vkd,
- vk::VkDevice device,
- deUint32 queueFamilyIndex)
-{
- const vk::VkCommandPoolCreateInfo poolInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
- DE_NULL,
-
- vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
- queueFamilyIndex,
- };
-
- return vk::createCommandPool(vkd, device, &poolInfo);
-}
-
vk::Move<vk::VkBuffer> createBuffer (const vk::DeviceInterface& vkd,
vk::VkDevice device,
vk::VkDeviceSize size,
, m_queue (queue)
, m_queueFamilyIndex (queueFamilyIndex)
, m_queues (queues)
- , m_commandPool (createCommandPool(vkd, device, queueFamilyIndex))
+ , m_commandPool (createCommandPool(vkd, device, vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex))
, m_binaryCollection (binaryCollection)
{
for (size_t queueNdx = 0; queueNdx < m_queues.size(); queueNdx++)
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
{ VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
BlendTestInstance::~BlendTestInstance (void)
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
- {
- const VkCommandBufferAllocateInfo cmdAllocateParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdAllocateParams);
- }
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
// Create the Pipeline Cache
{
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
},
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
DepthTestInstance::~DepthTestInstance (void)
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
preAttachmentBarriers[imgNdx].subresourceRange.layerCount = 1u;
}
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
ImageSamplingInstance::~ImageSamplingInstance (void)
}
// Create command pool and buffer
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, device, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
- cmdBuffer = allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo);
- }
+ cmdPool = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+ cmdBuffer = allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, device, &fenceParams);
- }
+ fence = createFence(vk, device);
// Barriers for copying image to buffer
}
// Create command pool and buffer
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, device, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- cmdBuffer = allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo);
- }
+ cmdPool = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+ cmdBuffer = allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, device, &fenceParams);
- }
+ fence = createFence(vk, device);
// Barriers for copying buffer to image
const VkBufferMemoryBarrier preBufferBarrier =
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
{ VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
InputAssemblyInstance::~InputAssemblyInstance (void)
return barrier;
}
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- return createCommandPool(vk, device, &info);
-}
-
Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
{
- const VkCommandBufferAllocateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 commandBufferCount;
- };
- return allocateCommandBuffer(vk, device, &info);
+ return allocateCommandBuffer(vk, device, commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface& vk,
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
};
vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, const vk::VkBufferUsageFlags usage);
-vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
vk::Move<vk::VkDescriptorSet> makeDescriptorSet (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorPool descriptorPool, const vk::VkDescriptorSetLayout setLayout);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device);
const Unique<VkPipeline> graphicsPipeline(createGraphicsPipeline(deviceInterface, device, DE_NULL, &graphicsPipelineInfo));
// Create command buffer for compute and transfer oparations
- const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, device, queueFamilyIndex));
+ const Unique<VkCommandPool> commandPool(createCommandPool(deviceInterface, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, device, *commandPool));
// Start recording commands
}
// Create command buffer for compute and transfer oparations
- const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, device, queueFamilyIndex));
+ const Unique<VkCommandPool> commandPool(createCommandPool(deviceInterface, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, device, *commandPool));
// Start recording commands
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
Allocator& allocator = context.getDefaultAllocator();
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkRect2D renderArea = {
const Unique<VkImage> colorImage (makeImage(vk, device, caseDef.colorFormat, caseDef.renderSize, caseDef.numLayers, caseDef.numSamples, colorImageUsage));
const UniquePtr<Allocation> colorImageAlloc (bindImage(vk, device, allocator, *colorImage, MemoryRequirement::Any));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkRect2D renderArea = {
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT));
const UniquePtr<Allocation> resolveImageAlloc (bindImage(vk, device, allocator, *resolveImage, MemoryRequirement::Any));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
// Working image barrier, we change it based on which rendering stages were executed so far.
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
},
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
MultisampleRenderer::~MultisampleRenderer (void)
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
{ VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
PushConstantGraphicsTestInstance::~PushConstantGraphicsTestInstance (void)
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
PushConstantComputeTestInstance::~PushConstantComputeTestInstance (void)
const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, caseDef.colorFormat, static_cast<deUint32>(numLayers)));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
vector<SharedPtrVkPipeline> pipeline;
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
vector<SharedPtrVkImageView> colorAttachments;
const Unique<VkShaderModule> shaderModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("comp"), 0));
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout (vk, device, *descriptorSetLayout));
const Unique<VkPipeline> pipeline (makeComputePipeline(vk, device, *pipelineLayout, *shaderModule, pSpecInfo));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
beginCommandBuffer(vk, *cmdBuffer);
const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, imageFormat));
const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, 1u, &colorImageView.get(), static_cast<deUint32>(renderSize.x()), static_cast<deUint32>(renderSize.y())));
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
GraphicsPipelineBuilder pipelineBuilder;
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
},
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
StencilTestInstance::~StencilTestInstance (void)
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
- {
- const VkCommandBufferAllocateInfo cmdAllocateParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdAllocateParams);
- }
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
{
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- m_cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ m_cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
{ VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
};
- m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
+ m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vk, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vk, vkDevice);
}
VertexInputInstance::~VertexInputInstance (void)
const CmdPoolCreateInfo cmdPoolCreateInfo (m_context.getUniversalQueueFamilyIndex());
vk::Move<vk::VkCommandPool> cmdPool = vk::createCommandPool(vk, device, &cmdPoolCreateInfo);
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Unique<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ vk::Unique<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const CmdBufferBeginInfo beginInfo (0u);
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
DE_ASSERT(hasSeparateResetCmdBuf());
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo (0u);
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
const vk::VkDevice device = m_context.getDevice();
const vk::DeviceInterface& vk = m_context.getDeviceInterface();
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
CmdBufferBeginInfo beginInfo (0u);
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
const vk::VkDevice device = m_context.getDevice();
const vk::DeviceInterface& vk = m_context.getDeviceInterface();
- const vk::VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ vk::Move<vk::VkCommandBuffer> cmdBuffer (vk::allocateCommandBuffer(vk, device, cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const CmdBufferBeginInfo beginInfo (0u);
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
namespace vkt
{
- namespace QueryPool
- {
+namespace QueryPool
+{
class QueryPoolOcclusionTests : public tcu::TestCaseGroup
{
};
const Unique<VkPipeline> pipeline(createComputePipeline(vk, device, DE_NULL , &pipelineCreateInfo));
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkQueryPool> queryPool (makeQueryPool(vk, device, VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT));
beginCommandBuffer(vk, *cmdBuffer);
pipeline.push_back(VkPipelineSp(new Unique<VkPipeline>(createComputePipeline(vk, device, DE_NULL , &pipelineCreateInfo))));
}
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
const Unique<VkQueryPool> queryPool (makeQueryPool(vk, device, VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT));
pipeline.push_back(VkPipelineSp(new Unique<VkPipeline>(createComputePipeline(vk, device, DE_NULL , &pipelineCreateInfo))));
}
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
const Unique<VkQueryPool> queryPool (makeQueryPool(vk, device, VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT));
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(vk, *cmdBuffer);
{
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(vk, *cmdBuffer);
{
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer(vk, *cmdBuffer);
{
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
const de::SharedPtr<Buffer> vertexBufferSp = creatAndFillVertexBuffer();
const VkBuffer vertexBuffer = vertexBufferSp->object();
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, &cmdBufferAllocateInfo));
-
- const VkCommandBufferAllocateInfo secondaryCmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_SECONDARY, // VkCommandBufferLevel level;
- 1u // deUint32 commandBufferCount;
- };
- const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, &secondaryCmdBufferAllocateInfo));
+ const Unique<VkCommandBuffer> primaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const Unique<VkCommandBuffer> secondaryCmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_SECONDARY));
beginSecondaryCommandBuffer(vk, *secondaryCmdBuffer, m_parametersGraphic.queryStatisticFlags, *m_renderPass, *m_framebuffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);
vk.cmdBindPipeline(*secondaryCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
DescriptorSetLayoutBuilder descriptorSetLayoutBuilder;
// Command Pool
- {
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_commandPool = createCommandPool(vkd, vkDevice, &cmdPoolCreateInfo, DE_NULL);
- }
+ m_commandPool = createCommandPool(vkd, vkDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
// Image
{
}
// Fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_FENCE_CREATE_SIGNALED_BIT // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vkd, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vkd, vkDevice);
// Result Buffer
{
}
// Create Command Buffer
- {
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1 // deUint32 commandBufferCount;
- };
-
- commandBuffer = allocateCommandBuffer(vkd, vkDevice, &cmdBufferAllocateInfo);
- }
+ commandBuffer = allocateCommandBuffer(vkd, vkDevice, *m_commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Begin Command Buffer
{
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1 // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
&attachmentClearValues[0] // const VkClearValue* pAttachmentClearValues;
};
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
// Execute Draw
{
};
// constants for image copy
-
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- Move<VkCommandPool> copyCmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *copyCmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 bufferCount;
- };
+ Move<VkCommandPool> copyCmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
// Copy image to buffer
{
- Move<VkCommandBuffer> copyCmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ Move<VkCommandBuffer> copyCmdBuffer = allocateCommandBuffer(vk, vkDevice, *copyCmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
const VkSubmitInfo submitInfo =
{
uploadInputBuffer(ctx, inputs, numValues);
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
const int maxValuesPerInvocation = ctx.getDeviceProperties().limits.maxComputeWorkGroupSize[0];
int curOffset = 0;
descriptorSetUpdateBuilder.update(vk, vkDevice);
}
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer, &cmdBufferBeginInfo));
vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *computePipeline);
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // uint32_t bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
clearValues // const VkClearValue* pClearValues;
};
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
// Execute Draw
{
}
// Create command pool and buffer
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
// Barriers for copying buffer to image
const VkBufferMemoryBarrier preBufferBarrier =
, m_queueFamilyIndex (findQueueFamilyIndexWithCaps(context.getInstanceInterface(), context.getPhysicalDevice(), VK_QUEUE_GRAPHICS_BIT|VK_QUEUE_SPARSE_BINDING_BIT))
, m_device (createDevice())
, m_deviceInterface (context.getInstanceInterface(), *m_device)
+ , m_queue (getDeviceQueue(m_deviceInterface, *m_device, m_queueFamilyIndex, 0))
, m_allocator (createAllocator())
{
- m_deviceInterface.getDeviceQueue(*m_device, m_queueFamilyIndex, 0, &m_queue);
}
Move<VkDevice> ShaderRenderCaseInstance::SparseContext::createDevice () const
}
// Create command pool and buffer
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
// Barriers for copying buffer to image
const VkBufferMemoryBarrier preBufferBarrier =
// Create command pool and buffer
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
-
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
-
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
const VkImageMemoryBarrier preImageBarrier =
{
VK_CHECK(vk.waitForFences(vkDevice, 1, &fence.get(), true, ~(0ull) /* infinity */));
}
-// Sparse utility function
-Move<VkSemaphore> makeSemaphore (const DeviceInterface& vk, const VkDevice device)
-{
- const VkSemaphoreCreateInfo semaphoreCreateInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
- DE_NULL,
- 0u
- };
-
- return createSemaphore(vk, device, &semaphoreCreateInfo);
-}
-
VkExtent3D mipLevelExtents (const VkExtent3D& baseExtents, const deUint32 mipLevel)
{
VkExtent3D result;
const bool isShadowSampler = refSampler.compare != tcu::Sampler::COMPAREMODE_NONE;
const VkImageAspectFlags aspectMask = isShadowSampler ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT;
- const Unique<VkSemaphore> imageMemoryBindSemaphore(makeSemaphore(vk, vkDevice));
+ const Unique<VkSemaphore> imageMemoryBindSemaphore(createSemaphore(vk, vkDevice));
deUint32 bufferSize = 0u;
std::vector<deUint32> offsetMultiples;
offsetMultiples.push_back(4u);
Move<VkCommandPool> cmdPool;
Move<VkCommandBuffer> cmdBuffer;
- // Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
-
- {
- // Create command buffer
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
+ // Create command pool
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
- }
+ // Create command buffer
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Create source buffer
const VkBufferCreateInfo bufferParams =
DE_NULL // const VkSemaphore* pSignalSemaphores;
};
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
-
- Move<VkFence> fence = createFence(vk, vkDevice, &fenceParams);
+ Move<VkFence> fence = createFence(vk, vkDevice);
try
{
}
// Create command pool
- {
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
-
- cmdPool = createCommandPool(vk, vkDevice, &cmdPoolParams);
- }
+ cmdPool = createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
// Create command buffer
{
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
&clearValues, // const VkClearValue* pClearValues;
};
- cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ cmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer, &cmdBufferBeginInfo));
}
// Create fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u // VkFenceCreateFlags flags;
- };
- fence = createFence(vk, vkDevice, &fenceParams);
- }
+ fence = createFence(vk, vkDevice);
// Execute Draw
{
VK_CHECK(vk.bindBufferMemory(vkDevice, *readImageBuffer, readImageBufferMemory->getMemory(), readImageBufferMemory->getOffset()));
// Copy image to buffer
- const VkCommandBufferAllocateInfo cmdBufferParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool cmdPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u // deUint32 bufferCount;
- };
-
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // VkStructureType sType;
(const VkCommandBufferInheritanceInfo*)DE_NULL,
};
- const Move<VkCommandBuffer> resultCmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferParams);
+ const Move<VkCommandBuffer> resultCmdBuffer = allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
const VkBufferImageCopy copyParams =
{
const deUint32 m_queueFamilyIndex;
vk::Unique<vk::VkDevice> m_device;
vk::DeviceDriver m_deviceInterface;
- vk::VkQueue m_queue;
+ const vk::VkQueue m_queue;
const de::UniquePtr<vk::Allocator> m_allocator;
private:
vk::Move<vk::VkDevice> createDevice (void) const;
{
Queue& queue = queuesIter->second[queueNdx];
- VkQueue queueHandle = 0;
- m_deviceDriver->getDeviceQueue(*m_logicalDevice, queue.queueFamilyIndex, queue.queueIndex, &queueHandle);
-
- queue.queueHandle = queueHandle;
+ queue.queueHandle = getDeviceQueue(*m_deviceDriver, *m_logicalDevice, queue.queueFamilyIndex, queue.queueIndex);
}
}
}
const Unique<VkBuffer> sparseBufferRead (createBuffer(deviceInterface, getDevice(), &bufferCreateInfo));
// Create sparse buffers memory bind semaphore
- const Unique<VkSemaphore> bufferMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> bufferMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
const VkMemoryRequirements bufferMemRequirements = getBufferMemoryRequirements(deviceInterface, getDevice(), *sparseBufferWrite);
// Create command buffer for compute and data transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
beginCommandBuffer(deviceInterface, *commandBuffer);
const Unique<VkBuffer> sparseBuffer(createBuffer(deviceInterface, getDevice(), &bufferCreateInfo));
// Create sparse buffer memory bind semaphore
- const Unique<VkSemaphore> bufferMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> bufferMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
const VkMemoryRequirements bufferMemRequirement = getBufferMemoryRequirements(deviceInterface, getDevice(), *sparseBuffer);
// Create command buffer for transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording transfer commands
beginCommandBuffer(deviceInterface, *commandBuffer);
const Unique<VkBuffer> sparseBuffer(createBuffer(deviceInterface, getDevice(), &bufferCreateInfo));
// Create sparse buffer memory bind semaphore
- const Unique<VkSemaphore> bufferMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> bufferMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
const VkMemoryRequirements bufferMemRequirements = getBufferMemoryRequirements(deviceInterface, getDevice(), *sparseBuffer);
// Create command buffer for compute and data transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording compute and transfer commands
beginCommandBuffer(deviceInterface, *commandBuffer);
m_pipelineLayout = makePipelineLayout (vk, device, m_descriptorSetLayout);
m_pipeline = makeGraphicsPipeline (vk, device, *m_pipelineLayout, *m_renderPass, m_renderSize, m_topology, DE_LENGTH_OF_ARRAY(pShaderStages), pShaderStages);
m_cmdPool = makeCommandPool (vk, device, queueFamilyIndex);
- m_cmdBuffer = makeCommandBuffer (vk, device, *m_cmdPool);
+ m_cmdBuffer = allocateCommandBuffer (vk, device, *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
void draw (const DeviceInterface& vk,
DE_NULL, // const VkSemaphore* pSignalSemaphores;
};
- const Unique<VkFence> fence(makeFence(vk, device));
+ const Unique<VkFence> fence(createFence(vk, device));
VK_CHECK(vk.queueBindSparse(sparseQueue, 1u, &bindInfo, *fence));
VK_CHECK(vk.waitForFences(device, 1u, &fence.get(), VK_TRUE, ~0ull));
stagingBufferSize, // VkDeviceSize size;
};
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, getDevice(), m_universalQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, getDevice(), *cmdPool));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, getDevice(), m_universalQueue.queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, getDevice(), *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer (vk, *cmdBuffer);
vk.cmdCopyBuffer (*cmdBuffer, *stagingBuffer, *sparseBuffer, 1u, ©Region);
},
};
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, getDevice(), m_universalQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, getDevice(), *cmdPool));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, getDevice(), m_universalQueue.queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, getDevice(), *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
beginCommandBuffer (vk, *cmdBuffer);
vk.cmdCopyBuffer (*cmdBuffer, *m_stagingBuffer, *m_sparseBuffer, DE_LENGTH_OF_ARRAY(copyRegions), copyRegions);
const Unique<VkImage> imageWrite(createImage(deviceInterface, getDevice(), &imageSparseInfo));
// Create semaphores to synchronize sparse binding operations with other operations on the sparse images
- const Unique<VkSemaphore> memoryBindSemaphoreTransfer(makeSemaphore(deviceInterface, getDevice()));
- const Unique<VkSemaphore> memoryBindSemaphoreCompute(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> memoryBindSemaphoreTransfer(createSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> memoryBindSemaphoreCompute(createSemaphore(deviceInterface, getDevice()));
const VkSemaphore imageMemoryBindSemaphores[] = { memoryBindSemaphoreTransfer.get(), memoryBindSemaphoreCompute.get() };
// Create command buffer for compute and transfer oparations
const Unique<VkCommandPool> commandPool (makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
std::vector<VkBufferImageCopy> bufferImageCopy(imageSparseInfo.mipLevels);
const Unique<VkImage> imageSparse(createImage(deviceInterface, getDevice(), &imageSparseInfo));
// Create sparse image memory bind semaphore
- const Unique<VkSemaphore> imageMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> imageMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
// Get sparse image general memory requirements
const VkMemoryRequirements imageSparseMemRequirements = getImageMemoryRequirements(deviceInterface, getDevice(), *imageSparse);
// Create command buffer for compute and transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
std::vector<VkBufferImageCopy> bufferImageCopy(imageSparseInfo.mipLevels);
const Unique<VkImage> sparseImage(createImage(deviceInterface, getDevice(), &imageCreateInfo));
// Create sparse image memory bind semaphore
- const Unique<VkSemaphore> imageMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> imageMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
{
// Get image general memory requirements
// Create command buffer for compute and transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Start recording commands
beginCommandBuffer(deviceInterface, *commandBuffer);
const Unique<VkImage> imageSparse(createImage(deviceInterface, getDevice(), &imageSparseInfo));
// Create sparse image memory bind semaphore
- const Unique<VkSemaphore> imageMemoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> imageMemoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
{
// Get sparse image general memory requirements
// Create command buffer for compute and transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), computeQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
std::vector <VkBufferImageCopy> bufferImageCopy(imageSparseInfo.mipLevels);
for (deUint32 i = 0; i < m_params.numWaitSemaphores; ++i)
{
- allSemaphores.push_back(makeVkSharedPtr(makeSemaphore(vk, getDevice())));
+ allSemaphores.push_back(makeVkSharedPtr(createSemaphore(vk, getDevice())));
waitSemaphores.push_back(**allSemaphores.back());
}
for (deUint32 i = 0; i < m_params.numSignalSemaphores; ++i)
{
- allSemaphores.push_back(makeVkSharedPtr(makeSemaphore(vk, getDevice())));
+ allSemaphores.push_back(makeVkSharedPtr(createSemaphore(vk, getDevice())));
signalSemaphores.push_back(**allSemaphores.back());
signalSemaphoresWaitDstStageMask.push_back(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
}
if (m_params.bindSparseUseFence)
{
- bindSparseFences.push_back(makeVkSharedPtr(makeFence(vk, getDevice())));
+ bindSparseFences.push_back(makeVkSharedPtr(createFence(vk, getDevice())));
fence = **bindSparseFences.back();
}
}
else
{
- regularFences.push_back(makeVkSharedPtr(makeFence(vk, getDevice())));
+ regularFences.push_back(makeVkSharedPtr(createFence(vk, getDevice())));
VK_CHECK(vk.queueSubmit(submissionIter->queue->queueHandle, 1u, &submissionIter->info.regular, **regularFences.back()));
}
}
const Unique<VkImage> imageSparse(createImage(deviceInterface, getDevice(), &imageSparseInfo));
// Create sparse image memory bind semaphore
- const Unique<VkSemaphore> memoryBindSemaphore(makeSemaphore(deviceInterface, getDevice()));
+ const Unique<VkSemaphore> memoryBindSemaphore(createSemaphore(deviceInterface, getDevice()));
const deUint32 imageSparseSizeInBytes = getImageSizeInBytes(imageSparseInfo.extent, imageSparseInfo.arrayLayers, m_format, imageSparseInfo.mipLevels, BUFFER_IMAGE_COPY_OFFSET_GRANULARITY);
const deUint32 imageSizeInPixels = getImageSizeInBytes(imageSparseInfo.extent, imageSparseInfo.arrayLayers, m_format, imageSparseInfo.mipLevels) / tcu::getPixelSize(m_format);
// Create command buffer for compute and transfer oparations
const Unique<VkCommandPool> commandPool(makeCommandPool(deviceInterface, getDevice(), extractQueue.queueFamilyIndex));
- const Unique<VkCommandBuffer> commandBuffer(makeCommandBuffer(deviceInterface, getDevice(), *commandPool));
+ const Unique<VkCommandBuffer> commandBuffer(allocateCommandBuffer(deviceInterface, getDevice(), *commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
std::vector <VkBufferImageCopy> bufferImageSparseCopy(imageSparseInfo.mipLevels);
return createCommandPool(vk, device, &commandPoolParams);
}
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo bufferAllocateParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- return allocateCommandBuffer(vk, device, &bufferAllocateParams);
-}
-
Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface& vk,
const VkDevice device,
const VkDescriptorSetLayout descriptorSetLayout)
return allocateDescriptorSet(vk, device, &allocateParams);
}
-Move<VkSemaphore> makeSemaphore (const DeviceInterface& vk, const VkDevice device)
-{
- const VkSemaphoreCreateInfo semaphoreCreateInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
- DE_NULL,
- 0u
- };
-
- return createSemaphore(vk, device, &semaphoreCreateInfo);
-}
-
-Move<VkFence> makeFence (const DeviceInterface& vk, const VkDevice device, const VkFenceCreateFlags flags)
-{
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- flags, // VkFenceCreateFlags flags;
- };
- return createFence(vk, device, &fenceCreateInfo);
-}
-
Move<VkFramebuffer> makeFramebuffer (const DeviceInterface& vk,
const VkDevice device,
const VkRenderPass renderPass,
const vk::VkDevice device,
const deUint32 queueFamilyIndex);
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk,
- const vk::VkDevice device,
- const vk::VkCommandPool commandPool);
-
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk,
const vk::VkDevice device,
const vk::VkDescriptorSetLayout descriptorSetLayout = DE_NULL);
const vk::VkDescriptorPool descriptorPool,
const vk::VkDescriptorSetLayout setLayout);
-vk::Move<vk::VkSemaphore> makeSemaphore (const vk::DeviceInterface& vk,
- const vk::VkDevice device);
-
-vk::Move<vk::VkFence> makeFence (const vk::DeviceInterface& vk,
- const vk::VkDevice device,
- const vk::VkFenceCreateFlags flags = 0u);
-
vk::Move<vk::VkFramebuffer> makeFramebuffer (const vk::DeviceInterface& vk,
const vk::VkDevice device,
const vk::VkRenderPass renderPass,
*//*--------------------------------------------------------------------*/
Move<VkCommandPool> createCommandPool (const DeviceInterface& vkdi, VkDevice device, deUint32 queueFamilyIndex)
{
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
- DE_NULL, // pNext
- 0u, // flags
- queueFamilyIndex, // queueFamilyIndex
- };
-
- return createCommandPool(vkdi, device, &cmdPoolCreateInfo);
+ return createCommandPool(vkdi, device, 0u, queueFamilyIndex);
}
} // anonymous
// Create command buffer and record commands
const Unique<VkCommandPool> cmdPool (createCommandPool(vkdi, device, m_context.getUniversalQueueFamilyIndex()));
- const VkCommandBufferAllocateInfo cmdBufferCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- NULL, // pNext
- *cmdPool, // cmdPool
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u // count
- };
-
- Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vkdi, device, &cmdBufferCreateInfo));
+ Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vkdi, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
// Create fence and run.
- const VkFenceCreateInfo fenceCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType
- NULL, // pNext
- 0 // flags
- };
- const Unique<VkFence> cmdCompleteFence (createFence(vkdi, device, &fenceCreateInfo));
+ const Unique<VkFence> cmdCompleteFence (createFence(vkdi, device));
const deUint64 infiniteTimeout = ~(deUint64)0u;
const VkSubmitInfo submitInfo =
{
};
const Unique<VkFramebuffer> framebuffer (createFramebuffer(vk, vkDevice, &framebufferParams));
- const VkCommandPoolCreateInfo cmdPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- const Unique<VkCommandPool> cmdPool (createCommandPool(vk, vkDevice, &cmdPoolParams));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, vkDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
// Command buffer
- const VkCommandBufferAllocateInfo cmdBufParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool pool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u, // deUint32 count;
- };
- const Unique<VkCommandBuffer> cmdBuf (allocateCommandBuffer(vk, vkDevice, &cmdBufParams));
+ const Unique<VkCommandBuffer> cmdBuf (allocateCommandBuffer(vk, vkDevice, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const VkCommandBufferBeginInfo cmdBufBeginParams =
{
// Submit & wait for completion
{
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, vkDevice, &fenceParams));
+ const Unique<VkFence> fence (createFence(vk, vkDevice));
const VkSubmitInfo submitInfo =
{
VK_STRUCTURE_TYPE_SUBMIT_INFO,
};
vk::Move<vk::VkPipeline> pipeline(createComputePipeline(vk, device, DE_NULL, &pipelineCreateInfo));
- const vk::VkCommandPoolCreateInfo cmdPoolParams =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCmdPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- vk::Move<vk::VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolParams));
-
- const vk::VkCommandBufferAllocateInfo cmdBufParams =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *cmdPool, // VkCmdPool pool;
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCmdBufferLevel level;
- 1u, // deUint32 bufferCount;
- };
- vk::Move<vk::VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, &cmdBufParams));
+ vk::Move<vk::VkCommandPool> cmdPool (createCommandPool(vk, device, vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ vk::Move<vk::VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const vk::VkCommandBufferBeginInfo cmdBufBeginParams =
{
VK_CHECK(vk.endCommandBuffer(*cmdBuffer));
- const vk::VkFenceCreateInfo fenceParams =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- vk::Move<vk::VkFence> fence (createFence(vk, device, &fenceParams));
+ vk::Move<vk::VkFence> fence (createFence(vk, device));
const vk::VkSubmitInfo submitInfo =
{
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkSubmitInfo submitInfo =
{
0u, // deUint32 signalSemaphoreCount;
DE_NULL, // const VkSemaphore* pSignalSemaphores;
};
- const VkEventCreateInfo eventInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0
- };
- const Unique<VkEvent> event (createEvent(vk, device, &eventInfo, DE_NULL));
+ const Unique<VkEvent> event (createEvent(vk, device));
beginCommandBuffer(vk, *cmdBuffer);
vk.cmdSetEvent(*cmdBuffer, *event, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceInfo));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkFence> fence (createFence(vk, device));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkSubmitInfo submitInfo =
{
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceInfo));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkFence> fence (createFence(vk, device));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> ptrCmdBuffer[COUNT] = {makeCommandBuffer(vk, device, *cmdPool), makeCommandBuffer(vk, device, *cmdPool)};
VkCommandBuffer cmdBuffers[COUNT] = {*ptrCmdBuffer[SET], *ptrCmdBuffer[WAIT]};
const VkSubmitInfo submitInfo =
0u, // deUint32 signalSemaphoreCount;
DE_NULL, // const VkSemaphore* pSignalSemaphores;
};
- const VkEventCreateInfo eventInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0
- };
- const Unique<VkEvent> event (createEvent(vk, device, &eventInfo, DE_NULL));
+ const Unique<VkEvent> event (createEvent(vk, device));
beginCommandBuffer(vk, cmdBuffers[SET]);
vk.cmdSetEvent(cmdBuffers[SET], *event, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Move<VkFence> ptrFence[COUNT] = {createFence(vk, device, &fenceInfo), createFence(vk, device, &fenceInfo)};
+ const Move<VkFence> ptrFence[COUNT] =
+ {
+ createFence(vk, device),
+ createFence(vk, device)
+ };
VkFence fence[COUNT] = {*ptrFence[SET], *ptrFence[WAIT]};
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> ptrCmdBuffer[COUNT] = {makeCommandBuffer(vk, device, *cmdPool), makeCommandBuffer(vk, device, *cmdPool)};
VkCommandBuffer cmdBuffers[COUNT] = {*ptrCmdBuffer[SET], *ptrCmdBuffer[WAIT]};
const VkSubmitInfo submitInfo[COUNT] =
DE_NULL, // const VkSemaphore* pSignalSemaphores;
}
};
- const VkEventCreateInfo eventInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0
- };
- const Unique<VkEvent> event (createEvent(vk, device, &eventInfo, DE_NULL));
+ const Unique<VkEvent> event (createEvent(vk, device));
beginCommandBuffer(vk, cmdBuffers[SET]);
vk.cmdSetEvent(cmdBuffers[SET], *event, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceInfo));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkFence> fence (createFence(vk, device));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> primaryCmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkCommandBufferAllocateInfo cmdBufferInfo =
{
0u, // deUint32 signalSemaphoreCount;
DE_NULL, // const VkSemaphore* pSignalSemaphores;
};
- const VkEventCreateInfo eventInfo =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
- DE_NULL,
- 0
- };
- const Unique<VkEvent> event (createEvent(vk, device, &eventInfo, DE_NULL));
+ const Unique<VkEvent> event (createEvent(vk, device));
const VkCommandBufferInheritanceInfo secCmdBufInheritInfo =
{
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkFenceCreateInfo fenceInfo =
{
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkFenceCreateInfo fenceInfo =
{
const VkDevice device = context.getDevice();
const VkQueue queue = context.getUniversalQueue();
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const VkSemaphoreCreateInfo semaphoreInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkSemaphoreCreateFlags flags;
- };
- const Unique<VkSemaphore> semaphore (createSemaphore (vk, device, &semaphoreInfo, DE_NULL));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkSemaphore> semaphore (createSemaphore (vk, device));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkCommandBufferBeginInfo info =
{
DE_NULL, // const VkSemaphore* pSignalSemaphores;
}
};
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence (createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence (createFence(vk, device));
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer, &info));
endCommandBuffer(vk, *cmdBuffer);
VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, // VkCommandBufferUsageFlags flags;
DE_NULL, // const VkCommandBufferInheritanceInfo* pInheritanceInfo;
};
- const VkSemaphoreCreateInfo semaphoreInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkSemaphoreCreateFlags flags;
- };
Move<VkSemaphore> semaphore;
Move<VkCommandPool> cmdPool[COUNT];
Move<VkCommandBuffer> cmdBuffer[COUNT];
const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT };
VkSubmitInfo submitInfo[COUNT];
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
Move<VkFence> fence[COUNT];
queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instance, physicalDevice);
vk.getDeviceQueue(*logicalDevice, queues[queueReqNdx].queueFamilyIndex, 0u, &queues[queueReqNdx].queue);
}
- semaphore = (createSemaphore (vk,*logicalDevice, &semaphoreInfo, DE_NULL));
- cmdPool[FIRST] = (makeCommandPool(vk, *logicalDevice, queues[FIRST].queueFamilyIndex));
- cmdPool[SECOND] = (makeCommandPool(vk, *logicalDevice, queues[SECOND].queueFamilyIndex));
+ semaphore = (createSemaphore (vk, *logicalDevice));
+ cmdPool[FIRST] = (createCommandPool(vk, *logicalDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queues[FIRST].queueFamilyIndex));
+ cmdPool[SECOND] = (createCommandPool(vk, *logicalDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queues[SECOND].queueFamilyIndex));
cmdBuffer[FIRST] = (makeCommandBuffer(vk, *logicalDevice, *cmdPool[FIRST]));
cmdBuffer[SECOND] = (makeCommandBuffer(vk, *logicalDevice, *cmdPool[SECOND]));
VK_CHECK(vk.beginCommandBuffer(*cmdBuffer[SECOND], &info));
endCommandBuffer(vk, *cmdBuffer[SECOND]);
- fence[FIRST] = (createFence(vk, *logicalDevice, &fenceInfo));
- fence[SECOND] = (createFence(vk, *logicalDevice, &fenceInfo));
+ fence[FIRST] = (createFence(vk, *logicalDevice));
+ fence[SECOND] = (createFence(vk, *logicalDevice));
VK_CHECK(vk.queueSubmit(queues[FIRST].queue, 1u, &submitInfo[FIRST], *fence[FIRST]));
VK_CHECK(vk.queueSubmit(queues[SECOND].queue, 1u, &submitInfo[SECOND], *fence[SECOND]));
.build(vk, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u));
Buffer resultBuffer (vk, device, *queues.m_allocator, makeBufferCreateInfo(BUFFER_SIZE, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT), MemoryRequirement::HostVisible);
const VkBufferMemoryBarrier bufferBarrier = makeBufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *resultBuffer, 0ull, BUFFER_SIZE);
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
{
MemoryRequirement::Any));
Move<VkImageView> colorAttachmentView = makeImageView(vk, device, **colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange);
Move<VkFramebuffer> framebuffer = makeFramebuffer(vk, device, renderPass, *colorAttachmentView, colorImageExtent.width, colorImageExtent.height, 1u);
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const VkDescriptorBufferInfo outputBufferDescriptorInfo = makeDescriptorBufferInfo(*resultBuffer, 0ull, BUFFER_SIZE);
const Move<VkCommandPool> cmdPool[] =
{
- makeCommandPool(vk, device, queuePairs[pairNdx].familyIndexWrite),
- makeCommandPool(vk, device, queuePairs[pairNdx].familyIndexRead)
+ createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queuePairs[pairNdx].familyIndexWrite),
+ createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queuePairs[pairNdx].familyIndexRead)
};
const Move<VkCommandBuffer> ptrCmdBuffer[] =
{
*ptrCmdBuffer[QUEUETYPE_WRITE],
*ptrCmdBuffer[QUEUETYPE_READ]
};
- const VkSemaphoreCreateInfo semaphoreInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkSemaphoreCreateFlags flags;
- };
- const Unique<VkSemaphore> semaphore (createSemaphore(vk, device, &semaphoreInfo, DE_NULL));
+ const Unique<VkSemaphore> semaphore (createSemaphore(vk, device));
const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT };
const VkSubmitInfo submitInfo[] =
{
const UniquePtr<Operation> readOp (m_readOp.build(*m_opContext, *resource));
const Move<VkCommandPool> cmdPool[] =
{
- makeCommandPool(vk, device, queuePairs[pairNdx].familyIndexWrite),
- makeCommandPool(vk, device, queuePairs[pairNdx].familyIndexRead)
+ createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queuePairs[pairNdx].familyIndexWrite),
+ createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queuePairs[pairNdx].familyIndexRead)
};
const Move<VkCommandBuffer> ptrCmdBuffer[] =
{
const VkDevice device = m_context.getDevice();
const VkQueue queue = m_context.getUniversalQueue();
const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
- const Unique<VkEvent> event (makeEvent(vk, device));
+ const Unique<VkEvent> event (createEvent(vk, device));
const SyncInfo writeSync = m_writeOp->getSyncInfo();
const SyncInfo readSync = m_readOp->getSyncInfo();
const VkDevice device = m_context.getDevice();
const VkQueue queue = m_context.getUniversalQueue();
const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
const SyncInfo writeSync = m_writeOp->getSyncInfo();
const SyncInfo readSync = m_readOp->getSyncInfo();
const VkDevice device = m_context.getDevice();
const VkQueue queue = m_context.getUniversalQueue();
const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- const VkSemaphoreCreateInfo semaphoreInfo =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, //VkStructureType sType;
- DE_NULL, //const void* pNext;
- 0u //VkSemaphoreCreateFlags flags;
- };
- const Unique<VkSemaphore> semaphore (createSemaphore (vk, device, &semaphoreInfo, DE_NULL));
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkSemaphore> semaphore (createSemaphore (vk, device));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> ptrCmdBuffer[COUNT] = {makeCommandBuffer(vk, device, *cmdPool), makeCommandBuffer(vk, device, *cmdPool)};
VkCommandBuffer cmdBuffers[COUNT] = {*ptrCmdBuffer[WRITE], *ptrCmdBuffer[READ]};
const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT };
const VkDevice device = m_context.getDevice();
const VkQueue queue = m_context.getUniversalQueue();
const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
- const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
const Move<VkCommandBuffer> ptrCmdBuffer[COUNT] = {makeCommandBuffer(vk, device, *cmdPool), makeCommandBuffer(vk, device, *cmdPool)};
VkCommandBuffer cmdBuffers[COUNT] = {*ptrCmdBuffer[WRITE], *ptrCmdBuffer[READ]};
const SyncInfo writeSync = m_writeOp->getSyncInfo();
void createCommandBuffer (const DeviceInterface& deviceInterface, const VkDevice device, const deUint32 queueFamilyNdx, vk::Move<VkCommandBuffer>* commandBufferRef, vk::Move<VkCommandPool>* commandPoolRef)
{
vk::Move<VkCommandPool> commandPool;
- VkCommandPoolCreateInfo commandPoolInfo;
VkCommandBufferAllocateInfo commandBufferInfo;
VkCommandBuffer commandBuffer;
- deMemset(&commandPoolInfo, 0xcd, sizeof(commandPoolInfo));
- commandPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
- commandPoolInfo.pNext = DE_NULL;
- commandPoolInfo.flags = 0;
- commandPoolInfo.queueFamilyIndex = queueFamilyNdx;
-
- commandPool = createCommandPool(deviceInterface, device, &commandPoolInfo, DE_NULL);
+ commandPool = createCommandPool(deviceInterface, device, 0u, queueFamilyNdx);
deMemset(&commandBufferInfo, 0xcd, sizeof(commandBufferInfo));
commandBufferInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
return TestStatus::pass("synchronization-fences passed");
}
-vk::refdetails::Checked<VkSemaphore> createSemaphore (const DeviceInterface& deviceInterface, const VkDevice& device, const VkAllocationCallbacks* allocationCallbacks)
-{
- VkSemaphoreCreateInfo semaCreateInfo;
- VkSemaphore semaphore;
-
- semaCreateInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
- semaCreateInfo.pNext = DE_NULL;
- semaCreateInfo.flags = 0;
- VK_CHECK(deviceInterface.createSemaphore(device, &semaCreateInfo, allocationCallbacks, &semaphore));
-
- return vk::check<VkSemaphore>(semaphore);
-}
-
tcu::TestStatus testSemaphores (Context& context)
{
TestLog& log = context.getTestContext().getLog();
SimpleAllocator allocator (deviceInterface,
*device,
getPhysicalDeviceMemoryProperties(instanceInterface, physicalDevice));
- VkQueue queue[2];
+ const VkQueue queue[2] =
+ {
+ getDeviceQueue(deviceInterface, *device, queueFamilyIdx, 0),
+ getDeviceQueue(deviceInterface, *device, queueFamilyIdx, 1)
+ };
VkResult testStatus;
TestContext testContext1 (deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
TestContext testContext2 (deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
- Unique<VkSemaphore> semaphore (createSemaphore(deviceInterface, device.get(), (VkAllocationCallbacks*)DE_NULL), Deleter<VkSemaphore>(deviceInterface, device.get(), DE_NULL));
+ Unique<VkSemaphore> semaphore (createSemaphore(deviceInterface, *device));
VkSubmitInfo submitInfo[2];
VkMappedMemoryRange range;
void* resultImage;
const VkPipelineStageFlags waitDstStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
- deviceInterface.getDeviceQueue(device.get(), queueFamilyIdx, 0, &queue[0]);
- deviceInterface.getDeviceQueue(device.get(), queueFamilyIdx, 1, &queue[1]);
-
const tcu::Vec4 vertices1[] =
{
tcu::Vec4( 0.5f, 0.5f, 0.0f, 1.0f),
return tcu::TestStatus::pass("synchronization-semaphores passed");
}
-vk::refdetails::Checked<VkEvent> createEvent (const DeviceInterface& deviceInterface, const VkDevice& device, const VkAllocationCallbacks* allocationCallbacks)
-{
- VkEventCreateInfo eventCreateInfo;
- VkEvent event;
-
- eventCreateInfo.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
- eventCreateInfo.pNext = DE_NULL;
- eventCreateInfo.flags = 0;
- VK_CHECK(deviceInterface.createEvent(device, &eventCreateInfo, allocationCallbacks, &event));
-
- return vk::check<VkEvent>(event);
-}
-
tcu::TestStatus testEvents (Context& context)
{
TestLog& log = context.getTestContext().getLog();
VkResult testStatus;
VkResult eventStatus;
TestContext testContext (deviceInterface, device, queueFamilyIdx, context.getBinaryCollection(), allocator);
- Unique<VkEvent> event (createEvent(deviceInterface, device, (VkAllocationCallbacks*)DE_NULL), Deleter<VkEvent>(deviceInterface, device, DE_NULL));
+ Unique<VkEvent> event (createEvent(deviceInterface, device));
VkSubmitInfo submitInfo;
VkMappedMemoryRange range;
void* resultImage;
return barrier;
}
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex, // deUint32 queueFamilyIndex;
- };
- return createCommandPool(vk, device, &info);
-}
-
Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
{
const VkCommandBufferAllocateInfo info =
return copyParams;
}
-Move<VkEvent> makeEvent (const DeviceInterface& vk, const VkDevice device)
-{
- const VkEventCreateInfo eventParams =
- {
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkEventCreateFlags)0, // VkEventCreateFlags flags;
- };
- return createEvent(vk, device, &eventParams);
-}
-
void beginCommandBuffer (const DeviceInterface& vk, const VkCommandBuffer commandBuffer)
{
const VkCommandBufferBeginInfo info =
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, const vk::VkBufferUsageFlags usage);
vk::VkImageCreateInfo makeImageCreateInfo (const vk::VkImageType imageType, const vk::VkExtent3D& extent, const vk::VkFormat format, const vk::VkImageUsageFlags usage);
-vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
vk::Move<vk::VkDescriptorSet> makeDescriptorSet (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorPool descriptorPool, const vk::VkDescriptorSetLayout setLayout);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
vk::Move<vk::VkFramebuffer> makeFramebuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const vk::VkImageView colorAttachment, const deUint32 width, const deUint32 height, const deUint32 layers);
vk::Move<vk::VkFramebuffer> makeFramebufferWithoutAttachments (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass);
vk::Move<vk::VkImageView> makeImageView (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkImage image, const vk::VkImageViewType viewType, const vk::VkFormat format, const vk::VkImageSubresourceRange subresourceRange);
-vk::Move<vk::VkEvent> makeEvent (const vk::DeviceInterface& vk, const vk::VkDevice device);
vk::VkBufferImageCopy makeBufferImageCopy (const vk::VkImageSubresourceLayers subresourceLayers, const vk::VkExtent3D extent);
vk::VkMemoryBarrier makeMemoryBarrier (const vk::VkAccessFlags srcAccessMask, const vk::VkAccessFlags dstAccessMask);
vk::VkBufferMemoryBarrier makeBufferMemoryBarrier (const vk::VkAccessFlags srcAccessMask, const vk::VkAccessFlags dstAccessMask, const vk::VkBuffer buffer, const vk::VkDeviceSize offset, const vk::VkDeviceSize bufferSizeBytes);
const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat));
const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayoutWithoutDescriptors(vk, device));
const int inPatchSize = (caseDef.primitiveType == TESSPRIMITIVETYPE_TRIANGLES ? 3 : 4);
// Pipeline: set up vertex processing without rasterization
- const Unique<VkRenderPass> renderPass (makeRenderPassWithoutAttachments (vk, device));
- const Unique<VkFramebuffer> framebuffer (makeFramebufferWithoutAttachments(vk, device, *renderPass));
- const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout (vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkRenderPass> renderPass (makeRenderPassWithoutAttachments (vk, device));
+ const Unique<VkFramebuffer> framebuffer (makeFramebufferWithoutAttachments(vk, device, *renderPass));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setShader(vk, device, VK_SHADER_STAGE_VERTEX_BIT, m_context.getBinaryCollection().get("vert"), DE_NULL)
const Unique<VkFramebuffer> framebuffer (makeFramebufferWithoutAttachments(vk, device, *renderPass));
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout (vk, device, *descriptorSetLayout));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setShader(vk, device, VK_SHADER_STAGE_VERTEX_BIT, context.getBinaryCollection().get("vert"), DE_NULL)
const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), m_params.numLayers));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayoutWithoutDescriptors(vk, device));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline (GraphicsPipelineBuilder()
.setRenderSize (renderSize)
// Pipeline
- const Unique<VkImageView> colorAttachmentView(makeImageView (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
- const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat));
- const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
- const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkImageView> colorAttachmentView(makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+ const Unique<VkRenderPass> renderPass (makeRenderPass(vk, device, colorFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
// Message explaining the test
{
const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayoutWithoutDescriptors(vk, device));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
GraphicsPipelineBuilder pipelineBuilder;
, m_framebuffer (makeFramebufferWithoutAttachments(m_context.getDeviceInterface(), m_context.getDevice(), *m_renderPass))
, m_pipelineLayout (makePipelineLayout (m_context.getDeviceInterface(), m_context.getDevice(), *m_descriptorSetLayout))
, m_cmdPool (makeCommandPool (m_context.getDeviceInterface(), m_context.getDevice(), m_context.getUniversalQueueFamilyIndex()))
- , m_cmdBuffer (makeCommandBuffer (m_context.getDeviceInterface(), m_context.getDevice(), *m_cmdPool))
+ , m_cmdBuffer (allocateCommandBuffer (m_context.getDeviceInterface(), m_context.getDevice(), *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY))
{
requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(),
FEATURE_TESSELLATION_SHADER | FEATURE_GEOMETRY_SHADER | FEATURE_VERTEX_PIPELINE_STORES_AND_ATOMICS);
const Unique<VkFramebuffer> framebuffer (makeFramebufferWithoutAttachments(vk, device, *renderPass));
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout (vk, device, *descriptorSetLayout));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
for (int tessLevelCaseNdx = 0; tessLevelCaseNdx < static_cast<int>(tessLevelCases.size()); ++tessLevelCaseNdx)
{
const Unique<VkFramebuffer> framebuffer (makeFramebufferWithoutAttachments(vk, device, *renderPass));
const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout (vk, device, *descriptorSetLayout));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setPatchControlPoints (NUM_TESS_LEVELS)
// Pipeline
- const Unique<VkImageView> colorAttachmentView (makeImageView (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
- const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat));
- const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
- const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkImageView> colorAttachmentView (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+ const Unique<VkRenderPass> renderPass (makeRenderPass(vk, device, colorFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setRenderSize (renderSize)
// Pipeline
- const Unique<VkImageView> colorAttachmentView(makeImageView (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
- const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat));
- const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
- const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
- const bool needPointSizeWrite = getPhysicalDeviceFeatures(context.getInstanceInterface(), context.getPhysicalDevice()).shaderTessellationAndGeometryPointSize && caseDef.usePointMode;
+ const Unique<VkImageView> colorAttachmentView (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+ const Unique<VkRenderPass> renderPass (makeRenderPass(vk, device, colorFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+ const bool needPointSizeWrite = getPhysicalDeviceFeatures(context.getInstanceInterface(), context.getPhysicalDevice()).shaderTessellationAndGeometryPointSize && caseDef.usePointMode;
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setRenderSize (renderSize)
const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayoutWithoutDescriptors(vk, device));
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setRenderSize (renderSize)
// Pipeline
- const Unique<VkImageView> colorAttachmentView(makeImageView (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
- const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat));
- const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+ const Unique<VkImageView> colorAttachmentView(makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+ const Unique<VkRenderPass> renderPass (makeRenderPass(vk, device, colorFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout(vk, device, *descriptorSetLayout));
- const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer (vk, device, *cmdPool));
+ const Unique<VkCommandPool> cmdPool (makeCommandPool(vk, device, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
.setRenderSize (renderSize)
return createCommandPool(vk, device, &info);
}
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 commandBufferCount;
- };
- return allocateCommandBuffer(vk, device, &info);
-}
Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface& vk,
const VkDevice device,
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, const vk::VkBufferUsageFlags usage);
vk::VkImageCreateInfo makeImageCreateInfo (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage, const deUint32 numArrayLayers);
vk::Move<vk::VkCommandPool> makeCommandPool (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
-vk::Move<vk::VkCommandBuffer> makeCommandBuffer (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
vk::Move<vk::VkDescriptorSet> makeDescriptorSet (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorPool descriptorPool, const vk::VkDescriptorSetLayout setLayout);
vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
vk::Move<vk::VkPipelineLayout> makePipelineLayoutWithoutDescriptors (const vk::DeviceInterface& vk, const vk::VkDevice device);
// Draw commands
const Unique<VkCommandPool> cmdPool (makeCommandPool (vk, device, queueFamilyIndex));
- const Unique<VkCommandBuffer> cmdBuffer(makeCommandBuffer(vk, device, *cmdPool));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(testCases); ++caseNdx)
{
de::UniquePtr<Allocation> bufMem(ctx.getDefaultAllocator().allocate(bufMemReq, MemoryRequirement::HostVisible));
VK_CHECK(vkd.bindBufferMemory(dev, buf.get(), bufMem->getMemory(), bufMem->getOffset()));
- const VkCommandPoolCreateInfo copyPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
- DE_NULL,
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT,
- uqfi
- };
-
- Unique<VkCommandPool> copyPool(createCommandPool(vkd, dev, ©PoolCreateInfo));
-
- const VkCommandBufferAllocateInfo copyBufferCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- copyPool.get(),
- VK_COMMAND_BUFFER_LEVEL_PRIMARY,
- 1
- };
+ Unique<VkCommandPool> copyPool(createCommandPool(vkd, dev, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, uqfi));
- Unique<VkCommandBuffer> copyBuffer(allocateCommandBuffer(vkd, dev, ©BufferCreateInfo));
+ Unique<VkCommandBuffer> copyBuffer(allocateCommandBuffer(vkd, dev, *copyPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
std::vector<VkBufferImageCopy> copyRegions;
Allocator& allocator = m_context.getDefaultAllocator();
// Command Pool
- {
- const VkCommandPoolCreateInfo cmdPoolCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags flags;
- queueFamilyIndex // deUint32 queueFamilyIndex;
- };
-
- m_commandPool = createCommandPool(vkd, vkDevice, &cmdPoolCreateInfo, DE_NULL);
- }
+ m_commandPool = createCommandPool(vkd, vkDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
// Image
{
}
// Fence
- {
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_FENCE_CREATE_SIGNALED_BIT // VkFenceCreateFlags flags;
- };
-
- m_fence = createFence(vkd, vkDevice, &fenceParams);
- }
+ m_fence = createFence(vkd, vkDevice);
// Result Buffer
{
1 // deUint32 layerCount;
};
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1 // deUint32 commandBufferCount;
- };
-
- commandBuffer = allocateCommandBuffer(vkd, vkDevice, &cmdBufferAllocateInfo);
+ commandBuffer = allocateCommandBuffer(vkd, vkDevice, *m_commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
{
}
// Create Command Buffer
- {
- const VkCommandBufferAllocateInfo cmdBufferAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- *m_commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1 // deUint32 commandBufferCount;
- };
-
- commandBuffer = allocateCommandBuffer(vkd, vkDevice, &cmdBufferAllocateInfo);
- }
+ commandBuffer = allocateCommandBuffer(vkd, vkDevice, *m_commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
// Begin Command Buffer
{
Move<vk::VkCommandPool> createCmdPool (Context& context)
{
- const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const vk::VkCommandPoolCreateInfo params =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
- DE_NULL, // pNext
- vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // flags
- queueFamilyIndex, // queueFamilyIndex
- };
+ const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- return vk::createCommandPool(context.getDeviceInterface(), context.getDevice(), ¶ms);
+ return vk::createCommandPool(context.getDeviceInterface(), context.getDevice(), vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
}
Move<vk::VkCommandBuffer> createCmdBuffer (Context& context, vk::VkCommandPool cmdPool)
{
- const vk::VkCommandBufferAllocateInfo params =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- DE_NULL, // pNext
- cmdPool, // commandPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // bufferCount
- };
-
- return vk::allocateCommandBuffer(context.getDeviceInterface(), context.getDevice(), ¶ms);
+ return vk::allocateCommandBuffer(context.getDeviceInterface(), context.getDevice(), cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
-
// UniformBlockCaseInstance
class UniformBlockCaseInstance : public vkt::TestInstance
// Submit the command buffer
{
- const vk::VkFenceCreateInfo fenceParams =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- 0u, // VkFenceCreateFlags flags;
- };
- const Unique<vk::VkFence> fence(vk::createFence(vk, device, &fenceParams));
+ const Unique<vk::VkFence> fence(vk::createFence(vk, device));
const VkSubmitInfo submitInfo =
{
return ops[index % DE_LENGTH_OF_ARRAY(ops)];
}
-// Utility functions using flattened structs
-Move<VkFence> createFence (const DeviceInterface& vk, VkDevice device, VkFenceCreateFlags flags)
-{
- const VkFenceCreateInfo pCreateInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
-
- flags
- };
- return createFence(vk, device, &pCreateInfo);
-}
-
Move<VkFramebuffer> createFramebuffer (const DeviceInterface& vk,
VkDevice device,
VkFramebufferCreateFlags pCreateInfo_flags,
return createBuffer(vk, device, &pCreateInfo);
}
-Move<VkCommandPool> createCommandPool (const DeviceInterface& vk,
- VkDevice device,
- VkCommandPoolCreateFlags pCreateInfo_flags,
- deUint32 pCreateInfo_queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo pCreateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
- DE_NULL,
- pCreateInfo_flags,
- pCreateInfo_queueFamilyIndex,
- };
- return createCommandPool(vk, device, &pCreateInfo);
-}
-
void cmdBeginRenderPass (const DeviceInterface& vk,
VkCommandBuffer cmdBuffer,
VkRenderPass pRenderPassBegin_renderPass,
vk.cmdBeginRenderPass(cmdBuffer, &pRenderPassBegin, contents);
}
-Move<VkCommandBuffer> allocateCommandBuffer (const DeviceInterface& vk,
- VkDevice device,
- VkCommandPool pCreateInfo_commandPool,
- VkCommandBufferLevel pCreateInfo_level)
-{
- const VkCommandBufferAllocateInfo pAllocateInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- pCreateInfo_commandPool,
- pCreateInfo_level,
- 1u, // bufferCount
- };
- return allocateCommandBuffer(vk, device, &pAllocateInfo);
-}
-
void beginCommandBuffer (const DeviceInterface& vk,
VkCommandBuffer cmdBuffer,
VkCommandBufferUsageFlags pBeginInfo_flags,
Move<vk::VkCommandPool> createCommandPool (Context& context)
{
const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
- const vk::VkCommandPoolCreateInfo params =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
- DE_NULL, // pNext
- (vk::VkCommandPoolCreateFlags)0,
- queueFamilyIndex, // queueFamilyIndex
- };
- return vk::createCommandPool(context.getDeviceInterface(), context.getDevice(), ¶ms);
+ return vk::createCommandPool(context.getDeviceInterface(), context.getDevice(), (vk::VkCommandPoolCreateFlags)0u, queueFamilyIndex);
}
Move<vk::VkDescriptorPool> createDescriptorPool (Context& context)
Move<vk::VkCommandBuffer> allocateCommandBuffer (Context& context, vk::VkCommandPool cmdPool)
{
- const vk::VkCommandBufferAllocateInfo params =
- {
- vk::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- DE_NULL, // pNext
- cmdPool, // commandPool
- vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
- 1u, // bufferCount
- };
-
- return vk::allocateCommandBuffer(context.getDeviceInterface(), context.getDevice(), ¶ms);
+ return vk::allocateCommandBuffer(context.getDeviceInterface(), context.getDevice(), cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
}
MovePtr<vk::Allocation> allocateAndBindMemory (Context& context, vk::VkBuffer buffer, vk::MemoryRequirement memReqs)
0u, // signalSemaphoreCount
(const vk::VkSemaphore*)0, // pSignalSemaphores
};
- const vk::VkFenceCreateInfo fenceParams =
- {
- vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // sType
- DE_NULL, // pNext
- 0u, // flags
- };
- const Unique<vk::VkFence> fence (vk::createFence(vkd, device, &fenceParams));
+ const Unique<vk::VkFence> fence (vk::createFence(vkd, device));
VK_CHECK(vkd.queueSubmit (queue, 1u, &submitInfo, *fence));
VK_CHECK(vkd.waitForFences (device, 1u, &fence.get(), DE_TRUE, ~0ull));
VkQueue DefaultDevice::getUniversalQueue (void) const
{
- VkQueue queue = 0;
- m_deviceInterface.getDeviceQueue(*m_device, m_universalQueueFamilyIndex, 0, &queue);
- return queue;
+ return getDeviceQueue(m_deviceInterface, *m_device, m_universalQueueFamilyIndex, 0);
}
VkPhysicalDeviceFeatures DefaultDevice::filterDefaultDeviceFeatures (const VkPhysicalDeviceFeatures& deviceFeatures)
{}
};
-VkQueue getDeviceQueue (const DeviceInterface& vkd, VkDevice device, deUint32 queueFamilyIndex, deUint32 queueIndex)
-{
- VkQueue queue = (VkQueue)0;
- vkd.getDeviceQueue(device, queueFamilyIndex, queueIndex, &queue);
- return queue;
-}
-
struct DeviceHelper
{
const VkPhysicalDevice physicalDevice;
typedef de::SharedPtr<Unique<VkFence> > FenceSp;
typedef de::SharedPtr<Unique<VkSemaphore> > SemaphoreSp;
-Move<VkFence> createFence (const DeviceInterface& vkd,
- const VkDevice device)
-{
- const VkFenceCreateInfo fenceParams =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- DE_NULL,
- (VkFenceCreateFlags)0,
- };
- return vk::createFence(vkd, device, &fenceParams);
-}
-
vector<FenceSp> createFences (const DeviceInterface& vkd,
const VkDevice device,
size_t numFences)
return fences;
}
-Move<VkSemaphore> createSemaphore (const DeviceInterface& vkd,
- const VkDevice device)
-{
- const VkSemaphoreCreateInfo semaphoreParams =
- {
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
- DE_NULL,
- (VkSemaphoreCreateFlags)0,
- };
- return vk::createSemaphore(vkd, device, &semaphoreParams);
-}
-
vector<SemaphoreSp> createSemaphores (const DeviceInterface& vkd,
const VkDevice device,
size_t numSemaphores)
return semaphores;
}
-Move<VkCommandPool> createCommandPool (const DeviceInterface& vkd,
- const VkDevice device,
- VkCommandPoolCreateFlags flags,
- deUint32 queueFamilyIndex)
-{
- const VkCommandPoolCreateInfo commandPoolParams =
- {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
- DE_NULL,
- flags,
- queueFamilyIndex
- };
-
- return createCommandPool(vkd, device, &commandPoolParams);
-}
-
vector<CommandBufferSp> allocateCommandBuffers (const DeviceInterface& vkd,
const VkDevice device,
const VkCommandPool commandPool,
const VkCommandBufferLevel level,
const size_t numCommandBuffers)
{
- const VkCommandBufferAllocateInfo allocInfo =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
- DE_NULL,
- commandPool,
- level,
- 1u,
- };
-
vector<CommandBufferSp> buffers (numCommandBuffers);
for (size_t ndx = 0; ndx < numCommandBuffers; ++ndx)
- buffers[ndx] = CommandBufferSp(new Unique<VkCommandBuffer>(allocateCommandBuffer(vkd, device, &allocInfo)));
+ buffers[ndx] = CommandBufferSp(new Unique<VkCommandBuffer>(allocateCommandBuffer(vkd, device, commandPool, level)));
return buffers;
}