Fix some validation errors in tests

This commit is contained in:
baldurk
2026-07-24 17:52:48 +01:00
parent fff1cc4b0e
commit ccc110c57e
2 changed files with 24 additions and 12 deletions
+13 -10
View File
@@ -147,15 +147,19 @@ void updateDescriptorSets(VkDevice device, const std::vector<VkWriteDescriptorSe
void cmdPipelineBarrier(VkCommandBuffer cmd, std::initializer_list<VkImageMemoryBarrier> img,
std::initializer_list<VkBufferMemoryBarrier> buf = {},
std::initializer_list<VkMemoryBarrier> mem = {},
VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT |
VK_PIPELINE_STAGE_HOST_BIT,
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT |
VK_PIPELINE_STAGE_HOST_BIT,
VkDependencyFlags dependencyFlags = 0);
void cmdPipelineBarrier(VkCommandBuffer cmd, const std::vector<VkImageMemoryBarrier> &img,
const std::vector<VkBufferMemoryBarrier> &buf = {},
const std::vector<VkMemoryBarrier> &mem = {},
VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT |
VK_PIPELINE_STAGE_HOST_BIT,
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT |
VK_PIPELINE_STAGE_HOST_BIT,
VkDependencyFlags dependencyFlags = 0);
struct ClearColorValue;
@@ -309,7 +313,7 @@ struct DeviceQueueCreateInfo : public VkDeviceQueueCreateInfo
struct DeviceCreateInfo : public VkDeviceCreateInfo
{
DeviceCreateInfo(const std::vector<VkDeviceQueueCreateInfo> &queues,
const std::vector<const char *> &layers, const std::vector<const char *> &exts,
const std::vector<const char *> &exts,
const VkPhysicalDeviceFeatures *features = NULL)
{
sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
@@ -317,17 +321,16 @@ struct DeviceCreateInfo : public VkDeviceCreateInfo
flags = 0;
queueCreateInfoCount = uint32_t(queues.size());
pQueueCreateInfos = queues.data();
enabledLayerCount = uint32_t(layers.size());
ppEnabledLayerNames = layers.data();
enabledLayerCount = 0;
ppEnabledLayerNames = NULL;
enabledExtensionCount = uint32_t(exts.size());
ppEnabledExtensionNames = exts.data();
pEnabledFeatures = features;
}
DeviceCreateInfo(const std::vector<VkDeviceQueueCreateInfo> &queues,
const std::vector<const char *> &layers, const std::vector<const char *> &exts,
const VkPhysicalDeviceFeatures &features)
: DeviceCreateInfo(queues, layers, exts, &features)
const std::vector<const char *> &exts, const VkPhysicalDeviceFeatures &features)
: DeviceCreateInfo(queues, exts, &features)
{
}
+11 -2
View File
@@ -736,8 +736,7 @@ bool VulkanGraphicsTest::Init()
queueCreates.push_back(vkh::DeviceQueueCreateInfo(transferQueueFamilyIndex, 1, priorities));
CHECK_VKR(vkCreateDevice(
phys, vkh::DeviceCreateInfo(queueCreates, enabledLayers, devExts, features).next(devInfoNext),
NULL, &device));
phys, vkh::DeviceCreateInfo(queueCreates, devExts, features).next(devInfoNext), NULL, &device));
volkLoadDevice(device);
@@ -1693,6 +1692,16 @@ bool VulkanWindow::CreateSwapchain()
renderPassCreateInfo.addSubpass({VkAttachmentReference({0, VK_IMAGE_LAYOUT_GENERAL})});
// add deps to allow clear/copy on the main target before or after
renderPassCreateInfo.dependencies.push_back(vkh::SubpassDependency(
~0U, 0, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT));
renderPassCreateInfo.dependencies.push_back(vkh::SubpassDependency(
0, ~0U, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT));
rp = m_Test->createRenderPass(renderPassCreateInfo);
}