};
const Unique<VkCommandPool> cmdPool (createCommandPool(vk, vkDevice, &cmdPoolParams));
- // create a minimal amount of command buffers - is there any minimal amount in spec?
+ // \todo Determining the minimum number of command buffers should be a function of available system memory and driver capabilities.
+#if (DE_PTR_SIZE == 4)
+ const unsigned minCommandBuffer = 1024;
+#else
const unsigned minCommandBuffer = 10000;
+#endif
// Command buffer
const VkCommandBufferAllocateInfo cmdBufParams =
};
const Unique<VkCommandPool> cmdPool (createCommandPool(vk, vkDevice, &cmdPoolParams));
- // create a minimal amount of command buffers - is there any minimal amount in spec?
+ // \todo Determining the minimum number of command buffers should be a function of available system memory and driver capabilities.
+#if (DE_PTR_SIZE == 4)
+ const unsigned minCommandBuffer = 1024;
+#else
const unsigned minCommandBuffer = 10000;
+#endif
// Command buffer
const VkCommandBufferAllocateInfo cmdBufParams =
return type == vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || type == vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC;
}
+void verifyDriverSupport(const vk::VkPhysicalDeviceFeatures& deviceFeatures,
+ vk::VkDescriptorType descType,
+ vk::VkShaderStageFlags activeStages)
+{
+ switch (descType)
+ {
+ case vk::VK_DESCRIPTOR_TYPE_SAMPLER:
+ case vk::VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ case vk::VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+ case vk::VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
+ case vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+ case vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+ // These are supported in all stages
+ return;
+
+ case vk::VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+ case vk::VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
+ case vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+ case vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
+ if (activeStages & (vk::VK_SHADER_STAGE_VERTEX_BIT |
+ vk::VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT |
+ vk::VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT |
+ vk::VK_SHADER_STAGE_GEOMETRY_BIT))
+ {
+ if (!deviceFeatures.vertexPipelineStoresAndAtomics)
+ TCU_THROW(NotSupportedError, (de::toString(descType) + " is not supported in the vertex pipeline").c_str());
+ }
+
+ if (activeStages & vk::VK_SHADER_STAGE_FRAGMENT_BIT)
+ {
+ if (!deviceFeatures.fragmentStoresAndAtomics)
+ TCU_THROW(NotSupportedError, (de::toString(descType) + " is not supported in fragment shaders").c_str());
+ }
+ return;
+
+ default:
+ DE_FATAL("Impossible");
+ }
+}
+
vk::VkImageType viewTypeToImageType (vk::VkImageViewType type)
{
switch (type)
vkt::TestInstance* BufferDescriptorCase::createInstance (vkt::Context& context) const
{
+ verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT)
{
DE_ASSERT(m_isPrimaryCmdBuf); // secondaries are only valid within renderpass
vkt::TestInstance* ImageDescriptorCase::createInstance (vkt::Context& context) const
{
+ verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
switch (m_descriptorType)
{
case vk::VK_DESCRIPTOR_TYPE_SAMPLER:
vkt::TestInstance* TexelBufferDescriptorCase::createInstance (vkt::Context& context) const
{
+ verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT)
{
DE_ASSERT(m_isPrimaryCmdBuf); // secondaries are only valid within renderpass
}
else if (m_scale == BLIT_SCALE_20)
{
- tcu::TextureLevel source (TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), m_srcImageWidth, m_srcImageHeight);
+ tcu::TextureLevel source (TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), m_srcImageWidth, m_srcImageHeight);
+ const float xscale = ((float)m_srcImageWidth) / (float)m_imageWidth;
+ const float yscale = ((float)m_srcImageHeight) / (float)m_imageHeight;
for (deInt32 y = 0; y < m_srcImageHeight; y++)
for (deInt32 x = 0; x < m_srcImageWidth; x++)
for (deInt32 y = 0; y < m_imageHeight; y++)
for (deInt32 x = 0; x < m_imageWidth; x++)
- refAccess.setPixel(source.getAccess().getPixelUint(x / 2, y / 2), x, y);
+ refAccess.setPixel(source.getAccess().getPixelUint(int(x * xscale), int(y * yscale)), x, y);
}
else
DE_FATAL("Unsupported scale");