<TestSuite name="linkage">
<TestSuite name="varying">
<TestCase name="rules">
- <Test name="fragment_declare">
- <TestInstance/>
- </Test>
<Test name="vertex_declare">
<TestInstance/>
</Test>
<TestInstance/>
</Test>
</TestCase>
- <TestCase name="indirect_draw">
- <Test name="indirect_draw_triangle_list">
- <TestInstance/>
- </Test>
- <Test name="indirect_draw_triangle_strip">
- <TestInstance/>
- </Test>
- <Test name="indirect_draw_instanced_triangle_list">
- <TestInstance/>
- </Test>
- <Test name="indirect_draw_instanced_triangle_strip">
- <TestInstance/>
- </Test>
- </TestCase>
+ <TestSuite name="indirect_draw">
+ <TestCase name="indirect_draw">
+ <Test name="triangle_list">
+ <TestInstance/>
+ </Test>
+ <Test name="triangle_strip">
+ <TestInstance/>
+ </Test>
+ </TestCase>
+ <TestSuite name="indirect_draw_instanced">
+ <TestCase name="no_first_instance">
+ <Test name="triangle_list">
+ <TestInstance/>
+ </Test>
+ <Test name="triangle_strip">
+ <TestInstance/>
+ </Test>
+ </TestCase>
+ <TestCase name="first_instance">
+ <Test name="triangle_list">
+ <TestInstance/>
+ </Test>
+ <Test name="triangle_strip">
+ <TestInstance/>
+ </Test>
+ </TestCase>
+ </TestSuite>
+ </TestSuite>
</TestSuite>
<TestSuite name="compute">
<TestCase name="basic">
dEQP-VK.glsl.functions.misc.argument_eval_order_1_fragment
dEQP-VK.glsl.functions.misc.argument_eval_order_2_vertex
dEQP-VK.glsl.functions.misc.argument_eval_order_2_fragment
-dEQP-VK.glsl.linkage.varying.rules.fragment_declare
dEQP-VK.glsl.linkage.varying.rules.vertex_declare
dEQP-VK.glsl.linkage.varying.rules.both_declare
dEQP-VK.glsl.linkage.varying.rules.vertex_declare_fragment_use
dEQP-VK.draw.indexed_draw.draw_indexed_triangle_strip
dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_list
dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_strip
-dEQP-VK.draw.indirect_draw.indirect_draw_triangle_list
-dEQP-VK.draw.indirect_draw.indirect_draw_triangle_strip
-dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_list
-dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw.triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_strip
dEQP-VK.compute.basic.empty_shader
dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation
dEQP-VK.compute.basic.ubo_to_ssbo_single_group
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2014 The Android Open Source Project
+ Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
If the submission package covers multiple products, you can list them by appending
additional `PRODUCT:` lines to the conformance statement. For example:
- CONFORM_VERSION: vulkan-cts-1.0.0-internal
+ CONFORM_VERSION: vulkan-cts-1.0.0.2
PRODUCT: Product A
PRODUCT: Product B
...
--- /dev/null
+#version 430
+
+layout(location = 0) in vec4 in_position;
+layout(location = 1) in vec4 in_color;
+
+layout(location = 0) out vec4 out_color;
+
+void main() {
+ vec2 perVertex = vec2(in_position.x, in_position.y);
+ vec2 perInstance[6] = vec2[6](vec2(0.0, 0.0), vec2(0.3, 0.0), vec2(0.0, -0.3),vec2(0.3, -0.3), vec2(0.7, -0.7), vec2(-0.75, 0.8));
+
+ gl_Position = vec4(perVertex + perInstance[gl_InstanceIndex], 0.0, 1.0);
+ out_color = in_color;
+}
\ No newline at end of file
# Linking rules
group rules "Varying linking rules"
- # not declared in vertex shader, declared in fragment shader
- case fragment_declare
- version 310 es
- desc "varying declared in fragment shader, no reference in vertex shader"
- values { output float out0 = 1.0; }
- vertex ""
- #version 310 es
- ${VERTEX_DECLARATIONS}
- void main()
- {
- ${VERTEX_OUTPUT}
- }
- ""
- fragment ""
- #version 310 es
- precision mediump float;
- layout(location = 0) in mediump float var;
- ${FRAGMENT_DECLARATIONS}
- void main()
- {
- out0 = 1.0;
- ${FRAGMENT_OUTPUT}
- }
- ""
- end
-
# declared in vertex shader, no reference in frag shader
case vertex_declare
version 310 es
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
DE_NULL, // const void* pNext;
0u, // VkAccessFlags srcAccessMask;
- 0u, // VkAccessFlags dstAccessMask;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask;
VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
for (deUint32 i = 0; i < m_params.regions.size(); i++)
imageCopies[i] = m_params.regions[i].imageCopy;
- // Barriers for copying image to buffer
- const VkImageMemoryBarrier srcImageBarrier =
- {
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
- VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask;
- VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout;
- VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
- m_source.get(), // VkImage image;
- { // VkImageSubresourceRange subresourceRange;
- getAspectFlag(srcTcuFormat), // VkImageAspectFlags aspectMask;
- 0u, // deUint32 baseMipLevel;
- 1u, // deUint32 mipLevels;
- 0u, // deUint32 baseArraySlice;
- 1u // deUint32 arraySize;
- }
- };
-
- const VkImageMemoryBarrier dstImageBarrier =
+ const VkImageMemoryBarrier imageBarriers[] =
{
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
- VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask;
- VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout;
- VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
- m_destination.get(), // VkImage image;
- { // VkImageSubresourceRange subresourceRange;
- getAspectFlag(dstTcuFormat), // VkImageAspectFlags aspectMask;
- 0u, // deUint32 baseMipLevel;
- 1u, // deUint32 mipLevels;
- 0u, // deUint32 baseArraySlice;
- 1u // deUint32 arraySize;
- }
+ // source image
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ m_source.get(), // VkImage image;
+ { // VkImageSubresourceRange subresourceRange;
+ getAspectFlag(srcTcuFormat), // VkImageAspectFlags aspectMask;
+ 0u, // deUint32 baseMipLevel;
+ 1u, // deUint32 mipLevels;
+ 0u, // deUint32 baseArraySlice;
+ 1u // deUint32 arraySize;
+ }
+ },
+ // destination image
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ m_destination.get(), // VkImage image;
+ { // VkImageSubresourceRange subresourceRange;
+ getAspectFlag(dstTcuFormat), // VkImageAspectFlags aspectMask;
+ 0u, // deUint32 baseMipLevel;
+ 1u, // deUint32 mipLevels;
+ 0u, // deUint32 baseArraySlice;
+ 1u // deUint32 arraySize;
+ }
+ },
};
const VkCommandBufferBeginInfo cmdBufferBeginInfo =
};
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
- vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &srcImageBarrier);
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
vk.cmdCopyImage(*m_cmdBuffer, m_source.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), imageCopies);
- vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &dstImageBarrier);
VK_CHECK(vk.endCommandBuffer(*m_cmdBuffer));
const VkSubmitInfo submitInfo =
const VkQueue queue = m_context.getUniversalQueue();
SimpleAllocator memAlloc (vk, vkDevice, getPhysicalDeviceMemoryProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice()));
- // Barriers for copying image to buffer
- const VkBufferMemoryBarrier bufferBarrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
- VK_ACCESS_HOST_READ_BIT, // VkAccessFlags dstAccessMask;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
- VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
- *m_source, // VkBuffer buffer;
- 0u, // VkDeviceSize offset;
- m_bufferSize // VkDeviceSize size;
- };
-
const VkImageMemoryBarrier imageBarrier =
{
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
DE_NULL, // const void* pNext;
VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
- VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask;
VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout;
- VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout;
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
*m_destination, // VkImage image;
};
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
- vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &bufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
- vk.cmdCopyBufferToImage(*m_cmdBuffer, m_source.get(), m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), bufferImageCopies);
vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
+ vk.cmdCopyBufferToImage(*m_cmdBuffer, m_source.get(), m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), bufferImageCopies);
VK_CHECK(vk.endCommandBuffer(*m_cmdBuffer));
const VkSubmitInfo submitInfo =
VK_CHECK(vk.queueSubmit(queue, 1, &submitInfo, *m_fence));
VK_CHECK(vk.waitForFences(vkDevice, 1, &m_fence.get(), true, ~(0ull) /* infinity */));
- // Read buffer data
de::MovePtr<tcu::TextureLevel> resultLevel = readImage(vk, vkDevice, queue, memAlloc, *m_destination, m_params.dst.image.format, m_params.dst.image.extent);
deFree(bufferImageCopies);
#include "tcuResultCollector.hpp"
#include "deUniquePtr.hpp"
+#include "deString.h"
#include "deStringUtil.hpp"
#include "deSTLUtil.hpp"
#include "deMemory.h"
VkPhysicalDeviceFeatures features;
deUint8 buffer[sizeof(VkPhysicalDeviceProperties) + GUARD_SIZE];
- const QueryMemberTableEntry limitOffsetTable[] =
+ const QueryMemberTableEntry physicalDevicePropertiesOffsetTable[] =
{
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension1D),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension2D),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension3D),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimensionCube),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageArrayLayers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelBufferElements),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxUniformBufferRange),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxStorageBufferRange),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPushConstantsSize),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxMemoryAllocationCount),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerAllocationCount),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, bufferImageGranularity),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sparseAddressSpaceSize),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxBoundDescriptorSets),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorSamplers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorUniformBuffers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorStorageBuffers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorSampledImages),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorStorageImages),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorInputAttachments),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageResources),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetSamplers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetUniformBuffers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetUniformBuffersDynamic),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageBuffers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageBuffersDynamic),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetSampledImages),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageImages),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetInputAttachments),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputAttributes),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputBindings),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputAttributeOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputBindingStride),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationGenerationLevel),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationPatchSize),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerVertexInputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerVertexOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerPatchOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlTotalOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationEvaluationInputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationEvaluationOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryShaderInvocations),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryInputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryOutputVertices),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryTotalOutputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentInputComponents),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentOutputAttachments),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentDualSrcAttachments),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentCombinedOutputResources),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeSharedMemorySize),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupCount[3]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupInvocations),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupSize[3]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subPixelPrecisionBits),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subTexelPrecisionBits),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, mipmapPrecisionBits),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDrawIndexedIndexValue),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDrawIndirectCount),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerLodBias),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerAnisotropy),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxViewports),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxViewportDimensions[2]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, viewportBoundsRange[2]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, viewportSubPixelBits),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minMemoryMapAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelBufferOffsetAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minUniformBufferOffsetAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minStorageBufferOffsetAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelGatherOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelGatherOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minInterpolationOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxInterpolationOffset),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subPixelInterpolationOffsetBits),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferWidth),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferHeight),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferLayers),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferColorSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferDepthSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferStencilSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferNoAttachmentsSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxColorAttachments),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageColorSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageIntegerSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageDepthSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageStencilSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, storageImageSampleCounts),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSampleMaskWords),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, timestampComputeAndGraphics),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, timestampPeriod),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxClipDistances),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxCullDistances),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxCombinedClipAndCullDistances),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, discreteQueuePriorities),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, pointSizeRange[2]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, lineWidthRange[2]),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, pointSizeGranularity),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, lineWidthGranularity),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, strictLines),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, standardSampleLocations),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, optimalBufferCopyOffsetAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, optimalBufferCopyRowPitchAlignment),
- OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, nonCoherentAtomSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, apiVersion),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, driverVersion),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, vendorID),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceID),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceType),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, pipelineCacheUUID),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension1D),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension2D),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension3D),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimensionCube),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageArrayLayers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelBufferElements),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxUniformBufferRange),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxStorageBufferRange),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPushConstantsSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxMemoryAllocationCount),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAllocationCount),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.bufferImageGranularity),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sparseAddressSpaceSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxBoundDescriptorSets),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSamplers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorUniformBuffers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageBuffers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSampledImages),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageImages),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorInputAttachments),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageResources),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSamplers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffersDynamic),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffersDynamic),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSampledImages),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageImages),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetInputAttachments),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributes),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindings),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributeOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindingStride),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationGenerationLevel),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationPatchSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexInputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerPatchOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlTotalOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationInputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryShaderInvocations),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryInputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputVertices),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryTotalOutputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentInputComponents),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentOutputAttachments),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentDualSrcAttachments),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentCombinedOutputResources),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeSharedMemorySize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupCount[3]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupInvocations),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupSize[3]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelPrecisionBits),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subTexelPrecisionBits),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.mipmapPrecisionBits),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndexedIndexValue),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndirectCount),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerLodBias),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAnisotropy),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewports),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewportDimensions[2]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportBoundsRange[2]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportSubPixelBits),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minMemoryMapAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelBufferOffsetAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minUniformBufferOffsetAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minStorageBufferOffsetAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelGatherOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelGatherOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minInterpolationOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxInterpolationOffset),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelInterpolationOffsetBits),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferWidth),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferHeight),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferLayers),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferColorSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferDepthSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferStencilSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferNoAttachmentsSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxColorAttachments),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageColorSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageIntegerSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageDepthSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageStencilSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.storageImageSampleCounts),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSampleMaskWords),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampComputeAndGraphics),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampPeriod),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxClipDistances),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCullDistances),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCombinedClipAndCullDistances),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.discreteQueuePriorities),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeRange[2]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthRange[2]),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeGranularity),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthGranularity),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.strictLines),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.standardSampleLocations),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyOffsetAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyRowPitchAlignment),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.nonCoherentAtomSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DBlockShape),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DMultisampleBlockShape),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard3DBlockShape),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyAlignedMipSize),
+ OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyNonResidentStrict),
{ 0, 0 }
};
}
}
- if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), limitOffsetTable))
+ if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), physicalDevicePropertiesOffsetTable))
{
log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties not completely initialized" << TestLog::EndMessage;
return tcu::TestStatus::fail("deviceProperties incomplete initialization");
}
+ // Check if deviceName string is properly terminated.
+ if (deStrnlen(props->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) == VK_MAX_PHYSICAL_DEVICE_NAME_SIZE)
+ {
+ log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties deviceName not properly initialized" << TestLog::EndMessage;
+ return tcu::TestStatus::fail("deviceProperties incomplete initialization");
+ }
+
{
const ApiVersion deviceVersion = unpackVersion(props->apiVersion);
const ApiVersion deqpVersion = unpackVersion(VK_API_VERSION);
VK_FALSE, // stencilTestEnable
{ VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0u, 0u, 0u },
{ VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0u, 0u, 0u },
- -1.0f, // minDepthBounds
- +1.0f, // maxDepthBounds
+ 0.0f, // minDepthBounds
+ 1.0f, // maxDepthBounds
};
const VkPipelineColorBlendAttachmentState colorBlendAttState[]=
{
0u, // writeMask
0u, // reference
}, // back;
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkViewport viewport0 =
{
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 deUint64 infiniteTimeout = ~(deUint64)0u;
VK_CHECK(m_vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo));
m_vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (vk::VkDependencyFlags)0,
(const vk::VkSemaphore*)0,
};
- VK_CHECK(m_vki.queueSubmit(m_queue, 1, &submitInfo, (vk::VkFence)0));
+ VK_CHECK(m_vki.queueSubmit(m_queue, 1u, &submitInfo, *fence));
}
+ VK_CHECK(m_vki.waitForFences(m_device, 1u, &fence.get(), vk::VK_TRUE, infiniteTimeout));
// and then render to
renderToTarget();
flushMappedMemoryRange(vki, device, bufferMemory->getMemory(), bufferMemory->getOffset(), bufferSize);
+ // Flushed host-visible memory is automatically made available to the GPU, no barrier is needed.
+
*outMemory = bufferMemory;
return buffer;
}
void BufferRenderInstance::writeDrawCmdBuffer (vk::VkCommandBuffer cmd) const
{
- const bool isUniformBuffer = isUniformDescriptorType(m_descriptorType);
-
// \note dynamic offset replaces the view offset, i.e. it is not offset relative to the view offset
const deUint32 dynamicOffsets[] =
{
const deUint32 numOffsets = (!m_setDynamicOffset) ? (0u) : (getInterfaceNumResources(m_shaderInterface));
const deUint32* const dynamicOffsetPtr = (!m_setDynamicOffset) ? (DE_NULL) : (dynamicOffsets);
- // make host writes device-visible
- const vk::VkAccessFlags inputBit = (isUniformBuffer) ? (vk::VK_ACCESS_UNIFORM_READ_BIT) : (vk::VK_ACCESS_SHADER_READ_BIT);
- const vk::VkBufferMemoryBarrier memoryBarriers[] =
- {
- {
- vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- DE_NULL,
- vk::VK_ACCESS_HOST_WRITE_BIT, // outputMask
- inputBit, // inputMask
- vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex
- vk::VK_QUEUE_FAMILY_IGNORED, // destQueueFamilyIndex
- *m_sourceBufferA, // buffer
- 0u, // offset
- (vk::VkDeviceSize)m_bufferSizeA, // size
- },
- {
- vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- DE_NULL,
- vk::VK_ACCESS_HOST_WRITE_BIT, // outputMask
- inputBit, // inputMask
- vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex
- vk::VK_QUEUE_FAMILY_IGNORED, // destQueueFamilyIndex
- *m_sourceBufferB, // buffer
- 0u, // offset
- (vk::VkDeviceSize)m_bufferSizeB, // size
- }
- };
- const deUint32 numMemoryBarriers = getInterfaceNumResources(m_shaderInterface);
-
m_vki.cmdBindDescriptorSets(cmd, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, getPipelineLayout(), 0, 1, &m_descriptorSet.get(), numOffsets, dynamicOffsetPtr);
- m_vki.cmdPipelineBarrier(cmd, 0u, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, (vk::VkDependencyFlags)0,
- 0, (const vk::VkMemoryBarrier*)DE_NULL,
- numMemoryBarriers, memoryBarriers,
- 0, (const vk::VkImageMemoryBarrier*)DE_NULL);
m_vki.cmdDraw(cmd, 6 * 4, 1, 0, 0); // render four quads (two separate triangles)
}
m_vki.cmdBindDescriptorSets(*cmd, vk::VK_PIPELINE_BIND_POINT_COMPUTE, m_pipelineLayout, 0, m_numDescriptorSets, m_descriptorSets, m_numDynamicOffsets, m_dynamicOffsets);
if (m_numPreBarriers)
- m_vki.cmdPipelineBarrier(*cmd, 0u, vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (vk::VkDependencyFlags)0,
+ m_vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (vk::VkDependencyFlags)0,
0, (const vk::VkMemoryBarrier*)DE_NULL,
m_numPreBarriers, m_preBarriers,
0, (const vk::VkImageMemoryBarrier*)DE_NULL);
if ((m_activeStages & vk::VK_SHADER_STAGE_VERTEX_BIT) != 0u)
{
+ const bool onlyVS = (m_activeStages == vk::VK_SHADER_STAGE_VERTEX_BIT);
+
// active vertex shader
buf << versionDecl << "\n"
<< genExtensionDeclarations(vk::VK_SHADER_STAGE_VERTEX_BIT)
<< genResourceDeclarations(vk::VK_SHADER_STAGE_VERTEX_BIT, 0)
<< "layout(location = 0) out highp vec4 " << nextStageName << "_color;\n"
- << "layout(location = 1) flat out highp int " << nextStageName << "_quadrant_id;\n"
+ << (onlyVS ? "" : "layout(location = 1) flat out highp int " + de::toString(nextStageName) + "_quadrant_id;\n")
<< "void main (void)\n"
<< "{\n"
<< " highp vec4 result_position;\n"
<< " highp int quadrant_id;\n"
<< s_quadrantGenVertexPosSource
<< " gl_Position = result_position;\n"
- << " " << nextStageName << "_quadrant_id = quadrant_id;\n"
+ << (onlyVS ? "" : "\t" + de::toString(nextStageName) + "_quadrant_id = quadrant_id;\n")
<< "\n"
<< " highp vec4 result_color;\n"
<< genResourceAccessSource(vk::VK_SHADER_STAGE_VERTEX_BIT)
<< "{\n"
<< " highp vec4 read_colors[4];\n"
<< "} b_out;\n"
- << "void main(void)\n"
+ << "void main (void)\n"
<< "{\n"
<< " highp int quadrant_id = int(gl_WorkGroupID.x);\n"
<< " highp vec4 result_color;\n"
vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
DE_NULL,
0u, // outputMask
- 0u, // inputMask
+ vk::VK_ACCESS_TRANSFER_WRITE_BIT, // inputMask
vk::VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout
vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout
vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex
// record command buffer
VK_CHECK(vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo));
- vki.cmdPipelineBarrier(*cmd, 0u, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, (vk::VkDependencyFlags)0,
+ vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, (vk::VkDependencyFlags)0,
0, (const vk::VkMemoryBarrier*)DE_NULL,
1, &preMemoryBarrier,
1, &preImageBarrier);
const VkBufferMemoryBarrier stagingBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, *stagingBuffer, 0ull, bufferSizeBytes);
const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier(
- 0u, 0u,
+ 0u, VK_ACCESS_TRANSFER_WRITE_BIT,
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
*image, subresourceRange);
const VkBufferMemoryBarrier inputBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, *inputBuffer, 0ull, inputBufferSizeBytes);
+ const VkImageMemoryBarrier imageLayoutBarrier = makeImageMemoryBarrier(
+ (VkAccessFlags)0, VK_ACCESS_SHADER_WRITE_BIT,
+ VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL,
+ *image, subresourceRange);
+
const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier(
VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline);
vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipelineLayout, 0u, 1u, &descriptorSet.get(), 0u, DE_NULL);
- vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 1, &imageLayoutBarrier);
vk.cmdDispatch(*cmdBuffer, m_imageSize.x(), m_imageSize.y(), 1u);
vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imagePreCopyBarrier);
addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_indexed_triangle_strip", "Draws indexed triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
- shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert";
+ shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert";
shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
addChild(new InstanceFactory<DrawInstancedIndexed>(m_testCtx, "draw_instanced_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
deUint32 m_drawIndirectMaxCount;
};
+struct FirtsInstanceSupported
+{
+ static deUint32 getFirstInstance (void) { return 2; }
+ static bool isTestSupported (const vk::VkPhysicalDeviceFeatures& features) { return features.drawIndirectFirstInstance == vk::VK_TRUE; }
+};
+
+struct FirtsInstanceNotSupported
+{
+ static deUint32 getFirstInstance (void) { return 0; }
+ static bool isTestSupported (const vk::VkPhysicalDeviceFeatures&) { return true; }
+};
+
+template<class FirstInstanceSupport>
class IndirectDrawInstanced : public IndirectDraw
{
public:
}
-IndirectDrawInstanced::IndirectDrawInstanced (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology)
+template<class FirstInstanceSupport>
+IndirectDrawInstanced<FirstInstanceSupport>::IndirectDrawInstanced (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology)
: IndirectDraw (context, shaders, topology)
{
+ if (!FirstInstanceSupport::isTestSupported(m_context.getDeviceFeatures()))
+ {
+ throw tcu::NotSupportedError("Required 'drawIndirectFirstInstance' feature is not supported");
+ }
}
-tcu::TestStatus IndirectDrawInstanced::iterate (void)
+template<class FirstInstanceSupport>
+tcu::TestStatus IndirectDrawInstanced<FirstInstanceSupport>::iterate (void)
{
tcu::TestLog &log = m_context.getTestContext().getLog();
const vk::VkQueue queue = m_context.getUniversalQueue();
vk::VkDrawIndirectCommand drawCmd[] =
{
{
- 3, //vertexCount
- 4, //instanceCount
- 2, //firstVertex
- 2 //firstInstance
+ 3, //vertexCount
+ 4, //instanceCount
+ 2, //firstVertex
+ FirstInstanceSupport::getFirstInstance() //firstInstance
},
{ (deUint32)-4, (deUint32)-2, (deUint32)-11, (deUint32)-9 }, // junk (stride)
{
- 3, //vertexCount
- 4, //instanceCount
- 5, //firstVertex
- 2 //firstInstance
+ 3, //vertexCount
+ 4, //instanceCount
+ 5, //firstVertex
+ FirstInstanceSupport::getFirstInstance() //firstInstance
}
};
m_indirectDrawCmd.push_back(drawCmd[0]);
vk::VkDrawIndirectCommand drawCmd[] =
{
{
- 4, //vertexCount
- 4, //instanceCount
- 2, //firstVertex
- 2 //firstInstance
+ 4, //vertexCount
+ 4, //instanceCount
+ 2, //firstVertex
+ FirstInstanceSupport::getFirstInstance() //firstInstance
},
{ (deUint32)-4, (deUint32)-2, (deUint32)-11, (deUint32)-9 },
{
- 4, //vertexCount
- 4, //instanceCount
- 6, //firstVertex
- 2 //firstInstance
+ 4, //vertexCount
+ 4, //instanceCount
+ 6, //firstVertex
+ FirstInstanceSupport::getFirstInstance() //firstInstance
}
};
m_indirectDrawCmd.push_back(drawCmd[0]);
{
ShaderMap shaderPaths;
shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetch.vert";
- shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
+ shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
- addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "indirect_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
- addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "indirect_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
+ tcu::TestCaseGroup* indirectDrawGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw", "Draws geometry");
+ {
+ indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
+ indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
+ }
+ addChild(indirectDrawGroup);
- shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert";
- shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
- addChild(new InstanceFactory<IndirectDrawInstanced>(m_testCtx, "indirect_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
- addChild(new InstanceFactory<IndirectDrawInstanced>(m_testCtx, "indirect_draw_instanced_triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
+ tcu::TestCaseGroup* indirectDrawInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_instanced", "Draws an instanced geometry");
+ {
+ tcu::TestCaseGroup* noFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
+ {
+ shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstanced.vert";
+
+ noFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirtsInstanceNotSupported> >(m_testCtx, "triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
+ noFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirtsInstanceNotSupported> >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
+ }
+ indirectDrawInstancedGroup->addChild(noFirstInstanceGroup);
+
+ tcu::TestCaseGroup* firstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
+ {
+ shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert";
+
+ firstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirtsInstanceSupported> >(m_testCtx, "triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
+ firstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirtsInstanceSupported> >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
+ }
+ indirectDrawInstancedGroup->addChild(firstInstanceGroup);
+ }
+ addChild(indirectDrawInstancedGroup);
}
} // DrawTests
addChild(new InstanceFactory<SimpleDraw>(m_testCtx, "simple_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
addChild(new InstanceFactory<SimpleDraw>(m_testCtx, "simple_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
- shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert";
+ shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert";
shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
addChild(new InstanceFactory<SimpleDrawInstanced>(m_testCtx, "simple_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
vk::VK_ACCESS_TRANSFER_READ_BIT,
- vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
vk::VK_QUEUE_FAMILY_IGNORED,
0u, // deUint32 writeMask;
0u // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f // float maxDepthBounds;
};
// The color blend attachment will be set up before creating the graphics pipeline.
&attachmentClearValue // const VkClearValue* pClearValues;
};
+ // Color image layout transition
+ const VkImageMemoryBarrier imageLayoutBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkAccessFlags)0, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, 1u, &imageLayoutBarrier);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
const VkDeviceSize quadOffset = (m_vertices.size() / BlendTest::QUAD_COUNT) * sizeof(Vertex4RGBA);
#include "vkQueryUtil.hpp"
#include "vkRef.hpp"
#include "vkRefUtil.hpp"
+#include "vkTypeUtil.hpp"
#include "tcuImageCompare.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
const tcu::UVec2 m_renderSize;
const VkFormat m_colorFormat;
const VkFormat m_depthFormat;
+ VkImageSubresourceRange m_depthImageSubresourceRange;
Move<VkImage> m_colorImage;
de::MovePtr<Allocation> m_colorImageAlloc;
// Allocate and bind depth image memory
m_depthImageAlloc = memAlloc.allocate(getImageMemoryRequirements(vk, vkDevice, *m_depthImage), MemoryRequirement::Any);
VK_CHECK(vk.bindImageMemory(vkDevice, *m_depthImage, m_depthImageAlloc->getMemory(), m_depthImageAlloc->getOffset()));
+
+ const VkImageAspectFlags aspect = (mapVkFormat(m_depthFormat).order == tcu::TextureFormat::DS ? VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT
+ : VK_IMAGE_ASPECT_DEPTH_BIT);
+ m_depthImageSubresourceRange = makeImageSubresourceRange(aspect, 0u, depthImageParams.mipLevels, 0u, depthImageParams.arrayLayers);
}
// Create color attachment view
VK_IMAGE_VIEW_TYPE_2D, // VkImageViewType viewType;
m_depthFormat, // VkFormat format;
componentMappingRGBA, // VkComponentMapping components;
- { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
+ m_depthImageSubresourceRange, // VkImageSubresourceRange subresourceRange;
};
m_depthAttachmentView = createImageView(vk, vkDevice, &depthAttachmentViewParams);
0u, // deUint32 writeMask;
0u, // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
attachmentClearValues // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier imageLayoutBarriers[] =
+ {
+ // color image layout transition
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkAccessFlags)0, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
+ },
+ // depth image layout transition
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkAccessFlags)0, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex;
+ *m_depthImage, // VkImage image;
+ m_depthImageSubresourceRange, // VkImageSubresourceRange subresourceRange;
+ },
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
const VkDeviceSize quadOffset = (m_vertices.size() / DepthTest::QUAD_COUNT) * sizeof(Vertex4RGBA);
0u, // deUint32 writeMask;
0u // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
&attachmentClearValue // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier preAttachmentBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, 1u, &preAttachmentBarrier);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
vk.cmdBindPipeline(*m_cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_graphicsPipeline);
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
DE_NULL, // const void* pNext;
0u, // VkAccessFlags srcAccessMask;
- 0u, // VkAccessFlags dstAccessMask;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask;
VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
0u, // deUint32 writeMask;
0u, // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
&attachmentClearValue // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier attachmentLayoutBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
const VkDeviceSize vertexBufferOffset = 0;
0u, // deUint32 writeMask;
0u, // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
clearValues // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier imageLayoutBarriers[] =
+ {
+ // color attachment image
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ },
+ // resolve attachment image
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_resolveImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ },
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
VkDeviceSize vertexBufferOffset = 0u;
0u, // deUint32 stencilWriteMask;
0u, // deUint32 stencilReference;
},
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkPipelineTessellationStateCreateInfo tessellationStateParams =
attachmentClearValues // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier attachmentLayoutBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
// update push constant
#include "vkQueryUtil.hpp"
#include "vkRef.hpp"
#include "vkRefUtil.hpp"
+#include "vkTypeUtil.hpp"
#include "tcuImageCompare.hpp"
#include "deMemory.h"
#include "deRandom.hpp"
const tcu::UVec2 m_renderSize;
const VkFormat m_colorFormat;
const VkFormat m_stencilFormat;
+ VkImageSubresourceRange m_stencilImageSubresourceRange;
VkImageCreateInfo m_colorImageCreateInfo;
Move<VkImage> m_colorImage;
// Allocate and bind stencil image memory
m_stencilImageAlloc = memAlloc.allocate(getImageMemoryRequirements(vk, vkDevice, *m_stencilImage), MemoryRequirement::Any);
VK_CHECK(vk.bindImageMemory(vkDevice, *m_stencilImage, m_stencilImageAlloc->getMemory(), m_stencilImageAlloc->getOffset()));
+
+ const VkImageAspectFlags aspect = (mapVkFormat(m_stencilFormat).order == tcu::TextureFormat::DS ? VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_DEPTH_BIT
+ : VK_IMAGE_ASPECT_STENCIL_BIT);
+ m_stencilImageSubresourceRange = makeImageSubresourceRange(aspect, 0u, stencilImageParams.mipLevels, 0u, stencilImageParams.arrayLayers);
}
// Create color attachment view
VK_IMAGE_VIEW_TYPE_2D, // VkImageViewType viewType;
m_stencilFormat, // VkFormat format;
componentMappingRGBA, // VkComponentMapping components;
- { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ m_stencilImageSubresourceRange, // VkImageSubresourceRange subresourceRange;
};
m_stencilAttachmentView = createImageView(vk, vkDevice, &stencilAttachmentViewParams);
true, // VkBool32 stencilTestEnable;
m_stencilOpStateFront, // VkStencilOpState front;
m_stencilOpStateBack, // VkStencilOpState back;
- -1.0f, // float minDepthBounds;
- +1.0f // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
attachmentClearValues // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier imageLayoutBarriers[] =
+ {
+ // color image layout transition
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkAccessFlags)0, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange;
+ },
+ // stencil image layout transition
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkAccessFlags)0, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex;
+ *m_stencilImage, // VkImage image;
+ m_stencilImageSubresourceRange, // VkImageSubresourceRange subresourceRange;
+ },
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
const VkDeviceSize quadOffset = (m_vertices.size() / StencilTest::QUAD_COUNT) * sizeof(Vertex4RGBA);
0u, // deUint32 writeMask;
0u, // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkPipelineTessellationStateCreateInfo* pTessCreateInfo = DE_NULL;
Move<VkImageView> m_depthAttachmentView;
Move<VkRenderPass> m_renderPass;
Move<VkFramebuffer> m_framebuffer;
+ VkImageMemoryBarrier m_imageLayoutBarriers[2];
de::MovePtr<Allocation> m_vertexBufferAlloc;
Move<VkBuffer> m_vertexBuffer;
&m_depthImageAlloc);
}
+ // Set up image layout transition barriers
+ {
+ const VkImageMemoryBarrier colorImageBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ };
+ const VkImageMemoryBarrier depthImageBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_depthImage, // VkImage image;
+ { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ };
+
+ m_imageLayoutBarriers[0] = colorImageBarrier;
+ m_imageLayoutBarriers[1] = depthImageBarrier;
+ }
+
// Create color attachment view
{
const VkImageViewCreateInfo colorAttachmentViewParams =
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(m_imageLayoutBarriers), m_imageLayoutBarriers);
+
vk.cmdResetQueryPool(*m_cmdBuffer, *m_queryPool, 0u, TimestampTest::ENTRY_COUNT);
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
programCollection.glslSources.add("dummy_geo") << glu::GeometrySource(
"#version 450 \n"
- "layout (triangles) in;\n"
- "layout (triangle_strip, max_vertices = 3) out;\n"
+ "layout(triangles) in;\n"
+ "layout(triangle_strip, max_vertices = 3) out;\n"
+ "layout(location = 0) in highp vec4 in_vtxColor[];\n"
+ "layout(location = 0) out highp vec4 vtxColor;\n"
"void main (void)\n"
"{\n"
" for(int ndx=0; ndx<3; ndx++)\n"
" {\n"
" gl_Position = gl_in[ndx].gl_Position;\n"
+ " vtxColor = in_vtxColor[ndx];\n"
" EmitVertex();\n"
" }\n"
" EndPrimitive();\n"
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(m_imageLayoutBarriers), m_imageLayoutBarriers);
+
vk.cmdResetQueryPool(*m_cmdBuffer, *m_queryPool, 0u, TimestampTest::ENTRY_COUNT);
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
0u, // deUint32 writeMask;
0u, // deUint32 reference;
},
- -1.0f, // float minDepthBounds;
- +1.0f, // float maxDepthBounds;
+ 0.0f, // float minDepthBounds;
+ 1.0f, // float maxDepthBounds;
};
const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
&attachmentClearValue // const VkClearValue* pClearValues;
};
+ const VkImageMemoryBarrier attachmentLayoutBarrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex;
+ *m_colorImage, // VkImage image;
+ { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange;
+ };
+
m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo);
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
+
+ vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0,
+ 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier);
+
vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
vk.cmdBindPipeline(*m_cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_graphicsPipeline);
{
}
-tcu::ConstPixelBufferAccess Image::readSurface (vk::VkQueue queue,
- vk::Allocator& allocator,
- vk::VkImageLayout layout,
- vk::VkOffset3D offset,
- int width,
- int height,
- vk::VkImageAspectFlagBits aspect,
- unsigned int mipLevel,
- unsigned int arrayElement)
-{
- m_pixelAccessData.resize(width * height * vk::mapVkFormat(m_format).getPixelSize());
- deMemset(m_pixelAccessData.data(), 0, m_pixelAccessData.size());
- if (aspect == vk::VK_IMAGE_ASPECT_COLOR_BIT)
- {
- read(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, vk::VK_IMAGE_TYPE_2D,
- m_pixelAccessData.data());
- }
- if (aspect == vk::VK_IMAGE_ASPECT_DEPTH_BIT || aspect == vk::VK_IMAGE_ASPECT_STENCIL_BIT)
- {
- readUsingBuffer(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, m_pixelAccessData.data());
- }
- return tcu::ConstPixelBufferAccess(vk::mapVkFormat(m_format), width, height, 1, m_pixelAccessData.data());
-}
-
tcu::ConstPixelBufferAccess Image::readVolume (vk::VkQueue queue,
vk::Allocator& allocator,
vk::VkImageLayout layout,
CmdBufferBeginInfo beginInfo;
VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
- transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL);
+ transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_TRANSFER_WRITE_BIT);
const vk::VkOffset3D zeroOffset = { 0, 0, 0 };
vk::VkImageCopy region = { {aspect, mipLevel, arrayElement, 1}, offset, {aspect, 0, 0, 1}, zeroOffset, {(deUint32)width, (deUint32)height, (deUint32)depth} };
}
void transition2DImage (const vk::DeviceInterface& vk,
- vk::VkCommandBuffer cmdBuffer,
+ vk::VkCommandBuffer cmdBuffer,
vk::VkImage image,
vk::VkImageAspectFlags aspectMask,
vk::VkImageLayout oldLayout,
- vk::VkImageLayout newLayout)
+ vk::VkImageLayout newLayout,
+ vk::VkAccessFlags srcAccessMask,
+ vk::VkAccessFlags dstAccessMask)
{
vk::VkImageMemoryBarrier barrier;
- barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = DE_NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = 0;
- barrier.oldLayout = oldLayout;
- barrier.newLayout = newLayout;
- barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED;
- barrier.image = image;
+ barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.pNext = DE_NULL;
+ barrier.srcAccessMask = srcAccessMask;
+ barrier.dstAccessMask = dstAccessMask;
+ barrier.oldLayout = oldLayout;
+ barrier.newLayout = newLayout;
+ barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = image;
barrier.subresourceRange.aspectMask = aspectMask;
barrier.subresourceRange.baseMipLevel = 0;
barrier.subresourceRange.levelCount = 1;
vk::Allocator& allocator,
vk::MemoryRequirement memoryRequirement = vk::MemoryRequirement::Any);
- tcu::ConstPixelBufferAccess readSurface (vk::VkQueue queue,
- vk::Allocator& allocator,
- vk::VkImageLayout layout,
- vk::VkOffset3D offset,
- int width,
- int height,
- vk::VkImageAspectFlagBits aspect,
- unsigned int mipLevel = 0,
- unsigned int arrayElement = 0);
-
tcu::ConstPixelBufferAccess readSurface1D (vk::VkQueue queue,
vk::Allocator& allocator,
vk::VkImageLayout layout,
vk::VkDevice m_device;
};
-void transition2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, vk::VkImageLayout newLayout);
+void transition2DImage (const vk::DeviceInterface& vk,
+ vk::VkCommandBuffer cmdBuffer,
+ vk::VkImage image,
+ vk::VkImageAspectFlags aspectMask,
+ vk::VkImageLayout oldLayout,
+ vk::VkImageLayout newLayout,
+ vk::VkAccessFlags srcAccessMask = 0,
+ vk::VkAccessFlags dstAccessMask = 0);
void initialTransitionColor2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
std::vector<vk::VkClearValue> renderPassClearValues(2);
deMemset(&renderPassClearValues[0], 0, static_cast<int>(renderPassClearValues.size()) * sizeof(vk::VkClearValue));
vk.cmdEndRenderPass(*cmdBuffer);
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT);
vk.endCommandBuffer(*cmdBuffer);
}
log << tcu::TestLog::EndSection;
- const vk::VkOffset3D zeroOffset = { 0, 0, 0 };
-
- tcu::ConstPixelBufferAccess resultImageAccess = m_stateObjects->m_colorAttachmentImage->readSurface(
- queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_GENERAL,
- zeroOffset, StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT);
-
- log << tcu::TestLog::Image("Result", "Result", resultImageAccess);
-
if (passed)
{
return tcu::TestStatus(QP_TEST_RESULT_PASS, "Query result verification passed");
void captureResults (deUint64* retResults, deUint64* retAvailability, bool allowNotReady);
void logResults (const deUint64* results, const deUint64* availability);
bool validateResults (const deUint64* results, const deUint64* availability, bool allowUnavailable, vk::VkPrimitiveTopology primitiveTopology);
- void logRenderTarget (void);
enum
{
log << tcu::TestLog::EndSection;
- logRenderTarget();
+ if (m_testVector.queryResultsMode != RESULTS_MODE_COPY)
+ {
+ VK_CHECK(vk.queueWaitIdle(queue));
+ }
if (passed)
{
vk.beginCommandBuffer(*cmdBuffer, &beginInfo);
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
std::vector<vk::VkClearValue> renderPassClearValues(2);
deMemset(&renderPassClearValues[0], 0, static_cast<int>(renderPassClearValues.size()) * sizeof(vk::VkClearValue));
}
}
- transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
+ transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT);
vk.endCommandBuffer(*cmdBuffer);
return passed;
}
-void OcclusionQueryTestInstance::logRenderTarget (void)
-{
- tcu::TestLog& log = m_context.getTestContext().getLog();
- const vk::VkQueue queue = m_context.getUniversalQueue();
- const vk::VkOffset3D zeroOffset = { 0, 0, 0 };
- tcu::ConstPixelBufferAccess resultImageAccess = m_stateObjects->m_colorAttachmentImage->readSurface(
- queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
- zeroOffset, StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT);
-
- log << tcu::TestLog::Image("Result", "Result", resultImageAccess);
-}
-
template<class Instance>
class QueryPoolOcclusionTest : public vkt::TestCase
{
for (int outNdx = 0; outNdx < (int)m_outputLayout.locationSymbols.size(); ++outNdx)
{
- bool isFloat = isDataTypeFloatOrVec(m_shaderSpec.outputs[outNdx].varType.getBasicType());
- bool isSigned = isDataTypeIntOrIVec(m_shaderSpec.outputs[outNdx].varType.getBasicType());
- VkFormat colorFormat = isFloat ? VK_FORMAT_R32G32B32A32_SFLOAT : (isSigned ? VK_FORMAT_R32G32B32A32_SINT : VK_FORMAT_R32G32B32A32_UINT);
+ const bool isFloat = isDataTypeFloatOrVec(m_shaderSpec.outputs[outNdx].varType.getBasicType());
+ const bool isSigned = isDataTypeIntOrIVec (m_shaderSpec.outputs[outNdx].varType.getBasicType());
+ const bool isBool = isDataTypeBoolOrBVec(m_shaderSpec.outputs[outNdx].varType.getBasicType());
+ const VkFormat colorFormat = isFloat ? VK_FORMAT_R32G32B32A32_SFLOAT : (isSigned || isBool ? VK_FORMAT_R32G32B32A32_SINT : VK_FORMAT_R32G32B32A32_UINT);
const VkImageCreateInfo colorImageParams =
{
TessellationExecutor (const ShaderSpec& shaderSpec, glu::ShaderType shaderType);
virtual ~TessellationExecutor (void);
- void renderTess (const Context& ctx, deUint32 vertexCount);
+ void renderTess (const Context& ctx, deUint32 numValues, deUint32 vertexCount, deUint32 patchControlPoints);
};
TessellationExecutor::TessellationExecutor (const ShaderSpec& shaderSpec, glu::ShaderType shaderType)
{
}
-void TessellationExecutor::renderTess (const Context& ctx, deUint32 vertexCount)
+void TessellationExecutor::renderTess (const Context& ctx, deUint32 numValues, deUint32 vertexCount, deUint32 patchControlPoints)
{
- const size_t inputBufferSize = (vertexCount/2) * getInputStride();
+ const size_t inputBufferSize = numValues * getInputStride();
const VkDevice vkDevice = ctx.getDevice();
const DeviceInterface& vk = ctx.getDeviceInterface();
const VkQueue queue = ctx.getUniversalQueue();
VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout initialLayout;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL // VkImageLayout finalLayout
};
0u, // VkDeviceSize offset;
VK_WHOLE_SIZE // VkDeviceSize range;
};
- if (inputBufferSize)
+
+ if (inputBufferSize > 0)
{
inputDescriptorBufferInfo.buffer = *m_inputBuffer;
VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, // VkStructureType sType;
DE_NULL, // const void* pNext;
(VkPipelineTessellationStateCreateFlags)0, // VkPipelineTessellationStateCreateFlags flags;
- 1 // uint32_t patchControlPoints;
+ patchControlPoints // uint32_t patchControlPoints;
};
const VkViewport viewport =
void TessControlExecutor::execute (const Context& ctx, int numValues, const void* const* inputs, void* const* outputs)
{
+ const deUint32 patchSize = 3;
+
checkSupported(ctx, m_shaderType);
initBuffers(ctx, numValues);
// Setup input buffer & copy data
uploadInputBuffer(ctx, inputs, numValues);
- renderTess(ctx, 3 * numValues);
+ renderTess(ctx, numValues, patchSize * numValues, patchSize);
// Read back data
readOutputBuffer(ctx, outputs, numValues);
src << "void main (void)\n{\n"
<< "\tgl_Position = vec4(gl_TessCoord.x, 0.0, 0.0, 1.0);\n"
- << "\thighp uint invocationId = uint(gl_PrimitiveID) + (gl_TessCoord.x > 0.5 ? 1u : 0u);\n";
+ << "\thighp uint invocationId = uint(gl_PrimitiveID)*2u + (gl_TessCoord.x > 0.5 ? 1u : 0u);\n";
generateExecBufferIo(src, shaderSpec, "invocationId");
{
checkSupported(ctx, m_shaderType);
- const int alignedValues = deAlign32(numValues, 2);
+ const int patchSize = 2;
+ const int alignedValues = deAlign32(numValues, patchSize);
// Initialize buffers with aligned value count to make room for padding
initBuffers(ctx, alignedValues);
// Setup input buffer & copy data
uploadInputBuffer(ctx, inputs, numValues);
- renderTess(ctx, 2 * numValues);
+ renderTess(ctx, (deUint32)alignedValues, (deUint32)alignedValues, (deUint32)patchSize);
// Read back data
readOutputBuffer(ctx, outputs, numValues);
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
DE_NULL, // const void* pNext;
0u, // VkAccessFlags srcAccessMask;
- 0u, // VkAccessFlags dstAccessMask;
+ VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask;
VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout;
VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout initialLayout;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout finalLayout;
};
}
const SamplerUniform* sampler = static_cast<const SamplerUniform*>(uniformInfo);
-
- const VkAccessFlags outputMask = VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT;
- const VkImageMemoryBarrier textureBarrier = createImageMemoryBarrier(sampler->image->get(), outputMask, 0u, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ const VkImageMemoryBarrier textureBarrier = createImageMemoryBarrier(sampler->image->get(), 0u, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
barriers.push_back(textureBarrier);
}
{
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
DE_NULL, // const void* pNext;
- VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask;
VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask;
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout oldLayout;
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout;
m_uniformBuffers.push_back(VkBufferSp(new vk::Unique<vk::VkBuffer>(buffer)));
m_uniformAllocs.push_back(AllocationSp(alloc.release()));
}
-
- setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(1),
- vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocks, &descriptors[0]);
}
else
{
descriptors[blockNdx] = makeDescriptorBufferInfo(*buffer, offset, bufferSize);
}
- setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(1),
- vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocks, &descriptors[0]);
-
m_uniformBuffers.push_back(VkBufferSp(new vk::Unique<vk::VkBuffer>(buffer)));
m_uniformAllocs.push_back(AllocationSp(alloc.release()));
}
+ // Update remaining bindings
+ {
+ int blockNdx = 0;
+ for (int bindingNdx = 0; bindingNdx < numBindings; ++bindingNdx)
+ {
+ const BufferBlock& block = m_interface.getBlock(bindingNdx);
+ const int numBlocksInBinding = (block.isArray() ? block.getArraySize() : 1);
+
+ setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(bindingNdx + 1),
+ vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocksInBinding, &descriptors[blockNdx]);
+
+ blockNdx += numBlocksInBinding;
+ }
+ }
+
// Copy the initial data to the storage buffers
{
mappedBlockPtrs = blockLocationsToPtrs(m_refLayout, blockLocations, mapPtrs);
&clearValue, // const VkClearValue* pClearValues;
};
+ // Add barrier for initializing image state
+ {
+ const vk::VkImageMemoryBarrier initializeBarrier =
+ {
+ vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext
+ 0, // VVkAccessFlags srcAccessMask;
+ vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask;
+ vk::VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout;
+ vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout;
+ queueFamilyIndex, // deUint32 srcQueueFamilyIndex;
+ queueFamilyIndex, // deUint32 dstQueueFamilyIndex;
+ *colorImage, // VkImage image;
+ {
+ vk::VK_IMAGE_ASPECT_COLOR_BIT, // VkImageAspectFlags aspectMask;
+ 0u, // deUint32 baseMipLevel;
+ 1u, // deUint32 mipLevels;
+ 0u, // deUint32 baseArraySlice;
+ 1u, // deUint32 arraySize;
+ } // VkImageSubresourceRange subresourceRange
+ };
+
+ vk.cmdPipelineBarrier(*cmdBuffer, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, (vk::VkDependencyFlags)0,
+ 0, (const vk::VkMemoryBarrier*)DE_NULL,
+ 0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
+ 1, &initializeBarrier);
+ }
+
vk.cmdBeginRenderPass(*cmdBuffer, &passBeginInfo, vk::VK_SUBPASS_CONTENTS_INLINE);
vk.cmdBindPipeline(*cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
| VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
}
+VkAccessFlags getMemoryFlagsForLayout (const VkImageLayout layout)
+{
+ switch (layout)
+ {
+ case VK_IMAGE_LAYOUT_GENERAL: return getAllMemoryReadFlags() | getAllMemoryWriteFlags();
+ case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: return VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT;
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: return VK_ACCESS_SHADER_READ_BIT;
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: return VK_ACCESS_TRANSFER_READ_BIT;
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: return VK_ACCESS_TRANSFER_WRITE_BIT;
+
+ default:
+ return (VkAccessFlags)0;
+ }
+}
+
VkPipelineStageFlags getAllPipelineStageFlags (void)
{
return VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
STENCIL_VALUE // stencilReference
}, // back
- -1.0f, // minDepthBounds;
+ 0.0f, // minDepthBounds;
1.0f // maxDepthBounds;
};
const VkPipelineColorBlendStateCreateInfo blendState =
const VkImageMemoryBarrier barrier =
{
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType;
- DE_NULL, // pNext;
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType;
+ DE_NULL, // pNext;
- getAllMemoryWriteFlags(), // srcAccessMask
- getAllMemoryReadFlags(), // dstAccessMask
+ (VkAccessFlags)0, // srcAccessMask
+ getAllMemoryReadFlags() | VK_ACCESS_TRANSFER_WRITE_BIT, // dstAccessMask
- VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout
- VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout;
+ VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout;
- queueIndex, // srcQueueFamilyIndex;
- queueIndex, // destQueueFamilyIndex;
+ queueIndex, // srcQueueFamilyIndex;
+ queueIndex, // destQueueFamilyIndex;
- attachmentResources[attachmentNdx]->getImage(), // image;
- { // subresourceRange;
- getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
- 0, // baseMipLevel;
- 1, // mipLevels;
- 0, // baseArraySlice;
- 1 // arraySize;
+ attachmentResources[attachmentNdx]->getImage(), // image;
+ { // subresourceRange;
+ getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
+ 0, // baseMipLevel;
+ 1, // mipLevels;
+ 0, // baseArraySlice;
+ 1 // arraySize;
}
};
for (size_t attachmentNdx = 0; attachmentNdx < attachmentInfo.size(); attachmentNdx++)
{
- const VkImageMemoryBarrier barrier =
+ const VkImageLayout oldLayout = clearValues[attachmentNdx] ? VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+ const VkImageMemoryBarrier barrier =
{
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType;
- DE_NULL, // pNext;
-
- getAllMemoryWriteFlags(), // srcAccessMask
- getAllMemoryReadFlags(), // dstAccessMask
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType;
+ DE_NULL, // pNext;
- clearValues[attachmentNdx] ?
- VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
- : VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout
+ (oldLayout != VK_IMAGE_LAYOUT_UNDEFINED ? getAllMemoryWriteFlags() : (VkAccessFlags)0), // srcAccessMask
+ getAllMemoryReadFlags() | getMemoryFlagsForLayout(attachmentInfo[attachmentNdx].getInitialLayout()), // dstAccessMask
- attachmentInfo[attachmentNdx].getInitialLayout(), // newLayout;
+ oldLayout, // oldLayout
+ attachmentInfo[attachmentNdx].getInitialLayout(), // newLayout;
- queueIndex, // srcQueueFamilyIndex;
- queueIndex, // destQueueFamilyIndex;
+ queueIndex, // srcQueueFamilyIndex;
+ queueIndex, // destQueueFamilyIndex;
- attachmentResources[attachmentNdx]->getImage(), // image;
- { // subresourceRange;
- getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
- 0, // baseMipLevel;
- 1, // mipLevels;
- 0, // baseArraySlice;
- 1 // arraySize;
+ attachmentResources[attachmentNdx]->getImage(), // image;
+ { // subresourceRange;
+ getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
+ 0, // baseMipLevel;
+ 1, // mipLevels;
+ 0, // baseArraySlice;
+ 1 // arraySize;
}
};
if (isLazy[attachmentNdx])
continue;
- const VkImageMemoryBarrier barrier =
+ const VkImageLayout oldLayout = attachmentInfo[attachmentNdx].getFinalLayout();
+ const VkImageMemoryBarrier barrier =
{
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType
- DE_NULL, // pNext
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType
+ DE_NULL, // pNext
- getAllMemoryWriteFlags(), // srcAccessMask
- getAllMemoryReadFlags(), // dstAccessMask
+ getAllMemoryWriteFlags() | getMemoryFlagsForLayout(oldLayout), // srcAccessMask
+ getAllMemoryReadFlags(), // dstAccessMask
- attachmentInfo[attachmentNdx].getFinalLayout(), // oldLayout
- VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // newLayout
+ oldLayout, // oldLayout
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // newLayout
- queueIndex, // srcQueueFamilyIndex
- queueIndex, // destQueueFamilyIndex
+ queueIndex, // srcQueueFamilyIndex
+ queueIndex, // destQueueFamilyIndex
- attachmentResources[attachmentNdx]->getImage(), // image
- { // subresourceRange
- getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
- 0, // baseMipLevel
- 1, // mipLevels
- 0, // baseArraySlice
- 1 // arraySize
+ attachmentResources[attachmentNdx]->getImage(), // image
+ { // subresourceRange
+ getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect;
+ 0, // baseMipLevel
+ 1, // mipLevels
+ 0, // baseArraySlice
+ 1 // arraySize
}
};
bufferBarriers.push_back(secondaryBufferBarrier);
}
-
- bufferBarriers.push_back(bufferBarrier);
}
if (!bufferBarriers.empty())
DataType getTransportType (DataType valueType)
{
if (isDataTypeBoolOrBVec(valueType))
- return glu::getDataTypeIntVec(getDataTypeScalarSize(valueType));
+ return glu::getDataTypeUintVec(getDataTypeScalarSize(valueType));
else
return valueType;
}
vk::VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, // sType
DE_NULL, // pNext
(vk::VkPipelineVertexInputStateCreateFlags)0,
- DE_LENGTH_OF_ARRAY(vertexBindings), // bindingCount
+ (inputValues.empty() ? 1u : 2u), // bindingCount
vertexBindings, // pVertexBindingDescriptions
(deUint32)vertexAttribParams.size(), // attributeCount
&vertexAttribParams[0], // pVertexAttributeDescriptions
vkd.cmdBeginRenderPass(*m_cmdBuffer, &passBeginInfo, vk::VK_SUBPASS_CONTENTS_INLINE);
}
- vkd.cmdBindPipeline (*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
- vkd.cmdBindDescriptorSets (*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelineLayout, 0u, 1u, &*m_descriptorSet, 0u, DE_NULL);
+ vkd.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
+
+ if (!m_spec.values.uniforms.empty() || !m_spec.values.outputs.empty())
+ vkd.cmdBindDescriptorSets(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelineLayout, 0u, 1u, &*m_descriptorSet, 0u, DE_NULL);
{
const vk::VkBuffer buffers[] = { *m_posNdxBuffer, *m_inputBuffer };
"currentExtent dimensions must be larger than 0");
results.check(de::inRange(capabilities.currentExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width) &&
- de::inRange(capabilities.currentExtent.height, capabilities.minImageExtent.width, capabilities.maxImageExtent.width),
+ de::inRange(capabilities.currentExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height),
"currentExtent is not in supported extent limits");
}
{
const PlatformProperties& platformProperties = getPlatformProperties(wsiType);
vector<VkSwapchainCreateInfoKHR> cases;
+ const VkSurfaceTransformFlagBitsKHR defaultTransform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform;
const VkSwapchainCreateInfoKHR baseParameters =
{
VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
VK_SHARING_MODE_EXCLUSIVE,
0u,
(const deUint32*)DE_NULL,
- VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
+ defaultTransform,
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
VK_PRESENT_MODE_FIFO_KHR,
VK_FALSE, // clipped
{
case TEST_DIMENSION_MIN_IMAGE_COUNT:
{
- const deUint32 maxImageCountToTest = de::clamp(16u, capabilities.minImageCount, capabilities.maxImageCount);
+ const deUint32 maxImageCountToTest = de::clamp(16u, capabilities.minImageCount, (capabilities.maxImageCount > 0) ? capabilities.maxImageCount : capabilities.minImageCount + 16u);
for (deUint32 imageCount = capabilities.minImageCount; imageCount <= maxImageCountToTest; ++imageCount)
{
physicalDevice,
surface);
const PlatformProperties& platformProperties = getPlatformProperties(wsiType);
+ const VkSurfaceTransformFlagBitsKHR transform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform;
const VkSwapchainCreateInfoKHR parameters =
{
VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
DE_NULL,
(VkSwapchainCreateFlagsKHR)0,
surface,
- de::clamp(desiredImageCount, capabilities.minImageCount, capabilities.maxImageCount),
+ de::clamp(desiredImageCount, capabilities.minImageCount, capabilities.maxImageCount > 0 ? capabilities.maxImageCount : capabilities.minImageCount + desiredImageCount),
formats[0].format,
formats[0].colorSpace,
(platformProperties.swapchainExtent == PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE
VK_SHARING_MODE_EXCLUSIVE,
0u,
(const deUint32*)DE_NULL,
- VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
+ transform,
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
VK_PRESENT_MODE_FIFO_KHR,
VK_FALSE, // clipped
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
DE_NULL,
(VkPipelineRasterizationStateCreateFlags)0,
- VK_TRUE, // depthClampEnable
+ VK_FALSE, // depthClampEnable
VK_FALSE, // rasterizerDiscardEnable
VK_POLYGON_MODE_FILL, // polygonMode
VK_CULL_MODE_NONE, // cullMode
deUint32 imageNdx,
deUint32 frameNdx) const
{
- const VkImage curImage = m_swapchainImages[imageNdx];
const VkFramebuffer curFramebuffer = **m_framebuffers[imageNdx];
{
}
{
- const VkImageMemoryBarrier fromPresentationBarrier =
- {
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
- DE_NULL,
- VK_ACCESS_MEMORY_READ_BIT,
- (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT|
- VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT),
- VK_IMAGE_LAYOUT_UNDEFINED,
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- VK_QUEUE_FAMILY_IGNORED,
- VK_QUEUE_FAMILY_IGNORED,
- curImage,
- {
- VK_IMAGE_ASPECT_COLOR_BIT,
- 0u, // baseMipLevel
- 1u, // levelCount
- 0u, // baseArrayLayer
- 1u, // layerCount
- }
- };
- m_vkd.cmdPipelineBarrier(cmdBuffer,
- VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
- VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
- (VkDependencyFlags)0,
- 0, (const VkMemoryBarrier*)DE_NULL,
- 0, (const VkBufferMemoryBarrier*)DE_NULL,
- 1, &fromPresentationBarrier);
- }
-
- {
const VkClearValue clearValue = makeClearValueColorF32(0.125f, 0.25f, 0.75f, 1.0f);
const VkRenderPassBeginInfo passBeginParams =
{
m_vkd.cmdDraw(cmdBuffer, 3u, 1u, 0u, 0u);
m_vkd.cmdEndRenderPass(cmdBuffer);
- {
- const VkImageMemoryBarrier toPresentationBarrier =
- {
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
- DE_NULL,
- (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT|
- VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT),
- VK_ACCESS_MEMORY_READ_BIT,
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
- VK_QUEUE_FAMILY_IGNORED,
- VK_QUEUE_FAMILY_IGNORED,
- curImage,
- {
- VK_IMAGE_ASPECT_COLOR_BIT,
- 0u, // baseMipLevel
- 1u, // levelCount
- 0u, // baseArrayLayer
- 1u, // layerCount
- }
- };
- m_vkd.cmdPipelineBarrier(cmdBuffer,
- VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
- VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
- (VkDependencyFlags)0,
- 0, (const VkMemoryBarrier*)DE_NULL,
- 0, (const VkBufferMemoryBarrier*)DE_NULL,
- 1, &toPresentationBarrier);
- }
-
VK_CHECK(m_vkd.endCommandBuffer(cmdBuffer));
}
dEQP-VK.glsl.functions.misc.argument_eval_order_1_fragment
dEQP-VK.glsl.functions.misc.argument_eval_order_2_vertex
dEQP-VK.glsl.functions.misc.argument_eval_order_2_fragment
-dEQP-VK.glsl.linkage.varying.rules.fragment_declare
dEQP-VK.glsl.linkage.varying.rules.vertex_declare
dEQP-VK.glsl.linkage.varying.rules.both_declare
dEQP-VK.glsl.linkage.varying.rules.vertex_declare_fragment_use
dEQP-VK.draw.indexed_draw.draw_indexed_triangle_strip
dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_list
dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_strip
-dEQP-VK.draw.indirect_draw.indirect_draw_triangle_list
-dEQP-VK.draw.indirect_draw.indirect_draw_triangle_strip
-dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_list
-dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw.triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_strip
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_list
+dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_strip
dEQP-VK.compute.basic.empty_shader
dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation
dEQP-VK.compute.basic.ubo_to_ssbo_single_group
return DE_TRUE;
}
-
int deVsprintf (char* string, size_t size, const char* format, va_list list)
{
int res;
#endif
}
+size_t deStrnlen (const char* string, size_t maxSize)
+{
+#if ((DE_COMPILER == DE_COMPILER_MSC) && (DE_OS != DE_OS_WINCE)) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201100L))
+ return strnlen_s(string, maxSize);
+#else
+ size_t len = 0;
+ while (len < maxSize || string[len] != 0)
+ ++len;
+ return len;
+#endif
+}
+
DE_END_EXTERN_C
deInt32 deSprintf (char* string, size_t size, const char* format, ...) DE_PRINTF_FUNC_ATTR(3, 4);
char* deStrcpy (char* dst, size_t size, const char* src);
char* deStrcat (char* s1, size_t size, const char* s2);
+size_t deStrnlen (const char* string, size_t maxSize);
DE_END_EXTERN_C