#include "vkBarrierUtil.hpp"
#include "deStringUtil.hpp"
#include <set>
+#include <limits>
namespace vkt
{
}
}
-VkImageCreateInfo makeImageCreateInfo (const VkImageType imageType, const VkExtent3D& extent, const VkFormat format, const VkImageUsageFlags usage)
+VkImageCreateInfo makeImageCreateInfo (const VkImageType imageType,
+ const VkExtent3D& extent,
+ const VkFormat format,
+ const VkImageUsageFlags usage,
+ const VkSampleCountFlagBits samples,
+ const VkImageTiling tiling)
{
- const VkImageCreateInfo imageInfo =
+ return
{
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // VkStructureType sType;
DE_NULL, // const void* pNext;
extent, // VkExtent3D extent;
1u, // uint32_t mipLevels;
1u, // uint32_t arrayLayers;
- VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;
- VK_IMAGE_TILING_OPTIMAL, // VkImageTiling tiling;
+ samples, // VkSampleCountFlagBits samples;
+ tiling, // VkImageTiling tiling;
usage, // VkImageUsageFlags usage;
VK_SHARING_MODE_EXCLUSIVE, // VkSharingMode sharingMode;
0u, // uint32_t queueFamilyIndexCount;
DE_NULL, // const uint32_t* pQueueFamilyIndices;
VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
};
- return imageInfo;
}
void beginRenderPassWithRasterizationDisabled (const DeviceInterface& vk,
std::size_t signalSemaphoreValueIndexPlusOne;
};
- bool isStageFlagAllowed(VkPipelineStageFlags2KHR stage)
+ bool isStageFlagAllowed(VkPipelineStageFlags2KHR stage) const
{
// synchronization2 suports more stages then legacy synchronization
// and so SynchronizationWrapper can only be used for cases that
return (allowedStages.find(static_cast<deUint32>(stage)) != allowedStages.end());
}
- bool isAccessFlagAllowed(VkAccessFlags2KHR access)
+ bool isAccessFlagAllowed(VkAccessFlags2KHR access) const
{
// synchronization2 suports more access flags then legacy synchronization
// and so SynchronizationWrapper can only be used for cases that
}
}
- void cmdPipelineBarrier(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdPipelineBarrier(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo) const override
{
DE_ASSERT(pDependencyInfo);
);
}
- void cmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfoKHR* pDependencyInfo) const override
{
DE_ASSERT(pDependencyInfo);
m_vk.cmdSetEvent(commandBuffer, event, static_cast<VkPipelineStageFlags>(srcStageMask));
}
- void cmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR flag) override
+ void cmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR flag) const override
{
DE_ASSERT(isStageFlagAllowed(flag));
VkPipelineStageFlags legacyStageMask = static_cast<VkPipelineStageFlags>(flag);
m_vk.cmdResetEvent(commandBuffer, event, legacyStageMask);
}
- void cmdWaitEvents(VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdWaitEvents(VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfo) const override
{
DE_ASSERT(pDependencyInfo);
});
}
- void cmdPipelineBarrier(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdPipelineBarrier(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo) const override
{
m_vk.cmdPipelineBarrier2KHR(commandBuffer, pDependencyInfo);
}
- void cmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfoKHR* pDependencyInfo) const override
{
m_vk.cmdSetEvent2KHR(commandBuffer, event, pDependencyInfo);
}
- void cmdWaitEvents(VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfo) override
+ void cmdWaitEvents(VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfo) const override
{
m_vk.cmdWaitEvents2KHR(commandBuffer, eventCount, pEvents, pDependencyInfo);
}
- void cmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR flag) override
+ void cmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR flag) const override
{
m_vk.cmdResetEvent2KHR(commandBuffer, event, flag);
}
throw tcu::NotSupportedError("Tessellation and geometry shaders don't support PointSize built-in");
}
-void requireStorageImageSupport(const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkFormat fmt)
+void requireStorageImageSupport(const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkFormat fmt, const VkImageTiling tiling)
{
- const VkFormatProperties p = getPhysicalDeviceFormatProperties(vki, physDevice, fmt);
- if ((p.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) == 0)
+ const VkFormatProperties p = getPhysicalDeviceFormatProperties(vki, physDevice, fmt);
+ const auto& features = ((tiling == VK_IMAGE_TILING_LINEAR) ? p.linearTilingFeatures : p.optimalTilingFeatures);
+
+ if ((features & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) == 0)
throw tcu::NotSupportedError("Storage image format not supported");
}
{
std::ostringstream str;
- if (resource.type == RESOURCE_TYPE_BUFFER)
+ if ((resource.type == RESOURCE_TYPE_BUFFER) ||
+ (resource.type == RESOURCE_TYPE_INDEX_BUFFER))
+ {
str << "buffer_" << resource.size.x();
+ }
else if (resource.type == RESOURCE_TYPE_IMAGE)
{
str << "image_" << resource.size.x()
};
}
-VkDependencyInfoKHR makeCommonDependencyInfo(const VkMemoryBarrier2KHR* pMemoryBarrier, const VkBufferMemoryBarrier2KHR* pBufferMemoryBarrier, const VkImageMemoryBarrier2KHR* pImageMemoryBarrier)
+VkDependencyInfoKHR makeCommonDependencyInfo(const VkMemoryBarrier2KHR* pMemoryBarrier, const VkBufferMemoryBarrier2KHR* pBufferMemoryBarrier, const VkImageMemoryBarrier2KHR* pImageMemoryBarrier,
+ bool eventDependency)
{
return
{
- VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR, // VkStructureType sType
- DE_NULL, // const void* pNext
- VK_DEPENDENCY_BY_REGION_BIT, // VkDependencyFlags dependencyFlags
- !!pMemoryBarrier, // deUint32 memoryBarrierCount
- pMemoryBarrier, // const VkMemoryBarrier2KHR* pMemoryBarriers
- !!pBufferMemoryBarrier, // deUint32 bufferMemoryBarrierCount
- pBufferMemoryBarrier, // const VkBufferMemoryBarrier2KHR* pBufferMemoryBarriers
- !!pImageMemoryBarrier, // deUint32 imageMemoryBarrierCount
- pImageMemoryBarrier // const VkImageMemoryBarrier2KHR* pImageMemoryBarriers
+ VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR, // VkStructureType sType
+ DE_NULL, // const void* pNext
+ eventDependency ? (VkDependencyFlags)0u : (VkDependencyFlags)VK_DEPENDENCY_BY_REGION_BIT, // VkDependencyFlags dependencyFlags
+ !!pMemoryBarrier, // deUint32 memoryBarrierCount
+ pMemoryBarrier, // const VkMemoryBarrier2KHR* pMemoryBarriers
+ !!pBufferMemoryBarrier, // deUint32 bufferMemoryBarrierCount
+ pBufferMemoryBarrier, // const VkBufferMemoryBarrier2KHR* pBufferMemoryBarriers
+ !!pImageMemoryBarrier, // deUint32 imageMemoryBarrierCount
+ pImageMemoryBarrier // const VkImageMemoryBarrier2KHR* pImageMemoryBarriers
};
};