VK_KHR_maintenance1: Add tests render to 3d slices
authorArkadiusz Sarwa <arkadiusz.sarwa@mobica.com>
Mon, 28 Nov 2016 13:11:41 +0000 (14:11 +0100)
committerPyry Haulos <phaulos@google.com>
Thu, 15 Dec 2016 14:36:02 +0000 (10:36 -0400)
New tests:
- dEQP-VK.pipeline.render_to_image.3d.*
- dEQP-VK.geometry.layered.3d.*

Khronos issue: #532

Change-Id: Iefac60096c4ced04558cea0fe79344685359f415

android/cts/master/vk-master.txt
external/vulkancts/framework/vulkan/vkBasicTypes.inl
external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp
external/vulkancts/mustpass/1.0.2/vk-default.txt
external/vulkancts/scripts/src/vulkan.h.in

index cd3f18d..b2a714b 100644 (file)
@@ -91044,6 +91044,10 @@ dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r32_uint
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r16g16_sint
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r32g32b32a32_sfloat
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r8g8b8a8_unorm
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r32_uint
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r16g16_sint
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r32g32b32a32_sfloat
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r32_uint
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r16g16_sint
@@ -139784,6 +139788,13 @@ dEQP-VK.geometry.layered.cube_array.render_different_content
 dEQP-VK.geometry.layered.cube_array.fragment_layer
 dEQP-VK.geometry.layered.cube_array.invocation_per_layer
 dEQP-VK.geometry.layered.cube_array.multiple_layers_per_invocation
+dEQP-VK.geometry.layered.3d.render_to_default_layer
+dEQP-VK.geometry.layered.3d.render_to_one
+dEQP-VK.geometry.layered.3d.render_to_all
+dEQP-VK.geometry.layered.3d.render_different_content
+dEQP-VK.geometry.layered.3d.fragment_layer
+dEQP-VK.geometry.layered.3d.invocation_per_layer
+dEQP-VK.geometry.layered.3d.multiple_layers_per_invocation
 dEQP-VK.geometry.instanced.draw_1_instances_1_geometry_invocations
 dEQP-VK.geometry.instanced.draw_1_instances_2_geometry_invocations
 dEQP-VK.geometry.instanced.draw_1_instances_8_geometry_invocations
index 3d07987..a1e8b44 100644 (file)
@@ -861,11 +861,12 @@ typedef deUint32 VkImageUsageFlags;
 
 enum VkImageCreateFlagBits
 {
-       VK_IMAGE_CREATE_SPARSE_BINDING_BIT              = 0x00000001,
-       VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT    = 0x00000002,
-       VK_IMAGE_CREATE_SPARSE_ALIASED_BIT              = 0x00000004,
-       VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT              = 0x00000008,
-       VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT             = 0x00000010,
+       VK_IMAGE_CREATE_SPARSE_BINDING_BIT                      = 0x00000001,
+       VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT            = 0x00000002,
+       VK_IMAGE_CREATE_SPARSE_ALIASED_BIT                      = 0x00000004,
+       VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT                      = 0x00000008,
+       VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT                     = 0x00000010,
+       VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR     = 0x00000020,
 };
 typedef deUint32 VkImageCreateFlags;
 
index 9128d3c..13a2c43 100644 (file)
@@ -970,11 +970,12 @@ tcu::Format::Bitfield<32> getImageCreateFlagsStr (VkImageCreateFlags value)
 {
        static const tcu::Format::BitDesc s_desc[] =
        {
-               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_BINDING_BIT,        "VK_IMAGE_CREATE_SPARSE_BINDING_BIT"),
-               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT,      "VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"),
-               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_ALIASED_BIT,        "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"),
-               tcu::Format::BitDesc(VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT,        "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"),
-               tcu::Format::BitDesc(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,       "VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_BINDING_BIT,                        "VK_IMAGE_CREATE_SPARSE_BINDING_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT,                      "VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_SPARSE_ALIASED_BIT,                        "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT,                        "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,                       "VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"),
+               tcu::Format::BitDesc(VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR,       "VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR"),
        };
        return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
 }
index d5e10e9..182f9c0 100644 (file)
@@ -653,16 +653,18 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
 
        // Geometry shader
        {
-               const int maxVertices = (params.testType == TEST_TYPE_DIFFERENT_CONTENT)                                                                        ? (params.image.numLayers + 1) * params.image.numLayers :
-                                                               (params.testType == TEST_TYPE_ALL_LAYERS || params.testType == TEST_TYPE_LAYER_ID)      ? params.image.numLayers * 4 :
-                                                               (params.testType == TEST_TYPE_MULTIPLE_LAYERS_PER_INVOCATION)                                           ? 6 : 4;
+               const int numLayers             = static_cast<int>(params.image.viewType == VK_IMAGE_VIEW_TYPE_3D ? params.image.size.depth : params.image.numLayers);
+
+               const int maxVertices   = (params.testType == TEST_TYPE_DIFFERENT_CONTENT)                                                                              ? (numLayers + 1) * numLayers :
+                                                                 (params.testType == TEST_TYPE_ALL_LAYERS || params.testType == TEST_TYPE_LAYER_ID)    ? numLayers * 4 :
+                                                                 (params.testType == TEST_TYPE_MULTIPLE_LAYERS_PER_INVOCATION)                                                 ? 6 : 4;
 
                std::ostringstream src;
                src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
                        << "\n";
 
                if (params.testType == TEST_TYPE_INVOCATION_PER_LAYER || params.testType == TEST_TYPE_MULTIPLE_LAYERS_PER_INVOCATION)
-                       src << "layout(points, invocations = " << params.image.numLayers << ") in;\n";
+                       src << "layout(points, invocations = " << numLayers << ") in;\n";
                else
                        src << "layout(points) in;\n";
 
@@ -728,7 +730,7 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
                {
                        src << colorTable.str()
                                << "\n"
-                               << "    for (int layerNdx = 0; layerNdx < " << params.image.numLayers << "; ++layerNdx) {\n"
+                               << "    for (int layerNdx = 0; layerNdx < " << numLayers << "; ++layerNdx) {\n"
                                << "        const int colorNdx = layerNdx % " << DE_LENGTH_OF_ARRAY(s_colors) << ";\n"
                                << "\n"
                                << "        gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);\n"
@@ -755,7 +757,7 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
                }
                else if (params.testType == TEST_TYPE_LAYER_ID)
                {
-                       src << "    for (int layerNdx = 0; layerNdx < " << params.image.numLayers << "; ++layerNdx) {\n"
+                       src << "    for (int layerNdx = 0; layerNdx < " << numLayers << "; ++layerNdx) {\n"
                                << "        gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);\n"
                                << "        gl_Layer    = layerNdx;\n"
                                << "        EmitVertex();\n"
@@ -776,9 +778,9 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
                }
                else if (params.testType == TEST_TYPE_DIFFERENT_CONTENT)
                {
-                       src << "    for (int layerNdx = 0; layerNdx < " << params.image.numLayers << "; ++layerNdx) {\n"
+                       src << "    for (int layerNdx = 0; layerNdx < " << numLayers << "; ++layerNdx) {\n"
                                << "        for (int colNdx = 0; colNdx <= layerNdx; ++colNdx) {\n"
-                               << "            const float posX = float(colNdx) / float(" << params.image.numLayers << ") * 2.0 - 1.0;\n"
+                               << "            const float posX = float(colNdx) / float(" << numLayers << ") * 2.0 - 1.0;\n"
                                << "\n"
                                << "            gl_Position = vec4(posX,  1.0, 0.0, 1.0);\n"
                                << "            gl_Layer    = layerNdx;\n"
@@ -820,9 +822,9 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
                else if (params.testType == TEST_TYPE_MULTIPLE_LAYERS_PER_INVOCATION)
                {
                        src << "    const int   layerA = gl_InvocationID;\n"
-                               << "    const int   layerB = (gl_InvocationID + 1) % " << params.image.numLayers << ";\n"
-                               << "    const float aEnd   = float(layerA) / float(" << params.image.numLayers << ") * 2.0 - 1.0;\n"
-                               << "    const float bEnd   = float(layerB) / float(" << params.image.numLayers << ") * 2.0 - 1.0;\n"
+                               << "    const int   layerB = (gl_InvocationID + 1) % " << numLayers << ";\n"
+                               << "    const float aEnd   = float(layerA) / float(" << numLayers << ") * 2.0 - 1.0;\n"
+                               << "    const float bEnd   = float(layerB) / float(" << numLayers << ") * 2.0 - 1.0;\n"
                                << "\n"
                                << "    gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);\n"
                                << "    gl_Layer    = layerA;\n"
@@ -890,40 +892,47 @@ void initPrograms (SourceCollections& programCollection, const TestParams params
 
 tcu::TestStatus test (Context& context, const TestParams params)
 {
-       const DeviceInterface&                  vk                                      = context.getDeviceInterface();
-       const InstanceInterface&                vki                                     = context.getInstanceInterface();
-       const VkDevice                                  device                          = context.getDevice();
-       const VkPhysicalDevice                  physDevice                      = context.getPhysicalDevice();
-       const deUint32                                  queueFamilyIndex        = context.getUniversalQueueFamilyIndex();
-       const VkQueue                                   queue                           = context.getUniversalQueue();
-       Allocator&                                              allocator                       = context.getDefaultAllocator();
+       if (VK_IMAGE_VIEW_TYPE_3D == params.image.viewType &&
+               (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1")))
+               TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
+
+       const DeviceInterface&                  vk                                              = context.getDeviceInterface();
+       const InstanceInterface&                vki                                             = context.getInstanceInterface();
+       const VkDevice                                  device                                  = context.getDevice();
+       const VkPhysicalDevice                  physDevice                              = context.getPhysicalDevice();
+       const deUint32                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
+       const VkQueue                                   queue                                   = context.getUniversalQueue();
+       Allocator&                                              allocator                               = context.getDefaultAllocator();
 
        checkGeometryShaderSupport(vki, physDevice);
 
        const VkFormat                                  colorFormat                             = VK_FORMAT_R8G8B8A8_UNORM;
-       const VkImageSubresourceRange   colorSubresourceRange   = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, params.image.numLayers);
+       const deUint32                                  numLayers                               = (VK_IMAGE_VIEW_TYPE_3D == params.image.viewType ? params.image.size.depth : params.image.numLayers);
        const Vec4                                              clearColor                              = Vec4(0.0f, 0.0f, 0.0f, 1.0f);
        const VkDeviceSize                              colorBufferSize                 = params.image.size.width * params.image.size.height * params.image.size.depth * params.image.numLayers * tcu::getPixelSize(mapVkFormat(colorFormat));
-       const VkImageCreateFlags                imageCreateFlags                = (isCubeImageViewType(params.image.viewType) ? VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT : (VkImageCreateFlagBits)0);
-
-       const Unique<VkImage>                   colorImage                      (makeImage                              (vk, device, makeImageCreateInfo(imageCreateFlags, getImageType(params.image.viewType), colorFormat, params.image.size,
-                                                                                                                                                                params.image.numLayers, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)));
-       const UniquePtr<Allocation>             colorImageAlloc         (bindImage                              (vk, device, allocator, *colorImage, MemoryRequirement::Any));
-       const Unique<VkImageView>               colorAttachment         (makeImageView                  (vk, device, *colorImage, params.image.viewType, colorFormat, colorSubresourceRange));
-       const Unique<VkBuffer>                  colorBuffer                     (makeBuffer                             (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
-       const UniquePtr<Allocation>             colorBufferAlloc        (bindBuffer                             (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
-
-       const Unique<VkShaderModule>    vertexModule            (createShaderModule             (vk, device, context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkShaderModule>    geometryModule          (createShaderModule             (vk, device, context.getBinaryCollection().get("geom"), 0u));
-       const Unique<VkShaderModule>    fragmentModule          (createShaderModule             (vk, device, context.getBinaryCollection().get("frag"), 0u));
-
-       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                 (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer                (vk, device, *renderPass, *colorAttachment, params.image.size.width,  params.image.size.height, params.image.numLayers));
-       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                pipeline                        (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule,
-                                                                                                                                                                makeExtent2D(params.image.size.width, params.image.size.height)));
-       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool                (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer                       (makeCommandBuffer              (vk, device, *cmdPool));
+       const VkImageCreateFlags                imageCreateFlags                = (isCubeImageViewType(params.image.viewType) ? VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT : (VkImageCreateFlagBits)0) |
+                                                                                                                         (VK_IMAGE_VIEW_TYPE_3D == params.image.viewType ? VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR : (VkImageCreateFlagBits)0);
+       const VkImageViewType                   viewType                                = (VK_IMAGE_VIEW_TYPE_3D == params.image.viewType ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : params.image.viewType);
+
+       const Unique<VkImage>                   colorImage                              (makeImage                              (vk, device, makeImageCreateInfo(imageCreateFlags, getImageType(params.image.viewType), colorFormat, params.image.size,
+                                                                                                                                                                        params.image.numLayers, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)));
+       const UniquePtr<Allocation>             colorImageAlloc                 (bindImage                              (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+       const Unique<VkImageView>               colorAttachment                 (makeImageView                  (vk, device, *colorImage, viewType, colorFormat, makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, numLayers)));
+
+       const Unique<VkBuffer>                  colorBuffer                             (makeBuffer                             (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+       const UniquePtr<Allocation>             colorBufferAlloc                (bindBuffer                             (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
+
+       const Unique<VkShaderModule>    vertexModule                    (createShaderModule             (vk, device, context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkShaderModule>    geometryModule                  (createShaderModule             (vk, device, context.getBinaryCollection().get("geom"), 0u));
+       const Unique<VkShaderModule>    fragmentModule                  (createShaderModule             (vk, device, context.getBinaryCollection().get("frag"), 0u));
+
+       const Unique<VkRenderPass>              renderPass                              (makeRenderPass                 (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, *colorAttachment, params.image.size.width,  params.image.size.height, numLayers));
+       const Unique<VkPipelineLayout>  pipelineLayout                  (makePipelineLayout             (vk, device));
+       const Unique<VkPipeline>                pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule,
+                                                                                                                                                                        makeExtent2D(params.image.size.width, params.image.size.height)));
+       const Unique<VkCommandPool>             cmdPool                                 (makeCommandPool                (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                               (makeCommandBuffer              (vk, device, *cmdPool));
 
        zeroBuffer(vk, device, *colorBufferAlloc, colorBufferSize);
 
@@ -953,7 +962,8 @@ tcu::TestStatus test (Context& context, const TestParams params)
 
        // Prepare color image for copy
        {
-               const VkImageMemoryBarrier barriers[] =
+               const VkImageSubresourceRange   colorSubresourceRange   = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, params.image.numLayers);
+               const VkImageMemoryBarrier              barriers[] =
                {
                        {
                                VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,                 // VkStructureType                      sType;
@@ -1042,11 +1052,11 @@ tcu::TestCaseGroup* createLayeredRenderingTests (tcu::TestContext& testCtx)
 
        const ImageParams imageParams[] =
        {
-               { VK_IMAGE_VIEW_TYPE_1D_ARRAY,          { 64,  1,  1 },         4       },
-               { VK_IMAGE_VIEW_TYPE_2D_ARRAY,          { 64, 64,  1 },         4       },
-               { VK_IMAGE_VIEW_TYPE_CUBE,                      { 64, 64,  1 },         6       },
-               { VK_IMAGE_VIEW_TYPE_CUBE_ARRAY,        { 64, 64,  1 },         2*6     },
-               // No support for rendering to 3d image slices in Vulkan 1.0
+               { VK_IMAGE_VIEW_TYPE_1D_ARRAY,          { 64,  1, 1 },  4       },
+               { VK_IMAGE_VIEW_TYPE_2D_ARRAY,          { 64, 64, 1 },  4       },
+               { VK_IMAGE_VIEW_TYPE_CUBE,                      { 64, 64, 1 },  6       },
+               { VK_IMAGE_VIEW_TYPE_CUBE_ARRAY,        { 64, 64, 1 },  2*6     },
+               { VK_IMAGE_VIEW_TYPE_3D,                        { 64, 64, 8 },  1       }
        };
 
        for (int imageParamNdx = 0; imageParamNdx < DE_LENGTH_OF_ARRAY(imageParams); ++imageParamNdx)
index 3ec6ecc..5f389eb 100644 (file)
@@ -548,6 +548,10 @@ tcu::PixelBufferAccess getExpectedData (tcu::TextureLevel& textureLevel, const C
 
 tcu::TestStatus test (Context& context, const CaseDef caseDef)
 {
+       if (VK_IMAGE_VIEW_TYPE_3D == caseDef.imageType &&
+               (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1")))
+               TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
+
        const DeviceInterface&                  vk                                      = context.getDeviceInterface();
        const VkDevice                                  device                          = context.getDevice();
        const VkQueue                                   queue                           = context.getUniversalQueue();
@@ -563,13 +567,14 @@ tcu::TestStatus test (Context& context, const CaseDef caseDef)
                Vec4(0.1f, 0.0f, 1.0f, 1.0f)
        };
 
+       const int                                               numLayers                       = (VK_IMAGE_VIEW_TYPE_3D == caseDef.imageType ? caseDef.renderSize.z() : caseDef.numLayers);
        const VkDeviceSize                              colorBufferSize         = caseDef.renderSize.x() * caseDef.renderSize.y() * caseDef.renderSize.z() * caseDef.numLayers * tcu::getPixelSize(mapVkFormat(caseDef.colorFormat));
        const Unique<VkBuffer>                  colorBuffer                     (makeBuffer(vk, device, colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT));
        const UniquePtr<Allocation>             colorBufferAlloc        (bindBuffer(vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
 
        const Unique<VkShaderModule>    vertexModule            (createShaderModule                     (vk, device, context.getBinaryCollection().get("vert"), 0u));
        const Unique<VkShaderModule>    fragmentModule          (createShaderModule                     (vk, device, context.getBinaryCollection().get("frag"), 0u));
-       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                         (vk, device, caseDef.colorFormat, static_cast<deUint32>(caseDef.numLayers)));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                         (vk, device, caseDef.colorFormat, static_cast<deUint32>(numLayers)));
        const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout                     (vk, device));
        vector<SharedPtrVkPipeline>             pipeline;
        const Unique<VkCommandPool>             cmdPool                         (makeCommandPool  (vk, device, queueFamilyIndex));
@@ -583,14 +588,15 @@ tcu::TestStatus test (Context& context, const CaseDef caseDef)
 
        //create colorImage
        {
+               const VkImageViewCreateFlags    flags                   = (VK_IMAGE_VIEW_TYPE_3D == caseDef.imageType ? (VkImageViewCreateFlags)VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR : (VkImageViewCreateFlags)0);
                const VkImageUsageFlags                 colorImageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
-               colorImage = makeImage(vk, device, VkImageViewCreateFlags(0), getImageType(caseDef.imageType), caseDef.colorFormat, caseDef.renderSize, caseDef.numLayers, colorImageUsage);
+               colorImage = makeImage(vk, device, flags, getImageType(caseDef.imageType), caseDef.colorFormat, caseDef.renderSize, caseDef.numLayers, colorImageUsage);
                colorImageAlloc = bindImage(vk, device, allocator, *colorImage, MemoryRequirement::Any);
        }
 
        //create vertexBuffer
        {
-               const vector<Vertex4RGBA>       vertices                        = genFullQuadVertices(caseDef.numLayers, vector<Vec4>(color, color + DE_LENGTH_OF_ARRAY(color)));
+               const vector<Vertex4RGBA>       vertices                        = genFullQuadVertices(numLayers, vector<Vec4>(color, color + DE_LENGTH_OF_ARRAY(color)));
                const VkDeviceSize                      vertexBufferSize        = sizeInBytes(vertices);
 
                vertexBuffer            = makeBuffer(vk, device, vertexBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
@@ -600,22 +606,24 @@ tcu::TestStatus test (Context& context, const CaseDef caseDef)
        }
 
        //create attachmentHandles and pipelines
-       for (int layerNdx = 0; layerNdx < caseDef.numLayers; ++layerNdx)
+       for (int layerNdx = 0; layerNdx < numLayers; ++layerNdx)
        {
-               colorAttachments.push_back(makeSharedPtr(makeImageView(vk, device, *colorImage,
-                                                                                                                         (caseDef.imageType == VK_IMAGE_VIEW_TYPE_CUBE || caseDef.imageType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY ? VK_IMAGE_VIEW_TYPE_2D : caseDef.imageType),
-                                                                                                                         caseDef.colorFormat, makeColorSubresourceRange(layerNdx, 1))));
+               const VkImageViewType   imageType = (VK_IMAGE_VIEW_TYPE_3D == caseDef.imageType ? VK_IMAGE_VIEW_TYPE_2D_ARRAY :
+                                                                                       (VK_IMAGE_VIEW_TYPE_CUBE == caseDef.imageType || VK_IMAGE_VIEW_TYPE_CUBE_ARRAY == caseDef.imageType ? VK_IMAGE_VIEW_TYPE_2D :
+                                                                                       caseDef.imageType));
+
+               colorAttachments.push_back(makeSharedPtr(makeImageView(vk, device, *colorImage, imageType, caseDef.colorFormat, makeColorSubresourceRange(layerNdx, 1))));
                attachmentHandles.push_back(**colorAttachments.back());
 
                pipeline.push_back(makeSharedPtr(makeGraphicsPipeline(vk, device, *pipelineLayout, *renderPass, *vertexModule, *fragmentModule,
                                                                                                                          caseDef.renderSize, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, static_cast<deUint32>(layerNdx))));
        }
 
-       framebuffer = makeFramebuffer(vk, device, *renderPass, caseDef.numLayers, &attachmentHandles[0], static_cast<deUint32>(caseDef.renderSize.x()), static_cast<deUint32>(caseDef.renderSize.y()));
+       framebuffer = makeFramebuffer(vk, device, *renderPass, numLayers, &attachmentHandles[0], static_cast<deUint32>(caseDef.renderSize.x()), static_cast<deUint32>(caseDef.renderSize.y()));
 
        beginCommandBuffer(vk, *cmdBuffer);
        {
-               const vector<VkClearValue>      clearValues                     (caseDef.numLayers, getClearValue(caseDef.colorFormat));
+               const vector<VkClearValue>      clearValues                     (numLayers, getClearValue(caseDef.colorFormat));
                const VkRect2D                          renderArea                      =
                {
                        makeOffset2D(0, 0),
@@ -638,7 +646,7 @@ tcu::TestStatus test (Context& context, const CaseDef caseDef)
        }
 
        //cmdDraw
-       for (deUint32 layerNdx = 0; layerNdx < static_cast<deUint32>(caseDef.numLayers); ++layerNdx)
+       for (deUint32 layerNdx = 0; layerNdx < static_cast<deUint32>(numLayers); ++layerNdx)
        {
                if (layerNdx != 0)
                        vk.cmdNextSubpass(*cmdBuffer, VK_SUBPASS_CONTENTS_INLINE);
@@ -757,6 +765,7 @@ void addTestCasesWithFunctions (tcu::TestCaseGroup* group)
                { VK_IMAGE_VIEW_TYPE_1D_ARRAY,          IVec3(54,  1, 1),       4,              VK_FORMAT_UNDEFINED},
                { VK_IMAGE_VIEW_TYPE_2D,                        IVec3(22, 64, 1),       1,              VK_FORMAT_UNDEFINED},
                { VK_IMAGE_VIEW_TYPE_2D_ARRAY,          IVec3(22, 64, 1),       4,              VK_FORMAT_UNDEFINED},
+               { VK_IMAGE_VIEW_TYPE_3D,                        IVec3(22, 64, 7),       1,              VK_FORMAT_UNDEFINED},
                { VK_IMAGE_VIEW_TYPE_CUBE,                      IVec3(35, 35, 1),       6,              VK_FORMAT_UNDEFINED},
                { VK_IMAGE_VIEW_TYPE_CUBE_ARRAY,        IVec3(35, 35, 1),       2*6,    VK_FORMAT_UNDEFINED},
        };
index 106b522..3168566 100644 (file)
@@ -85798,6 +85798,10 @@ dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r32_uint
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r16g16_sint
 dEQP-VK.pipeline.render_to_image.2d_array.22x64_4.r32g32b32a32_sfloat
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r8g8b8a8_unorm
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r32_uint
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r16g16_sint
+dEQP-VK.pipeline.render_to_image.3d.22x64x7.r32g32b32a32_sfloat
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r32_uint
 dEQP-VK.pipeline.render_to_image.cube.35x35_6.r16g16_sint
@@ -134223,6 +134227,13 @@ dEQP-VK.geometry.layered.cube_array.render_different_content
 dEQP-VK.geometry.layered.cube_array.fragment_layer
 dEQP-VK.geometry.layered.cube_array.invocation_per_layer
 dEQP-VK.geometry.layered.cube_array.multiple_layers_per_invocation
+dEQP-VK.geometry.layered.3d.render_to_default_layer
+dEQP-VK.geometry.layered.3d.render_to_one
+dEQP-VK.geometry.layered.3d.render_to_all
+dEQP-VK.geometry.layered.3d.render_different_content
+dEQP-VK.geometry.layered.3d.fragment_layer
+dEQP-VK.geometry.layered.3d.invocation_per_layer
+dEQP-VK.geometry.layered.3d.multiple_layers_per_invocation
 dEQP-VK.geometry.instanced.draw_1_instances_1_geometry_invocations
 dEQP-VK.geometry.instanced.draw_1_instances_2_geometry_invocations
 dEQP-VK.geometry.instanced.draw_1_instances_8_geometry_invocations
index 6eaeaf7..fb9be8e 100644 (file)
@@ -875,6 +875,7 @@ typedef enum VkImageCreateFlagBits {
     VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
     VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008,
     VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010,
+    VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020,
     VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
 } VkImageCreateFlagBits;
 typedef VkFlags VkImageCreateFlags;